List customer payment methods
List customer payment method resources.
Endpoint
GET /customers/:id/payment_methods
Sample code
- curl
- Node
- PHP
- Python
- Ruby
curl --location 'https://api.payrexhq.com/customers/<insert customer id>/payment_methods' \
-u replace_with_secret_api_key: \
--data-urlencode 'limit=10'
const client = require('payrex-node')('insert your PayRex Secret API key.');
const paymentMethods = await client.customers.listPaymentMethods('<insert customer id>');
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
// Return 10 records and search for customers with email juan@gmail.com
$paymentMethods = $client->customers->listPaymentMethods('<insert customer id>');
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
payment_methods = client.customers.list_payment_methods('<insert customer id>')
client = Payrex::Client.new("insert your PayRex Secret API key.")
payment_methods = client.customers.list_payment_methods('<insert customer id'>)
Parameters
limit optional
Limits the number of resources returned by the endpoint. Minimum amount is 1 and maximum is 100.
before optional
A cursor used in pagination. before is a resource ID that defines your place in the list. For example, if you call a list request and receive 10 resources, starting with pm_1234, your subsequent calls can include before=pm_1234 in order to fetch the previous page of the list.
after optional
A cursor used in pagination. after is a resource ID that defines your place in the list. For example, if you call a list request and receive 10 resources, ending with pm_1234, your subsequent calls can include after=pm_1234 in order to fetch the next page of the list.
Returns
Returns a paginated list of Payment Method resources.