Orders GET - json
The call is used for retrieving orders created in the CloudSuite webshop. You can fetch an order list and individual orders.
Get order list
Retrieves a list of orders from the CloudSuite database. The result is a paginated order list. More information on the order flow can be checked at Order JSON orderflow - states
State = confirmed; is the best option for getting orders to be processed in the order flow
In order to exclude the offline orders you can add the parameter offline=false
to the URL
It is also possible to including a timespan to retrieve the orders. Best is to get the orders based on confirm_date. By including a gte (greater than equal) or lte (lower than equal) parameter
Example:
Retrieving all orders since 23-10-2024 / 06.00 AM
https://test.cloudsuite.io/api/order/?state=confirmed&confirm_date__gte=2024-10-23T06:00:00
Retrieving all order until 22-10-2024 / 18.00 PM
https://test.cloudsuite.io/api/order/?state=confirmed&confirm_date__lte=2024-10-22T18:00:00
Retrieving order by external key. Add ext: before the key
/api/order/ext:<key>
Retrieving order by id
/api/order/{id}
URL
GET /api/order/
Fields
Field | Value | Remarks |
---|---|---|
count | Number of orders for this result |
|
next | Next page of results |
|
previous | Previous page of results |
|
results | Order object |
|
results - id | ID of the order | Can be used to get order details. |
results - reference | CloudSuite reference |
|
results - customer_order_number | Customer order number | Entered by the end-user during the ordering in the checkout. |
results - erp_order_number | The ERP number of the order | Must be sent by the ERP system to CloudSuite. |
results - state | The order status |
|
results - order_date | The sale date |
|
results - create_date | Creation date | This is not the sale date |
results - modified_date | Last modified date |
|
Response
{
"count": 26,
"next": "https://test.cloudsuite.io/api/order/?limit=5&offset=10",
"previous": "https://test.cloudsuite.io/api/order/?limit=5",
"results": [
{
"id": 6,
"reference": "CS6",
"customer_order_number": null,
"erp_order_number": null,
"state": "confirmed",
"order_date": "2020-09-09",
"create_date": "2020-09-09T13:44:42.733072",
"modified_date": "2020-09-09T13:44:43.295899"
},
...
{
"id": 7,
"reference": "CS7",
"customer_order_number": "Test",
"erp_order_number": null,
"state": "confirmed",
"order_date": "2020-09-09",
"create_date": "2020-09-09T14:56:16.858569",
"modified_date": "2020-09-09T14:56:17.314175"
}
]
}
Get Order
The shipment_address, invoice_address, user and customer keys are returned with an ID.
The corresponding info can be retrieved by adding the related ID to the endpoint.
GET /api/address/{id}?inactive=true → GET /api/origin/{origin}/address/{key from previous call}
GET /api/user/{id}?inactive=true → GET /api/origin/{origin}/user/{key from previous call}
GET /api/customer/{id}?inactive=true → GET /api/origin/{origin}/customer/{key from previous call}
URL
GET /api/order/{id}
Fields
Field | Value | Remarks |
---|---|---|
id | Unique order ID |
|
reference | The CloudSuite order number |
|
customer_order_number | The reference number the customer has entered for the order |
|
erp_order_number | The ERP order number. Can be set with a PUT of PATCH on the order |
|
state | The state of the order. | Possible states are: |
order_date | Date the order has been placed (YYY-MM-DD) |
|
description | Order description |
|
currency | Currency used in the order |
|
order_lines | Order lines object |
|
order_lines - id | The ID of the orderline |
|
order_lines - product - origin | The origin of the product |
|
order_lines - product - key | The import_key of the product |
|
order_lines - description | The product description |
|
order_lines - type |
|
|
order_lines - quantity | Number of items |
|
order_lines - erp_line_number | The line number of the order given by the ERP system |
|
order_lines - unit_price | Price of the product, excl. tax, one sales unit |
|
order_lines - create_date | Created timestamp of the order |
|
order_lines - delivery_date | The delivery date of the line |
|
order_lines - tax_keys | Array of tax keys of the order line |
|
order_lines - modified_date | Timestamp when the order was last modified |
|
requested_delivery_date | The requested delivery date for the order |
|
paid_amount | Amount paid for this order |
|
shipment_address | ID of the shipment address | /api/address/{id} can be used to get more data. |
shipment_address_key → origin | the origin of the delivery address |
|
shipment_address_key → key | the key of the delivery address |
|
invoice_address | ID of the invoice address | /api/address/{id} can be used to get more data. |
invoice_address_key→ origin | the origin of the invoice address |
|
invoice_address_key→ key | the key of the invoice address |
|
customer | ID of the customer | /api/customer/{id} can be used to get more data. |
customer_key→ origin | the origin of the customer |
|
customer_key→ key | the key of the customer |
|
webshop | ID of the webshop | Can be fixed set of data on the integration side. |
user | ID of the end-user who placed the order | /api/user/{id} can be used to get more data. |
create_date | Creation date of the order | This is not the sale date |
modified_date | Last modified date of the order |
|
Response
{
"id": 27,
"reference": "CS26",
"customer_order_number": "def",
"erp_order_number": "ERP1",
"state": "confirmed",
"order_date": "2020-09-24",
"description": "Description",
"currency": "EUR",
"order_lines": [
{
"id": 50,
"product": {
"origin": "CLOUDSUITE",
"key": "1000"
},
"description": "[1000] Bicycle for Cloudsuite",
"type": "line",
"quantity": 1,
"erp_line_number": 10,
"unit_price": "19.99",
"delivery_date": "2024-04-23",
"tax_keys": [
"1000-waste",
"21"
],
"create_date": "2020-10-26T14:38:48.755771",
"modified_date": "2020-10-26T14:57:14.772521"
}
],
"requested_delivery_date": "2020-10-26",
"paid_amount": "0",
"shipment_address": 4,
"shipment_address_key": {
"key": "123456789-D",
"origin": "CLOUDSUITE"
},
"invoice_address": 5,
"invoice_address_key": {
"key": "123456789-I",
"origin": "CLOUDSUITE"
},
"customer": 54,
"customer_key": {
"key": "C123456",
"origin": "CLOUDSUITE"
},
"webshop": 1,
"user": 14,
"create_date": "2020-10-26T14:38:48.755771",
"modified_date": "2020-10-26T14:57:14.772521"
}
Related content
© 2024 CloudSuite BV, All rights reserved