Read Account

The ReadAccount API in OCS.io allows for retrieving details of an account using the account’s reference ID or external ID. This API is particularly useful when you need to fetch account information for display or processing purposes.

API Overview

Parameters Required for Reading Account

The following table lists and describes the parameters required to read an account through the ReadAccount API:

Parameter Description

refId

Ref ID of the Account.

externalId

External ID of the Account.

billCycleHistory

Indicates whether reads also Bill Cycle History belonging to the Account.

stateHistory

Indicates whether reads also State History belonging to the Account.

subscribers

Indicates whether reads also Subscribers belonging to the Account.

subordinates

Indicates whether reads also Sub-ordinate Accounts belonging to the Account.

offers

Indicates whether reads also Subscriptions belonging to the Account.

Detailed API documentation and endpoint specifics are available here.

Request Validations

The following validations are performed when reading an Account:

  • Account must exist in the system.

Read Account Example

Here is a cURL example for the ReadAccount API:

curl -X GET 'https://api.ocs.io/v1/casm/accounts/read?refId=<account_ref_id>&billCycleHistory=true&stateHistory=true&subscribers=true&subordinates=true&offers=true'

The outcome of the API call is as follows:

  • The account with Ref ID <account_ref_id> is retrieved.

  • If billCycleHistory is set to true, the bill cycle history of the account is included.

  • If stateHistory is set to true, the state history of the account is included.

  • If subscribers is set to true, the subscribers belonging to the account are included.

  • If subordinates is set to true, the sub-ordinate accounts belonging to the account are included.

  • If offers is set to true, the subscriptions belonging to the account are included.