Weftstore API
Connect a store to the software around it. The Admin API reads and changes orders, products, stock, customers, discounts and content. Webhooks tell your app the moment something happens. The Storefront API runs your own storefront or mobile app on the store's catalog and carts.
Quick start#
There are two ways in. Pick by who will use the app.
Connect your own store#
- 1Create an appIn the store's admin, open Apps and create an app for the software you're connecting. Choose what it can read and change; you can change that later.
- 2Copy the access tokenThe Admin API access token is shown once, right after the app is created. Keep it on your server like a password. The app page also shows the storefront token and the secret that signs webhooks.
- 3Make a request
Every request names the API version and sends the token in a header:
Requestcurl https://store.weftgrid.com/api/admin/2026-10/shop.json \ -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" - 4Subscribe to webhooksAdd webhooks on the app page or with POST /webhooks.json, and your app hears about new orders, payments and shipments without polling. See Webhooks.
Authentication and scopes#
Send the app's Admin API access token in the X-Storeloom-Access-Token header (or as Authorization: Bearer slat_…). A token belongs to one app in one store: requests only ever see that store's data, and ids from other stores answer 404. A custom app's token is copied from the admin. An App Store app gets one for each store that installs it, through OAuth.
Each app has the access its scopes give it. A write scope includes reading the same resource. A request without the scope its endpoint needs gets a 403 that names the scope; every endpoint in this reference shows the scope it needs. Store owners and staff with the Apps permission can change an app's scopes, rotate its token or delete it at any time, so be ready for a 401 or 403.
| Read | Read and write |
|---|---|
read_productsRead products, variants and collections | write_productsEdit products, variants and collections |
read_inventoryRead stock levels | write_inventoryAdjust stock levels and transfer stock between locations |
read_locationsRead locations | write_locationsAdd and edit locations |
read_ordersRead orders, fulfillments, refunds and transactions | write_ordersEdit, fulfill, refund and cancel orders |
read_returnsRead returns | write_returnsCreate, approve, decline and close returns |
read_draft_ordersRead draft orders | write_draft_ordersCreate and complete draft orders |
read_customersRead customers | write_customersEdit customers |
read_discountsRead discounts | write_discountsEdit discounts |
read_gift_cardsRead gift cards | write_gift_cardsIssue and disable gift cards |
read_contentRead pages, blogs, articles and menus | write_contentEdit pages, blogs, articles and menus |
read_translationsRead translated content | write_translationsEdit translated content |
read_policiesRead store policies | write_policiesEdit store policies |
read_filesRead files | write_filesUpload and delete files |
read_metaobject_definitionsRead metaobject definitions (content types) | write_metaobject_definitionsAdd, edit and delete metaobject definitions |
read_metaobjectsRead metaobject entries | write_metaobjectsAdd, edit and delete metaobject entries |
read_shippingRead shipping zones and rates | write_shippingEdit shipping zones and rates |
read_marketsRead markets, their countries, currencies and prices | write_marketsEdit markets and their prices |
read_store_creditRead customers' store credit and its history | write_store_creditAdd and remove store credit |
read_themesRead themes, their templates and files | write_themesAdd, edit, publish and delete themes |
read_script_tagsRead the app's storefront scripts | write_script_tagsAdd and remove storefront scripts |
read_reviewsRead product reviews (Loom Reviews) | write_reviewsAdd, moderate, reply to and delete product reviews |
The Storefront API uses a different, public token: see Storefront API authentication. Admin API tokens start with slat_, storefront tokens with slst_ and API secrets with slsk_, which makes a leaked secret easy to spot.
Versioning#
The version is part of every URL: /api/admin/2026-10/…. The current version is 2026-10. Responses carry the version that served them in X-Storeloom-API-Version, and a version that isn't supported answers 404 with the version to use. Webhook subscriptions keep the version they were created with, shown in each delivery's headers.
A version is deprecated at least 6 months before it stops working, and replies from a deprecated version carry Deprecation, Sunset and Link headers. Versions and changelog has the policy, the list of versions and everything that has changed.
Requests and responses#
- Bodies are JSON (
Content-Type: application/json, up to 2 MB). They may be wrapped in the resource's name, as in Shopify's API ({ "order": { … } }), or sent unwrapped. - Field names are snake_case. Ids are opaque strings: store them as they are.
- Money is a decimal string in the store's currency, like
"58.00"(or"1500"in zero-decimal currencies). Send amounts the same way; numbers work too. - Times are ISO 8601 in UTC, like
2026-10-23T09:30:00.000Z. Tags come back as one comma-separated string and can be sent as a string or a list. - A successful request answers 200, or 201 when it creates something. Lists and single resources come wrapped in their name:
{ "orders": [ … ] },{ "order": { … } }. fields=id,name,updated_aton list and get endpoints returns only those top-level fields.- Every response has an
X-Request-Id. Include it when you ask for help.
Pagination#
Lists that page return up to limit results (1 to 250, default 50). When there are more, the Link header has the URL of the next page, and of the previous one after the first page:
Link: <https://store.weftgrid.com/api/admin/2026-10/orders.json?limit=50&page_info=eyJkaXIiOiJuZXh0Ii…>; rel="next"Follow those URLs as they are. Filters from the first request carry over in page_info, so a page_info request takes only limit and fields besides; anything else is a 400. To sync incrementally, filter on updated_at_min with the time of your last sync, or page through new records with since_id.
// Every order changed since your last sync, 250 at a time.
let url = "https://store.weftgrid.com/api/admin/2026-10/orders.json?status=any&limit=250&updated_at_min=" + lastSync;
while (url) {
const res = await fetch(url, { headers: { "X-Storeloom-Access-Token": process.env.STORELOOM_TOKEN } });
const { orders } = await res.json();
await saveOrders(orders);
url = /<([^>]+)>; rel="next"/.exec(res.headers.get("link") ?? "")?.[1];
}Rate limits#
Each app has a bucket of 40 Admin API calls that refills at 2 calls a second, so short bursts are fine and the steady rate is 2 a second. Every response says how full the bucket is:
X-Storeloom-Shop-Api-Call-Limit: 12/40A call over the limit answers 429 with a Retry-After header in seconds; wait that long and try again. Webhooks are the better way to hear about changes than polling. The Storefront API has its own, larger limit: 200 calls refilling at 20 a second per storefront token.
Errors#
Errors have one shape: a message, or field errors that name exactly what to fix, with the path into the body for nested fields.
{
"errors": "[API] This action requires merchant approval for write_orders scope."
}{
"errors": {
"line_items.1.quantity": ["only 2 in stock"],
"email": ["is invalid"]
}
}| Status | Meaning |
|---|---|
| 400 | The request is malformed: invalid JSON, an unknown filter value, page_info combined with filters. |
| 401 | The access token is missing or wrong, or was rotated. For an App Store app it also means the store uninstalled the app, or approved it again, which gives the app a new token. |
| 403 | The app doesn't have the scope this endpoint needs. The message names it. |
| 404 | No such endpoint, API version or record in this store. |
| 405 | The endpoint exists but not with this method. |
| 413 | The body is over 2 MB. |
| 422 | The request is understood but can't be done: field errors, or a base error such as "Cancelled orders can't be fulfilled." |
| 423 | The store is suspended. |
| 429 | Rate limited. Retry after Retry-After seconds. |
| 500 | Something went wrong on our side. The body includes a request_id; it's safe to retry reads. |