> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fire.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# Enviar orden de compra

> Cambia el estado de la orden de DRAFT a SUBMITTED. Úsalo cuando estés listo para enviarla al proveedor.

<ParamField header="x-api-key" type="string" required>
  API key de BOH con scope `inventory:write`.
</ParamField>

<ParamField path="vendorId" type="string" required>UUID del vendor.</ParamField>
<ParamField path="orderId" type="string" required>UUID de la orden de compra.</ParamField>
<ParamField body="external_user_id" type="string" required>Actor que envía la orden.</ParamField>

<RequestExample>
  ```json theme={null}
  { "external_user_id": "compras_01" }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "purchase_order": {
      "id": "po_01...",
      "status": "SUBMITTED"
    }
  }
  ```

  ```json 422 theme={null}
  {
    "error": {
      "kind": "purchase_order_has_no_lines",
      "message": "Cannot submit an order with no lines"
    }
  }
  ```
</ResponseExample>
