import { APIResource } from "../core/resource.mjs"; import * as CheckoutIntentsAPI from "./checkout-intents/checkout-intents.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; export declare class Billing extends APIResource { /** * Cancel/void an unpaid top-up invoice. Only invoices in open state can be * cancelled. * * @example * ```ts * await client.billing.cancelTopupInvoice('invoiceId'); * ``` */ cancelTopupInvoice(invoiceID: string, options?: RequestOptions): APIPromise; /** * Request an on-demand top-up invoice.. Requires drawdown billing to be enabled. * Only one unpaid top-up invoice is allowed at a time. * * @example * ```ts * const response = await client.billing.createTopupInvoice({ * amountSubunits: 500000, * }); * ``` */ createTopupInvoice(body: BillingCreateTopupInvoiceParams, options?: RequestOptions): APIPromise; /** * Get current drawdown balance for the authenticated developer * * @example * ```ts * const response = await client.billing.getBalance(); * ``` */ getBalance(options?: RequestOptions): APIPromise; /** * List drawdown balance transactions for the authenticated developer * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const billingListTransactionsResponse of client.billing.listTransactions()) { * // ... * } * ``` */ listTransactions(query?: BillingListTransactionsParams | null | undefined, options?: RequestOptions): PagePromise; } export type BillingListTransactionsResponsesCursorPagination = CursorPagination; export interface BillingCreateTopupInvoiceResponse { id: string; amount: CheckoutIntentsAPI.Money; /** * Vendor-agnostic bank transfer details for push-based payment */ bankTransferDetails: BillingCreateTopupInvoiceResponse.BankTransferDetails; status: 'draft' | 'open' | 'paid' | 'uncollectible' | 'void' | 'unknown'; url: string | null; } export declare namespace BillingCreateTopupInvoiceResponse { /** * Vendor-agnostic bank transfer details for push-based payment */ interface BankTransferDetails { accountHolderName: string; accountNumber: string; bankName: string; routingNumber: string; } } export interface BillingGetBalanceResponse { balance: CheckoutIntentsAPI.Money; drawdownEnabled: boolean; } export interface BillingListTransactionsResponse { id: string; amount: CheckoutIntentsAPI.Money; createdAt: string; description?: string; /** * Construct a type with a set of properties K of type T */ metadata?: { [key: string]: string; }; } export interface BillingCreateTopupInvoiceParams { /** * Amount in smallest currency unit (e.g. cents). */ amountSubunits: number; /** * Override whether to automatically charge the invoice. Defaults to the * developer's drawdown config value if not specified. */ chargeAutomatically?: boolean; } export interface BillingListTransactionsParams extends CursorPaginationParams { } export declare namespace Billing { export { type BillingCreateTopupInvoiceResponse as BillingCreateTopupInvoiceResponse, type BillingGetBalanceResponse as BillingGetBalanceResponse, type BillingListTransactionsResponse as BillingListTransactionsResponse, type BillingListTransactionsResponsesCursorPagination as BillingListTransactionsResponsesCursorPagination, type BillingCreateTopupInvoiceParams as BillingCreateTopupInvoiceParams, type BillingListTransactionsParams as BillingListTransactionsParams, }; } //# sourceMappingURL=billing.d.mts.map