Skip to content

Endpoint Reference

This is a reference to common routes used by StockrHub’s own interface, not a public integration contract or a complete schema. All routes below require Shopify App Bridge authentication. IDs belong to the authenticated store. Availability also depends on installation state and the operation’s validation.

Field names follow the implementation, commonly snake_case. Do not substitute the camel-case fields or generic response envelopes used by other APIs. Use StockrHub’s interface for changes to inventory, orders, payments, and fulfillment.

Method Route Purpose
GET /api/dashboard/stats Dashboard counters, including orders needing POs.
GET, PUT /api/dashboard/vendor-pins Read or change the store’s ordered dashboard vendor pins; writes require revision handling.
GET /api/settings/installation Installation readiness and setup state.
GET, PUT /api/settings Store configuration.
GET /api/settings/export Export supported configuration.
POST /api/settings/import Import supported configuration after validation.
POST /api/settings/register-webhooks Reconcile the store’s Shopify webhook registrations.

Configuration export is not a complete operational-data backup and does not transfer a Shopify installation or grant access to another store.

Method Route Purpose
GET, POST /api/suppliers List or create suppliers.
GET, PUT, DELETE /api/suppliers/:id Read, update, or archive a supplier as permitted by existing records.
GET /api/suppliers/:id/motorstate/payment-methods Read Motor State’s saved-card options using the supplier’s saved credentials.
POST /api/suppliers/motorstate/payment-methods Read Motor State card options using the connection form’s credentials.
GET, POST /api/suppliers/:supplierId/payment-accounts Read or add supplier payment-account references.
GET /api/suppliers/:supplierId/vendors Supplier vendor assignments.
POST /api/suppliers/:supplierId/vendors/assign Assign vendors to a supplier.
GET, POST /api/suppliers/:supplierId/locations Read or add supplier location mappings.
GET, POST /api/suppliers/:supplierId/item-pricing Read or add item-pricing rules.

GET /api/suppliers accepts limit (default 50, maximum 1,000), offset, letter, include_archived=1, and include_locations=1. It returns { suppliers, total, limit, offset, letter }, with optional location fields on the supplier records.

The Motor State card routes retrieve the supplier’s available choices. They do not add or replace a card on the supplier account. Use the supplier’s account process to change the underlying card, then refresh the available choices in StockrHub.

Method Route Purpose
GET, POST /api/purchase-orders List or create POs.
GET /api/purchase-orders/:id PO details, items, and activity.
PATCH /api/purchase-orders/:id/notes Edit supported note fields.
PATCH /api/purchase-orders/:id/status Request a permitted status transition.
PATCH /api/purchase-orders/:id/shipping Edit supported shipping details.
PATCH /api/purchase-orders/:id/expected-date Edit the expected date.
PATCH /api/purchase-orders/:id/financials Edit permitted financial fields.
POST /api/purchase-orders/:id/line-items Add a permitted line item.
PATCH, DELETE /api/purchase-orders/:id/line-items/:lineItemId Edit or remove a permitted line item.
POST /api/purchase-orders/:id/submit-api Start the connected supplier submission workflow.
POST /api/purchase-orders/:id/email Send a purchase order email through the configured email service.
GET /api/purchase-orders/:id/pdf Download a PO document.
POST /api/purchase-orders/:id/duplicate Create a separate draft from an existing PO.
POST /api/inventory/receive Record receiving and apply permitted inventory updates.

GET /api/purchase-orders uses supplier_id, q, paid, status, source, include_imported, limit, and offset. The default limit is 50, with a maximum of 200. It returns { purchase_orders, total, limit, offset }.

Status filters use uppercase values. OPEN selects operational SENT, SHIPPED, and PARTIAL POs and excludes archived records. Draft and failed records are not Open. Lifecycle state can make the displayed status differ from raw_status, so preserve the returned effective status rather than rebuilding it from the raw value.

Email and supplier API submission are separate operations. A queue acknowledgement, a saved payment label, or a displayed PO status does not by itself establish supplier acceptance, payment capture, or fulfillment. Check the PO’s activity and confirmed external result.

Method Route Purpose
GET /api/locations Shopify locations available to the store.
GET /api/inventory/levels Cached inventory levels.
GET /api/inventory/search Search inventory for a workflow.
POST /api/inventory/sync Refresh inventory data.
POST /api/inventory/adjust Apply a validated inventory adjustment.
GET, POST /api/stock-counts List or create stock counts.
GET /api/stock-counts/:id Count details and items.
POST, PATCH /api/stock-counts/:id/items Add or update count items.
POST /api/stock-counts/:id/apply Apply a count’s inventory changes.
GET, POST /api/transfers List or create transfers.
GET /api/transfers/:id Transfer details.
POST /api/transfers/:id/ship Ship a staged transfer.
POST /api/transfers/:id/receive Receive a staged transfer.
POST /api/transfers/quick Perform the quick-transfer workflow.

Applying a stock count is a separate operation from editing its items. Transfer shipping and receiving also use separate actions. These operations can change Shopify inventory; they are not generic PUT updates to a status field.

Method Route Purpose
GET, POST /api/reorder/rules Read or save reorder rules.
DELETE /api/reorder/rules/:sku Delete a SKU’s reorder rule.
POST /api/reorder/analyze Run reorder analysis.
GET, POST /api/stock-levels Read or save stock-level rules.
POST /api/stock-levels/bulk Save multiple stock-level rules.
GET /api/forecasting Forecasting data.
POST /api/forecasting/sync Request forecasting history synchronization.
GET /api/forecasting/sync/status Check that synchronization’s state.
GET /api/reports Report data.
GET, POST /api/alert-rules Read or create alert rules.
PUT, DELETE /api/alert-rules/:id Update or delete an alert rule.
GET /api/alert-log Alert history.

Stock-level rules describe target levels. Saving them does not directly replace Shopify inventory quantities. Report modes and payloads vary by workflow; use the Reports interface to select the period and report.

GET /api/export/:type handles supported data exports. Export types and filters are specific to each dataset; this route is not a full-store backup. Other internal routes support Stocky import, connected-supplier reconciliation, automation, and document workflows. They are not a general external API or webhook-subscription service.

For an integration requirement, contact StockrHub with the workflow and store domain. Do not send API credentials, customer data, or copied bearer tokens.