Inventory API
The Inventory endpoints expose the records that Bookkeep Inventory keeps for a Shopify store. They let a partner app or an in-house integration create purchase orders, read what was ordered and received, and follow the bills that result.
Objects
Supplier. Who the store buys from. Suppliers carry contact details and addresses, so treat them as personal data.
Purchase order. What was ordered from one supplier, as line items with quantities and costs. Status moves from draft through ordered, partial and received to committed, or to cancelled. The API creates and edits drafts and can cancel; receiving happens in Bookkeep Inventory.
Receipt. What arrived against a purchase order, with any landed-cost fees. Receiving a purchase order moves the stock from incoming to available in Shopify. API keys see committed receipts only.
Bill. The vendor bill built from a receipt and posted to the store's accounting platform. Bills are read-only and are listed per receipt.
Authentication
Inventory endpoints take a scoped API key rather than the publishable and secret key pair the rest of this API uses. Merchants create keys under Settings → API Keys in the Bookkeep app in Shopify admin. Each key belongs to one store and only sees that store's data.
Send the key as the HTTP Basic username with any password:
curl -L 'https://api.bookkeep.com/v1/entities/<entity_id>/purchase_orders' -u '<api-key>:x'
Every Inventory path starts with /v1/entities/{entity_id}. The key's store must be linked to that entity, or the request returns 403.
| Scope | Allows |
|---|---|
purchase_orders:read | List purchase orders and fetch one, in any status |
purchase_orders:write | Create and update draft purchase orders, cancel a purchase order |
purchase_order_receipts:read | List and fetch receipts, and include=receipts on purchase order reads |
suppliers:read | List and fetch suppliers |
bills:read | List a receipt's bills and fetch a bill |
Errors
Inventory endpoints return {"error": "..."}, or {"errors": [...]} when a validation failure has several messages. The other endpoints in this API use {"error": {"message", "type"}}, so handle both if you use both. A key without the scope an endpoint needs gets 403.
Endpoints
Questions about Inventory API access go to inventory@bookkeep.com.