Payment Method - Set Default Payment Method for Customer
curl --request GET \
--url https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default \
--header 'api-key: <api-key>'const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"payment_method": "card",
"default_payment_method_id": "card_rGK4Vi5iSW70MY7J2mIg",
"payment_method_type": "ach"
}Payment Methods
Payment Method - Set Default Payment Method for Customer
Set the Payment Method as Default for the Customer.
GET
/
{customer_id}
/
payment_methods
/
{payment_method_id}
/
default
Payment Method - Set Default Payment Method for Customer
curl --request GET \
--url https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default \
--header 'api-key: <api-key>'const options = {method: 'GET', headers: {'api-key': '<api-key>'}};
fetch('https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default"
headers = {"api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.pesaswap.io/{customer_id}/payment_methods/{payment_method_id}/default",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"payment_method": "card",
"default_payment_method_id": "card_rGK4Vi5iSW70MY7J2mIg",
"payment_method_type": "ach"
}Authorizations
Path Parameters
Response
Payment Method has been set as default
Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.
Available options:
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