Update Profile
Update the authenticated customer's profile fields
Update Profile
Update one or more fields on the authenticated customer's profile. Only the fields you include in the request body will be changed.
Endpoint
PATCH /profileAuthentication
Requires a valid JWT access token.
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...Request Body
All fields are optional. Include only the fields you want to update.
| Field | Type | Description |
|---|---|---|
firstName | string | Customer's first name |
lastName | string | Customer's last name |
displayName | string | Full display name |
phone | string | Phone number (e.g. +1234567890) |
profilePhoto | string | URL to a profile photo |
The DOM Package also accepts a browser File or Blob for profilePhoto. When a file is provided, the SDK uploads the image through the profile photo upload endpoints before saving the customer profile.
Example Request
curl -X PATCH "https://edge.tiquo.app/api/client/v1/profile" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
-H "Content-Type: application/json" \
-d '{
"firstName": "John",
"lastName": "Smith",
"phone": "+1234567890"
}'Response
{
"success": true,
"data": {
"customer": {
"id": "cust_456",
"firstName": "John",
"lastName": "Smith",
"displayName": "John Smith",
"customerNumber": "CUST-000001",
"email": "customer@example.com",
"phone": "+1234567890",
"profilePhoto": null,
"status": "active",
"totalOrders": 5,
"totalSpent": 150.00,
"lifetimeValue": 200.00
}
}
}The response includes the full updated customer object, so you can use it to refresh your local state without making a separate GET request.
Profile Photo Uploads
For browser-based uploads, use the DOM Package uploadProfilePhoto() helper where possible.
If you are calling the Client API directly, profile photo uploads use two steps:
- Request an upload URL.
- Upload the image to that URL, then finalise the profile photo with the returned
storageId.
Create Upload URL
POST /profile/photo-upload-urlThe request body can be an empty JSON object.
curl -X POST "https://edge.tiquo.app/api/client/v1/profile/photo-upload-url" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
-H "Content-Type: application/json" \
-d '{}'The response includes a temporary uploadUrl.
{
"success": true,
"data": {
"uploadUrl": "https://..."
}
}Upload the image file to the returned URL using POST and the image content type. The upload response includes a storageId.
Finalise Profile Photo
POST /profile/photocurl -X POST "https://edge.tiquo.app/api/client/v1/profile/photo" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
-H "Content-Type: application/json" \
-d '{
"storageId": "kg2..."
}'The image must be an image MIME type and smaller than 5MB.
The response includes the updated customer, the resolved profilePhoto URL, and the storageId.
Errors
| Status | Description |
|---|---|
400 | No customer profile linked to this account, or invalid field values |
401 | Invalid or expired access token |
500 | Internal server error |
Code Examples
JavaScript
const response = await fetch('https://edge.tiquo.app/api/client/v1/profile', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
firstName: 'John',
lastName: 'Smith',
}),
});
const { success, data, error } = await response.json();
if (success) {
console.log('Profile updated:', data.customer.displayName);
}Swift
var request = URLRequest(url: URL(string: "https://edge.tiquo.app/api/client/v1/profile")!)
request.httpMethod = "PATCH"
request.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONEncoder().encode(["firstName": "John", "lastName": "Smith"])
let (data, _) = try await URLSession.shared.data(for: request)Kotlin
val body = """{"firstName": "John", "lastName": "Smith"}"""
.toRequestBody("application/json".toMediaType())
val request = Request.Builder()
.url("https://edge.tiquo.app/api/client/v1/profile")
.patch(body)
.addHeader("Authorization", "Bearer $accessToken")
.build()
val response = client.newCall(request).execute()