POST /v1/order-intents/{order_intent_id}/submit

Submit Order Intent

Summary

Submit an order intent to create quote and order

Description

Submits a draft order intent for processing. Creates a quote snapshot from the intent, then creates an order from that quote. The intent status changes to 'submitted' and latest_quote_id/latest_order_id are populated. Validates intent completeness before submission.

Request Example

curl -X POST "http://127.0.0.1:8000/api/v1/order-intents/oi_xxx/submit" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "order_intent_id": "oi_abc123def456",
  "status": "submitted",
  "created_at": "2024-01-27T21:12:00Z",
  "updated_at": "2024-01-27T21:15:00Z",
  "quantity": 10,
  "lead_time": "standard",
  "latest_quote_id": "quo_xyz789",
  "latest_order_id": "ord_def456"
}

Error Codes

This endpoint may return the following error codes:

Code Status Meaning
missing_auth 401 No Authorization header provided
invalid_api_key 403 API key is invalid or missing
order_intent_not_found 404 Order intent not found
forbidden 403 Not allowed to access this intent
invalid_state 409 Only draft intents can be submitted
missing_design 400 Provide dfm_run_id or board_id
invalid_quantity 400 Quantity must be >= 1
missing_shipping 400 Ship-to must include country and postal_code
dfm_run_not_found 404 DFM run not found
board_not_found 404 Board not found

Authentication

This endpoint requires Bearer token authentication:

Authorization: Bearer YOUR_API_KEY