Skip to content

API v1

Build on the Shop API

Everything you need to connect an external system to a Lelaloop shop: authenticate with OAuth 2.0, then read and update products, inventory, orders and customers.

Introduction

The Lelaloop Shop API lets external systems, such as an ERP, a warehouse, an accounting package or a shipping tool, work with a shop's products, inventory, orders and customers over HTTPS.

It is a REST API with resource-oriented URLs, JSON request and response bodies, and standard HTTP status codes. Every request carries an OAuth 2.0 access token that is bound to exactly one shop, so there is never a shop id in the URL.

OAuth 2.0

Authorization Code with PKCE for third-party systems, client credentials for the shop's own back office.

One shop per token

The shop owner creates the app, chooses its scopes and can disconnect it at any time.

OpenAPI 3.1

A machine-readable description for Postman, code generators and your own tooling.

Base URL and versioning

All endpoints in the reference are relative to this base URL. Always use HTTPS.

Base URL
https://lelaloop.com/api/v1

The version is part of the path (/api/v1). Within a version we may add endpoints, optional parameters and response fields, so your integration should ignore fields it does not recognise. Changes that would break existing integrations are released under a new version path.

Server-to-server only
The API does not send CORS headers, so browsers cannot call it. Call it from your backend, and never put the client secret or any token in frontend or mobile app code.

OpenAPI specification

The endpoint reference on this page is generated from the OpenAPI 3.1 document served at GET /api/v1/openapi.json. It is public and needs no token.

Open the OpenAPI spec

Quickstart

Go from nothing to a first successful call. This path uses the client credentials grant, which is the fastest way to try the API against your own shop.

  1. 1

    Create an app

    In the shop admin, open Settings › Apps & API and create an app. Pick the scopes it needs and, if you will use the authorization code flow, add your redirect URI. You receive a client_id (it starts with llc_) and a client_secret (it starts with lls_). The secret is shown only once, so store it somewhere safe right away.

  2. 2

    Get an access token

    Exchange the client credentials for an access token. To connect on behalf of other shop owners, use the authorization code flow instead; it is described in the Authentication section.

    curl -X POST "https://lelaloop.com/api/oauth/token" \
      -u "llc_xxx:lls_xxx" \
      -d grant_type=client_credentials \
      --data-urlencode "scope=products:read inventory:write"
    Response
    {
      "access_token": "llat_xxx",
      "token_type": "Bearer",
      "expires_in": 3600,
      "scope": "products:read inventory:write",
      "shop_id": "665f1c2ab7e4a90012345678"
    }
  3. 3

    Call the API

    Send the token in the Authorization header. GET /shop returns the shop the token is bound to, which makes it a good connection test.

    curl "https://lelaloop.com/api/v1/shop" \
      -H "Authorization: Bearer llat_xxx"
    Response
    {
      "success": true,
      "message": "Shop",
      "data": {
        "id": "665f1c2ab7e4a90012345678",
        "name": "Example Store",
        "slug": "example-store",
        "domain": "example-store.com",
        "status": "active",
        "currency": "USD",
        "defaultLocale": "en",
        "locales": [
          "en",
          "vi"
        ],
        "contact": {
          "email": "[email protected]"
        }
      }
    }
  4. 4

    Go further

    Before going to production, read how authorization, errors and rate limits work, then browse the endpoints.

Authentication

The API uses OAuth 2.0. An app belongs to one shop, and every token it obtains works with that shop only. Two grant types are available:

GrantUse it whenRefresh token
Authorization code with PKCEAn external system connects to a shop and the shop owner approves the access in the browser.Yes
Client credentialsThe shop's own systems run machine to machine, with no person in the loop.No
EndpointURL
Authorization pageGET https://lelaloop.com/oauth/authorize
Token endpointPOST https://lelaloop.com/api/oauth/token
Revocation endpointPOST https://lelaloop.com/api/oauth/revoke

The token and revocation endpoints authenticate your app with its client credentials. Send them with HTTP Basic authentication (Authorization: Basic followed by the base64 of client_id:client_secret, recommended) or as the client_id and client_secret body fields, but not both at once. The body can be application/x-www-form-urlencoded, as the OAuth standard defines, or application/json.

These two endpoints answer with plain OAuth JSON, not with the envelope used by the rest of the API, and their responses must never be cached.

Authorization code flow with PKCE

Use this flow when a shop owner connects their shop to your system. The owner approves the request in the browser and your server receives tokens without ever seeing the owner's login. PKCE is mandatory, and only the S256 method is accepted.

1. Create a code verifier, a code challenge and a state

Generate a random code_verifier (43 to 128 characters from the set A-Z a-z 0-9 - . _ ~), derive code_challenge as the base64url-encoded SHA-256 hash of the verifier, and generate a random state. Keep the verifier and the state on your server, tied to the user's session.

CODE_VERIFIER=$(openssl rand -base64 32 | tr '+/' '-_' | tr -d '=')
CODE_CHALLENGE=$(printf '%s' "$CODE_VERIFIER" | openssl dgst -sha256 -binary | openssl base64 | tr '+/' '-_' | tr -d '=')
STATE=$(openssl rand -hex 16)

2. Send the shop owner to the authorization page

Redirect the browser to the authorization page with these query parameters (shown on separate lines for readability):

URL
https://lelaloop.com/oauth/authorize
  ?response_type=code
  &client_id=llc_xxx
  &redirect_uri=https%3A%2F%2Fyour-app.example.com%2Fcallback
  &scope=products%3Aread%20orders%3Aread
  &state=RANDOM_STATE
  &code_challenge=CODE_CHALLENGE
  &code_challenge_method=S256
