Skip to main content

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}

important

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.

HeaderTypeRequiredDescriptionConstraintsExample
client_idstringYesMandatory client credential that identifies the calling application.32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$0123456789ABCDEF0123456789ABCDEF
client_secretstringYesMandatory client credential secret for the calling application.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

URI Parameters​

This supplier-facing reference follows the approved Direct Integration material for memberId.

ParameterTypeRequiredDescriptionConstraintsExample
memberIdstringYesSix-digit numeric Capricorn member identifier.Six-digit numeric Capricorn member identifier.111555
important

If a Member ID contains fewer than six digits, include leading zeros when constructing the request. Examples: 001234, 000321, 088776, 000077

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/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'

Responses​

important

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.

FieldTypeReturnedDescriptionConstraints / Example
memberIdstringAlwaysSix-digit numeric Capricorn member identifier.111555
namestringConditionalMember account name.John Doe Motors
phonestringConditionalMember account phone number.08 1234 5678
businessNumberstringConditionalBusiness number for the member trading account.12345678901
invoiceStopDatestring (date)ConditionalInvoice stop date for the account, when returned.2002-09-23
terminationDatestring (date)ConditionalTermination date for the account, when returned.2002-09-23
isInvoiceStopbooleanAlwaysFalse- Invoice can be posted to the account.
True- Invoice can not be posted to the account.
true
isCreditNoteStopbooleanAlwaysFalse- Credit Note can be posted to the account.
True- Credit Note can not be posted to the account.
true
onStopDescriptionstringConditionalAdditional stop explanation supplied for the account. Returned when Capricorn provides extra stop detail.Capricorn Credit Terms/conditions
isActivebooleanAlwaysTrue- Account is active.
False – Account is inactive and cannot trade.
true
addressesarray of objectsConditionalAddresses attached to the member account.See nested address fields below.
addresses[].addressTypestringConditionalAddress type returned by Capricorn. The approved supplier reference describes these as Physical (Shipping) and Postal (Billing).Physical
addresses[].addressstringConditionalStreet address or PO Box.999 Newcastle Street
addresses[].suburbstringConditionalSuburb or locality.Linthorpe
addresses[].statestringConditionalState or region.WA
addresses[].countrystringConditionalCountry.Australia
addresses[].postCodestringConditionalPostal code.6000
contactsarray of objectsConditionalContacts captured for the member account.See nested contact fields below.
contacts[].firstNamestringConditionalContact first name.ALFRED
contacts[].lastNamestringConditionalContact last name.CAMERON
contacts[].emailAddressstringConditionalContact email address.abc@abc.com
contacts[].mobilePhonestringConditionalContact mobile phone number.03 5447 4771
contacts[].isPrimaryContactbooleanConditionalIndicates 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​

  • isActive tells you whether the member account is active. If it is false, the account is inactive and cannot trade.
  • isInvoiceStop tells you whether invoice transactions are stopped for that account and therefore cannot be posted.
  • isCreditNoteStop tells you whether credit note transactions are stopped for that account and therefore cannot be posted.
  • invoiceStopDate, terminationDate, and onStopDescription provide 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.

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."
}
}

404 Not Found​

Returned when the supplied memberId does not map to an account record.

FieldTypeDescriptionExample
error.typestringError category returned when the requested record is not available.CAP:NOT_FOUND
error.descriptionstringShort summary of the missing-resource condition.Not found / CAP's resource not found
error.messagestringMessage 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.

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 reading the account record.

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 resolving the account.

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."
}
}