Store API and webhooks
Read and update Store orders, Products, stock, returns, customers and discounts from your own systems, and get signed webhooks when they change.
The Store API lets a program you run, such as a warehouse, shipping or
accounting system, work with the selected team's Store. It uses an API key
from API keys (see API keys and REST API); send X-Magpie-Team-Id
to choose the team. A key can do in Store what its owner can: team admins can
do everything, and a team member needs the matching Store permission, such as
See orders to read orders or Refund and cancel orders to refund them.
Orders
GET /api/v1/store-orderslists orders, newest first. Filter withq(order number, customer name or email),payment,fulfillment,channel,tag,fromandto(dates as2026-10-31).GET /api/v1/store-orders/ORDER_UUIDreturns the order with its items, how many of each have shipped, shipments, refunds, returns, addresses and history.POST /api/v1/store-orders/ORDER_UUID/fulfillmentsadds a shipment withcarrier,tracking_number,tracking_urland theitemsin it. Withoutitems, everything left to ship goes. The customer will be emailed, as when a shipment is added on the order page.POST /api/v1/store-orders/ORDER_UUID/refundsrefunds anamount, or everything still refundable when there is no amount. Sendrestock_itemsto put items back into stock. An order paid through Stripe is refunded in your Stripe account.POST /api/v1/store-orders/ORDER_UUID/notesadds a note to the history, andPUT /api/v1/store-orders/ORDER_UUID/tagsreplaces the order's tags.
Send an Idempotency-Key header with each refund or shipment, for example a
UUID your program makes. If the same request is sent again with the same key,
for a day, the first answer is returned and nothing is done twice.
Orders include the customer's name, email, phone and addresses, so treat the data your program stores as customer data.
Products, stock, returns and customers
GET /api/v1/store-productsandGET /api/v1/store-products/PRODUCT_UUIDreturn Products with every variant's price, SKU and stock.PATCH /api/v1/store-products/PRODUCT_UUID/variants/VARIANT_UUIDchangesprice_amount,compare_at_amount,skuoron_hand. A newon_handis recorded in the stock history as a count correction.POST .../variants/VARIANT_UUID/adjustmentsadds or removes stock with a reason (received,count,damaged,lost,returnedorother).GET /api/v1/store-inventorylists variants that track stock with on hand, held for checkouts and available. Addlow_stock=truefor those at or below their reorder point.GET /api/v1/store-returnsandGET /api/v1/store-customerslist returns and customers; add a UUID to read one.
Discounts
These need Manage discounts.
GET /api/v1/store-discountslists discounts that are not archived. Filter withstatus(active,scheduled,expired,draftorarchived) andq(name or code).GET /api/v1/store-discounts/DISCOUNT_UUIDadds the products and collections it applies to and how many paid orders used it.POST /api/v1/store-discountsadds one. Send"method": "code"with acode, or"method": "automatic"with atitle, then the other settings as on the discount's page:kind(percentage,fixed_amount,free_shippingorbuy_x_get_y),percent_basis_points(1500 is 15%) oramount_off,applies_towithproduct_idsorcollection_ids, a minimum, limits,starts_atandends_at. It is a draft until you send"status": "active".PATCH /api/v1/store-discounts/DISCOUNT_UUIDchanges any of the same settings. If one value is refused, the answer names it and nothing is changed.POST /api/v1/store-discounts/DISCOUNT_UUID/deactivatearchives the discount: it stops applying at checkout and keeps its history. Send"status": "active"to turn it on again.
Prices and totals are whole numbers in the smallest unit of the Store's
currency: 1999 is 19.99 in dollars. Lists return up to
100 records per page.
Webhooks
A webhook sends a POST to an HTTPS address you choose when something happens in the Store. Team admins add them in Store settings › Webhooks: choose Add webhook and give a name and the address. The webhook's page opens with every event turned on and its signing secret shown once. Turn events on or off there, turn the webhook off, change its address, or choose New signing secret or Delete webhook from More. The page also lists the last 50 deliveries; Send again resends a failed one.
Webhooks can also be managed with POST /api/v1/store-webhooks, giving a name,
the URL and the events:
| Event | Sent when |
|---|---|
store.order.paid |
An order is paid, online or recorded by hand |
store.order.fulfilled |
A shipment is added (once per shipment) |
store.order.ready_for_pickup |
A pickup order is marked ready for pickup (once per order) |
store.order.refunded |
A refund succeeds |
store.order.canceled |
An unpaid order is canceled |
store.product.updated |
A Product or its prices change |
store.stock.low |
A variant's stock reaches its reorder point |
store.return.requested |
A customer asks to return items |
A Store can have up to 20 webhooks. The response that
adds a webhook shows its signing secret once; POST /api/v1/store-webhooks/WEBHOOK_UUID/rotate-secret replaces it.
Each POST has the headers X-Magpie-Event, X-Magpie-Id,
X-Magpie-Timestamp and X-Magpie-Signature. Before using the body, compute
the HMAC-SHA256 of the timestamp, a full stop and the raw body with the
secret, and compare it with the v1 value in X-Magpie-Signature
(t=<timestamp>,v1=<signature>). X-Magpie-Id stays the same when a webhook
is sent again, so store it and ignore a repeat.
Answer with any 2xx status. Any other answer, or no answer, will be retried
with longer waits over about two days; after 8
attempts the delivery fails.
GET /api/v1/store-webhooks/WEBHOOK_UUID/deliveries lists each delivery and
its last result, and POST .../deliveries/DELIVERY_ID/retry sends a failed one
again. Turning a webhook off, or changing its URL or events, cancels what it
has not received.
The full reference, with every field, is the OpenAPI file linked from
/docs/api. If a webhook signature does not match or a response differs from
the reference, Contact support.