Skip to main content

Get Members Reference

Endpoint​

GET /members

What this endpoint does​

Retrieves member account details for a specified Capricorn zone (zoneId).

  • When the optional sinceDateTime parameter is not supplied, the response returns the active member records currently available for the specified zone.
  • When sinceDateTime is supplied, the response returns a delta of member records (including active and inactive members) created or updated since the specified UTC date and time.

Request Headers​

In the tables below, Required indicates that Capricorn cannot process the request without that value.

HeaderTypeRequiredDescriptionConstraintsExample
client_idstringYesClient application identifier for the calling system.32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$0123456789ABCDEF0123456789ABCDEF
client_secretstringYesClient application secret for the calling system.32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$ABCDEF0123456789ABCDEF0123456789
x-captokenstringYesMandatory Capricorn authorization token for the approved request context.64-character SHA-256 hash, pattern ^[a-fA-F0-9]{64}$opaque-token
X-Correlation-IDstringNoOptional correlation value used for tracing and support.Pattern ^[0-9a-zA-Z(\-){}]+$, min length 1a0235ed0-d884-11ef-957a-005056afc7ce

Query Parameters​

ParameterTypeRequiredDescriptionConstraintsExample
sinceDateTimestring (date-time)NoOnly return member data extracted since this timestamp.Must be in ISO 8601 UTC format (YYYY-MM-DDTHH:mm:ssZ) and cannot exceed 30 days in the past from the current date.2024-03-13T08:49:53Z
supplierIdstringYesSix-digit numeric Capricorn supplier identifier.Min length 2, max length 6000000
zoneIdstringYesCapricorn zone identifier to filter the result set.Enum VIC, NSW, QLD, SA, WA, NZVIC
Approved zoneIdZone Name / Description
VICVictoria & Tasmania
NSWNew South Wales & Australian Capital Territory
QLDQueensland
SASouth Australia & Northern Territory
WAWestern Australia
NZNew Zealand

Code Examples​

important

Replace the example credentials with the values provided during onboarding. If the example includes a supplierId, use your own supplier ID associated with your x-captoken.

curl -X GET 'https://api.capricorn.example.com/members?supplierId=000000&zoneId=VIC&sinceDateTime=2024-03-13T08:49:53Z' \
-H 'client_id: 0123456789ABCDEF0123456789ABCDEF' \
-H 'client_secret: ABCDEF0123456789ABCDEF0123456789' \
-H 'x-captoken: opaque-token' \
-H 'username: api.user' \
-H 'X-Correlation-ID: a0235ed0-d884-11ef-957a-005056afc7ce'

Responses​

important

X-Correlation-ID is generated automatically if omitted and may appear as correlationId in the response body.

200 OK​

Returned when the supplier and zone match one or more member records. The body is an array of MemberDetails objects.

FieldTypeDescriptionConstraints / Example
[]arrayCollection of zone-level member results.Array of MemberDetails
[].zonestringHuman-readable zone name.Victoria & Tasmania
[].zoneIdstringZone identifier used in the request.VIC
[].extractedDateTimestring (date-time)Timestamp for the extraction batch.2024-03-13T08:49:53Z
[].accountsarray of objectsMember accounts returned in the batch.See nested account fields below.
[].accounts[].memberIdstringSix-digit numeric Capricorn member identifier.111555
[].accounts[].namestringMember name.John Doh
[].accounts[].phonestringMember phone number.08 1234 5678
[].accounts[].businessNumberstringBusiness number associated with the member account.12345678901
[].accounts[].invoiceStopDatestring (date)Invoice stop date.2002-09-23
[].accounts[].terminationDatestring (date)Termination date.2002-09-23
[].accounts[].isInvoiceStopbooleanWhether invoices are stopped.true
[].accounts[].isCreditNoteStopbooleanWhether credit notes are stopped.true
[].accounts[].isActivebooleanWhether the account is active.true
[].accounts[].addressstringStreet address or PO Box.999 Newcastle Street
[].accounts[].suburbstringSuburb or locality.Linthorpe
[].accounts[].statestringState or region.WA
[].accounts[].countrystringCountry.Australia
[].accounts[].postCodestringPostal code.6000
[].accounts[].descriptionstringIndustry class type description.MECHANICAL WORKSHOP
[].accounts[].contactstringContact name returned for the member account.ALFRED
[
{
"zone": "Victoria & Tasmania",
"zoneId": "VIC",
"extractedDateTime": "2024-03-13T08:49:53Z",
"accounts": [
{
"memberId": "111555",
"name": "John Doh",
"phone": "08 1234 5678",
"businessNumber": "12345678901",
"invoiceStopDate": "2002-09-23",
"terminationDate": "2002-09-23",
"isInvoiceStop": true,
"isCreditNoteStop": true,
"isActive": true,
"address": "999 Newcastle Street",
"suburb": "Linthorpe",
"state": "WA",
"country": "Australia",
"postCode": "6000",
"description": "MECHANICAL WORKSHOP",
"contact": "ALFRED"
}
]
}
]

400 Bad Request​

Returned when supplierId, zoneId, sinceDateTime, or header values are invalid.

FieldTypeDescriptionExample
error.typestringError category for request-shape or validation problems.CAP:BAD_REQUEST
error.descriptionstringShort summary of the failure category.Bad request
error.messagestringMessage describing what to correct before retrying.Invalid Request, Please validate the request message.
{
"error": {
"type": "CAP:BAD_REQUEST",
"description": "Bad request",
"message": "Invalid Request, Please validate the request message."
}
}

401 Unauthorized​

Returned when client_id or client_secret is missing or invalid.

FieldTypeDescriptionExample
error.typestringError category returned when authentication fails.CAP:UNAUTHORIZED
error.descriptionstringShort summary of the authentication failure.Unauthorized
error.messagestringExplains that the supplied client credentials were rejected.Client id or secret is invalid.
{
"error": {
"type": "CAP:UNAUTHORIZED",
"description": "Unauthorized",
"message": "Client id or secret is invalid."
}
}

429 Too Many Requests​

Returned when the caller exceeds the API rate limit.

FieldTypeDescriptionExample
messagestringRate-limit message returned when too many requests are sent in a short period.Too Many Requests
{
"message": "Too Many Requests"
}

500 Internal Server Error​

Returned when the API encounters an unexpected server-side failure while loading member results.

FieldTypeDescriptionExample
error.typestringError category for unexpected server-side failures.CAP:INTERNAL_SERVER_ERROR
error.descriptionstringShort summary of the server-side error.Internal server error
error.messagestringAdvises the client to retry later.API encountered an unexpected error. Please retry later.
{
"error": {
"type": "CAP:INTERNAL_SERVER_ERROR",
"description": "Internal server error",
"message": "API encountered an unexpected error. Please retry later."
}
}

503 Service Unavailable​

Returned when a backend dependency is unavailable or times out while loading members.

Response headers

HeaderTypeDescription
Retry-AfterstringOptional delay, in seconds, that the client should wait before retrying the request.

Response Body

FieldTypeDescriptionExample
error.typestringError category for temporary downstream or platform outages.CAP:SERVICE_UNAVAILABLE
error.descriptionstringShort summary of the availability issue.Service unavailable
error.messagestringIndicates the API timed out or could not reach a backend service.A timeout occurred while processing the request.
{
"error": {
"type": "CAP:SERVICE_UNAVAILABLE",
"description": "Service unavailable",
"message": "A timeout occurred while processing the request."
}
}