// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import * as FundsAPI from './funds'; import { FundRetrieveHistoryResponse, Funds } from './funds'; import * as PaymentMethodsAPI from './payment-methods'; import { PaymentMethodRetrieveCurrentResponse, PaymentMethodSetupResponse, PaymentMethodUpdateDefaultParams, PaymentMethodUpdateDefaultResponse, PaymentMethods, } from './payment-methods'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; export class Billing extends APIResource { funds: FundsAPI.Funds = new FundsAPI.Funds(this._client); paymentMethods: PaymentMethodsAPI.PaymentMethods = new PaymentMethodsAPI.PaymentMethods(this._client); /** * Load credits into the brand's account balance. Credits are used to pay for * campaign activities and influencer partnerships. Requires a valid payment method * to be configured. * * @example * ```ts * const response = await client.billing.loadCredits({ * amount: 10000, * }); * ``` */ loadCredits( body: BillingLoadCreditsParams, options?: RequestOptions, ): APIPromise { return this._client.post('/billing/credits', { body, ...options }); } } /** * Response schema for loading credits into a brand's account */ export interface BillingLoadCreditsResponse { /** * Payment intent ID */ id: string; /** * Credits amount in smallest currency unit (e.g., cents) */ amount: number; } export interface BillingLoadCreditsParams { /** * The amount of credits to load in the smallest currency unit (e.g., cents). Must * be at least $10. */ amount: number; } Billing.Funds = Funds; Billing.PaymentMethods = PaymentMethods; export declare namespace Billing { export { type BillingLoadCreditsResponse as BillingLoadCreditsResponse, type BillingLoadCreditsParams as BillingLoadCreditsParams, }; export { Funds as Funds, type FundRetrieveHistoryResponse as FundRetrieveHistoryResponse }; export { PaymentMethods as PaymentMethods, type PaymentMethodRetrieveCurrentResponse as PaymentMethodRetrieveCurrentResponse, type PaymentMethodSetupResponse as PaymentMethodSetupResponse, type PaymentMethodUpdateDefaultResponse as PaymentMethodUpdateDefaultResponse, type PaymentMethodUpdateDefaultParams as PaymentMethodUpdateDefaultParams, }; }