Content
Scope required: read_content (read), write_content (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /content/pages | List pages |
| POST | /content/pages | Create a page |
| GET | /content/blog | List blog posts |
| POST | /content/blog | Create a blog post |
The Mercentia REST API lets your app read and write merchant store data. All endpoints are available at https://gateway.mercentia.com/api/v1.
https://gateway.mercentia.com/api/v1Authorization: Bearer {access_token}X-Store-Id: {store_id}application/jsonScope required: read_products (read), write_products (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /products | List all products (paginated) |
| GET | /products/:id | Get a single product with variants and images |
| POST | /products | Create a new product |
| PUT | /products/:id | Update a product |
| DELETE | /products/:id | Delete a product |
| GET | /products/:id/variants | List product variants |
| POST | /products/:id/variants | Add a variant |
| GET | /collections | List collections |
| POST | /collections | Create a collection |
{
"id": "uuid",
"name": "Premium Cotton T-Shirt",
"slug": "premium-cotton-t-shirt",
"description": "Organic cotton, ethically made",
"status": "active",
"price": 29.99,
"compareAtPrice": 39.99,
"currency": "USD",
"sku": "TSH-001",
"barcode": "1234567890",
"weight": 200,
"weightUnit": "g",
"trackInventory": true,
"inventoryQuantity": 150,
"category": "Apparel",
"tags": ["cotton", "organic", "t-shirt"],
"images": [{ "url": "https://...", "alt": "Front view", "position": 0 }],
"variants": [...],
"metadata": {},
"createdAt": "2026-04-21T10:00:00Z",
"updatedAt": "2026-04-21T10:00:00Z"
}Scope required: read_orders (read), write_orders (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /orders | List orders (filterable by status, date) |
| GET | /orders/:id | Get order detail with items, shipping, payment |
| PUT | /orders/:id | Update order (notes, tags, status) |
| POST | /orders/:id/fulfill | Create a fulfillment with tracking |
| POST | /orders/:id/refund | Issue a refund (full or partial) |
| POST | /draft-orders | Create a draft order |
{
"id": "uuid",
"orderNumber": "SF-1042",
"status": "paid",
"fulfillmentStatus": "unfulfilled",
"customerEmail": "customer@example.com",
"subtotal": 59.98,
"tax": 5.40,
"shipping": 4.99,
"total": 70.37,
"currency": "USD",
"items": [
{
"productId": "uuid",
"variantId": "uuid",
"name": "Premium Cotton T-Shirt - Blue / M",
"quantity": 2,
"price": 29.99
}
],
"shippingAddress": { "line1": "...", "city": "...", "country": "US" },
"paymentMethod": "card",
"createdAt": "2026-04-21T10:00:00Z"
} Scope required: read_customers (read), write_customers (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /customers | List customers |
| GET | /customers/:id | Get customer with addresses and order history |
| POST | /customers | Create a customer |
| PUT | /customers/:id | Update customer profile |
Scope required: read_inventory (read), write_inventory (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /products/:id/inventory | Get stock levels for a product |
| PUT | /products/:id/inventory | Adjust stock level (set or increment/decrement) |
Scope required: read_shipping (read), write_shipping (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /shipping/zones | List shipping zones and rates |
| GET | /shipping/carriers | List configured carriers |
| POST | /shipping/labels | Generate a shipping label |
| POST | /shipping/rates | Calculate shipping rates for a cart |
Scope required: read_discounts (read), write_discounts (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /discounts | List discount codes |
| POST | /discounts | Create a discount code |
| PUT | /discounts/:id | Update a discount |
| DELETE | /discounts/:id | Delete a discount |
Scope required: read_content (read), write_content (write)
| Method | Endpoint | Description |
|---|---|---|
| GET | /content/pages | List pages |
| POST | /content/pages | Create a page |
| GET | /content/blog | List blog posts |
| POST | /content/blog | Create a blog post |
Scope required: read_analytics
| Method | Endpoint | Description |
|---|---|---|
| GET | /analytics/overview | Sales, orders, AOV, conversion rate summary |
| GET | /analytics/sales | Sales data with date range and granularity |
| GET | /analytics/top-products | Best-selling products |
Scope required: read_store_settings
| Method | Endpoint | Description |
|---|---|---|
| GET | /stores/current | Get store name, domain, currency, language |
| GET | /stores/settings | Full store configuration |
List endpoints support cursor-based pagination:
GET /products?limit=25&cursor=eyJpZCI6Inh4eCJ9
Response:
{
"data": [...],
"pagination": {
"hasMore": true,
"nextCursor": "eyJpZCI6Inl5eSJ9",
"total": 150
}
}| Parameter | Default | Max | Description |
|---|---|---|---|
limit | 25 | 250 | Number of records per page |
cursor | - | - | Opaque cursor from previous response |
sort | created_at | - | Sort field (varies by resource) |
order | desc | - | asc or desc |
All errors follow a consistent format:
{
"error": "Descriptive error message",
"code": "VALIDATION_ERROR",
"details": [
{ "field": "name", "message": "Name is required" }
]
}| Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request — check the error details |
| 401 | Unauthorized — invalid or expired token |
| 403 | Forbidden — insufficient scope or permission |
| 404 | Not found |
| 409 | Conflict — resource already exists |
| 422 | Validation error — check the details array |
| 429 | Rate limited — retry after Retry-After header |
| 500 | Server error — contact support if persistent |
| Tier | Requests / Minute | Burst |
|---|---|---|
| Community | 1,000 | 50 concurrent |
| Partner | 10,000 | 200 concurrent |
| Elite | Unlimited | 500 concurrent |
Rate limit headers are included in every response:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 994
X-RateLimit-Reset: 1713700000
Retry-After: 30 (only on 429 responses)The current API version is v1. Breaking changes will be introduced in new versions (v2, v3, etc.) and the previous version will remain supported for at least 12 months with a deprecation notice.
Non-breaking changes (new fields, new endpoints) are added to the current version without a version bump. Your app should handle unknown fields gracefully.