Okay, so I may have misunderstood. You’re at the point where you need to figure out how to GET the information from the API, correct? It’s not that you’ve already gotten the information and just need help saving/converting it.
I may be able to help with that.
This section of the documentation includes the GET command for invoices:
https://restdocs.e-conomic.com/#invoices
It only lists javascript which I’m not all that familiar with. The documentation is pretty limited compared to some APIs I’ve used. There aren’t example of how to create REST calls which is what I typically use and there aren’t examples of the JSON result which is really unfortunate because that’s the main thing I need to know to help you with the next steps. But it’s possible we can still get this to work.
Based on the javascript:
$.ajax({
url: "https://restapi.e-conomic.com/invoices",
dataType: "json",
headers: {
'X-AppSecretToken': "demo",
'X-AgreementGrantToken': "demo",
'Content-Type': "application/json"
},
type: "GET"
})
.always(function (data) {
$("#output").text(JSON.stringify(data, null, 4));
});
It looks like you’ll need a secret token and grant token. It appears you can use “demo” for both so that’s good.
Edit: Oh! Perfect! They have a demo url:
https://restapi.e-conomic.com/invoices?demo=true
It returns this JSON:
{"drafts":"https://restapi.e-conomic.com/invoices/drafts?demo=true","booked":"https://restapi.e-conomic.com/invoices/booked?demo=true","paid":"https://restapi.e-conomic.com/invoices/paid?demo=true","unpaid":"https://restapi.e-conomic.com/invoices/unpaid?demo=true","overdue":"https://restapi.e-conomic.com/invoices/overdue?demo=true","notDue":"https://restapi.e-conomic.com/invoices/not-due?demo=true","sent":"https://restapi.e-conomic.com/invoices/sent?demo=true","totals":"https://restapi.e-conomic.com/invoices/totals?demo=true","self":"https://restapi.e-conomic.com/invoices?demo=true"}
Which when formatted at https://jsonformatter-online.com looks like this:
The “paid” url (https://restapi.e-conomic.com/invoices/paid?demo=true) generates a long JSON response:
{"collection":[{"bookedInvoiceNumber":42,"date":"2020-04-07","currency":"DKK","exchangeRate":100.000000,"netAmount":0.00,"netAmountInBaseCurrency":0.00,"grossAmount":0.00,"grossAmountInBaseCurrency":0.00,"vatAmount":0.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2020-04-15","paymentTerms":{"paymentTermsNumber":1,"daysOfCredit":8,"name":"Netto 8 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/1?demo=true"},"customer":{"customerNumber":12345678,"self":"https://restapi.e-conomic.com/customers/12345678?demo=true"},"recipient":{"name":"Test Firma A/S","address":"Testvej 4","zip":"7100","city":"Vejle","country":"Danmark","attention":{"customerContactNumber":501,"self":"https://restapi.e-conomic.com/customers/12345678/contacts/501?demo=true"},"vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"notes":{"textLine1":"Booked af Henry - hb@incaptiva.dk"},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/42/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/42/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/42?demo=true"},{"bookedInvoiceNumber":10001,"date":"2011-10-10","currency":"DKK","exchangeRate":100.000000,"netAmount":100000.00,"netAmountInBaseCurrency":100000.00,"grossAmount":125000.00,"grossAmountInBaseCurrency":125000.00,"vatAmount":25000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-11-09","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10001/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10001/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10001?demo=true"},{"bookedInvoiceNumber":10002,"date":"2011-10-31","currency":"DKK","exchangeRate":100.000000,"netAmount":50000.00,"netAmountInBaseCurrency":50000.00,"grossAmount":62500.00,"grossAmountInBaseCurrency":62500.00,"vatAmount":12500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-11-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10002/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10002/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10002?demo=true"},{"bookedInvoiceNumber":10003,"date":"2011-11-20","currency":"DKK","exchangeRate":100.000000,"netAmount":150000.00,"netAmountInBaseCurrency":150000.00,"grossAmount":187500.00,"grossAmountInBaseCurrency":187500.00,"vatAmount":37500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-12-20","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10003/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10003/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10003?demo=true"},{"bookedInvoiceNumber":10004,"date":"2011-11-30","currency":"DKK","exchangeRate":100.000000,"netAmount":120000.00,"netAmountInBaseCurrency":120000.00,"grossAmount":150000.00,"grossAmountInBaseCurrency":150000.00,"vatAmount":30000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-12-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1007,"self":"https://restapi.e-conomic.com/customers/1007?demo=true"},"recipient":{"name":"Andersens Eftf. A/S","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10004/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10004/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10004?demo=true"},{"bookedInvoiceNumber":10005,"date":"2011-12-20","currency":"DKK","exchangeRate":100.000000,"netAmount":150000.00,"netAmountInBaseCurrency":150000.00,"grossAmount":187500.00,"grossAmountInBaseCurrency":187500.00,"vatAmount":37500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-01-19","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10005/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10005/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10005?demo=true"},{"bookedInvoiceNumber":10006,"date":"2012-02-28","currency":"DKK","exchangeRate":100.000000,"netAmount":160000.00,"netAmountInBaseCurrency":160000.00,"grossAmount":200000.00,"grossAmountInBaseCurrency":200000.00,"vatAmount":40000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-03-29","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1003,"self":"https://restapi.e-conomic.com/customers/1003?demo=true"},"recipient":{"name":"Storeskolen","address":"Byvej 4","zip":"3450","city":"Allerød","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10006/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10006/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10006?demo=true"},{"bookedInvoiceNumber":10007,"date":"2012-03-31","currency":"DKK","exchangeRate":100.000000,"netAmount":250000.00,"netAmountInBaseCurrency":250000.00,"grossAmount":312500.00,"grossAmountInBaseCurrency":312500.00,"vatAmount":62500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-04-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10007/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10007/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10007?demo=true"},{"bookedInvoiceNumber":10008,"date":"2012-03-31","currency":"DKK","exchangeRate":100.000000,"netAmount":29350.00,"netAmountInBaseCurrency":29350.00,"grossAmount":36687.50,"grossAmountInBaseCurrency":36687.50,"vatAmount":7337.50,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-04-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1004,"self":"https://restapi.e-conomic.com/customers/1004?demo=true"},"recipient":{"name":"Lilleskolen","address":"Gl. Kongevej 121","zip":"2850","city":"Nærum","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10008/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10008/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10008?demo=true"},{"bookedInvoiceNumber":10009,"date":"2012-05-31","currency":"DKK","exchangeRate":100.000000,"netAmount":175000.00,"netAmountInBaseCurrency":175000.00,"grossAmount":218750.00,"grossAmountInBaseCurrency":218750.00,"vatAmount":43750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-06-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10009/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10009/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10009?demo=true"},{"bookedInvoiceNumber":10010,"date":"2012-06-30","currency":"DKK","exchangeRate":100.000000,"netAmount":202500.00,"netAmountInBaseCurrency":202500.00,"grossAmount":253125.00,"grossAmountInBaseCurrency":253125.00,"vatAmount":50625.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-07-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10010/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10010/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10010?demo=true"},{"bookedInvoiceNumber":10011,"date":"2012-06-30","currency":"DKK","exchangeRate":100.000000,"netAmount":250000.00,"netAmountInBaseCurrency":250000.00,"grossAmount":312500.00,"grossAmountInBaseCurrency":312500.00,"vatAmount":62500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-07-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10011/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10011/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10011?demo=true"},{"bookedInvoiceNumber":10012,"date":"2012-06-30","currency":"DKK","exchangeRate":100.000000,"netAmount":75000.00,"netAmountInBaseCurrency":75000.00,"grossAmount":93750.00,"grossAmountInBaseCurrency":93750.00,"vatAmount":18750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-07-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1002,"self":"https://restapi.e-conomic.com/customers/1002?demo=true"},"recipient":{"name":"Ejendomsmæglerne BoBedre","address":"Bymidten 2","zip":"3600","city":"Frederikssund","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10012/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10012/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10012?demo=true"},{"bookedInvoiceNumber":10013,"date":"2012-09-30","currency":"DKK","exchangeRate":100.000000,"netAmount":18000.00,"netAmountInBaseCurrency":18000.00,"grossAmount":22500.00,"grossAmountInBaseCurrency":22500.00,"vatAmount":4500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-10-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10013/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10013/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10013?demo=true"},{"bookedInvoiceNumber":10014,"date":"2012-09-30","currency":"DKK","exchangeRate":100.000000,"netAmount":125000.00,"netAmountInBaseCurrency":125000.00,"grossAmount":156250.00,"grossAmountInBaseCurrency":156250.00,"vatAmount":31250.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-10-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1002,"self":"https://restapi.e-conomic.com/customers/1002?demo=true"},"recipient":{"name":"Ejendomsmæglerne BoBedre","address":"Bymidten 2","zip":"3600","city":"Frederikssund","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10014/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10014/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10014?demo=true"},{"bookedInvoiceNumber":10015,"date":"2012-11-30","currency":"DKK","exchangeRate":100.000000,"netAmount":60000.00,"netAmountInBaseCurrency":60000.00,"grossAmount":75000.00,"grossAmountInBaseCurrency":75000.00,"vatAmount":15000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-12-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10015/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10015/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10015?demo=true"},{"bookedInvoiceNumber":10016,"date":"2012-11-30","currency":"DKK","exchangeRate":100.000000,"netAmount":95000.00,"netAmountInBaseCurrency":95000.00,"grossAmount":118750.00,"grossAmountInBaseCurrency":118750.00,"vatAmount":23750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-12-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1004,"self":"https://restapi.e-conomic.com/customers/1004?demo=true"},"recipient":{"name":"Lilleskolen","address":"Gl. Kongevej 121","zip":"2850","city":"Nærum","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10016/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10016/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10016?demo=true"},{"bookedInvoiceNumber":10017,"date":"2012-12-31","currency":"DKK","exchangeRate":100.000000,"netAmount":155000.00,"netAmountInBaseCurrency":155000.00,"grossAmount":193750.00,"grossAmountInBaseCurrency":193750.00,"vatAmount":38750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2013-01-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10017/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10017/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10017?demo=true"},{"bookedInvoiceNumber":10018,"date":"2012-12-31","currency":"DKK","exchangeRate":100.000000,"netAmount":35000.00,"netAmountInBaseCurrency":35000.00,"grossAmount":43750.00,"grossAmountInBaseCurrency":43750.00,"vatAmount":8750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2013-01-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10018/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10018/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10018?demo=true"},{"bookedInvoiceNumber":10019,"date":"2013-01-31","currency":"DKK","exchangeRate":100.000000,"netAmount":135000.00,"netAmountInBaseCurrency":135000.00,"grossAmount":168750.00,"grossAmountInBaseCurrency":168750.00,"vatAmount":33750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2013-03-02","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10019/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10019/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10019?demo=true"}],"pagination":{"maxPageSizeAllowed":1000,"skipPages":0,"pageSize":20,"results":81,"resultsWithoutFilter":81,"firstPage":"https://restapi.e-conomic.com/invoices/paid?demo=true&skippages=0&pagesize=20","nextPage":"https://restapi.e-conomic.com/invoices/paid?demo=true&skippages=1&pagesize=20","lastPage":"https://restapi.e-conomic.com/invoices/paid?demo=true&skippages=4&pagesize=20"},"self":"https://restapi.e-conomic.com/invoices/paid?demo=true"}
Which when formatted looks like this:
And right there at the end is the PDF link (https://restapi.e-conomic.com/invoices/booked/42/pdf?demo=true).
So now it’s just a matter of making a GET command in Thunkable and parsing the JSON data to find that “pdf” property.
You’ll need to get the “download” property of the “pdf” property of the first list item of the “collection” property of the JSON object.
If your head is spinning, welcome to the world of APIs and JSON!!! It took me a good ten hours or so of playing around with this stuff to really start to understand it.