Retrieve customer
Get Customers Endpoint - Yativo
The GET
/customer/{{customer_id}}
endpoint allows you to retrieve detailed information about a specific customer using their unique customer ID. This endpoint is useful for accessing and displaying customer data within your application or for performing operations that require customer details.
Key Features:
HTTP Method:
GET
Endpoint URL:
/customer/{{customer_id}}
Authentication: Requires Bearer token to ensure secure access.
Response Structure:
Status Code:
200 OK
on success, with other codes indicating various errors (e.g.,401 Unauthorized
,404 Not Found
).
Headers
Name
Value
Content-Type
application/json
Authorization
Bearer <token>
Request sample and Response
import requests
customer_id = "5ae2f659-45d2-4256-9f82-2811726a5376" //example customer ID
url = f"{{baseUrl}}/customer/{customer_id}"
headers = {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
}
response = requests.get(url, headers=headers)
print(response.text)
{
"status": "success",
"status_code": 201,
"message": "Request successful",
"data": {
"customer_id": "5ae2f659-45d2-4256-9f82-2811726a5376",
"customer_name": "Test Customer",
"customer_email": "[email protected]",
"customer_phone": "+19203751411",
"customer_country": "USA",
"customer_address": {
"city": "Anytown",
"state": "Anystate",
"zipcode": "12345",
"street": "1234 Elm Street",
"number": "5678",
"country": "USA"
}
}
}
Authorizations
Responses
200
OK
application/json
Responseall of
and
anyOptionalExample:
{"status":"success","status_code":200,"message":"Records retrieved successfully","data":[{"customer_id":"fabdb7dd-aa1e-4d25-84a4-514567056173","customer_name":"Test Customer","customer_email":"[email protected]","customer_phone":"+19203751411","customer_country":"USA","customer_address":{"city":"Anytown","state":"Anystate","number":"5678","street":"1234 Elm Street","country":"USA","zipcode":"12345"},"can_create_vc":0,"can_create_va":0,"customer_status":"pending"}],"pagination":{"total":1,"per_page":20,"current_page":1,"last_page":1,"next_page_url":null,"prev_page_url":null}}
get
GET /api/v1/customer/fb942a7e-40ce-4a5e-90f7-089c6d53de8d HTTP/1.1
Host: smtp.yativo.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
OK
{
"status": "success",
"status_code": 200,
"message": "Records retrieved successfully",
"data": [
{
"customer_id": "fabdb7dd-aa1e-4d25-84a4-514567056173",
"customer_name": "Test Customer",
"customer_email": "[email protected]",
"customer_phone": "+19203751411",
"customer_country": "USA",
"customer_address": {
"city": "Anytown",
"state": "Anystate",
"number": "5678",
"street": "1234 Elm Street",
"country": "USA",
"zipcode": "12345"
},
"can_create_vc": 0,
"can_create_va": 0,
"customer_status": "pending"
}
],
"pagination": {
"total": 1,
"per_page": 20,
"current_page": 1,
"last_page": 1,
"next_page_url": null,
"prev_page_url": null
}
}
Last updated