Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanSCaicedo/Api-Ecommerce/llms.txt

Use this file to discover all available pages before exploring further.

API Ecommerce exposes two profile endpoints: one for reading the currently authenticated user’s information, and one for updating it. Both require a valid JWT Bearer token. The update endpoint also handles avatar image uploads and optional password changes.

Get Profile

POST /api/auth/me
Returns the full profile of the currently authenticated user. Also accessible as a convenience alias at GET /api/ecommerce/profile_client/me within the ecommerce route group. Authentication: Requires Authorization: Bearer <token> header.

Response Fields

name
string
The user’s first name.
surname
string
The user’s last name / surname.
phone
string
The user’s phone number.
email
string
The user’s email address.
bio
string | null
A short biography or description provided by the user. null if not set.
fb
string | null
The user’s Facebook profile URL. null if not set.
tw
string | null
The user’s Twitter profile URL. null if not set.
sexo
string | null
The user’s gender. null if not set.
address_city
string | null
The user’s city address. null if not set.
avatar
string
Full URL of the user’s avatar image served from OCI Object Storage. If no avatar has been uploaded, returns the default CDN icon: https://cdn-icons-png.flaticon.com/512/18851/18851107.png.

Example Request

curl --request POST \
  --url https://your-domain.com/api/auth/me \
  --header 'Authorization: Bearer <your_token>'

Example Response

{
  "name": "Jane",
  "surname": "Doe",
  "phone": "+1-555-0100",
  "email": "jane.doe@example.com",
  "bio": "Avid shopper and tech enthusiast.",
  "fb": "https://facebook.com/janedoe",
  "tw": "https://twitter.com/janedoe",
  "sexo": "F",
  "address_city": "Bogotá",
  "avatar": "https://objectstorage.region.oraclecloud.com/n/namespace/b/bucket/o/juandevops/ecommerce/public/users/avatar.jpg"
}

Update Profile

POST /api/ecommerce/profile_client
Updates the authenticated user’s profile data. Accepts multipart/form-data to allow optional avatar image uploads alongside other text fields. Authentication: Requires Authorization: Bearer <token> header. Content-Type: multipart/form-data (required when uploading file_imagen; application/json is acceptable for text-only updates).

Update Fields

name
string
Updated first name.
surname
string
Updated surname.
phone
string
Updated phone number.
email
string
Updated email address. Must not already be in use by a different user account.
bio
string
Updated biography text.
fb
string
Updated Facebook profile URL.
tw
string
Updated Twitter profile URL.
sexo
string
Updated gender value.
address_city
string
Updated city address.
file_imagen
file
Optional new avatar image. Uploaded to OCI Object Storage under juandevops/ecommerce/public/users/. Any previously stored avatar is deleted before the new one is saved.
current_password
string
The user’s current password. Required together with password to trigger a password change. Omit both fields to update profile data only.
password
string
The desired new password. Required together with current_password. Stored as a bcrypt hash.

Example Request — Update Profile Fields

curl --request POST \
  --url https://your-domain.com/api/ecommerce/profile_client \
  --header 'Authorization: Bearer <your_token>' \
  --form 'name=Jane' \
  --form 'surname=Smith' \
  --form 'phone=+1-555-0199' \
  --form 'bio=Updated bio text.' \
  --form 'file_imagen=@/path/to/new-avatar.jpg'

Example Request — Change Password

curl --request POST \
  --url https://your-domain.com/api/ecommerce/profile_client \
  --header 'Authorization: Bearer <your_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "current_password": "oldPassword123",
    "password": "newSecurePass456"
  }'

Responses

Profile update success:
{
  "message": 200
}
Password changed successfully:
{
  "message": 200,
  "message_text": "Contraseña actualizada correctamente"
}
Wrong current password (403):
{
  "message": 403,
  "message_text": "La contraseña actual es incorrecta"
}
Duplicate email (200 body with 403 code):
{
  "message": 403,
  "message_text": "El usuario ya existe"
}
Every successful profile update calls Cache::flush(), clearing all application cache entries including cached home page data and product listings. This ensures stale data is never served after a profile change.

Build docs developers (and LLMs) love