Payments Link - Retrieve
curl --request GET \
--url https://api.sandbox.pesaswap.io/payment_link/{payment_link_id} \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"client_secret": "<string>"
}
'const options = {
method: 'GET',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_secret: '<string>'})
};
fetch('https://api.sandbox.pesaswap.io/payment_link/{payment_link_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.pesaswap.io/payment_link/{payment_link_id}"
payload = { "client_secret": "<string>" }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.pesaswap.io/payment_link/{payment_link_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'client_secret' => '<string>'
]),
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_link_id": "<string>",
"payment_id": "<string>",
"merchant_id": "<string>",
"link_to_pay": "<string>",
"amount": 6540,
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"status": "active",
"expiry": "2023-11-07T05:31:56Z",
"description": "<string>",
"custom_merchant_name": "<string>",
"profile_id": "<string>",
"payment_link_config": {},
"currency": "AED",
"secure_link": "<string>",
"customer_name": "<string>",
"customer_email": "<string>",
"customer_phone": "<string>",
"customer_phone_country_code": "<string>",
"setup_future_usage": "off_session"
}Payments
Payments Link - Retrieve
To retrieve the properties of a Payment Link. This may be used to get the status of a previously initiated payment or next action for an ongoing payment
GET
/
payment_link
/
{payment_link_id}
Payments Link - Retrieve
curl --request GET \
--url https://api.sandbox.pesaswap.io/payment_link/{payment_link_id} \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"client_secret": "<string>"
}
'const options = {
method: 'GET',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_secret: '<string>'})
};
fetch('https://api.sandbox.pesaswap.io/payment_link/{payment_link_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.pesaswap.io/payment_link/{payment_link_id}"
payload = { "client_secret": "<string>" }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.pesaswap.io/payment_link/{payment_link_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'client_secret' => '<string>'
]),
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_link_id": "<string>",
"payment_id": "<string>",
"merchant_id": "<string>",
"link_to_pay": "<string>",
"amount": 6540,
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"status": "active",
"expiry": "2023-11-07T05:31:56Z",
"description": "<string>",
"custom_merchant_name": "<string>",
"profile_id": "<string>",
"payment_link_config": {},
"currency": "AED",
"secure_link": "<string>",
"customer_name": "<string>",
"customer_email": "<string>",
"customer_phone": "<string>",
"customer_phone_country_code": "<string>",
"setup_future_usage": "off_session"
}Authorizations
api_keypublishable_key
Response
Gets details regarding payment link
The three letter ISO currency code in uppercase. Eg: 'USD' for the United States Dollar.
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USDC, USDT, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL Indicates that you intend to make future payments with the payment methods used for this Payment. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.
- On_session - Payment method saved only at pesaswap when consent is provided by the user. CVV will asked during the returning user payment
- Off_session - Payment method saved at both pesaswap and Processor when consent is provided by the user. No input is required during the returning user payment.
Available options:
off_session, on_session