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.

      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_4e25112ac20e144ad073a614dc46934b/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": "66a08dc0-6e95-42f7-8d96-cab18c152943"
        },
        "data": [
            {
                "id": "other_330f2c3586e670b72aab45f5c12195c0",
                "type": "in_jiomoney_ewallet",
                "category": "ewallet_redirect",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/in_jiomoney_ewallet.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable"
            },
            {
                "id": "other_9a1fa177940e16c09f161cfa55ec108a",
                "type": "sg_grabpay_ewallet",
                "category": "ewallet",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/sg_grabpay_ewallet.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "bic_swift": "",
                "account_last4": ""
            },
            {
                "id": "other_0bfa8ede2535263dab8da20a384d5c2f",
                "type": "pe_banco_ripley_cash",
                "category": "cash",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/pe_banco_ripley_cash.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable"
            },
            {
                "id": "other_9162cf0e8ba033a39833b89b289b2581",
                "type": "kr_localcards_redirect_card",
                "category": "card_redirect",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/kr_localcards_redirect_card.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable"
            },
            {
                "id": "other_618d6e098d0ea74fd73ad9e91930df6d",
                "type": "at_sofort_bank",
                "category": "bank_redirect",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/at_sofort_bank.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "bic_swift": "",
                "account_last4": ""
            },
            {
                "id": "card_b9548d9b53a565b2315fecdc6c87f158",
                "type": "gb_visa_card",
                "category": "card",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/gb_visa_card.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "name": "John Doe",
                "last4": "1111",
                "acs_check": "unchecked",
                "cvv_check": "unchecked",
                "bin_details": {
                    "type": "DEBIT",
                    "brand": "VISA",
                    "level": "CLASSIC",
                    "issuer": "CONOTOXIA SP. Z O.O",
                    "country": "PL",
                    "bin_number": "411111"
                },
                "expiration_year": "35",
                "expiration_month": "12",
                "fingerprint_token": "ocfp_e599f990674473ce6283b245e9ad2467",
                "network_reference_id": "507150",
                "payment_account_reference": "V0015Y3DOIFQF1G6MJ2QGQ89VYTK1"
            },
            {
                "id": "other_e4cd3a4bdcc26ab661420b306d2224ab",
                "type": "mx_spei_bank",
                "category": "bank_transfer",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/mx_spei_bank.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "bic_swift": "",
                "account_last4": ""
            },
            {
                "id": "other_307e27cfa36b5e2cb5c2c1f395e4c012",
                "type": "at_sofort_bank",
                "category": "bank_redirect",
                "metadata": {},
                "image": "https://iconslib.rapyd.net/checkout/at_sofort_bank.png",
                "webhook_url": "",
                "supporting_documentation": "",
                "next_action": "not_applicable",
                "bic_swift": "",
                "account_last4": ""
            }
        ]
    }