POST v3/orders
POST/v3/orders
Create an order with its order items and addresses.
This endpoint enables a client to create an order with its orderItems and related addresses.
Request
When creating an order the related resources must be included in the request under the included attribute of the order (see the example). For the resources deliveryAddress and billingAddress it is required to provide a provisional id to be able to link the correct address-resource in the appropriate relationship. For orderItems and the pickUpPoint this is not required as these are effectively redundant. Resource orderAttachment is optional and, if provided, has to be set in included array (see the example below).
Attachments
It is possible to submit pdf documents which will be printed-out and placed in the parcel with the products.
On order to make use of this print facility contact your account manager to arrange matters.
Response
Upon successful creation of the orders and its orderItems 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.
Request
Responses
- 201
- 401
- 403
- 404
- 406
- 409
- 415
Upon successful creation of the orders and its orderItems 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.
Response Headers
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.
404 Not Found
In case there are references to preferredShippingMethod,
orderType of skus that are not known the server will respond with a
404: Not Found code. The response combines as many validation issues the
server was able to find.
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.
Conflict
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.