메인 콘텐츠로 건너뛰기
GET
/
credit-entitlements
/
{credit_entitlement_id}
/
balances
/
{customer_id}
/
ledger
JavaScript
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 creditLedgerEntry of client.creditEntitlements.balances.listLedger('customer_id', {
  credit_entitlement_id: 'credit_entitlement_id',
})) {
  console.log(creditLedgerEntry.id);
}
{
  "items": [
    {
      "amount": "<string>",
      "balance_after": "<string>",
      "balance_before": "<string>",
      "business_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "credit_entitlement_id": "<string>",
      "customer_id": "<string>",
      "id": "<string>",
      "is_credit": true,
      "overage_after": "<string>",
      "overage_before": "<string>",
      "transaction_type": "credit_added",
      "description": "<string>",
      "grant_id": "<string>",
      "reference_id": "<string>",
      "reference_type": "<string>"
    }
  ]
}

인증

Authorization
string
header
필수

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

경로 매개변수

credit_entitlement_id
string
필수

Credit Entitlement ID

customer_id
string
필수

Customer ID

쿼리 매개변수

page_size
integer<int32>

Page size default is 10 max is 100

필수 범위: x >= 0
page_number
integer<int32>

Page number default is 0

필수 범위: x >= 0
transaction_type
string

Filter by transaction type (snake_case: credit_added, credit_deducted, credit_expired, etc.)

start_date
string<date-time>

Filter by start date

end_date
string<date-time>

Filter by end date

응답

List of ledger entries

items
object[]
필수