Tiquo
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 /profile

Authentication

Requires a valid JWT access token.

Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...

Request Body

All fields are optional. Include only the fields you want to update.

FieldTypeDescription
firstNamestringCustomer's first name
lastNamestringCustomer's last name
displayNamestringFull display name
phonestringPhone number (e.g. +1234567890)
profilePhotostringURL 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:

  1. Request an upload URL.
  2. Upload the image to that URL, then finalise the profile photo with the returned storageId.

Create Upload URL

POST /profile/photo-upload-url

The 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/photo
curl -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

StatusDescription
400No customer profile linked to this account, or invalid field values
401Invalid or expired access token
500Internal 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()

Sur cette page