REST Admin API
Connect your own apps, ERP, inventory, shipping or accounting tools to a store.
Every store has a JSON REST API at its own domain:
https://{store-domain}/api/v1It covers products, inventory, collections, orders, customers, discounts, pages, menus, analytics and themes. Each endpoint runs the same code as the store admin and the MCP connector, so behaviour is identical everywhere.
1. Create an access token#
In the store admin: Settings → API access → Create token. Give it a name (e.g. Inventory sync) and, optionally, limit it to the scopes it needs. The token (sk_…) is shown once, so store it in a secret manager or environment variable.
2. Make a request#
curl https://demo.mystores.in/api/v1/products?limit=2 \
-H "Authorization: Bearer sk_your_token"{
"products": [
{
"id": 12, "title": "Cotton T-shirt", "handle": "cotton-t-shirt", "status": "active",
"vendor": "", "product_type": "Apparel", "tags": ["summer"], "options": ["Title"],
"url": "/products/cotton-t-shirt", "images": ["https://…/tee.jpg"],
"variants": [{ "id": 21, "title": "Default", "sku": "TEE-01", "price": "799.00", "compare_at_price": "999.00", "inventory_quantity": 25 }]
}
],
"total": 10
}JavaScript (Node 18+ / browser)#
const api = (path, opts = {}) => fetch(`https://demo.mystores.in/api/v1${path}`, {
...opts,
headers: { Authorization: `Bearer ${process.env.STORE_TOKEN}`, 'Content-Type': 'application/json', ...opts.headers },
body: opts.body ? JSON.stringify(opts.body) : undefined,
}).then(async (r) => { const d = await r.json(); if (!r.ok) throw new Error(d.error.message); return d; });
const { product } = await api('/products', { method: 'POST', body: { title: 'Masala Chai 250g', price: 349, inventory_quantity: 40 } });
await api(`/orders/1001/fulfill`, { method: 'POST', body: { tracking_company: 'Delhivery', tracking_number: 'DL123456789IN' } });Python#
import os, requests
S = requests.Session()
S.headers.update({"Authorization": f"Bearer {os.environ['STORE_TOKEN']}"})
BASE = "https://demo.mystores.in/api/v1"
orders = S.get(f"{BASE}/orders", params={"filter": "unfulfilled", "limit": 50}).json()["orders"]
for o in orders:
print(o["name"], o["total"], o["email"])PHP#
$ch = curl_init("https://demo.mystores.in/api/v1/inventory");
curl_setopt_array($ch, [
CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("STORE_TOKEN"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["product_id" => "masala-chai-250g", "adjust" => -2]),
]);
$result = json_decode(curl_exec($ch), true);Conventions#
| Topic | Rule |
|---|---|
| Format | JSON in, JSON out. Send Content-Type: application/json with a body |
| Money | Major units. Send numbers (799 means ₹799.00); responses return decimal strings ("799.00") so no precision is lost |
| IDs | Products and collections accept the numeric id or the handle. Orders accept the id or the order number |
| Dates | ISO 8601 (2026-11-10 or 2026-11-10T09:30:00Z) |
| Partial updates | PATCH changes only the fields you send |
| Success | 200 OK, or 201 Created for creates |
Errors#
{ "error": { "status": 403, "message": "This token is missing the \"write_orders\" scope.", "required_scope": "write_orders" } }| Status | Meaning |
|---|---|
| 400 / 422 | Invalid input, the message says which field |
| 401 | Missing, invalid or revoked token |
| 402 | A plan limit was reached (e.g. max products) |
| 403 | API not in the store's plan, or the token lacks a scope |
| 404 | No such endpoint or record |
| 405 | Wrong HTTP method for this path |
| 415 | Body isn't JSON |
| 429 | Rate limit, wait for Retry-After seconds |
| 500 | Our fault. Retry later |
Rate limits#
120 requests per minute per token. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix time). For bulk work, use one token per integration and back off when you get 429.
Scopes#
A token with no scopes has full access. Otherwise it can only call endpoints whose scope it has. A write_ scope includes the matching read_ scope.
| Scope | Allows |
|---|---|
read_products | Read products, variants, inventory and collections |
write_products | Create, update and delete products, inventory and collections |
read_orders | Read orders |
write_orders | Mark paid, fulfill, cancel, archive and add notes to orders |
read_customers | Read customers |
read_discounts | Read discount codes |
write_discounts | Create and update discount codes |
read_content | Read pages and navigation menus |
write_content | Create and update pages and menus |
read_themes | Read themes, page layouts and theme settings |
write_themes | Change sections, theme settings, code; publish themes |
read_analytics | Read sales analytics |
read_settings | Read store information |
write_settings | Update store settings |
Endpoints#
Store#
GET /api/v1/shop#
Store name, domain, currency, plan and counts of products, orders and customers. Scope: read_settings.
curl "https://demo.mystores.in/api/v1/shop" \
-H "Authorization: Bearer $TOKEN"PATCH /api/v1/shop#
Update store settings. Send only the fields to change. Scope: write_settings.
| Body field | Type | Notes |
|---|---|---|
name | string | Store name |
email | string | Contact email |
phone | string | |
description | string | |
logo | string | Image URL |
free_shipping_threshold | number | Amount in major units, 0 = off |
seo_title | string | |
seo_description | string | |
policy_refund · policy_privacy · policy_terms · policy_shipping | string | HTML |
curl -X PATCH "https://demo.mystores.in/api/v1/shop" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Demo Store","free_shipping_threshold":999}'Products#
GET /api/v1/products#
List or search products. Prices are in major currency units (e.g. rupees). Scope: read_products.
| Query parameter | Type | Notes | ||
|---|---|---|---|---|
query | string | Search title, tags, type, vendor | ||
status | string | active | draft | archived |
limit | number | Default 20, max 100 | ||
offset | number | For pagination |
curl "https://demo.mystores.in/api/v1/products?query=&status=" \
-H "Authorization: Bearer $TOKEN"GET /api/v1/products/:id#
One product with variants and images. :id can be the numeric id or the handle. Scope: read_products.
curl "https://demo.mystores.in/api/v1/products/cotton-t-shirt" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/products#
Create a product. For a simple product send price / inventory_quantity; for variants send options + variants. Scope: write_products.
| Body field | Type | Notes | |
|---|---|---|---|
title | string | Required | |
description | string | HTML | |
price | number | ||
compare_at_price | number | ||
inventory_quantity | number | ||
sku | string | ||
vendor | string | ||
product_type | string | ||
tags | string[] | ||
status | string | active | draft |
options | string[] | e.g. ["Size","Color"] | |
variants | object[] | {option1, option2, price, compare_at_price, sku, inventory_quantity} | |
images | string[] | Public image URLs (copied to the image CDN in the background) | |
collections | string[] | Collection handles | |
seo_title · seo_description | string |
curl -X POST "https://demo.mystores.in/api/v1/products" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Cotton T-shirt","price":799,"compare_at_price":999,"inventory_quantity":25,"tags":["summer","cotton"],"images":["https://example.com/tee.jpg"]}'PATCH /api/v1/products/:id#
Update any product fields (same fields as create). Sending variants replaces all variants. Scope: write_products.
curl -X PATCH "https://demo.mystores.in/api/v1/products/cotton-t-shirt" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"price":699,"status":"active"}'DELETE /api/v1/products/:id#
Delete a product permanently. Scope: write_products.
curl -X DELETE "https://demo.mystores.in/api/v1/products/cotton-t-shirt" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/inventory#
Set (quantity) or adjust (adjust) stock of a variant, or of a product's only variant. Scope: write_products.
| Body field | Type | Notes |
|---|---|---|
variant_id | number | Variant id |
product_id | string | Or product id / handle (uses its first variant) |
quantity | number | New absolute quantity |
adjust | number | Relative change, e.g. -2 |
curl -X POST "https://demo.mystores.in/api/v1/inventory" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"product_id":"cotton-t-shirt","adjust":-1}'GET /api/v1/inventory/low-stock#
Variants at or below a stock threshold. Scope: read_products.
| Query parameter | Type | Notes |
|---|---|---|
threshold | number | Default 5 |
curl "https://demo.mystores.in/api/v1/inventory/low-stock?threshold=" \
-H "Authorization: Bearer $TOKEN"Collections#
GET /api/v1/collections#
All collections with product counts. Scope: read_products.
curl "https://demo.mystores.in/api/v1/collections" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/collections#
Create a manual collection (products) or an automated one (rules). Scope: write_products.
| Body field | Type | Notes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
title | string | Required | |||||||||||
description | string | HTML | |||||||||||
image | string | Image URL | |||||||||||
products | string[] | Product ids or handles (manual) | |||||||||||
rules | object[] | {column: tag | title | type | vendor | price | inventory, relation: equals | not_equals | contains | not_contains | starts_with | greater_than | less_than, condition} |
disjunctive | boolean | Match ANY rule instead of ALL | |||||||||||
sort_order | string | manual | best-selling | title-ascending | price-ascending | price-descending | created-descending |
curl -X POST "https://demo.mystores.in/api/v1/collections" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Summer sale","rules":[{"column":"tag","relation":"equals","condition":"summer"}]}'PATCH /api/v1/collections/:id#
Update a collection; add_products / remove_products take product ids or handles. Scope: write_products.
curl -X PATCH "https://demo.mystores.in/api/v1/collections/cotton-t-shirt" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"add_products":["cotton-t-shirt"]}'Orders#
GET /api/v1/orders#
List orders, newest first. Scope: read_orders.
| Query parameter | Type | Notes | ||||
|---|---|---|---|---|---|---|
filter | string | all | unfulfilled | unpaid | paid | cancelled |
query | string | Order number, email or phone | ||||
since | string | YYYY-MM-DD | ||||
limit | number | Default 20, max 100 |
curl "https://demo.mystores.in/api/v1/orders?filter=&query=" \
-H "Authorization: Bearer $TOKEN"GET /api/v1/orders/:id#
Full order: items, addresses, payments, fulfillments. :id can be the id or the order number. Scope: read_orders.
curl "https://demo.mystores.in/api/v1/orders/1001" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/orders/:id/fulfill#
Mark an order fulfilled, optionally with tracking and a customer email. Scope: write_orders.
| Body field | Type | Notes |
|---|---|---|
tracking_company | string | |
tracking_number | string | |
tracking_url | string | |
notify_customer | boolean | Default true |
curl -X POST "https://demo.mystores.in/api/v1/orders/1001/fulfill" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"tracking_company":"Delhivery","tracking_number":"DL123456789IN","notify_customer":true}'POST /api/v1/orders/:id/mark-paid#
Record payment for an order (e.g. Cash on Delivery collected). Scope: write_orders.
curl -X POST "https://demo.mystores.in/api/v1/orders/1001/mark-paid" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/orders/:id/cancel#
Cancel an order. Scope: write_orders.
| Body field | Type | Notes | |||
|---|---|---|---|---|---|
reason | string | customer | inventory | fraud | other |
restock | boolean | Put items back in stock |
curl -X POST "https://demo.mystores.in/api/v1/orders/1001/cancel" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason":"customer","restock":true}'POST /api/v1/orders/:id/archive#
Archive an order. Scope: write_orders.
curl -X POST "https://demo.mystores.in/api/v1/orders/1001/archive" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/orders/:id/notes#
Add an internal note to an order. Scope: write_orders.
| Body field | Type | Notes |
|---|---|---|
note | string | Required |
curl -X POST "https://demo.mystores.in/api/v1/orders/1001/notes" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"note":"Gift wrap requested"}'Returns#
GET /api/v1/returns#
List returns, newest first. Scope: read_orders.
| Query parameter | Type | Notes | ||||
|---|---|---|---|---|---|---|
status | string | requested | open | done | declined | all |
order | string | Order id or number | ||||
limit | number | Default 20, max 100 |
curl "https://demo.mystores.in/api/v1/returns?status=&order=" \
-H "Authorization: Bearer $TOKEN"GET /api/v1/returns/:id#
Full return with items, suggested refund and timeline. :id can be the id or the number (R1001). Scope: read_orders.
curl "https://demo.mystores.in/api/v1/returns/cotton-t-shirt" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/orders/:id/returns#
Create and approve a return for an order (staff can override the return window). Scope: write_orders.
| Body field | Type | Notes | ||
|---|---|---|---|---|
items | array | [{order_item_id, quantity, reason, exchange_variant_id}] | ||
resolution | string | refund | exchange | store_credit |
reason | string | |||
note | string |
curl -X POST "https://demo.mystores.in/api/v1/orders/cotton-t-shirt/returns" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"items":[{"order_item_id":12,"quantity":1,"reason":"Size too small"}],"resolution":"refund"}'POST /api/v1/returns/:id/:action#
approve | decline | receive | refund | exchange | close | add_note. The customer is emailed at each step. Scope: write_orders.
| Body field | Type | Notes | ||
|---|---|---|---|---|
message | string | approve / decline | ||
reason | string | decline | ||
pickup | boolean | approve: book a courier pickup | ||
restock | object | receive: {return_item_id: true/false} | ||
amount | number | refund: amount (e.g. 749.50); default = suggested | ||
method | string | refund: original | store_credit | manual |
note | string | add_note / manual refund reference |
curl -X POST "https://demo.mystores.in/api/v1/returns/cotton-t-shirt/:action" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount":749,"method":"original"}'Customers#
GET /api/v1/customers#
Search customers by name, email or phone. Scope: read_customers.
| Query parameter | Type | Notes | |
|---|---|---|---|
query | string | ||
sort | string | recent | top (by total spent) |
limit | number | Default 20 |
curl "https://demo.mystores.in/api/v1/customers?query=&sort=" \
-H "Authorization: Bearer $TOKEN"GET /api/v1/customers/:id#
One customer with addresses and recent orders. Scope: read_customers.
curl "https://demo.mystores.in/api/v1/customers/42" \
-H "Authorization: Bearer $TOKEN"Discounts#
GET /api/v1/discounts#
All discount codes. Scope: read_discounts.
curl "https://demo.mystores.in/api/v1/discounts" \
-H "Authorization: Bearer $TOKEN"POST /api/v1/discounts#
Create a discount code. Scope: write_discounts.
| Body field | Type | Notes | ||
|---|---|---|---|---|
code | string | Required | ||
type | string | percentage | fixed | free_shipping (required) |
value | number | Percent or amount | ||
min_subtotal | number | |||
usage_limit | number | |||
once_per_customer | boolean | |||
starts_at · ends_at | string | ISO dates |
curl -X POST "https://demo.mystores.in/api/v1/discounts" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"code":"DIWALI20","type":"percentage","value":20,"ends_at":"2026-11-15"}'PATCH /api/v1/discounts/:code#
Activate / deactivate a code or change its value or end date. Scope: write_discounts.
| Body field | Type | Notes |
|---|---|---|
active | boolean | |
value | number | |
ends_at | string |
curl -X PATCH "https://demo.mystores.in/api/v1/discounts/DIWALI20" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"active":false}'Content#
GET /api/v1/pages#
All content pages. Scope: read_content.
curl "https://demo.mystores.in/api/v1/pages" \
-H "Authorization: Bearer $TOKEN"PUT /api/v1/pages/:handle#
Create or update a page by handle. template_suffix: "contact" adds a contact form. Scope: write_content.
| Body field | Type | Notes |
|---|---|---|
title | string | Required |
content | string | HTML |
published | boolean | |
template_suffix | string | |
seo_title · seo_description | string |
curl -X PUT "https://demo.mystores.in/api/v1/pages/about-us" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"About us","content":"<p>We make handmade candles.</p>","published":true}'GET /api/v1/menus#
Navigation menus with nested links. Scope: read_content.
curl "https://demo.mystores.in/api/v1/menus" \
-H "Authorization: Bearer $TOKEN"PUT /api/v1/menus/:handle#
Replace a menu's links (creates the menu if needed). Scope: write_content.
| Body field | Type | Notes |
|---|---|---|
title | string | |
items | object[] | [{title, url, links?: [{title, url}]}] |
curl -X PUT "https://demo.mystores.in/api/v1/menus/main-menu" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"items":[{"title":"Shop","url":"/collections/all"},{"title":"About","url":"/pages/about-us"}]}'Analytics#
GET /api/v1/analytics#
Sales totals, daily series, top products and conversion for the last N days. Scope: read_analytics.
| Query parameter | Type | Notes |
|---|---|---|
days | number | Default 30 |
curl "https://demo.mystores.in/api/v1/analytics?days=" \
-H "Authorization: Bearer $TOKEN"Themes#
GET /api/v1/themes#
Installed themes (role: main is live). Scope: read_themes.
curl "https://demo.mystores.in/api/v1/themes" \
-H "Authorization: Bearer $TOKEN"GET /api/v1/themes/:theme_id/layout#
Sections (in order) of a page template. Scope: read_themes.
| Query parameter | Type | Notes | |||||||
|---|---|---|---|---|---|---|---|---|---|
template | string | index | product | collection | page | cart | search | header | footer … |
curl "https://demo.mystores.in/api/v1/themes/1/layout?template=" \
-H "Authorization: Bearer $TOKEN"GET /api/v1/themes/:theme_id/settings#
Global theme settings (colors, fonts, layout…). Scope: read_themes.
curl "https://demo.mystores.in/api/v1/themes/1/settings" \
-H "Authorization: Bearer $TOKEN"PATCH /api/v1/themes/:theme_id/settings#
Merge global theme settings. Scope: write_themes.
curl -X PATCH "https://demo.mystores.in/api/v1/themes/1/settings" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"color_accent":"#0f766e","font_heading":"Poppins"}'POST /api/v1/themes/:theme_id/sections#
Add a section to a page template. Scope: write_themes.
| Body field | Type | Notes |
|---|---|---|
template | string | Default index |
type | string | Section type (required) |
settings | object | |
blocks | object[] | |
position | number | Index; default end |
curl -X POST "https://demo.mystores.in/api/v1/themes/1/sections" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"template":"index","type":"rich-text","settings":{"align":"center"}}'POST /api/v1/themes/:theme_id/publish#
Make a theme live. Scope: write_themes.
curl -X POST "https://demo.mystores.in/api/v1/themes/1/publish" \
-H "Authorization: Bearer $TOKEN"