ParameterRequiredDescription
response_typeYesAlways code.
client_idYesThe client id of your app.
redirect_uriYesMust be identical, character for character, to one of the redirect URIs registered for the app.
scopeNoSpace-separated scopes. They must be within the scopes configured for the app. Leave it out to request all of them.
stateRecommendedAn opaque random value (up to 1024 characters) that is returned unchanged. Use it to protect against CSRF.
code_challengeYesThe PKCE code challenge: 43 base64url characters.
code_challenge_methodYesAlways S256.

The shop owner signs in if needed and sees the name of your app, the shop and the requested scopes. Only an owner of the shop that created the app can approve the request.

Redirect URI rules
A redirect URI must be an absolute https URL with no fragment and no embedded credentials. Plain http is accepted only for localhost, 127.0.0.1 and [::1] during development. An app can register up to 10 redirect URIs, and matching is an exact string comparison.

3. Handle the redirect back to your app

After the decision, the browser returns to your redirect_uri. First check that state equals the value you stored. On approval you receive a code, which is valid for 5 minutes and can be used once. If the owner declines, you receive error=access_denied.

Approved
https://your-app.example.com/callback?code=llac_xxx&state=RANDOM_STATE
Denied
https://your-app.example.com/callback?error=access_denied&error_description=The+shop+owner+denied+the+request&state=RANDOM_STATE

Other problems with the request come back the same way, in the error and error_description parameters: invalid_request (PKCE missing or malformed), invalid_scope and unsupported_response_type. If the client_id or the redirect_uri is wrong, there is no redirect at all: the error is shown on the authorization page, because no trusted address exists to send it to.

4. Exchange the code for tokens

From your server, call the token endpoint with the code, the same redirect_uri and the original code_verifier.

curl -X POST "https://lelaloop.com/api/oauth/token" \
  -u "llc_xxx:lls_xxx" \
  -d grant_type=authorization_code \
  -d code=llac_xxx \
  --data-urlencode "redirect_uri=https://your-app.example.com/callback" \
  -d code_verifier="$CODE_VERIFIER"
Response
{
  "access_token": "llat_xxx",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "llrt_xxx",
  "scope": "products:read orders:read",
  "shop_id": "665f1c2ab7e4a90012345678"
}
FieldDescription
access_tokenThe token to send with API requests.
token_typeAlways Bearer.
expires_inLifetime of the access token in seconds (3600).
refresh_tokenUsed to obtain the next pair of tokens. Absent for the client credentials grant.
scopeThe scopes actually granted, separated by spaces.
shop_idThe id of the shop the token works with. Store it next to the tokens.

A code is consumed by the first exchange attempt, even a failed one (for example a wrong redirect_uri or code_verifier). If the exchange fails, start the flow again. Presenting a code that was already used also revokes the tokens issued from it.

Refreshing tokens

An access token lives for 60 minutes. Use the refresh token to obtain a new pair without involving the shop owner.

curl -X POST "https://lelaloop.com/api/oauth/token" \
  -u "llc_xxx:lls_xxx" \
  -d grant_type=refresh_token \
  -d refresh_token=llrt_xxx
  • Refresh tokens rotate. Each one works once, and every refresh returns a new refresh token that is valid for 30 days. Save the new pair before you start using it.
  • Using a refresh token a second time is treated as a sign of theft: the whole connection is revoked (every access and refresh token of that authorization) and the shop owner has to authorize again.
  • Run one refresh at a time per connection, behind a lock or a single worker. Two parallel refreshes with the same token count as reuse.
  • Send scope only if you want to narrow the scopes of the new tokens; scopes can never be widened. A refresh request rejected because of its parameters (for example an invalid scope) does not consume the refresh token, so you can correct it and retry with the same token.
  • A refresh fails with invalid_grant when the person who authorized the app is no longer an owner of the shop or their account has been disabled.
Never retry a refresh with the old token
If your code crashes or times out after sending a refresh request, the old refresh token may already be spent. Sending it again revokes the connection. Refresh shortly before the access token expires instead of on every request, and persist the response atomically.

Client credentials grant

For systems that belong to the shop itself, such as a nightly stock sync. There is no browser step: the app authenticates with its own credentials and receives an access token for its shop. scope is optional and defaults to every scope configured for the app.

curl -X POST "https://lelaloop.com/api/oauth/token" \
  -u "llc_xxx:lls_xxx" \
  -d grant_type=client_credentials \
  --data-urlencode "scope=products:read inventory:write"
Response
{
  "access_token": "llat_xxx",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "products:read inventory:write",
  "shop_id": "665f1c2ab7e4a90012345678"
}

The response has no refresh token. When the access token expires after 60 minutes, simply request a new one. The token acts on behalf of the person who created the app, so it stops working if that person loses access to the shop.

This grant needs nothing but the client secret. Use it only from servers you control.

Revoking access

When a shop disconnects from your system, revoke the connection by sending any of its access or refresh tokens to the revocation endpoint. Revoking one token revokes the whole connection.

curl -X POST "https://lelaloop.com/api/oauth/revoke" \
  -u "llc_xxx:lls_xxx" \
  -d token=llrt_xxx

The endpoint answers 200 with an empty JSON object, even when the token is unknown or belongs to another app, as RFC 7009 requires.

Shop owners can also turn an app off or disconnect it in Settings › Apps & API. Every request is checked against the current state of the token, the app and the shop, so the change takes effect immediately and your calls start failing with 401.

Credential lifetimes

