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

# Update a purchase orders

> Update a purchase orders

### Path parameters

<ParamField path="id" type="string" required>
  Purchase order ID
</ParamField>

### Request body

`UpdatePurchaseOrderRequest`

<ParamField body="discount_amount" type="string,null">
  Decimal discount amount as a string.
</ParamField>

<ParamField body="expected_date" type="string,null">
  RFC 3339 timestamp.
</ParamField>

<ParamField body="notes" type="string,null" />

<ParamField body="payment_terms" type="string,null" />

<ParamField body="ship_to_address" type="string,null" />

<ParamField body="ship_to_city" type="string,null" />

<ParamField body="ship_to_country" type="string,null" />

<ParamField body="ship_to_postal_code" type="string,null" />

<ParamField body="ship_to_state" type="string,null" />

<ParamField body="shipping_cost" type="string,null">
  Decimal shipping cost as a string.
</ParamField>

<ParamField body="supplier_notes" type="string,null" />

<ParamField body="supplier_reference" type="string,null" />

<ParamField body="tax_amount" type="string,null">
  Decimal tax amount as a string.
</ParamField>

### Responses

<ResponseField name="200" type="PurchaseOrderResponse" />

<ResponseField name="400" type="ErrorBody" />

<ResponseField name="404" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request PUT \
    --url 'https://api.stateset.com/api/v1/purchase-orders/{id}' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "discount_amount": null,
    "expected_date": null,
    "notes": null,
    "payment_terms": null,
    "ship_to_address": null,
    "ship_to_city": null,
    "ship_to_country": null,
    "ship_to_postal_code": null,
    "ship_to_state": null,
    "shipping_cost": null,
    "supplier_notes": null,
    "supplier_reference": null,
    "tax_amount": null
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "approved_by": null,
    "created_at": "string",
    "currency": "string",
    "discount_amount": "string",
    "id": "string",
    "items": [
      {
        "created_at": "string",
        "id": "string",
        "line_total": "string",
        "name": "string",
        "product_id": null,
        "purchase_order_id": "string",
        "quantity_ordered": "string",
        "quantity_received": "string",
        "sku": "string",
        "supplier_sku": null,
        "unit_cost": "string"
      }
    ],
    "payment_terms": "string",
    "po_number": "string",
    "shipping_cost": "string",
    "status": "string",
    "subtotal": "string",
    "supplier_id": "string",
    "supplier_reference": null,
    "tax_amount": "string",
    "total": "string"
  }
  ```
</ResponseExample>
