Get the list of payment methods available for your purchase
https://gate.qorepay.com/api/v1/payment_methods
Send this request providing, at the very least, the brand_id
andcurrency
query parameters having the same values you'd use to create your Purchase. Be sure to use the same API key you'll create your Purchase with; it will define the test_mode
setting used in the lookup.
In the response body you'll receive an object with available_payment_methods
property containing the list of payment method names available to use with your Purchase (e.g. those codes can be used inpayment_method_whitelist
field or with ?preferred={payment_method}
option of checkout_url
).
Please note that all lookup arguments must be provided via query parameters after the endpoint, e.g. the minimal call would be similar to: GET
/api/v1/payment_methods/?brand_id=75a76529-91c7-4d98-90a9-8a641d70ee52¤cy=NGN
HEADER PARAMS
authorization
String
required
Set value to
BEARER SECRET_KEY
content-type
String
required
Set value to
JSON
QUERY PARAMS
brand_id
string
required
Which brand would you like to lookup the available payment methods for. Use the same value (UUID) you'd set the
Purchase.brand_id
to.currency
string
required
Currency you'd use in your Purchase in ISO 4217 format, e.g.
NGN
.country
string
Country code in the ISO 3166-1 alpha-2 format (e.g.
NG
) Optional.recurring
boolean
If provided in the format of
recurring=true
, will filter out the methods that don't support recurring charges (seePOST
/purchases/{id}/charge/
).language
boolean
Language code in the ISO 639-1 format (e.g.
en
) Optional.
RESPONSES
200
OK
400
Invalid data submitted or request processing error
Query
Javascript
const options = {
method: 'GET',
headers: {
accept: 'application/json'
}
};
fetch('https://gate.qorepay.com/api/v1/payment_methods/',
options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Sample Response
JSON
{
"available_payment_methods": [
"visa",
"mastercard",
"some_method"
],
"by_country": {
"any": [
"card"
],
"GB": [
"some_method"
]
},
"country_names": {
"any": "Other",
"GB": "United Kingdom"
},
"names": {
"visa": "Visa",
"mastercard": "Mastercard",
"some_method": "Some method"
},
"logos": {
"some_method": [
"/static/images/icon-visa.svg",
"/static/images/icon-mastercard.svg",
"/static/images/icon-maestro.svg"
],
"visa": "/static/images/icon-visa.svg",
"mastercard": "/static/images/icon-mastercard.svg"
},
"card_methods": [
"american_express",
"visa"
]
}