CredentialPrefixLifetimeNotes
Client idllc_PermanentPublic identifier of the app. Not a secret.
Client secretlls_Until rotatedShown once when it is created. Rotate it if it may have leaked.
Authorization codellac_5 minutesSingle use.
Access tokenllat_60 minutesSent as a Bearer token with every API request.
Refresh tokenllrt_30 daysSingle use. Replaced by a new one on every refresh.

Tokens are opaque strings. Do not parse them or rely on their length; the prefix exists only so that secret scanners can recognise them.

The scopes of a token are re-evaluated on every request. When the shop owner removes a scope from the app, existing tokens lose it at once.

OAuth errors

The token and revocation endpoints report errors in the standard OAuth shape: an error code for your program and an error_description for you.

400 Bad Request
{
  "error": "invalid_grant",
  "error_description": "Authorization code is invalid, expired or already used"
}
errorHTTPDescription
invalid_request400A required parameter is missing or malformed, the Content-Type is not supported, or the client credentials were sent in both the header and the body.
invalid_client401The app is unknown or turned off, or the client secret is wrong.
invalid_grant400The authorization code or refresh token is invalid, expired, already used or was issued to another app; the redirect_uri or code_verifier does not match; or the person who authorized the app no longer has access to the shop.
unsupported_grant_type400grant_type is not authorization_code, refresh_token or client_credentials.
invalid_scope400A requested scope is unknown, or goes beyond what the app or the original authorization allows.
temporarily_unavailable429Too many token requests. Wait for the number of seconds in Retry-After (HTTP 429).
server_error500An unexpected failure on our side. Try again later.

When these endpoints are rate limited they answer 429 with a Retry-After header and the error temporarily_unavailable, in the same OAuth error shape.

Scopes

Scopes limit what a token can do. Each one is named after a resource and an access level: read or write. The shop owner chooses the scopes of an app, and an authorization can request any subset of them.

ScopeAllows
shop:readRead the shop's name, domain, currency and languages.
products:readRead products and categories.
products:writeCreate, update and delete products and categories, and upload images.
inventory:readRead stock levels.
inventory:writeUpdate stock levels.
orders:readRead orders, including the customer's name, email and shipping address.
orders:writeChange order status and tracking information.
customers:readRead customers. This is personal data.
  • A write scope includes the read scope of the same resource. An app with products:write does not need to request products:read.
  • Request the smallest set of scopes your integration needs. Shop owners are more likely to approve a short, clearly justified list.
  • A token can never do more than its app. The effective scopes of a request are the scopes granted to the token that the app still has.
  • The consent screen highlights scopes that change data or expose personal data: products:write, inventory:write, orders:read, orders:write, customers:read.

Every endpoint in the reference lists the scope it requires. A call without that scope fails with 403; data.code is insufficient_scope and data.requiredScope names the missing scope.

403 Forbidden
{
  "error": true,
  "statusCode": 403,
  "message": "This token is missing the required scope: orders:write",
  "data": {
    "code": "insufficient_scope",
    "requiredScope": "orders:write",
    "requestId": "0b0f6a9e-3d0c-4f55-9a53-2f1c7f0c8d21"
  }
}

Making requests

Authenticate every request with the access token in the Authorization header. This header is the only accepted place for a token: it is never read from the query string or from a cookie.

HTTP
Authorization: Bearer llat_xxx
HeaderDescription
AuthorizationRequired. The word Bearer, a space, then the access token.
Content-TypeRequired for POST, PUT and PATCH: application/json, or multipart/form-data for image upload. Anything else is rejected with 415.

A JSON request body can be up to 2 MB; larger bodies are rejected with 413.

Response envelope

Every successful response uses the same envelope: success is always true, message is a short human-readable label and data holds the result. Endpoints that return nothing, such as a delete, omit data. Rely on the HTTP status and on data, not on the text of message.

200 OK
{
  "success": true,
  "message": "Shop",
  "data": {
    "id": "665f1c2ab7e4a90012345678",
    "name": "Example Store",
    "slug": "example-store",
    "domain": "example-store.com",
    "status": "active",
    "currency": "USD",
    "defaultLocale": "en",
    "locales": [
      "en",
      "vi"
    ],
    "contact": {
      "email": "[email protected]"
    }
  }
}

Pagination

List endpoints accept page (starting at 1) and limit (default 20, maximum 100). The data object contains items, total, page, limit and hasMore. Keep requesting the next page while hasMore is true. Most lists also accept search and a few filters; see each endpoint.

curl "https://lelaloop.com/api/v1/products?page=2&limit=100&status=active" \
  -H "Authorization: Bearer llat_xxx"
Response
{
  "success": true,
  "message": "Products",
  "data": {
    "items": [
      {
        "id": "665f1c2ab7e4a90012345678",
        "name": "Classic Crewneck Sweatshirt",
        "price": 39.9,
        "status": "active"
      }
    ],
    "total": 248,
    "page": 1,
    "limit": 100,
    "hasMore": true
  }
}

Data conventions

Identifiers
Strings of 24 hexadecimal characters. A malformed id in the path returns 404.
Money
Decimal numbers in the shop's currency, for example 39.9. Read the ISO 4217 currency code from currency in GET /shop; orders also carry their own currency field.
Dates and times
ISO 8601 strings in UTC, for example 2026-03-14T09:30:00.000Z.
Content language
Translatable text such as product names and descriptions is read and written in the shop's default language. Pass locale (for example en, vi or zh-CN) to work in another language enabled for the shop; the enabled languages are listed in locales from GET /shop. A language the shop has not enabled falls back to the default. The reference shows whether an endpoint takes locale in the query string or in the body.
Unknown fields
Responses may gain new fields over time. Ignore the ones you do not use instead of failing on them.

