The Order Endpoints
These endpoints allow you to Create, Get or Patch (Update) orders.
More and extra info about the order object can be found below.
Orders
With our API you can create Invoices, Creditnotes, Offers, .... Just take a look at our different endpoints below.
When creating an invoice these are some minimal required fields that you have to provide the API.
Field | Value | Definition |
---|---|---|
OrderType | Types | This to define the type invoice |
OrderDirection | Types | This to define the direction of the invoice |
OrderDate | DateTime | Date of the invoice |
ExpiryDate | DateTime | Date when the invoice expiries |
Orderlines | --Orderlines-- | The lines with items on the invoice |
CustomerID / Customer object | INT / Customer object | This to know who you are sending the invoice too or who its from |
You can see we did do not expect you to provide your own data since we already have this in our system.
Below you can find the "application/json" version of the table above.
{
"OrderType": "Invoice",
"OrderDirection": "Income",
"OrderDate": "2022-01-01",
"ExpiryDate": "2022-01-31",
"OrderLines": [
{
"ProductID": {{productID}}
}
],
"CustomerID": {{customerID}}
}
Or without using IDs.
{
"OrderType": "Invoice",
"OrderDirection": "Income",
"OrderDate": "2022-01-01",
"ExpiryDate": "2022-01-31",
"OrderLines": [
{
"Quantity": 1,
"UnitPriceExcl": 100.0,
"Description": "my order line",
"VATPercentage": 21.0
}
],
"Customer": {
"Name": "Billit",
"VATNumber": "BE0563846944",
"PartyType": "Customer",
}
}
{
"OrderPDF": {
"FileName": "Invoice-200.pdf",
"FileContent": "BASE64STRING"
},
"OrderNumber": "Invoice-200",
"Customer": {
"Nr": "Cus-001",
"Name": "Billit Bird",
"Street": "Piazza del Miracolli",
"Zipcode": "56126",
"City": "Pisa PI",
"CountryCode": "IT",
"VATNumber": "IT01394200362",
"PartyType": "Customer",
"Identifiers": [
{ "IdentifierType": "SDICODFIS", "Identifier": "" },
{ "IdentifierType": "SDICODDEST", "Identifier": "3PRL4IK" },
{ "IdentifierType": "SDIPEC", "Identifier": "" }
]
},
"OrderDate": "2023-01-01T00:00:00",
"ExpiryDate": "2023-02-01T00:00:00",
"OrderType": "Invoice",
"OrderDirection": "Income",
"OrderLines": [
{
"Quantity": 1.0,
"UnitPriceExcl": 0.45,
"Description": "API License",
"VATPercentage": 22.0,
}
],
"Paid": true/false,
"Currency": "EUR"
}
Customer/Supplier object
- When creating an order or retrieving it some of these objects are available.
Below you can see which have to be in the Order object for each Order direction(Types). Billit will take the company information for the Direction used and set it automatically.
Order Direction | Party Object |
---|---|
Income | Customer |
Cost | Supplier |
There are 2 options on how to add these objects.
Using the PartyID
-
The PartyID is a unique ID, you can retrieve this ID in multiple ways.
More info on how to find PartyID Where can I find my CompanyID or a PartyID -
You can also provide the IDs like the example below, you will have to check which one you need from the table above.
{
"CustomerID": 0,
"SupplierID": 0,
//Other Order data...
}
Using the party object
-
The party object is same one used when using the Party Endpoint. You can find more info here on how to create an party object here Parties.
-
You can use the created object as the following code below describes.
"Customer" can also be "Supplier" here
{
//Other order data...
"Customer": {
"Nr": "string",
"Name": "string",
"CommercialName": "string",
//Other party data...
}
}
Order PDF/Attachment
The order object contains the OrderPDF object. You can see the usage and structure of that Object below
"OrderPDF": {
"FileID": "00000000-0000-0000-0000-000000000000",
"FileName": "string",
"MimeType": "string",
"FileContent": "string"
}
Property Name | Property Value | Required |
---|---|---|
FileID | String | No, Ignore in POST |
FileName | String | Yes |
MimeType | String | No, if type is in filename |
FileContent | FileBase64 String | Yes |
The order object also contains a similar object "Attachments" the usage is the same. This can contain extra files that have to be added to the particular Invoice
Full API Request JSON Example
Endpoint | Method | Response |
---|---|---|
/v1/orders | Post | INT (Unique OrderID) |
{
"OrderType": "Invoice",
"OrderDirection": "Income",
"OrderNumber": "QS-001",
"OrderDate": "2024-01-01",
"ExpiryDate": "2024-01-31",
"Customer": {
"Name": "Billit",
"VATNumber": "BE0563846944",
"PartyType": "Customer",
"Identifiers": [
{
"IdentifierType": "GLN",
"Identifier": "5430003732007"
}
],
"Addresses": [
{
"AddressType": "InvoiceAddress",
"Name": "Billit",
"Street": "Oktrooiplein",
"StreetNumber": "1",
"City": "Ghent",
"Box": "301",
"CountryCode": "BE"
},
{
"AddressType": "DeliveryAddress", //The delivery address, if not provided will be automatically the same as invoice address
"Name": "Billit",
"Street": "Oktrooiplein",
"StreetNumber": "1",
"City": "Ghent",
"Box": "301",
"CountryCode": "BE"
}
]
},
"OrderLines": [
{
"Quantity": 1,
"UnitPriceExcl": 10.0,
"Description": "Box of cookies",
"VATPercentage": 6
},
{
"Quantity": 2,
"UnitPriceExcl": 3.75,
"Description": "Sticks",
"VATPercentage": 21
}
]
}