For archived content, access the previous documentation here or the previous API reference here.

Create customer request

Prev Next
Post
/customers

Make a POST request to this endpoint to create a customer for later use with a payments endpoint.

The Customer Object is a standard data structure to hold information relating to one of your customers. It has the following major components:

  • A Type of customer (Individual or Business)
  • Basic descriptive details of that customer
  • Addresses of the customer
  • Identity accounts and KYC documents to prove the legitimacy of the customer
  • Other metadata
Security
HTTP
Type Basic
Header parameters
idempotency-key
string

A unique key to prevent processing duplicate requests. Can be your reference_id or any GUID. Must be unique across development & production environments. Idempotency keys are stored on the request layer; it expires after 24 hours from the first request

Min length1
Max length100
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

Body parameters
Expand All
object

Patch body request

individual_detail
object (XenditStandardIndividualDetail)
given_names
string Required

Primary or first name/s of customer. Alphanumeric. No special characters is allowed.

Min length1
Max length50
surname
string | null

Last or family name of customer. Alphanumeric. No special characters is allowed.

Min length1
Max length50
nationality
string | null

Country code for customer nationality. ISO 3166-1 alpha-2 Country Code

Min length2
Max length2
place_of_birth
string | null

City or other relevant location for the customer birth place. Alphanumeric. No special characters is allowed.

Min length1
Max length60
date_of_birth
string | null

Date of birth of the customer. Format: YYYY-MM-DD

Min length10
Max length10
gender
string | null

Gender of customer

Valid values[ "MALE", "FEMALE", "OTHER" ]
employment
object | null
employer_name
string

Name of the employer

Min length1
Max length50
nature_of_business
string

Industry or nature of business

Min length1
Max length50
role_description
string

Occupation or title

Min length1
Max length50
business_detail
object (XenditStandardBusinessDetail)
business_name
string Required

Name of business

Min length1
Max length50
trading_name
string | null

Trading name

Min length1
Max length50
business_type
string

Legal entity type of the business

Valid values[ "SOLE_PROPRIETOR", "PARTNERSHIP", "COOPERATIVE", "TRUST", "NON_PROFIT", "GOVERNMENT", "CORPORATION" ]
nature_of_business
string | null

Free text description of the type of business this entity pursues

Min length1
Max length50
ExampleEcommerce, Travel
business_domicile
string | null

Registered country of the business. ISO 3166 format

date_of_registration
string (date) | null

Business registration date

mobile_number
string | null

Supports both E.164 international format (+) and local formats with or without a leading zero.

Min length7
Max length15
phone_number
string | null

Supports both E.164 international format (+) and local formats with or without a leading zero.

Min length7
Max length15
email
string (email) | null

E-mail address of customer

Min length1
Max length50
addresses
object (XenditStandardAddress)
country
string Required

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 (XenditKYCDocumentsObject)
object
country
string Required

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[ "NATIONAL_ID", "CONSULAR_ID", "VOTER_ID", "POSTAL_ID", "RESIDENCE_PERMIT", "TAX_ID", "STUDENT_ID", "MILITARY_ID", "MEDICAL_ID", "OTHERS" ]
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_images
Array of 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

string
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)

Business registration date

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.

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"
    }
  },
  "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
    }
  ],
  "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",
  "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": [],
  "kyc_documents": [],
  "description": null,
  "date_of_registration": "2020-03-30",
  "domicile_of_registration": "ID",
  "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
type
string

Type of customer

Valid values[ "INDIVIDUAL", "BUSINESS" ]
individual_detail
object
given_names
string

Primary or first name/s of customer. Alphanumeric. No special characters is allowed.

Min length1
Max length50
surname
string | null

Last or family name of customer. Alphanumeric. No special characters is allowed.

Min length1
Max length50
nationality
string | null

Country code for customer nationality. ISO 3166-1 alpha-2 Country Code

Min length2
Max length2
place_of_birth
string | null

City or other relevant location for the customer birth place. Alphanumeric. No special characters is allowed.

Min length1
Max length60
date_of_birth
string | null

Date of birth of the customer. Format: YYYY-MM-DD

Min length10
Max length10
gender
string | null

Gender of customer

Valid values[ "MALE", "FEMALE", "OTHER" ]
employment
object | null
employer_name
string

Name of the employer

Min length1
Max length50
nature_of_business
string

Industry or nature of business

Min length1
Max length50
role_description
string

Occupation or title

Min length1
Max length50
business_detail
object
business_name
string

Name of business

Min length1
Max length50
trading_name
string | null

Trading name

Min length1
Max length50
business_type
string

Legal entity type of the business

Valid values[ "SOLE_PROPRIETOR", "PARTNERSHIP", "COOPERATIVE", "TRUST", "NON_PROFIT", "GOVERNMENT", "CORPORATION" ]
nature_of_business
string | null

Free text description of the type of business this entity pursues

Min length1
Max length50
ExampleEcommerce, Travel
business_domicile
string | null

Registered country of the business. ISO 3166 format

date_of_registration
string (date) | null

Business registration date

mobile_number
string | null

Supports both E.164 international format (+) and local formats with or without a leading zero.

Min length7
Max length15
phone_number
string | null

Supports both E.164 international format (+) and local formats with or without a leading zero.

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 (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
identity_accounts
Array of object (IdentityAccount)
object
type
string

Type of identity account

Valid values[ "CREDIT_CARD", "DEBIT_CARD", "BANK_ACCOUNT" ]
company
string

Financial institution or company name

description
string

Description of the account

country
string

ISO 3166-1 alpha-2 Country Code

Min length2
Max length2
properties
object

Additional properties specific to the account type

kyc_documents
Array of object (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[ "NATIONAL_ID", "CONSULAR_ID", "VOTER_ID", "POSTAL_ID", "RESIDENCE_PERMIT", "TAX_ID", "STUDENT_ID", "MILITARY_ID", "MEDICAL_ID", "OTHERS" ]
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_images
Array of 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

string
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.

created
string (date-time)

Customer creation timestamp

updated
string (date-time)

Customer last update timestamp

409

Conflict

object
error_code
string
Valid values[ "DUPLICATE_ERROR", "IDEMPOTENCY_ERROR" ]
message
string
errors
Array
OneOf
string
string
object
object