This POST method allows you to create a new sales invoice within the ‘Boekhouding’ (bookkeeping) module of our software.
Notes:
- Maximum 75 invoice lines per invoice allowed.
- If CustomerNumber is used to identify the customer, the parameters CustomerName and CustomerEmail will be ignored.
- If CustomerName or CustomerEmail is used to identify the customer, and you have multiple customers that match, we will use the first found match.
- The parameters CustomerName and CustomerEmail can also be used combined. When both parameters are submitted, the system will search for relations where both name and e-mail match with the submitted parameters.
- You must add at least one invoice line.
- Request
- Response
Parameters
CustomerNumber **
Integer
Details
The customer, identified by its customer number, to be associated with the invoice
CustomerName **
String
Details
The customer, identified by its name, to be associated with the invoice
CustomerEmail **
String
Details
The customer, identified by its e-mailaddress, to be associated with the invoice
InvoiceDate
Date String (dd-MM-yyyy)
Details
The invoice date in format dd-MM-yyyy. (http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html) Defaults to current date.
InvoiceNumber
Long
Details
An optional invoice number. Please note this number MUST be unique.
InvoiceNotes
String
Details
The invoice description
InvoiceFileUrl
String
Details
A file URL containing the file to be attached to the invoice. The file will be downloaded and added as attachment to the invoice. If the file is not downloadable, the invoice will still be created but without attachment. The file URL must end with one of the following file extensions in order for it to be added to the invoice: .jpg, .png, .pdf, .doc, .docx, .gif
InvoiceProject
String
Details
The project by either projectnumber or project name to be associated with the invoide
SelectProjectBy
String
Details
Allowed values: NAME or NUMBER. Determines wether the value in the parameter 'InvoiceProject' is the projectname or projectnumber.
Invoice_InvoiceLine *
Array
Details
An JSON array of invoice lines. At least one record must be present.
Invoice_InvoiceLine > TaxPc **
Float
Details
Numeric representation of the tax % to be applied for this invoice line. Please note that this percentage must be available within your Silvasoft administration.
Invoice_InvoiceLine > TaxCode **
String
Details
The tax code to apply to this invoice line. For example if you have multiple tax codes with the same percentage, you can identify a specific tax code with this parameter.
Invoice_InvoiceLine > SubTotalInclTax *
Float
Details
The invoice line subtotal, including taxes. We will automatically calculate the totals excluding taxes based on the given tax percentage.
Invoice_InvoiceLine > Description
String
Details
Invoiceline description
Invoice_InvoiceLine > CostCenter
String
Details
The Cost Center for the invoiceline (Dutch: Kostenplaats). If the Cost Center does not exist in your administration, a new one will be created.
Invoice_InvoiceLine > LedgerAccountNumber
String
Details
The ledger accountnumber (Dutch: Grootboekrekeningnummer) to be associated with the invoiceline. The ledger account must be present in your administration.
CURL Example
1 |
curl -X POST -H "Content-Type: application/json" -H "ApiKey: b7d343Bnhd436f3ec3bd3504582" -H "Username: [email protected]" "https://rest-api.silvasoft.nl/rest/addsalestransaction/" |
Parameters
Response JSON Example
The response order can vary from the parameter order above
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
[{ "InvoiceReference": "", "InvoiceOutstandingAmount": 789.69, "InvoiceNotes": "Invoices created from API", "ProjectName": "Pr-123", "ProjectNumber": "1", "InvoiceTotalInclTax": 789.69, "InvoiceType": "BOOKKEEPING", "PackingSlipNotes": "", "CustomerNumber": 1, "InvoiceTaxAmount": 97.29, "InvoiceDueDate": "26-05-2017", "CustomerName": "Demo bedrijf", "InvoiceNumber": 2, "InvoiceDate": "05-05-2017", "InvoiceTotalExclTax": 692.4, "Invoice_Contact": [ { "ContactType": "Invoice", "Email": null, "ContactNotes": null, "FamilyName": "Janssens", "FirstName": "Hendrik", "Phone": null, "Sex": "Man", "LastName": "Janssens", "DefaultContact": true }, { "ContactType": "PackingSlip", "Email": null, "ContactNotes": null, "FamilyName": "Janssens", "FirstName": "Hendrik", "Phone": null, "Sex": "Man", "LastName": "Janssens", "DefaultContact": true } ], "Invoice_Address": [ { "Address_CountryCode": "BE", "Address_Unit": "55", "Address_City": "Antwerpen", "Address_UnitAppendix": "", "AddressType": "InvoiceAddress", "Address_PostalCode": "2018", "Address_Street": "Voorbeeldstraat" }] }] |