Retrieve a credit grant

Retrieves a credit grant.

Parameters

  • idstringRequired

    Unique identifier for the object.

Returns

Returns a credit grant.

curl https://api.stripe.com/v1/billing/credit_grants/credgr_test_61R9a6NUWsRmOW3RM41L6nFOS1ekDGHo \
-u "sk_test_CGGvfNi...iDwaOfZ3oX6Ysk_test_CGGvfNiIPwLXiDwaOfZ3oX6Y:"
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": "",
"effective_at": 1729297860,
"expires_at": null,
"livemode": false,
"metadata": {},
"name": "Purchased Credits",
"priority": 50,
"test_clock": null,
"updated": 1726620803
}

List credit grants

Retrieve a list of credit grants.

Parameters

  • customerstring

    Only return credit grants for this customer.

  • customer_accountstring

    Only return credit grants for this account representing the customer.

More parameters

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

Returns a list of credit grants.

curl https://api.stripe.com/v1/billing/credit_grants \
-u "sk_test_CGGvfNi...iDwaOfZ3oX6Ysk_test_CGGvfNiIPwLXiDwaOfZ3oX6Y:"
Response
{
"object": "list",
"data": [
{
"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": "",
"effective_at": 1729297860,
"expires_at": null,
"livemode": false,
"metadata": {},
"name": "Purchased Credits",
"priority": 50,
"test_clock": null,
"updated": 1726620803,
"voided_at": null
}
],
"has_more": false,
"url": "/v1/billing/credit_grants"
}

Expire a credit grant

Expires a credit grant.

Parameters

  • idstringRequired

    Unique identifier for the object.

Returns

Returns the expired credit grant.

curl -X POST https://api.stripe.com/v1/billing/credit_grants/credgr_test_61R9rm9vto9SMMvt041L6nFOS1ekDCim/expire \
-u "sk_test_CGGvfNi...iDwaOfZ3oX6Ysk_test_CGGvfNiIPwLXiDwaOfZ3oX6Y:"
Response
{
"id": "credgr_test_61R9rm9vto9SMMvt041L6nFOS1ekDCim",
"object": "billing.credit_grant",
"amount": {
"monetary": {
"currency": "usd",
"value": 1000
},
"type": "monetary"
},
"applicability_config": {
"scope": {
"price_type": "metered"
}
},
"category": "paid",
"created": 1726688741,
"customer": "",
"effective_at": 1726688741,
"expires_at": 1726688796,
"livemode": false,
"metadata": {},
"name": "Purchased Credits",
"priority": 50,
"test_clock": null,
"updated": 1726688796,
"voided_at": null
}