GET
/
credits
curl --request GET \
  --url https://api.togai.com/credits \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "creds.1znQx9jiIXw.r44fc",
      "customerId": "7VcRw9xZDIqsC5E",
      "accountId": "ACC001",
      "purpose": "Prepaid Credit",
      "effectiveFrom": "2020-07-04",
      "effectiveUntil": "2021-07-04",
      "status": "ACTIVE",
      "creditAmount": 1000,
      "creditUnit": "USD",
      "holdAmount": 500,
      "consumedAmount": 400,
      "priority": 1,
      "createdAt": "2020-07-04T12:00:00.000Z"
    }
  ],
  "nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

nextToken
string

Pagination token used as a marker to get records from next page.

Example:

"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="

status
string

Filter option to filter by status.

account_id
string

Filter option to filter based on account id.

Example:

"1234"

id
string

Filter option to filter based on credit id.

Example:

"cred.1znpoFlsI3U.zmg85"

pageSize
integer

Maximum page size expected by client to return the record list.

NOTE: Max page size cannot be more than 50. Also 50 is the default page size if no value is provided.

Example:

10

Response

200
application/json
Response for Get invoice requests

List credits response

data
object[]
required

Payload to grant Credits

nextToken
string
Maximum length: 500
Example:

"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ=="