Orders
The Orders-V4 interface allows you to view orders and associated position items. You can send cancellations on order and position item level.
Fulfillment States
A position item can stay in different fulfillment states (attribute: fulfillmentStatus
):
- ANNOUNCED
An ordered position item which shall be reserved for the customer but shall not be shipped yet. The position item can still be cancelled by the marketplace and the customer. The address of the customer is not visible in this state. - PROCESSABLE
This position item is ready to be fulfilled. - SENT
This position item was shipped. It was processed by the Shipments interface. - RETURNED
This position item was returned. It was processed by the Returns interface. - CANCELLED_BY_PARTNER
This position item was cancelled by the partner and won't be processed any further. - CANCELLED_BY_MARKETPLACE
This position item was cancelled by the marketplace and won't be processed any further. In case of a partner termination all position items in state ANNOUNCED or PROCESSABLE will be cancelled.
Possible State Transitions
The position item states determine the whole order's lifecycle state:
- The order will be classified as ANNOUNCED, PROCESSABLE, SENT, or RETURNED if at least one position item is in an analogous state and all other position items have the same or higher state according to above-mentioned list.
- The order will also be classified as CANCELLED_BY_MARKETPLACE or CANCELLED_BY_PARTNER if it has at least one position item in fulfillment state CANCELLED_BY_MARKETPLACE resp. CANCELLED_BY_PARTNER.
The latest lifecycle change is recorded in order attribute lifecycleChangeDate
. You can choose to query by lifecycle state or position item state by using the mode
Cancellation
Position items of an order can be cancelled. These position items must be in state PROCESSABLE or ANNOUNCED.
Partner cancellations in general lead to customer dissatisfaction and should be avoided.
Cancellation is possible for only a single position item or the whole order:
- to cancel a single position item send a POST request
/v4/orders/{salesOrderId}/positionItems/{positionItemId}/cancellation
- to cancel the whole order send a POST request
/v4/orders/{salesOrderId}/cancellation
Every position item which is in fulfillment status PROCESSABLE or ANNOUNCED will be changed to CANCELLED_BY_PARTNER. If there was a cancellation request from the customer the cancellationReason
will be set to CANCELLED_ON_CUSTOMER_WISH
The cancellation operations might take a moment until the result is visible on a subsequent fetch request. Conflicts will be reported in an error response.
Common Use Cases
Fetch open orders
Orders can be constantly created. After the payment confirmation orders change to state PROCESSABLE. Orders can be fetched individually by salesOrderId
/ orderNumber
or as a list by using different filter criteria. To fetch orders after they became processable this REST call can be used
GET /v4/orders?fulfillmentStatus=PROCESSABLE
If there is a next link it can be followed until there are no new orders. To start at a certain date the fromDate can be used, which relates to the lifecycleChangeDate, which in this case is when order became PROCESSABLE.
GET /v4/orders?fulfillmentStatus=PROCESSABLE&orderColumnType=ORDER_LIFECYCLE_DATE&fromDate=2023-07-01T00:00:00Z
This works in a similar way for other status and combinations, for example
GET /v4/orders?fulfillmentStatus=PROCESSABLE,SENT