cURL
curl --request PATCH \ --url https://api.example.com/v1/customers/{id} \ --header 'Authorization: <authorization>' \ --header 'Content-Type: application/json' \ --data ' { "firstName": "<string>", "lastName": "<string>", "email": "<string>", "phone": "<string>", "dateOfBirth": "<string>", "address": {}, "tags": [ {} ], "notes": "<string>", "preferredLocationId": "<string>", "marketingConsent": true, "companyId": "<string>" } '
Update an existing customer
PATCH /v1/customers/{id}
customers:write
cust_abc123
curl -X PATCH "https://api.tiquo.co/v1/customers/cust_abc123" \ -H "Authorization: Bearer sk_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "phone": "+1987654321", "tags": ["VIP", "longtime"], "notes": "Prefers email communication" }'
{ "success": true, "data": { "id": "cust_abc123", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "phone": "+1987654321", "dateOfBirth": "1990-05-15", "loyaltyPoints": 150, "tags": ["VIP", "longtime"], "notes": "Prefers email communication", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-20T16:00:00Z" } }
{ "phone": "+1987654321" }
{ "address": { "line1": "456 Oak Avenue" } }
line1
{ "tags": ["new-tag"] }
const customer = await getCustomer(id); const newTags = [...customer.tags, 'new-tag']; await updateCustomer(id, { tags: newTags });
400
401
403
404
409
{ "success": false, "error": { "code": "not_found", "message": "Customer not found" } }
const customerId = 'cust_abc123'; const response = await fetch(`https://api.tiquo.co/v1/customers/${customerId}`, { method: 'PATCH', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ phone: '+1987654321', notes: 'Updated contact number' }) }); const { data: customer } = await response.json(); console.log('Updated customer:', customer.id);