MobiariDocs
Admin APIPurchasing

Update a purchase order

PATCH
/stores/{store_id}/purchase-orders/{po_id}

Changes the fields sent (omitted ones stay). lines replaces every line and is only allowed on a draft. status moves a draft to ordered, or cancels an order that is not received.

Authorization

bearer_auth
AuthorizationBearer <token>

Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.

In: header

Path Parameters

store_id*string

Store id

Formatuuid
po_id*string

Purchase order id

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/purchase-orders/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{
  "closed_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z",
  "currency": "string",
  "expected_at": "2019-08-24",
  "goods_cents": 0,
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "line_count": 0,
  "location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
  "notes": "string",
  "number": "string",
  "ordered_at": "2019-08-24T14:15:22Z",
  "other_cents": 0,
  "shipping_cents": 0,
  "status": "draft",
  "supplier_id": "3cb1e20c-c6c9-4e71-ba66-399c468f697c",
  "supplier_name": "string",
  "total_ordered": 0,
  "total_received": 0,
  "lines": [
    {
      "current_name": "string",
      "description": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
      "quantity_ordered": 0,
      "quantity_received": 0,
      "sku": "string",
      "unit_cost_cents": 0
    }
  ],
  "receipts": [
    {
      "created_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "items": [
        {
          "description": "string",
          "quantity": 0,
          "sku": "string",
          "unit_cost_cents": 0
        }
      ],
      "location_name": "string",
      "note": "string",
      "quantity": 0,
      "received_by": "string"
    }
  ]
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}