Orders POST (offline orders) - json
The call is used for posting a new offline order.
Post offline order
URL
POST /api/order/
Fields
Field | Mandatory | Value | Remarks |
---|---|---|---|
id | no | Unique ClouSuite ID of the order | Readonly |
reference | no | The CloudSuite order number | Readonly |
key | no | The key of the order This can be used to use an external key. This key can be used to locate the order with external created keys. /api/order/ext:<key> |
|
customer_order_number | no | The number which the customer has provided in the order |
|
erp_order_number | yes | The ERP order number. Can be set with a PUT of PATCH on the order |
|
state | yes | The state of the order (draft, quotation, confirmed, processing, done, cancel) | |
order_date | yes | Date the order has been placed (YYYY-MM-DD) |
|
description | no | Specified description of the order |
|
currency | yes | Currency of the order |
|
order_lines | yes | Order lines object |
|
order_lines - id | no | The CloudSuite ID of the orderline | Readonly |
order_lines - product - origin | yes | The origin of the product |
|
order_lines - product - key | yes | The import_key of the product |
|
order_lines - description | yes | The product description |
|
order_lines - type | yes | The type of the line. Always must be “line“ |
|
order_lines - quantity | yes | Number of items |
|
order_lines - erp_line_number | yes | The linenumber of the order given by the ERP system |
|
order_lines - unit_price | yes | Price of the product, ex tax, one sales unit |
|
requested_delivery_date | no | The date when the order is requested. |
|
paid_amount | no | Amount that has been paid for this order |
|
shipment_address | yes (1*) | CloudSuite ID of the shipment address | The CloudSuite ID can be retrieved with an extra call to /origin/{origin_code}/address/{key}/ |
shipment_address_key → origin | yes (or 1*) | the origin of the delivery address |
|
shipment_address_key → key | yes (or 1*) | the key of the delivery address |
|
invoice_address | yes (2*) | CloudSuite ID of the invoice address | The CloudSuite ID can be retrieved with an extra call to /origin/{origin_code}/address/{key}/ |
invoice_address_key→ origin | yes (or 2*) | the origin of the invoice address |
|
invoice_address_key→ key | yes (or 2*) | the key of the invoice address |
|
customer | yes (3*) | CloudSuite ID of the customer | The CloudSuite ID can be retrieved with an extra call to /origin/{origin_code}/customer/{key}/ |
customer_key→ origin | yes ( or 3*) | the origin of the customer |
|
customer_key→ key | yes (or 3*) | the key of the customer |
|
webshop | yes | CloudSuite ID of the webshop | Can be fixed set of data on the integration side. |
user | yes | CloudSuite ID of the user who placed the order | /api/user/{id} can be used to get more data. The CloudSuite ID can be retrieved with an extra call to /origin/{origin_code}/user/{key}/ |
Request
Used with customer.id, invoice_address.id and shipment_address.id
{
"id": 27,
"key": "MyOwnKey",
"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": "MYORIGIN",
"key": "1000"
},
"description": "[1000] Bicycle for Cloudsuite",
"type": "line",
"quantity": 1,
"erp_line_number": 10,
"unit_price": "19.99"
}
],
"requested_delivery_date": "2020-10-26",
"paid_amount": "0",
"shipment_address": 4,
"invoice_address": 5,
"customer": 54,
"webshop": 1,
"user": 14
}
Used with customer.key , invoice_address.key and shipment_address.key
{
"id": 27,
"key": "MyOwnKey",
"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": "MYORIGIN",
"key": "1000"
},
"description": "[1000] Bicycle for Cloudsuite",
"type": "line",
"quantity": 1,
"erp_line_number": 10,
"unit_price": "19.99"
}
],
"requested_delivery_date": "2020-10-26",
"paid_amount": "0",
"shipment_address_key": {
"key": "123456-D",
"origin": "MYORIGIN"
},
"invoice_address_key": {
"key": "123456-I",
"origin": "MYORIGIN"
},
"customer_key": {
"key": "123456",
"origin": "MYORIGIN"
},
"webshop": 1,
"user": 14
}
Related content
© 2024 CloudSuite BV, All rights reserved