Skip to main content

Retrieve Customer

Retrieves detailed information about a specific customer.

HTTP Request

GET/api/customers/:id

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the customer

Example Requests

1import requests
2
3response = requests.get('http://www.example.com/api/customers/123', 
4  headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())

Status Codes

CodeDescription
200Customer retrieved successfully
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Customer not found
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the customer
first_nameStringCustomer's first name
last_nameStringCustomer's last name
emailStringCustomer's email address
mobile_numberStringCustomer's mobile phone number
national_codeStringCustomer's national identification code
birth_dateString (YYYY-MM-DD)Customer's birth date
genderStringCustomer's gender (male/female)
notesStringAdditional notes about the customer
is_activeBooleanWhether the customer account is active
is_profile_completedBooleanWhether the customer has completed their profile
date_joinedString (ISO 8601)Timestamp when customer was created
last_loginString (ISO 8601)Timestamp of customer's last login (null if never logged in)
total_ordersIntegerTotal number of orders placed by this customer
total_spentString (Decimal)Total amount spent by this customer

Notes

    • The customer ID must exist in the system
    • Some fields may be null if not provided during customer creation
    • total_orders and total_spent are calculated in real-time
    • last_login will be null for customers who have never logged in