POST
/
credits
curl --request POST \
  --url https://api.togai.com/credits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "creditRequests": [
    {
      "accountId": "ACC001",
      "purpose": "Prepaid Credit",
      "effectiveFrom": "2023-02-04",
      "effectiveUntil": "2024-02-04",
      "creditAmount": 1000,
      "priority": 1
    }
  ]
}'
[
  {
    "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"
  },
  {
    "id": "creds.1znQ46jiIXw.r24fc",
    "customerId": "7VcRw9xZDIqsC5E",
    "accountId": "ACC001",
    "purpose": "Prepaid Credit",
    "effectiveFrom": "2020-08-04",
    "effectiveUntil": "2021-08-04",
    "status": "ACTIVE",
    "creditAmount": 1000,
    "creditUnit": "USD",
    "holdAmount": 500,
    "consumedAmount": 400,
    "priority": 1,
    "createdAt": "2020-08-04T12:00:00.000Z"
  }
]

Authorizations

Authorization
string
headerrequired

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

Body

application/json
creditRequests
object[]
required

Response

200 - application/json
credits
object[]
required