Appearance
Customer profiles and accounts
Read or update customer details and addresses, merge duplicate accounts, and deactivate accounts. Customer identity normally comes from the Authorization token.
Access labels such as Origin + Brand key + Customer are defined in Headers and access. Each endpoint ends in a Try it console; set the host and keys once in its Settings tab or on the overview.
Get user address
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/address | Origin + Brand key + Customer |
Request fields: no body, query, or path fields are read by this controller. Context comes from the headers/middleware above.
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/address" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: An array of saved address records, including addressId and address fields.
Source: app/v1/controller/address_controller.js:138 → getUserAddress; routes: routes/v1/address_route.js:65; service: _getUserAddress (app/v1/service/address_service.js:62).
Update user address
| Method | URL path | Required access |
|---|---|---|
PUT | /api/v1/user/address/update/:addressId | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.address1 | string | optional | Whitespace trimmed |
body.payload.address2 | string | optional | Whitespace trimmed |
body.payload.city | string | optional | Whitespace trimmed |
body.payload.county | string | optional | Whitespace trimmed |
body.payload.state | string | optional | Whitespace trimmed |
body.payload.short_state | string | optional | Whitespace trimmed |
body.payload.zip | string | optional | Whitespace trimmed |
body.payload.country | string | optional | Whitespace trimmed; Country code from country_iso_codes, for example US or CA |
body.payload.addressString | string | optional | Whitespace trimmed |
body.payload.what3words | string | optional | Whitespace trimmed |
body.payload.deliveryCharges | number | optional | — |
body.payload.name | string | optional | Whitespace trimmed |
body.payload.type | string | optional | Whitespace trimmed; Default ("shipping") |
body.payload.isPrimary | boolean | optional | — |
body.payload.latLng | object | optional | — |
body.payload.latLng.lat | number | yes | — |
body.payload.latLng.lng | number | yes | — |
path.addressId | number | yes | — |
Example:
bash
curl -X PUT "$BASE_URL/api/v1/user/address/update/1" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"type":"example"}}'Response: JSON with success: true and result containing the operation’s service data. Result fields/details: message, addressId.
Source: app/v1/controller/address_controller.js:69 → updateUserAddress; routes: routes/v1/address_route.js:75; service: _updateUserAddress (app/v1/service/address_service.js:28).
Add user address
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/address/add | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.address1 | string | yes | Whitespace trimmed |
body.payload.address2 | string | optional | Whitespace trimmed |
body.payload.city | string | yes | Whitespace trimmed |
body.payload.county | string | optional | Whitespace trimmed |
body.payload.state | string | yes | Whitespace trimmed |
body.payload.short_state | string | optional | Whitespace trimmed |
body.payload.zip | string | yes | Whitespace trimmed |
body.payload.country | string | yes | Whitespace trimmed; Country code from country_iso_codes, for example US or CA |
body.payload.addressString | string | yes | Whitespace trimmed |
body.payload.what3words | string | optional | Whitespace trimmed |
body.payload.deliveryCharges | number | optional | — |
body.payload.isPrimary | boolean | optional | Default (true) |
body.payload.name | string | optional | Whitespace trimmed |
body.payload.type | string | optional | Whitespace trimmed; Default ("shipping") |
body.payload.latLng | object | optional | — |
body.payload.latLng.lat | number | yes | — |
body.payload.latLng.lng | number | yes | — |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/address/add" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"address1":"123 Example Street","city":"New York","state":"New York","zip":"10001","country":"US","addressString":"123 Example Street, New York, NY 10001, US"}}'Response: JSON with success: true and result containing the operation’s service data. Result fields/details: message, addressId.
Source: app/v1/controller/address_controller.js:13 → addUserAddress; routes: routes/v1/address_route.js:54; service: _addUserAddress (app/v1/service/address_service.js:5).
Delete address by ID
| Method | URL path | Required access |
|---|---|---|
DELETE | /api/v1/user/address/delete/:addressId | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.addressId | number | yes | — |
The address service refuses to delete a primary address. Select another primary address before removing it.
Example:
bash
curl -X DELETE "$BASE_URL/api/v1/user/address/delete/1" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: message, userId.
Source: app/v1/controller/address_controller.js:152 → deleteAddressById; routes: routes/v1/address_route.js:86; service: _deleteAddressById (app/v1/service/address_service.js:85).
Get customer details
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/detail | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
query.hubId | number | optional | — |
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/detail" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: Customer profile data, with loyalty and integration details when available.
Source: app/v1/controller/customer_controller.js:298 → getCustomerDetails; routes: routes/v1/customer_route.js:571; service: _detailCustomer (app/v1/service/customer_service.js:408).
Update details
| Method | URL path | Required access |
|---|---|---|
PUT | /api/v1/user/details/update | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.firstName | string | optional | Whitespace trimmed |
body.payload.lastName | string | optional | Whitespace trimmed |
body.payload.fullName | string | optional | Whitespace trimmed |
body.payload.email | string | optional | Email address; Whitespace trimmed; Converted to lowercase; Custom validation in controller |
body.payload.password | string | optional | Whitespace trimmed; Minimum (8) |
body.payload.dateOfBirth | date | optional | ISO date |
body.payload.phoneNumber | string | optional | replace(/\D/g , ""); Whitespace trimmed |
body.payload.phone_prefix | string | conditional | Required when phoneNumber is supplied; otherwise optional |
body.payload.tags | string | optional | Whitespace trimmed |
body.payload.user_profile | string | optional | Whitespace trimmed |
body.payload.user_description | string | optional | Whitespace trimmed |
body.payload.username | string | optional | Whitespace trimmed |
body.payload.open_to_trade | boolean | optional | — |
body.payload.show_collections_for_trade | boolean | optional | — |
body.payload.gender | string | optional | Whitespace trimmed |
body.payload.geocode | string | optional | Whitespace trimmed; pattern(/^[A-Z]{1,4} [A-Z0-9][A-Z0-9 -]{1,9}, [A-Z]{2}$/) |
Example:
bash
curl -X PUT "$BASE_URL/api/v1/user/details/update" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"email":"alex@example.com"}}'Response: JSON with success: true and result containing the operation’s service data. Result fields/details: message, userId, token.
Source: app/v1/controller/customer_controller.js:325 → updateDetails; routes: routes/v1/customer_route.js:591; service: _updateCustomer (app/v1/service/customer_service.js:611).
Send OTP for user merge operation
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/merge-user/send-otp | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | At least one of ("email" , "phoneNumber") |
body.payload.phoneNumber | string | optional | replace(/\D/g , ""); Whitespace trimmed |
body.payload.phone_prefix | string | conditional | Required when phoneNumber is supplied; otherwise optional |
body.payload.email | string | optional | Email address; Whitespace trimmed; Converted to lowercase; Custom validation in controller |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/merge-user/send-otp" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"email":"alex@example.com"}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/customer_controller.js:1132 → sendOtpForUserMergeOperation; routes: routes/v1/customer_route.js:394; service: _sendOtpForUserMergeOperation (app/v1/service/customer_service.js:2366).
Validate OTP for user merge operation
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/merge-user/validate-otp | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | At least one of ("email" , "phoneNumber") |
body.payload.email | string | optional | Email address; Whitespace trimmed; Converted to lowercase; Custom validation in controller |
body.payload.phoneNumber | string | optional | replace(/\D/g , ""); Whitespace trimmed |
body.payload.phone_prefix | string | conditional | Required when phoneNumber is supplied; otherwise optional |
body.payload.otp | string | optional | Whitespace trimmed |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/merge-user/validate-otp" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"email":"alex@example.com"}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/customer_controller.js:1185 → validateOTPForUserMergeOperation; routes: routes/v1/customer_route.js:404; service: _validateOTPForUserMergeOperation (app/v1/service/customer_service.js:2446).
Merge duplicate users
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/merge-user | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | At least one of ("email" , "phoneNumber") |
body.payload.firstName | string | optional | Whitespace trimmed |
body.payload.lastName | string | optional | Whitespace trimmed |
body.payload.phoneNumber | string | optional | replace(/\D/g , ""); Whitespace trimmed |
body.payload.phone_prefix | string | conditional | Required when phoneNumber is supplied; otherwise optional |
body.payload.email | string | optional | Email address; Whitespace trimmed; Converted to lowercase; Custom validation in controller |
body.payload.username | string | optional | Whitespace trimmed |
body.payload.dateOfBirth | date | optional | ISO date |
body.payload.gender | string | optional | Whitespace trimmed |
body.payload.user_profile | string | optional | Whitespace trimmed |
body.payload.user_description | string | optional | Whitespace trimmed |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/merge-user" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"email":"alex@example.com"}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/customer_controller.js:1244 → mergeDuplicateUsers; routes: routes/v1/customer_route.js:414; service: _mergeDuplicateUsers (app/v1/service/customer_service.js:2569).
Create integration customer
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/register/integration | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
query.hubId | number | optional | — |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/register/integration" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/customer_controller.js:857 → createIntegrationCustomer; routes: routes/v1/customer_route.js:184; service: _createIntegrationCustomer (app/v1/service/customer_service.js:1531).
Start account deactivation
Send the OTP used to confirm account deactivation.
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/deactivate | Origin + Brand key + Customer |
Request fields: no body, query, or path fields are read by this controller. Context comes from the headers/middleware above.
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/deactivate" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/customer_controller.js:1082 → deactivateUser; routes: routes/v1/customer_route.js:608; service: _deactivateUser (app/v1/service/customer_service.js:2105).
Confirm account deactivation
Confirm deactivation using the OTP. This changes account access.
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/deactivate/confirmation | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.otp | string | yes | Whitespace trimmed |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/deactivate/confirmation" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"otp":"123456"}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/customer_controller.js:1098 → deactivateUserConfirmation; routes: routes/v1/customer_route.js:615; service: _deactivateUserConfirmation (app/v1/service/customer_service.js:2160).
Get all brand customers
Search or page through customers belonging to the current brand.
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/brand/customers | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
query.limit | number | optional | — |
query.offset | number | optional | — |
query.search | string | optional | Whitespace trimmed |
Pagination is added only when limit and offset are both truthy; offset=0 does not enable that branch.
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/brand/customers?limit=10&offset=0" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: count, rows.
Source: app/v1/controller/customer_controller.js:1425 → getAllBrandCustomers; routes: routes/v1/customer_route.js:374; service: _getAllBrandCustomers (app/v1/service/customer_service.js:3291).
Check username availability
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/available/username | Origin + Customer + Brand key |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
query.username | string | yes | Whitespace trimmed |
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/available/username?username=alex_taylor" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: available (boolean).
Source: app/v1/controller/customer_controller.js:1580 → check_username_availability; routes: routes/v1/customer_route.js:654; service: _check_username_availability (app/v1/service/customer_service.js:3884).