Update next IDs for site

PUT /api/configuration/system/sites/{id}/next-ids

Overview

Sets the identifier counters for one site. These counters are how the platform allocates the next member number, booking id, sale invoice id and so on: when a record is created, the counter is incremented and the record gets the value it held beforehand. The numbers live in configuration, which is why they are editable at all, and why editing them is dangerous.

Treat this endpoint as a repair tool, not part of a normal integration.

Setting a counter backwards re-issues numbers that are already in use. The next record created will be given an identifier that an existing record already has, so you should expect failed record creation — members, invoices and so on — and, for references that are not required to be unique, two records sharing one number. There is no validation against the highest identifier already issued; the value you send is saved as-is. Only ever move a counter forwards unless you have verified that nothing occupies the range you are moving into. Gaps are harmless: a reserved identifier that is not used is simply skipped.

This is a full replacement of all 23 counters, not a partial update. Every field is written on every call from the value in the body, and there is no "leave this one alone". All 23 are required integers, so an omitted field cannot be distinguished from a deliberate 0 — and 0 would reset that counter. Read the current values with GET /api/configuration/system/sites/{id}/next-ids, change only what you mean to change, and send all 23 back.

Site-specific identifiers must be switched on. If the system configuration Database_EnableSiteSpecificIDs is not 1, the request is rejected with 400 Site specific ids is not enabled — and note that when it is 0 identifiers are allocated from the counters held against site HO whatever the site, so per-site counters would have no effect anyway.

The site must already have counter records; a site with none returns 404. The 23 writes are saved together, so the call is all-or-nothing.

On success the response is 204 No Content.

Endpoint

PUT {base_url}/api/configuration/system/sites/{id}/next-ids

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
idstringYesThe site whose counters you are setting. It must already have counter records — if none are found the request fails with 404 System configuration with the site id {id} could not be found. Note that when site-specific identifiers are disabled the platform allocates from the HO site's counters regardless of the site a record belongs to.

Request body