Every response includes an X-Request-Id header and Cache-Control: no-store. Do not cache API responses in shared caches.

Errors

Errors are reported with HTTP status codes; a failed request never answers 200. The JSON body describes the problem:

FieldDescription
statusCodeThe HTTP status, repeated in the body.
messageA human-readable explanation, always in English. The wording may change, so do not parse it; use data.code for automated handling.
data.codeA stable, machine-readable code. Build your error handling on this value.
data.requestIdThe id of this request, identical to the X-Request-Id response header.
data.errorsOnly with 422: one entry per invalid field, each with field (a dotted path such as variants.0.price) and an English message.
422 Unprocessable Entity
{
  "error": true,
  "statusCode": 422,
  "message": "Request validation failed",
  "data": {
    "code": "validation_failed",
    "requestId": "0b0f6a9e-3d0c-4f55-9a53-2f1c7f0c8d21",
    "errors": [
      {
        "field": "name",
        "message": "Required"
      },
      {
        "field": "variants.0.price",
        "message": "Expected number, received string"
      }
    ]
  }
}

The body can contain other fields as well; ignore any field that is not listed here.

Status codes

HTTPdata.codeDescription
400invalid_requestThe request is malformed, for example a multipart upload without its file field.
401unauthorizedThe access token is missing, invalid, expired or revoked, or the app or the shop is no longer active.
403forbiddenThe action is not permitted.
403insufficient_scopeThe token does not carry the scope the endpoint requires. data.requiredScope names it.
404not_foundThe resource does not exist in this shop, or the id is malformed.
405method_not_allowedThe HTTP method is not supported on this path.
409conflictThe request conflicts with existing data, such as a duplicate SKU or slug.
413payload_too_largeThe request body is too large.
415unsupported_media_typeThe Content-Type is not supported by this endpoint.
422validation_failedValidation failed (see data.errors), or the operation is not allowed in the current state of the resource, such as an invalid order status transition.
429rate_limitedA rate limit was exceeded. Wait for the number of seconds in Retry-After.
500internal_errorAn unexpected error on our side. No internal detail is exposed; report the request id if it persists.
503service_unavailableThe service is temporarily unavailable. Retry with backoff.

Handling errors

  • Branch on the HTTP status and on data.code. Treat codes you do not know by their status class: 4xx means the request must change, 5xx means try again later.
  • On 401, refresh the access token once and repeat the request. If it still fails, or the refresh returns invalid_grant, the connection has been revoked: stop calling and ask the shop owner to connect again.
  • Retry 500 and 503 with exponential backoff. Do not retry other 4xx responses without changing the request.
  • Log the X-Request-Id of failed requests and quote it when you contact support. It lets us find the exact request.

Rate limits

Requests are counted in fixed windows of 60 seconds. Several limits apply at the same time, and a request that exceeds any of them is rejected with 429.

Counted forLimit
All requests of one app120 requests per 60 seconds
Write requests of one app (POST, PUT, PATCH, DELETE)60 requests per 60 seconds
All apps of one shop together600 requests per 60 seconds
All requests from one IP address, counted before authentication600 requests per 60 seconds
Token and revocation endpoints, per IP address30 requests per 60 seconds
Token and revocation endpoints, per client_id60 requests per 60 seconds

Response headers

Authenticated API responses report the state of the per-app limit, so you can pace your requests before you hit it:

HeaderDescription
X-RateLimit-LimitThe per-app limit of the current window.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetSeconds until the current window ends. This is a duration, not a timestamp.
Retry-AfterSent with 429: the number of seconds to wait before retrying. The same value is in data.retryAfterSeconds.
429 Too Many Requests
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 17
Retry-After: 17

Handling 429

  • Wait for Retry-After seconds before sending the request again. Retrying earlier only uses up the next window.
  • If the header is missing, use exponential backoff with jitter and cap the number of attempts.
  • Watch X-RateLimit-Remaining and slow down before it reaches zero, especially in bulk jobs.
  • Reduce the number of calls: request the largest page size, sync only what changed, and queue writes through a single worker per shop.
Node.js
async function callApi(url, init, attempt = 0) {
  const response = await fetch(url, init)
  if (response.status !== 429 && response.status !== 503) return response
  if (attempt >= 5) throw new Error('Still rate limited after 5 retries')

  // Honour Retry-After; fall back to exponential backoff with jitter.
  const retryAfter = Number(response.headers.get('Retry-After'))
  const delayMs = retryAfter > 0 ? retryAfter * 1000 : 2 ** attempt * 1000 + Math.random() * 250
  await new Promise(resolve => setTimeout(resolve, delayMs))
  return callApi(url, init, attempt + 1)
}

Security and best practices

A checklist for taking an integration to production.

  • Keep secrets on the server

    The client secret and all tokens belong on your backend. Never embed them in a web page, a mobile app or a public repository.

  • Use HTTPS everywhere

    Call the API over HTTPS only, and host your redirect URI on HTTPS. Plain http is accepted for loopback addresses in development only.

  • Verify state and use PKCE

    Generate a fresh state and code_verifier for every authorization, bind them to the user's session and reject a callback whose state does not match.

  • Encrypt tokens at rest

    Store access and refresh tokens encrypted, with access limited to the service that needs them, and store the shop_id alongside.

  • Rotate a leaked secret

    If a client secret may have been exposed, ask the shop owner to rotate it in Settings › Apps & API and deploy the new one immediately.

  • Ask for the minimum

    Request only the scopes you use. Prefer read scopes when you never write, and avoid scopes that expose personal data unless you need them.

  • Make retries safe

    The API has no idempotency keys. PUT requests and absolute updates, such as setting a variant's stock, are safe to repeat. Before repeating a POST that creates a resource after a timeout, check whether the first attempt succeeded.

  • Keep tokens out of logs

    Never log the Authorization header, tokens, codes or the client secret. Log the request id instead.

  • Handle disconnection

    A shop owner can disconnect your app at any time. Treat a persistent 401 as a disconnected shop, stop your jobs for it, and revoke tokens yourself when a shop leaves your system.

  • Respect personal data

    Orders and customers contain personal data. Fetch only what you need, keep it only as long as you need it, and follow the privacy laws that apply to you and to the shop.

