Skip to main content
POST

Receive units of a purchase order

Scope:inventory:purchase-orders.write
https://api.holded.com/api/v2/purchase-orders/{purchaseOrderId}/receive

Registers the receipt of units for a purchase order. Internally creates a linked purchase shipment (albarán de compra) and updates the purchase order's pending units accordingly. Provide the lines you want to receive in the `items` array. Each item references an existing purchase order line by `line_id` together with the `units` being received. Partial reception is supported: any line of the purchase order that is **not** listed in `items` remains untouched and pending, and you can call this endpoint again later to receive the remaining units.

Parameters

Path parameters

purchaseOrderIdstringrequired

Purchase Order ID (24-char hex ObjectId)

Request body

object
items[]object[]required

Lines being received. Each item must reference an existing purchase order line.

line_idstringrequired

Identifier of the purchase order line being received

unitsnumberrequired

Number of units being received. Must be greater than zero and not exceed the line's pending units.

datestring<date> | nulloptional

Reception date in ISO 8601 format (YYYY-MM-DD). Defaults to today.

warehouse_idstring | nulloptional

Warehouse where the units are received. Defaults to the purchase order warehouse.

Request

python
import requests

url = "https://api.holded.com/api/v2/purchase-orders/{purchaseOrderId}/receive"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

payload = {
    "items": [
        {
            "line_id": "string",
            "units": 0
        }
    ],
    "date": "2024-01-15",
    "warehouse_id": "string"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())

Responses

Response

json
{
  "id": "507f1f77bcf86cd799439011"
}

Success responses

201Reception registered. Returns the created purchase shipment id.application/json
object
idstring

Error responses

400Bad requestapplication/json
401Invalid or missing API keyapplication/json
403Insufficient permissionsapplication/json
404Purchase order not foundapplication/json
409Conflictapplication/json
object
typestring
titlestring
statusinteger
detailstring
422Validation errorapplication/json
429Rate limit exceededapplication/json