---
title: "Update a purchase order"
method: PATCH
path: "/api/v1/sa/inventory/purchase-orders/{id}"
tags: ["Purchase Orders"]
---

# Update a purchase order

`PATCH /api/v1/sa/inventory/purchase-orders/{id}`

## Request

- Base URL: `https://app.sellerassistant.app` (the document declares no server; this is the origin it was published from)
- URL: `https://app.sellerassistant.app/api/v1/sa/inventory/purchase-orders/{id}`
- Auth: one of:
  - API key in query parameter `api_key`
  - API key in header `X-Api-Key`

The warehouse cannot change while a shipment is linked to the order, and the call answers 422 then. A change of the order level costs spreads them over the items again.

## Path parameters

- `id` integer, required

## Request body

- PurchaseOrderForm: The update sends only the fields it changes. The supplier and the marketplace of an order do not change.
  - `po_id` string
  - `status` 'draft' | 'sent' | 'completed' | 'cancelled'
  - `prep_center_id` integer, nullable: The warehouse. It cannot change while a shipment is linked to the order.
  - `order_date` string, date, nullable
  - `shipping_cost` number, nullable
  - `taxes` number, nullable
  - `misc_expenses` number, nullable
  - `user_id` integer: The member of the team who owns the order. A user of another team answers 400.

## Response `200`

The purchase order

- object
  - `data` PurchaseOrder: What the team bought from one supplier. A purchase order has no team of its own: the supplier carries it.
    - `id` integer: The id of the purchase order.
    - `po_id` string, nullable: The name a person gave the order.
    - `status` string, nullable
    - `supplier_id` integer
    - `marketplace_id` string, nullable
    - `prep_center_id` integer, nullable: The warehouse the goods go to.
    - `user_id` integer, nullable
    - `order_date` string, date, nullable
    - `currency` string, nullable: The currency of the supplier.
    - `items_count` integer
    - `subtotal` number, float, nullable: The sum of the items. Null means not known, which is not the same as zero.
    - `shipping_cost` number, float, nullable
    - `taxes` number, float, nullable
    - `misc_expenses` number, float, nullable
    - `total_price` number, float, nullable
    - `estimated_revenue` number, float, nullable
    - `estimated_profit` number, float, nullable
    - `supplier` object: The supplier of the order. Every answer of the v1 carries it.
      - `id` integer: The id of the document.
      - `name` string
      - `currency` string, nullable
    - `items` PurchaseOrderItem[]: The items of the order. It is present only with `include=items`, and it carries the first 100 items, by id. `items_count` reports the real number, and `/purchase-orders/{id}/items` serves them all as a page.
      - `id` integer
      - `purchase_order_id` integer
      - `internal_product_id` string, nullable: The inventory product the line points at. It is the same id the matches and the history of a product use.
      - `title` string, nullable
      - `image_url` string, nullable
      - `asin` string, nullable
      - `upc` string, nullable
      - `ean` string, nullable
      - `sku` string, nullable
      - `identifier` string, nullable
      - `unit_cost` number, float, nullable: Null means not known, which is not the same as zero.
      - `unit_count` integer
      - `total_cost` number, float, nullable
      - `selling_price` number, float, nullable
      - `profit_fba` number, float, nullable
      - `profit_marketplace_id` string, nullable
      - `profit_calculated_at` string, date-time, nullable
      - `created_at` string, date-time, nullable
      - `updated_at` string, date-time, nullable
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable

## Other responses

- `400`: Bad request - validation failed or invalid parameters
- `403`: Access denied - insufficient permissions, invalid API key, or the API request limit is used up (`public_api_key_limit`)
- `404`: Resource not found
- `422`: Business logic error - operation cannot be completed due to business rules
- `429`: Too many requests - rate limit exceeded

---

[API](https://skmtc.dev/sellerassistant/apis/seller-assistant-public-api.md) · [All operations](https://skmtc.dev/sellerassistant/apis/seller-assistant-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sellerassistant/apis/seller-assistant-public-api/revisions/5b3ecdbcadb6?raw)
