Create a new order entry
POST/orders
Create a new order entry to purchase a giftcard product for a specific customer.
The order will be processed either synchronously or asynchronously based on the processing_mode parameter.
sync: the request will only return once the order has been fully processed and the delivery information is available.async: the request will return as soon as the order has been created and processing will continue in the background.
The client can then poll the order status to retrieve the delivery information once available or use webhooks to be notified about the order status changes.
Note: The request must include an Idempotency-Key header to ensure that duplicate requests are not processed multiple times.
Retrying with the same key and an identical request body returns the previously created order in its current state instead of creating a duplicate.
Note that the returned order may still be in the processing state even in sync mode if the original request is still being processed.
Request
Responses
- 201
- 202
- 400
- 409
- 500
Order entry created and processed successfully
Order entry created successfully with asynchronous delivery in the background.
Bad Request
Conflict
Internal Server Error
Error Codes
| HTTP Status | Class | Code | Description |
|---|---|---|---|
| 400 | invalid_request | invalid_body_parameters | Invalid body parameters with details in the fields attribute |
| 400 | invalid_state | order_not_allowed_for_product | The given product is disabled for the client |
| 409 | invalid_state | out_of_stock | The product is currently out of stock and cannot be delivered synchronously. Retry later or place the order with processing_mode set to async. |
| 400 | idempotency | invalid_idempotency_key_header | The Idempotency-Key header is invalid or missing |
| 400 | idempotency | reused_idempotency_key | The Idempotency-Key has already been used for a previous request with a different request body |
| 403 | forbidden | insufficient_available_balance | The client does not have sufficient available balance to place the order |
| 403 | forbidden | currency_not_allowed | The given currency is not allowed for the client |
| 403 | forbidden | customer_amount_limit_exceeded | The requested amount exceeds the maximum allowed value for the customer |