MobiariDocs
Admin APIPurchasing

Receive a purchase order

POST
/stores/{store_id}/purchase-orders/{po_id}/receive

Books one delivery: a receipt with its lines, a stock_in movement per line carrying the landed unit cost (shipping and other costs spread over every unit ordered), the variant's moving average cost, and the order's new status (partial or received), all in one transaction.

Every call books a new delivery, so send an Idempotency-Key: a retry with the same key replays the first answer instead of receiving the goods twice.

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

Header Parameters

Idempotency-Key?string

A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.

Lengthlength <= 255

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 POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/purchase-orders/497f6eca-6276-4993-bfeb-53cbbbba6f08/receive" \  -H "Content-Type: application/json" \  -d '{    "lines": [      {        "purchase_order_item_id": "be5f836e-2db2-4716-bf3a-f85f33396714",        "quantity": 0      }    ]  }'
{
  "levels": [
    {
      "available": 0,
      "location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
      "movement_id": "91f31a1e-b7f2-4510-b623-c550715ad5a8",
      "on_hand": 0,
      "reserved": 0,
      "variant_id": "8a2d415d-59aa-4132-bef3-011f97c4a0f6"
    }
  ],
  "receipt_id": "64d0a161-468e-472a-b00e-a06ee9ab7de7",
  "received": 0,
  "status": "draft",
  "unlocks": [
    {
      "limiting_sku": "string",
      "max_shippable": 0,
      "name": "string",
      "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
      "sku": "string",
      "variant_id": "8a2d415d-59aa-4132-bef3-011f97c4a0f6"
    }
  ]
}
{
  "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"
}