Skip to main content

Documentation

Retrieve Customer

Retrieve details of a customer profile.

Code Samples
    • .NET

      • using System;
        
        namespace RapydApiRequestSample
        {
            class Program
            {
                static void Main(string[] args)
                {
                    try
                    {
                        string customerId = "cus_d3ed65d5091a8398cc3651bcedec1201";
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/customers/{customerId}");
        
                        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_d3ed65d5091a8398cc3651bcedec1201');
        
            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_d3ed65d5091a8398cc3651bcedec1201");
            var_dump($object);
        } catch (Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        result = make_request(method='get', path='/v1/customers/cus_d3ed65d5091a8398cc3651bcedec1201')
        pprint(result)
        
  • /v1/customers/:customer

  • Retrieve Customer

  • curl -X get
    https://sandboxapi.rapyd.net/v1/customers/cus_d3ed65d5091a8398cc3651bcedec1201
    -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": "75ae0273-1770-4635-9256-ce47e03e4b43"
        },
        "data": {
            "id": "cus_d3ed65d5091a8398cc3651bcedec1201",
            "delinquent": false,
            "discount": null,
            "name": "John Doe",
            "default_payment_method": "card_291ba88b24be649b3672b2a90b0a6a2f",
            "description": "",
            "email": "johndoe1@rapyd.net",
            "phone_number": "+14155559983",
            "invoice_prefix": "JD-",
            "addresses": [],
            "payment_methods": {
                "data": [
                    {
                        "id": "card_c52b734a6febd737b53423de36a5eab2",
                        "type": "us_visa_card",
                        "category": "card",
                        "metadata": null,
                        "image": "https://iconslib.rapyd.net/checkout/us_visa_card.png",
                        "webhook_url": "",
                        "supporting_documentation": "",
                        "next_action": "not_applicable",
                        "address": {
                            "id": "address_5c246d4b107642b558689a7b0c1bcc2b",
                            "name": "John Doe",
                            "line_1": "123 First Ave",
                            "line_2": "",
                            "line_3": "",
                            "city": "New York",
                            "state": "NY",
                            "country": "US",
                            "zip": "111111",
                            "phone_number": "",
                            "metadata": {},
                            "canton": "",
                            "district": "",
                            "created_at": 1638775395
                        },
                        "name": "John Doe",
                        "last4": "0000",
                        "acs_check": "unchecked",
                        "cvv_check": "unchecked",
                        "bin_details": {
                            "type": null,
                            "brand": null,
                            "country": null,
                            "bin_number": "446203"
                        },
                        "expiration_year": "25",
                        "expiration_month": "12",
                        "fingerprint_token": "ocfp_1476e28831f830fb85356e3b61a1ed84"
                    },
                    {
                        "id": "card_291ba88b24be649b3672b2a90b0a6a2f",
                        "type": "us_visa_card",
                        "category": "card",
                        "metadata": {},
                        "image": "https://iconslib.rapyd.net/checkout/us_visa_card.png",
                        "webhook_url": "",
                        "supporting_documentation": "",
                        "next_action": "not_applicable",
                        "name": "John Doe",
                        "last4": "0000",
                        "acs_check": "unchecked",
                        "cvv_check": "unchecked",
                        "bin_details": {
                            "type": null,
                            "brand": null,
                            "country": null,
                            "bin_number": "446203"
                        },
                        "expiration_year": "25",
                        "expiration_month": "12",
                        "fingerprint_token": "ocfp_1476e28831f830fb85356e3b61a1ed84"
                    },
                    {
                        "id": "card_c39d3f6be5f628736ca2477243edf18c",
                        "type": "us_debit_discover_card",
                        "category": "card",
                        "metadata": null,
                        "image": "https://iconslib.rapyd.net/checkout/us_debit_discover_card.png",
                        "webhook_url": "",
                        "supporting_documentation": "",
                        "next_action": "not_applicable",
                        "address": {
                            "id": "address_bb69b70848d56ac99a78ab240a60161b",
                            "name": "Jake Doe",
                            "line_1": "123 Main Street",
                            "line_2": "",
                            "line_3": "",
                            "city": "New York",
                            "state": "NY",
                            "country": "US",
                            "zip": "12345",
                            "phone_number": "",
                            "metadata": {},
                            "canton": "",
                            "district": "",
                            "created_at": 1638177770
                        },
                        "name": "Jake Doe",
                        "last4": "1111",
                        "acs_check": "unchecked",
                        "cvv_check": "unchecked",
                        "bin_details": {
                            "type": null,
                            "brand": null,
                            "country": null,
                            "bin_number": "411111"
                        },
                        "expiration_year": "23",
                        "expiration_month": "11",
                        "fingerprint_token": "ocfp_e599f990674473ce6283b245e9ad2467"
                    }
                ],
                "has_more": true,
                "total_count": 7,
                "url": "/v1/customers/cus_d3ed65d5091a8398cc3651bcedec1201/payment_methods"
            },
            "subscriptions": null,
            "created_at": 1634217004,
            "metadata": {
                "merchant_defined": true
            },
            "business_vat_id": "123456789",
            "ewallet": "ewallet_0430df85c650a9a0a87f677d281b3f59"
        }
    }