Skip to content

API overview

MyShopie exposes a versioned REST API in two planes. The central API handles the account that owns a store — plans, billing, domains at the platform level. The tenant API is your store itself: catalog, orders, customers, settings, POS and the public storefront endpoints a shopper’s browser calls. Both speak JSON, both return the same response envelope, and both are versioned under /api/v1.

Plans: All plans

  • A store, and a staff account on it. See Create your store.
  • For integration work rather than a browser session, an Admin API key — see Authentication.
  • HTTPS. Every endpoint rejects plain HTTP.
Plane Base URL What lives here
Central https://myshopie.app/api/v1/central The account, plans, subscription, tenant records
Tenant https://{your-store-domain}/api/v1 Catalog, orders, customers, settings, POS, storefront

Your store domain is whichever hostname serves the store — your custom domain once verified, otherwise your *.myshopie.app subdomain. Both resolve to the same tenant, so either works.

Three separate identities call the API, and an endpoint accepts exactly one of them.

Guard Who it is How the token is obtained
auth:central The account owner on the platform Central login
auth:sanctum Store staff, or an Admin API key POST /login, or a key from Settings → AI Agents
auth:customer A shopper with an account on your store POST /customer/login, passkey, Google, or an email code

Pass the token as Authorization: Bearer <token> on every request. A guest shopper with a cart but no account carries an X-Guest-Token header instead, which is not an identity — it identifies the cart only.

Full detail, including the POS two-token model and scoped agent keys, is on Authentication.

Every controller answers through a shared base, so the shape is predictable:

{
"success": true,
"message": "Products retrieved",
"data": { }
}
  • success is a boolean, not a copy of the status code. Check the HTTP status first.
  • message is human-readable and may change. Never branch on its text.
  • data carries the payload. For a list it holds the collection plus pagination metadata.

On a failure success is false, message names the problem, and validation errors arrive under errors keyed by field, in Laravel’s standard shape.

Status Meaning
200 / 201 Success
401 No token, an expired token, or the wrong guard for this route
403 Authenticated, but blocked by a permission, an app install or a plan entitlement
404 Not found — or not found in your store, which is the same answer
422 Validation failed; read errors
429 Rate limited; read the Retry-After header
503 Store is in maintenance mode, for the public lanes only
  1. Sign in as staff against your own store domain:

    Terminal window
    curl -X POST https://your-store.example/api/v1/login \
    -H 'Accept: application/json' \
    -d 'email=you@example.com&password=…'
  2. Copy the token out of data, and confirm who you are:

    Terminal window
    curl https://your-store.example/api/v1/me \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer <token>'
  3. Read something public, with no token at all:

    Terminal window
    curl https://your-store.example/api/v1/store/config -H 'Accept: application/json'
  4. Read something staff-only, to confirm the guard:

    Terminal window
    curl https://your-store.example/api/v1/orders -H 'Authorization: Bearer <token>'

If step 3 works and step 4 returns 401, the token is wrong or expired. If step 4 returns 403, the token is fine and the role is missing a permission.

Each lane is throttled separately, so a busy storefront cannot starve your integration.

Lane Limit Counted per
Sign-in (/login, /signup, passkeys, OAuth exchange) 10 / minute IP
One-time codes (guest and shopper OTP) 5 per 15 minutes IP and store
Password reset 5 per 15 minutes IP
Public storefront reads 180 / minute Staff token if present, otherwise IP
Product search hints 60 / minute IP
Checkout and payment requests 20 / minute IP
Agent and partner API keys 120 / minute per IP and 60 / minute per key Both
Image proxy 120 / minute (configurable) IP
Custom-plan requests 3 / minute and 10 / hour IP

A throttled request returns 429 with Retry-After. Back off on that header rather than retrying immediately; the counters are per-minute windows, so a tight retry loop simply stays blocked.

Authentication gets you in. Two further gates decide whether a route exists for your store.

Gate Behaviour
App install A route under require.app:pos or require.app:b2b_wholesale returns 403 until that app is installed
Plan entitlement A route under require.entitlement:<key> returns 403 unless your plan includes that feature key

So POS endpoints are absent on a store without the POS app, B2B company endpoints are absent without the wholesale app, and gift-card or custom-domain endpoints follow the plan. This is why two stores on the same API version can legitimately disagree about which endpoints exist. See Apps & integrations.

While maintenance is enabled under Settings, the public catalog, cart and checkout endpoints return 503. Deliberately still reachable: GET /store/config, every authentication endpoint, /me, and the preview-token endpoint — so staff and a preview link can work on a store the public cannot reach. The GET /storefront/access probe tells a client which state it is in without guessing from a 503.

401 on an endpoint that worked yesterday. Staff tokens expire. Call POST /auth/refresh, which is deliberately public because the access token may already be expired.

403 with a valid token. A permission, an app install or a plan entitlement — in that order of likelihood. The error message names which.

404 for a product you can see in admin. The public lanes only return published, in-scope records. Draft products are visible to staff tokens only.

429 during an import. You are on a public lane. Authenticate: the public read limiter counts per staff token rather than per IP once a token is present.

503 on the catalog but not on login. Maintenance mode is on, working exactly as designed.

A cart empties between requests. The X-Guest-Token header was not echoed back on the next call. A guest cart belongs to the token, not to the IP or the session.

Is there a v2 of the MyShopie API? No. v1 is the only public surface. The v2 route files exist in the codebase as empty placeholders and load no endpoints, so nothing should be built against /api/v2. Breaking changes will be announced before any v2 ships.

Why does an endpoint return 403 when my token is valid? Authentication and authorization are separate. A 403 usually means the route is gated by an app install (require.app) or by a plan entitlement (require.entitlement) that your store does not have, or by a staff permission your role is missing. Install the app or upgrade the plan rather than reissuing the token.

What happens to API calls while my store is in maintenance mode? Public catalog, cart and checkout endpoints return 503 while maintenance is enabled. Store config, the authentication endpoints, /me and the preview-token endpoint keep working, so a staff member or a preview session can still reach the store.

What are the API rate limits? Public storefront reads allow 180 requests per minute, product search 60, checkout 20, and sign-in attempts 10. Agent and partner keys allow 120 requests per minute per IP and 60 per minute per key. One-time codes and password resets allow 5 attempts per 15 minutes.