Read Customer
The ReadCustomer
API in OCS.io allows for retrieving details of a customer using the customer’s reference ID or external ID. This API is particularly useful when you need to fetch customer information for display or processing purposes.
API Overview
Parameters Required for Reading Customer
The following table lists and describes the parameters required to read a customer through the ReadCustomer
API:
Parameter | Description |
---|---|
refId |
Ref ID of the Customer. |
externalId |
External ID of the Customer. |
stateHistory |
Indicates whether reads also State History belonging to the Customer. |
accounts |
Indicates whether reads also Accounts belonging to the Customer. |
offers |
Indicates whether reads also Subscriptions belonging to the Customer. |
Detailed API documentation and endpoint specifics are available here. |
Request Validations
The following validations are performed when reading a Customer:
-
Customer must exist in the system.
Read Customer Example
Here is a cURL example for the ReadCustomer
API:
curl -X GET 'https://api.ocs.io/v1/casm/customers/read?refId=<customer_ref_id>&stateHistory=true&accounts=true&offers=true'
The outcome of the API call is as follows:
-
The customer with Ref ID
<customer_ref_id>
is retrieved. -
If
stateHistory
is set totrue
, the state history of the customer is included. -
If
accounts
is set totrue
, the accounts belonging to the customer are included. -
If
offers
is set totrue
, the subscriptions belonging to the customer are included.