Endpoint reference

This section is generated from the OpenAPI specification and is written in English. Paths are relative to the base URL. Every endpoint can also answer 401, 403 and 429.

Shop

GET/shop

Get the shop

Returns the shop this access token is bound to. A good first call to verify a connection.

Required scope shop:read

Example request
cURL
curl "https://lelaloop.com/api/v1/shop" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type Shop.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 429Rate limit exceeded. See the Retry-After header.

Products

GET/products

List products

Required scope products:read

Query parameters
Field Type Description
page
integerPage number, starting at 1.
min 1default 1
limit
integerItems per page (max 100).
min 1max 100default 20
search
stringSearch by product name or SKU.
max 120 chars
status
stringFilter by status.
draftactivearchived
kind
stringFilter by product kind.
physicaldigitalserviceprogram
locale
stringContent language (e.g. en, vi, zh-CN). Defaults to the shop default language.
Example request
cURL
curl "https://lelaloop.com/api/v1/products" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type object.

Field Type Description
itemsrequired
array of ProductSummary
totalrequired
integerTotal number of records matching the filter.
pagerequired
integer
limitrequired
integer
hasMorerequired
booleanTrue when another page exists.
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 429Rate limit exceeded. See the Retry-After header.
POST/products

Create a product

Creates a product with its options and variants. Responds with 201 and a Location header.

Required scope products:write

Request body application/jsonProductInput
Field Type Description
namerequired
string
max 200 chars
slug
stringURL handle. Derived from name when omitted.
bodyHtml
stringDescription HTML. Sanitized by the server.
excerpt
string
statusrequired
string
draftactivearchived
images
array of ProductImageUp to 20 images.
categoryNames
array of stringCategory names. Unknown names are created.
tags
array of string
brand
string
productType
string
kind
stringDefaults to physical.
physicaldigitalserviceprogram
trackInventory
booleanDefault true.
allowBackorder
booleanAllow ordering when out of stock. Default false.
requiresShipping
booleanDefault true.
weightUnit
string
kgglboz
options
array of ProductOptionUp to 3 options.
variantsrequired
array of ProductVariantAt least one variant (1–1000).
seo
object
title
string
description
string
image
string
locale
stringLanguage of the text fields in this request. Defaults to the shop default language.
Example request
cURL
curl -X POST "https://lelaloop.com/api/v1/products" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Classic Crewneck Sweatshirt",
  "bodyHtml": "<p>Midweight fleece, relaxed fit.</p>",
  "status": "active",
  "images": [
    {
      "url": "https://cdn.example.com/sweatshirt-front.jpg",
      "alt": "Front view"
    }
  ],
  "categoryNames": [
    "Sweatshirts"
  ],
  "tags": [
    "fleece",
    "winter"
  ],
  "trackInventory": true,
  "options": [
    {
      "name": "Size",
      "values": [
        "S",
        "M",
        "L"
      ]
    }
  ],
  "variants": [
    {
      "optionValues": [
        "S"
      ],
      "sku": "CREW-S",
      "price": 39.9,
      "inventory": 25
    },
    {
      "optionValues": [
        "M"
      ],
      "sku": "CREW-M",
      "price": 39.9,
      "inventory": 40
    },
    {
      "optionValues": [
        "L"
      ],
      "sku": "CREW-L",
      "price": 39.9,
      "inventory": 30
    }
  ]
}'
Returns 201

The standard envelope, with data of type Product.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 409Conflict with existing data (e.g. duplicate SKU or slug).
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.
GET/products/{productId}

Get a product

Required scope products:read

Path parameters
Field Type Description
productIdrequired
string
Query parameters
Field Type Description
locale
stringContent language (e.g. en, vi, zh-CN). Defaults to the shop default language.
Example request
cURL
curl "https://lelaloop.com/api/v1/products/665f1c2ab7e4a90012345678" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type Product.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 429Rate limit exceeded. See the Retry-After header.
PUT/products/{productId}

Replace a product

Full replacement: read the product, change what you need, send the whole object back. Keep each variant id and each option slug exactly as returned so variant history, carts and orders stay linked.

Required scope products:write

