Skip to content

Merchant Payment API

Merchant payment collection endpoints (/api/v1/merchant/* and /api/v1/payment/*).


Create Payment Request

POST /api/v1/merchant/payment-requests

{
  "amount": "100",
  "currency": "USDC",
  "chain": "eip155:8453",
  "description": "Order #12345",
  "metadata": {}
}

Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "payment_link": "https://pay.cyber-pay.com/pay/550e8400-...",
  "qr_code_url": "https://cdn.cyber-pay.com/qr/550e8400-....png",
  "status": "pending"
}

Query Payment Request

GET /api/v1/merchant/payment-requests/{id}

{
  "id": "550e8400-...",
  "status": "pending",
  "amount": "100",
  "currency": "USDC",
  "chain": "eip155:8453"
}

List All Payments

GET /api/v1/merchant/payments

{
  "payments": [],
  "total": 0
}

Merchant Statistics

GET /api/v1/merchant/stats

{
  "today": { "total_payments": 3, "total_amount": 450.0, "currency": "USDC" },
  "this_week": { "total_payments": 15, "total_amount": 2250.0, "currency": "USDC" },
  "this_month": { "total_payments": 60, "total_amount": 9000.0, "currency": "USDC" }
}

Get Payment Details

GET /api/v1/payment/{id}

Returns payment request details and available payment options.

{
  "payment_request": {
    "id": "550e8400-...",
    "amount": "100",
    "currency": "USDC",
    "chain": "eip155:8453",
    "description": "Order #12345",
    "merchant": "Example Store"
  },
  "payment_options": [
    {
      "from_token": "ETH",
      "from_chain": "eip155:1",
      "from_amount": "0.035",
      "execution_strategy": "swap_and_bridge",
      "estimated_time": "2-5 minutes"
    }
  ]
}

Execute Payment

POST /api/v1/payment/{id}/execute

{
  "selected_option": {
    "from_token": "ETH",
    "from_chain": "eip155:1"
  }
}

Response

{
  "payment_id": "660e8400-...",
  "status": "executing",
  "estimated_completion": "2026-03-23T12:05:00Z"
}

Query Payment Status

GET /api/v1/payment/{id}/status

{
  "payment_id": "660e8400-...",
  "status": "executing",
  "steps": [
    { "step_type": "swap", "status": "completed", "transaction_hash": "0x123..." },
    { "step_type": "bridge", "status": "executing", "transaction_hash": null },
    { "step_type": "transfer", "status": "pending", "transaction_hash": null }
  ],
  "progress": 33
}