Get Members Reference
Endpoint
GET /members
What this endpoint does
Retrieves member account details for a specified Capricorn zone (zoneId).
- When the optional
sinceDateTimeparameter is not supplied, the response returns the active member records currently available for the specified zone. - When
sinceDateTimeis 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.
| Header | Type | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
client_id | string | Yes | Client application identifier for the calling system. | 32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$ | 0123456789ABCDEF0123456789ABCDEF |
client_secret | string | Yes | Client application secret for the calling system. | 32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$ | ABCDEF0123456789ABCDEF0123456789 |
x-captoken | string | Yes | Mandatory Capricorn authorization token for the approved request context. | 64-character SHA-256 hash, pattern ^[a-fA-F0-9]{64}$ | opaque-token |
X-Correlation-ID | string | No | Optional correlation value used for tracing and support. | Pattern ^[0-9a-zA-Z(\-){}]+$, min length 1 | a0235ed0-d884-11ef-957a-005056afc7ce |
Query Parameters
| Parameter | Type | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
sinceDateTime | string (date-time) | No | Only 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 |
supplierId | string | Yes | Six-digit numeric Capricorn supplier identifier. | Min length 2, max length 6 | 000000 |
zoneId | string | Yes | Capricorn zone identifier to filter the result set. | Enum VIC, NSW, QLD, SA, WA, NZ | VIC |
Approved zoneId | Zone Name / Description |
|---|---|
VIC | Victoria & Tasmania |
NSW | New South Wales & Australian Capital Territory |
QLD | Queensland |
SA | South Australia & Northern Territory |
WA | Western Australia |
NZ | New Zealand |
Code Examples
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
- HTTP
- JavaScript
- Python
- C
- Java
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'
GET /members?supplierId=000000&zoneId=VIC&sinceDateTime=2024-03-13T08:49:53Z HTTP/1.1
Host: api.capricorn.example.com
client_id: 0123456789ABCDEF0123456789ABCDEF
client_secret: ABCDEF0123456789ABCDEF0123456789
x-captoken: opaque-token
username: api.user
X-Correlation-ID: a0235ed0-d884-11ef-957a-005056afc7ce
const response = await fetch('https://api.capricorn.example.com/members?supplierId=000000&zoneId=VIC&sinceDateTime=2024-03-13T08:49:53Z', {
method: 'GET',
headers: {
'client_id': '0123456789ABCDEF0123456789ABCDEF',
'client_secret': 'ABCDEF0123456789ABCDEF0123456789',
'x-captoken': 'opaque-token',
'username': 'api.user',
'X-Correlation-ID': 'a0235ed0-d884-11ef-957a-005056afc7ce',
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.request(
'GET',
'https://api.capricorn.example.com/members?supplierId=000000&zoneId=VIC&sinceDateTime=2024-03-13T08:49:53Z',
headers={
'client_id': '0123456789ABCDEF0123456789ABCDEF',
'client_secret': 'ABCDEF0123456789ABCDEF0123456789',
'x-captoken': 'opaque-token',
'username': 'api.user',
'X-Correlation-ID': 'a0235ed0-d884-11ef-957a-005056afc7ce',
},
)
print(response.status_code)
print(response.json())
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
struct curl_slist *headers = NULL;
if (!curl) return 1;
curl_easy_setopt(curl, CURLOPT_URL, "https://api.capricorn.example.com/members?supplierId=000000&zoneId=VIC&sinceDateTime=2024-03-13T08:49:53Z");
headers = curl_slist_append(headers, "client_id: 0123456789ABCDEF0123456789ABCDEF");
headers = curl_slist_append(headers, "client_secret: ABCDEF0123456789ABCDEF0123456789");
headers = curl_slist_append(headers, "x-captoken: opaque-token");
headers = curl_slist_append(headers, "username: api.user");
headers = curl_slist_append(headers, "X-Correlation-ID: a0235ed0-d884-11ef-957a-005056afc7ce");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return 0;
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create("https://api.capricorn.example.com/members?supplierId=000000&zoneId=VIC&sinceDateTime=2024-03-13T08:49:53Z"))
.header("client_id", "0123456789ABCDEF0123456789ABCDEF")
.header("client_secret", "ABCDEF0123456789ABCDEF0123456789")
.header("x-captoken", "opaque-token")
.header("username", "api.user")
.header("X-Correlation-ID", "a0235ed0-d884-11ef-957a-005056afc7ce")
.GET();
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
Responses
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.
| Field | Type | Description | Constraints / Example |
|---|---|---|---|
[] | array | Collection of zone-level member results. | Array of MemberDetails |
[].zone | string | Human-readable zone name. | Victoria & Tasmania |
[].zoneId | string | Zone identifier used in the request. | VIC |
[].extractedDateTime | string (date-time) | Timestamp for the extraction batch. | 2024-03-13T08:49:53Z |
[].accounts | array of objects | Member accounts returned in the batch. | See nested account fields below. |
[].accounts[].memberId | string | Six-digit numeric Capricorn member identifier. | 111555 |
[].accounts[].name | string | Member name. | John Doh |
[].accounts[].phone | string | Member phone number. | 08 1234 5678 |
[].accounts[].businessNumber | string | Business number associated with the member account. | 12345678901 |
[].accounts[].invoiceStopDate | string (date) | Invoice stop date. | 2002-09-23 |
[].accounts[].terminationDate | string (date) | Termination date. | 2002-09-23 |
[].accounts[].isInvoiceStop | boolean | Whether invoices are stopped. | true |
[].accounts[].isCreditNoteStop | boolean | Whether credit notes are stopped. | true |
[].accounts[].isActive | boolean | Whether the account is active. | true |
[].accounts[].address | string | Street address or PO Box. | 999 Newcastle Street |
[].accounts[].suburb | string | Suburb or locality. | Linthorpe |
[].accounts[].state | string | State or region. | WA |
[].accounts[].country | string | Country. | Australia |
[].accounts[].postCode | string | Postal code. | 6000 |
[].accounts[].description | string | Industry class type description. | MECHANICAL WORKSHOP |
[].accounts[].contact | string | Contact 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.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category for request-shape or validation problems. | CAP:BAD_REQUEST |
error.description | string | Short summary of the failure category. | Bad request |
error.message | string | Message 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.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category returned when authentication fails. | CAP:UNAUTHORIZED |
error.description | string | Short summary of the authentication failure. | Unauthorized |
error.message | string | Explains 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.
| Field | Type | Description | Example |
|---|---|---|---|
message | string | Rate-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.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category for unexpected server-side failures. | CAP:INTERNAL_SERVER_ERROR |
error.description | string | Short summary of the server-side error. | Internal server error |
error.message | string | Advises 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
| Header | Type | Description |
|---|---|---|
Retry-After | string | Optional delay, in seconds, that the client should wait before retrying the request. |
Response Body
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category for temporary downstream or platform outages. | CAP:SERVICE_UNAVAILABLE |
error.description | string | Short summary of the availability issue. | Service unavailable |
error.message | string | Indicates 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."
}
}