Skip to content

API Overview

rCommerce exposes a versioned REST API. All endpoints accept and return JSON.

https://your-domain.com/api/v1

Three authentication methods:

Terminal window
curl -H "Authorization: Bearer <token>" https://api.example.com/api/v1/products

Obtained via /api/v1/auth/login. Tokens expire after 24 hours (configurable).

Terminal window
curl -H "Authorization: Bearer <api_key>" https://api.example.com/api/v1/products

Created via CLI: rcommerce api-key create --name "My App" --scopes "products:read,orders:write"

Some endpoints require no authentication:

  • GET /api/v1/products — list products
  • GET /api/v1/products/:id — get product
  • GET /api/v1/categories — list categories
  • POST /api/v1/auth/register — create account
  • POST /api/v1/auth/login — authenticate

List endpoints return paginated results:

{
"products": [...],
"meta": {
"page": 1,
"per_page": 20,
"total": 150,
"total_pages": 8
}
}

Query parameters: ?page=2&per_page=50

{
"error": {
"code": "validation_error",
"message": "Field 'title' is required"
}
}

HTTP status codes: 400 validation, 401 unauthorized, 403 forbidden, 404 not found, 429 rate limited, 500 server error.

Default: 60 requests/minute per IP. API keys get higher limits (configurable).

Real-time events via WebSocket at /api/v1/ws. Requires JWT authentication.

ResourceEndpoints
ProductsCRUD, variants, images, categories
OrdersCRUD, status transitions, fulfillments
CustomersCRUD, addresses
CartAdd/remove items, totals
CheckoutInitiate, select shipping, complete
PaymentsProcess, refund
ShippingRates, tracking
WebhooksCRUD, event subscriptions

Every API operation has a CLI equivalent:

Terminal window
rcommerce product list
rcommerce order get <id>
rcommerce api-key create --name "Integration" --scopes "read"

See CLI reference for the full command list.