API and AuthenticationClient API
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 |
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.
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()