Skip to main content

PurchaseOrderLineItemPatch

A line item you send when updating a draft purchase order. Send id (or a client_line_id you used before) to change or remove an existing line; leave both out to add a new line, which then needs quantity_ordered and at least one of sku, variant_id or inventory_item_id.

client_line_idstring

Your own identifier for the line. It must be unique within the purchase order, and within one request: two lines with the same value in one request return 422. Send it again on a later PATCH to update the line without knowing its id.

Example: replen-7731-1
skustring

The product's SKU in your Shopify store. A new line sent with a sku and no variant_id or inventory_item_id is matched to the one product in Bookkeep's copy of your catalog with exactly that SKU, and the response fills in its variant_id, inventory_item_id, product_id and title. A SKU that matches no product returns 422, and so does a SKU shared by more than one product; send variant_id or inventory_item_id for that line instead. A product added in Shopify in the last few minutes may not be in Bookkeep yet, so retry later or send its variant_id or inventory_item_id.

Example: TSHIRT-BLK-M
variant_idstring

The Shopify product variant ID, in the form gid://shopify/ProductVariant/<id>.

Example: gid://shopify/ProductVariant/44120183865627
inventory_item_idstring

The Shopify inventory item ID, in the form gid://shopify/InventoryItem/<id>.

Example: gid://shopify/InventoryItem/46217359098139
quantity_orderedinteger

Number of units to order. Must be greater than zero.

Possible values: >= 1

Example: 24
unit_costnumbernullable

Cost per unit, in the purchase order's currency.

Example: 6.25
tax_percentnumber

Tax rate for the line as a percentage, for example 8.25 for 8.25%. Defaults to 0.

Example: 8.25
supplier_skustringnullable

The supplier's own code for this item.

Example: ACME-TS-BLK-M
notestringnullable

A note on this line.

Example: null
barcodestringnullable

The item's barcode.

Example: null
titlestringnullable

Product title. When the line is matched to a product in your Shopify store, the store's product title replaces it.

Example: Classic T-Shirt
positioninteger

Display order of the line on the purchase order. Lines are sorted by position, then by the order they were added. Defaults to 0.

Example: 1
idinteger

The line item's id from an earlier response. Send it to change or remove that line.

Example: 31842
_destroyboolean

Set to true, together with id or client_line_id, to remove the line. A line that already has stock received against it cannot be removed.

Example: false
PurchaseOrderLineItemPatch
{
"client_line_id": "replen-7731-1",
"sku": "TSHIRT-BLK-M",
"variant_id": "gid://shopify/ProductVariant/44120183865627",
"inventory_item_id": "gid://shopify/InventoryItem/46217359098139",
"quantity_ordered": 24,
"unit_cost": 6.25,
"tax_percent": 8.25,
"supplier_sku": "ACME-TS-BLK-M",
"note": null,
"barcode": null,
"title": "Classic T-Shirt",
"position": 1,
"id": 31842,
"_destroy": false
}