Path parameters
Field Type Description
productIdrequired
string
Request body application/jsonProductInput
Field Type Description
namerequired
string
max 200 chars
slug
stringURL handle. Derived from name when omitted.
bodyHtml
stringDescription HTML. Sanitized by the server.
excerpt
string
statusrequired
string
draftactivearchived
images
array of ProductImageUp to 20 images.
categoryNames
array of stringCategory names. Unknown names are created.
tags
array of string
brand
string
productType
string
kind
stringDefaults to physical.
physicaldigitalserviceprogram
trackInventory
booleanDefault true.
allowBackorder
booleanAllow ordering when out of stock. Default false.
requiresShipping
booleanDefault true.
weightUnit
string
kgglboz
options
array of ProductOptionUp to 3 options.
variantsrequired
array of ProductVariantAt least one variant (1–1000).
seo
object
title
string
description
string
image
string
locale
stringLanguage of the text fields in this request. Defaults to the shop default language.
Example request
cURL
curl -X PUT "https://lelaloop.com/api/v1/products/665f1c2ab7e4a90012345678" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Classic Crewneck Sweatshirt",
  "bodyHtml": "<p>Midweight fleece, relaxed fit.</p>",
  "status": "active",
  "images": [
    {
      "url": "https://cdn.example.com/sweatshirt-front.jpg",
      "alt": "Front view"
    }
  ],
  "categoryNames": [
    "Sweatshirts"
  ],
  "tags": [
    "fleece",
    "winter"
  ],
  "trackInventory": true,
  "options": [
    {
      "name": "Size",
      "values": [
        "S",
        "M",
        "L"
      ]
    }
  ],
  "variants": [
    {
      "optionValues": [
        "S"
      ],
      "sku": "CREW-S",
      "price": 39.9,
      "inventory": 25
    },
    {
      "optionValues": [
        "M"
      ],
      "sku": "CREW-M",
      "price": 39.9,
      "inventory": 40
    },
    {
      "optionValues": [
        "L"
      ],
      "sku": "CREW-L",
      "price": 39.9,
      "inventory": 30
    }
  ]
}'
Returns 200

The standard envelope, with data of type Product.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 409Conflict with existing data (e.g. duplicate SKU or slug).
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.
DELETE/products/{productId}

Delete a product

Soft delete: the product disappears from the storefront and from every list.

Required scope products:write

Path parameters
Field Type Description
productIdrequired
string
Example request
cURL
curl -X DELETE "https://lelaloop.com/api/v1/products/665f1c2ab7e4a90012345678" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope without data.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 429Rate limit exceeded. See the Retry-After header.
PATCH/products/{productId}/status

Change product status

Required scope products:write

Path parameters
Field Type Description
productIdrequired
string
Request body application/json
Field Type Description
statusrequired
string
draftactivearchived
Example request
cURL
curl -X PATCH "https://lelaloop.com/api/v1/products/665f1c2ab7e4a90012345678/status" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "archived"
}'
Returns 200

The standard envelope, with data of type object.

Field Type Description
id
string
status
string
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.
POST/media

Upload an image

Uploads one image (multipart/form-data, field file, max 15 MB) to the shop media library. Use the returned url / thumbUrl in product or category images.

Required scope products:write

Request body multipart/form-data
Field Type Description
filerequired
file
Example request
cURL
curl -X POST "https://lelaloop.com/api/v1/media" \
  -H "Authorization: Bearer llat_xxx" \
  -F "file=@./photo.jpg"
Returns 201

The standard envelope, with data of type Media.

Errors
  • 400Malformed request.
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 413Request body too large.
  • 415Unsupported Content-Type.
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.

Categories

GET/categories

List categories

Returns the whole category tree as a flat list (parentId + depth). Not paginated.

Required scope products:read

Query parameters
Field Type Description
locale
stringContent language (e.g. en, vi, zh-CN). Defaults to the shop default language.
Example request
cURL
curl "https://lelaloop.com/api/v1/categories" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type object.

Field Type Description
items
array of Category
total
integer
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 429Rate limit exceeded. See the Retry-After header.
POST/categories

Create a category

Required scope products:write

Query parameters
Field Type Description
locale
stringContent language (e.g. en, vi, zh-CN). Defaults to the shop default language.
Request body application/jsonCategoryInput
Field Type Description
namerequired
string
max 120 chars
slug
stringDerived from name when omitted.
parentId
stringParent category id. Omit for a root category.
sortOrder
integerDefault 0.
isActive
booleanDefault true.
image
stringhttps URL.
seoTitle
string
seoDescription
string
Example request
cURL
curl -X POST "https://lelaloop.com/api/v1/categories" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Sweatshirts",
  "isActive": true
}'
Returns 201

The standard envelope, with data of type object.

Field Type Description
id
string
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 409Conflict with existing data (e.g. duplicate SKU or slug).
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.
PUT/categories/{categoryId}

Update a category

Required scope products:write

Path parameters
Field Type Description
categoryIdrequired
string
Query parameters
Field Type Description
locale
stringContent language (e.g. en, vi, zh-CN). Defaults to the shop default language.
Request body application/jsonCategoryInput
Field Type Description
namerequired
string
max 120 chars
slug
stringDerived from name when omitted.
parentId
stringParent category id. Omit for a root category.
sortOrder
integerDefault 0.
isActive
booleanDefault true.
image
stringhttps URL.
seoTitle
string
seoDescription
string
Example request
cURL
curl -X PUT "https://lelaloop.com/api/v1/categories/665f1c2ab7e4a90012345678" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Hoodies & Sweatshirts",
  "sortOrder": 2,
  "isActive": true
}'
Returns 200

The standard envelope, with data of type object.

Field Type Description
id
string
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 409Conflict with existing data (e.g. duplicate SKU or slug).
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.
DELETE/categories/{categoryId}

Delete a category

Required scope products:write

Path parameters
Field Type Description
categoryIdrequired
string
Example request
cURL
curl -X DELETE "https://lelaloop.com/api/v1/categories/665f1c2ab7e4a90012345678" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope without data.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.

Inventory

GET/inventory

List inventory

One row per variant.

Required scope inventory:read

Query parameters
Field Type Description
page
integerPage number, starting at 1.
min 1default 1
limit
integerItems per page (max 100).
min 1max 100default 20
search
stringSearch by product name or SKU.
max 120 chars
locale
stringContent language (e.g. en, vi, zh-CN). Defaults to the shop default language.
Example request
cURL
curl "https://lelaloop.com/api/v1/inventory" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type object.

