GET
/
credits
/
{credit_id}
curl --request GET \
  --url https://api.togai.com/credits/{credit_id} \
  --header 'Authorization: Bearer <token>'
{
  "accountId": "ACC001",
  "purpose": "PREPAID_CREDIT",
  "applicableEntityIds": [
    [
      "umg.1znQx9jiIXw.r44fc",
      "ALL_USAGE_METER_RATE_CARDS",
      "ALL_FIXED_FEE_RATE_CARDS"
    ]
  ],
  "effectiveFrom": "2020-07-04",
  "effectiveUntil": "2021-07-04",
  "creditAmount": 1000,
  "priority": 1,
  "grantorId": "<string>",
  "idempotencyKey": "<string>",
  "id": "cred.1znqBOVcai0.0tBFz",
  "customerId": "7VcRw9xZDIqsC5E",
  "status": "ACTIVE",
  "creditUnit": "USD",
  "holdAmount": 500,
  "consumedAmount": 400,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "transactions": [
    {
      "id": "<string>",
      "creditId": "<string>",
      "transactionType": "CREDITED",
      "invoiceId": "<string>",
      "entityId": "<string>",
      "amount": 200,
      "createdAt": "2023-11-07T05:31:56Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

credit_id
string
required
Example:

"creds.1znQx9jiIXw.r44fc"

Response

200
application/json
Response for Fetch Credit Details request. This contains Credit Transactions

Payload to grant Credits

accountId
string
required
Example:

"ACC001"

purpose
string
required
Example:

"PREPAID_CREDIT"

effectiveFrom
string
required
Example:

"2020-07-04"

priority
integer
required
Example:

1

id
string
required

Identifier of credits

Maximum length: 50
Example:

"cred.1znqBOVcai0.0tBFz"

customerId
string
required
Example:

"7VcRw9xZDIqsC5E"

status
enum<string>
required
Available options:
ACTIVE,
CONSUMED,
EXPIRED,
VOIDED
Example:

"ACTIVE"

createdAt
string
required
transactions
object[]
required
applicableEntityIds
string[]

List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards

effectiveUntil
string
Example:

"2021-07-04"

creditAmount
number
Example:

1000

grantorId
string

The entity through which the credit has been granted

idempotencyKey
string

The idempotency key for uniqueness of the credit record

creditUnit
string
Example:

"USD"

holdAmount
number
Example:

500

consumedAmount
number
Example:

400

updatedAt
string