API Test Keys
Fetch All Customers
GET/v1/customersClick to copy
Use this endpoint to retrieve the details of all the customers.
Is this page helpful?
Curl
change language
change language
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X GET https://api.razorpay.com/v1/customers?count=2&skip=1
Success
Failure
1{2"entity": "collection",3"count": 2,4"items": [5{6"id": "cust_LQPdeJqQeKQrJM",7"entity": "customer",8"name": "John Smith",9"email": "john.smith@example.com",10"contact": "+11234567890",11"gstin": null,12"notes": [],13"created_at": 167858035214},15{16"id": "cust_LQPd9lomgwDE5F",17"entity": "customer",18"name": "John Smith",19"email": "john.smith@example.com",20"contact": "+11234567890",21"gstin": null,22"notes": [],23"created_at": 167858032424}25]26}
Query Parameters
count integer The number of customer records to be retrieved from the system. The default value is 10. The maximum value is 100. This can be used for pagination in combination with skip.
skip integer The number of customer records that must be skipped. The default value is 0. This can be used for pagination in combination with count.
Response Parameters
entity stringIndicates the type of entity.
idstring Unique identifier of the customer. For example, cust_1Aa00000000004.
namestring 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, John Smith.
contactstring The customer's phone number. A maximum length of 15 characters including country code. For example, +1123567890.
emailstring The customer's email address. A maximum length of 64 characters. For example, john.smith@example.com.
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
count must be an integer between 1 and 100.
Error Status: 400
An invalid value was passed for the count query parameter. The API returns variants of this error depending on the input: The count must be at least 1. (for count=0 or negative values), The count may not be greater than 100. (for values above 100), or The parameter provided is not an integer (for non-integer values).
Solution
The skip must be at least 0.
Error Status: 400
A negative value was passed for the skip query parameter.
Solution
Fetch All Customers
GET/v1/customersClick to copy
Use this endpoint to retrieve the details of all the customers.
Is this page helpful?
Query Parameters
count integer The number of customer records to be retrieved from the system. The default value is 10. The maximum value is 100. This can be used for pagination in combination with skip.
skip integer The number of customer records that must be skipped. The default value is 0. This can be used for pagination in combination with count.
Response Parameters
entity stringIndicates the type of entity.
idstring Unique identifier of the customer. For example, cust_1Aa00000000004.
namestring 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, John Smith.
contactstring The customer's phone number. A maximum length of 15 characters including country code. For example, +1123567890.
emailstring The customer's email address. A maximum length of 64 characters. For example, john.smith@example.com.
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
count must be an integer between 1 and 100.
Error Status: 400
An invalid value was passed for the count query parameter. The API returns variants of this error depending on the input: The count must be at least 1. (for count=0 or negative values), The count may not be greater than 100. (for values above 100), or The parameter provided is not an integer (for non-integer values).
Solution
The skip must be at least 0.
Error Status: 400
A negative value was passed for the skip query parameter.
Solution
Curl
change language
change language
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X GET https://api.razorpay.com/v1/customers?count=2&skip=1
Success
Failure
1{2"entity": "collection",3"count": 2,4"items": [5{6"id": "cust_LQPdeJqQeKQrJM",7"entity": "customer",8"name": "John Smith",9"email": "john.smith@example.com",10"contact": "+11234567890",11"gstin": null,12"notes": [],13"created_at": 167858035214},15{16"id": "cust_LQPd9lomgwDE5F",17"entity": "customer",18"name": "John Smith",19"email": "john.smith@example.com",20"contact": "+11234567890",21"gstin": null,22"notes": [],23"created_at": 167858032424}25]26}