Entitlements
Update a feature credits entry
This API let's you to update the following attributes: effectiveUntil
and granted
- effectiveUntil: must be in future
- granted: must be greater than the existing usage (previous granted - current balance)
PATCH
/
accounts
/
{account_id}
/
features
/
{feature_id}
/
entries
/
{entry_id}
curl --request PATCH \
--url https://api.togai.com/accounts/{account_id}/features/{feature_id}/entries/{entry_id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"effectiveUntil": "2023-02-23T14:25:10Z",
"granted": 200
}'
{
"id": "purchase.20rvWRxQcQK.0ZwPG$1",
"source": "PURCHASE",
"accountId": "acc.fdjsl.313",
"featureId": "feat.fdjsl.313",
"granted": 15,
"balance": 10,
"overageLimit": 20,
"usedOverage": 15
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
account_id
string
requiredaccount_id corresponding to an account
feature_id
string
requiredfeature_id corresponding to a feature
entry_id
string
requiredentryId
corresponding to a particular entitlement/overage grant entry
Formats:
- If source of entry is an entitlement grant rate card in price plan:
schedule_id#pricing_cycle_start_date$PRICE_PLAN
- If source of entry is an entitlement overage rate card in price plan:
schedule_id#pricing_cycle_start_date$OVERAGE
- If source of entry is a purchase:
purchase_id#int_index$PURCHASE
Body
application/json
effectiveUntil
string
Expiry date-time for a feature credits entry
granted
number
Granted units for a feature credits entry
Response
200 - application/json
id
string
requiredsource
enum<string>
requiredSource of the feature credit
Available options:
ENTITLEMENT
, PRICE_PLAN
, OVERAGE
, REFUND
status
enum<string>
requiredStatus of the feature credit entry
Available options:
ACTIVE
, EXPIRED
, VOIDED
effectiveFrom
string
requiredeffectiveUntil
string
requiredgranted
number
balance
number
used
number
requiredcurl --request PATCH \
--url https://api.togai.com/accounts/{account_id}/features/{feature_id}/entries/{entry_id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"effectiveUntil": "2023-02-23T14:25:10Z",
"granted": 200
}'
{
"id": "purchase.20rvWRxQcQK.0ZwPG$1",
"source": "PURCHASE",
"accountId": "acc.fdjsl.313",
"featureId": "feat.fdjsl.313",
"granted": 15,
"balance": 10,
"overageLimit": 20,
"usedOverage": 15
}