API / DOCUMENTATION / 01_

DEVELOPER
API_

RESTful API with predictable resource-oriented URLs. JSON-encoded requests and responses. Standard HTTP codes and authentication.

API VERSION
v2.4
RATE LIMIT
1000/min
AVG LATENCY
< 50ms
UPTIME SLA
99.99%
AUTHENTICATION / KEYS / 02_

API KEYS

Authenticate requests by including your API key in the Authorization header. Keep your keys secure and never expose them in client-side code.

sk_live_* for production
sk_test_* for sandbox
Authorization Header
curl https://api.merchos.io/v2/orders \
  -H "Authorization: Bearer sk_live_xxxxx"
ENDPOINTS / REFERENCE / 03_

ORDERS

POST
/v2/orders
Create a new order for fulfillment
GET
/v2/orders/:id
Retrieve order details and status
GET
/v2/orders
List all orders with pagination and filters
PUT
/v2/orders/:id
Update order before fulfillment
DELETE
/v2/orders/:id
Cancel an order (if not yet shipped)

INVENTORY

GET
/v2/inventory
List all inventory items across locations
GET
/v2/inventory/:sku
Get stock levels for a specific SKU
POST
/v2/inventory/adjust
Adjust inventory quantities
POST
/v2/inventory/transfer
Transfer stock between locations

WEBHOOKS

GET
/v2/webhooks
List configured webhook endpoints
POST
/v2/webhooks
Register a new webhook endpoint
DELETE
/v2/webhooks/:id
Remove a webhook endpoint
EXAMPLES / CODE / 04_

CREATE AN ORDER

POSTRequest
curl -X POST https://api.merchos.io/v2/orders \
  -H "Authorization: Bearer sk_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "email": "customer@example.com",
      "shipping_address": {
        "line1": "123 Main St",
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94102",
        "country": "US"
      }
    },
    "items": [
      {
        "sku": "TSHIRT-BLK-L",
        "quantity": 2
      }
    ]
  }'
Response
{
  "id": "ord_1234567890",
  "status": "processing",
  "created_at": "2024-01-15T10:30:00Z",
  "fulfillment_center": "LAX-01",
  "estimated_delivery": "2024-01-18",
  "tracking": {
    "carrier": "USPS",
    "number": null,
    "url": null
  },
  "webhook_url": "https://your-site.com/webhooks"
}

WEBHOOK EVENTS

AVAILABLE EVENTS

  • order.created
  • order.processing
  • order.shipped
  • order.delivered
  • order.cancelled
  • inventory.low_stock
  • inventory.updated
Webhook Payload
// Webhook payload for order.shipped event
{
  "event": "order.shipped",
  "timestamp": "2024-01-16T14:22:00Z",
  "data": {
    "order_id": "ord_1234567890",
    "tracking_number": "9400111899223456789012",
    "carrier": "USPS",
    "tracking_url": "https://tools.usps.com/...",
    "estimated_delivery": "2024-01-18"
  }
}
SDK / LIBRARIES / 05_

OFFICIAL SDKS_

JS

Node.js

STABLE
PY

Python

STABLE
RB

Ruby

STABLE
GO

Go

STABLE
PHP

PHP

STABLE
JV

Java

BETA

RATE LIMITS

Rate limits are applied per API key. Headers indicate your current usage and reset time.

DEV_SANDBOX100 req/min
PRODUCTION1,000 req/min
ENTERPRISEUNLIMITED

RESPONSE HEADERS

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1705320000

START BUILDING_

Get your API keys and start integrating in minutes. Full documentation and support available.

GET API KEYSVIEW FULL DOCS