PATCH /v1/order-intents/{order_intent_id}

Update Order Intent

Summary

Update a draft order intent

Description

Updates an existing order intent. Only intents with 'draft' status can be edited. Supports partial updates - only include fields you want to change.

Request Example

curl -X PATCH "http://127.0.0.1:8000/api/v1/order-intents/oi_xxx" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"quantity":25,"lead_time":"expedite"}'

Response Example

{
  "order_intent_id": "oi_abc123def456",
  "status": "draft",
  "created_at": "2024-01-27T21:12:00Z",
  "updated_at": "2024-01-27T21:14:00Z",
  "quantity": 25,
  "lead_time": "expedite",
  "ship_to": { ... },
  "build": { ... }
}

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
not_editable 409 Only draft intents can be edited

Authentication

This endpoint requires Bearer token authentication:

Authorization: Bearer YOUR_API_KEY