PUT v3/orders/:id
PUT/v3/orders/:id
Change an order that has not been fully shipped yet.
This endpoint enables a client to make some changes to an existing order within certain limits. The order
cannot be modified after it is fulfilled in its entirety (i.e. there is nothing left to ship). The mutability of the attributes is indicated in the tables below.
Request
When submitting changes for an order, the entire order in its desired state must be submitted; otherwise, the omitted fields may be erased.
Mutable attributes on order level
| attribute | nullable | remarks |
|---|---|---|
externalOrderNumber | no | The new value must also be unique. |
reference | yes | Use an empty string to erase current value. |
consumerReference | yes | Use an empty string to erase current value. |
promotionCode | yes | Use an empty string to erase current value. |
email | yes | When null or omitted, noreply@activeants.nl default will be used. |
locale | no | |
phoneNumber | yes | |
vatNumber | yes | |
fulfillFrom | yes | New warehouseCode must be part of the fulfillment strategy. |
preferredShippingDate | yes | New date must be today or later. |
allowPartialDelivery | yes | When null or omitted, the default for the orderType will take effect. |
onHold | no | |
metadata/* | yes | Note that not providing the full set will erase previous data. |
Immutable attributes on order level
| attribute | remarks |
|---|---|
currency | |
channelIdentifier |
Response
Upon successful modification of the order, the server responds with the complete order resource and related resources in a similar fashion as if invoked by a GET v3/orders/:id?include=orderItems,deliveryAddress,billingAddress,pickUpPoint. It is the responsibility of the caller to validate that the changes made to the order are having the expected results.
Limitations of PUT /v3/orders/:id
When using this endpoint, the following limitations apply:
- Invoking the endpoint requires the use of the
order's resource id. If not known, this can be obtained by invoking theGET v3/orders?filter[externalOrderNumber]={YOUR_ORDER_NUMBER}. - It is not possible to modify the
orderItems. - It is not possible to modify the
deliveryAddress,billingAddress, orpickUpPoint. - It is not possible to modify the related
preferredShippingMethod. - It is not possible to modify the related
orderType.
Request
Responses
- 200
- 401
- 403
- 406
- 415
- 422
Upon successfulmodification of the order the server responds
with the complete order resource and related resources in a similar
fashion as if invoked by a GET v3/orders/{id}?include=orderItems,deliveryAddress,billingAddress,pickUpPoint.
401 Unauthorized
A 401 Unauthorized response occurs when attempting to access a resource or perform an action that requires authentication, but no valid credentials have been provided. It indicates that the requester is unauthorized to access the requested resource.
The following are common scenarios that may lead to a 401 Unauthorized response:
- Attempting to access a protected API endpoint without providing authentication credentials.
- Providing an invalid or expired authentication token.
- Providing valid authentication credentials, but lacking sufficient privileges to access the requested resource.
- Providing authentication credentials that are valid for a different resource or API endpoint than the one being requested.
403 Forbidden
The HTTP 403 Forbidden client error response status code indicates that the server understood the request but refused to process it. This status is similar to 401 Unauthorized, except that for 403 Forbidden responses, authenticating or re-authenticating makes no difference. The request failure is tied to application logic, such as insufficient permissions to a resource or action.
406 Not Acceptable
A 406 Not Acceptable response occurs when the server cannot provide a response that matches the client's requested format or content language for the requested resource. For instance, if a client sends an Accept header of text/html to an API endpoint that only supports application/json responses, the server would respond with a 406 Not Acceptable status code. This type of response is a required response for JSON:API compatible endpoints.
415 Unsupported Media Type
A 415 Unsupported Media Type response occurs when the server cannot process the request because the media type specified in the request is not supported for the requested resource. For example, if a client sends a request with a Content-Type header of application/pdf to an API endpoint that only supports application/json (the only valid media type for JSON:API), the server would respond with a 415 Unsupported Media Type status code. This type of error-response is a required for JSON:API compatible endpoints.
422 Unprocessable Content
A 422 Unprocessable Content
response is given when the order cannot be modified because it has been
fulfilled already. This means that none of the requested changes have
been applied to the order.