# Stockroom API > Purchase orders, receiving, suppliers and stock adjustments for Shopify stores running Stockroom. Every call carries a bearer key (Authorization: Bearer srk2_...) and answers as JSON; every refusal is one {"error": {"code", "message"}} envelope. Base URL: https://api.stockroom.app/v2 Contract: https://developer.stockroom.app/openapi.yaml Keys: Settings > API in Stockroom (go.stockroom.app, or inside the Shopify admin) ## Guides - [Get a key](https://developer.stockroom.app/keys/): The store gets access, then someone creates a key. - [Authentication and scopes](https://developer.stockroom.app/authentication/): One header, six scopes, and what each refusal means. - [Conventions](https://developer.stockroom.app/conventions/): Paging, money, errors, idempotency and rate limits, the same on every endpoint. - [Stock changes and sync state](https://developer.stockroom.app/sync/): The record is final at once; Shopify hears about it in the background. - [Webhooks](https://developer.stockroom.app/webhooks/): A signed POST when something happens, so nothing has to poll. - [Coming from Stocky](https://developer.stockroom.app/from-stocky/): Where each Stocky field went, for code you are repointing. - [Changelog](https://developer.stockroom.app/changelog/): What may change under you, what may not, and what has. ## Reference ### Account - GET /whoami (scope read): Which store and key this is. https://developer.stockroom.app/reference/account/#whoami ### Suppliers - GET /suppliers (scope read): List suppliers. https://developer.stockroom.app/reference/suppliers/#listSuppliers - POST /suppliers (scope write:suppliers): Create a supplier. https://developer.stockroom.app/reference/suppliers/#createSupplier - POST /suppliers/merge (scope write:suppliers): Merge suppliers. https://developer.stockroom.app/reference/suppliers/#mergeSuppliers - GET /suppliers/{id} (scope read): Get a supplier. https://developer.stockroom.app/reference/suppliers/#getSupplier - PATCH /suppliers/{id} (scope write:suppliers): Update a supplier. https://developer.stockroom.app/reference/suppliers/#updateSupplier - POST /suppliers/{id}/archive (scope write:suppliers): Archive a supplier. https://developer.stockroom.app/reference/suppliers/#archiveSupplier - POST /suppliers/{id}/unarchive (scope write:suppliers): Restore an archived supplier. https://developer.stockroom.app/reference/suppliers/#unarchiveSupplier - GET /suppliers/{id}/catalog (scope read): List a supplier's catalog. https://developer.stockroom.app/reference/suppliers/#listSupplierCatalog - PUT /suppliers/{id}/catalog (scope write:suppliers): Add or update catalog rows. https://developer.stockroom.app/reference/suppliers/#upsertSupplierCatalog - DELETE /suppliers/{id}/catalog/{inventory_item_id} (scope write:suppliers): Remove an item from a supplier's catalog. https://developer.stockroom.app/reference/suppliers/#deleteSupplierCatalogRow ### Purchase orders - GET /purchase_orders (scope read): List purchase orders. https://developer.stockroom.app/reference/purchase-orders/#listPurchaseOrders - POST /purchase_orders (scope write:purchase_orders): Create a purchase order. https://developer.stockroom.app/reference/purchase-orders/#createPurchaseOrder - GET /purchase_orders/{id} (scope read): Get a purchase order. https://developer.stockroom.app/reference/purchase-orders/#getPurchaseOrder - PATCH /purchase_orders/{id} (scope write:purchase_orders): Update a purchase order. https://developer.stockroom.app/reference/purchase-orders/#updatePurchaseOrder - DELETE /purchase_orders/{id} (scope write:purchase_orders): Delete a draft. https://developer.stockroom.app/reference/purchase-orders/#deletePurchaseOrder - GET /purchase_orders/{id}/history (scope read): An order's history. https://developer.stockroom.app/reference/purchase-orders/#getPurchaseOrderHistory - GET /purchase_orders/{id}/pdf (scope read): The order as a PDF. https://developer.stockroom.app/reference/purchase-orders/#getPurchaseOrderPdf - POST /purchase_orders/{id}/lines (scope write:purchase_orders): Add lines to an open order. https://developer.stockroom.app/reference/purchase-orders/#addPurchaseOrderLines - POST /purchase_orders/{id}/lines/{line_id}/cancel_remaining (scope write:purchase_orders): Cancel what is still outstanding on a line. https://developer.stockroom.app/reference/purchase-orders/#cancelRemainingOnLine - POST /purchase_orders/{id}/send (scope write:purchase_orders): Email the order to the supplier. https://developer.stockroom.app/reference/purchase-orders/#sendPurchaseOrder - POST /purchase_orders/{id}/mark_ordered (scope write:purchase_orders): Mark a draft ordered. https://developer.stockroom.app/reference/purchase-orders/#markPurchaseOrderOrdered - POST /purchase_orders/{id}/mark_in_transit (scope write:purchase_orders): Record a shipment. https://developer.stockroom.app/reference/purchase-orders/#markPurchaseOrderInTransit - POST /purchase_orders/{id}/close (scope write:purchase_orders): Close an order. https://developer.stockroom.app/reference/purchase-orders/#closePurchaseOrder - POST /purchase_orders/{id}/reopen (scope write:purchase_orders): Reopen a closed order. https://developer.stockroom.app/reference/purchase-orders/#reopenPurchaseOrder - POST /purchase_orders/{id}/archive (scope write:purchase_orders): Archive an order. https://developer.stockroom.app/reference/purchase-orders/#archivePurchaseOrder - POST /purchase_orders/{id}/unarchive (scope write:purchase_orders): Unarchive an order. https://developer.stockroom.app/reference/purchase-orders/#unarchivePurchaseOrder - POST /purchase_orders/{id}/duplicate (scope write:purchase_orders): Duplicate an order as a new draft. https://developer.stockroom.app/reference/purchase-orders/#duplicatePurchaseOrder ### Receipts - GET /purchase_orders/{id}/receipts (scope read): List an order's receipts. https://developer.stockroom.app/reference/receipts/#listReceipts - POST /purchase_orders/{id}/receipts (scope write:purchase_orders, Idempotency-Key required): Record a receipt. https://developer.stockroom.app/reference/receipts/#recordReceipt - GET /purchase_orders/{id}/receipts/{receipt_id} (scope read): Get a receipt. https://developer.stockroom.app/reference/receipts/#getReceipt - POST /purchase_orders/{id}/receipts/{receipt_id}/void (scope write:purchase_orders): Void a receipt. https://developer.stockroom.app/reference/receipts/#voidReceipt ### Payments - GET /purchase_orders/{id}/payments (scope read): List an order's payments. https://developer.stockroom.app/reference/payments/#listPayments - POST /purchase_orders/{id}/payments (scope write:purchase_orders): Record a payment. https://developer.stockroom.app/reference/payments/#recordPayment - DELETE /purchase_orders/{id}/payments/{payment_id} (scope write:purchase_orders): Delete a payment. https://developer.stockroom.app/reference/payments/#deletePayment - POST /purchase_orders/{id}/mark_paid (scope write:purchase_orders): Mark an order paid. https://developer.stockroom.app/reference/payments/#markPurchaseOrderPaid - POST /purchase_orders/{id}/mark_unpaid (scope write:purchase_orders): Mark an order unpaid. https://developer.stockroom.app/reference/payments/#markPurchaseOrderUnpaid ### Stock adjustments - GET /stock_adjustments (scope read): List stock adjustments. https://developer.stockroom.app/reference/stock-adjustments/#listStockAdjustments - POST /stock_adjustments (scope write:inventory): Create a draft adjustment. https://developer.stockroom.app/reference/stock-adjustments/#createStockAdjustment - GET /stock_adjustments/{id} (scope read): Get a stock adjustment. https://developer.stockroom.app/reference/stock-adjustments/#getStockAdjustment - PATCH /stock_adjustments/{id} (scope write:inventory): Update a draft adjustment. https://developer.stockroom.app/reference/stock-adjustments/#updateStockAdjustment - POST /stock_adjustments/{id}/apply (scope write:inventory, Idempotency-Key required): Apply a draft. https://developer.stockroom.app/reference/stock-adjustments/#applyStockAdjustment - POST /stock_adjustments/{id}/cancel (scope write:inventory): Cancel a draft. https://developer.stockroom.app/reference/stock-adjustments/#cancelStockAdjustment ### Catalog - GET /products (scope read): List products. https://developer.stockroom.app/reference/catalog/#listProducts - GET /products/{id} (scope read): Get a product. https://developer.stockroom.app/reference/catalog/#getProduct - GET /variants (scope read): List variants. https://developer.stockroom.app/reference/catalog/#listVariants - GET /variants/{id} (scope read): Get a variant. https://developer.stockroom.app/reference/catalog/#getVariant - GET /locations (scope read): List locations. https://developer.stockroom.app/reference/catalog/#listLocations - GET /locations/{id} (scope read): Get a location. https://developer.stockroom.app/reference/catalog/#getLocation - GET /inventory_levels (scope read): List inventory levels. https://developer.stockroom.app/reference/catalog/#listInventoryLevels ### Webhooks - GET /webhooks (scope webhooks): List webhooks. https://developer.stockroom.app/reference/webhooks/#listWebhooks - POST /webhooks (scope webhooks): Create a webhook. https://developer.stockroom.app/reference/webhooks/#createWebhook - GET /webhooks/{id} (scope webhooks): Get a webhook. https://developer.stockroom.app/reference/webhooks/#getWebhook - PATCH /webhooks/{id} (scope webhooks): Update a webhook. https://developer.stockroom.app/reference/webhooks/#updateWebhook - DELETE /webhooks/{id} (scope webhooks): Delete a webhook. https://developer.stockroom.app/reference/webhooks/#deleteWebhook - GET /webhooks/{id}/deliveries (scope webhooks): A webhook's delivery log. https://developer.stockroom.app/reference/webhooks/#listWebhookDeliveries - POST /webhooks/{id}/deliveries/{delivery_id}/redeliver (scope webhooks): Retry one delivery's event now. https://developer.stockroom.app/reference/webhooks/#redeliverWebhookDelivery - POST /webhooks/{id}/redeliver (scope webhooks): Resend past events. https://developer.stockroom.app/reference/webhooks/#redeliverWebhook - POST /webhooks/{id}/test (scope webhooks): Send a test event. https://developer.stockroom.app/reference/webhooks/#testWebhook ## Shapes - Timestamp: https://developer.stockroom.app/reference/shapes/#timestamp - Date: https://developer.stockroom.app/reference/shapes/#date - Money: https://developer.stockroom.app/reference/shapes/#money - Quantity: https://developer.stockroom.app/reference/shapes/#quantity - SyncState: https://developer.stockroom.app/reference/shapes/#syncstate - LocationRef: https://developer.stockroom.app/reference/shapes/#locationref - Error: https://developer.stockroom.app/reference/shapes/#error - Whoami: https://developer.stockroom.app/reference/shapes/#whoami - Scope: https://developer.stockroom.app/reference/shapes/#scope - Supplier: https://developer.stockroom.app/reference/shapes/#supplier - SupplierInput: https://developer.stockroom.app/reference/shapes/#supplierinput - SupplierCatalogRow: https://developer.stockroom.app/reference/shapes/#suppliercatalogrow - PriceTierSet: https://developer.stockroom.app/reference/shapes/#pricetierset - SupplierCatalogRowInput: https://developer.stockroom.app/reference/shapes/#suppliercatalogrowinput - PurchaseOrderStatus: https://developer.stockroom.app/reference/shapes/#purchaseorderstatus - PurchaseOrderSummary: https://developer.stockroom.app/reference/shapes/#purchaseordersummary - PurchaseOrder: https://developer.stockroom.app/reference/shapes/#purchaseorder - PurchaseOrderLine: https://developer.stockroom.app/reference/shapes/#purchaseorderline - PurchaseOrderCharge: https://developer.stockroom.app/reference/shapes/#purchaseordercharge - Payment: https://developer.stockroom.app/reference/shapes/#payment - HistoryRow: https://developer.stockroom.app/reference/shapes/#historyrow - PurchaseOrderInput: https://developer.stockroom.app/reference/shapes/#purchaseorderinput - PurchaseOrderLineInput: https://developer.stockroom.app/reference/shapes/#purchaseorderlineinput - PurchaseOrderChargeInput: https://developer.stockroom.app/reference/shapes/#purchaseorderchargeinput - Receipt: https://developer.stockroom.app/reference/shapes/#receipt - ReceiptInput: https://developer.stockroom.app/reference/shapes/#receiptinput - StockAdjustment: https://developer.stockroom.app/reference/shapes/#stockadjustment - StockAdjustmentInput: https://developer.stockroom.app/reference/shapes/#stockadjustmentinput - Product: https://developer.stockroom.app/reference/shapes/#product - Variant: https://developer.stockroom.app/reference/shapes/#variant - Location: https://developer.stockroom.app/reference/shapes/#location - InventoryLevel: https://developer.stockroom.app/reference/shapes/#inventorylevel - WebhookEvent: https://developer.stockroom.app/reference/shapes/#webhookevent - Webhook: https://developer.stockroom.app/reference/shapes/#webhook - WebhookWithSecret: https://developer.stockroom.app/reference/shapes/#webhookwithsecret - WebhookInput: https://developer.stockroom.app/reference/shapes/#webhookinput - WebhookDelivery: https://developer.stockroom.app/reference/shapes/#webhookdelivery - RedeliverResult: https://developer.stockroom.app/reference/shapes/#redeliverresult - WebhookEnvelopePayload: https://developer.stockroom.app/reference/shapes/#webhookenvelopepayload - ItemCondition: https://developer.stockroom.app/reference/shapes/#itemcondition