Create Order API
Creates a new sales order transaction in Ananta 4PL logistics system, inserting header, audit history, and line item records with atomic transaction rollback safety.
Authentication & Permission Scopes
All requests require a valid API key supplied in the X-API-Key HTTP request header.
The key is authenticated against active database credentials using SHA-512 with timing-safe hash comparison (hash_equals).
write:orders scope (or the wildcard *). Requests without this permission fail immediately with HTTP 403 Forbidden.
Headers & Preflight (CORS)
| Header | Type | Requirement | Description |
|---|---|---|---|
X-API-Key |
string | Required | Client API secret token. |
Content-Type |
string | Required | Must be application/json; charset=UTF-8. |
Accept |
string | Optional | Expected response format: application/json. |
OPTIONS request is supported and returns 200 OK with headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-API-Key
Order Header Schema
| Field | Type | Requirement | Default | Description / Validation Rules |
|---|---|---|---|---|
| txn_date | string | Required | — | Transaction date. Formatted to YYYY-MM-DD. |
| assoc_ref | string | Required | — | External client order ID. Unique per client. Duplicate triggers 422 Unprocessable Entity. |
| assoc_ref_date | string | Required | — | Date of the external reference (YYYY-MM-DD). |
| bill_to | string | Required | — | Billing account/client identifier (e.g. CU001). |
| cons_name | string | Required | — | Consignee recipient contact or business name. |
| cons_address | string | Required | — | Delivery shipping address. |
| cons_city | string | Required | — | Destination city (e.g. Panchkula). |
| cons_state | string | Required | — | 2-digit Indian State Code (e.g. 06, 07). |
| cons_pin | string | Required | — | 6-digit Indian PIN Code (e.g. 134109). |
| items | array | Required | — | Non-empty array of line item objects. |
| doc_id | string | Optional | SALO |
Order voucher/document series. |
| cons_phone | string | Optional | NULL |
Consignee mobile phone number. |
| cons_gst | string | Optional | NULL |
15-character GSTIN number of consignee. |
| backorder | string | Optional | N |
Backorder allowance flag (Y or N). |
| txn_status | string | Optional | Pending |
Initial transaction state. |
Order Detail Items Schema
| Field | Type | Requirement | Default | Description |
|---|---|---|---|---|
| prod_id | string | Required | — | Product SKU or identifier in Ananta 4PL catalog. |
| order_qty | number | Required | — | Quantity ordered. |
| price | number | Required | — | Selling unit price. |
| mrp | number | Required | — | Maximum Retail Price per unit. |
| unit | string | Optional | EACH |
Unit of Measure (EACH, BOX, KG). |
| price_cur | string | Optional | INR |
ISO currency code. |
| exch_rate | number | Optional | 1.00 |
Exchange multiplier. |
| disc_p | number | Optional | 0 |
Discount percentage. |
Status Codes & Error Matrix
Interactive API Playground
Order Dispatch Console
Simulate API behavior or inspect live headers.
// Ready to send. Responses will display status codes, headers, and payload here.
Integration Code Samples
Endpoint Name
This endpoint is scheduled for release in the Ananta 4PL API Roadmap.
API Specification In Progress
This endpoint contract is currently being designed and drafted. As soon as the specification is added, its full interactive playground, schema tables, and mock sandbox will appear here automatically.