Saved Invoices API
To manage your saved invoices, you can use the following commands.
To create a saved invoice, use the Invoices API.
Description | Method | URL |
---|---|---|
Get all saved invoices | GET | /api/v1/invoices_saved/ |
Get one saved invoice | GET | /api/v1/invoices_saved/{id or invoicenr} |
Delete saved invoice | DELETE | /api/v1/invoices_saved/{id or invoicenr} |
Send saved invoice(s) | POST | /api/v1/invoices_saved/ |
All attributes used for saved invoices
Attribute | Type | Note |
---|---|---|
idread only | integer | Unique invoice id |
nameread only | string(20) | Unique name for the invoice |
referenceread only | object | Contains reference lines on the invoice. 'line1', 'line2', 'line3'. All are strings. |
linesread only | array | All invoice lines on the invoice Per line: 'amount' 'amount_desc' 'description' 'tax_rate' 'price' 'discount_pct' (discount percentage) 'tax_country' (boolean, input only)* 'linetotal' (read only) if you want to use a foreign tax for this line, set this to true. Read more To use text lines on an invoice, only supply 'description' and do not use the other fields. Check the example below for more info. |
profileread only | id | The ID of the used profile. Default is default profile. |
discounttyperead only | string(10) | The type of discount. 'amount' or 'percentage' |
discountread only | float | If 'discounttype' is amount, then this is the amount of discount set on the invoice. If 'discounttype' is set to 'percentage', this is the discount percentage set. |
paymentconditionread only | string | The payment condition set on the invoice. Default is the payment condition set in the application. |
paymentperiodread only | integer | Term of payment in days. Default is the payment period set with the client. |
totaldiscountread only | float | The total amount of discount set |
totalintaxread only | float | Invoice total including taxes |
alreadypaidread only | float | The amount that is already marked as paid on the invoice |
alreadypaidmethodread only | string(32) | The payment method of the part that is already paid |
clientnrread only | integer | Client number |
contactread only | string(50) | |
companyread only | string(50) | |
addressread only | string(50) | |
zipcoderead only | string(7) | |
cityread only | string(50) | |
countryread only | integer or string | Country id. You can get a list of country id's with the function api/v1/countrylist. When creating or updating a client, you can supply a country id or a country name. We'll then try to find the id of the country you supplied. |
Send a saved invoice
You can send one or multiple saved invoice directly with a simple API call.
POST /api/v1/saved_invoices/
When posting this call, we need a few attributes in the body, please check the example below for more info.
Attribute | Type | Note |
---|---|---|
actionrequired | string(4) | "send" is the only option at the moment |
deleterequired | boolean | if the saved invoices must be deleted after sending |
idrequired | array | array of ids that we need to send. (max 10 id's per call) |
Example
This is example, we will be sending 5 saved invoices.
Be aware: sending invoices can take some time. Around 1,5 sec per invoice. Please do not send multiple calls at once and wait until the call is finished before sending the next.
{
"action": "send",
"delete": true,
"id": [252, 253, 254, 259, 1337]
}