サブスクリプションのクレジット使用状況を取得します。
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const response = await client.subscriptions.retrieveCreditUsage('subscription_id');
console.log(response.subscription_id);{
"items": [
{
"balance": "250.00",
"credit_entitlement_id": "<string>",
"credit_entitlement_name": "<string>",
"limit_reached": true,
"overage": "15.50",
"overage_enabled": true,
"unit": "<string>",
"overage_limit": "100.00",
"remaining_headroom": "84.50"
}
],
"subscription_id": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Subscription ID
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const response = await client.subscriptions.retrieveCreditUsage('subscription_id');
console.log(response.subscription_id);{
"items": [
{
"balance": "250.00",
"credit_entitlement_id": "<string>",
"credit_entitlement_name": "<string>",
"limit_reached": true,
"overage": "15.50",
"overage_enabled": true,
"unit": "<string>",
"overage_limit": "100.00",
"remaining_headroom": "84.50"
}
],
"subscription_id": "<string>"
}