Customer API
View a customer details
URL |
/api/v3/customer/ |
Methods |
GET |
The above endpoint will allow you to view the currently authenticated customer’s details.
Here is an example response from the server.
{
"customer_id": "",
"first_name": "",
"last_name": "",
"mobile": "",
"email": "",
"nationality": "",
"dob": "",
"gender": "",
"passport_number": "",
"nation_id_number": "",
"language":"",
"address":""
}
Key |
Type |
Description |
customer_id |
String |
A unique identifier for the customer |
first_name |
String |
The customer’s first name |
last_name |
String |
The customer’s surname/family name |
mobile |
String |
The customer’s mobile phone number including country code |
String |
The customer’s email address |
|
dob |
String |
The string representation of customer’s date of birth |
gender |
String |
A string that represents the gender of the customer, or null if not known |
passport_number |
String |
|
nation_id_number |
String |
|
nationality |
String |
Country code |
language |
String |
|
address |
String |
Errors
This endpoint will raise a 401 error code if you attempt to access it without previously authenticating a customer user with your session.
Code |
Reason |
401 |
Customer not authenticated |
Updating a customer’s details
URL |
/api/v3/customer/update/ |
Methods |
POST |
The update customer details endpoint can be called with either a GET or POST request. If called with either a GET or an empty POST request, the server will respond with just the form structure. However, if you POST data to the server then the server will validate the data submitted.
In either case, the server will respond with the following:
{
"customer_id": "customer_id",
"form": {},
"has_errors": false
}
Key |
Type |
Description |
customer_id |
String |
|
form |
Dict |
An object representing the form schema which needs to be completed. See ?? for details about form schemas |
has_errors |
Boolean |
A boolean flag to indicated if the form has an errors. This will be false if you are requesting the form |
When submitting data using a POST request, the payload should take the same shape as the form schema provided.
Errors
This endpoint will raise a 401 error code if you attempt to access it without previously authenticating a customer user with your session.
Code |
Reason |
401 |
Customer not authenticated |
Get a customer’s preferred language
Here is an example response from the server.
{
"language":"en",
"error_message": null,
}
Key |
Type |
Description |
language |
String |
Language short code |
error_message |
String |
Error message in case there’s an error. Otherwise, null |
Change a customer’s preferred language
URL |
/api/v3/customer/language/ |
Methods |
POST |
In case of customer logged in; will change customer’s preferred language to post_language_param |
|
and will return customer’s updated preferred language |
|
POST (language): In case of no customer; will return same POST language parameter |
Here is an example request:
{
"language":"en"
}
Key |
Type |
Description |
language |
String |
Language short code |
Here is an example response:
{
"language":"en"
}
Key |
Type |
Description |
language |
String |
Language short code |