Skip to main content

Profile

Retrieves or updates the authenticated customer's profile information.

HTTP Request

Retrieve Profile:

GET/api/shop/customers/me

Update Profile:

PATCH/api/shop/customers/me

Authorization

Authorization

  • Required: Yes
  • Permission: Authenticated Customer
  • Authentication: Token-based (`Authorization: Token <your_api_key>`)

Request Body (PATCH only)

FieldTypeRequiredDescription
usernameStringNoCustomer's username
avatarStringNoURL to customer's avatar image
first_nameStringNoCustomer's first name
last_nameStringNoCustomer's last name
genderStringNoCustomer's gender (male, female)

Example Requests

1import requests
2
3# Get customer profile
4response = requests.get('http://www.example.com/api/shop/customers/me', 
5  headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# Update customer profile
10response = requests.patch('http://www.example.com/api/shop/customers/me', 
11  json={
12      'first_name': 'John',
13      'last_name': 'Doe',
14      'gender': 'male'
15  },
16  headers={'Authorization': 'Token <your_api_key>'}
17)
18print(response.json())

Status Codes

CodeDescription
200Profile retrieved/updated successfully
401Unauthorized — authentication required
400Bad request — validation errors
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the customer
usernameStringCustomer's username
mobile_numberStringCustomer's phone number (read-only)
emailStringCustomer's email address (read-only)
avatarStringURL to customer's avatar image
first_nameStringCustomer's first name
last_nameStringCustomer's last name
full_nameStringCustomer's full name (computed field)
genderStringCustomer's gender
is_profile_completedBooleanWhether the profile is completed