Skip to main content

/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. Shop1 and shop1 are 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.
  • replace is for one system only. Only one system per business sends replace: true. It sets every stored branch that is not in the body to inactive, 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-Name that made it.
  • branchId and name are stored as sent. No other fields are accepted: an unknown key, in the body or in a row, is refused with 1001.

Request Details​

Method & URL​

POST /settings/update

See API Servers for the base URL to use in place of {{server}}.

Headers​

HeaderTypeRequiredDescription
x-api-keystringYesThe business's own API key
x-source-typestringYesSend Web for a system that is not a till
x-source-namestringYesThe name of the calling system. It is written to the change log
x-pos-idstringYesSend erp for a system that is not a till
x-branch-idstringYesSend erp for a system that is not a till. It is never checked on this call

Request Body​

FieldTypeRequiredDefaultDescription
locationListarrayYes0 to 500 rows. With replace: true, at least 1 row
locationList[].branchIdstringYes1 to 100 characters. No leading or trailing space, no control character, no < or >. The same value the till sends in x-branch-id
locationList[].namestringNoThe branchId, for a new row1 to 100 characters, no < or >
locationList[].statusstringNoactive, for a new rowactive or inactive
replacebooleanNofalseWhen true, every stored branch that is not in the body and is not already inactive is set to inactive. No row is removed
dryRunbooleanNofalseWhen 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 branchId is stored: the fields sent replace the stored ones. A field left out stays as stored.
  • A row whose branchId is not stored: a new branch is added, with status active and name equal to the branchId when those are left out.
  • The same branchId twice in one body is refused with 1105.

Request Example​

{
"locationList": [
{ "branchId": "1280", "name": "Main Street", "status": "active" },
{ "branchId": "1361", "status": "inactive" }
]
}

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​

FieldTypeDescription
statusstringsuccess
dryRunbooleantrue when the call was a dry run and nothing was written
club.idnumberBusiness ID
club.namestringBusiness name
activeLocationsnumberCount of active branches in locationList
locationListarrayThe whole stored list after the call, every status. On a dry run, the list the call would store
locationList[].branchIdstringBranch identifier
locationList[].namestringBranch display name
locationList[].statusstringactive or inactive
locationList[].updatedAtstringISO 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
changesarrayEvery field change of this call. Empty when nothing changed
changes[].branchIdstringThe branch that changed
changes[].fieldstringname or status
changes[].fromstring or nullThe stored value before the call. null for a new branch
changes[].tostringThe value after the call
warningsarrayEntries 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 StatusCodeDescription
400001Business not found for the given API key
400101Missing X-Api-Key header
400102Missing X-Source-Type header
400103Missing X-Source-Name header
400104Missing X-Pos-Id header
400105Missing X-Branch-Id header
4004030004Business suspended
4004030005Business inactive
4001001Unknown key in the body or in a row
4001101Invalid 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
4001102Invalid branchId
4001103Invalid name
4001104Invalid status
4001105branchId sent twice in one body
5001110The save failed. Nothing was written

The path of a validation error names the field, for example body.locationList.3.branchId.

Field Reference​

TermDescription
branchIdThe 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
nameThe display name of a branch
statusactive 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
replaceTreats the body as the whole list. Branches missing from the body are set to inactive, never removed
dryRunRuns the full check and answers as if the call were applied, with dryRun set to true in the answer. Nothing is written
changes entryOne changed field of one branch: branchId, field (name or status), the stored value from and the new value to
warnings entryA notice about the list that does not stop the call. It has a code and the branchIds it concerns
  • 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 dryRun before writing it
  • Reading the whole branch list, inactive rows included, with an empty locationList
  • Reading the active branches a till sees with /settings