Welcome to Xendit’s latest documentation. For legacy content, access the previous documentation here or the previous API reference here.

Get customer by id

Prev Next
Get
/customers/{customer_id}

Retrieves a single customer object

Security
HTTP
Type Basic
Header parameters
api-version
string

API version in date semantic. Attach this parameter when calling a specific API version. List of API versions can be found here.

Valid values[ "2024-10-31", "2024-11-11" ]
for-user-id
string

The sub-account user-id that you want to make this transaction for.

This header is only used if you have access to xenPlatform. See xenPlatform for more information

Path parameters
customer_id
stringRequired

Your identifier for the customer

Max length41
Examplecust-b98d6f63-d240-44ec-9bd5-aa42954c4f48
Responses
200

Successful operation

getIndividualCustomer
{
  "id": "cust-239c16f4-866d-43e8-9341-7badafbc019f",
  "reference_id": "demo_1475801962607",
  "type": "INDIVIDUAL",
  "individual_detail": {
    "given_names": "John",
    "surname": "Doe",
    "nationality": "ID",
    "place_of_birth": "Jakarta",
    "date_of_birth": "1980-01-01",
    "gender": "MALE",
    "employment": {
      "employer_name": "Xendit",
      "nature_of_business": "Payment Gateway",
      "role_description": "Test dummy"
    }
  },
  "business_detail": null,
  "email": "customer@website.com",
  "mobile_number": "+62812123456",
  "phone_number": "+62812123456",
  "hashed_phone_number": "+628#######56",
  "addresses": [
    {
      "street_line1": "Panglima Polim IV",
      "street_line2": "Ruko Grand Panglima Polim, Blok E",
      "city": "Jakarta Selatan",
      "province_state": "DKI Jakarta",
      "postal_code": "993448",
      "country": "ID",
      "category": "HOME",
      "is_primary": true
    }
  ],
  "identity_accounts": [
    {
      "type": "CREDIT_CARD",
      "company": "OCBC",
      "description": "My account",
      "country": "ID",
      "properties": {
        "token_id": "586f0ba2ab70de5d2b409e0d"
      }
    }
  ],
  "kyc_documents": [
    {
      "type": "IDENTITY_CARD",
      "sub_type": "NATIONAL_ID",
      "country": "ID",
      "document_name": "KTP",
      "document_number": "12356789012456",
      "expires_at": null,
      "holder_name": "John Doe",
      "document_images": [
        "file-ec700c1c-db17-4496-b1fb-04ebe551b412"
      ]
    }
  ],
  "description": "My first customer",
  "date_of_registration": "2020-03-30",
  "domicile_of_registration": "ID",
  "metadata": {
    "foo": "bar"
  },
  "created": "2020-03-30T06:12:47.212Z",
  "updated": "2020-03-30T06:12:47.212Z"
}
getBusinessCustomer
{
  "id": "cust-239c16f4-866d-43e8-9341-7badafbc019f",
  "reference_id": "demo_1475801962607",
  "type": "BUSINESS",
  "individual_detail": null,
  "business_detail": {
    "business_name": "ACME Corp",
    "trading_name": null,
    "business_type": "CORPORATION",
    "nature_of_business": null,
    "business_domicile": null,
    "date_of_registration": null
  },
  "email": "customer@website.com",
  "mobile_number": null,
  "phone_number": null,
  "hashed_phone_number": null,
  "addresses": [],
  "identity_accounts": [],
  "kyc_documents": [],
  "description": null,
  "metadata": {},
  "created": "2020-03-30T06:12:47.212Z",
  "updated": "2020-03-30T06:12:47.212Z"
}
Expand All
object

Customer Object

id
string

Xendit unique Capture ID generated as reference for the end user

Max length41
Examplecust-b98d6f63-d240-44ec-9bd5-aa42954c4f48
reference_id
string

A Reference ID from merchants to identify their request.

Min length1
Max length255
mobile_number
string | null

Mobile number of customer in E.164 format +(country code)(subscriber number)

Min length1
Max length50
phone_number
string | null

Additional contact number of customer in E.164 format. May be a landline

FormatE.164 international standard +(country code)(subscriber number)

Min length7
Max length15
hashed_phone_number
string | null

Hashed phone number

Min length1
Max length250
email
string (email) | null

E-mail address of customer

Min length1
Max length50
addresses
Array of object (Accounts_Operation_API_XenditStandardAddress)
object
country
string

ISO 3166-1 alpha-2 Country Code

Min length2
Max length2
street_line1
string

Line 1 of street address e.g., building name and apartment number

Min length1
Max length255
street_line2
string

Line 2 of street address e.g., building name and apartment number

Min length1
Max length255
city
string

City, village or town of residence of customer

Min length1
Max length255
province_state
string

Province, state or region of residence of customer

Min length1
Max length255
postal_code
string

ZIP/Postal Code of customer

Min length1
Max length255
category
string

Address type

Valid values[ "HOME", "WORK", "PROVINCIAL" ]
is_primary
boolean

Defaults to false. Indicates that the information provided refers to the customer’s primary address

Defaultfalse
kyc_documents
Array of object (Accounts_Operation_API_XenditKYCDocumentsObject)
object
country
string

ISO 3166-1 alpha-2 Country Code

Min length2
Max length2
type
string

Generic ID type

Valid values[ "BIRTH_CERTIFICATE", "BANK_STATEMENT", "DRIVING_LICENSE", "IDENTITY_CARD", "PASSPORT", "VISA", "BUSINESS_REGISTRATION", "BUSINESS_LICENSE" ]
sub-type
string

Specific ID type for IDENTITY_CARD types

Valid values[ "BIRTH_CERTIFICATE", "BANK_STATEMENT", "DRIVING_LICENSE", "IDENTITY_CARD", "PASSPORT", "VISA", "BUSINESS_REGISTRATION", "BUSINESS_LICENSE" ]
document_name
string

Free text description of the type of document (e.g., NIB, SIUP, AKTA). Characters alphanumeric. No special characters is allowed.

Max length255
document_number
string

Unique alphanumeric identity document number or code. Characters alphanumeric. No special characters is allowed.

Max length255
expires_at
string | null

Expiry date, if relevant

Example2024-11-11
holder_name
string

Free text to capture the full name(s) of the individual or business as defined on the document, if relevant. Characters alphanumeric. No special characters is allowed.

Max length255
document_image
string

Array of file ids returned from uploads to the files endpoint, representing images of the front/back of the document, in png/jpg/jpeg/pdf format

description
string | null

Merchant-provided description for the customer. Characters alphanumeric. No special characters is allowed.

Min length2
Max length500
date_of_registration
string (date)

Date of which the account that the shopper had to create/sign up on the merchant's website

domicile_of_registration
string

Country within which the account that the shopper had to create/sign up on the merchant’s website resides (e.g. accounts created on Shopee SG have SG as the value for this field. ISO 3166-2 Country Code

Min length2
Max length2
metadata
object

Object of additional information related to the customer. Define the JSON properties and values as required to pass information through the APIs. You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. This is only for your use and will not be used by Xendit.

404

The provided id does not exist. Please review the id and try again

object
error_code
string
Valid values[ "RATE_LIMIT_EXCEEDED" ]
message
string
errors
Array
OneOf
string
string
object
object