Update a credit grant
POST / v1 / billing / credit_grants /:id
Updates a credit grant.
Parameters
- id string Required Unique identifier for the object.
- expires _ at timestamp The time when the billing credits created by this credit grant expire. If set to empty, the billing credits never expire.
- metadata map Set of key-value pairs you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format.
Returns
Returns the updated credit grant.
Response
{ "id": "credgr_test_61R9rpFu8SZkXPTkU41L6nFOS1ekDKoa", "object": "billing.credit_grant", "amount": { "monetary": { "currency": "usd", "value": 1000 }, "type": "monetary" }, "applicability_config": { "scope": { "price_type": "metered" } }, "category": "paid", "created": 1726688933, "customer": "cus_QsEHa3GKweMwih", "effective_at": 1726688933, "expires_at": 1759302000, "livemode": false, "metadata": { "cost_basis": "0.9" }, "name": "Purchased Credits", "priority": 50, "test_clock": null, "updated": 1726688977, "voided_at": null}
Retrieve a credit grant
GET / v1 / billing / credit_grants /:id
Retrieves a credit grant.
Parameters
- id string Required Unique identifier for the object.
Returns
Returns a credit grant.
Response
{ "id": "credgr_test_61R9a6NUWsRmOW3RM41L6nFOS1ekDGHo", "object": "billing.credit_grant", "amount": { "monetary": { "currency": "usd", "value": 1000 }, "type": "monetary" }, "applicability_config": { "scope": { "price_type": "metered" } }, "category": "paid", "created": 1726620803, "customer": "cus_QrvQguzkIK8zTj", "effective_at": 1729297860, "expires_at": null, "livemode": false, "metadata": {}, "name": "Purchased Credits", "priority": 50, "test_clock": null, "updated": 1726620803}
List credit grants
GET / v1 / billing / credit_grants
Retrieve a list of credit grants.
Parameters
- customer string Only return credit grants for this customer.
- customer _ account string Only return credit grants for this account representing the customer.
More parameters
- ending _ before string
- limit integer
- starting _ after string
Returns
Returns a list of credit grants.
Response
