Search of customers [Private]
This endpoint allows you to search for customers.
Method name: | /v2/customer/find |
Request type: | POST |
To call private endpoints, you need to get a JWT token or an API key for authentication.
Here you can learn in detail how to successfully authenticate.
This option can be used to search for a customer when there is no information about their ID or when the goal is to find multiple customers by known parameters on the KunaCore side. The search is available using any combination of fields provided as optional in the BODY PARAMS.
Data dictionary
Name | Type | Parameter type | Required | Range | Description |
---|---|---|---|---|---|
string | BODY | NO | - | Customer email. | |
walletId | string | BODY | NO | - | Unique identifier of customer wallet in KunaCore. |
phoneNumber | string | BODY | NO | - | Customer's phone number. |
fullName | string | BODY | NO | - | Full name of the client in format "{firstName} {lastName}" . |
comment | string | BODY | NO | - | Additional comment about the customer. |
externalId | string | BODY | NO | - | Any string that identify client in your system. |
referralId | string | BODY | NO | - | For referral program, if supported. ID of another customer |
createdFrom | string | BODY | NO | - | ISO 8601 date string. Search records by field “createdAt” that were created after this date. |
createdTo | string | BODY | NO | - | ISO 8601 date string. Search records by field “createdAt” that were created before this date. |
take | int | BODY | NO | - | Number of records to take. |
skip | int | BODY | NO | - | Number of records to skip. |
Exemplary request
const url = BASE_URL;
const path = "/v2/customer/find";
const body = {
email: "[email protected]",
fullName: "Alexander Smith"
};
const options = {
method: "POST",
headers: {
accept: "application/json",
"Content-Type": "application/json",
"Authorization": `Bearer ${data.accessToken}` // data.accessToken - generated a JWT token via /v2/auth/login.
},
body: JSON.stringify(body),
};
fetch(url + path, options)
.then((response) => response.json())
.then((showResponse) => console.log(showResponse.data));
import requests
url = BASE_URL
path = "/v2/customer/find"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer " + data.accessToken # data.accessToken - generated a JWT token via /v2/auth/login.
}
body = {
"email": "[email protected]",
"fullName": "Alexander Smith"
}
request = requests.post(url + path, headers=headers, json=body)
print(request.json())
How to call private endpoints here
Response
{
"data": {
"id": "6d962783-f0cf-420d-a511-3a48c71c5595", // Customer’s ID
"comment": null, // Note for the customer account
"createdAt": "2024-02-26T16:36:14.499Z", // Account creation date
"email": "[email protected]", // Customer’s email
"firstName": "Alex", // Customer’s name
"lastName": "Smith", // Customer’s surname
"phoneNumber": "+380991234567", // Customer’s phone number
"externalId": null, // Customer’s external ID
"walletId": "6d962783-f0cf-420d-a511-3a48c71c5595", // Customer’s wallet ID
"referralId": "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5" // External ID of the referral account
}
}
Updated about 2 months ago