FieldTypeRequiredDescription
nextAccompaniedAttendanceinteger (int32)YesCounter keyed NextAccompaniedAttendance — the next number issued for accompanied attendance records at this site. Between 0 and 2100000000.
nextBookingIDinteger (int32)YesCounter keyed NextBookingID — the next identifier issued to a booking created at this site. Lowering it risks collisions with existing bookings. Between 0 and 2100000000.
nextBookingRefinteger (int32)YesCounter keyed NextBookingRef — the next booking reference issued at this site. Distinct from nextBookingID: a reference is the customer-facing number, an id is the booking's identifier. Between 0 and 2100000000.
nextCancellationRefinteger (int32)YesCounter keyed NextCancellationRef — the next cancellation reference issued at this site. Between 0 and 2100000000.
nextCorrespondenceIDinteger (int32)YesCounter keyed NextCorrespondenceID — the next identifier issued to a correspondence record at this site. Between 0 and 2100000000.
nextDirectDebitDateinteger (int32)YesCounter keyed NextDirectDebitDate. Despite the name it is an integer counter like the rest, not a date, and is validated on the same 0–2100000000 range. Between 0 and 2100000000.
nextEFTRunIDinteger (int32)YesCounter keyed NextEFTRunID — the next identifier issued to an electronic funds transfer run at this site. Between 0 and 2100000000.
nextEFTTransactionIDinteger (int32)YesCounter keyed NextEFTTransactionID — the next identifier issued to a transaction within an electronic funds transfer run. Between 0 and 2100000000.
nextEventLogIDinteger (int32)YesCounter keyed NextEventLogID — the next identifier issued to an event log record at this site. Between 0 and 2100000000.
nextInvoiceIDinteger (int32)YesCounter keyed NextInvoiceID — the next invoice identifier issued at this site. Note that sale invoices use nextSalesInvoiceID, not this counter. Between 0 and 2100000000.
nextMailIDinteger (int32)YesCounter keyed NextMailID — the next identifier issued to a mail record at this site. Between 0 and 2100000000.
nextMemberActionIDinteger (int32)YesCounter keyed NextMemberActionID — the next identifier issued to a member action record at this site. Between 0 and 2100000000.
nextMemberIDinteger (int32)YesCounter keyed NextMemberID — the number given to the next member created at this site. Member creation uses this value as the new member's id and login id. Lowering it makes member creation attempt ids that already exist. Between 0 and 2100000000.
nextOnlineAuthIDinteger (int32)YesCounter keyed NextOnlineAuthID — the next identifier issued to an online authorisation record at this site. Between 0 and 2100000000.
nextProductReferenceIdinteger (int32)YesCounter keyed NextProductReferenceId — the next product reference issued at this site. Between 0 and 2100000000.
nextSalesInvoiceIDinteger (int32)YesCounter keyed NextSalesInvoiceID — the next sale invoice identifier at this site. Sale invoice ids are allocated from this counter whenever invoices are raised — by invoicing, payments, bookings and memberships alike — so lowering it causes duplicate invoice ids across all of those. Gaps are expected and harmless, because a reserved id is abandoned if the operation fails. Between 0 and 2100000000.
nextSalesReceiptIDinteger (int32)YesCounter keyed NextSalesReceiptID — the next sale receipt identifier at this site. Like nextSalesInvoiceID, receipt ids are allocated from this counter, so lowering it causes duplicate receipt ids. Between 0 and 2100000000.
nextSubscriptionRefinteger (int32)YesCounter keyed NextSubscriptionRef — the next membership subscription reference issued at this site. Between 0 and 2100000000.
nextTerminalReadingIdinteger (int32)YesCounter keyed NextTerminalReadingId — the next identifier issued to a terminal reading at this site. Between 0 and 2100000000.
nextUserReadingIdinteger (int32)YesCounter keyed NextUserReadingId — the next identifier issued to a user reading at this site. Between 0 and 2100000000.
nextWaitinglistRefinteger (int32)YesCounter keyed NextWaitinglistRef — the next waiting list reference issued at this site. Between 0 and 2100000000.
nextXReadingIdinteger (int32)YesCounter keyed NextXReadingId — the next identifier issued to an X reading at this site. Between 0 and 2100000000.
nextZReadingIdinteger (int32)YesCounter keyed NextZReadingId — the next identifier issued to a Z reading at this site. Between 0 and 2100000000.

Sample request

cURL
curl -X PUT '{base_url}/api/configuration/system/sites/{id}/next-ids' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "nextAccompaniedAttendance": 1,
  "nextBookingID": 12345,
  "nextBookingRef": 1,
  "nextCancellationRef": 1,
  "nextCorrespondenceID": 12345,
  "nextDirectDebitDate": 1,
  "nextEFTRunID": 12345,
  "nextEFTTransactionID": 12345,
  "nextEventLogID": 12345,
  "nextInvoiceID": 12345,
  "nextMailID": 12345,
  "nextMemberActionID": 12345,
  "nextMemberID": 12345,
  "nextOnlineAuthID": 12345,
  "nextProductReferenceId": 12345,
  "nextSalesInvoiceID": 12345,
  "nextSalesReceiptID": 12345,
  "nextSubscriptionRef": 1,
  "nextTerminalReadingId": 12345,
  "nextUserReadingId": 12345,
  "nextWaitinglistRef": 1,
  "nextXReadingId": 12345,
  "nextZReadingId": 12345
}'

Errors

StatusMeaningWhen
400Bad requestSite-specific identifiers are switched off — body is the string Site specific ids is not enabled. This is checked first, before the site is looked up.
400Bad requestValidation failed: a value is missing, negative, or above 2100000000. The body is a validation problem document keyed by field name.
404Not foundThe site has no counter records — System configuration with the site id {id} could not be found.
422Unprocessable entityOne of the 23 counters does not exist for this site, so it cannot be set (Could not find {counterName}). The response body is empty, so you cannot tell which counter is missing from the response alone.
500Internal server errorThe save failed, or any other unexpected server-side failure. No detail is returned.

This page as markdown · All pages · llms.txt