Skip to main content

Documentation

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. Default is 10.

      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": "d87958fc-28f1-49ce-9101-f58b23171a10"
        },
        "data": [
            {
                "id": "other_e1c5d34df2125607ca08978929c3dd8f",
                "type": "fi_sepadirectdebit_bank",
                "category": "bank_redirect",
                "metadata": {
                "merchant_defined": true
                },
                "image": "https://iconslib.rapyd.net/checkout/fi_sepadirectdebit_bank.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "bic_swift": "ABCDEFG1234",
                "account_last4": "6283",
                "language": "es"
            },
            {
                "id": "other_45bbac3323dae3f8632f846e0a586f4f",
                "type": "fi_sepadirectdebit_bank",
                "category": "bank_redirect",
                "metadata": {
                "merchant_defined": true
                },
                "image": "https://iconslib.rapyd.net/checkout/fi_sepadirectdebit_bank.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "bic_swift": "HIJKLMN5678",
                "account_last4": "4321",
                "language": "es"
            }
        ]
    }