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

Update Customer

Prev Next
Patch
/customers

Make a PATCH request to this endpoint to update the details on a customer. Only fields present in the request will be updated. Any changes to fields on the customer object will replace that item in its entirety. If you wish to append to an array, your PATCH request should contain the desired end state array (i.e., both the current content and the new array element to append to it). Pass a NULL value to remove the existing content.

Note that the reference_id and type on a customer cannot be updated.

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

Body parameters
Expand All
object

Patch body request

individual_detail
object (Accounts_Operation_API_XenditStandardIndividualDetail)
given_names
string Required

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

Min length1
Max length50
surname
string

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

Min length1
Max length50
nationality
string

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

Min length2
Max length2
place_of_birth
string

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

Min length1
Max length60
date_of_birth
string

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

Min length10
Max length10
gender

Gender of customer

Valid values[ "MALE", "FEMALE", "OTHER" ]
employment
object
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 (Accounts_Operation_API_XenditStandardBusinessDetail)
business_name
string Required

Name of business

Min length1
Max length50
trading_name
string

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" ]
nature_of_business
string

Free text description of the type of business this entity pursues

Min length1
Max length50
ExampleEcommerce, Travel
business_domicile
string

Registered country of the business. ISO 3166 format

date_of_registration
string (date)

Business registration date

mobile_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
phone_number
string | null

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

Min length1
Max length50
email
string (email) | null

E-mail address of customer

Min length1
Max length50
addresses
object (Accounts_Operation_API_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 (Accounts_Operation_API_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[ "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)

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"
    }
  },
  "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
    }
  ],
  "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": [],
  "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
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