Skip to main content
POST
/
payment
/
checkouts
Create a checkout session
curl --request POST \
  --url https://api.orqex.com/v1/payment/checkouts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 2,
  "currency": "<string>",
  "description": "<string>",
  "customer": {
    "email": "[email protected]",
    "first_name": "<string>",
    "last_name": "<string>",
    "address": "<string>",
    "city": "<string>",
    "state": "<string>",
    "country": "<string>",
    "zip": "<string>"
  },
  "return_url": "<string>",
  "webhook_url": "<string>",
  "statement_descriptor": "<string>",
  "receipt_email": "[email protected]",
  "restriction": {
    "country_code": "<string>",
    "phone": {
      "number": "<string>",
      "country": "<string>"
    }
  },
  "customization": {
    "color": "<string>",
    "brand": "<string>"
  },
  "metadata": {}
}
'
{
  "message": "<string>",
  "data": {
    "checkout": {
      "id": "cs_abc123",
      "token": "<string>",
      "url": "<string>",
      "restriction": {},
      "customization": {},
      "expires_at": "<string>",
      "created_at": "<string>"
    },
    "payment": {
      "id": "TRX1A2B3C4D",
      "amount": {
        "value": 5000,
        "formatted": "50.00 XOF",
        "short": "50 XOF",
        "currency": "XOF"
      },
      "customer": {
        "id": "cus_abc123",
        "first_name": "<string>",
        "last_name": "<string>",
        "email": "[email protected]",
        "avatar_url": "<string>"
      },
      "description": "<string>",
      "return_url": "<string>",
      "webhook_url": "<string>",
      "statement_descriptor": "<string>",
      "receipt_email": "<string>",
      "metadata": {},
      "active_attempt": {
        "id": "<string>",
        "method": {
          "value": "momo_mtn",
          "label": "MTN Mobile Money",
          "description": "<string>",
          "icon_url": "<string>"
        },
        "amount": {
          "value": 5000,
          "formatted": "50.00 XOF",
          "short": "50 XOF",
          "currency": "XOF"
        },
        "exchange_rate": 123,
        "correction_rate": 123,
        "gateway": {
          "transaction": {
            "id": "<string>",
            "reference": "<string>",
            "external_id": "<string>",
            "status": "<string>"
          }
        },
        "next_action": {},
        "failure": {
          "code": "<string>",
          "message": "<string>"
        },
        "is_fallback": true,
        "completed_at": "<string>",
        "failed_at": "<string>",
        "created_at": "<string>"
      },
      "completed_at": "<string>",
      "expires_at": "<string>",
      "created_at": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Project secret key, e.g. sk_live_..., sent as Authorization: Bearer sk_....

Headers

X-Idempotency-Key
string

Safely retry a write without duplicating it. 8-128 chars.

Required string length: 8 - 128

Body

application/json
amount
number
required

Amount to charge, in major units (e.g. 50). Minimum 1.

Required range: x >= 1
currency
string
required

Three-letter ISO 4217 currency code, uppercase (e.g. XOF).

Required string length: 3
description
string
required

Short description shown to the customer on the checkout page.

Maximum string length: 500
customer
object
required
return_url
string<uri>

URL the customer is redirected to after checkout.

Maximum string length: 2048
webhook_url
string<uri>

URL Orqex POSTs this checkout's payment events to.

Maximum string length: 2048
statement_descriptor
string

Text shown on the customer's statement (max 22 chars).

Maximum string length: 22
receipt_email
string<email>

Email address to send the payment receipt to.

Maximum string length: 255
restriction
object

Optionally restrict the session to a country or a specific phone number.

customization
object

Customise the hosted checkout appearance.

metadata
object

Up to 10 arbitrary key/value pairs, stored on the payment.

Response

Created

message
string
data
object