Edit Customer Details
PUT/v1/customers/:idClick to copy
Use this endpoint to edit the customer details such as name, email and contact details. When editing a customer's details, ensure that the combination of the values in the email and contact attributes is unique for every customer.
Is this page helpful?
Curl
change language
change language
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X PUT https://api.razorpay.com/v1/customers/cust_1Aa00000000003 \3-H "Content-Type: application/json" \4-d '{5"name": " Nur Aisyah",6"email": "nur.aisyah@example.com",7"contact": "+60123456789"8}'
Success
Failure
1{2"id": "cust_1Aa00000000003",3"entity": "customer",4"name": " Nur Aisyah",5"email": "nur.aisyah@example.com",6"contact": "+60123456789",7"gstin": null,8"notes": [],9"created_at": 167858016510}
Path Parameters
id *
stringThe unique identifier linked to the customer.
Request Parameters
name string Customer's name. Alphanumeric, with period (.), apostrophe ('), forward slash (/), at (@) and parentheses allowed. The name must be between 3-50 characters in length. For example, Nur Aisyah.
contact string The customer's phone number. A maximum length of 15 characters. For example, +60748901142.
email string The customer's email address. A maximum length of 64 characters. For example, nur.aisyah@example.com.
Response Parameters
idstring Unique identifier of the customer. For example, cust_1Aa00000000004.
entity stringIndicates the type of entity.
namestringCustomer's name. Alphanumeric, with period (.), apostrophe (') and parentheses allowed. The name must be between 3-50 characters in length.
contactstringThe customer's phone number. A maximum length of 15 characters including country code.
emailstringThe customer's email address. A maximum length of 64 characters.
notesobject This is a key-value pair that can be used to store additional information about the entity. It can hold a maximum of 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
created_atinteger UNIX timestamp, when the customer was created. For example, 1234567890.
shipping_addressobject The customer's shipping address. An address object with line1, line2, city, state, country, and zipcode fields. Empty when none is set.
Errors
The API <key/secret> provided is invalid.
Error Status: 4xx
The API credentials passed in the API call differ from the ones generated on the Dashboard. Possible reasons:
- Different keys for test mode and live modes.
- Expired API key.
Solution
Contact number should be at least 8 digits, including country code.
Error Status: 400
The contact number is less than 8 digits.
Solution
id is not a valid id.
Error Status: 400
The customer_id passed is invalid.
Solution
The id provided does not exist.
Error Status: 400
The customer_id passed in the URL is well-formed but does not exist or does not belong to the requesting merchant.
Solution
Customer already exists for the merchant.
Error Status: 400
The contact or email passed in the edit request matches an existing customer of this merchant other than the one being edited.
Solution
The email must be a valid email address.
Error Status: 400
The value passed for email is not in a valid email format.
Solution
Contact number contains invalid characters, only digits and + symbol are allowed.
Error Status: 400
The contact value contains characters other than digits and the + symbol (for example, letters, hyphens or spaces).
Solution
The name may not be greater than 50 characters.
Error Status: 400
The name value exceeds the 50-character limit.
Solution
The name format is invalid.
Error Status: 400
The name value contains characters outside the allowed set. Allowed characters are letters, numbers and a limited set of punctuation (', -, ., _, (, ), @, / and spaces). The name must start and end with a letter, number, . or ).
Solution
Notes value cannot be greater than 512 characters.
Error Status: 400
One of the values inside the notes object exceeds the 512-character limit per value.
Solution
Edit Customer Details
PUT/v1/customers/:idClick to copy
Use this endpoint to edit the customer details such as name, email and contact details. When editing a customer's details, ensure that the combination of the values in the email and contact attributes is unique for every customer.
Is this page helpful?
Path Parameters
id *
stringThe unique identifier linked to the customer.
Request Parameters
name string Customer's name. Alphanumeric, with period (.), apostrophe ('), forward slash (/), at (@) and parentheses allowed. The name must be between 3-50 characters in length. For example, Nur Aisyah.
contact string The customer's phone number. A maximum length of 15 characters. For example, +60748901142.
email string The customer's email address. A maximum length of 64 characters. For example, nur.aisyah@example.com.
Response Parameters
idstring Unique identifier of the customer. For example, cust_1Aa00000000004.
entity stringIndicates the type of entity.
namestringCustomer's name. Alphanumeric, with period (.), apostrophe (') and parentheses allowed. The name must be between 3-50 characters in length.
contactstringThe customer's phone number. A maximum length of 15 characters including country code.
emailstringThe customer's email address. A maximum length of 64 characters.
notesobject This is a key-value pair that can be used to store additional information about the entity. It can hold a maximum of 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
created_atinteger UNIX timestamp, when the customer was created. For example, 1234567890.
shipping_addressobject The customer's shipping address. An address object with line1, line2, city, state, country, and zipcode fields. Empty when none is set.
Errors
The API <key/secret> provided is invalid.
Error Status: 4xx
The API credentials passed in the API call differ from the ones generated on the Dashboard. Possible reasons:
- Different keys for test mode and live modes.
- Expired API key.
Solution
Contact number should be at least 8 digits, including country code.
Error Status: 400
The contact number is less than 8 digits.
Solution
id is not a valid id.
Error Status: 400
The customer_id passed is invalid.
Solution
The id provided does not exist.
Error Status: 400
The customer_id passed in the URL is well-formed but does not exist or does not belong to the requesting merchant.
Solution
Customer already exists for the merchant.
Error Status: 400
The contact or email passed in the edit request matches an existing customer of this merchant other than the one being edited.
Solution
The email must be a valid email address.
Error Status: 400
The value passed for email is not in a valid email format.
Solution
Contact number contains invalid characters, only digits and + symbol are allowed.
Error Status: 400
The contact value contains characters other than digits and the + symbol (for example, letters, hyphens or spaces).
Solution
The name may not be greater than 50 characters.
Error Status: 400
The name value exceeds the 50-character limit.
Solution
The name format is invalid.
Error Status: 400
The name value contains characters outside the allowed set. Allowed characters are letters, numbers and a limited set of punctuation (', -, ., _, (, ), @, / and spaces). The name must start and end with a letter, number, . or ).
Solution
Notes value cannot be greater than 512 characters.
Error Status: 400
One of the values inside the notes object exceeds the 512-character limit per value.
Solution
Curl
change language
change language
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X PUT https://api.razorpay.com/v1/customers/cust_1Aa00000000003 \3-H "Content-Type: application/json" \4-d '{5"name": " Nur Aisyah",6"email": "nur.aisyah@example.com",7"contact": "+60123456789"8}'
Success
Failure
1{2"id": "cust_1Aa00000000003",3"entity": "customer",4"name": " Nur Aisyah",5"email": "nur.aisyah@example.com",6"contact": "+60123456789",7"gstin": null,8"notes": [],9"created_at": 167858016510}