Process Orders
Set the 'order_state_codes' parameter to 'WAITING_ACCEPTANCE' to get new orders.
See OR11 - List Orders
Typically this step involves a stock check on your side to confirm if you have the inventory on hand to fulfill this order. If you can fulfill this order, accept it, and if you cannot then reject it.
Note if you reject it, the order flow is complete. In addition, your inventory will be set to 0 in your store and the item will automatically be removed from our site to prevent future orders from being placed until you replenish stock.
You can cancel an order after it has been accepted, up to the point of shipment. Once cancelled, the order flow is complete.
A use case would be if you did an inventory check in step 2, and accepted the order, but later discover that you actually don't have enough to fulfill, or the shipping address is invalid, or the item breaks when packing and you can't replace it.
See OR29 - Cancel an Order
Retrieve the packing slip and include it with the customer's shipment.
Set the 'document_codes' parameter to 'SYSTEM_DELIVERY_BILL' to filter on the packing slip document type.
See OR73 - Get Packing Slip
Add the carrier info and tracking number used to ship the order.
Once the order has been shipped, the final step is to confirm the shipment, which marks it complete by you.
To obtain orders that have been refunded/returned, use API OR11 and in the response look for the refunds object under orders.order_lines.refunds
To retrieve the reason for the refund, capture the reason code from the API OR11 response at orders.order_lines.refunds.reason_code, then use the reason code with API RE01 to get the details.
See OR11 - List Orders and RE01 - List Reasons