OpenMeter Entitlements
Create customer entitlement grant
Changed onIssue a grant for a metered entitlement of the customer. Boolean and static entitlements cannot have grants, so the request is rejected for them.
Grants are immutable. The amount is added to the balance from effective_at, which cannot be earlier than the start of the current usage period.
post/openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
Request
- Base URL: http://localhost:8888/api/v3
- URL: http://localhost:8888/api/v3/openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
- Auth: none declared
Path parameters
customerIdstring required
ULID (Universally Unique Lexicographically Sortable Identifier).
Example:01G65Z755AFWAKHE12NY0CQ9FH
entitlementIdstring required
ULID (Universally Unique Lexicographically Sortable Identifier).
Example:01G65Z755AFWAKHE12NY0CQ9FH
Request body
Example request
{
"priority": 1,
"effective_at": "2023-01-01T01:01:01.001Z",
"expires_after": "P1Y",
"labels": {
"env": "test"
},
"recurrence": {
"interval": "P1Y",
"anchor": "2023-01-01T01:01:01.001Z"
}
}Response
EntitlementGrant created response.
Example response
{
"id": "01G65Z755AFWAKHE12NY0CQ9FH",
"entitlement_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
"priority": 1,
"effective_at": "2023-01-01T01:01:01.001Z",
"expires_after": "P1Y",
"expires_at": "2023-01-01T01:01:01.001Z",
"recurrence": {
"anchor": "2023-01-01T01:01:01.001Z",
"interval": "P1Y"
},
"next_recurrence": "2023-01-01T01:01:01.001Z",
"voided_at": "2023-01-01T01:01:01.001Z",
"labels": {
"env": "test"
},
"created_at": "2023-01-01T01:01:01.001Z",
"updated_at": "2023-01-01T01:01:01.001Z",
"deleted_at": "2023-01-01T01:01:01.001Z"
}Changes
- ○
added the optional property
to the response with the status
- ○
- ○
endpoint added
- ○