Skip to content

Edition of June 1, 2025

Acme Store APIAcme Store API

Manage products, orders and customers of an Acme storefront.

The reference

Acme Store API

The Acme Store API lets you manage products, orders and customers of an Acme storefront.

All requests are made over HTTPS and return JSON. Authenticate by sending a bearer token in the Authorization header — see Authentication.

Status Meaning
2xx Success
4xx Client error, check the error field
5xx Server error, please retry

Authentication

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

Variablesin Production

NameValue
base_urlhttps://api.acme.dev/v1
api_token<redacted>
store_idstore_42

Section

Authentication

Obtain and refresh access tokens. These endpoints don't require authentication.

Authentication

Log in

POST
https://api.acme.dev/v1/auth/login

Exchange user credentials for an access token.

The token expires after 1 hour; use Refresh token to get a new one.

Authentication.

No authentication required.

Body.application/json

{
  "email": "jane@acme.dev",
  "password": "{{password}}",
  "remember": true
}
curl -X POST https://api.acme.dev/v1/auth/login \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "email": "jane@acme.dev",
  "password": "{{password}}",
  "remember": true
}'
Log in: an example request.

200 OK

{
  "accessToken": "eyJhbGciOi...",
  "refreshToken": "rt_8f2k...",
  "expiresIn": 3600
}
Log in: example responses, by status.

Authentication

Refresh token

POST
https://api.acme.dev/v1/auth/token

Get a new access token using a refresh token (OAuth 2 style form body).

Authentication.

No authentication required.

Body.application/x-www-form-urlencoded

FieldValue
grant_typerefresh_token
refresh_token{{refresh_token}}
curl -X POST https://api.acme.dev/v1/auth/token \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode grant_type=refresh_token \
  --data-urlencode 'refresh_token={{refresh_token}}'
Refresh token: an example request.

Section

Products

Products are the items sold in your store.

Prices are always expressed in the smallest currency unit (e.g. cents).

Products

List products

GET
https://api.acme.dev/v1/stores/{{store_id}}/products

Returns a paginated list of products, newest first.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

curl 'https://api.acme.dev/v1/stores/store_42/products?page=1&limit=20&sort=-created_at' \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
List products: an example request.
{
  "data": [
    {
      "id": "prod_123",
      "name": "Running shoes",
      "price": 8999,
      "currency": "USD"
    },
    {
      "id": "prod_124",
      "name": "Trail socks",
      "price": 1299,
      "currency": "USD"
    }
  ],
  "page": 1,
  "hasMore": true
}
List products: example responses, by status.

Products

Get a product

GET
https://api.acme.dev/v1/products/:id

Retrieve a single product by its id.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

curl https://api.acme.dev/v1/products/prod_123 \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
Get a product: an example request.

200 OK

{
  "id": "prod_123",
  "name": "Running shoes",
  "price": 8999,
  "currency": "USD",
  "inStock": true
}
Get a product: example responses, by status.

Products

Create a product

POST
https://api.acme.dev/v1/products

Create a new product.

{ "id": "prod_124", "status": "draft" }

The response contains the created product.

The API validates the payload and returns 422 when a field is invalid.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

Body.application/json

{
  "name": "Running shoes",
  "price": 8999,
  "currency": "USD",
  "tags": [
    "sport",
    "shoes"
  ],
  "inStock": true,
  "dimensions": {
    "weight": 0.8,
    "unit": "kg"
  }
}
curl -X POST https://api.acme.dev/v1/products \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: {{uuid.v4}}' \
  -H 'Authorization: Bearer {{api_token}}' \
  --data-raw '{
  "name": "Running shoes",
  "price": 8999,
  "currency": "USD",
  "tags": [
    "sport",
    "shoes"
  ],
  "inStock": true,
  "dimensions": {
    "weight": 0.8,
    "unit": "kg"
  }
}'
Create a product: an example request.

201 Created

{
  "id": "prod_125",
  "name": "Running shoes",
  "status": "draft"
}
Create a product: example responses, by status.

Products

Update a product

PATCH
https://api.acme.dev/v1/products/:id

Partially update a product. Only the fields you send are changed.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

Body.application/json

{
  "price": 7999
}
curl -X PATCH https://api.acme.dev/v1/products/prod_123 \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "price": 7999
}'
Update a product: an example request.

Products

Delete a product

DELETE
https://api.acme.dev/v1/products/:id

Permanently delete a product. This cannot be undone.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

curl -X DELETE https://api.acme.dev/v1/products/prod_123 \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
Delete a product: an example request.

204 No Content

No response body.

Delete a product: example responses, by status.

Products

Images

Upload and manage product images.

Products · Images

Upload an image

POST
https://api.acme.dev/v1/products/:id/images

Upload a product image (PNG or JPEG, max 5 MB).

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

Body.multipart/form-data

FieldValue
altSide view
file@./shoe.png
curl -X POST https://api.acme.dev/v1/products/prod_123/images \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}' \
  -F 'alt=Side view' \
  -F 'file=@./shoe.png;type=image/png'
Upload an image: an example request.

Section

Catalog

Browse the product catalog by category. Folders can be nested as deeply as you like.

Catalog

Categories

Top-level product categories.

Catalog · Categories

List categories

GET
https://api.acme.dev/v1/catalog/categories

Returns all top-level categories.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

curl https://api.acme.dev/v1/catalog/categories \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
List categories: an example request.

200 OK

