Create customer entitlement grant
Grants define a behavior of granting usage for a metered entitlement. They can have complicated recurrence and rollover rules, thanks to which you can define a wide range of access patterns with a single grant, in most cases you don't have to periodically create new grants. You can only issue grants for active metered entitlements.
A grant defines a given amount of usage that can be consumed for the entitlement. The grant is in effect between its effective date and its expiration date. Specifying both is mandatory for new grants.
Grants have a priority setting that determines their order of use. Lower numbers have higher priority, with 0 being the highest priority.
Grants can have a recurrence setting intended to automate the manual reissuing of grants. For example, a daily recurrence is equal to reissuing that same grant every day (ignoring rollover settings).
Rollover settings define what happens to the remaining balance of a grant at a reset. Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))
Grants cannot be changed once created, only deleted. This is to ensure that balance is deterministic regardless of when it is queried.
Path parameters
Request body
Example request
{
"amount": 100,
"priority": 1,
"effectiveAt": "2023-01-01T01:01:01.001Z",
"minRolloverAmount": 100,
"metadata": {
"externalId": "019142cc-a016-796a-8113-1a942fecd26d"
},
"recurrence": {
"interval": "DAY",
"anchor": "2023-01-01T01:01:01.001Z"
},
"maxRolloverAmount": 100,
"expiration": {
"count": 12
},
"annotations": {
"externalId": "019142cc-a016-796a-8113-1a942fecd26d"
}
}Response
The request has succeeded and a new resource has been created as a result.
Example response
{
"createdAt": "2024-01-01T01:01:01.001Z",
"updatedAt": "2024-01-01T01:01:01.001Z",
"deletedAt": "2024-01-01T01:01:01.001Z",
"amount": 100,
"priority": 1,
"effectiveAt": "2023-01-01T01:01:01.001Z",
"minRolloverAmount": 100,
"metadata": {
"externalId": "019142cc-a016-796a-8113-1a942fecd26d"
},
"maxRolloverAmount": 100,
"expiration": {
"count": 12
},
"annotations": {
"externalId": "019142cc-a016-796a-8113-1a942fecd26d"
},
"id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"entitlementId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"nextRecurrence": "2023-01-01T01:01:01.001Z",
"expiresAt": "2023-01-01T01:01:01.001Z",
"voidedAt": "2023-01-01T01:01:01.001Z",
"recurrence": {
"interval": "DAY",
"intervalISO": "P1D",
"anchor": "2023-01-01T01:01:01.001Z"
}
}