Skip to main content

Overview

Orders represent the commerce purchase lifecycle after checkout. Use these endpoints to list orders, retrieve order snapshots, and cancel when supported.

Authentication

Merchant endpoints (merchant backend, commerce scope):
  • x-commerce-api-key: ck_..., or
  • Authorization: Bearer <jwt> (dashboard/user context)

Request

Merchant endpoints:
  • GET /api/commerce/merchant/orders
  • GET /api/commerce/merchant/orders/{orderId}
  • POST /api/commerce/merchant/orders/{orderId}/cancel
Example (merchant list):
BASE_URL=${PEPAY_API_URL}

curl "$BASE_URL/api/commerce/merchant/orders?limit=1&offset=0" \
  -H "x-commerce-api-key: ck_..."

Response

Representative list response:
{
  "success": true,
  "data": {
    "orders": [
      {
        "orderId": "550e8400-e29b-41d4-a716-446655440111",
        "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
        "networkEnvironment": "devnet",
        "status": "processing",
        "substatus": null,
        "actions": { "canCancel": false },
        "shipmentsSummary": { "hasTracking": false, "isDelivered": false, "lastTrackingAt": null, "shipmentCount": 0 },
        "retailer": "amazon",
        "walletAddress": "0x0000000000000000000000000000000000000001",
        "walletNetwork": "bsc",
        "customerId": "cust_123456",
        "total": 99.99,
        "createdAt": "2025-12-21T12:34:56.000Z",
        "updatedAt": "2025-12-21T12:34:56.000Z",
        "itemCount": 1
      }
    ],
    "pagination": { "limit": 1, "offset": 0, "count": 1 }
  }
}

Errors

  • 401 missing/invalid auth
  • 404 order not found
  • 400 cancellation not allowed or invalid request

Examples

Example (retrieve order snapshot):
BASE_URL=${PEPAY_API_URL}

curl "$BASE_URL/api/commerce/merchant/orders/550e8400-e29b-41d4-a716-446655440111" \
  -H "x-commerce-api-key: ck_..."
Next: Payments