Create Contact
Authentication
Basic Authentication
- Username: Client Id
- Password: Secret Key
Example Authorization Header:
Authorization: Basic eGV0dGxlXzgzMjg2NjU5YmRmNzBkZWEzMDUwMzcwNzE1MTYwMzA0MDo3YzE1ZDQyYTZhYjEyOTYzYWI4NzJhMzFkOTk4MDk1ZDMwNTAzNzA3MTUxNjMyMDg5
Request Body
{
"firstName":"Demo",
"lastName":"Kumar",
"email":"demo@gmail.com",
"mobile":"1122334455",
"type":"customer",
"accountType":"bank_account",
"accountNumber":"XXXXXXXXXXXXXX2223",
"ifsc":"YESB000XXXX",
"referenceId":"REFC56789097666"
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| firstName | String | Yes | First name of the contact |
| lastName | String | Yes | Last name of the contact |
| String | Yes | Email address of the contact | |
| mobile | String | Yes | Mobile number of the contact |
| type | String | Yes | Type of contact (e.g., "customer") |
| accountType | String | Yes | Type of account (e.g., "bank_account") |
| accountNumber | String | Yes | Bank account number |
| ifsc | String | Yes | IFSC code of the bank branch |
| referenceId | String | Yes | Your reference ID for this contact |
Request Examples
Request Examples
- Curl
- JavaScript
- C#
- Java
- Python
curl --location 'https://xyz.com/v1/service/payout/contacts' --header 'Content-Type: application/json' --header 'Authorization: Basic U0FGRUVfYmNlOTQ4MmUxZmJlZmFiMzEwMjU2MjY2NTg5NTUyMDk6MjRlN2Y3NGMyNjUxZTI3ZGQwOTI0NTA5OTM5YWY5NTgxMDI1NjI2NjU4OTYyNDcx' --data-raw '{
"firstName":"Demo",
"lastName":"Kumar",
"email":"demo@gmail.com",
"mobile":"1122334455",
"type":"customer",
"accountType":"bank_account",
"accountNumber":"XXXXXXXXXXXXXX2223",
"ifsc":"YESB000XXXX",
"referenceId":"REFC56789097666"
}'
const axios = require('axios');
let data = JSON.stringify({
"firstName": "Demo",
"lastName": "Kumar",
"email": "demo@gmail.com",
"mobile": "1122334455",
"type": "customer",
"accountType": "bank_account",
"accountNumber": "XXXXXXXXXXXXXX2223",
"ifsc": "YESB000XXXX",
"referenceId": "REFC56789097666"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://xyz.com/v1/service/payout/contacts',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic U0FGRUVfYmNlOTQ4MmUxZmJlZmFiMzEwMjU2MjY2NTg5NTUyMDk6MjRlN2Y3NGMyNjUxZTI3ZGQwOTI0NTA5OTM5YWY5NTgxMDI1NjI2NjU4OTYyNDcx'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://xyz.com/v1/service/payout/contacts");
request.Headers.Add("Authorization", "Basic U0FGRUVfYmNlOTQ4MmUxZmJlZmFiMzEwMjU2MjY2NTg5NTUyMDk6MjRlN2Y3NGMyNjUxZTI3ZGQwOTI0NTA5OTM5YWY5NTgxMDI1NjI2NjU4OTYyNDcx");
var content = new StringContent("{
"firstName":"Demo",
"lastName":"Kumar",
"email":"demo@gmail.com",
"mobile":"1122334455",
"type":"customer",
"accountType":"bank_account",
"accountNumber":"XXXXXXXXXXXXXX2223",
"ifsc":"YESB000XXXX",
"referenceId":"REFC56789097666"
}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{
"firstName":"Demo",
"lastName":"Kumar",
"email":"demo@gmail.com",
"mobile":"1122334455",
"type":"customer",
"accountType":"bank_account",
"accountNumber":"XXXXXXXXXXXXXX2223",
"ifsc":"YESB000XXXX",
"referenceId":"REFC56789097666"
}");
Request request = new Request.Builder()
.url("https://xyz.com/v1/service/payout/contacts")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic U0FGRUVfYmNlOTQ4MmUxZmJlZmFiMzEwMjU2MjY2NTg5NTUyMDk6MjRlN2Y3NGMyNjUxZTI3ZGQwOTI0NTA5OTM5YWY5NTgxMDI1NjI2NjU4OTYyNDcx")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://xyz.com/v1/service/payout/contacts"
payload = json.dumps({
"firstName": "Demo",
"lastName": "Kumar",
"email": "demo@gmail.com",
"mobile": "1122334455",
"type": "customer",
"accountType": "bank_account",
"accountNumber": "XXXXXXXXXXXXXX2223",
"ifsc": "YESB000XXXX",
"referenceId": "REFC56789097666"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Basic U0FGRUVfYmNlOTQ4MmUxZmJlZmFiMzEwMjU2MjY2NTg5NTUyMDk6MjRlN2Y3NGMyNjUxZTI3ZGQwOTI0NTA5OTM5YWY5NTgxMDI1NjI2NjU4OTYyNDcx'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Response Examples
- Success
- Failed
- MISSING_PARAMETER
{
"code": "0x0200",
"message": "Contact created successfully",
"status": "SUCCESS",
"data": {
"contactId": "CONT_30745919103659994DE3C",
"firstName": "Demo",
"lastName": "Kumar",
"email": "demo@gmail.com",
"mobile": "1122334455",
"type": "customer",
"accountType": "bank_account",
"reference": "REFC56789097666",
"isActive": "1",
"accountNumber": "XXXXXXXXXXXXXX2223",
"accountIFSC": "YESB000XXXX"
}
}
{
"code": "0x0201",
"message": "Unauthorized IP used.",
"status": "FAILURE",
"ip": "152.58.32.60"
}
{
"code": "0x0203",
"status": "MISSING_PARAMETER",
"message": "The reference id has already been taken."
}
Key indicators of success:
codeis0x0200(SUCCESS_CODE)statusis"SUCCESS"data.statusis"processed"
Key indicators of transaction failure:
codeis still0x0200because the status check itself succeededstatusis"SUCCESS"(referring to the status check, not the transaction)data.statusis"failed"
Key indicators of invalid request:
codeis0x0202(FAILED_CODE)statusis"FAILURE"- No
dataobject is returned messagedescribes the specific error
Key indicators of processing:
codeis0x0200because the status check succeededstatusis"SUCCESS"(referring to the status check)data.statusis"processing"
Response Codes
The API uses the following response codes to indicate the status of requests:
| Code | Description | Meaning |
|---|---|---|
0x0200 | SUCCESS | The request was processed successfully. |
0x0201 | UNAUTHORIZED | Authentication failed or insufficient permissions. |
0x0202 | FAILED | The request processing failed for a reason other than those specifically identified. |
0x0203 | MISSING_PARAMETER | The request is missing one or more required parameters. |
0x0206 | PENDING | The request has been received and is being processed, but processing has not yet completed. |
0x0205 | SOMETHING_WENT_WRONG | A server error occurred during processing of the request. |