import { type Client } from '../core.js'; import { type Result, type RequestOptions } from '../lib/types.js'; import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js'; /** * Create customer * * POST /openmeter/customers */ export declare function createCustomer(client: Client, req: CreateCustomerRequest, options?: RequestOptions): Promise>; /** * Get customer * * GET /openmeter/customers/{customerId} */ export declare function getCustomer(client: Client, req: GetCustomerRequest, options?: RequestOptions): Promise>; /** * List customers * * GET /openmeter/customers */ export declare function listCustomers(client: Client, req?: ListCustomersRequest, options?: RequestOptions): Promise>; /** * Upsert customer * * PUT /openmeter/customers/{customerId} */ export declare function upsertCustomer(client: Client, req: UpsertCustomerRequest, options?: RequestOptions): Promise>; /** * Delete customer * * DELETE /openmeter/customers/{customerId} */ export declare function deleteCustomer(client: Client, req: DeleteCustomerRequest, options?: RequestOptions): Promise>; /** * Get customer billing data * * GET /openmeter/customers/{customerId}/billing */ export declare function getCustomerBilling(client: Client, req: GetCustomerBillingRequest, options?: RequestOptions): Promise>; /** * Update customer billing data * * PUT /openmeter/customers/{customerId}/billing */ export declare function updateCustomerBilling(client: Client, req: UpdateCustomerBillingRequest, options?: RequestOptions): Promise>; /** * Update customer billing app data * * PUT /openmeter/customers/{customerId}/billing/app-data */ export declare function updateCustomerBillingAppData(client: Client, req: UpdateCustomerBillingAppDataRequest, options?: RequestOptions): Promise>; /** * Create Stripe Checkout Session * * Create a [Stripe Checkout Session](https://docs.stripe.com/payments/checkout) * for the customer. * * Creates a Checkout Session for collecting payment method information from * customers. The session operates in "setup" mode, which collects payment details * without charging the customer immediately. The collected payment method can be * used for future subscription billing. * * For hosted checkout sessions, redirect customers to the returned URL. For * embedded sessions, use the client_secret to initialize Stripe.js in your * application. * * POST /openmeter/customers/{customerId}/billing/stripe/checkout-sessions */ export declare function createCustomerStripeCheckoutSession(client: Client, req: CreateCustomerStripeCheckoutSessionRequest, options?: RequestOptions): Promise>; /** * Create Stripe customer portal session * * Create Stripe Customer Portal Session. * * Useful to redirect the customer to the Stripe Customer Portal to manage their * payment methods, change their billing address and access their invoice history. * Only returns URL if the customer billing profile is linked to a stripe app and * customer. * * POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions */ export declare function createCustomerStripePortalSession(client: Client, req: CreateCustomerStripePortalSessionRequest, options?: RequestOptions): Promise>; /** * Create customer entitlement * * Create an entitlement for the customer. * * A customer can have only one active entitlement per feature. The feature must be * compatible with the entitlement type. Entitlements cannot be modified after * creation, only deleted. * * POST /openmeter/customers/{customerId}/entitlements */ export declare function createCustomerEntitlement(client: Client, req: CreateCustomerEntitlementRequest, options?: RequestOptions): Promise>; /** * Override customer entitlement * * Override an entitlement of the customer with a new one. * * The referenced entitlement ends and the new one starts at the same instant, so * access continues without a gap. Both must belong to the same feature. Use this * for upgrades and downgrades. * * Fails if the referenced entitlement does not exist, is deleted, or is no longer * active. * * PUT /openmeter/customers/{customerId}/entitlements/{entitlementId}/override */ export declare function overrideCustomerEntitlement(client: Client, req: OverrideCustomerEntitlementRequest, options?: RequestOptions): Promise>; /** * Get customer entitlement history * * Get the balance and usage history of a metered entitlement. The queried range * may span multiple usage periods. * * `windowed_history` groups usage into windows of the requested size and reports * the balance at the start of each window. `burndown_history` lists the periods in * which grants were consumed in a fixed order, together with the usage taken from * each grant. * * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history */ export declare function getCustomerEntitlementHistory(client: Client, req: GetCustomerEntitlementHistoryRequest, options?: RequestOptions): Promise>; /** * Get customer entitlement * * Get an entitlement of the customer by ID. For checking entitlement access, use * the entitlement access endpoints instead. * * GET /openmeter/customers/{customerId}/entitlements/{entitlementId} */ export declare function getCustomerEntitlement(client: Client, req: GetCustomerEntitlementRequest, options?: RequestOptions): Promise>; /** * List customer entitlements * * List the entitlements of the customer that are active at the time of the * request. For checking entitlement access, use the entitlement access endpoints * instead. * * GET /openmeter/customers/{customerId}/entitlements */ export declare function listCustomerEntitlements(client: Client, req: ListCustomerEntitlementsRequest, options?: RequestOptions): Promise>; /** * Reset customer entitlement usage * * Reset the usage of a metered entitlement. The reset starts a new usage period: * usage is zeroed and grants roll over according to their rollover settings. * * Usage is reset automatically at the end of each usage period. Use this operation * to reset it earlier, for example to align the entitlement with the customer's * billing period. The usage period anchor can be moved at the same time. * * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset */ export declare function resetCustomerEntitlementUsage(client: Client, req: ResetCustomerEntitlementUsageRequest, options?: RequestOptions): Promise>; /** * Delete customer entitlement * * Deletes the entitlement and revokes access to its feature. A customer can hold * only one active entitlement per feature, so migrating a feature requires * deleting the previous entitlement first. * * Deletion sets the `deleted_at` timestamp instead of removing history. Access and * status queries for earlier points in time still treat the entitlement as active, * so access changes are never retroactive. * * DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId} */ export declare function deleteCustomerEntitlement(client: Client, req: DeleteCustomerEntitlementRequest, options?: RequestOptions): Promise>; /** * Create customer entitlement grant * * Issue a grant for a metered entitlement of the customer. Boolean and static * entitlements cannot have grants, so the request is rejected for them. * * Grants are immutable. The amount is added to the balance from `effective_at`, * which cannot be earlier than the start of the current usage period. * * POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants */ export declare function createCustomerEntitlementGrant(client: Client, req: CreateCustomerEntitlementGrantRequest, options?: RequestOptions): Promise>; /** * List customer entitlement grants * * List the grants issued for an entitlement of the customer. Grants only exist for * metered entitlements, so the list is empty for boolean and static entitlements. * * Deleted grants are excluded unless `include_deleted` is set. Voided and expired * grants are always included, as they are part of the balance history. * * GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants */ export declare function listCustomerEntitlementGrants(client: Client, req: ListCustomerEntitlementGrantsRequest, options?: RequestOptions): Promise>; /** * Create a new credit grant * * Create a new credit grant. A credit grant represents an allocation of prepaid * credits to a customer. * * POST /openmeter/customers/{customerId}/credits/grants */ export declare function createCreditGrant(client: Client, req: CreateCreditGrantRequest, options?: RequestOptions): Promise>; /** * Get a credit grant * * Get a credit grant. * * GET /openmeter/customers/{customerId}/credits/grants/{creditGrantId} */ export declare function getCreditGrant(client: Client, req: GetCreditGrantRequest, options?: RequestOptions): Promise>; /** * List credit grants * * List credit grants. * * GET /openmeter/customers/{customerId}/credits/grants */ export declare function listCreditGrants(client: Client, req: ListCreditGrantsRequest, options?: RequestOptions): Promise>; /** * Get a customer's credit balance * * Get a credit balance. * * GET /openmeter/customers/{customerId}/credits/balance */ export declare function getCustomerCreditBalance(client: Client, req: GetCustomerCreditBalanceRequest, options?: RequestOptions): Promise>; /** * Create a credit adjustment * * A credit adjustment can be used to make manual adjustments to a customer's * credit balance. * * Supported use-cases: * * - Usage correction * * POST /openmeter/customers/{customerId}/credits/adjustments */ export declare function createCreditAdjustment(client: Client, req: CreateCreditAdjustmentRequest, options?: RequestOptions): Promise>; /** * Void credit grant * * Void a credit grant, forfeiting the remaining unused balance. * * Voiding is a forward-looking, irreversible operation. Credits already consumed * by usage remain unaffected — only the remaining balance is forfeited. The grant * reads as `voided` status afterwards. Payment state is not adjusted when * `payment_adjustment` is `none`, so invoice-backed or externally collected * payments may still collect the original amount. Only `active` grants can be * voided; voiding a pending, expired, or fully consumed grant returns a conflict. * Retrying a successful void is an idempotent success. * * POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void */ export declare function voidCreditGrant(client: Client, req: VoidCreditGrantRequest, options?: RequestOptions): Promise>; /** * Update credit grant external settlement status * * Update the payment settlement status of an externally funded credit grant. * * Use this endpoint to synchronize the payment state of an external payment with * the system so that revenue recognition and credit availability work as expected. * * POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/settlement/external */ export declare function updateCreditGrantExternalSettlement(client: Client, req: UpdateCreditGrantExternalSettlementRequest, options?: RequestOptions): Promise>; /** * List credit transactions * * List credit transactions for a customer. * * Returns an immutable, chronological record of credit movements: funded credits * and consumed credits. Transactions are returned in reverse chronological order * by default. * * GET /openmeter/customers/{customerId}/credits/transactions */ export declare function listCreditTransactions(client: Client, req: ListCreditTransactionsRequest, options?: RequestOptions): Promise>; /** * List customer charges * * List customer charges. * * Returns the customer's charges that are represented as either flat fee or * usage-based charges. * * GET /openmeter/customers/{customerId}/charges */ export declare function listCustomerCharges(client: Client, req: ListCustomerChargesRequest, options?: RequestOptions): Promise>; /** * Create customer charge * * Create customer charge. * * POST /openmeter/customers/{customerId}/charges */ export declare function createCustomerCharges(client: Client, req: CreateCustomerChargesRequest, options?: RequestOptions): Promise>;