Create purchase orders with line items, vendor details, and procurement settings
application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
poNumber | string | Yes | Purchase order number to assign to the document (minimum 1 character) |
lineItems | array | Yes | List of line items that make up the purchase order (minimum 1 item required) |
poType | string | Yes | Indicates whether the purchase order is for goods or services. Valid values: GOODS, SERVICES |
matchingType | string | Yes | Specifies whether the purchase order follows a two-way or three-way match process. Valid values: TWO_WAY, THREE_WAY |
poDate | string | Yes | Purchase order date in ISO-8601 format (YYYY-MM-DD) |
vendorId | string | No | Identifier of the vendor that should be linked to the purchase order (minimum 1 character) |
gstin | string | No | GSTIN of the organization (minimum 1 character) |
description | string | No | Short description for the purchase order (1-255 characters) |
currency | string | No | ISO 4217 currency code that will be used for the purchase order amounts (3 characters, e.g., INR, USD) |
paymentTerms | string | No | Free form outline of the agreed payment terms (minimum 1 character) |
deliveryDate | string | No | Requested delivery date for the purchase order in ISO-8601 format (YYYY-MM-DD) |
termsAndConditions | string | No | Terms and conditions that must be displayed on the purchase order (minimum 1 character) |
additionalNotes | string | No | Additional notes to append to the purchase order document (minimum 1 character) |
state | string | No | Target state for the PO: DRAFTED or ACTIVE. When ACTIVE is requested the API validates all required fields. If they are all present the PO is created in active state; if anything is missing it falls back to DRAFTED and the response includes submitWarnings. Omitting this field defaults to DRAFTED. |
state: "ACTIVE")state: "ACTIVE" is passed, the following fields must be present in addition to the schema-required fields for the PO to be activated:
| Field | Level | Requirement |
|---|---|---|
vendorId | PO | Vendor must be linked |
description | PO | Description must be non-empty |
paymentTerms | PO | Payment terms must be non-empty |
quantity | Each line item | Must be greater than 0 |
rate | Each line item | Must be greater than 0 |
submitWarnings in the response identifies exactly which fields were absent.
lineItems array must contain the following fields:
| Parameter | Type | Required | Description |
|---|---|---|---|
quantity | number | Yes | Quantity requested for the line item |
rate | number | Yes | Unit rate to be applied to the line item |
identifier | string | Yes | Free-text label for the line item (minimum 1 character) |
skuCode | string | Required for THREE_WAY | Item code of an existing SKU in your inventory. Used to link this line item to a SKU. Takes priority over skuName when both are provided |
skuName | string | Required for THREE_WAY | Name of an existing SKU in your inventory. Used to link this line item to a SKU when skuCode is not provided |
SKU matching (THREE_WAY): WhenmatchingTypeisTHREE_WAY, every line item must include eitherskuCodeorskuName, and it must resolve to an existing SKU in your inventory. If any line item is missing both fields, or if the provided code/name cannot be matched, the request is rejected with a400error and the purchase order is not created. See Bulk SKU Creation to pre-populate your inventory.
poType field accepts the following values:
GOODS: Purchase order for physical goods or productsSERVICES: Purchase order for servicesmatchingType field accepts the following values:
TWO_WAY: Purchase order matching based on purchase order and invoice (2-way match)THREE_WAY: Purchase order matching based on purchase order, invoice, and goods receipt note (3-way match)200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
data | object | Contains the purchase order creation response data |
data.poId | string | Unique slug identifier for the purchase order (use this to retrieve or update the PO) |
data.state | string | State the PO was created in — DRAFTED or APPROVED (active) |
data.skuMatchWarnings | array | Not applicable for THREE_WAY POs (unmatched SKUs are rejected). Reserved for future use |
data.submitWarnings | object | Present only when submit: true was passed but required fields were missing. The PO is still created in draft state |
skuMatchWarnings Object| Field | Type | Description |
|---|---|---|
lineItemIdentifier | string | The identifier value of the unmatched line item |
skuCode | string | The skuCode that was provided (if applicable) |
skuName | string | The skuName that was provided (if applicable) |
message | string | Human-readable description of why the SKU could not be matched |
submitWarnings Object| Field | Type | Description |
|---|---|---|
po | array of strings | PO-level fields that were missing (e.g. "vendorId", "description", "paymentTerms") |
lineItems | object | Map of line item identifier to an array of missing fields (e.g. "quantity", "rate") |
state field or state: "DRAFTED")state: "ACTIVE", all fields present)state: "ACTIVE" (fields missing)state: "ACTIVE" with SKU warnings400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
404 Not Found
400 Bad Request
400 Bad Request
401 Unauthorized
403 Forbidden
500 Internal Server Error
500 Internal Server Error
poNumber, lineItems, poType, matchingType, poDate) are providedquantity, rate, and identifier valuesINR for the currency field (only INR is currently supported)matchingType based on your procurement process:
TWO_WAY for simpler matching between PO and invoiceTHREE_WAY when goods receipt verification is requiredvendorId if availablegstin for tax compliance in Indian marketsdescription concise (max 255 characters) for better readabilitytermsAndConditions to specify important contractual termsadditionalNotes for delivery instructions or special requirementsstate: "ACTIVE" when the PO is complete and ready to be activated immediately:
state will be ACTIVE if all required fields are present, or DRAFTED if anything was missingsubmitWarnings in the response — it lists exactly which PO-level or line item fields prevented activationDRAFTED state can be activated later by calling the update API with state: "ACTIVE"state (or passing state: "DRAFTED") always creates in draft, regardless of what fields are presentidentifierquantity and rate