/settings/update
Overview
Writes the business's branch list. A system outside the loyalty platform (a back office or an ERP) keeps the list in step with its own records through this one call. With the business's own API key it adds a branch, renames it, sets it inactive, or sets it active again. Rows are never deleted.
The answer always carries the business and its whole branch list, inactive rows and real names included.
When to Use This Endpoint
Use this endpoint to:
- Load all of a business's branches in one call
- Add a branch when a new location opens
- Rename a branch
- Set a closed branch inactive, or a reopened branch active again
- Read the whole branch list: send an empty
locationList - Check what a load would change before it writes anything, with
dryRun
Key Considerations
- Load all of a business's branches in one call. With "only allow defined locations" on, a business with no active branch accepts every till, and the first branch added closes the business to every till that is not listed.
- All or nothing. Every row is validated before anything is written. One invalid row refuses the whole call, and nothing changes. The list and its change log are saved in one transaction.
- Matching is exact. A row is matched to a stored branch by
branchId, exact and case-sensitive, with no trimming: the same match the till check uses.Shop1andshop1are two branches. - A repeated call is safe. A row whose stored values already equal the sent values is not a change. Sending the same body twice gives the same list and logs nothing the second time.
replaceis for one system only. Only one system per business sendsreplace: true. It sets every stored branch that is not in the body toinactive, so a second system that sends a shorter list undoes the first.- The branch header is not checked on this call. The call works with "only allow defined locations" on, from a system that is not a till.
- A branch added here is accepted from its next sale. Changes apply from the next call.
- Every change is recorded with the time, the old and new value, and the
X-Source-Namethat made it. branchIdandnameare stored as sent. No other fields are accepted: an unknown key, in the body or in a row, is refused with1001.
Request Details
Method & URL
POST /settings/update
See API Servers for the base URL to use in place of {{server}}.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
x-api-key | string | Yes | The business's own API key |
x-source-type | string | Yes | Send Web for a system that is not a till |
x-source-name | string | Yes | The name of the calling system. It is written to the change log |
x-pos-id | string | Yes | Send erp for a system that is not a till |
x-branch-id | string | Yes | Send erp for a system that is not a till. It is never checked on this call |
Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
locationList | array | Yes | 0 to 500 rows. With replace: true, at least 1 row | |
locationList[].branchId | string | Yes | 1 to 100 characters. No leading or trailing space, no control character, no < or >. The same value the till sends in x-branch-id | |
locationList[].name | string | No | The branchId, for a new row | 1 to 100 characters, no < or > |
locationList[].status | string | No | active, for a new row | active or inactive |
replace | boolean | No | false | When true, every stored branch that is not in the body and is not already inactive is set to inactive. No row is removed |
dryRun | boolean | No | false | When true, answers what would change and writes nothing |
replace and dryRun must be JSON booleans. The string "true" is refused with 1101.
How a row is applied:
- A row whose
branchIdis stored: the fields sent replace the stored ones. A field left out stays as stored. - A row whose
branchIdis not stored: a new branch is added, withstatusactiveandnameequal to thebranchIdwhen those are left out. - The same
branchIdtwice in one body is refused with1105.
Request Example
- Add and rename
- Load the whole list
- Dry run
- Read the list
{
"locationList": [
{ "branchId": "1280", "name": "Main Street", "status": "active" },
{ "branchId": "1361", "status": "inactive" }
]
}
{
"replace": true,
"locationList": [
{ "branchId": "1280", "name": "Main Street" },
{ "branchId": "1295", "name": "Harbour Road" }
]
}
{
"dryRun": true,
"replace": true,
"locationList": [
{ "branchId": "1280", "name": "Main Street" }
]
}
{
"locationList": []
}
cURL Example
curl --location --request POST 'https://{{server}}/v1/settings/update' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: {{api-key}}' \
--header 'X-Source-Type: Web' \
--header 'X-Source-Name: MyERP' \
--header 'X-Pos-Id: erp' \
--header 'X-Branch-Id: erp' \
--data-raw '{
"locationList": [
{ "branchId": "1280", "name": "Main Street", "status": "active" },
{ "branchId": "1361", "status": "inactive" }
]
}'
Success Response
200 OK
{
"status": "success",
"dryRun": false,
"club": { "id": 1280, "name": "My Business" },
"activeLocations": 1,
"locationList": [
{
"branchId": "1280",
"name": "Main Street",
"status": "active",
"updatedAt": "2026-11-20T10:00:00.000Z"
},
{
"branchId": "1361",
"name": "1361",
"status": "inactive",
"updatedAt": "2026-11-20T10:00:00.000Z"
}
],
"changes": [
{ "branchId": "1280", "field": "status", "from": null, "to": "active" },
{ "branchId": "1280", "field": "name", "from": null, "to": "Main Street" },
{ "branchId": "1361", "field": "status", "from": null, "to": "inactive" },
{ "branchId": "1361", "field": "name", "from": null, "to": "1361" }
],
"warnings": []
}
Response Fields
| Field | Type | Description |
|---|---|---|
status | string | success |
dryRun | boolean | true when the call was a dry run and nothing was written |
club.id | number | Business ID |
club.name | string | Business name |
activeLocations | number | Count of active branches in locationList |
locationList | array | The whole stored list after the call, every status. On a dry run, the list the call would store |
locationList[].branchId | string | Branch identifier |
locationList[].name | string | Branch display name |
locationList[].status | string | active or inactive |
locationList[].updatedAt | string | ISO 8601 time of the last change made through /settings/update, in this call or an earlier one. Absent on a branch never changed through it |
changes | array | Every field change of this call. Empty when nothing changed |
changes[].branchId | string | The branch that changed |
changes[].field | string | name or status |
changes[].from | string or null | The stored value before the call. null for a new branch |
changes[].to | string | The value after the call |
warnings | array | Entries of the form { "code": "caseVariants", "branchIds": [...] } naming branch IDs that differ only by letter case. This is not an error: the till check treats them as separate branches |
A new branch logs two changes: its status and its name, both from null.
Error Response Examples
Repeated Branch ID
{
"status": "error",
"error": {
"code": "1105",
"message": "branchId is sent twice in one call",
"path": "body.locationList.2.branchId"
}
}
Flag Is Not a Boolean
{
"status": "error",
"error": {
"code": "1101",
"message": "replace must be a boolean",
"path": "body.replace"
}
}
Unknown Key
{
"status": "error",
"error": {
"code": "1001",
"message": "country is not allowed",
"path": "body.locationList.0.country"
}
}
Save Failed
{
"status": "error",
"error": {
"code": "1110",
"message": "Internal server error while saving the location list"
}
}
Nothing is written when 1110 is answered. Send the same body again.
Error Codes
| HTTP Status | Code | Description |
|---|---|---|
400 | 001 | Business not found for the given API key |
400 | 101 | Missing X-Api-Key header |
400 | 102 | Missing X-Source-Type header |
400 | 103 | Missing X-Source-Name header |
400 | 104 | Missing X-Pos-Id header |
400 | 105 | Missing X-Branch-Id header |
400 | 4030004 | Business suspended |
400 | 4030005 | Business inactive |
400 | 1001 | Unknown key in the body or in a row |
400 | 1101 | Invalid body: replace or dryRun is not a boolean, locationList is missing or not an array, has more than 500 rows, or is empty with replace: true |
400 | 1102 | Invalid branchId |
400 | 1103 | Invalid name |
400 | 1104 | Invalid status |
400 | 1105 | branchId sent twice in one body |
500 | 1110 | The save failed. Nothing was written |
The path of a validation error names the field, for example body.locationList.3.branchId.
Field Reference
| Term | Description |
|---|---|
branchId | The identifier of a branch. It is the value a till sends in x-branch-id, and it is the key of a row: a stored row with the same branchId is updated, any other branchId adds a branch. Letter case counts, so A1 and a1 are two branches |
name | The display name of a branch |
status | active for a branch a till may use when "only allow defined locations" is on, inactive for a branch it may not use then. An inactive branch stays in the list |
replace | Treats the body as the whole list. Branches missing from the body are set to inactive, never removed |
dryRun | Runs the full check and answers as if the call were applied, with dryRun set to true in the answer. Nothing is written |
changes entry | One changed field of one branch: branchId, field (name or status), the stored value from and the new value to |
warnings entry | A notice about the list that does not stop the call. It has a code and the branchIds it concerns |
Related Use Cases
- Loading a new business's branches before turning on "only allow defined locations"
- Keeping the branch list in step with an ERP when a location opens, closes or is renamed
- Previewing a full reload with
dryRunbefore writing it - Reading the whole branch list, inactive rows included, with an empty
locationList - Reading the active branches a till sees with /settings