Receive units of a purchase order
inventory:purchase-orders.writehttps://api.holded.com/api/v2/purchase-orders/{purchaseOrderId}/receiveRegisters 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
stringrequiredPurchase Order ID (24-char hex ObjectId)
Request body
Lines being received. Each item must reference an existing purchase order line.
Identifier of the purchase order line being received
Number of units being received. Must be greater than zero and not exceed the line's pending units.
Reception date in ISO 8601 format (YYYY-MM-DD). Defaults to today.
Warehouse where the units are received. Defaults to the purchase order warehouse.
Request
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
{
"id": "507f1f77bcf86cd799439011"
}Success responses
201Reception registered. Returns the created purchase shipment id.application/jsonError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Purchase order not foundapplication/json409Conflictapplication/json422Validation errorapplication/json429Rate limit exceededapplication/json