A credit grant is money a customer spends on their usage, applied when each month is billed. Usage past it is billed as usual. Credits pay for a month when they're in effect at its end.
Attributes
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier, starting cgrt_. |
object | string | Always credit_grant. |
livemode | boolean | true in live mode. |
customer | string | Who it's for. |
name | string | Shown with the credits on the customer's invoices. |
category | enum | paid (prepaid) or promotional. |
currency | string | usd. |
amount | integer | What it's worth, in cents. |
applicability | object | scope all (any usage in its currency), or telemetries with telemetry_ids. |
priority | integer | Which credits are spent first. |
status | enum | pending, granted, depleted, expired or voided. |
effective_at | timestamp | When it takes effect. |
expires_at | timestamp or null | What's left then expires, once that month is billed. |
voided_at | timestamp or null | When it was voided. |
created | timestamp | When it was granted. |
Example
Endpoints
| Endpoint | What it does |
|---|---|
POST /v1/billing/credit_grants | Give a customer credits for their usage. |
GET /v1/billing/credit_grants/{id} | Get a credit grant by its ID. |
POST /v1/billing/credit_grants/{id}/void | Cancel what's left: it pays for no more usage. |
GET /v1/billing/credit_grants | List your credit grants. |