Payment Methods
Retrieve available payment methods for your integration
List Available Payment Methods#
Returns the payment methods available for your service in a given country. Use this endpoint to check which payment methods your service supports before displaying options to users.
This endpoint requires Bearer authentication using your Client ID and Client Secret encoded in Base64.
/api/v1/payment-methods/availableQuery Parameters#
countryCodestringrequiredDZ, MA, TNRequired Headers#
AuthorizationstringrequiredBearer base64(client_id:client_secret)Response Fields#
data[].idstringrequireddata[].namestringrequireddata[].codestringrequiredpaymentMethodCode when creating a payment intent.data[].displayNamestringrequireddata[].imagestringrequiredFiltering by Country
countryCode to get the relevant options for your user.curl "https://api.payment.yassir.io/api/v1/payment-methods/available?countryCode=DZ" \
-H "Authorization: Bearer $(echo -n 'your_client_id:your_client_secret' | base64)" \
-H "x-platform: API"curl "https://api.payment.yassir.io/api/v1/payment-methods/available?countryCode=DZ" \
-H "Authorization: Bearer $(echo -n 'your_client_id:your_client_secret' | base64)" \
-H "x-platform: API"{
"code": 200,
"status": "success",
"message": "payment methods listed successfully",
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Yassir Cash",
"code": "WALLET_V2",
"displayName": "Yassir Cash",
"image": "https://assets.yassir.com/wallet-logo.png"
}
]
}{
"code": 200,
"status": "success",
"message": "payment methods listed successfully",
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Yassir Cash",
"code": "WALLET_V2",
"displayName": "Yassir Cash",
"image": "https://assets.yassir.com/wallet-logo.png"
}
]
}List Payment Methods (with User Context)#
Returns payment methods with user-specific information such as wallet balance. Use this endpoint when you have a payment intent and want to show personalized payment options to the user.
This endpoint uses the x-client-secret header for authentication. The client secret is obtained when you create a payment intent.
/api/v1/payment-methodsQuery Parameters#
amountnumberrequiredactionCurrencyCodestringoptionalDZD, MADactionCountryCodestringoptionalRequired Headers#
x-client-secretstringrequiredx-servicestringrequiredx-country-codestringrequiredDZAx-platformstringrequiredAPIWEBANDROIDIOSx-localestringoptionalen_US, fr_FR, ar_DZGetting the Client Secret#
The x-client-secret is returned in the response when you create a payment intent:
// Create a payment intent first
const intent = await fetch("/api/v1/payments/intents?countryCode=DZA", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
actionId: "unique-order-id",
amount: 2500,
actionCurrencyCode: "DZD",
actionCountryCode: "DZA",
userId: "+213555123456",
}),
});
const { data } = await intent.json();
// data.clientSecret => "pa_xxxxxxxx_secret_xxxxxxxx"
// Use this as the x-client-secret header// Create a payment intent first
const intent = await fetch("/api/v1/payments/intents?countryCode=DZA", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
actionId: "unique-order-id",
amount: 2500,
actionCurrencyCode: "DZD",
actionCountryCode: "DZA",
userId: "+213555123456",
}),
});
const { data } = await intent.json();
// data.clientSecret => "pa_xxxxxxxx_secret_xxxxxxxx"
// Use this as the x-client-secret headerResponse Fields#
data[].idstringrequireddata[].namestringrequireddata[].codestringrequiredpaymentMethodCode when proceeding with payment.data[].displayNamestringrequiredx-locale header.data[].imagestringrequireddata[].balancenumberoptionalWALLET_V2).data[].currencystringoptionalcurl "https://api.payment.yassir.io/api/v1/payment-methods?amount=2500" \
-H "x-client-secret: pa_xxxxxxxx_secret_xxxxxxxx" \
-H "x-service: your-service-code" \
-H "x-country-code: DZA" \
-H "x-platform: API" \
-H "x-locale: en_US"curl "https://api.payment.yassir.io/api/v1/payment-methods?amount=2500" \
-H "x-client-secret: pa_xxxxxxxx_secret_xxxxxxxx" \
-H "x-service: your-service-code" \
-H "x-country-code: DZA" \
-H "x-platform: API" \
-H "x-locale: en_US"{
"code": 200,
"status": "success",
"message": "payment methods listed successfully",
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Yassir Cash",
"code": "WALLET_V2",
"displayName": "Yassir Cash",
"image": "https://assets.yassir.com/wallet-logo.png",
"balance": 15000,
"currency": "DZD"
}
]
}{
"code": 200,
"status": "success",
"message": "payment methods listed successfully",
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Yassir Cash",
"code": "WALLET_V2",
"displayName": "Yassir Cash",
"image": "https://assets.yassir.com/wallet-logo.png",
"balance": 15000,
"currency": "DZD"
}
]
}