Import Purchase Orders
POST/api/purchase-orders/import
Execute the purchase order import — create purchase orders from validated data.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Returns 201 Created on success, 422 on failure.
Purchase order fields:
- purchase_order_date (required, date)
- supplier_id (required, exists:suppliers)
- destination_warehouse_id (required, exists:warehouses)
- purchase_order_number (optional)
- currency_id (optional), currency_code (optional)
- order_status (optional, in:draft,open)
- estimated_delivery_date, supplier_notes, tracking_number, tags (all optional)
- payment_term_id, shipping_method_id, incoterm_id, store_id (all optional)
Line fields:
- quantity (required, numeric, min:1)
- amount (required, numeric, min:0)
- product_id, description, discount, tax_rate, nominal_code_id, estimated_delivery_date (all optional)
Requires permission: purchase_orders.import
Request
Responses
- 201
- 401
- 403
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.