curl --request POST \
--url https://api.sandbox.pesaswap.io/payments/session_tokens \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"payment_id": "<string>",
"client_secret": "<string>",
"wallets": [],
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
'const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_id: '<string>',
client_secret: '<string>',
wallets: [],
merchant_connector_details: {
creds_identifier: '<string>',
encoded_data: {connector_account_details: {}, metadata: {}}
}
})
};
fetch('https://api.sandbox.pesaswap.io/payments/session_tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.pesaswap.io/payments/session_tokens"
payload = {
"payment_id": "<string>",
"client_secret": "<string>",
"wallets": [],
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.pesaswap.io/payments/session_tokens",
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([
'payment_id' => '<string>',
'client_secret' => '<string>',
'wallets' => [
],
'merchant_connector_details' => [
'creds_identifier' => '<string>',
'encoded_data' => [
'connector_account_details' => [
],
'metadata' => [
]
]
]
]),
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;
}{
"payment_id": "<string>",
"client_secret": "<string>",
"session_token": [
{
"delayed_session_token": true,
"connector": "<string>",
"sdk_next_action": {
"next_action": "post_session_tokens"
},
"wallet_name": "google_pay"
}
]
}Payments - Session token
Creates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Pesaswap’s SDK to initiate these wallets’ SDK.
curl --request POST \
--url https://api.sandbox.pesaswap.io/payments/session_tokens \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"payment_id": "<string>",
"client_secret": "<string>",
"wallets": [],
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
'const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_id: '<string>',
client_secret: '<string>',
wallets: [],
merchant_connector_details: {
creds_identifier: '<string>',
encoded_data: {connector_account_details: {}, metadata: {}}
}
})
};
fetch('https://api.sandbox.pesaswap.io/payments/session_tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.pesaswap.io/payments/session_tokens"
payload = {
"payment_id": "<string>",
"client_secret": "<string>",
"wallets": [],
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.pesaswap.io/payments/session_tokens",
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([
'payment_id' => '<string>',
'client_secret' => '<string>',
'wallets' => [
],
'merchant_connector_details' => [
'creds_identifier' => '<string>',
'encoded_data' => [
'connector_account_details' => [
],
'metadata' => [
]
]
]
]),
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;
}{
"payment_id": "<string>",
"client_secret": "<string>",
"session_token": [
{
"delayed_session_token": true,
"connector": "<string>",
"sdk_next_action": {
"next_action": "post_session_tokens"
},
"wallet_name": "google_pay"
}
]
}Authorizations
Publishable keys are a type of keys that can be public and have limited scope of usage.
Body
The identifier for the payment
This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK
The list of the supported wallets
Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.
ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, boleto, bca_bank_transfer, bni_va, bri_va, card_redirect, cimb_va, pay_bill, pay_till, classic, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eps, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, pesa_link, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, red_compra, red_pagos, samsung_pay, sepa, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, m_pesa_express, airtel_money, momo_mtn, m_pesa_imt Merchant connector details used to make payments.
Show child attributes
Show child attributes
Response
Payment session object created or session token was retrieved from wallets
The identifier for the payment
This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK
The list of session token object
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
Show child attributes
Show child attributes