API Test Keys

Activate or Deactivate a Contact

PATCH
/v1/contacts/:id

Click to copy

Use this endpoint to activate or deactivate a contact. This helps you block payouts to certain contacts, as and when required.

Is this page helpful?

Curl

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
2
-X PATCH https://api.razorpay.com/v1/contacts/cont_00000000000001 \
3
-H "Content-Type: application/json" \
4
-d '{
5
"active": false
6
}'

Success

Failure

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": false,
11
"notes": {
12
"notes_key_1": "Tea, Earl Grey, Hot",
13
"notes_key_2": "Tea, Earl Grey… decaf."
14
},
15
"created_at": 1545320320
16
}
Path Parameters
id

*

string

The unique identifier linked to the contact. For example, cont_00000000000001.

Request Parameters
active

*

boolean

Represents the state to which you want to move the contact. A contact can have the following two states:

  • true (default) : active
  • false : inactive

Pass false to deactivate an active contact and pass true to activate a deactivated contact.

Response Parameters
id
string

The unique identifier linked to the contact. For example, cont_00000000000001.

entity
string

The entity being created. Here, it is contact.

name
string

The contact's name. For example, Gaurav Kumar.

contact
string

The contact's phone number. For example, 9000090000.

email
string

The contact's email address. For example, gaurav.kumar@example.com.

type
string

A classification for the contact being created. For example, employee.

reference_id
string

A user-entered reference for the contact. For example, Acme Contact ID 12345.

batch_id
string

This value is returned if the contact was created as part of a bulk upload. For example, batch_00000000000001.

active
boolean

Possible values:

  • true (default) : active
  • false : inactive

notes
object

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_at
integer

Timestamp, in Unix, when the contact was created. For example, 1545320320.

Errors

<sample id> is not a valid id.

Error Status: 4xx

The contact id entered in the request body is invalid/does not exist.

Solution

Activate or Deactivate a Contact

PATCH
/v1/contacts/:id

Click to copy

Use this endpoint to activate or deactivate a contact. This helps you block payouts to certain contacts, as and when required.

Is this page helpful?

Path Parameters
id

*

string

The unique identifier linked to the contact. For example, cont_00000000000001.

Request Parameters
active

*

boolean

Represents the state to which you want to move the contact. A contact can have the following two states:

  • true (default) : active
  • false : inactive

Pass false to deactivate an active contact and pass true to activate a deactivated contact.

Response Parameters
id
string

The unique identifier linked to the contact. For example, cont_00000000000001.

entity
string

The entity being created. Here, it is contact.

name
string

The contact's name. For example, Gaurav Kumar.

contact
string

The contact's phone number. For example, 9000090000.

email
string

The contact's email address. For example, gaurav.kumar@example.com.

type
string

A classification for the contact being created. For example, employee.

reference_id
string

A user-entered reference for the contact. For example, Acme Contact ID 12345.

batch_id
string

This value is returned if the contact was created as part of a bulk upload. For example, batch_00000000000001.

active
boolean

Possible values:

  • true (default) : active
  • false : inactive

notes
object

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_at
integer

Timestamp, in Unix, when the contact was created. For example, 1545320320.

Errors

<sample id> is not a valid id.

Error Status: 4xx

The contact id entered in the request body is invalid/does not exist.

Solution

Curl

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
2
-X PATCH https://api.razorpay.com/v1/contacts/cont_00000000000001 \
3
-H "Content-Type: application/json" \
4
-d '{
5
"active": false
6
}'

Success

Failure

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": false,
11
"notes": {
12
"notes_key_1": "Tea, Earl Grey, Hot",
13
"notes_key_2": "Tea, Earl Grey… decaf."
14
},
15
"created_at": 1545320320
16
}