Merge two customers
const url = 'https://example.com/customers/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/merge';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"intoId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/customers/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/merge \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "intoId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" }'Everything the duplicate holds moves to the account being kept: addresses, orders, invoices, payment requests, cylinder movements, deposit refunds, standing orders, prices, contacts, shop logins and its Xero match. Where both have something, the kept account keeps its own and the duplicate fills only what it lacks; a different person or contact detail becomes a contact. The duplicate stays as a tombstone pointing at it, because an order taken against it this morning still has to resolve to something.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Bodyrequired
Section titled “Request Bodyrequired”object
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fResponses
Section titled “Responses”The account that was kept
object
object
UUID v7
A language: en-GB English, ar Arabic, ur Urdu, pa Punjabi (Gurmukhi), hi Hindi, bn Bengali, gu Gujarati, zh-Hans Chinese (Simplified), pl Polish, ro Romanian, es Spanish, fr French, de German.
UUID v7
Deposit: paid once with the cylinder and refunded on return. rent: charged while they keep it, no deposit.
UUID v7
UUID v7
object
UUID v7
object
UUID v7
object
UUID v7
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "tradingName": "Camden Lock Grill", "accountNumber": "BTL00313", "kind": "commercial", "legalName": "Camden Lock Grill Ltd", "contactName": "Priya Shah", "email": "orders@camdenlockgrill.co.uk", "phone": "07700 900123", "paymentTerms": "prepaid", "surchargeRule": "add", "preferredLocale": "en-GB", "billingAddressId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "hireBillingPeriod": "weekly", "cylinderCharge": "deposit", "rateSetId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "invoiceSchedule": { "mode": "business" }, "mergedIntoId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "contacts": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "phone": "07700 900123", "kind": "normal", "relationship": "Accounts" } ], "shopperAccounts": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "role": "manager" } ], "shopperInvitations": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "role": "manager" } ]}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Not a member of that tenant
object
Example
{ "error": "not_found", "message": "Customer not found"}Not found
object
Example
{ "error": "not_found", "message": "Customer not found"}Cannot merge a customer into itself
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}