Field Type Description
itemsrequired
array of InventoryItem
totalrequired
integerTotal number of records matching the filter.
pagerequired
integer
limitrequired
integer
hasMorerequired
booleanTrue when another page exists.
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 429Rate limit exceeded. See the Retry-After header.
PUT/products/{productId}/variants/{variantId}/inventory

Set variant stock

Sets the ABSOLUTE stock of one variant (not a delta).

Required scope inventory:write

Path parameters
Field Type Description
productIdrequired
string
variantIdrequired
string
Request body application/json
Field Type Description
inventoryrequired
integer
min 0
Example request
cURL
curl -X PUT "https://lelaloop.com/api/v1/products/665f1c2ab7e4a90012345678/variants/665f1c2ab7e4a90012345678/inventory" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "inventory": 120
}'
Returns 200

The standard envelope, with data of type object.

Field Type Description
productId
string
variantId
string
inventory
integer
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.

Orders

GET/orders

List orders

Newest first.

Required scope orders:read

Query parameters
Field Type Description
page
integerPage number, starting at 1.
min 1default 1
limit
integerItems per page (max 100).
min 1max 100default 20
search
stringSearch by order number, customer name or email.
max 120 chars
status
stringFilter by status.
pendingconfirmedprocessingshippeddeliveredcompletedcancelledrefunded
Example request
cURL
curl "https://lelaloop.com/api/v1/orders" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type object.

Field Type Description
itemsrequired
array of OrderSummary
totalrequired
integerTotal number of records matching the filter.
pagerequired
integer
limitrequired
integer
hasMorerequired
booleanTrue when another page exists.
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 429Rate limit exceeded. See the Retry-After header.
GET/orders/{orderId}

Get an order

Required scope orders:read

Path parameters
Field Type Description
orderIdrequired
string
Example request
cURL
curl "https://lelaloop.com/api/v1/orders/665f1c2ab7e4a90012345678" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type Order.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 429Rate limit exceeded. See the Retry-After header.
PATCH/orders/{orderId}/status

Change order status

Moves the order along its lifecycle: pending → confirmed → processing → shipped → delivered → completed, with cancelled / refunded branches. Invalid transitions return 422. An order paid through a payment gateway cannot be set to refunded here.

Required scope orders:write

Path parameters
Field Type Description
orderIdrequired
string
Request body application/json
Field Type Description
statusrequired
string
pendingconfirmedprocessingshippeddeliveredcompletedcancelledrefunded
Example request
cURL
curl -X PATCH "https://lelaloop.com/api/v1/orders/665f1c2ab7e4a90012345678/status" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "processing"
}'
Returns 200

The standard envelope, with data of type Order.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.
PATCH/orders/{orderId}/fulfillment

Set tracking information

Saves carrier and tracking number (empty string clears them). markShipped: true also moves the order to shipped when that transition is valid.

Required scope orders:write

Path parameters
Field Type Description
orderIdrequired
string
Request body application/json
Field Type Description
carrier
string
max 100 chars
trackingNumber
string
max 100 chars
markShipped
booleanDefault false.
Example request
cURL
curl -X PATCH "https://lelaloop.com/api/v1/orders/665f1c2ab7e4a90012345678/fulfillment" \
  -H "Authorization: Bearer llat_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "carrier": "DHL",
  "trackingNumber": "1234567890",
  "markShipped": true
}'
Returns 200

The standard envelope, with data of type Order.

Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 404The resource does not exist in this shop.
  • 422Validation failed or the operation is not allowed in the current state.
  • 429Rate limit exceeded. See the Retry-After header.

Customers

GET/customers

List customers

Newest first. Contains personal data: request this scope only when you need it.

Required scope customers:read

Query parameters
Field Type Description
page
integerPage number, starting at 1.
min 1default 1
limit
integerItems per page (max 100).
min 1max 100default 20
search
stringSearch by name or email.
max 120 chars
Example request
cURL
curl "https://lelaloop.com/api/v1/customers" \
  -H "Authorization: Bearer llat_xxx"
Returns 200

The standard envelope, with data of type object.

Field Type Description
itemsrequired
array of Customer
totalrequired
integerTotal number of records matching the filter.
pagerequired
integer
limitrequired
integer
hasMorerequired
booleanTrue when another page exists.
Errors
  • 401Missing, invalid, expired or revoked access token.
  • 403The token does not carry the required scope.
  • 429Rate limit exceeded. See the Retry-After header.

Objects

The resources and request bodies that the endpoints above refer to.

Shop

Field Type Description
id
string
name
string
slug
string
domain
stringPrimary domain of the storefront.
status
string
activesuspendedclosed
currency
stringISO 4217 code. Every monetary amount in this API is expressed in this currency.
defaultLocale
string
locales
array of string
contact
object
email
string
phone
string
address
string

ProductSummary

Field Type Description
id
string
name
string
image
stringThumbnail URL.
price
numberLowest variant price.
inventoryTotal
integerStock summed over all variants.
variantsCount
integer
status
string
draftactivearchived
kind
string
physicaldigitalserviceprogram
categoryNames
array of string
ratingAvg
number
soldCount
integer
updatedAt
string
date-time

ProductOption

Field Type Description
namerequired
stringOption name, e.g. "Size".
slug
stringStable identifier. Send it back unchanged when updating.
valuesrequired
array of string or objectOption values (1–50).

ProductVariant

