curl --request POST \
--url https://api.staging.paycodefintech.net/terminals/balance-enquiry \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"acquirer": {
"country": "180",
"id": "ACQ001"
},
"card": {
"entry_mode": "051",
"expiry_date": "2509",
"pan": "6050923334801130",
"sequence_number": "001",
"track2": "6050923334801130D25076211019450400000"
},
"cardholder": {
"authentication": {
"protected_pin_data": "8DA22546B6C93C95"
}
},
"emv_data": {
"82": "3c00",
"95": "8000040000",
"5F2A": "0976",
"5F34": "00",
"9A": "250720",
"9C": "01",
"9F02": "000000000000",
"9F03": "000000000000",
"9F10": "0fa501a23100000000000000000000000f000000000000000000000000000000",
"9F1A": "0180",
"9F26": "aac7b7d3eda149af",
"9F27": "80",
"9F33": "604020",
"9F36": "005a",
"9F37": "7aa214a6"
},
"merchant": {
"category_code": "5411",
"id": "MERCHAoNT001",
"name_and_location": "Test Merchant, Test City"
},
"network_token": "f5Ce3SuoWgSVq1A5WWbg",
"poi": {
"id": "58100155"
},
"terminal_id": "term_5QoXWYH7lR8Og5lu2Bv5",
"transaction_amounts": {
"cardholder_billing_amount": "0",
"cardholder_billing_currency": "976",
"currency": "976",
"exchange_rate": "1.000000",
"total_amount": "0"
},
"transaction_id": {
"reference": "bacd"
}
}
'import requests
url = "https://api.staging.paycodefintech.net/terminals/balance-enquiry"
payload = {
"acquirer": {
"country": "180",
"id": "ACQ001"
},
"card": {
"entry_mode": "051",
"expiry_date": "2509",
"pan": "6050923334801130",
"sequence_number": "001",
"track2": "6050923334801130D25076211019450400000"
},
"cardholder": { "authentication": { "protected_pin_data": "8DA22546B6C93C95" } },
"emv_data": {
"82": "3c00",
"95": "8000040000",
"5F2A": "0976",
"5F34": "00",
"9A": "250720",
"9C": "01",
"9F02": "000000000000",
"9F03": "000000000000",
"9F10": "0fa501a23100000000000000000000000f000000000000000000000000000000",
"9F1A": "0180",
"9F26": "aac7b7d3eda149af",
"9F27": "80",
"9F33": "604020",
"9F36": "005a",
"9F37": "7aa214a6"
},
"merchant": {
"category_code": "5411",
"id": "MERCHAoNT001",
"name_and_location": "Test Merchant, Test City"
},
"network_token": "f5Ce3SuoWgSVq1A5WWbg",
"poi": { "id": "58100155" },
"terminal_id": "term_5QoXWYH7lR8Og5lu2Bv5",
"transaction_amounts": {
"cardholder_billing_amount": "0",
"cardholder_billing_currency": "976",
"currency": "976",
"exchange_rate": "1.000000",
"total_amount": "0"
},
"transaction_id": { "reference": "bacd" }
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
acquirer: {country: '180', id: 'ACQ001'},
card: {
entry_mode: '051',
expiry_date: '2509',
pan: '6050923334801130',
sequence_number: '001',
track2: '6050923334801130D25076211019450400000'
},
cardholder: {authentication: {protected_pin_data: '8DA22546B6C93C95'}},
emv_data: {
'82': '3c00',
'95': '8000040000',
'5F2A': '0976',
'5F34': '00',
'9A': '250720',
'9C': '01',
'9F02': '000000000000',
'9F03': '000000000000',
'9F10': '0fa501a23100000000000000000000000f000000000000000000000000000000',
'9F1A': '0180',
'9F26': 'aac7b7d3eda149af',
'9F27': '80',
'9F33': '604020',
'9F36': '005a',
'9F37': '7aa214a6'
},
merchant: {
category_code: '5411',
id: 'MERCHAoNT001',
name_and_location: 'Test Merchant, Test City'
},
network_token: 'f5Ce3SuoWgSVq1A5WWbg',
poi: {id: '58100155'},
terminal_id: 'term_5QoXWYH7lR8Og5lu2Bv5',
transaction_amounts: {
cardholder_billing_amount: '0',
cardholder_billing_currency: '976',
currency: '976',
exchange_rate: '1.000000',
total_amount: '0'
},
transaction_id: {reference: 'bacd'}
})
};
fetch('https://api.staging.paycodefintech.net/terminals/balance-enquiry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.paycodefintech.net/terminals/balance-enquiry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'acquirer' => [
'country' => '180',
'id' => 'ACQ001'
],
'card' => [
'entry_mode' => '051',
'expiry_date' => '2509',
'pan' => '6050923334801130',
'sequence_number' => '001',
'track2' => '6050923334801130D25076211019450400000'
],
'cardholder' => [
'authentication' => [
'protected_pin_data' => '8DA22546B6C93C95'
]
],
'emv_data' => [
'82' => '3c00',
'95' => '8000040000',
'5F2A' => '0976',
'5F34' => '00',
'9A' => '250720',
'9C' => '01',
'9F02' => '000000000000',
'9F03' => '000000000000',
'9F10' => '0fa501a23100000000000000000000000f000000000000000000000000000000',
'9F1A' => '0180',
'9F26' => 'aac7b7d3eda149af',
'9F27' => '80',
'9F33' => '604020',
'9F36' => '005a',
'9F37' => '7aa214a6'
],
'merchant' => [
'category_code' => '5411',
'id' => 'MERCHAoNT001',
'name_and_location' => 'Test Merchant, Test City'
],
'network_token' => 'f5Ce3SuoWgSVq1A5WWbg',
'poi' => [
'id' => '58100155'
],
'terminal_id' => 'term_5QoXWYH7lR8Og5lu2Bv5',
'transaction_amounts' => [
'cardholder_billing_amount' => '0',
'cardholder_billing_currency' => '976',
'currency' => '976',
'exchange_rate' => '1.000000',
'total_amount' => '0'
],
'transaction_id' => [
'reference' => 'bacd'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.paycodefintech.net/terminals/balance-enquiry"
payload := strings.NewReader("{\n \"acquirer\": {\n \"country\": \"180\",\n \"id\": \"ACQ001\"\n },\n \"card\": {\n \"entry_mode\": \"051\",\n \"expiry_date\": \"2509\",\n \"pan\": \"6050923334801130\",\n \"sequence_number\": \"001\",\n \"track2\": \"6050923334801130D25076211019450400000\"\n },\n \"cardholder\": {\n \"authentication\": {\n \"protected_pin_data\": \"8DA22546B6C93C95\"\n }\n },\n \"emv_data\": {\n \"82\": \"3c00\",\n \"95\": \"8000040000\",\n \"5F2A\": \"0976\",\n \"5F34\": \"00\",\n \"9A\": \"250720\",\n \"9C\": \"01\",\n \"9F02\": \"000000000000\",\n \"9F03\": \"000000000000\",\n \"9F10\": \"0fa501a23100000000000000000000000f000000000000000000000000000000\",\n \"9F1A\": \"0180\",\n \"9F26\": \"aac7b7d3eda149af\",\n \"9F27\": \"80\",\n \"9F33\": \"604020\",\n \"9F36\": \"005a\",\n \"9F37\": \"7aa214a6\"\n },\n \"merchant\": {\n \"category_code\": \"5411\",\n \"id\": \"MERCHAoNT001\",\n \"name_and_location\": \"Test Merchant, Test City\"\n },\n \"network_token\": \"f5Ce3SuoWgSVq1A5WWbg\",\n \"poi\": {\n \"id\": \"58100155\"\n },\n \"terminal_id\": \"term_5QoXWYH7lR8Og5lu2Bv5\",\n \"transaction_amounts\": {\n \"cardholder_billing_amount\": \"0\",\n \"cardholder_billing_currency\": \"976\",\n \"currency\": \"976\",\n \"exchange_rate\": \"1.000000\",\n \"total_amount\": \"0\"\n },\n \"transaction_id\": {\n \"reference\": \"bacd\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.staging.paycodefintech.net/terminals/balance-enquiry")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"acquirer\": {\n \"country\": \"180\",\n \"id\": \"ACQ001\"\n },\n \"card\": {\n \"entry_mode\": \"051\",\n \"expiry_date\": \"2509\",\n \"pan\": \"6050923334801130\",\n \"sequence_number\": \"001\",\n \"track2\": \"6050923334801130D25076211019450400000\"\n },\n \"cardholder\": {\n \"authentication\": {\n \"protected_pin_data\": \"8DA22546B6C93C95\"\n }\n },\n \"emv_data\": {\n \"82\": \"3c00\",\n \"95\": \"8000040000\",\n \"5F2A\": \"0976\",\n \"5F34\": \"00\",\n \"9A\": \"250720\",\n \"9C\": \"01\",\n \"9F02\": \"000000000000\",\n \"9F03\": \"000000000000\",\n \"9F10\": \"0fa501a23100000000000000000000000f000000000000000000000000000000\",\n \"9F1A\": \"0180\",\n \"9F26\": \"aac7b7d3eda149af\",\n \"9F27\": \"80\",\n \"9F33\": \"604020\",\n \"9F36\": \"005a\",\n \"9F37\": \"7aa214a6\"\n },\n \"merchant\": {\n \"category_code\": \"5411\",\n \"id\": \"MERCHAoNT001\",\n \"name_and_location\": \"Test Merchant, Test City\"\n },\n \"network_token\": \"f5Ce3SuoWgSVq1A5WWbg\",\n \"poi\": {\n \"id\": \"58100155\"\n },\n \"terminal_id\": \"term_5QoXWYH7lR8Og5lu2Bv5\",\n \"transaction_amounts\": {\n \"cardholder_billing_amount\": \"0\",\n \"cardholder_billing_currency\": \"976\",\n \"currency\": \"976\",\n \"exchange_rate\": \"1.000000\",\n \"total_amount\": \"0\"\n },\n \"transaction_id\": {\n \"reference\": \"bacd\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.paycodefintech.net/terminals/balance-enquiry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"acquirer\": {\n \"country\": \"180\",\n \"id\": \"ACQ001\"\n },\n \"card\": {\n \"entry_mode\": \"051\",\n \"expiry_date\": \"2509\",\n \"pan\": \"6050923334801130\",\n \"sequence_number\": \"001\",\n \"track2\": \"6050923334801130D25076211019450400000\"\n },\n \"cardholder\": {\n \"authentication\": {\n \"protected_pin_data\": \"8DA22546B6C93C95\"\n }\n },\n \"emv_data\": {\n \"82\": \"3c00\",\n \"95\": \"8000040000\",\n \"5F2A\": \"0976\",\n \"5F34\": \"00\",\n \"9A\": \"250720\",\n \"9C\": \"01\",\n \"9F02\": \"000000000000\",\n \"9F03\": \"000000000000\",\n \"9F10\": \"0fa501a23100000000000000000000000f000000000000000000000000000000\",\n \"9F1A\": \"0180\",\n \"9F26\": \"aac7b7d3eda149af\",\n \"9F27\": \"80\",\n \"9F33\": \"604020\",\n \"9F36\": \"005a\",\n \"9F37\": \"7aa214a6\"\n },\n \"merchant\": {\n \"category_code\": \"5411\",\n \"id\": \"MERCHAoNT001\",\n \"name_and_location\": \"Test Merchant, Test City\"\n },\n \"network_token\": \"f5Ce3SuoWgSVq1A5WWbg\",\n \"poi\": {\n \"id\": \"58100155\"\n },\n \"terminal_id\": \"term_5QoXWYH7lR8Og5lu2Bv5\",\n \"transaction_amounts\": {\n \"cardholder_billing_amount\": \"0\",\n \"cardholder_billing_currency\": \"976\",\n \"currency\": \"976\",\n \"exchange_rate\": \"1.000000\",\n \"total_amount\": \"0\"\n },\n \"transaction_id\": {\n \"reference\": \"bacd\"\n }\n}"
response = http.request(request)
puts response.read_body{
"additional_amounts": [
{
"amount": "10500",
"currency": "USD",
"qualifier": "LEDGER_BALANCE"
},
{
"amount": "500",
"currency": "USD",
"qualifier": "HOLD_AMOUNT"
}
],
"available_balance": 10000,
"currency": "USD",
"message": "Balance enquiry completed successfully",
"raw_response": null,
"response_code": "00",
"status": "success",
"timestamp": "2024-01-15T10:30:05Z",
"transaction_id": "txn_123456"
}POS Balance Enquiry
Performs a balance enquiry for a card or account through POS terminal. This endpoint allows merchants to check the available balance of a customer’s card or account before processing a transaction.
curl --request POST \
--url https://api.staging.paycodefintech.net/terminals/balance-enquiry \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"acquirer": {
"country": "180",
"id": "ACQ001"
},
"card": {
"entry_mode": "051",
"expiry_date": "2509",
"pan": "6050923334801130",
"sequence_number": "001",
"track2": "6050923334801130D25076211019450400000"
},
"cardholder": {
"authentication": {
"protected_pin_data": "8DA22546B6C93C95"
}
},
"emv_data": {
"82": "3c00",
"95": "8000040000",
"5F2A": "0976",
"5F34": "00",
"9A": "250720",
"9C": "01",
"9F02": "000000000000",
"9F03": "000000000000",
"9F10": "0fa501a23100000000000000000000000f000000000000000000000000000000",
"9F1A": "0180",
"9F26": "aac7b7d3eda149af",
"9F27": "80",
"9F33": "604020",
"9F36": "005a",
"9F37": "7aa214a6"
},
"merchant": {
"category_code": "5411",
"id": "MERCHAoNT001",
"name_and_location": "Test Merchant, Test City"
},
"network_token": "f5Ce3SuoWgSVq1A5WWbg",
"poi": {
"id": "58100155"
},
"terminal_id": "term_5QoXWYH7lR8Og5lu2Bv5",
"transaction_amounts": {
"cardholder_billing_amount": "0",
"cardholder_billing_currency": "976",
"currency": "976",
"exchange_rate": "1.000000",
"total_amount": "0"
},
"transaction_id": {
"reference": "bacd"
}
}
'import requests
url = "https://api.staging.paycodefintech.net/terminals/balance-enquiry"
payload = {
"acquirer": {
"country": "180",
"id": "ACQ001"
},
"card": {
"entry_mode": "051",
"expiry_date": "2509",
"pan": "6050923334801130",
"sequence_number": "001",
"track2": "6050923334801130D25076211019450400000"
},
"cardholder": { "authentication": { "protected_pin_data": "8DA22546B6C93C95" } },
"emv_data": {
"82": "3c00",
"95": "8000040000",
"5F2A": "0976",
"5F34": "00",
"9A": "250720",
"9C": "01",
"9F02": "000000000000",
"9F03": "000000000000",
"9F10": "0fa501a23100000000000000000000000f000000000000000000000000000000",
"9F1A": "0180",
"9F26": "aac7b7d3eda149af",
"9F27": "80",
"9F33": "604020",
"9F36": "005a",
"9F37": "7aa214a6"
},
"merchant": {
"category_code": "5411",
"id": "MERCHAoNT001",
"name_and_location": "Test Merchant, Test City"
},
"network_token": "f5Ce3SuoWgSVq1A5WWbg",
"poi": { "id": "58100155" },
"terminal_id": "term_5QoXWYH7lR8Og5lu2Bv5",
"transaction_amounts": {
"cardholder_billing_amount": "0",
"cardholder_billing_currency": "976",
"currency": "976",
"exchange_rate": "1.000000",
"total_amount": "0"
},
"transaction_id": { "reference": "bacd" }
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
acquirer: {country: '180', id: 'ACQ001'},
card: {
entry_mode: '051',
expiry_date: '2509',
pan: '6050923334801130',
sequence_number: '001',
track2: '6050923334801130D25076211019450400000'
},
cardholder: {authentication: {protected_pin_data: '8DA22546B6C93C95'}},
emv_data: {
'82': '3c00',
'95': '8000040000',
'5F2A': '0976',
'5F34': '00',
'9A': '250720',
'9C': '01',
'9F02': '000000000000',
'9F03': '000000000000',
'9F10': '0fa501a23100000000000000000000000f000000000000000000000000000000',
'9F1A': '0180',
'9F26': 'aac7b7d3eda149af',
'9F27': '80',
'9F33': '604020',
'9F36': '005a',
'9F37': '7aa214a6'
},
merchant: {
category_code: '5411',
id: 'MERCHAoNT001',
name_and_location: 'Test Merchant, Test City'
},
network_token: 'f5Ce3SuoWgSVq1A5WWbg',
poi: {id: '58100155'},
terminal_id: 'term_5QoXWYH7lR8Og5lu2Bv5',
transaction_amounts: {
cardholder_billing_amount: '0',
cardholder_billing_currency: '976',
currency: '976',
exchange_rate: '1.000000',
total_amount: '0'
},
transaction_id: {reference: 'bacd'}
})
};
fetch('https://api.staging.paycodefintech.net/terminals/balance-enquiry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.paycodefintech.net/terminals/balance-enquiry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'acquirer' => [
'country' => '180',
'id' => 'ACQ001'
],
'card' => [
'entry_mode' => '051',
'expiry_date' => '2509',
'pan' => '6050923334801130',
'sequence_number' => '001',
'track2' => '6050923334801130D25076211019450400000'
],
'cardholder' => [
'authentication' => [
'protected_pin_data' => '8DA22546B6C93C95'
]
],
'emv_data' => [
'82' => '3c00',
'95' => '8000040000',
'5F2A' => '0976',
'5F34' => '00',
'9A' => '250720',
'9C' => '01',
'9F02' => '000000000000',
'9F03' => '000000000000',
'9F10' => '0fa501a23100000000000000000000000f000000000000000000000000000000',
'9F1A' => '0180',
'9F26' => 'aac7b7d3eda149af',
'9F27' => '80',
'9F33' => '604020',
'9F36' => '005a',
'9F37' => '7aa214a6'
],
'merchant' => [
'category_code' => '5411',
'id' => 'MERCHAoNT001',
'name_and_location' => 'Test Merchant, Test City'
],
'network_token' => 'f5Ce3SuoWgSVq1A5WWbg',
'poi' => [
'id' => '58100155'
],
'terminal_id' => 'term_5QoXWYH7lR8Og5lu2Bv5',
'transaction_amounts' => [
'cardholder_billing_amount' => '0',
'cardholder_billing_currency' => '976',
'currency' => '976',
'exchange_rate' => '1.000000',
'total_amount' => '0'
],
'transaction_id' => [
'reference' => 'bacd'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.paycodefintech.net/terminals/balance-enquiry"
payload := strings.NewReader("{\n \"acquirer\": {\n \"country\": \"180\",\n \"id\": \"ACQ001\"\n },\n \"card\": {\n \"entry_mode\": \"051\",\n \"expiry_date\": \"2509\",\n \"pan\": \"6050923334801130\",\n \"sequence_number\": \"001\",\n \"track2\": \"6050923334801130D25076211019450400000\"\n },\n \"cardholder\": {\n \"authentication\": {\n \"protected_pin_data\": \"8DA22546B6C93C95\"\n }\n },\n \"emv_data\": {\n \"82\": \"3c00\",\n \"95\": \"8000040000\",\n \"5F2A\": \"0976\",\n \"5F34\": \"00\",\n \"9A\": \"250720\",\n \"9C\": \"01\",\n \"9F02\": \"000000000000\",\n \"9F03\": \"000000000000\",\n \"9F10\": \"0fa501a23100000000000000000000000f000000000000000000000000000000\",\n \"9F1A\": \"0180\",\n \"9F26\": \"aac7b7d3eda149af\",\n \"9F27\": \"80\",\n \"9F33\": \"604020\",\n \"9F36\": \"005a\",\n \"9F37\": \"7aa214a6\"\n },\n \"merchant\": {\n \"category_code\": \"5411\",\n \"id\": \"MERCHAoNT001\",\n \"name_and_location\": \"Test Merchant, Test City\"\n },\n \"network_token\": \"f5Ce3SuoWgSVq1A5WWbg\",\n \"poi\": {\n \"id\": \"58100155\"\n },\n \"terminal_id\": \"term_5QoXWYH7lR8Og5lu2Bv5\",\n \"transaction_amounts\": {\n \"cardholder_billing_amount\": \"0\",\n \"cardholder_billing_currency\": \"976\",\n \"currency\": \"976\",\n \"exchange_rate\": \"1.000000\",\n \"total_amount\": \"0\"\n },\n \"transaction_id\": {\n \"reference\": \"bacd\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.staging.paycodefintech.net/terminals/balance-enquiry")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"acquirer\": {\n \"country\": \"180\",\n \"id\": \"ACQ001\"\n },\n \"card\": {\n \"entry_mode\": \"051\",\n \"expiry_date\": \"2509\",\n \"pan\": \"6050923334801130\",\n \"sequence_number\": \"001\",\n \"track2\": \"6050923334801130D25076211019450400000\"\n },\n \"cardholder\": {\n \"authentication\": {\n \"protected_pin_data\": \"8DA22546B6C93C95\"\n }\n },\n \"emv_data\": {\n \"82\": \"3c00\",\n \"95\": \"8000040000\",\n \"5F2A\": \"0976\",\n \"5F34\": \"00\",\n \"9A\": \"250720\",\n \"9C\": \"01\",\n \"9F02\": \"000000000000\",\n \"9F03\": \"000000000000\",\n \"9F10\": \"0fa501a23100000000000000000000000f000000000000000000000000000000\",\n \"9F1A\": \"0180\",\n \"9F26\": \"aac7b7d3eda149af\",\n \"9F27\": \"80\",\n \"9F33\": \"604020\",\n \"9F36\": \"005a\",\n \"9F37\": \"7aa214a6\"\n },\n \"merchant\": {\n \"category_code\": \"5411\",\n \"id\": \"MERCHAoNT001\",\n \"name_and_location\": \"Test Merchant, Test City\"\n },\n \"network_token\": \"f5Ce3SuoWgSVq1A5WWbg\",\n \"poi\": {\n \"id\": \"58100155\"\n },\n \"terminal_id\": \"term_5QoXWYH7lR8Og5lu2Bv5\",\n \"transaction_amounts\": {\n \"cardholder_billing_amount\": \"0\",\n \"cardholder_billing_currency\": \"976\",\n \"currency\": \"976\",\n \"exchange_rate\": \"1.000000\",\n \"total_amount\": \"0\"\n },\n \"transaction_id\": {\n \"reference\": \"bacd\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.paycodefintech.net/terminals/balance-enquiry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"acquirer\": {\n \"country\": \"180\",\n \"id\": \"ACQ001\"\n },\n \"card\": {\n \"entry_mode\": \"051\",\n \"expiry_date\": \"2509\",\n \"pan\": \"6050923334801130\",\n \"sequence_number\": \"001\",\n \"track2\": \"6050923334801130D25076211019450400000\"\n },\n \"cardholder\": {\n \"authentication\": {\n \"protected_pin_data\": \"8DA22546B6C93C95\"\n }\n },\n \"emv_data\": {\n \"82\": \"3c00\",\n \"95\": \"8000040000\",\n \"5F2A\": \"0976\",\n \"5F34\": \"00\",\n \"9A\": \"250720\",\n \"9C\": \"01\",\n \"9F02\": \"000000000000\",\n \"9F03\": \"000000000000\",\n \"9F10\": \"0fa501a23100000000000000000000000f000000000000000000000000000000\",\n \"9F1A\": \"0180\",\n \"9F26\": \"aac7b7d3eda149af\",\n \"9F27\": \"80\",\n \"9F33\": \"604020\",\n \"9F36\": \"005a\",\n \"9F37\": \"7aa214a6\"\n },\n \"merchant\": {\n \"category_code\": \"5411\",\n \"id\": \"MERCHAoNT001\",\n \"name_and_location\": \"Test Merchant, Test City\"\n },\n \"network_token\": \"f5Ce3SuoWgSVq1A5WWbg\",\n \"poi\": {\n \"id\": \"58100155\"\n },\n \"terminal_id\": \"term_5QoXWYH7lR8Og5lu2Bv5\",\n \"transaction_amounts\": {\n \"cardholder_billing_amount\": \"0\",\n \"cardholder_billing_currency\": \"976\",\n \"currency\": \"976\",\n \"exchange_rate\": \"1.000000\",\n \"total_amount\": \"0\"\n },\n \"transaction_id\": {\n \"reference\": \"bacd\"\n }\n}"
response = http.request(request)
puts response.read_body{
"additional_amounts": [
{
"amount": "10500",
"currency": "USD",
"qualifier": "LEDGER_BALANCE"
},
{
"amount": "500",
"currency": "USD",
"qualifier": "HOLD_AMOUNT"
}
],
"available_balance": 10000,
"currency": "USD",
"message": "Balance enquiry completed successfully",
"raw_response": null,
"response_code": "00",
"status": "success",
"timestamp": "2024-01-15T10:30:05Z",
"transaction_id": "txn_123456"
}Authorizations
Use the API key created under your merchant account from the Paycode dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Body
Request payload for POS balance enquiry
Terminal ID (required)
network-token
Card Information for POS transactions
Show child attributes
Show child attributes
Merchant Information for POS transactions
Show child attributes
Show child attributes
Acquirer Information for POS transactions
Show child attributes
Show child attributes
Point of Interaction (Terminal) Information
Show child attributes
Show child attributes
Cardholder Information
Show child attributes
Show child attributes
Transaction Amounts Information
Show child attributes
Show child attributes
Transaction Identification
Show child attributes
Show child attributes
EMV data if available
Show child attributes
Show child attributes
Initiating Party Information
Show child attributes
Show child attributes
Response
Balance enquiry successful
Response payload for POS balance enquiry
Transaction ID
Status of the enquiry
Currency code
Response message
Available balance (in smallest currency unit, e.g., cents)
Additional amounts (e.g., ledger balance, hold amount)
Response timestamp
Response code from the payment system
Raw response from the payment system if available