Zum Hauptinhalt springen
GET
/
credit-entitlements
/
{credit_entitlement_id}
/
balances
/
{customer_id}
JavaScript
import DodoPayments from 'dodopayments';

const client = new DodoPayments({
  bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});

const customerCreditBalance = await client.creditEntitlements.balances.retrieve('customer_id', {
  credit_entitlement_id: 'credit_entitlement_id',
});

console.log(customerCreditBalance.id);
{
  "balance": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "credit_entitlement_id": "<string>",
  "customer_id": "<string>",
  "id": "<string>",
  "overage": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "last_transaction_at": "2023-11-07T05:31:56Z"
}

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

credit_entitlement_id
string
erforderlich

Credit Entitlement ID

customer_id
string
erforderlich

Customer ID

Antwort

Customer balance details

Response for a customer's credit balance

balance
string
erforderlich
created_at
string<date-time>
erforderlich
credit_entitlement_id
string
erforderlich
customer_id
string
erforderlich
id
string
erforderlich
overage
string
erforderlich
updated_at
string<date-time>
erforderlich
last_transaction_at
string<date-time> | null