List Payment Methods by Country
Retrieve a list of all payment methods available for a country.
You can filter the results by specifying the currency query parameter.
For general information about payment methods, use the Client Portal.
Note
The code samples include successful requests (200) and bad requests (400).
For error messages that appear due to bad requests (400), see:
For information about unauthorized request (401) and other authentication errors, see Troubleshooting Authentication and Authorization Errors.
country
Two-letter ISO 3166-1 ALPHA-2 code for the country.
currency
Three-letter ISO 4217 code for the currency.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/payment_methods/countries/IT?currency=EUR"); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Error completing request: " + e.Message); } } } }
JavaScript
const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest; async function main() { try { const result = await makeRequest('GET', '/v1/payment_methods/countries/IT?currency=EUR'); console.log(result); } catch (error) { console.error('Error completing request', error); } }
PHP
<?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/<path-to-your-utility-file>/utilities.php"; include($path); try { $object = make_request('get', '/v1/payment_methods/countries/IT?currency=EUR'); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request response = make_request(method='get', path=f'/v1/payment_methods/countries/IT?currency=EUR') pprint(response)
/v1/payment_methods/countries/:country
List Payment Methods by Country
curl -X get 'https://sandboxapi.rapyd.net/v1/payment_methods/countries/US' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "4cc7a174-3c28-49ac-947b-06867781342e" }, "data": [ { "type": "us_multiplestoresother_cash", "name": "Cash Payment in US", "category": "cash", "image": "https://iconslib.rapyd.net/checkout/us_multiplestoresother_cash.png", "country": "us", "payment_flow_type": "cash", "currencies": [ "USD" ], "status": 1, "is_cancelable": false, "payment_options": [ { "name": "customer", "type": "customer", "regex": "", "description": "A 'customer' object or the ID of an existing customer object. All fields listed here as required must appear either directly in the API request or in the saved customer object.", "is_required": true, "is_updatable": false, "required_fields": [ { "name": "name", "type": "string", "regex": "^[0-9a-zA-Z.:|?*,!&_ -]{1,128}$", "description": "Customer\u2019s full name", "is_required": true, "is_updatable": false } ] } ], "is_expirable": false, "is_online": false, "is_refundable": false, "minimum_expiration_seconds": 0, "maximum_expiration_seconds": 1209600, "virtual_payment_method_type": null, "is_virtual": false, "multiple_overage_allowed": false, "amount_range_per_currency": [ { "currency": "USD", "maximum_amount": null, "minimum_amount": null } ], "is_tokenizable": false, "supported_digital_wallet_providers": [], "is_restricted": false, "supports_subscription": true, "supports_aft": false } ] }
Bad Request - Invalid Country Value
curl -X get 'https://sandboxapi.rapyd.net/v1/payment_methods/countries/2' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "MISSING_INVALID_PARAMETERS", "status": "ERROR", "message": "A parameter is missing or contains an invalid value. The request was rejected. Corrective action: Check all input parameters.", "response_code": "INVALID_COUNTRY", "operation_id": "9e85e33c-03de-4387-895b-3cff3ab6bb3a" } }