Skip to main content
POST
/
v1
/
terminal
/
sessions
Create a Terminal Payment Session
curl --request POST \
  --url https://terminal-dev.xendit.co/v1/terminal/sessions \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'idempotency-key: <idempotency-key>' \
  --data '
{
  "currency": "IDR",
  "amount": 2,
  "country": "ID",
  "session_type": "PAY",
  "mode": "TERMINAL",
  "channel_properties": {
    "terminal_id": "abcd-3254fsd-3242",
    "order_id": "order-12345",
    "payment_methods": [
      "ID_INSERT_CARD"
    ]
  },
  "reference_id": "ref_123456789",
  "customer_id": "cus_123456789",
  "customer": {
    "type": "INDIVIDUAL",
    "reference_id": "cus_123456789",
    "email": "[email protected]",
    "mobile_number": "+62123456789",
    "phone_number": "+62123456789",
    "individual_detail": {
      "given_names": "John Doe",
      "surname": "Doe"
    },
    "business_detail": {
      "business_name": "<string>"
    }
  },
  "description": "Payment for order #123",
  "metadata": {}
}
'
{
  "payment_session_id": "<string>",
  "latest_payment_id": "<string>",
  "business_id": "<string>",
  "reference_id": "ref_123456789",
  "session_type": "PAY",
  "currency": "IDR",
  "amount": 2,
  "country": "ID",
  "mode": "TERMINAL",
  "status": "ACTIVE",
  "channel_properties": {
    "terminal_id": "abcd-3254fsd-3242",
    "order_id": "order-12345",
    "payment_methods": [
      "ID_INSERT_CARD"
    ]
  },
  "created": "2024-11-06T15:32:42Z",
  "updated": "2024-11-06T15:32:42Z",
  "customer_id": "cus_123456789",
  "description": "Payment for order #123",
  "metadata": {},
  "canceled_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Headers

idempotency-key
string
required

Idempotency key to ensure the request is not processed multiple times

Body

application/json
currency
enum<string>
required
Available options:
IDR,
VND,
THB
amount
number<decimal>
required
Required range: x >= 1
country
enum<string>
required
Available options:
ID,
VN,
TH
session_type
enum<string>
required
Available options:
PAY
mode
enum<string>
required
Available options:
TERMINAL
channel_properties
object
required
reference_id
string
Example:

"ref_123456789"

customer_id
string
Example:

"cus_123456789"

customer
object
description
string | null
Example:

"Payment for order #123"

metadata
object

Response

Terminal Payment Session created successfully

payment_session_id
string
required
latest_payment_id
string
required
business_id
string
required
reference_id
string
required
Example:

"ref_123456789"

session_type
enum<string>
required
Available options:
PAY
currency
enum<string>
required
Available options:
IDR,
VND,
THB
amount
number<decimal>
required
Required range: x >= 1
country
enum<string>
required
Available options:
ID,
VN,
TH
mode
enum<string>
required
Available options:
TERMINAL
status
enum<string>
required
Available options:
ACTIVE,
COMPLETED,
FAILED,
CANCELED
channel_properties
object
required
created
string<date-time>
required
Example:

"2024-11-06T15:32:42Z"

updated
string<date-time>
required
Example:

"2024-11-06T15:32:42Z"

customer_id
string
Example:

"cus_123456789"

description
string | null
Example:

"Payment for order #123"

metadata
object
canceled_at
string<date-time> | null