Skip to main content
Version: Lastest

API Update customer

API Update customer

Chat with AI▼

Endpoint: /api/v1/customers/{customerId}

Method: PATCH

Header Params​

ParamRequiredTypeDescriptionNote
X-APPOTAPAY-AUTHrequiredString How to generate JWT_TOKEN
Content-TyperequiredStringValue: application/json
X-Request-IDoptionalStringUUIDv4 format. Request ID to check when a problem occursmax:42
LanguageoptionalStringThe value vi or en corresponding to the payment link will be Vietnamese or English, (default: vi)

in:vi,en

X-Account-Ref-IDoptionalString

Iidentifier of the sub account provided by AppotaPay.

Mandatory be passed over when processing payment for transactions of owner-type sub account

{
"X-APPOTAPAY-AUTH": "JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}

Request params​

ParamRequiredTypeDescriptionNote
customerRequiredObjectCustomer information
customer.firstNameRequiredStringFirst namemin:1, max: 50, only unaccented letters (a-z, A-Z), digits (0-9) and spaces are allowed; special characters, accented letters and non-Latin characters (e.g. Japanese, Chinese) are not allowed
customer.lastNameOptionalStringLast namemin:1, max: 50, only unaccented letters (a-z, A-Z), digits (0-9) and spaces are allowed; special characters, accented letters and non-Latin characters (e.g. Japanese, Chinese) are not allowed
customer.mobileNumberOptionalString

Phone number

Format: +[Country code][Phone number]

Example: +84919333777

min:1, max: 16, format: E.164
customer.emailOptionalStringEmailmin:1, max: 50
customer.genderOptionalString

Gender

- MALE: male

- FEMALE: female

- OTHER: other

in: MALE, FEMALE, OTHER
customer.dateOfBirthOptionalStringDate of birthformat YYYY-MM-DD string
customer.placeOfBirthOptionalStringPlace of birthmax: 50
customer.nationalityOptionalStringNationality codeformat ISO 3166-2 Country Code

Example Request​

{
"customer": {
"firstName": "Ha",
"lastName": "Phan",
"mobileNumber": "+84123456789",
"email": "ha@gmail.com",
"gender": "MALE",
"dateOfBirth": "1996-04-23",
"placeOfBirth": "HN",
"nationality": "EC"
}
}

Response data​

Success​

Http Status Code 200 - OK

Success responses will contain a single Customer object

Failure​

HTTP Status Code != 200

Error response params​

ParamRequiredTypeDescription
errorCoderequiredIntegerError code
messagerequiredStringError message
errorsoptionalArrayDetailed error description
errors.*.fieldoptionalStringField data is corrupted
errors.*.reasonoptionalStringDescription of the data field in error
{
"errorCode": 1,
"message": "Missing or Invalid Params",
"errors": [
{
"field": "customer.firstName",
"reason": "The customer.first name must be a string."
}
]
}

Common error code table​

Full error code, please check this error code list

Error codeDescription
0Success
1Missing or Invalid Params
11Partner is not found
13Partner has been blocked
14API Key is invalid
15API Key is not activated or blocked
92IP is not allowed to access
99Undefined error, please contact AppotaPay for more detailed information
401Unauthorized
500Server error
3003Customer not exist

Code Examples​

curl --location 'https://gateway.dev.appotapay.com/api/v1/customers/ASKJLKALK213' \
--header 'X-APPOTAPAY-AUTH: JWT_TOKEN' \
--header 'Content-Type: application/json' \
--header 'X-Request-ID: Your_Unique_id' \
--header 'Language: vi' \
--header 'X-Account-Ref-ID: 9723f73b-9295-4acb-884b-ab6310c2e653' \
-d '{
"customer": {
"firstName": "Ha",
"lastName": "Phan",
"mobileNumber": "+84123456789",
"email": "ha@gmail.com",
"gender": "MALE",
"dateOfBirth": "1996-04-23",
"placeOfBirth": "HN",
"nationality": "EC"
}
}'

Request​

REQUEST

Development server
The value corresponding to the payment link can be in Vietnamese or English (default: vi)
Example (from schema)