Customers - Retrieve

Retrieve a customer by ID.

HTTP request

GET /customers/{customer_id}

Example (cURL)

curl --request GET \
  --url https://sandbox.hyperswitch.io/customers/{customer_id} \
  --header 'api-key: <api-key>'

Example response (200)

{
  "customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
  "created_at": "2023-01-18T11:04:09.922Z",
  "name": "Jon Test",
  "email": "[email protected]",
  "phone": "9123456789",
  "phone_country_code": "+65",
  "description": "First Customer",
  "address": {
    "city": "New York",
    "country": "AF",
    "line1": "123, King Street",
    "line2": "Powelson Avenue",
    "line3": "Bridgewater",
    "zip": "08807",
    "state": "New York",
    "first_name": "John",
    "last_name": "Doe",
    "origin_zip": "08807"
  },
  "metadata": {},
  "default_payment_method_id": "pm_djh2837dwduh890123",
  "tax_registration_id": "123456789"
}

Authorization

Header: api-key (string, required)

Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

Path parameters

  • customer_id (string, required) The unique identifier for the Customer.

Response (200 — application/json)

Customer Retrieved — response fields:

  • customer_id (string, required) The identifier for the customer object. Required string length: 1 - 64 Example: "cus_y3oqhf46pyzuxjbcn2giaqnb44"

  • created_at (string, date-time, required) A timestamp (ISO 8601) that indicates when the customer was created. Example: "2023-01-18T11:04:09.922Z"

  • name (string | null) The customer's name. Maximum length: 255 Example: "Jon Test"

  • email (string | null) The customer's email address. Maximum length: 255 Example: "[email protected]"

  • phone (string | null) The customer's phone number. Maximum length: 255 Example: "9123456789"

  • phone_country_code (string | null) The country code for the customer's phone number. Maximum length: 255 Example: "+65"

  • description (string | null) An arbitrary string that you can attach to a customer object. Maximum length: 255 Example: "First Customer"

  • address (object) Address details. Child attributes include:

    • first_name (string)

    • last_name (string)

    • line1 (string)

    • line2 (string)

    • line3 (string)

    • city (string)

    • state (string)

    • zip (string)

    • origin_zip (string)

    • country (string)

  • metadata (object) Up to 50 keys. Key names up to 40 characters; values up to 500 characters. Useful for storing additional structured information on an object.

  • default_payment_method_id (string | null) The identifier for the default payment method. Maximum length: 64 Example: "pm_djh2837dwduh890123"

  • tax_registration_id (string | null) The customer's tax registration number. Maximum length: 255 Example: "123456789"

  • Edit this page: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/customers/customers--retrieve.mdx

  • Raise an issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/customers/customers--retrieve

Related:

  • Customers — Create: /v1/customers/customers--create

  • Customers — Update: /v1/customers/customers--update