{
  "data": [
    {
      "id": "cat_shoes",
      "name": "Shoes"
    },
    {
      "id": "cat_apparel",
      "name": "Apparel"
    }
  ]
}
List categories: example responses, by status.

Catalog · Categories

Subcategories

Categories within a category.

Catalog · Categories · Subcategories

List subcategories
GET
https://api.acme.dev/v1/catalog/categories/:category/subcategories

Returns the subcategories of a category.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

curl https://api.acme.dev/v1/catalog/categories/cat_shoes/subcategories \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
List subcategories: an example request.

200 OK

{
  "data": [
    {
      "id": "sub_running",
      "name": "Running"
    },
    {
      "id": "sub_trail",
      "name": "Trail"
    }
  ]
}
List subcategories: example responses, by status.

Catalog · Categories · Subcategories

Attributes

Filterable attributes of a subcategory (size, color, …).

Catalog · Categories · Subcategories · Attributes

GET
https://api.acme.dev/v1/catalog/categories/:category/subcategories/:subcategory/attributes

Returns the values of every filterable attribute in a subcategory.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

curl https://api.acme.dev/v1/catalog/categories/cat_shoes/subcategories/sub_running/attributes \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
List attribute values: an example request.

200 OK

{
  "size": [
    "38",
    "39",
    "40",
    "41",
    "42"
  ],
  "color": [
    "black",
    "white",
    "volt"
  ]
}
List attribute values: example responses, by status.

Section

Orders

Orders placed by customers. Requires an API key with the orders:read scope.

Orders

List orders

GET
https://api.acme.dev/v1/orders

List orders, optionally filtered by status.

Authentication.

API Key — send X-API-Key in the headers. Inherited from folder "Orders".

curl 'https://api.acme.dev/v1/orders?status=paid' \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Acme-Version: 2025-01' \
  -H 'X-API-Key: {{orders_api_key}}'
List orders: an example request.

Orders

Create an order

POST
https://api.acme.dev/v1/orders

Place an order on behalf of a customer.

Authentication.

Basic Auth — send Authorization: Basic <base64(username:password)>.

Body.application/json

{
  "customerId": "cus_9",
  "items": [
    {
      "productId": "prod_123",
      "quantity": 2
    }
  ]
}
curl -X POST https://api.acme.dev/v1/orders \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Acme-Version: 2025-01' \
  -H 'Content-Type: application/json' \
  -u 'merchant:{{merchant_password}}' \
  --data-raw '{
  "customerId": "cus_9",
  "items": [
    {
      "productId": "prod_123",
      "quantity": 2
    }
  ]
}'
Create an order: an example request.

Orders

GET
https://api.acme.dev/v1/orders/export.xml

Legacy XML export.

Authentication.

API Key — send X-API-Key in the headers. Inherited from folder "Orders".

curl https://api.acme.dev/v1/orders/export.xml \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Acme-Version: 2025-01' \
  -H 'Accept: application/xml' \
  -H 'X-API-Key: {{orders_api_key}}'
Export orders (XML): an example request.

200 OK

<?xml version="1.0"?>
<orders>
  <order id="ord_1" status="paid" total="17998"/>
</orders>
Export orders (XML): example responses, by status.

Section

GraphQL

A GraphQL endpoint is available for flexible queries.

GraphQL

Search products

POST
https://api.acme.dev/v1/graphql

Full-text product search with GraphQL.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

Body.application/json

query Search($term: String!) {
  products(search: $term, first: 5) {
    id
    name
    price
  }
}

Variables

{
  "term": "shoes"
}
curl -X POST https://api.acme.dev/v1/graphql \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "query": "query Search($term: String!) { products(search: $term, first: 5) { id name price } }",
  "variables": {
    "term": "shoes"
  }
}'
Search products: an example request.

Section

Realtime

Streaming APIs over WebSockets and gRPC.

Realtime

Order updates

WS
wss://stream.acme.dev/orders

Subscribe to real-time order events.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

Message.

{
  "subscribe": "orders.*"
}
// Note: browsers don't support custom WebSocket headers. In Node.js, use the `ws` package:
// new WebSocket(url, { headers: {"Accept":"application/json","User-Agent":"acme-docs/1.0","Authorization":"Bearer {{api_token}}"} })
const socket = new WebSocket("wss://stream.acme.dev/orders?store=store_42");

socket.addEventListener("open", () => {
  socket.send("{\"subscribe\": \"orders.*\"}");
});

socket.addEventListener("message", (event) => {
  console.log(event.data);
});
Order updates: an example request.

Realtime

Get stock level

gRPC
http://grpc.acme.dev:50051

acme.inventory.v1.Inventory/GetStock

Query live inventory via gRPC.

Authentication.

Bearer Token — send Authorization: Bearer <token>. Inherited from workspace "Acme Store API".

Message.

{
  "productId": "prod_123"
}
grpcurl \
  -plaintext \
  -H 'x-store-id: store_42' \
  -H 'authorization: Bearer {{api_token}}' \
  -d '{
  "productId": "prod_123"
}' \
  grpc.acme.dev:50051 \
  acme.inventory.v1.Inventory/GetStock
Get stock level: an example request.

Health check

GET
https://api.acme.dev/v1/health

Returns ok when the API is up. No authentication required.

Authentication.

No authentication required.

curl https://api.acme.dev/v1/health \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0'
Health check: an example request.

200 OK

ok
Health check: example responses, by status.