Skip to content

General arrangement

Acme Store API

General notes

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

Variables · Production

ItemNameValue
1base_urlhttps://api.acme.dev/v1
2api_token<redacted>
3store_idstore_42

Section

Authentication

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

Authentication

Log in

Endpoint
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

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
3Content-Typeapplication/json

Bodyapplication/json

{
  "email": "jane@acme.dev",
  "password": "{{password}}",
  "remember": true
}
Detail A
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
}'
Detail B

200 OK

{
  "accessToken": "eyJhbGciOi...",
  "refreshToken": "rt_8f2k...",
  "expiresIn": 3600
}

Authentication

Refresh token

Endpoint
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

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0

Bodyapplication/x-www-form-urlencoded

ItemFieldValue
1grant_typerefresh_token
2refresh_token{{refresh_token}}
Detail A
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}}'

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

Endpoint
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

ItemNameValue
1page1
2limit20
3searchoptionalshoes
4sort-created_at

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
Detail A
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}}'
Detail B
{
  "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

Endpoint
GET
https://api.acme.dev/v1/products/:id
1id= prod_123

Retrieve a single product by its id.

Authentication

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

Path parameters

ItemNameValue
1idprod_123

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
Detail A
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}}'
Detail B

200 OK

{
  "id": "prod_123",
  "name": "Running shoes",
  "price": 8999,
  "currency": "USD",
  "inStock": true
}

Products

Create a product

Endpoint
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

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
3Content-Typeapplication/json
4Idempotency-Key{{uuid.v4}}

Bodyapplication/json

{
  "name": "Running shoes",
  "price": 8999,
  "currency": "USD",
  "tags": [
    "sport",
    "shoes"
  ],
  "inStock": true,
  "dimensions": {
    "weight": 0.8,
    "unit": "kg"
  }
}
Detail A
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"
  }
}'
Detail B

201 Created

{
  "id": "prod_125",
  "name": "Running shoes",
  "status": "draft"
}

Products

Update a product

Endpoint
PATCH
https://api.acme.dev/v1/products/:id
1id= prod_123

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

ItemNameValue
1idprod_123

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0

Bodyapplication/json

{
  "price": 7999
}
Detail A
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

Endpoint
DELETE
https://api.acme.dev/v1/products/:id
1id= prod_123

Permanently delete a product. This cannot be undone.

Authentication

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

Path parameters

ItemNameValue
1idprod_123

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
Detail A
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}}'
Detail B

204 No Content

No response body

Section · Products

Images

Upload and manage product images.

Products / Images

Upload an image

Endpoint
POST
https://api.acme.dev/v1/products/:id/images
1id= prod_123

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

ItemNameValue
1idprod_123

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0

Bodymultipart/form-data

ItemFieldValue
1altSide view
2file@./shoe.png
Detail A
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'

Section

Catalog

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

Section · Catalog

Categories

Top-level product categories.

Catalog / Categories

List categories

Endpoint
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

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
Detail A
curl https://api.acme.dev/v1/catalog/categories \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0' \
  -H 'Authorization: Bearer {{api_token}}'
Detail B

200 OK

{
  "data": [
    {
      "id": "cat_shoes",
      "name": "Shoes"
    },
    {
      "id": "cat_apparel",
      "name": "Apparel"
    }
  ]
}

Section · Catalog / Categories

Subcategories

Categories within a category.

Catalog / Categories / Subcategories

List subcategories
Endpoint
GET
https://api.acme.dev/v1/catalog/categories/:category/subcategories
1category= cat_shoes

Returns the subcategories of a category.

Authentication

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

Path parameters

ItemNameValue
1categorycat_shoes

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
Detail A
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}}'
Detail B

200 OK

{
  "data": [
    {
      "id": "sub_running",
      "name": "Running"
    },
    {
      "id": "sub_trail",
      "name": "Trail"
    }
  ]
}

Section · Catalog / Categories / Subcategories

Attributes

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

Catalog / Categories / Subcategories / Attributes

Endpoint
GET
https://api.acme.dev/v1/catalog/categories/:category/subcategories/:subcategory/attributes
1category= cat_shoes2subcategory= sub_running

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

ItemNameValue
1categorycat_shoes
2subcategorysub_running

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
Detail A
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}}'
Detail B

200 OK

{
  "size": [
    "38",
    "39",
    "40",
    "41",
    "42"
  ],
  "color": [
    "black",
    "white",
    "volt"
  ]
}

Section

Orders

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

Orders

List orders

Endpoint
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

ItemNameValue
1statuspaid

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
3Acme-VersionOrders{{orders_version}}
Detail A
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

Endpoint
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

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
3Acme-VersionOrders{{orders_version}}

Bodyapplication/json

{
  "customerId": "cus_9",
  "items": [
    {
      "productId": "prod_123",
      "quantity": 2
    }
  ]
}
Detail A
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

Endpoint
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

ItemNameValue
1User-Agentworkspaceacme-docs/1.0
2Acme-VersionOrders{{orders_version}}
3Acceptapplication/xml
Detail A
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}}'
Detail B

200 OK

<?xml version="1.0"?>
<orders>
  <order id="ord_1" status="paid" total="17998"/>
</orders>

Section

GraphQL

A GraphQL endpoint is available for flexible queries.

GraphQL

Search products

Endpoint
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

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0

Bodyapplication/json

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

Variables

{
  "term": "shoes"
}
Detail A
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"
  }
}'

Section

Realtime

Streaming APIs over WebSockets and gRPC.

Realtime

Order updates

Connection
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

ItemNameValue
1store{{store_id}}

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0

Message

{
  "subscribe": "orders.*"
}
Detail A
// 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 call
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

ItemNameValue
1x-store-id{{store_id}}

Message

{
  "productId": "prod_123"
}
Detail A
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

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

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

Authentication

No authentication required.

Headers

ItemNameValue
1Acceptworkspaceapplication/json
2User-Agentworkspaceacme-docs/1.0
Detail A
curl https://api.acme.dev/v1/health \
  -H 'Accept: application/json' \
  -H 'User-Agent: acme-docs/1.0'
Detail B

200 OK

ok