List Payment Methods of Customer
List all the payment methods of a customer.
customer
ID of the customer. String starting with cus_.
category
Category (as opposed to type) of payment method to find.
ending_before
The ID of the payment method created after the last payment method you want to retrieve.
limit
The maximum number of payment methods to return. Range: 1-100.
10
starting_after
The ID of the payment method created before the first payment method you want to retrieve.
type
The type of payment method to find.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string customerId = "cus_217f61d6757465a9716666ccf4d3ec73"; string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/customers/{customerId}/payment_methods"); 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/customers/cus_217f61d6757465a9716666ccf4d3ec73/payment_methods' ); 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/customers/cus_217f61d6757465a9716666ccf4d3ec73/payment_methods"); var_dump($object); } catch (Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request # List Payment Methods of Customer result = make_request(method='get', path='/v1/customers/cus_217f61d6757465a9716666ccf4d3ec73/payment_methods') pprint(result)
/v1/customers/:customer/payment_methods
List Payment Methods of Customer
curl -X get 'https://sandboxapi.rapyd.net/v1/customers/cus_e467136cc0d5ab97ff2c3cbcda43a658/payment_methods' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'idempotency: your-idempotency-parameter-here' \ -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": "1e13a7f6-5e72-4230-9b1f-d60013921f4f" }, "data": [ { "id": "other_2d1a55ed70548f259f6a488fd81ed96a", "type": "pl_p24_bank", "category": "bank_redirect", "metadata": { "merchant_defined": true }, "image": "https://iconslib.rapyd.net/checkout/pl_p24_bank.png", "webhook_url": "", "supporting_documentation": "", "next_action": "not_applicable", "bic_swift": "", "account_last4": "" } ] }