MyShopy Help Center
Help Center › API

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/v1

It 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.

The API is available on plans that include API access. MCP and the REST API share the same access tokens.

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#

TopicRule
FormatJSON in, JSON out. Send Content-Type: application/json with a body
MoneyMajor units. Send numbers (799 means ₹799.00); responses return decimal strings ("799.00") so no precision is lost
IDsProducts and collections accept the numeric id or the handle. Orders accept the id or the order number
DatesISO 8601 (2026-11-10 or 2026-11-10T09:30:00Z)
Partial updatesPATCH changes only the fields you send
Success200 OK, or 201 Created for creates

Errors#

{ "error": { "status": 403, "message": "This token is missing the \"write_orders\" scope.", "required_scope": "write_orders" } }
StatusMeaning
400 / 422Invalid input, the message says which field
401Missing, invalid or revoked token
402A plan limit was reached (e.g. max products)
403API not in the store's plan, or the token lacks a scope
404No such endpoint or record
405Wrong HTTP method for this path
415Body isn't JSON
429Rate limit, wait for Retry-After seconds
500Our 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.

ScopeAllows
read_productsRead products, variants, inventory and collections
write_productsCreate, update and delete products, inventory and collections
read_ordersRead orders
write_ordersMark paid, fulfill, cancel, archive and add notes to orders
read_customersRead customers
read_discountsRead discount codes
write_discountsCreate and update discount codes
read_contentRead pages and navigation menus
write_contentCreate and update pages and menus
read_themesRead themes, page layouts and theme settings
write_themesChange sections, theme settings, code; publish themes
read_analyticsRead sales analytics
read_settingsRead store information
write_settingsUpdate store settings

Endpoints#

MethodPathScope
GET/api/v1/shopread_settings
PATCH/api/v1/shopwrite_settings
GET/api/v1/productsread_products
GET/api/v1/products/:idread_products
POST/api/v1/productswrite_products
PATCH/api/v1/products/:idwrite_products
DELETE/api/v1/products/:idwrite_products
POST/api/v1/inventorywrite_products
GET/api/v1/inventory/low-stockread_products
GET/api/v1/collectionsread_products
POST/api/v1/collectionswrite_products
PATCH/api/v1/collections/:idwrite_products
GET/api/v1/ordersread_orders
GET/api/v1/orders/:idread_orders
POST/api/v1/orders/:id/fulfillwrite_orders
POST/api/v1/orders/:id/mark-paidwrite_orders
POST/api/v1/orders/:id/cancelwrite_orders
POST/api/v1/orders/:id/archivewrite_orders
POST/api/v1/orders/:id/noteswrite_orders
GET/api/v1/returnsread_orders
GET/api/v1/returns/:idread_orders
POST/api/v1/orders/:id/returnswrite_orders
POST/api/v1/returns/:id/:actionwrite_orders
GET/api/v1/customersread_customers
GET/api/v1/customers/:idread_customers
GET/api/v1/discountsread_discounts
POST/api/v1/discountswrite_discounts
PATCH/api/v1/discounts/:codewrite_discounts
GET/api/v1/pagesread_content
PUT/api/v1/pages/:handlewrite_content
GET/api/v1/menusread_content
PUT/api/v1/menus/:handlewrite_content
GET/api/v1/analyticsread_analytics
GET/api/v1/themesread_themes
GET/api/v1/themes/:theme_id/layoutread_themes
GET/api/v1/themes/:theme_id/settingsread_themes
PATCH/api/v1/themes/:theme_id/settingswrite_themes
POST/api/v1/themes/:theme_id/sectionswrite_themes
POST/api/v1/themes/:theme_id/publishwrite_themes

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 fieldTypeNotes
namestringStore name
emailstringContact email
phonestring
descriptionstring
logostringImage URL
free_shipping_thresholdnumberAmount in major units, 0 = off
seo_titlestring
seo_descriptionstring
policy_refund · policy_privacy · policy_terms · policy_shippingstringHTML
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 parameterTypeNotes
querystringSearch title, tags, type, vendor
statusstringactivedraftarchived
limitnumberDefault 20, max 100
offsetnumberFor 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 fieldTypeNotes
titlestringRequired
descriptionstringHTML
pricenumber
compare_at_pricenumber
inventory_quantitynumber
skustring
vendorstring
product_typestring
tagsstring[]
statusstringactivedraft
optionsstring[]e.g. ["Size","Color"]
variantsobject[]{option1, option2, price, compare_at_price, sku, inventory_quantity}
imagesstring[]Public image URLs (copied to the image CDN in the background)
collectionsstring[]Collection handles
seo_title · seo_descriptionstring
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 fieldTypeNotes
variant_idnumberVariant id
product_idstringOr product id / handle (uses its first variant)
quantitynumberNew absolute quantity
adjustnumberRelative 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 parameterTypeNotes
thresholdnumberDefault 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 fieldTypeNotes
titlestringRequired
descriptionstringHTML
imagestringImage URL
productsstring[]Product ids or handles (manual)
rulesobject[]{column: tagtitletypevendorpriceinventory, relation: equalsnot_equalscontainsnot_containsstarts_withgreater_thanless_than, condition}
disjunctivebooleanMatch ANY rule instead of ALL
sort_orderstringmanualbest-sellingtitle-ascendingprice-ascendingprice-descendingcreated-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 parameterTypeNotes
filterstringallunfulfilledunpaidpaidcancelled
querystringOrder number, email or phone
sincestringYYYY-MM-DD
limitnumberDefault 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 fieldTypeNotes
tracking_companystring
tracking_numberstring
tracking_urlstring
notify_customerbooleanDefault 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 fieldTypeNotes
reasonstringcustomerinventoryfraudother
restockbooleanPut 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 fieldTypeNotes
notestringRequired
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 parameterTypeNotes
statusstringrequestedopendonedeclinedall
orderstringOrder id or number
limitnumberDefault 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 fieldTypeNotes
itemsarray[{order_item_id, quantity, reason, exchange_variant_id}]
resolutionstringrefundexchangestore_credit
reasonstring
notestring
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 fieldTypeNotes
messagestringapprove / decline
reasonstringdecline
pickupbooleanapprove: book a courier pickup
restockobjectreceive: {return_item_id: true/false}
amountnumberrefund: amount (e.g. 749.50); default = suggested
methodstringrefund: originalstore_creditmanual
notestringadd_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 parameterTypeNotes
querystring
sortstringrecenttop (by total spent)
limitnumberDefault 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 fieldTypeNotes
codestringRequired
typestringpercentagefixedfree_shipping (required)
valuenumberPercent or amount
min_subtotalnumber
usage_limitnumber
once_per_customerboolean
starts_at · ends_atstringISO 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 fieldTypeNotes
activeboolean
valuenumber
ends_atstring
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 fieldTypeNotes
titlestringRequired
contentstringHTML
publishedboolean
template_suffixstring
seo_title · seo_descriptionstring
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 fieldTypeNotes
titlestring
itemsobject[][{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 parameterTypeNotes
daysnumberDefault 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 parameterTypeNotes
templatestringindexproductcollectionpagecartsearchheaderfooter …
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 fieldTypeNotes
templatestringDefault index
typestringSection type (required)
settingsobject
blocksobject[]
positionnumberIndex; 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"
Didn’t find what you need?Contact support