Skip to main content

Create Customer

Introduction

Create a customer

The customer object represents a customer of your business. It lets you create recurring payments and track payments that belong to the same customer.

Interface

POST /v1/customers

Request Params

FieldNameTypeRangeExampleDefaultOptionalRemarkRule
referenceReferencestring[1, 64]2022123optionalRefer to merchant side's customer ID, see Unique Reference Mode
first_nameFirst Namestring[1,64]DavidoptionalFirst name(and middle name if exists) of customer
last_nameLast Namestring[1,64]SmithoptionalLast name of customer
companyCompanystring[1,64]company nameoptionalCustomer's company
descriptionDescriptionstringcompany descriptionoptionalyyyy-mm-dd
birth_dateBirth DatestringoptionalCustomer's birth date
emailEmailstringoptionalEmail of customerE.164
phonePhonestringoptionalPhone of customer
countryCountrystringoptionalCustomer's countryISO 3166 alpha-2
addressResidential Addresshash-optionalCustomer's residential address, see more on Address
billing_addressBilling Addresshash-optionalCustomer's billing address, see more on Address
documentDocumenthash-optional
address
FieldNameTypeRangeExampleDefaultOptionalRemarkRule
countryCountrystring[1, 64]USrequiredCountry for address, in ISO 3166 alpha-2 format
stateStatestring[1, 64]Washington DCrequiredAlso called as province in some country
cityCity namestring[1, 64]Washingtonrequired
line1Line 1string[1, 64]requireddetail address 1
line2Line 2string[1, 64]optionaldetail address 2
postal_codePostal codestring[1, 64]optionalAlso called as zip code in some country
billing_address

same as address

document
FieldNameTypeRangeExampleDefaultOptionalRemarkRule
countryCountrystring[1, 64]USrequiredCountry for address, in ISO 3166 alpha-2 format
typeTypestringenumrequirednational_id, passport, driving_license, business_license, tax_id
numberNumberstringenumrequiredDocument number

Response Params

Response Example

200 success:

{
"id": "cst_un9WL8ervLWDqTGW",
"object": "customer",
"account": "acct_yz50aD",
"time_created": "2022-07-15T14:00:46+08:00",
"livemode": true,
"reference": "2022000000000",
"first_name": "David",
"last_name": "Smith",
"company": "comany name",
"country": null,
"description": "company description",
"birth_date": "2020-01-01",
"email": "test@company.com",
"phone": "+8613000000000",
"address": {
"country": "US",
"state": "Washington DC",
"city": "Washington",
"line1": "detail address 1",
"line2": "detail address 2",
"postal_code": "200000",
"time_created": "2022-07-15T14:00:46+08:00"
},
"deleted": false
}

400 error:

{
"error": {
"type": "invalid_request_error",
"message": "reference duplicated: 2022050500002",
"code": "request_param_error"
}
}

For some payment methods, specific fields are mandatory, if your customer's payment is possible to be initiated with these payment methods, be sure to pass these fields beforehand.

Payment MethodRequired Field
ovo_idcustomer.phone
boleto_brcustomer.document, customer.billing_address