Liste les subventions de crédit pour un client dans le cadre d’un droit au crédit spécifique
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const balanceListGrantsResponse of client.creditEntitlements.balances.listGrants(
'customer_id',
{ credit_entitlement_id: 'credit_entitlement_id' },
)) {
console.log(balanceListGrantsResponse.id);
}{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"credit_entitlement_id": "<string>",
"customer_id": "<string>",
"id": "<string>",
"initial_amount": "<string>",
"is_expired": true,
"is_rolled_over": true,
"remaining_amount": "<string>",
"rollover_count": 123,
"source_type": "subscription",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"metadata": {},
"parent_grant_id": "<string>",
"source_id": "<string>"
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Credit Entitlement ID
Customer ID
Page size default is 10 max is 100
x >= 0Page number default is 0
x >= 0Filter by grant status: active, expired, depleted
active, expired, depleted List of customer grants
Show child attributes
Cette page vous a-t-elle été utile ?
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const balanceListGrantsResponse of client.creditEntitlements.balances.listGrants(
'customer_id',
{ credit_entitlement_id: 'credit_entitlement_id' },
)) {
console.log(balanceListGrantsResponse.id);
}{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"credit_entitlement_id": "<string>",
"customer_id": "<string>",
"id": "<string>",
"initial_amount": "<string>",
"is_expired": true,
"is_rolled_over": true,
"remaining_amount": "<string>",
"rollover_count": 123,
"source_type": "subscription",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"metadata": {},
"parent_grant_id": "<string>",
"source_id": "<string>"
}
]
}