Order JSON orderflow - states
How to handle webshop orders.
Handle webshop orders
Get orders with filter (State = “confirmed” or other criteria)
State = confirmed; is the best option for getting orders to be processed in the order flow.
Also check the payment status if there is an payment option in the site!
check the payment_status state. Can be one of the following options:
closed_success → successful payment
closed_canceled → no payment
started → no payment
paid → successful payment
account → no payment needed, order is invoiced afterwards
none → no payment
Example:
GET /api/order/?confirm_date__gte=2021-06-29T00:00:00&state=confirmed
2. Process order in ERP
3. Set state to “processing“*
If the ID is unknown you can get it by using:
/api/order/?reference=<CloudSuite reference>
and get the ID from the results. If multiple reacrds are returned also add the webshop as a parameter.
Example:
PATCH /api/order/12345/
{
"state" : "processing"
}
When sending DESADV’s / packingslips also the ERP ordernumber and lines must be send. The DESADV’s / packingslips need this to match the order and order lines
it is also possible to send in the cXML order confirmation. Step 3b/c are then replaced by Order incoming - feedback - cXML
3b. Update ERP number
Example:
PATCH /api/order/12345/
{
"erp_order_number" : "ERP-124578"
}
3c. Update ERP orders lines
Example:
PUT /api/order/12345/
{
"reference": "CS48193",
"customer": 1324,
"erp_order_number": "123456789",
"state": "confirmed",
"currency": "EUR",
"order_lines": [
{
"product": {
"key": "124_STUK",
"origin": "myorigin"
},
"description": "My description",
"type": "line",
"quantity": 1.0,
"erp_line_number": 11
},
{
"product": {
"key": "123_KG",
"origin": "myorigin"
},
"description": "My description 2",
"type": "line",
"quantity": 2.0,
"erp_line_number": 22
}
],
"shipment_address": 1695,
"invoice_address": 1652,
"webshop": 1,
"user": 1260
}
3d. Send packing-slip info with DESADV call (optional)
4. Set orders with shipment_state=”sent” when you don';t sent a delivery (DESADV)
Request:
PATCH /api/order/12345/
{
"shipment_state" : "sent"
}
You may set the state=done or shipment_state = sent if there is no communication with deliveries.
OFFLINE orders
Offline orders can set to shipment-state is sent.
Set orders with shipment_state=”sent”
Request:
PATCH /api/order/12345/
{
"shipment_state" : "sent"
}
Related content
© 2024 CloudSuite BV, All rights reserved