Get Accounts Reference
Endpoint
GET /accounts/{memberId}
What this endpoint does
Retrieves real-time trade account information for a single Capricorn member identified by memberId. The response includes trading status, trading restriction indicators, address details, and contact information.
The request URI contains the memberId for the member account being retrieved. GET /accounts/{memberId}
Although the supplier-facing navigation label is Get Accounts, the API returns details for a single member account per request.
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 | Mandatory client credential that identifies the calling application. | 32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$ | 0123456789ABCDEF0123456789ABCDEF |
client_secret | string | Yes | Mandatory client credential secret for the calling application. | 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 |
URI Parameters
This supplier-facing reference follows the approved Direct Integration material for memberId.
| Parameter | Type | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
memberId | string | Yes | Six-digit numeric Capricorn member identifier. | Six-digit numeric Capricorn member identifier. | 111555 |
If a Member ID contains fewer than six digits, include leading zeros when constructing the request. Examples: 001234, 000321, 088776, 000077
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/accounts/111555' \
-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 /accounts/111555 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/accounts/111555', {
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/accounts/111555',
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/accounts/111555");
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/accounts/111555"))
.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 requested member account exists and can be returned to the caller.
The supplier reference treats this as a response structure. The trading-status fields used for the recommended pre-check are identified explicitly below. A field marked Conditional should only be relied on when Capricorn returns it for the relevant account state.
This supplier-facing page prioritises the approved response fields from the reference material.
| Field | Type | Returned | Description | Constraints / Example |
|---|---|---|---|---|
memberId | string | Always | Six-digit numeric Capricorn member identifier. | 111555 |
name | string | Conditional | Member account name. | John Doe Motors |
phone | string | Conditional | Member account phone number. | 08 1234 5678 |
businessNumber | string | Conditional | Business number for the member trading account. | 12345678901 |
invoiceStopDate | string (date) | Conditional | Invoice stop date for the account, when returned. | 2002-09-23 |
terminationDate | string (date) | Conditional | Termination date for the account, when returned. | 2002-09-23 |
isInvoiceStop | boolean | Always | False- Invoice can be posted to the account.True- Invoice can not be posted to the account. | true |
isCreditNoteStop | boolean | Always | False- Credit Note can be posted to the account.True- Credit Note can not be posted to the account. | true |
onStopDescription | string | Conditional | Additional stop explanation supplied for the account. Returned when Capricorn provides extra stop detail. | Capricorn Credit Terms/conditions |
isActive | boolean | Always | True- Account is active.False – Account is inactive and cannot trade. | true |
addresses | array of objects | Conditional | Addresses attached to the member account. | See nested address fields below. |
addresses[].addressType | string | Conditional | Address type returned by Capricorn. The approved supplier reference describes these as Physical (Shipping) and Postal (Billing). | Physical |
addresses[].address | string | Conditional | Street address or PO Box. | 999 Newcastle Street |
addresses[].suburb | string | Conditional | Suburb or locality. | Linthorpe |
addresses[].state | string | Conditional | State or region. | WA |
addresses[].country | string | Conditional | Country. | Australia |
addresses[].postCode | string | Conditional | Postal code. | 6000 |
contacts | array of objects | Conditional | Contacts captured for the member account. | See nested contact fields below. |
contacts[].firstName | string | Conditional | Contact first name. | ALFRED |
contacts[].lastName | string | Conditional | Contact last name. | CAMERON |
contacts[].emailAddress | string | Conditional | Contact email address. | abc@abc.com |
contacts[].mobilePhone | string | Conditional | Contact mobile phone number. | 03 5447 4771 |
contacts[].isPrimaryContact | boolean | Conditional | Indicates the primary contact for the account, when returned. | true |
Legacy note: older responses may also include additional fields such as description. Treat those as supplementary context rather than as part of the approved supplier-facing trading-status check.
{
"memberId": "111555",
"name": "John Doe Motors",
"phone": "08 1234 5678",
"businessNumber": "12345678901",
"invoiceStopDate": "2002-09-23",
"terminationDate": "2002-09-23",
"isInvoiceStop": true,
"isCreditNoteStop": true,
"onStopDescription": "Capricorn Credit Terms/conditions",
"isActive": true,
"addresses": [
{
"addressType": "Physical",
"address": "999 Newcastle Street",
"suburb": "Linthorpe",
"state": "WA",
"country": "Australia",
"postCode": "6000"
}
],
"contacts": [
{
"firstName": "ALFRED",
"lastName": "CAMERON",
"emailAddress": "abc@abc.com",
"mobilePhone": "03 5447 4771",
"isPrimaryContact": true
}
]
}
Trading-status fields to check before transacting
isActivetells you whether the member account is active. If it isfalse, the account is inactive and cannot trade.isInvoiceStoptells you whether invoice transactions are stopped for that account and therefore cannot be posted.isCreditNoteStoptells you whether credit note transactions are stopped for that account and therefore cannot be posted.invoiceStopDate,terminationDate, andonStopDescriptionprovide extra context when a restriction applies.
400 Bad Request
Returned when memberId does not satisfy the documented constraints or when a header value is malformed.
| 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."
}
}
404 Not Found
Returned when the supplied memberId does not map to an account record.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category returned when the requested record is not available. | CAP:NOT_FOUND |
error.description | string | Short summary of the missing-resource condition. | Not found / CAP's resource not found |
error.message | string | Message published in the asset for the not-found case. | The specified account could not be located. |
{
"error": {
"type": "CAP:NOT_FOUND",
"description": "Not found / CAP's resource not found",
"message": "The specified account could not be located."
}
}
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 reading the account record.
| 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 resolving the account.
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."
}
}