POST
Add a pickup item
Company space For: Buyer, Stock keeper · Permission: purchase_pickups.update, purchase_reception_items.create Conditions
  • The pickup must still be editable: a draft pickup. A confirmed one is refused.
  • Both the reception’s update permission and purchase_reception_items.create are required.
  • asset_id must be an existing, active location asset available to the current company and not restricted for the current member; otherwise the call is refused with 422.
  • item_id must be a line of the purchase this reception belongs to; a line of another purchase is refused with 422.
  • The purchase unit of the line must still be active.
  • quantity must be greater than 0 and may not exceed the quantity still to receive on that purchase line. Quantities of other draft receptions are not reserved, so the same remainder can be planned twice and is only enforced again at confirmation.
  • A purchase line can appear only once per reception (item_id is unique inside the reception; deleted lines are really removed, so they no longer count).
  • damaged_quantity is counted in the damage unit (the purchase unit when damage_stockable_unit_id is omitted) and must be between 0 and the received quantity expressed in that unit; the received quantity must convert exactly into that unit.
  • damage_stockable_unit_id, when sent, must be an active unit of the same product and the same unit category as the purchase line.
  • damage_reason, damage_cost_treatment and damage_stockable_unit_id are refused when damaged_quantity is 0; damage_reason and damage_cost_treatment are required when damaged_quantity is above 0.
  • damage_cost_treatment “absorbed_by_remaining_stock” is refused when every received unit is damaged, because no accepted stock would remain to absorb the cost.
  • cost_total cannot be sent; it is computed by the server.
  • asset_id, item_id and quantity are required.
What else happens
  • Creates the line with its base cost (the purchase line’s commercial cost for this quantity, tax included) and no extra cost spread yet; cost_total equals base_cost_total until confirmation.
  • Nothing is added to stock and the purchase line’s remaining quantity is not changed until the reception is confirmed.
Part of Receive purchased goods.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

purchase_pickup
string
required

Identifier of the purchase pickup (27-character KSUID).

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, asset_id, purchase_id, item_id, reception_id, quantity, accepted_quantity, damaged_quantity, damage_stockable_unit_id, damage_reason, damage_cost_treatment, damage_cost_total, base_cost_total, allocated_purchase_leftover, allocated_landed_cost_total, cost_total, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: item, item.stockable, item.stockableUnit, damageStockableUnit, damageStockableUnit.uomUnit, damageStockableUnit.prices, damageStockableUnit.stockable.

Body

application/json
asset_id
string
required

Location asset (warehouse or shop) where the accepted goods will be stocked. Required on create; must be an existing, active location available to the company and not restricted for the current member.

item_id
string
required

Purchase line being received. Required on create; must be a line of the reception's purchase, with an active purchase unit, and not already used by another line of this reception.

quantity
integer
required

Quantity received, in the purchase line's unit, greater than 0 and at most the quantity still to receive on the purchase line. Required on create.

damaged_quantity
integer

Quantity damaged, in the damage unit (the purchase unit when damage_stockable_unit_id is omitted); between 0 and the received quantity in that unit. Defaults to 0 on create.

damage_stockable_unit_id
string | null

Unit in which damaged_quantity is counted: an active unit of the same product and unit category as the purchase line. Refused when damaged_quantity is 0. Null or omitted means the purchase unit.

damage_reason
enum<string> | null

Reason for the damage: ordinary or exceptional. Required when damaged_quantity is above 0, refused when it is 0.

Available options:
ordinary,
exceptional
damage_cost_treatment
enum<string> | null

How the damage cost is treated: absorbed_by_remaining_stock or expensed. Required when damaged_quantity is above 0, refused when it is 0. absorbed_by_remaining_stock is refused when all received goods are damaged.

Available options:
absorbed_by_remaining_stock,
expensed
cost_total
string

Not accepted: the line cost is computed by the server from the purchase line and, at confirmation, the spread extra costs.

Response

Resource (only with response=resource).

id

Identifier of the reception line (27-character KSUID).

asset_id

Identifier of the location asset (warehouse or shop) where the accepted goods will be added to stock at confirmation.

purchase_id

Identifier of the purchase of the reception.

item_id

Identifier of the purchase line being received.

reception_id

Identifier of the delivery or pickup this line belongs to.

purchase_item
object | null

The purchase line, present only when requested with include=item; null otherwise.

quantity
integer

Quantity received on this line, in the purchase line's unit, damaged goods included.

accepted_quantity
integer

Quantity accepted into stock: received quantity minus damaged_quantity, expressed in the damage unit when damage_stockable_unit_id is set, otherwise in the purchase unit. Computed by the server.

damaged_quantity
integer

Quantity found damaged, in the damage unit (the purchase unit when none is set). 0 when nothing is damaged.

damage_stockable_unit_id

Identifier of the unit in which damaged_quantity is counted, or null for the purchase unit.

damage_stockable_unit
object | null

The damage unit, present only when requested with include=damageStockableUnit; null otherwise.

damage_reason

Why the goods are damaged: ordinary or exceptional. Null when nothing is damaged.

damage_cost_treatment

How the cost of the damaged goods is treated: absorbed_by_remaining_stock (kept in the cost of the accepted stock) or expensed (removed from the stock cost). Null when nothing is damaged.

damage_cost_total
number

Cost attributed to the damaged goods, in major units. 0 until the reception is confirmed.

base_cost_total
number

Commercial cost of the received quantity taken from the purchase line (tax included), in major units, before extra costs.

allocated_purchase_leftover
number

Share of the purchase's rounding leftover given to this line, in major units. 0 until the reception is confirmed.

allocated_landed_cost_total
number

Share of the reception's extra costs (and delivery fee) given to this line, in major units. 0 until the reception is confirmed.

cost_total
number

Total cost of the line, in major units: base cost plus the spread amounts, minus the damage cost when it is expensed. Equals base_cost_total until the reception is confirmed.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).