Skip to main content
GET
/
v1
/
terminal
/
sessions
/
{id}
Fetch Terminal Payment Session
curl --request GET \
  --url https://terminal-dev.xendit.co/v1/terminal/sessions/{id} \
  --header 'Authorization: Basic <encoded-value>'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://terminal-dev.xendit.co/v1/terminal/sessions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://terminal-dev.xendit.co/v1/terminal/sessions/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://terminal-dev.xendit.co/v1/terminal/sessions/{id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Basic <encoded-value>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
import requests

url = "https://terminal-dev.xendit.co/v1/terminal/sessions/{id}"

headers = {"Authorization": "Basic <encoded-value>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};

fetch('https://terminal-dev.xendit.co/v1/terminal/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://terminal-dev.xendit.co/v1/terminal/sessions/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'

response = http.request(request)
puts response.read_body
{
  "payment_session_id": "<string>",
  "latest_payment_id": "<string>",
  "business_id": "<string>",
  "reference_id": "ref_123456789",
  "session_type": "PAY",
  "amount": 2,
  "mode": "TERMINAL",
  "channel_properties": {
    "terminal_id": "abcd-3254fsd-3242",
    "order_id": "order-12345",
    "payment_methods": []
  },
  "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"
}
{
"error_code": "INVALID_REQUEST",
"message": "Missing required parameter: terminal_id"
}
{
"error_code": "INVALID_REQUEST",
"message": "Missing required parameter: terminal_id"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Terminal Payment Session ID

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

Response

Terminal Payment Session fetched successfully

payment_session_id
string
required
Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
latest_payment_id
string
required
Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$
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,
MYR
amount
number<decimal>
required
Required range: x >= 1
country
enum<string>
required
Available options:
ID,
VN,
TH,
MY
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