Payment Session
Once authenticated, merchants can create a payment session by providing the necessary attributes.
Endpoint
- URL:
{baseUrl}/api/sessions - Method:
POST
Required Headers
Content-Type: application/json
Accept: application/json
x-api-key: <x-api-key> # Available in the merchant portal
Authorization: Bearer <access_token>
Request Body Parameters
| Name | Location | Type | Description | Required |
|---|---|---|---|---|
| terminal_id | body | string | A terminal ID | yes |
| reference | body | string(40) | Order reference (must be unique per terminal) | yes |
| description | body | string | Description of the transaction | yes |
| currency | body | string(3) | ISO currency code (e.g., EUR) | yes |
| amount | body | int64 | Order amount | yes |
| transaction_type | body | enum | AUTHORIZE or PURCHASE | yes |
| success_url | body | url | URL where the user is redirected after successful payment | yes |
| cancel_url | body | url | URL where the user is redirected after a failed or cancelled payment | yes |
| country | body | string(2) | User’s country (used to preload country-specific payment methods) | no |
| customer | body | object | Customer details (pre-loaded if provided, requested if not) | no |
Sample Request Body
{
"terminal_id": "DEV01",
"reference": "fea21e46-f028-4c79-b101-3b68ebbd9789",
"description": "b1377afa-8246-4d89-ad84-88ced5988e32",
"currency": "EUR",
"amount": 25600,
"transaction_type": "AUTHORIZE",
"success_url": "https://google.com/success-url",
"cancel_url": "https://google.com/failed-url",
"customer": {
"first_name": "John",
"last_name": "Doe",
"address": "Address",
"city": "City",
"country": "BA",
"postal_code": "10000",
"email": "email@email.com",
"phone": "00000",
"customer_ip": "74.196.235.211"
},
"country": "BA"
}
Sample Response
{
"id": "tcNyatfpvOjxxIDEdcYH",
"terminal_id": "DEV01",
"reference": "00893e62-c536-4e35-887e-79f23ac4c971",
"description": "5f0da071-c27e-4b15-beea-f3071740ade1",
"currency": "EUR",
"amount": 25600,
"success_url": "https://google.com/success-url?payload=H4Yje-YA91s15xdQIVzNXlY3xL_p4Aey7IgqVbgbsW__Czv9Trvpw",
"cancel_url": "https://google.com/failed-url?payload=hVUXvUugEL9gX14-4l4dWkgr88RQH0eBiBysx8fmwB1DbRvegoxQrtv",
"error_url": null,
"customer": {
"first_name": "John",
"last_name": "Doe",
"address": "Address",
"city": "City",
"country": "BA",
"postal_code": "10000",
"email": "email@email.com",
"phone": "00000",
"customer_ip": "74.196.235.211",
"id": null
},
"country": "BA",
"expires_at": null,
"status": "CREATED",
"transaction_type": "AUTHORIZE"
}
Next Step
Use the returned Session ID to load the payment form.