A credit balance transaction is a resource representing a transaction (either a credit or a debit) against an existing credit grant.
Attributes
- idstring
Unique identifier for the object.
- objectstring
String representing the object’s type. Objects of the same type share the same value.
- createdtimestamp
Time at which the object was created. Measured in seconds since the Unix epoch.
- creditnullable object
Credit details for this credit balance transaction. Only present if type is
credit. - credit_
grantstringExpandable The credit grant associated with this credit balance transaction.
- debitnullable object
Debit details for this credit balance transaction. Only present if type is
debit. - effective_
attimestamp The effective time of this credit balance transaction.
- livemodeboolean
Has the value
trueif the object exists in live mode or the valuefalseif the object exists in test mode. - test_
clocknullable stringExpandable ID of the test clock this credit balance transaction belongs to.
- typenullable enum
The type of credit balance transaction (credit or debit).
Possible enum valuescreditA credit transaction.
debitA debit transaction.
{ "id": "cbtxn_test_61R9ZljjaFmdidb6e41L6nFOS1ekD9Ue", "object": "billing.credit_balance_transaction", "created": 1726619524, "credit": null, "credit_grant": "credgr_test_61R9ZkIkIzLSp0xze41L6nFOS1ekDTPE", "debit": { "amount": { "monetary": { "currency": "usd", "value": 1000 }, "type": "monetary" }, "credits_applied": { "invoice": "in_1Q0BoLL6nFOS1ekDbwBM5ER1", "invoice_line_item": "il_1QB443L6nFOS1ekDwRiN3Z4n" }, "type": "credits_applied" }, "effective_at": 1729211351, "livemode": false, "test_clock": "clock_1Q0BoJL6nFOS1ekDbyYYuseM", "type": "debit"}Retrieves a credit balance transaction.
Parameters
- idstringRequired
Unique identifier for the object.
Returns
Returns a credit balance transaction.
{ "id": "cbtxn_test_61R9ZljjaFmdidb6e41L6nFOS1ekD9Ue", "object": "billing.credit_balance_transaction", "created": 1726619524, "credit": null, "credit_grant": "credgr_test_61R9ZkIkIzLSp0xze41L6nFOS1ekDTPE", "debit": { "amount": { "monetary": { "currency": "usd", "value": 1000 }, "type": "monetary" }, "credits_applied": { "invoice": "in_1Q0BoLL6nFOS1ekDbwBM5ER1", "invoice_line_item": "il_1QB443L6nFOS1ekDwRiN3Z4n" }, "type": "credits_applied" }, "effective_at": 1729211351, "livemode": false, "test_clock": "clock_1Q0BoJL6nFOS1ekDbyYYuseM", "type": "debit"}Retrieve a list of credit balance transactions.
Parameters
- customerstring
The customer for which to fetch credit balance transactions.
- credit_
grantstring The credit grant for which to fetch credit balance transactions.
- customer_
accountstringPreview feature The account for which to fetch credit balance transactions.
More parameters
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
Returns a list of credit balanace transactions.
{ "object": "list", "data": [ { "id": "cbtxn_test_61R9ZljjaFmdidb6e41L6nFOS1ekD9Ue", "object": "billing.credit_balance_transaction", "created": 1726619524, "credit": null, "credit_grant": "credgr_test_61R9ZkIkIzLSp0xze41L6nFOS1ekDTPE", "debit": { "amount": { "monetary": { "currency": "usd", "value": 1000 }, "type": "monetary" }, "credits_applied": { "invoice": "in_1Q0BoLL6nFOS1ekDbwBM5ER1", "invoice_line_item": "il_1QB443L6nFOS1ekDwRiN3Z4n" }, "type": "credits_applied" }, "effective_at": 1729211351, "livemode": false, "test_clock": "clock_1Q0BoJL6nFOS1ekDbyYYuseM", "type": "debit" }, { "id": "cbtxn_test_61R9ZkIbb17ze4b2s41L6nFOS1ekDXHs", "object": "billing.credit_balance_transaction", "created": 1726619434, "credit": { "amount": { "monetary": { "currency": "usd", "value": 1000 }, "type": "monetary" }, "type": "credits_granted" }, "credit_grant": "credgr_test_61R9ZkIkIzLSp0xze41L6nFOS1ekDTPE", "debit": null, "effective_at": 1726619434, "livemode": false, "test_clock": "clock_1Q0BoJL6nFOS1ekDbyYYuseM", "type": "credit" } ], "has_more": false, "url": "/v1/billing/credit_grants"}