Create Order v2
Create an asynchronous order which will be placed in a queue and processed later.
Order Creation v2
Orders can be placed by a POST request to v2/order API endpoint. Each request to create an order must include, alongwith the necessary authentication headers, order information in the request body. The format for the same can be found in the Create Order API Reference.
- Acquire the
create-order-payloadfrom Account Manager. - Configure the order details in the
create-order-payloadjson. This payload will be placed in the request body. - Acquire
access-tokenas mentioned in Authentication. The account'sclientIdandsecretcan be found in WebApp - Make a
POSTrequest to/orderAPI endpoint. API reference in Create Order V2
For orders placed with country=USA, the region field must be included in Shipping address.
Creating a test order
To make sure the account and webhook have been successfully registered, we suggest to send few test orders before going live. The steps to create a test order are the same as a real one mentioned above. In case of a test order, the fakeOrder key in the payload will have true value.
The fakeOrder flag, which is a part of the create-order-payload, has to be set as true (otherwise the order placed will be produced) .
Difference between v1 and v2 Version
There are two endpoints to place orders which accept the same payload as mentioned above, but differ in the way they process the request and response:
v1/orderversion which processes the request immediately.v2/orderversion where the order is placed in a queue on a fire-and-forget basis, the request is processed as per the queue without any added delay.
| Feature | v1 | v2 |
|---|---|---|
| Request Processing | Synchronous (Immediate response) | Asynchronous (Placed in a queue for processing) |
| Response | Returns the created order with pricing and promised arrival date | "Your order has been successfully placed for processing" |
| Order Creation Timing | Instant, immediately processed | Order is processed in a queue |
| Use Case | Suitable for immediate order processing when the order details are required on priority | Suitable for high-volume or queued order processing |