Skip to content

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

VariablesProduction

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

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.

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
Content-Typeapplication/json

Bodyapplication/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
}'
Response
{
  "accessToken": "eyJhbGciOi...",
  "refreshToken": "rt_8f2k...",
  "expiresIn": 3600
}

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.

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0

Bodyapplication/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}}'

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

Query parameters

NameValue
page1
limit20
searchoptionalshoes
sort-created_at

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
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}}'
Response
{
  "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
}

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

Path parameters

NameValue
idprod_123

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
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}}'
Response
{
  "id": "prod_123",
  "name": "Running shoes",
  "price": 8999,
  "currency": "USD",
  "inStock": true
}

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

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
Content-Typeapplication/json
Idempotency-Key{{uuid.v4}}

Bodyapplication/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"
  }
}'
Response
{
  "id": "prod_125",
  "name": "Running shoes",
  "status": "draft"
}

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

Path parameters

NameValue
idprod_123

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0

Bodyapplication/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
}'

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

Path parameters

NameValue
idprod_123

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
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}}'
Response

No response body

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

Path parameters

NameValue
idprod_123

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0

Bodymultipart/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'

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

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
curl https://api.acme.dev/v1/catalog/categories \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
Response
{
  "data": [
    {
      "id": "cat_shoes",
      "name": "Shoes"
    },
    {
      "id": "cat_apparel",
      "name": "Apparel"
    }
  ]
}

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

Path parameters

NameValue
categorycat_shoes

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
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}}'
Response
{
  "data": [
    {
      "id": "sub_running",
      "name": "Running"
    },
    {
      "id": "sub_trail",
      "name": "Trail"
    }
  ]
}

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

Path parameters

NameValue
categorycat_shoes
subcategorysub_running

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
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}}'
Response
{
  "size": [
    "38",
    "39",
    "40",
    "41",
    "42"
  ],
  "color": [
    "black",
    "white",
    "volt"
  ]
}

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

Query parameters

NameValue
statuspaid

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
Acme-VersionOrders{{orders_version}}
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}}'

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

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
Acme-VersionOrders{{orders_version}}

Bodyapplication/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
    }
  ]
}'

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

Headers

NameValue
User-Agentworkspaceacme-docs/1.0
Acme-VersionOrders{{orders_version}}
Acceptapplication/xml
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}}'
Response
<?xml version="1.0"?>
<orders>
  <order id="ord_1" status="paid" total="17998"/>
</orders>

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

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0

Bodyapplication/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"
  }
}'

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

Query parameters

NameValue
store{{store_id}}

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0

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);
});

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

Metadata

NameValue
x-store-id{{store_id}}

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

Health check

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

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

Authentication

No authentication required.

Headers

NameValue
Acceptworkspaceapplication/json
User-Agentworkspaceacme-docs/1.0
curl https://api.acme.dev/v1/health \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0'
Response
ok