API Test Keys
Create a Contact
POST/v1/contactsClick to copy
Use this endpoint to create a new contact.
- A new contact is created if any combination of the following details is unique:
name,email,contact,typeandreference_id. - If all the above details match the details of an existing contact, the API returns details of the existing contact.
Is this page helpful?
1curl -u <YOUR_KEY>:<YOUR_SECRET> \2-X POST https://api.razorpay.com/v1/contacts \3-H "Content-Type: application/json" \4-d '{5"name":"Gaurav Kumar",6"email":"gaurav.kumar@example.com",7"contact":"9000090000",8"type":"employee",9"reference_id":"Acme Contact ID 12345",10"notes":{11"notes_key_1":"Tea, Earl Grey, Hot",12"notes_key_2":"Tea, Earl Grey… decaf."13}14}'
Success
1{2"id": "cont_00000000000001",3"entity": "contact",4"name": "Gaurav Kumar",5"contact": "9000090000",6"email": "gaurav.kumar@example.com",7"type": "employee",8"reference_id": "Acme Contact ID 12345",9"batch_id": null,10"active": true,11"notes": {12"notes_key_1": "Tea, Earl Grey, Hot",13"notes_key_2": "Tea, Earl Grey… decaf."14},15"created_at": 154532032016}
Request Parameters
name*
string The contact's name. This field is case-sensitive. A minimum of 3 characters and a maximum of 50 characters are allowed. Name cannot end with a special character, except .. Supported characters: a-z, A-Z, 0-9, space, ’ , - , _ , / , ( , ) and , .. For example, Gaurav Kumar.
emailstring The contact's email address. For example, gaurav.kumar@example.com.
contactstring The contact's phone number. For example, 9000090000.
typestring Maximum 40 characters. Classification for the contact being created. For example, employee. The following classifications are available by default:
vendorcustomeremployeeself
Additional classifications can be created via the
and then used in APIs. It is not possible to create new classifications via API.reference_idstring Maximum 40 characters. A user-entered reference for the contact. For example, Acme Contact ID 12345.
notesobject Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
Response Parameters
idstring The unique identifier linked to the contact. For example, cont_00000000000001.
entitystring The entity being created. Here, it is contact.
namestring The contact's name. For example, Gaurav Kumar.
contactstring The contact's phone number. For example, 9000090000.
emailstring The contact's email address. For example, gaurav.kumar@example.com.
typestring A classification for the contact being created. For example, employee.
reference_idstring A user-entered reference for the contact. For example, Acme Contact ID 12345.
batch_idstring This value is returned if the contact was created as part of a bulk upload. For example, batch_00000000000001.
activebooleanPossible values:
true(default) : activefalse: inactive
notesobject Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
created_atinteger Timestamp, in Unix, when the contact was created. For example, 1545320320.
Create a Contact
POST/v1/contactsClick to copy
Use this endpoint to create a new contact.
- A new contact is created if any combination of the following details is unique:
name,email,contact,typeandreference_id. - If all the above details match the details of an existing contact, the API returns details of the existing contact.
Is this page helpful?
Request Parameters
name*
string The contact's name. This field is case-sensitive. A minimum of 3 characters and a maximum of 50 characters are allowed. Name cannot end with a special character, except .. Supported characters: a-z, A-Z, 0-9, space, ’ , - , _ , / , ( , ) and , .. For example, Gaurav Kumar.
emailstring The contact's email address. For example, gaurav.kumar@example.com.
contactstring The contact's phone number. For example, 9000090000.
typestring Maximum 40 characters. Classification for the contact being created. For example, employee. The following classifications are available by default:
vendorcustomeremployeeself
Additional classifications can be created via the
and then used in APIs. It is not possible to create new classifications via API.reference_idstring Maximum 40 characters. A user-entered reference for the contact. For example, Acme Contact ID 12345.
notesobject Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
Response Parameters
idstring The unique identifier linked to the contact. For example, cont_00000000000001.
entitystring The entity being created. Here, it is contact.
namestring The contact's name. For example, Gaurav Kumar.
contactstring The contact's phone number. For example, 9000090000.
emailstring The contact's email address. For example, gaurav.kumar@example.com.
typestring A classification for the contact being created. For example, employee.
reference_idstring A user-entered reference for the contact. For example, Acme Contact ID 12345.
batch_idstring This value is returned if the contact was created as part of a bulk upload. For example, batch_00000000000001.
activebooleanPossible values:
true(default) : activefalse: inactive
notesobject Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
created_atinteger Timestamp, in Unix, when the contact was created. For example, 1545320320.
1curl -u <YOUR_KEY>:<YOUR_SECRET> \2-X POST https://api.razorpay.com/v1/contacts \3-H "Content-Type: application/json" \4-d '{5"name":"Gaurav Kumar",6"email":"gaurav.kumar@example.com",7"contact":"9000090000",8"type":"employee",9"reference_id":"Acme Contact ID 12345",10"notes":{11"notes_key_1":"Tea, Earl Grey, Hot",12"notes_key_2":"Tea, Earl Grey… decaf."13}14}'
Success
1{2"id": "cont_00000000000001",3"entity": "contact",4"name": "Gaurav Kumar",5"contact": "9000090000",6"email": "gaurav.kumar@example.com",7"type": "employee",8"reference_id": "Acme Contact ID 12345",9"batch_id": null,10"active": true,11"notes": {12"notes_key_1": "Tea, Earl Grey, Hot",13"notes_key_2": "Tea, Earl Grey… decaf."14},15"created_at": 154532032016}