Field Type Description
id
stringVariant id. Omit when creating; send it back unchanged when updating to keep variant history.
optionValues
array of stringOne value per option, in the same order as options. Empty for a product without options.
sku
stringLeave empty to auto-generate. Unique per shop.
barcode
string
pricerequired
number
compareAtPrice
numberOriginal price shown struck through.
costPrice
number
inventoryrequired
integerStock on hand.
weight
number
image
string
isActive
boolean

ProductImage

Field Type Description
urlrequired
stringhttps URL.
thumbUrl
stringOptional smaller version; defaults to url.
alt
string

ProductInput

Field Type Description
namerequired
string
max 200 chars
slug
stringURL handle. Derived from name when omitted.
bodyHtml
stringDescription HTML. Sanitized by the server.
excerpt
string
statusrequired
string
draftactivearchived
images
array of ProductImageUp to 20 images.
categoryNames
array of stringCategory names. Unknown names are created.
tags
array of string
brand
string
productType
string
kind
stringDefaults to physical.
physicaldigitalserviceprogram
trackInventory
booleanDefault true.
allowBackorder
booleanAllow ordering when out of stock. Default false.
requiresShipping
booleanDefault true.
weightUnit
string
kgglboz
options
array of ProductOptionUp to 3 options.
variantsrequired
array of ProductVariantAt least one variant (1–1000).
seo
object
title
string
description
string
image
string
locale
stringLanguage of the text fields in this request. Defaults to the shop default language.

Product

Field Type Description
namerequired
string
max 200 chars
slug
string
bodyHtml
stringDescription HTML. Sanitized by the server.
excerpt
string
statusrequired
string
draftactivearchived
images
array of ProductImageUp to 20 images.
categoryNames
array of stringCategory names. Unknown names are created.
tags
array of string
brand
string
productType
string
kind
stringDefaults to physical.
physicaldigitalserviceprogram
trackInventory
booleanDefault true.
allowBackorder
booleanAllow ordering when out of stock. Default false.
requiresShipping
booleanDefault true.
weightUnit
string
kgglboz
options
array of ProductOptionUp to 3 options.
variantsrequired
array of ProductVariantAt least one variant (1–1000).
seo
object
title
string
description
string
image
string
locale
stringLanguage of the text fields in this request. Defaults to the shop default language.
id
string
ratingAvg
number
ratingCount
integer
soldCount
integer
updatedAt
string
date-time

Category

Field Type Description
id
string
name
string
slug
string
parentId
stringAbsent for a root category.
depth
integer0 for root categories.
sortOrder
integer
productsCount
integer
isActive
boolean
image
string
seoTitle
string
seoDescription
string

CategoryInput

Field Type Description
namerequired
string
max 120 chars
slug
stringDerived from name when omitted.
parentId
stringParent category id. Omit for a root category.
sortOrder
integerDefault 0.
isActive
booleanDefault true.
image
stringhttps URL.
seoTitle
string
seoDescription
string

InventoryItem

Field Type Description
productId
string
productName
string
variantId
string
sku
string
variantLabel
stringE.g. "Black / S". Empty for a product without options.
image
string
inventory
integer
trackInventory
booleanWhen false the number is informational only and never blocks a sale.
isActive
boolean

OrderSummary

Field Type Description
id
string
orderNumber
string
customerName
string
email
string
itemsCount
integer
total
number
currency
string
status
string
pendingconfirmedprocessingshippeddeliveredcompletedcancelledrefunded
paymentProvider
string
paymentStatus
string
createdAt
string
date-time

Order

Field Type Description
id
string
orderNumber
string
customerName
string
email
string
itemsCount
integer
total
number
currency
string
status
string
pendingconfirmedprocessingshippeddeliveredcompletedcancelledrefunded
paymentProvider
string
paymentStatus
string
createdAt
string
date-time
items
array of object
name
string
sku
string
image
string
variantLabel
string
price
number
quantity
integer
amounts
object
subtotal
number
discount
number
shipping
number
tax
numberTotal tax of the order. When taxesIncluded is true it is already inside subtotal / shipping and is NOT added to total.
total
number
taxLines
array of objectSnapshot at checkout. Empty when the order has no tax.
title
stringTax name shown to the customer, e.g. "VAT".
rate
numberPercent, e.g. 20 = 20%.
amount
number
taxesIncluded
booleantrue = product prices (and shipping, if taxed) already include tax.
shippingAddress
object
fullName
string
phone
string
addressLine1
string
addressLine2
string
city
string
state
string
postalCode
string
country
stringISO 3166-1 alpha-2.
shippingMethod
string
statusHistory
array of object
status
string
at
string
date-time
couponCode
string
customerNote
string
customerId
string
locale
string
paidAt
string
date-time
paymentTransactionId
string
fulfillment
object
carrier
string
trackingNumber
string
shippedAt
string
date-time
refunds
array of object
id
string
amount
number
currency
string
status
string
method
string
at
string
date-time

Customer

Field Type Description
id
string
fullName
string
email
string
phone
string
ordersCount
integer
totalSpent
number
tags
array of string
marketingConsent
boolean
lastOrderAt
string
date-time
createdAt
string
date-time

Media

Field Type Description
id
string
url
string
thumbUrl
string
width
integer
height
integer
size
integerBytes.

Error

Field Type Description
error
boolean
statusCoderequired
integer
messagerequired
stringHuman-readable message. Do not parse it; use data.code.
data
object
coderequired
stringMachine-readable error code, e.g. validation_failed, rate_limited, insufficient_scope.
requestIdrequired
stringQuote this id when contacting support.
errors
array of objectOnly for 422: one entry per invalid field.