type ClientOptions = { baseUrl: 'https://staging-api.revkeen.com/v2' | 'https://api.revkeen.com/v2' | 'https://mock-api.revkeen.com/v2' | (string & {}); }; type Webhooks = WebhooksPaymentSucceededWebhookRequest | WebhooksPaymentFailedWebhookRequest | WebhooksInvoiceCreatedWebhookRequest | WebhooksInvoicePaidWebhookRequest | WebhooksInvoiceOverdueWebhookRequest | WebhooksSubscriptionCreatedWebhookRequest | WebhooksSubscriptionActivatedWebhookRequest | WebhooksSubscriptionCanceledWebhookRequest | WebhooksSubscriptionRenewedWebhookRequest | WebhooksCustomerCreatedWebhookRequest | WebhooksCustomerUpdatedWebhookRequest | WebhooksRefundCreatedWebhookRequest | WebhooksRefundSucceededWebhookRequest | WebhooksVoidCreatedWebhookRequest | WebhooksVoidSucceededWebhookRequest | WebhooksVoidFailedWebhookRequest | WebhooksCreditNoteCreatedWebhookRequest | WebhooksCreditNoteIssuedWebhookRequest | WebhooksCreditNoteVoidedWebhookRequest | WebhooksCheckoutSessionCompletedWebhookRequest | WebhooksCheckoutSessionExpiredWebhookRequest | WebhooksOrderCreatedWebhookRequest | WebhooksOrderPaidWebhookRequest | WebhooksTerminalPaymentRequestedWebhookRequest | WebhooksTerminalPaymentSucceededWebhookRequest | WebhooksTerminalPaymentDeclinedWebhookRequest | WebhooksTerminalPaymentCancelledWebhookRequest | WebhooksTerminalPaymentErrorWebhookRequest | WebhooksTerminalRefundSucceededWebhookRequest | WebhooksTerminalVoidSucceededWebhookRequest | WebhooksOrderFulfilledWebhookRequest | WebhooksUsageThresholdReachedWebhookRequest | WebhooksUsagePeriodFinalizedWebhookRequest | WebhooksUsageInvoiceCreatedWebhookRequest | WebhooksUsageEventIngestedWebhookRequest | WebhooksUsageEventRejectedWebhookRequest | WebhooksMeterCreatedWebhookRequest | WebhooksMeterUpdatedWebhookRequest | WebhooksMeterArchivedWebhookRequest | WebhooksMeterPriceCreatedWebhookRequest | WebhooksMeterPriceUpdatedWebhookRequest | WebhooksMeterPriceDeactivatedWebhookRequest | WebhooksMandateCreatedWebhookRequest | WebhooksMandateActivatedWebhookRequest | WebhooksMandateAuddisRejectedWebhookRequest | WebhooksMandateSuspendedWebhookRequest | WebhooksMandateCancelledWebhookRequest | WebhooksCollectionScheduledWebhookRequest | WebhooksCollectionNoticeSentWebhookRequest | WebhooksCollectionSucceededWebhookRequest | WebhooksCollectionFailedWebhookRequest | WebhooksCollectionIndemnityClaimedWebhookRequest | WebhooksSettlementCreatedWebhookRequest; /** * The envelope for all webhook event deliveries. Contains the event type, timestamp, and the affected object in the data field. */ type WebhookEvent = { /** * Unique event identifier */ id: string; /** * Event type using dot notation (e.g., `payment.succeeded`) */ type: string; /** * Unix timestamp when the event was created */ created: number; /** * Whether this event occurred in live mode */ livemode?: boolean; /** * Event payload containing the affected object */ data: { /** * The object that triggered the event (e.g., Payment, Invoice, Subscription) */ object?: { [key: string]: unknown; }; /** * Previous values of attributes that changed (for update events) */ previous_attributes?: { [key: string]: unknown; }; }; }; /** * Subscription billing terms for recurring invoices */ type SubscriptionTerms = { /** * How to collect payment for recurring invoices */ collection_method: 'charge_automatically' | 'send_invoice'; /** * When the subscription billing cycle starts */ start_mode: 'when_paid' | 'on_invoice_date' | 'first_of_next_month' | 'specific_date'; /** * Start date (ISO 8601) — required when start_mode is 'specific_date' */ start_date?: string; /** * How the subscription duration is determined */ duration_type: 'until_cancelled' | 'fixed_cycles' | 'end_date'; /** * Number of billing cycles — required when duration_type is 'fixed_cycles' */ duration_count?: number; /** * End date (ISO 8601) — required when duration_type is 'end_date' */ end_date?: string; /** * Whether to charge the first cycle immediately or defer to the start date */ first_payment_behavior: 'charge_first_cycle_now' | 'defer_first_cycle_to_start_date'; }; /** * A list of invoices matching the query filters. */ type InvoiceListResponse = { data: Array; requestId: string; }; /** * The canonical record of what a customer owes or has paid. Invoices track line items, amounts, and payment status through their lifecycle: draft → open → finalized → paid. */ type Invoice = { /** * Unique invoice identifier */ id: string; /** * ID of the customer this invoice belongs to */ customer_uuid: string; /** * Merchant-assigned invoice number for reference */ invoice_number?: string; /** * Total amount in minor units (cents) */ total_minor: number; /** * Three-letter ISO 4217 currency code */ currency: string; /** * Allowed payment methods for checkout sessions against this invoice */ allowed_methods?: Array | null; /** * Invoice lifecycle status: draft, open, finalized, paid, void, or uncollectible */ status: string; /** * Payment due date in ISO 8601 format */ due_date?: string | null; /** * Key-value pairs for custom fields */ custom_fields?: { [key: string]: unknown; }; /** * External integration source (e.g., practicehub, wodify) */ external_source?: string | null; /** * Type within external system (e.g., appointment, membership) */ external_type?: string | null; /** * ID from external system */ external_id?: string | null; /** * Subscription billing terms for recurring invoices */ subscription_terms?: { /** * How to collect payment for recurring invoices */ collection_method: 'charge_automatically' | 'send_invoice'; /** * When the subscription billing cycle starts */ start_mode: 'when_paid' | 'on_invoice_date' | 'first_of_next_month' | 'specific_date'; /** * Start date (ISO 8601) — required when start_mode is 'specific_date' */ start_date?: string; /** * How the subscription duration is determined */ duration_type: 'until_cancelled' | 'fixed_cycles' | 'end_date'; /** * Number of billing cycles — required when duration_type is 'fixed_cycles' */ duration_count?: number; /** * End date (ISO 8601) — required when duration_type is 'end_date' */ end_date?: string; /** * Whether to charge the first cycle immediately or defer to the start date */ first_payment_behavior: 'charge_first_cycle_now' | 'defer_first_cycle_to_start_date'; } | null; /** * When the invoice was created (ISO 8601) */ created_at: string; /** * When the invoice was last updated (ISO 8601) */ updated_at: string; }; /** * A single invoice object with request tracking metadata. */ type InvoiceResponse = { data: Invoice; requestId: string; }; /** * Generic success confirmation for operations that do not return a resource. */ type SuccessResponse = { success: boolean; }; type MarkDeliveredResponse = { success: boolean; marked_delivered: number; /** * Count of invoices that would match the default overdue ladder (day 1+) at the next hourly reminder cron. With anchor = NOW() on mark, this is typically 0 — the first reminder fires tomorrow. */ reminder_eligible_now: number; /** * Count of invoices that will receive at least one reminder within 7 days of this attestation, assuming the default ladder [1, 7, 14, 30]. */ reminder_eligible_within_7_days: number; skipped: Array<{ invoice_id: string; reason: string; }>; requestId: string; }; /** * A list of invoice comments with extended author details. */ type InvoiceCommentListDetailResponse = { data: Array; requestId: string; }; /** * An invoice comment with extended author details including name, email, and avatar. */ type InvoiceCommentDetail = { id: string; invoiceId: string; userId: string | null; content: string; isInternal: boolean; createdAt: string; updatedAt: string | null; }; /** * A single invoice comment with extended author details. */ type InvoiceCommentDetailResponse = { data: InvoiceCommentDetail; requestId: string; }; /** * Response from an external system upsert, indicating whether the invoice was created or updated along with any warnings. */ type ExternalUpsertResponse = { data: Invoice; created: boolean; warnings?: Array; requestId: string; }; /** * Returned when an external upsert is skipped because the incoming timestamp is older than the stored version. */ type StaleUpdateResponse = { ignored: true; reason: 'stale_update'; stored_timestamp: string; incoming_timestamp: string; requestId: string; }; /** * Returned when an external upsert is skipped because the substantive content hash matched the stored row — no DB write performed. */ type UnchangedContentResponse = { ignored: true; reason: 'unchanged_content'; content_hash: string; requestId: string; }; /** * Shows whether an invoice is eligible for a credit note and the maximum amount that can be credited. */ type CreditEligibilityResponse = { data: { /** * Whether a credit note can be issued for this invoice */ can_credit: boolean; /** * Maximum amount that can be credited in minor units */ max_creditable_minor: number; /** * Total amount already credited against this invoice */ total_credited_minor: number; /** * Original invoice total in minor units */ invoice_total_minor: number; /** * Reason why the invoice cannot be credited, if applicable */ reason?: string; }; requestId: string; }; /** * A list of credit notes matching the query filters. */ type CreditNoteListResponse = { data: Array; requestId: string; }; /** * A formal accounting document that reduces the amount owed on a paid or partially paid invoice, used for refunds, billing corrections, and prorated cancellations. */ type CreditNote = { /** * Unique credit note identifier */ id: string; /** * Sequential credit note number for accounting reference */ credit_note_number: string | null; /** * ID of the invoice this credit note applies to */ invoice_id: string; /** * ID of the customer who received the credit */ customer_id: string | null; /** * Credit amount in minor units (cents) */ amount_minor: number; /** * Tax portion of the credit in minor units */ tax_amount_minor: number | null; /** * Three-letter ISO 4217 currency code */ currency: string; /** * Credit note status: draft, issued, or void */ status: string; /** * Human-readable reason for the credit */ reason: string | null; /** * Machine-readable reason code (e.g., billing_error, customer_request) */ reason_code: string | null; /** * How the credit is applied: refund_to_payment_method, customer_balance, or external */ credit_method: string | null; /** * URL to the credit note PDF document */ pdf_url: string | null; /** * When the credit note was issued (ISO 8601) */ issued_at: string | null; /** * When the credit note was created (ISO 8601) */ created_at: string; /** * When the credit note was last updated (ISO 8601) */ updated_at: string; }; /** * A single credit note with request tracking metadata. */ type CreditNoteResponse = { data: CreditNote; requestId: string; }; /** * Returned when request parameters or body fail schema validation. The details.fields object maps each invalid parameter to its validation errors. */ type ValidationError = { error: { type: 'invalid_request_error'; code: 'validation_error'; message: string; param?: string; details?: { /** * Field-specific validation errors */ fields?: { [key: string]: Array; }; }; request_id?: string; }; }; /** * Returned when the API key is missing, invalid, or expired. Verify your x-api-key header contains a valid key. */ type AuthenticationError = { error: { type: 'authentication_error'; code: 'authentication_failed' | 'invalid_api_key' | 'expired_api_key'; message: string; request_id?: string; }; }; /** * Returned when the authenticated API key lacks the required scopes for the requested operation. */ type ForbiddenError = { error: { type: 'authentication_error'; code: 'insufficient_permissions' | 'forbidden'; message: string; request_id?: string; }; }; /** * Returned when the requested resource does not exist or does not belong to this merchant. */ type NotFoundError = { error: { type: 'invalid_request_error'; code: 'resource_not_found'; message: string; param?: string; request_id?: string; }; }; /** * A paginated list of products matching the query filters. */ type ProductListResponse = { data: Array; pagination: Pagination; }; /** * A product defines what you sell — the name, billing type, price, and fulfillment method. Products can be one-time, recurring (subscription), or usage-based. */ type Product = { /** * Unique identifier (UUID) */ id: string; /** * Object type */ object: 'product'; /** * User-facing product identifier */ product_id: string; /** * Product display name */ name: string; /** * Product description */ description?: string | null; /** * Product kind */ kind: 'subscription' | 'one_time' | 'usage'; /** * How the product is priced */ pricing_model: 'one_time' | 'recurring' | 'usage'; /** * Price in minor units (cents/pence) */ amount_minor: number | null; /** * Three-letter ISO currency code */ currency: string; /** * Billing interval (day, week, month, year) */ interval?: string | null; /** * Number of intervals between billings */ interval_count?: number | null; /** * Free trial period in days */ trial_days: number; /** * Fulfillment type */ fulfillment_type: 'none' | 'digital' | 'physical'; /** * Whether a finite purchase cap is enforced */ track_inventory?: boolean; /** * Remaining purchasable units (null when not tracked) */ stock_quantity?: number | null; /** * Billing date calculation rule */ billing_anchor_rule?: 'same_day' | 'day_of_month' | 'last_day' | null; /** * Day of month for billing (1-31) */ billing_anchor_day?: number | null; /** * First payment timing */ first_charge_behavior?: 'immediate' | 'next_anchor' | 'prorate' | null; /** * Subscription end behavior */ end_behavior?: 'until_canceled' | 'fixed_payments' | null; /** * Max billing cycles for fixed-payment subscriptions */ max_payments?: number | null; /** * Associated usage meter ID */ usage_meter_id?: string | null; /** * URL-friendly slug */ slug?: string | null; /** * Whether the product is active */ is_active: boolean; /** * Whether the product is archived */ is_archived: boolean; /** * Product image URL */ image_url?: string | null; /** * Tax behavior (exclusive, inclusive, location) */ tax_behavior?: string | null; /** * Tax code for tax calculation */ tax_code?: string | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Creation timestamp (ISO 8601) */ created_at: string; /** * Last update timestamp (ISO 8601) */ updated_at: string; }; type Pagination = { /** * Pagination type */ kind: string; /** * Current page number */ page: number; /** * Results per page */ limit: number; /** * Total matching results */ total: number; /** * Total pages available */ totalPages: number; }; /** * Error response returned when a product operation fails. */ type ProductErrorResponse = { error: string; }; /** * A single product object with full details and associated prices. */ type ProductRetrieveResponse = { data: Product; }; /** * The newly created product object. */ type ProductCreateResponse = { data: Product; }; /** * Parameters for creating a new product, including name, billing type, and pricing. */ type CreateProductRequest = { product_id: string; name: string; description?: string | null; kind: 'subscription' | 'one_time' | 'usage'; pricing_model: 'one_time' | 'recurring' | 'usage'; amount_minor: number; currency?: string; interval?: string | null; interval_count?: number | null; trial_days?: number; usage_meter_id?: string | null; slug?: string; /** * Fulfillment type for the product. Defaults to 'none' (service). */ fulfillment_type?: 'none' | 'digital' | 'physical'; /** * Enable a finite purchase cap that blocks purchase once stock reaches zero. One-time products only; requires stock_quantity. */ track_inventory?: boolean; /** * Remaining units that can be purchased. Required (non-negative) when track_inventory is true; ignored otherwise. */ stock_quantity?: number | null; /** * How billing dates are calculated. same_day: Bill on same day as start. day_of_month: Bill on specific day (1-31). last_day: Bill on last day of month. */ billing_anchor_rule?: 'same_day' | 'day_of_month' | 'last_day'; /** * Day of month (1-31) when billing_anchor_rule is 'day_of_month' */ billing_anchor_day?: number | null; /** * When first payment is collected. immediate: Charge on start. next_anchor: Charge on first scheduled date. prorate: Prorate until first date. */ first_charge_behavior?: 'immediate' | 'next_anchor' | 'prorate'; /** * How subscription ends. until_canceled: Runs forever. fixed_payments: Ends after N billing cycles. */ end_behavior?: 'until_canceled' | 'fixed_payments'; /** * Max billing cycles when end_behavior is 'fixed_payments' */ max_payments?: number | null; /** * Arbitrary key-value metadata for the product */ metadata?: { [key: string]: unknown; }; /** * Product image S3 key or public URL (upload via /internal/storage first) */ image_url?: string | null; }; /** * The updated product object reflecting the changes. */ type ProductUpdateResponse = { data: Product; }; /** * Parameters for updating an existing product. Only the provided fields are changed. */ type UpdateProductRequest = { name?: string; description?: string | null; amount_minor?: number; currency?: string; interval?: string | null; interval_count?: number | null; trial_days?: number; is_active?: boolean; is_archived?: boolean; /** * Fulfillment type for the product. */ fulfillment_type?: 'none' | 'digital' | 'physical'; /** * Enable/disable the finite purchase cap (one-time products only). Requires stock_quantity when enabled. */ track_inventory?: boolean; /** * Remaining units that can be purchased. Required (non-negative) when track_inventory is true. */ stock_quantity?: number | null; /** * How billing dates are calculated. same_day: Bill on same day as start. day_of_month: Bill on specific day (1-31). last_day: Bill on last day of month. */ billing_anchor_rule?: 'same_day' | 'day_of_month' | 'last_day'; billing_anchor_day?: number | null; /** * When first payment is collected. immediate: Charge on start. next_anchor: Charge on first scheduled date. prorate: Prorate until first date. */ first_charge_behavior?: 'immediate' | 'next_anchor' | 'prorate'; /** * How subscription ends. until_canceled: Runs forever. fixed_payments: Ends after N billing cycles. */ end_behavior?: 'until_canceled' | 'fixed_payments'; max_payments?: number | null; /** * Arbitrary key-value metadata for the product */ metadata?: { [key: string]: unknown; }; /** * Product image S3 key or public URL. Pass null to remove. */ image_url?: string | null; }; /** * The created checkout session with the URL to redirect the customer to. */ type CheckoutSessionCreateResponse = { data: { id: string; url: string; public_token: string; amount_minor?: number; currency: string; customer_id?: string; expires_at: string; allowed_methods?: Array; selected_method?: string | null; }; requestId: string; }; /** * Error response returned when a checkout session cannot be created. */ type CheckoutSessionErrorResponse = { error: string; }; /** * Parameters for creating a hosted checkout session. Customers are redirected to complete payment on a RevKeen-hosted page. */ type CreateCheckoutSessionInput = { invoiceId?: string; productId?: string; amountMinor?: number; currency?: string; successUrl?: string; cancelUrl?: string; /** * Payment methods to offer. Intersected with merchant capabilities. Defaults to merchant config. */ allowedMethods?: Array<'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'>; /** * Target a registered companion device. Session is pushed via SSE to the device. */ companionDeviceId?: string; }; type CheckoutSessionRetrieveResponse = { data: CheckoutSession; requestId: string; }; /** * A checkout session represents a customer's intent to pay. */ type CheckoutSession = { id: string; object: 'checkout_session'; status: string; mode: string | null; amount_total: number | null; currency: string | null; customer_id: string | null; payment_intent_id: string | null; invoice_id: string | null; subscription_id: string | null; url: string | null; success_url: string | null; cancel_url: string | null; expires_at: string | null; created_at: string | null; allowed_methods: Array; selected_method: string | null; }; type CheckoutSessionExpireResponse = { data: { id: string; status: 'expired'; expired_at: string; }; requestId: string; }; type CartSessionResponse = { data: CartSession; }; type CartSession = { id: string; object: 'cart_session'; merchant_id: string; customer_id: string | null; currency: string; mode: string; status: CartSessionStatus; line_items: Array; add_ons_offered: Array; add_ons_selected: Array; discount_code: string | null; /** * Captured customer email for recovery, if provided. */ email: string | null; promotional_consent: boolean | null; sms_consent: boolean | null; subtotal_minor: number; total_minor: number; metadata: { [key: string]: unknown; } | null; converted_to_checkout_session_id: string | null; /** * Anon-access token. Use to build /c/[cart_session_id]?token=... URLs for customer-facing cart checkout. Open carts can be reviewed and edited; unexpired abandoned carts can be reviewed and converted as-is. Expired and converted carts are inaccessible. */ public_token: string; created_at: string; updated_at: string; expires_at: string; }; type CartSessionStatus = 'open' | 'converted' | 'abandoned' | 'expired'; type CartLineItem = { id: string; product_id: string; name: string; quantity: number; unit_price_minor: number; currency: string; recurring: CartLineItemRecurring; billing_max_cycles?: number | null; trial_period_days?: number | null; start_rule?: CartStartRule; billing_anchor_rule?: CartBillingAnchorRule; billing_anchor_day?: number | null; due_today_minor?: number | null; first_charge_minor?: number | null; first_renewal_at?: string | null; effective_start_rule?: CartStartRule; metadata?: { [key: string]: unknown; } | null; }; type CartLineItemRecurring = { interval: 'day' | 'week' | 'month' | 'year'; interval_count: number; } | null; type CartStartRule = 'immediate' | 'next_anchor' | 'prorate' | null; type CartBillingAnchorRule = 'same_day' | 'day_of_month' | 'last_day' | null; type CartSessionErrorResponse = { error: string; code?: 'CART_SESSION_NOT_FOUND' | 'CART_LINE_ITEM_NOT_FOUND' | 'CART_SESSION_CLOSED' | 'CART_SESSION_EMPTY'; }; type CreateCartSessionInput = { currency: string; mode?: 'payment' | 'subscription' | 'mixed'; customer_id?: string; line_items?: Array; add_ons_offered?: Array; metadata?: { [key: string]: unknown; }; /** * Seed this cart from a cart-enabled payment link. */ payment_link_id?: string; }; type CartLineItemInput = { product_id: string; name: string; quantity: number; /** * Unit price in minor units (pence, cents). */ unit_price_minor: number; currency: string; recurring?: CartLineItemRecurring; metadata?: { [key: string]: unknown; }; }; type UpdateCartLineItemInput = { quantity: number; }; type ToggleCartAddOnInput = { product_id: string; selected: boolean; }; type ApplyCartDiscountCodeInput = { /** * Discount code to apply. Pass `null` to clear. Valid discounts are priced into cart totals before checkout handoff. */ code: string | null; }; type SetCartContactInput = { /** * Customer email for abandoned-cart recovery. Pass `null` to clear. */ email?: string | null; /** * Whether the customer consented to marketing/recovery email. Records the consent timestamp when set. */ promotional_consent?: boolean | null; /** * Whether the customer consented to marketing/recovery SMS. Records the consent timestamp when set. */ sms_consent?: boolean | null; }; type CartConversionResponse = { data: { cart_session: CartSession; checkout_session: CartCheckoutSession; }; }; type CartCheckoutSession = { id: string; object: 'checkout_session'; merchant_id: string; customer_id: string | null; session_token: string | null; status: string; mode: string | null; amount_minor: number | null; currency: string | null; line_items: Array; metadata: { [key: string]: unknown; } | null; expires_at: string | null; created_at: string | null; updated_at: string | null; }; type StorefrontProductListResponse = { data: Array; }; /** * Browser-safe product projection for headless storefronts: display data, active prices, and derived availability only. */ type StorefrontProduct = { id: string; object: 'product'; product_id: string | null; slug: string | null; name: string; description: string | null; kind: string; pricing_model: string; currency: string; image_url: string | null; default_price_id: string | null; prices: Array; trial_days: number; usage_meter_id: string | null; tax_behavior: string | null; tax_code: string | null; availability: StorefrontAvailability; }; /** * Active price summary for storefront display. Amounts are minor units. */ type StorefrontPrice = { id: string; product_id: string; currency: string; unit_amount: number | null; unit_amount_decimal: string | null; type: string | null; interval: string | null; interval_count: number | null; billing_scheme: string; usage_type: string | null; package_size: number | null; trial_period_days: number | null; }; /** * Derived availability (capacity + oversell − reserved − confirmed). `unknown` when the product does not track availability. */ type StorefrontAvailability = { status: 'unknown' | 'plenty' | 'low' | 'soldout'; remaining: number | null; display_mode: string; low_stock_threshold: number | null; }; type StorefrontProductError = { error: string; message?: string; }; type StorefrontProductResponse = { data: StorefrontProduct; }; type StorefrontOriginListResponse = { data: Array; }; /** * A registered storefront origin allowed for publishable-key browser calls. */ type StorefrontOrigin = { id: string; object: 'storefront_origin'; origin: string; created_at: string; }; type StorefrontOriginError = { error: string; message?: string; }; type StorefrontOriginCreateResponse = { data: StorefrontOrigin; }; type StorefrontOriginCreateRequest = { /** * Exact origin, e.g. https://shop.example.com or http://localhost:3000. */ origin: string; }; type StorefrontOriginDeleteResponse = { data: { id: string; deleted: true; }; }; type StorefrontStatusResponse = { data: StorefrontStatus; }; type StorefrontStatus = { object: 'storefront_status'; ready: boolean; checks: Array; cart: { enabled: boolean; profile: string; }; keys: { publishable: StorefrontKeyStatus; secret: StorefrontKeyStatus; }; origins: { count: number; origins: Array; }; product_read: { active_products: number; priced_products: number; ready: boolean; }; webhooks: { active_endpoints: number; unreachable_endpoints: number; }; availability: { tracked_products: number; mode: 'enabled' | 'not_configured'; }; }; type StorefrontStatusCheck = { id: 'cart_enabled' | 'keys' | 'origins' | 'product_read' | 'webhooks' | 'availability'; status: 'pass' | 'warn' | 'fail'; code?: 'CART_DISABLED' | 'KEYS_MISSING' | 'ORIGIN_MISSING' | 'PRODUCT_READ_UNAVAILABLE' | 'WEBHOOK_MISSING' | 'WEBHOOK_UNREACHABLE'; message: string; next_action?: string; }; /** * Managed Cart key presence. Key material is never returned. */ type StorefrontKeyStatus = { present: boolean; active: boolean; created_at: string | null; last_used_at: string | null; }; type StorefrontStatusError = { error: string; message?: string; }; /** * A business entity (company) associated with a customer for B2B billing. */ type Business = { /** * Unique identifier (UUID) */ id: string; /** * Object type */ object: 'business'; /** * Associated customer ID */ customer_id?: string | null; /** * Business name */ name: string; /** * Company registration number */ company_number?: string | null; /** * Tax ID (VAT, EIN, etc.) */ tax_identifier?: string | null; /** * Billing email address */ billing_email?: string | null; /** * Billing phone number */ billing_phone?: string | null; /** * Billing address line 1 */ billing_address_line1?: string | null; /** * Billing address line 2 */ billing_address_line2?: string | null; /** * Billing city */ billing_city?: string | null; /** * Billing postcode/ZIP */ billing_postcode?: string | null; /** * Billing country (ISO 3166-1 alpha-2) */ billing_country?: string | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Creation timestamp (ISO 8601) */ created_at: string; /** * Last update timestamp (ISO 8601) */ updated_at: string; }; /** * An invoice belonging to a specific customer, with summarized billing details. */ type CustomerInvoice = { id: string; customer_id: string; invoice_number: string | null; status: string; total_minor: number; currency: string; due_date: string | null; created_at: string; updated_at: string; }; /** * Standard error response for customer sub-resource operations. */ type ErrorResponse = { error: { code: string; message: string; }; }; /** * A subscription belonging to a specific customer, with plan and status details. */ type CustomerSubscription = { id: string; customer_id: string; price_id: string | null; status: string; current_period_start: string | null; current_period_end: string | null; cancel_at_period_end: boolean; canceled_at: string | null; trial_end: string | null; created_at: string; updated_at: string; }; /** * An order belonging to a specific customer, with line items and fulfillment status. */ type CustomerOrder = { id: string; public_id: string; customer_id: string; status: string; total_minor: number; currency: string; fulfilled_at: string | null; canceled_at: string | null; created_at: string; updated_at: string; }; /** * A payment transaction belonging to a specific customer, with amount, status, and gateway details. */ type CustomerPayment = { id: string; customer_id: string | null; amount_minor: number; currency: string; status: string; payment_method_type: string | null; gateway_transaction_id: string | null; created_at: string; updated_at: string; }; /** * The newly created customer object. */ type CustomerCreateResponse = { data: { /** * Unique customer identifier */ id: string; /** * ID of the merchant this customer belongs to */ merchant_id: string; /** * Merchant-assigned reference ID for external system mapping */ merchant_ref_id?: string; /** * Customer's email address */ email: string; /** * Customer's full name */ name?: string; /** * Customer's phone number */ phone?: string; /** * Customer's company name */ company_name?: string; /** * Billing address line 1 */ address_line1?: string; /** * Billing address line 2 */ address_line2?: string; /** * Billing address city */ city?: string; /** * Billing address state or county */ state?: string; /** * Billing address postal code */ postal_code?: string; /** * Billing address country code */ country?: string; /** * Linked Better Auth user ID for portal access */ auth_user_id?: string; /** * Arbitrary key-value metadata attached to this customer */ metadata?: { [key: string]: unknown; }; /** * Merchant-defined custom fields displayed as columns in the dashboard */ custom_fields?: { [key: string]: unknown; }; /** * When the customer was created (ISO 8601) */ created_at: string; /** * When the customer was last updated (ISO 8601) */ updated_at: string; }; }; /** * A paginated list of customers matching the query filters. */ type CustomerListResponse = { data: Array<{ /** * Unique customer identifier */ id: string; /** * ID of the merchant this customer belongs to */ merchant_id: string; /** * Merchant-assigned reference ID for external system mapping */ merchant_ref_id?: string; /** * Customer's email address */ email: string; /** * Customer's full name */ name?: string; /** * Customer's phone number */ phone?: string; /** * Customer's company name */ company_name?: string; /** * Billing address line 1 */ address_line1?: string; /** * Billing address line 2 */ address_line2?: string; /** * Billing address city */ city?: string; /** * Billing address state or county */ state?: string; /** * Billing address postal code */ postal_code?: string; /** * Billing address country code */ country?: string; /** * Linked Better Auth user ID for portal access */ auth_user_id?: string; /** * Arbitrary key-value metadata attached to this customer */ metadata?: { [key: string]: unknown; }; /** * Merchant-defined custom fields displayed as columns in the dashboard */ custom_fields?: { [key: string]: unknown; }; /** * When the customer was created (ISO 8601) */ created_at: string; /** * When the customer was last updated (ISO 8601) */ updated_at: string; }>; pagination: { limit: number; offset: number; total?: number; }; }; /** * A single customer object with full details. */ type CustomerRetrieveResponse = { data: { /** * Unique customer identifier */ id: string; /** * ID of the merchant this customer belongs to */ merchant_id: string; /** * Merchant-assigned reference ID for external system mapping */ merchant_ref_id?: string; /** * Customer's email address */ email: string; /** * Customer's full name */ name?: string; /** * Customer's phone number */ phone?: string; /** * Customer's company name */ company_name?: string; /** * Billing address line 1 */ address_line1?: string; /** * Billing address line 2 */ address_line2?: string; /** * Billing address city */ city?: string; /** * Billing address state or county */ state?: string; /** * Billing address postal code */ postal_code?: string; /** * Billing address country code */ country?: string; /** * Linked Better Auth user ID for portal access */ auth_user_id?: string; /** * Arbitrary key-value metadata attached to this customer */ metadata?: { [key: string]: unknown; }; /** * Merchant-defined custom fields displayed as columns in the dashboard */ custom_fields?: { [key: string]: unknown; }; /** * When the customer was created (ISO 8601) */ created_at: string; /** * When the customer was last updated (ISO 8601) */ updated_at: string; }; }; /** * The updated customer object reflecting the changes. */ type CustomerUpdateResponse = { data: { /** * Unique customer identifier */ id: string; /** * ID of the merchant this customer belongs to */ merchant_id: string; /** * Merchant-assigned reference ID for external system mapping */ merchant_ref_id?: string; /** * Customer's email address */ email: string; /** * Customer's full name */ name?: string; /** * Customer's phone number */ phone?: string; /** * Customer's company name */ company_name?: string; /** * Billing address line 1 */ address_line1?: string; /** * Billing address line 2 */ address_line2?: string; /** * Billing address city */ city?: string; /** * Billing address state or county */ state?: string; /** * Billing address postal code */ postal_code?: string; /** * Billing address country code */ country?: string; /** * Linked Better Auth user ID for portal access */ auth_user_id?: string; /** * Arbitrary key-value metadata attached to this customer */ metadata?: { [key: string]: unknown; }; /** * Merchant-defined custom fields displayed as columns in the dashboard */ custom_fields?: { [key: string]: unknown; }; /** * When the customer was created (ISO 8601) */ created_at: string; /** * When the customer was last updated (ISO 8601) */ updated_at: string; }; }; /** * A list of payment methods attached to a customer. */ type CustomerPaymentMethodsListResponse = { data: Array; }; /** * A saved payment instrument (card, bank account, etc.) attached to a customer for future charges. */ type PaymentMethod = { /** * Unique identifier for the payment method */ id: string; /** * Object type, always 'payment_method' */ object: 'payment_method'; /** * Public ID visible in API responses (pm_xxx format) */ public_id: string | null; /** * The type of payment method */ type: 'card' | 'bank_account' | 'us_bank_account' | 'bacs_direct_debit'; /** * The status of the payment method */ status: 'active' | 'inactive' | 'expired'; /** * ID of the customer this payment method belongs to */ customer_id: string; /** * Whether this is the customer's default payment method */ is_default: boolean; card: CardDetails; us_bank_account: BankAccountDetails; bacs_direct_debit: BacsDirectDebitDetails; billing_details: BillingDetails; /** * Custom metadata attached to the payment method */ metadata: { [key: string]: unknown; }; /** * When the payment method was created */ created_at: string; /** * When the payment method was last updated */ updated_at: string; }; /** * Card details (if type is 'card') */ type CardDetails = { /** * The card brand */ brand: 'visa' | 'mastercard' | 'amex' | 'discover' | 'diners' | 'jcb' | 'unionpay' | 'unknown' | null; /** * The last 4 digits of the card number */ last4: string | null; /** * Expiration month (1-12) */ exp_month: number | null; /** * Expiration year */ exp_year: number | null; /** * The card funding type */ funding: 'credit' | 'debit' | 'prepaid' | 'unknown' | null; } | null; /** * Bank account details (if type is 'us_bank_account') */ type BankAccountDetails = { /** * The name of the bank */ bank_name: string | null; /** * The last 4 digits of the account number */ last4: string | null; /** * The last 4 digits of the routing number */ routing_number_last4: string | null; /** * The type of bank account */ account_type: 'checking' | 'savings' | null; } | null; /** * Bacs Direct Debit details (if type is 'bacs_direct_debit') */ type BacsDirectDebitDetails = { /** * Masked sort code — never the full value */ sort_code: string | null; /** * Last 4 digits of the account number */ account_number_last4: string | null; /** * Resolved bank name */ bank_name: string | null; /** * The Direct Debit mandate backing this payment method */ mandate_id: string; /** * RevKeen mandate reference (RK-XXXXXX) */ mandate_ref: string | null; /** * Mandate status */ mandate_status: string; } | null; /** * Billing details associated with the payment method */ type BillingDetails = { /** * Full name on the payment method */ name: string | null; /** * Email address */ email: string | null; /** * Phone number */ phone: string | null; /** * Billing address */ address: { line1: string | null; line2: string | null; city: string | null; state: string | null; postal_code: string | null; country: string | null; } | null; } | null; /** * A portal session URL that redirects the customer to their self-service billing portal. */ type CustomerPortalSessionCreateResponse = { data: { id: string; customer_id: string; merchant_id: string; url: string; expires_at: string; created_at: string; }; }; /** * The newly created subscription with billing schedule and initial invoice details. */ type SubscriptionCreateResponse = { data: Subscription; }; /** * A subscription with full plan, billing, and status details. */ type Subscription = { /** * Subscription UUID */ id: string; /** * Owning merchant UUID */ merchant_id: string; /** * Customer UUID */ customer_id: string; /** * Product UUID */ product_id?: string | null; /** * Price UUID */ price_id?: string | null; /** * Plan UUID */ plan_id?: string | null; /** * Subscription status */ status: string; /** * Subscribed quantity */ quantity: number; /** * Recurring amount in minor units */ amount_minor: number; /** * Three-letter ISO currency code */ currency: string; /** * Billing interval (day, week, month, year) */ billing_interval: string; /** * Current period start (ISO 8601) */ current_period_start: string; /** * Current period end (ISO 8601) */ current_period_end: string; /** * Trial end (ISO 8601) */ trial_end?: string | null; /** * Cancellation timestamp (ISO 8601) */ canceled_at?: string | null; /** * Creation timestamp (ISO 8601) */ created_at: string; /** * Last update timestamp (ISO 8601) */ updated_at: string; /** * Dunning summary when past due */ dunning?: { is_in_dunning: boolean; phase: number | null; phase_label: string | null; phase_severity: 'info' | 'warning' | 'critical' | null; retry_count: number; total_possible_retries: number; next_retry_at: string | null; days_in_dunning: number; access_restricted: boolean; } | null; }; /** * A paginated list of subscriptions matching the query filters. */ type SubscriptionListResponse = { data: Array; pagination: { page: number; limit: number; total: number; totalPages: number; }; }; /** * A single subscription object with full plan, billing, and status details. */ type SubscriptionRetrieveResponse = { data: Subscription; }; /** * The updated subscription reflecting the changes to metadata or billing parameters. */ type SubscriptionUpdateResponse = { data: Subscription; }; /** * The subscription after a plan change, with proration details and updated billing schedule. */ type SubscriptionChangePlanResponse = { subscription: Subscription; /** * Proration details */ proration?: { [key: string]: unknown; }; previousPlanId?: string; invoiceCreated: boolean; }; /** * The subscription after a quantity change, with proration details if applicable. */ type SubscriptionChangeQuantityResponse = { subscription: Subscription; /** * Proration details */ proration?: { [key: string]: unknown; }; previousQuantity?: number; invoiceCreated: boolean; }; /** * The subscription after cancellation, showing the effective end date and final billing period. */ type SubscriptionCancelResponse = { success: boolean; }; /** * A preview of the next renewal charge, including line items, amounts, and billing date. */ type SubscriptionPreviewRenewalResponse = { data: { subscriptionId: string; currentPeriodEnd: string; upcomingRenewals: Array<{ sequence: number; date: string; formattedDate: string; dayName: string; amountMinor: number; formattedAmount: string; isTrialEnd?: boolean; isFirstCharge?: boolean; isFinalPayment?: boolean; }>; nextInvoiceAmountMinor: number; currency: string; }; }; /** * The subscription after being paused, showing the pause effective date and planned resume date. */ type SubscriptionPauseResponse = { data: Subscription; }; /** * Parameters for pausing an active subscription. Specify when billing should resume. */ type PauseSubscriptionInput = { /** * How to handle invoices during the pause period */ behavior?: 'keep_as_draft' | 'mark_uncollectible' | 'void'; /** * ISO 8601 date when the subscription should automatically resume. If not provided, subscription stays paused until manually resumed. */ resumes_at?: string; }; /** * The subscription after being resumed from a paused state, with the next billing date. */ type SubscriptionResumeResponse = { data: Subscription; }; /** * The subscription after being canceled with the specified cancellation parameters. */ type SubscriptionCancelSubscriptionResponse = { data: Subscription; }; /** * Parameters for canceling a subscription, including whether to cancel immediately or at period end. */ type CancelSubscriptionInput = { /** * Cancel mode: "immediately" revokes access now, "period_end" schedules cancellation at billing period end */ mode: 'immediately' | 'period_end'; /** * Optional reason for cancellation */ reason?: string; }; /** * The subscription after being reactivated from a canceled state, with updated billing schedule. */ type SubscriptionReactivateResponse = { data: Subscription; }; /** * A list of line items in a subscription. */ type SubscriptionItemListResponse = { data: Array; meta: { total: number; limit: number; offset: number; has_more: boolean; }; }; /** * A line item within a subscription, representing a specific product and price that the customer is billed for each cycle. */ type SubscriptionItem = { id: string; subscription_id: string; product_id: string | null; price_id: string | null; description: string | null; /** * Item quantity */ quantity: number; currency: string; /** * Unit price in cents */ unit_amount_minor: number; /** * none: service (no order), physical: creates shipping order, digital: creates download order */ fulfillment_type: 'none' | 'physical' | 'digital'; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; created_at: string; updated_at: string; }; /** * The newly added subscription line item. */ type SubscriptionItemCreateResponse = { data: SubscriptionItem; }; /** * Parameters for adding a new line item to an existing subscription. */ type CreateSubscriptionItemInput = { /** * Product UUID to link to this item */ product_id?: string; /** * Price UUID to link to this item */ price_id?: string; /** * Item description */ description?: string; /** * Item quantity */ quantity?: number; /** * ISO 4217 currency code */ currency: string; /** * Unit price in cents */ unit_amount_minor: number; /** * Determines if orders are created on renewal */ fulfillment_type?: 'none' | 'physical' | 'digital'; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; }; /** * The updated subscription line item reflecting the changes. */ type SubscriptionItemUpdateResponse = { data: SubscriptionItem; }; /** * Parameters for updating a subscription line item, such as changing the quantity. */ type UpdateSubscriptionItemInput = { /** * Item quantity */ quantity?: number; /** * Item description */ description?: string; /** * Unit price in cents */ unit_amount_minor?: number; /** * Determines if orders are created on renewal */ fulfillment_type?: 'none' | 'physical' | 'digital'; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Swap the item onto another Price. Allowed only when the new Price shares the same meter_id (fail closed otherwise). */ price_id?: string; }; /** * Confirmation that the subscription line item was removed. */ type SubscriptionItemDeleteResponse = { success: boolean; deleted_id: string; }; /** * A payout represents funds settled from processed payments to your bank account. Track settlement batches and reconcile amounts. */ type Payout = { id: string; public_id: string; /** * Name of the payment processor that produced this payout batch */ gateway: string; gateway_payout_id: string; /** * Gross amount in cents */ gross_amount_minor: number; /** * Fees in cents */ fees_amount_minor: number; /** * Net amount in cents */ net_amount_minor: number; currency: string; charges_count: number | null; refunds_count: number | null; chargebacks_count: number | null; status: 'pending' | 'in_transit' | 'paid' | 'failed' | 'canceled'; arrival_date: string | null; settled_at: string | null; created_at: string; }; /** * A payment included in a payout settlement batch, with amount and fee details. */ type PayoutPayment = { id: string; public_id: string | null; amount_minor: number; currency: string; status: string; kind: string | null; paid_at: string | null; created_at: string; }; /** * A paginated list of refunds matching the query filters. */ type RefundListResponse = { data: Array; meta: { /** * Total number of results matching the query */ total: number; /** * Maximum results per page */ limit: number; /** * Number of results skipped */ offset: number; /** * Whether more results exist beyond this page */ has_more: boolean; }; }; /** * A refund represents money returned to a customer after a completed payment. Refunds create a child transaction linked to the original payment for audit trail purposes. */ type Refund = { id: string; public_id: string; /** * The original payment ID this refund is for (alias for parent_transaction_id) */ payment_id: string; /** * Parent transaction ID in unified transaction model. Same as payment_id for refunds. */ parent_transaction_id: string; order_id: string | null; /** * Name of the payment processor that handled this refund */ gateway: string; gateway_refund_id: string | null; /** * Refund amount in cents */ amount_minor: number; currency: string; reason: 'customer_request' | 'duplicate' | 'fraudulent' | 'product_not_received' | 'product_unacceptable' | 'subscription_canceled' | 'other' | null; reason_details: string | null; status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'canceled'; failure_reason: string | null; failure_code: string | null; processed_at: string | null; created_at: string; }; /** * A single refund object with full details. */ type RefundRetrieveResponse = { data: Refund; }; /** * The newly created refund object, including the gateway response details. */ type RefundCreateResponse = { data: Refund; }; /** * Parameters for creating a refund. Specify the transaction ID and optionally a partial amount. */ type CreateRefundInput = { /** * The ID of the payment to refund */ payment_id: string; /** * Amount to refund in cents. If not provided, refunds the full remaining amount. */ amount_minor?: number; /** * Reason for the refund */ reason?: 'customer_request' | 'duplicate' | 'fraudulent' | 'product_not_received' | 'product_unacceptable' | 'subscription_canceled' | 'other'; /** * Additional details about the refund reason */ reason_details?: string; }; /** * A paginated list of voids matching the query filters. */ type VoidListResponse = { data: Array; meta: { /** * Total number of results matching the query */ total: number; /** * Maximum results per page */ limit: number; /** * Number of results skipped */ offset: number; /** * Whether more results exist beyond this page */ has_more: boolean; }; }; /** * A void cancels an unsettled payment before gateway settlement. Voids are always for the full amount — use a refund for settled payments. */ type Void = { id: string; public_id: string; /** * The original payment ID this void is for (alias for parent_transaction_id) */ payment_id: string; /** * Parent transaction ID in unified transaction model. */ parent_transaction_id: string; order_id: string | null; /** * Name of the payment processor that handled this void */ gateway: string; gateway_void_id: string | null; /** * Void amount in cents (always full amount of original transaction) */ amount_minor: number; currency: string; reason: string | null; reason_code: 'customer_request' | 'duplicate' | 'fraudulent' | 'error' | 'other' | null; status: 'pending' | 'processing' | 'succeeded' | 'failed'; failure_reason: string | null; failure_code: string | null; voided_at: string | null; created_at: string; }; /** * A single void object with full details. */ type VoidRetrieveResponse = { data: Void; }; /** * The newly created void object confirming the unsettled payment was canceled. */ type VoidCreateResponse = { data: Void; }; /** * Parameters for creating a void. Specify the transaction ID of the unsettled payment to cancel. */ type CreateVoidInput = { /** * The ID of the payment to void. Must be unsettled. */ payment_id: string; /** * Reason for the void */ reason?: string; /** * Standardized reason code for the void */ reason_code?: 'customer_request' | 'duplicate' | 'fraudulent' | 'error' | 'other'; }; /** * A single credit note with full details including the associated invoice and refund. */ type CreditNoteRetrieveResponse = { data: CreditNote & unknown; }; /** * The newly created credit note with issued status and PDF URL. */ type CreditNoteCreateResponse = { data: CreditNote & unknown; }; /** * Parameters for creating a credit note against an invoice, specifying the amount, reason, and whether to issue a refund. */ type CreateCreditNoteInput = { /** * The ID of the invoice to issue a credit note for */ invoice_id: string; /** * Amount to credit in minor units (cents). Capped at 2,000,000,000 to stay below the 32-bit integer ceiling of the underlying DB column. */ amount_minor: number; /** * Tax portion of the credit in minor units (cents). For UK/EU VAT compliance. Capped at 2,000,000,000. */ tax_amount_minor?: number; /** * How the credit should be applied */ credit_method?: 'refund_to_payment_method' | 'customer_balance' | 'external'; /** * Reason for the credit note */ reason?: string; /** * Standardized reason code */ reason_code?: 'customer_request' | 'duplicate_charge' | 'service_issue' | 'billing_error' | 'subscription_cancellation' | 'proration' | 'other'; /** * Whether to cancel the associated subscription after issuing */ cancel_subscription?: boolean; /** * Whether this credit note represents a prorated amount */ is_prorated?: boolean; /** * Total days in the billing period (for prorated credits). Constrained to 1–366. */ proration_days_total?: number; /** * Unused days in the billing period (for prorated credits). Must be <= proration_days_total. Constrained to 0–366. */ proration_days_unused?: number; /** * Idempotency key to prevent duplicate credit notes */ idempotency_key?: string; /** * Arbitrary key-value metadata */ metadata?: { [key: string]: unknown; }; /** * When true, automatically trigger the process-credit-note task for multi-gateway reversal routing. Response will include gateway_operations array. Always combine with `idempotency_key` to avoid duplicate gateway operations. */ auto_route?: boolean; }; /** * The credit note after being voided, reversing its accounting effect. */ type CreditNoteVoidResponse = { data: CreditNote & unknown; }; /** * Eligibility details showing whether a credit note can be issued for the specified invoice and the maximum creditable amount. */ type CreditNoteEligibilityResponse = { invoice_id: string; total_amount_minor: number; total_paid_minor: number; total_credited_minor: number; max_creditable_minor: number; eligible: boolean; payments: Array<{ transaction_id: string; gateway: string; payment_method: string | null; amount_minor: number; amount_refunded_minor: number; amount_available_minor: number; card_brand: string | null; card_last4: string | null; terminal_serial: string | null; available_operations: Array; constraints: { partial_supported: boolean; requires_card_present: boolean; requires_terminal_online: boolean; }; }>; }; /** * Details about which reversal methods (refund, void, or credit note) are available for a specific transaction. */ type TransactionReversalEligibilityResponse = { can_reverse: boolean; transaction_id: string; gateway: string; payment_method: string | null; available_operations: Array; constraints: { max_amount: number; partial_supported: boolean; requires_card_present: boolean; requires_terminal_online: boolean; requires_customer_iban: boolean; reason: string | null; }; card_brand: string | null; card_last4: string | null; terminal_serial: string | null; terminal_uti: string | null; }; type CreditNoteLineList = { object: 'list'; data: Array; has_more: boolean; url: string; }; /** * A single line item on a credit note. Each line represents a portion of the invoice that is being credited — either a whole invoice line or a prorated slice of one. */ type CreditNoteLine = { id: string; object: 'credit_note_line'; credit_note_id: string; /** * The invoice line item this credit line applies to, when the credit was scoped to a specific line. Null for invoice-level credits. */ invoice_line_item_id: string | null; description: string; quantity: number; /** * Per-unit credit amount in cents */ unit_amount_minor: number; /** * Total credit for this line in cents */ total_amount_minor: number; metadata: { [key: string]: unknown; } | null; created_at: string; }; type CreditNotePreviewResponse = { data: CreditNotePreview; }; /** * A non-persistent preview of a credit note. Use this to show a customer (or merchant operator) what the credit would do before committing to creating it. */ type CreditNotePreview = { object: 'credit_note_preview'; invoice_id: string; proposed_amount_minor: number; proposed_tax_amount_minor: number | null; currency: string; invoice: { id: string; total_minor: number; amount_paid_minor: number; amount_due_minor: number; previously_credited_minor: number; max_creditable_minor: number; }; after_credit: { new_amount_due_minor: number; new_amount_credited_minor: number; /** * True if applying this credit would leave a non-zero balance on the invoice. */ would_leave_outstanding: boolean; }; /** * True if `amount_minor` exceeds the invoice's remaining creditable amount. A real create call would be rejected. */ exceeds_max_creditable: boolean; credit_method: string; }; /** * Parameters to preview a credit note without persisting it. The response shows what the credit note would look like if created with these fields. */ type PreviewCreditNoteInput = { /** * Invoice to preview a credit note against. */ invoice_id: string; /** * Proposed credit amount in cents. The preview validates that this does not exceed the invoice's outstanding creditable amount. */ amount_minor: number; /** * Proposed tax portion of the credit in cents. */ tax_amount_minor?: number; /** * Planned credit method. Defaults to refund_to_payment_method. */ credit_method?: 'refund_to_payment_method' | 'customer_balance' | 'external'; reason_code?: 'customer_request' | 'duplicate_charge' | 'service_issue' | 'billing_error' | 'subscription_cancellation' | 'proration' | 'other'; }; /** * A dispute (chargeback) represents a customer's challenge to a charge with their card issuer. Track lifecycle stages and submit evidence to contest. */ type Dispute = { /** * Unique identifier for the dispute */ id: string; /** * Public-facing dispute identifier */ public_id: string; /** * The original payment ID this dispute is for (alias for parent_transaction_id) */ payment_id: string | null; /** * Parent transaction ID in unified transaction model. Same as payment_id for disputes. */ parent_transaction_id: string | null; /** * Name of the payment processor that handled the original transaction */ gateway: string; /** * Rail/payment method for the disputed transaction */ payment_rail: string | null; /** * Rail-specific dispute subtype, when available */ dispute_kind: string | null; /** * Dispute identifier assigned by the payment gateway */ gateway_dispute_id: string; /** * Original transaction identifier from the payment gateway */ gateway_transaction_id: string | null; /** * Disputed amount in cents */ amount_minor: number; /** * Three-letter ISO 4217 currency code */ currency: string; /** * Card network reason code */ reason_code: string | null; /** * Human-readable reason for the dispute */ reason: string | null; /** * Card network-specific reason code */ network_reason_code: string | null; /** * Card network-specific reason description */ network_reason_description: string | null; /** * Name of the customer who filed the dispute */ customer_name: string | null; /** * Card brand used for the original payment */ card_brand: string | null; /** * Last four digits of the card used for the original payment */ card_last4: string | null; /** * Deadline for submitting evidence to contest the dispute */ evidence_due_by: string | null; /** * Whether evidence has been submitted for this dispute */ evidence_submitted: boolean; /** * Timestamp when evidence was submitted */ evidence_submitted_at: string | null; /** * Current status of the dispute lifecycle */ status: 'needs_response' | 'under_review' | 'won' | 'lost' | 'warning_closed' | 'warning_needs_response'; /** * Final resolution outcome of the dispute */ resolution: 'won' | 'lost' | 'withdrawn' | null; /** * Timestamp when the dispute was resolved */ resolved_at: string | null; /** * Timestamp when the dispute was filed */ disputed_at: string; /** * Timestamp when the dispute record was created */ created_at: string; }; /** * An open dispute requiring action, with urgency indicators for evidence submission deadlines. */ type OpenDispute = { /** * Unique identifier for the dispute */ id: string; /** * Public-facing dispute identifier */ public_id: string; /** * The original payment ID this dispute is for */ payment_id: string | null; /** * Parent transaction ID in unified transaction model */ parent_transaction_id: string | null; /** * Payment gateway that processed the original transaction */ gateway: string; /** * Rail/payment method for the disputed transaction */ payment_rail: string | null; /** * Rail-specific dispute subtype, when available */ dispute_kind: string | null; /** * Disputed amount in cents */ amount_minor: number; /** * Three-letter ISO 4217 currency code */ currency: string; /** * Human-readable reason for the dispute */ reason: string | null; /** * Name of the customer who filed the dispute */ customer_name: string | null; /** * Card brand used for the original payment */ card_brand: string | null; /** * Last four digits of the card used for the original payment */ card_last4: string | null; /** * Deadline for submitting evidence to contest the dispute */ evidence_due_by: string | null; /** * Number of days remaining until the evidence deadline */ days_until_due: number | null; /** * Whether the evidence submission deadline has passed */ is_overdue: boolean; /** * Timestamp when the dispute was filed */ disputed_at: string; }; /** * A paginated list of discounts matching the query filters. */ type DiscountListResponse = { data: Array; meta: { total: number; limit: number; offset: number; has_more: boolean; }; }; /** * A discount code that applies a percentage or fixed amount reduction to charges, invoices, or subscriptions. */ type Discount = { id: string; code: string; name: string | null; description: string | null; discount_type: string; /** * Amount off (cents) or percentage */ discount_value: number; applies_to: string | null; product_ids: Array | null; max_redemptions: number | null; current_redemptions: number | null; valid_from: string | null; valid_until: string | null; recurring_type: string | null; recurring_cycles: number | null; first_time_customer: boolean | null; is_active: boolean | null; created_at: string | null; updated_at: string | null; }; /** * A single discount object with full details and usage statistics. */ type DiscountRetrieveResponse = { data: Discount; }; /** * The newly created discount object. */ type DiscountCreateResponse = { data: Discount; }; /** * Parameters for creating a new discount code with amount, type, and usage limits. */ type CreateDiscountInput = { /** * Unique discount code (will be uppercased) */ code: string; /** * Human-readable name */ name: string; /** * Optional description */ description?: string; /** * Type of discount */ discount_type: 'percentage' | 'fixed_amount'; /** * Discount value - percentage (1-100) or amount in cents */ discount_value: number; /** * Which products the discount applies to */ applies_to?: 'all' | 'specific_products'; /** * Scope of where discount can be applied */ scope?: 'entire_order' | 'specific_products' | 'subscription_only' | 'one_time_only'; /** * Product IDs if applies_to is 'specific_products' */ product_ids?: Array; /** * Maximum total redemptions allowed */ max_redemptions?: number; /** * Maximum redemptions per customer (0 = unlimited) */ max_redemptions_per_user?: number; /** * Start date (ISO 8601) */ valid_from?: string; /** * End date (ISO 8601) */ valid_until?: string; /** * How the discount applies to recurring payments */ recurring_type?: 'once' | 'forever' | 'repeating'; /** * Number of billing cycles (only if recurring_type is 'repeating') */ recurring_cycles?: number; /** * Only available to first-time customers */ first_time_customer?: boolean; }; /** * The updated discount object reflecting the changes. */ type DiscountUpdateResponse = { data: Discount; }; /** * Parameters for updating an existing discount. Active discounts can only have metadata and usage limits modified. */ type UpdateDiscountInput = { name?: string; description?: string | null; discount_value?: number; applies_to?: 'all' | 'specific_products'; scope?: 'entire_order' | 'specific_products' | 'subscription_only' | 'one_time_only'; product_ids?: Array | null; max_redemptions?: number | null; max_redemptions_per_user?: number; valid_from?: string | null; valid_until?: string | null; is_active?: boolean; is_archived?: boolean; recurring_type?: 'once' | 'forever' | 'repeating' | null; recurring_cycles?: number | null; first_time_customer?: boolean; }; /** * Confirmation that the discount was successfully deleted. */ type DiscountDeleteResponse = { data: Discount; }; /** * A paginated list of payment attempts matching the query filters. */ type PaymentAttemptListResponse = { data: Array; meta: { /** * Number of results returned */ count: number; /** * Limit used in query */ limit?: number; }; }; /** * A record of an individual payment processing attempt, including gateway response codes, AVS/CVV results, and retry metadata. */ type PaymentAttempt = { /** * Unique identifier for the payment attempt */ id: string; /** * External reference ID (payatt_xxx format). Used as order_id in gateway requests. */ public_id: string | null; /** * Order ID sent to the processor. Format: payatt_. Primary correlation key for webhook mapping. */ gateway_order_id: string | null; /** * Processor-assigned transaction reference. */ gateway_transaction_id: string | null; /** * Logical payment (PaymentIntent) this attempt belongs to */ payment_id: string | null; /** * Associated invoice ID */ invoice_id: string | null; /** * Associated subscription ID */ subscription_id: string | null; /** * Associated checkout session ID */ checkout_session_id: string | null; /** * Billing run ID for batch reconciliation */ billing_run_id: string | null; /** * Name of the payment processor that handled this attempt */ gateway: string; /** * Processor-returned response code */ gateway_code: string; /** * Processor-returned response message */ gateway_message: string; /** * Normalized error category for the payment attempt */ category: 'approved' | 'generic_decline' | 'insufficient_funds' | 'over_limit' | 'expired_card' | 'invalid_card_number' | 'invalid_cvv' | 'invalid_expiry' | 'invalid_pin' | 'transaction_not_allowed' | 'call_issuer' | 'incorrect_payment_info' | 'lost_or_stolen' | 'pickup_card' | 'suspected_fraud' | 'restricted_card' | 'stop_all_recurring' | 'stop_this_program' | 'update_cardholder_data' | 'processor_error' | 'gateway_error' | 'communication_error' | 'merchant_config_error' | 'merchant_inactive' | 'issuer_unavailable' | 'duplicate_transaction' | 'invalid_transaction' | 'unsupported_card' | 'feature_not_available' | 'authentication_required'; /** * Severity level for logging/monitoring */ severity: 'info' | 'warn' | 'error'; /** * Retry behavior recommendation. retry_now: Safe to retry immediately. retry_later: Retry after delay. do_not_retry: Hard decline, don't retry. */ retryability: 'retry_now' | 'retry_later' | 'do_not_retry'; /** * Recommended action for the customer */ customer_action: 'try_again' | 'use_other_method' | 'update_card' | 'contact_bank' | 'contact_merchant' | 'none'; /** * Recommended action for the merchant */ merchant_action: 'none' | 'collect_new_pm' | 'fix_config' | 'contact_support' | 'fraud_review' | 'schedule_retry' | 'contact_bank' | 'stop_recurring'; /** * Directive for subscription handling after decline */ subscription_directive: 'none' | 'stop_all' | 'stop_program' | 'update_cardholder_data'; /** * Template key for customer-facing message */ safe_customer_message_key: string; /** * Decline classification. soft: May succeed on retry. hard: Will not succeed on retry. */ decline_type: 'soft' | 'hard' | null; /** * Final outcome status of the attempt */ attempt_status: 'pending' | 'succeeded' | 'failed' | 'canceled'; /** * Payment amount in cents */ amount_cents: number | null; /** * Three-letter ISO currency code */ currency: string | null; /** * Last 4 digits of card */ payment_method_last4: string | null; /** * Card brand (visa, mastercard, etc.) */ payment_method_brand: string | null; /** * Attempt sequence number (1 = first attempt) */ attempt_number: number; /** * Legacy retry attempt number */ retry_attempt_number: number; /** * Maximum retry attempts allowed */ max_retry_attempts: number | null; /** * Next scheduled retry timestamp */ next_retry_at: string | null; /** * Whether this was a scheduled retry */ is_scheduled_retry: boolean; /** * Whether this was a manual retry */ is_manual_retry: boolean; /** * When the attempt was created */ created_at: string; /** * When the attempt was last updated */ updated_at: string; }; /** * Error response returned when a payment attempt lookup fails. */ type PaymentAttemptErrorResponse = { /** * Error message */ error: string; }; /** * A single payment attempt with full gateway response details. */ type PaymentAttemptSingleResponse = { data: PaymentAttempt; }; /** * Assessment of whether a failed payment attempt is eligible for retry, including recommended retry strategy. */ type RetryEligibilityResponse = { data: { /** * Whether the subscription should be retried */ should_retry: boolean; /** * Explanation for the retry decision */ reason: string; last_attempt: PaymentAttempt & ({ [key: string]: unknown; } | null); }; }; /** * Analytics data about payment decline patterns, including decline codes, rates, and trends. */ type DeclineAnalyticsResponse = { data: { total_attempts: number; approved_count: number; declined_count: number; approval_rate: number; soft_decline_count: number; hard_decline_count: number; top_decline_categories: Array<{ category: string; count: number; }>; /** * Breakdown by gateway */ by_gateway: { [key: string]: { total?: number; approved?: number; declined?: number; }; }; }; }; /** * Response containing the security verification results (AVS/CVV) for a specific payment attempt. */ type PaymentSecurityResponse = { data: PaymentSecurityResult; }; /** * Combined AVS and CVV verification results for a payment attempt. */ type PaymentSecurityResult = { avs: AvsCodeInterpretation; cvv: CvvCodeInterpretation; /** * Combined risk level from AVS + CVV checks */ overall_risk_level: 'low' | 'medium' | 'high' | 'unknown'; /** * Recommended action based on security checks */ recommendation: 'accept' | 'review' | 'decline'; }; /** * AVS verification result */ type AvsCodeInterpretation = { /** * Raw AVS response code from gateway */ code: string; /** * Type of address match */ match_type: 'full_match' | 'partial_match' | 'no_match' | 'not_supported' | 'not_available' | 'error'; /** * Whether the street address matched */ address_match: boolean | null; /** * Whether the ZIP/postal code matched */ zip_match: boolean | null; /** * Human-readable description of the AVS result */ description: string; /** * Risk level based on AVS result. low: full match, medium: partial match, high: no match */ risk_level: 'low' | 'medium' | 'high' | 'unknown'; } | null; /** * CVV verification result */ type CvvCodeInterpretation = { /** * Raw CVV response code from gateway */ code: string; /** * Type of CVV match */ match_type: 'match' | 'no_match' | 'not_processed' | 'not_provided' | 'issuer_not_certified' | 'error'; /** * Human-readable description of the CVV result */ description: string; /** * Risk level based on CVV result. low: match, medium: not processed, high: no match */ risk_level: 'low' | 'medium' | 'high' | 'unknown'; } | null; /** * The newly created charge object with gateway response details. */ type ChargeCreateResponse = { data: { id: string; customerId: string; invoiceId: string | null; paymentMethodId: string | null; amountMinor: number; amountCapturedMinor: number; amountRefundedMinor: number; currency: string; status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'refunded' | 'partially_refunded' | 'voided'; description: string; statementDescriptor: string | null; failureCode: string | null; failureMessage: string | null; gatewayTransactionId: string | null; receiptUrl: string | null; captured: boolean; metadata: { [key: string]: unknown; } | null; createdAt: string; updatedAt: string; }; }; /** * Error response returned when a charge operation fails due to a gateway decline or validation error. */ type ChargeErrorResponse = { error: string; code?: string; }; /** * Error response returned when a duplicate charge is detected via idempotency key. */ type ChargeDuplicateErrorResponse = { error: string; existingChargeId?: string; }; /** * A paginated list of charges matching the query filters. */ type ChargeListResponse = { data: Array<{ id: string; customerId: string; invoiceId: string | null; paymentMethodId: string | null; amountMinor: number; amountCapturedMinor: number; amountRefundedMinor: number; currency: string; status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'refunded' | 'partially_refunded' | 'voided'; description: string; statementDescriptor: string | null; failureCode: string | null; failureMessage: string | null; gatewayTransactionId: string | null; receiptUrl: string | null; captured: boolean; metadata: { [key: string]: unknown; } | null; createdAt: string; updatedAt: string; }>; pagination: { /** * Current page number */ page: number; /** * Maximum results per page */ limit: number; /** * Total number of results matching the query */ total: number; /** * Total number of pages available */ totalPages: number; }; }; /** * A single charge object with full details. */ type ChargeRetrieveResponse = { data: { id: string; customerId: string; invoiceId: string | null; paymentMethodId: string | null; amountMinor: number; amountCapturedMinor: number; amountRefundedMinor: number; currency: string; status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'refunded' | 'partially_refunded' | 'voided'; description: string; statementDescriptor: string | null; failureCode: string | null; failureMessage: string | null; gatewayTransactionId: string | null; receiptUrl: string | null; captured: boolean; metadata: { [key: string]: unknown; } | null; createdAt: string; updatedAt: string; }; }; /** * The charge object after capturing the authorized funds. */ type ChargeCaptureResponse = { data: { id: string; customerId: string; invoiceId: string | null; paymentMethodId: string | null; amountMinor: number; amountCapturedMinor: number; amountRefundedMinor: number; currency: string; status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'refunded' | 'partially_refunded' | 'voided'; description: string; statementDescriptor: string | null; failureCode: string | null; failureMessage: string | null; gatewayTransactionId: string | null; receiptUrl: string | null; captured: boolean; metadata: { [key: string]: unknown; } | null; createdAt: string; updatedAt: string; }; }; /** * The charge object after processing a full or partial refund. */ type ChargeRefundResponse = { data: { id: string; customerId: string; invoiceId: string | null; paymentMethodId: string | null; amountMinor: number; amountCapturedMinor: number; amountRefundedMinor: number; currency: string; status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'refunded' | 'partially_refunded' | 'voided'; description: string; statementDescriptor: string | null; failureCode: string | null; failureMessage: string | null; gatewayTransactionId: string | null; receiptUrl: string | null; captured: boolean; metadata: { [key: string]: unknown; } | null; createdAt: string; updatedAt: string; }; }; /** * A preview of upcoming billing charges for a subscription, showing line items, amounts, and billing dates. */ type BillingPreviewResponse = { data: { items: Array<{ sequence: number; date: string; formattedDate: string; dayName: string; amountMinor: number; formattedAmount: string; isTrialEnd?: boolean; isFirstCharge?: boolean; isFinalPayment?: boolean; }>; summary: string; totalAmountMinor: number; firstChargeDate: string; trialEndDate: string | null; scheduleEndDate: string | null; timezone: string; }; }; /** * Error response when a billing preview cannot be generated. */ type BillingPreviewErrorResponse = { error: string; field?: string; }; /** * Available billing intervals (monthly, quarterly, yearly) with their configuration and pricing multipliers. */ type BillingIntervalsResponse = { data: Array<{ value: string; label: string; description: string; }>; }; /** * Billing anchor rules that determine how billing dates are calculated for different start modes and intervals. */ type BillingAnchorRulesResponse = { data: Array<{ value: string; label: string; description: string; requiresAnchorDay: boolean; }>; }; /** * A paginated list of prices matching the query filters. */ type PriceListResponse = { object: 'list'; data: Array; has_more: boolean; total_count?: number; }; /** * A price defines how much and how often to charge for a product. A single product can have multiple prices for different currencies, intervals, or tiers. */ type Price = { /** * Unique identifier for the price */ id: string; /** * Object type */ object: 'price'; /** * ID of the product this price belongs to */ product_id: string; /** * Whether the price is active */ active: boolean; /** * Three-letter ISO currency code (lowercase) */ currency: string; /** * Price in minor units (cents). Null when the per-unit rate is sub-penny — see `unit_amount_decimal`. */ unit_amount: number | null; /** * Exact per-unit rate in minor units as a decimal string (sub-penny safe, e.g. "0.02" = 0.02 pence). Set when the rate is not a whole minor unit; mirrors Stripe's `unit_amount_decimal`. */ unit_amount_decimal?: string | null; /** * Price type */ type: 'one_time' | 'recurring'; /** * Pricing model */ pricing_model: 'fixed' | 'pay_what_you_want' | 'free'; /** * Billing interval (recurring only) */ interval?: 'day' | 'week' | 'month' | 'year' | null; /** * Number of intervals between billings */ interval_count?: number | null; /** * Trial period in days (recurring only) */ trial_period_days?: number | null; /** * First-charge behavior for recurring checkout. `immediate`: full first period now. `next_anchor`: first charge on the billing anchor. `prorate`: prorated stub now, then full charge on the billing anchor. */ start_rule?: 'immediate' | 'next_anchor' | 'prorate' | null; /** * PWYW: minimum amount in cents */ minimum_amount?: number | null; /** * PWYW: maximum amount in cents */ maximum_amount?: number | null; /** * PWYW: suggested amount in cents */ suggested_amount?: number | null; /** * PWYW: quick-select amounts */ preset_amounts?: Array | null; /** * Customer-facing price name (e.g., 'Morning', 'Full day') */ name?: string | null; /** * Display name (e.g., 'Monthly', 'Annual - Save 17%') */ nickname?: string | null; /** * Description of this price option */ description?: string | null; /** * Immutable version for this price row */ version: number; /** * Stable key for API lookups */ lookup_key?: string | null; /** * Billing scheme. Defaults to `per_unit`. Set to `tiered` along with `tiers_mode` + `tiers` to use graduated or volume pricing. */ billing_scheme: 'per_unit' | 'tiered' | 'percentage'; /** * Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be null otherwise. */ tiers_mode?: 'graduated' | 'volume' | null; /** * Price tiers (ordered by `up_to`). Present only when `billing_scheme` is `tiered`. At least 2 tiers, final tier MUST have `up_to: null`. Immutable after creation. */ tiers?: Array | null; /** * Optional quantity transform (package pricing) applied before tier lookup. Immutable after creation. */ transform_quantity?: { /** * Package size — quantity is divided by this value before pricing. Must be >= 1. Example: `divide_by: 10` with `round: up` charges per pack of 10. */ divide_by: number; /** * Rounding mode when quantity is not an exact multiple of `divide_by`. */ round: 'up' | 'down'; } | null; /** * Rate in basis points (70 = 0.7%). Present only when `billing_scheme` is `percentage`. Null for `per_unit` and `tiered` prices. */ percentage_rate_bps?: number | null; /** * When true for a metered UBB price, usage events are debited from the customer's prepaid wallet at ingest time. */ pay_in_advance?: boolean; /** * Minimum minor-unit amount applied to each pay-in-advance usage drawdown when set. */ spending_minimum_cents?: number | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Creation timestamp */ created_at: string; /** * Last update timestamp */ updated_at: string; }; type PriceTier = { /** * Upper bound of this tier (1-based inclusive). `null` = open-ended catch-all. Only the FINAL tier may set `up_to: null`. */ up_to: number | null; /** * Per-unit charge in minor currency units (cents). May be null if the tier charges only a flat fee, or (REV-6249) when the rate is sub-penny and carried by `unit_amount_decimal`. */ unit_amount_minor: number | null; /** * Exact per-unit rate for this tier in minor currency units, as a decimal string (sub-penny safe, e.g. "0.0000024"). Takes precedence over `unit_amount_minor`, which is null whenever the rate is not a whole number of minor units. Must be > 0 with at most 12 decimal places. Tier BOUNDARIES remain integer. */ unit_amount_decimal?: string | null; /** * Flat fee charged once when quantity enters this tier. May be null if the tier charges only a per-unit amount. Always a whole number of minor units — only the per-unit RATE supports sub-penny precision. */ flat_amount_minor: number | null; }; /** * Error response returned when a price operation fails. */ type PriceErrorResponse = { error: { type: string; code: string; message: string; param?: string; }; }; /** * Parameters for creating a new price. Specify the product, amount, currency, and billing interval. */ type CreatePriceRequest = { /** * ID of the product this price belongs to */ product_id: string; /** * Three-letter ISO currency code */ currency?: string; /** * Price in minor units (cents). Required for fixed pricing. */ unit_amount?: number; /** * Price type */ type?: 'one_time' | 'recurring'; /** * Pricing model */ pricing_model?: 'fixed' | 'pay_what_you_want' | 'free'; /** * Billing interval (required for recurring) */ interval?: 'day' | 'week' | 'month' | 'year'; /** * Number of intervals between billings (1-12) */ interval_count?: number; /** * Trial period in days (0-730) */ trial_period_days?: number; /** * First-charge behavior for recurring checkout. `immediate`: full first period now. `next_anchor`: first charge on the billing anchor. `prorate`: prorated stub now, then full charge on the billing anchor. */ start_rule?: 'immediate' | 'next_anchor' | 'prorate'; /** * PWYW: minimum amount in cents */ minimum_amount?: number; /** * PWYW: maximum amount in cents */ maximum_amount?: number; /** * PWYW: suggested amount in cents */ suggested_amount?: number; /** * PWYW: quick-select amounts (max 10) */ preset_amounts?: Array; /** * Customer-facing price name (e.g., 'Morning', 'Full day') */ name?: string; /** * Display name (e.g., 'Monthly', 'Annual') */ nickname?: string; /** * Description of this price option */ description?: string; /** * Stable key for API lookups */ lookup_key?: string; /** * Billing scheme. Defaults to `per_unit`. Set to `tiered` with `tiers_mode` + `tiers` for graduated or volume pricing. */ billing_scheme?: 'per_unit' | 'tiered' | 'percentage'; /** * Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be omitted otherwise. */ tiers_mode?: 'graduated' | 'volume'; /** * Price tiers (ordered by `up_to`, min 2, max 50). Required when `billing_scheme` is `tiered`. Final tier MUST have `up_to: null`. */ tiers?: Array; transform_quantity?: TransformQuantity; /** * Rate in basis points. 70 = 0.7%. Required when `billing_scheme` is `percentage`. Range 0–10000 (0%–100%). */ percentage_rate_bps?: number; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; }; /** * Optional quantity transform (package pricing) applied before tier lookup. */ type TransformQuantity = { /** * Package size — quantity is divided by this value before pricing. Must be >= 1. Example: `divide_by: 10` with `round: up` charges per pack of 10. */ divide_by: number; /** * Rounding mode when quantity is not an exact multiple of `divide_by`. */ round: 'up' | 'down'; }; /** * Parameters for updating an existing price. Amounts cannot be changed — archive and create a new price instead. */ type UpdatePriceRequest = { /** * Whether the price is active */ active?: boolean; /** * Customer-facing price name */ name?: string | null; /** * Display name */ nickname?: string | null; /** * Description of this price option */ description?: string | null; /** * Stable key for API lookups */ lookup_key?: string | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; }; /** * A list of meters for the merchant. */ type MeterListResponse = { /** * Array of meter objects */ data: Array<{ [key: string]: unknown; }>; pagination: { limit: number; offset: number; count: number; }; }; /** * Error response returned when a meter operation fails. */ type MeterError = { error: string | { message: string; type: string; }; }; /** * A single meter object with configuration details. */ type MeterGetResponse = { /** * Meter object */ data: { [key: string]: unknown; }; }; /** * The newly created meter object. */ type CreateMeterResponse = { /** * Created meter object */ data: { [key: string]: unknown; }; }; /** * Parameters for creating a new usage meter with aggregation rules and event matching. */ type CreateMeterRequest = { /** * Human-readable meter name */ name: string; /** * Event name to match against */ event_name: string; /** * Aggregation method */ aggregation?: 'sum' | 'count' | 'count_unique' | 'max' | 'last'; /** * URL-safe identifier */ slug?: string; /** * Meter description */ description?: string; /** * Property key for sum/max/last aggregations */ value_key?: string; /** * Constrained arithmetic expression over numeric event properties. Example: input_tokens + output_tokens */ value_expression?: string; /** * Filter conditions for matching events */ filter_conditions?: Array<{ [key: string]: unknown; }>; /** * Property key for count_unique aggregation */ unique_count_key?: string; /** * Display unit name */ unit_name?: string; /** * Carry forward last value across periods */ carry_forward?: boolean; /** * Arbitrary key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Threshold percentages that trigger usage.threshold.reached webhooks. */ alert_thresholds?: Array; }; /** * The updated meter object reflecting the changes. */ type UpdateMeterResponse = { /** * Updated meter object */ data: { [key: string]: unknown; }; }; /** * Parameters for updating an existing meter. Only display name and metadata can be changed. */ type UpdateMeterRequest = { /** * Updated meter name */ name?: string; /** * Updated slug */ slug?: string; /** * Updated description */ description?: string; /** * Meter status */ status?: 'active' | 'archived' | 'draft'; /** * Updated value key */ value_key?: string; /** * Updated constrained arithmetic expression over numeric event properties. null clears it. */ value_expression?: string | null; /** * Updated filter conditions */ filter_conditions?: Array<{ [key: string]: unknown; }>; /** * Updated unique count key */ unique_count_key?: string; /** * Updated unit name */ unit_name?: string; /** * Updated carry forward setting */ carry_forward?: boolean; /** * Updated metadata */ metadata?: { [key: string]: unknown; }; /** * Updated threshold percentages for usage.threshold.reached webhooks. */ alert_thresholds?: Array; }; /** * A single meter price with per-unit cost and billing configuration. */ type MeterPriceResponse = { /** * Price object with tiers */ data: { [key: string]: unknown; }; }; /** * Error response returned when a meter price operation fails. */ type MeterPriceError = { error: string | { message: string; type: string; }; }; /** * Parameters for creating a price attached to a usage meter, defining per-unit cost, tiered tiers, or a percentage rate. */ type CreateMeterPriceRequest = { /** * Pricing model. 'percentage' charges a basis-points percentage of the metered amount (REV-3465); other models charge per unit, graduated tiers, volume tiers, or packages. */ pricing_model: 'per_unit' | 'graduated' | 'volume' | 'package' | 'percentage'; /** * ISO 4217 currency code. A usage-based subscription has one currency; metered events attributed to it are assumed to be in this currency and are not FX-converted by RevKeen. */ currency: string; /** * Price per unit in minor units (for per_unit). For a sub-penny rate use `unit_amount_decimal`. */ unit_amount_minor?: number; /** * Exact per-unit rate in minor units as a decimal string (sub-penny safe, e.g. "0.02" = 0.02 pence). Takes precedence over `unit_amount_minor`. Mirrors Stripe's `unit_amount_decimal`. */ unit_amount_decimal?: string; /** * Base charge per period in minor units */ flat_fee_minor?: number; /** * Units per package (for package model) */ package_size?: number; /** * Merchant's cost per unit for margin intelligence */ cost_per_unit_minor?: number; /** * Customer-facing price name */ name?: string; /** * Internal price nickname */ nickname?: string; /** * Description of this price option */ description?: string; /** * Tier configuration (for graduated and volume) */ tiers?: Array; /** * Optional event property predicates for dimensional pricing. Empty or omitted = base/fallthrough price. */ filter_conditions?: Array<{ [key: string]: unknown; }>; /** * Tie-breaker when multiple matching filters have the same specificity. */ filter_priority?: number; /** * When true, matching usage events debit the customer's prepaid wallet at ingest time. */ pay_in_advance?: boolean; /** * Minimum minor-unit amount applied to each pay-in-advance usage drawdown. */ spending_minimum_cents?: number; /** * Rate in basis points. 70 = 0.7%. Required when pricing_model='percentage'. Range 0–10000 (0%–100%). */ percentage_rate_bps?: number; }; type MeterPriceTierInput = { /** * Upper bound of this tier (1-based inclusive). null = open-ended final tier. New clients should use this canonical shape; legacy first_unit/last_unit is accepted during the deprecation window. */ up_to?: number | null; /** * Per-unit price in this tier (minor units). For a sub-penny per-tier rate use `unit_amount_decimal`. Optional when `unit_amount_decimal` or `flat_amount_minor` is supplied. */ unit_amount_minor?: number; /** * Exact per-unit rate for this tier in minor units as a decimal string (sub-penny safe, e.g. "0.0000024" = 0.0000024 pence per token). Takes precedence over `unit_amount_minor`. Must be > 0 with at most 12 decimal places. Amounts are rounded per tier with half-up (away from zero) before the tier subtotals are summed. */ unit_amount_decimal?: string; /** * Flat fee for entering this tier (minor units). Always a whole number of minor units — only the per-unit RATE supports sub-penny precision. */ flat_amount_minor?: number; [key: string]: unknown; }; /** * A list of prices attached to a meter. */ type MeterPriceListResponse = { /** * Array of price objects */ data: Array<{ [key: string]: unknown; }>; }; /** * Parameters for updating a meter price. Active prices on existing subscriptions are not retroactively changed. */ type UpdateMeterPriceRequest = { unit_amount_minor?: number; unit_amount_decimal?: string; flat_fee_minor?: number; package_size?: number; cost_per_unit_minor?: number; name?: string | null; nickname?: string | null; description?: string | null; tiers?: Array; filter_conditions?: Array<{ [key: string]: unknown; }>; filter_priority?: number; pay_in_advance?: boolean; spending_minimum_cents?: number | null; /** * Rate in basis points. 70 = 0.7%. Only meaningful when the price's pricing_model is 'percentage'. */ percentage_rate_bps?: number; }; /** * A paginated list of tax rates. */ type TaxRateListResponse = { object: 'list'; data: Array; has_more: boolean; total_count?: number; }; /** * A manually configured tax rate applied to invoices and charges. For automatic tax calculation, use the Quaderno integration instead. */ type TaxRate = { /** * Unique identifier for the tax rate */ id: string; /** * Object type */ object: 'tax_rate'; /** * Display name for the tax rate */ display_name: string; /** * Description of the tax rate */ description?: string | null; /** * Tax jurisdiction (e.g., 'US-CA', 'DE', 'GB') */ jurisdiction?: string | null; /** * Tax percentage (e.g., 8.25 for 8.25%) */ percentage: number; /** * Whether tax is included in displayed price (EU style) */ inclusive: boolean; /** * Type of tax */ tax_type: 'vat' | 'sales_tax' | 'gst' | 'other'; /** * ISO country code */ country?: string | null; /** * State/province code */ state?: string | null; /** * Whether the tax rate is active */ active: boolean; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Creation timestamp */ created_at: string; /** * Last update timestamp */ updated_at: string; }; /** * Error response returned when a tax rate operation fails. */ type TaxRateErrorResponse = { error: { type: string; code: string; message: string; param?: string; }; }; /** * Parameters for creating a new tax rate with a percentage and jurisdiction details. */ type CreateTaxRateRequest = { /** * Display name for the tax rate */ display_name: string; /** * Description of the tax rate */ description?: string; /** * Tax jurisdiction (e.g., 'US-CA', 'DE', 'GB') */ jurisdiction?: string; /** * Tax percentage (e.g., 8.25 for 8.25%) */ percentage: number; /** * Whether tax is included in displayed price */ inclusive?: boolean; /** * Type of tax */ tax_type?: 'vat' | 'sales_tax' | 'gst' | 'other'; /** * ISO 2-letter country code */ country?: string; /** * State/province code */ state?: string; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; }; /** * Parameters for updating a tax rate. Active tax rates on existing invoices are not retroactively changed. */ type UpdateTaxRateRequest = { /** * Display name for the tax rate */ display_name?: string; /** * Description of the tax rate */ description?: string | null; /** * Tax jurisdiction */ jurisdiction?: string | null; /** * ISO 2-letter country code */ country?: string | null; /** * State/province code */ state?: string | null; /** * Whether the tax rate is active */ active?: boolean; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; }; /** * A paginated list of orders matching the query filters. */ type OrderListResponse = { object: 'list'; data: Array; has_more: boolean; total_count?: number; }; /** * An order represents a one-off purchase with lifecycle operations: create, pay, cancel, and fulfill. */ type Order = { /** * Unique identifier for the order */ id: string; /** * Object type */ object: 'order'; /** * Public-facing order ID */ public_id: string; /** * ID of the customer */ customer_id?: string | null; /** * Order status. draft: Being built. pending: Awaiting payment. paid: Fully paid. partially_paid: Partial payment received. refunded: Refunded. canceled: Canceled. fulfilled: Shipped/delivered. */ status: 'draft' | 'pending' | 'paid' | 'partially_paid' | 'refunded' | 'canceled' | 'fulfilled'; /** * Billing type. one_time: Single purchase. recurring: Subscription-based. */ billing_type: 'one_time' | 'recurring'; /** * Fulfillment status for physical goods. */ fulfillment_status?: 'unfulfilled' | 'partial' | 'fulfilled' | 'returned' | null; /** * Three-letter ISO currency code */ currency: string; /** * Subtotal in cents */ subtotal: number; /** * Total discount in cents */ discount: number; /** * Total tax in cents */ tax: number; /** * Total amount in cents */ total: number; /** * Amount paid in cents */ amount_paid: number; /** * Amount refunded in cents */ amount_refunded: number; /** * Amount still due in cents */ amount_due: number; line_items?: Array; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; notes?: string | null; /** * ID of the linked invoice (Commercial Truth) */ invoice_id?: string | null; /** * ID of the linked subscription (for recurring fulfillment) */ subscription_id?: string | null; created_at: string; updated_at: string; paid_at?: string | null; canceled_at?: string | null; fulfilled_at?: string | null; expires_at?: string | null; }; /** * A line item within an order, representing a product, quantity, and unit price. */ type OrderLineItem = { id: string; product_id?: string | null; description: string; quantity: number; /** * Unit price in cents */ unit_price: number; /** * Subtotal in cents (unit_price * quantity) */ subtotal: number; /** * Discount in cents */ discount?: number; /** * Tax in cents */ tax?: number; /** * Total in cents (subtotal - discount + tax) */ total: number; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; position?: number; }; /** * Error response returned when an order operation fails. */ type OrderErrorResponse = { error: { type: string; code: string; message: string; param?: string; }; }; /** * Parameters for creating a new order with line items and customer association. */ type CreateOrderRequest = { /** * Customer ID (optional for guest orders) */ customer_id?: string; /** * Three-letter ISO currency code */ currency?: string; /** * Billing type. one_time: Single purchase. recurring: Subscription-based. */ billing_type?: 'one_time' | 'recurring'; /** * Order line items (at least one required) */ line_items: Array<{ /** * Product ID (optional for ad-hoc items) */ product_id?: string; description: string; quantity?: number; /** * Unit price in cents */ unit_price: number; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; }>; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; notes?: string; /** * Expiration timestamp for the order */ expires_at?: string; /** * ID of the linked invoice (Commercial Truth) */ invoice_id?: string; /** * ID of the linked subscription (for recurring fulfillment) */ subscription_id?: string; }; /** * Parameters for updating order metadata or notes before fulfillment. */ type UpdateOrderRequest = { customer_id?: string | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; notes?: string | null; }; /** * Parameters for paying an order, specifying the payment method and optional partial amount. */ type PayOrderRequest = { /** * Saved payment method ID */ payment_method_id?: string; /** * One-time payment token */ payment_token?: string; /** * Partial payment amount in cents (defaults to full amount_due) */ amount?: number; }; /** * Parameters for canceling an order before fulfillment. */ type CancelOrderRequest = { /** * Reason for cancellation */ reason?: string; }; /** * Parameters for marking an order as fulfilled, with optional tracking and shipping details. */ type FulfillOrderRequest = { /** * Shipping tracking number */ tracking_number?: string; /** * Shipping carrier (e.g., 'ups', 'fedex', 'usps') */ carrier?: string; /** * Specific line items to fulfill (defaults to all) */ line_item_ids?: Array; /** * Send fulfillment notification to customer */ notify_customer?: boolean; }; /** * A paginated list of payments matching the query filters. */ type PaymentListResponse = { object: 'list'; data: Array; has_more: boolean; total_count?: number; }; /** * A completed or in-progress money movement. Payments represent funds transferred between a customer and your account across all channels — online, terminal, and recurring. */ type Payment = { /** * Unique identifier for the payment */ id: string; /** * Object type */ object: 'payment'; /** * Associated invoice ID */ invoice_id?: string | null; /** * Customer ID */ customer_id?: string | null; /** * Payment status. pending: Processing. authorized: Funds reserved. captured/succeeded: Funds collected. failed: Payment failed. voided: Canceled before capture. refunded/partially_refunded: Returned to customer. */ status: 'pending' | 'authorized' | 'captured' | 'succeeded' | 'failed' | 'voided' | 'refunded' | 'partially_refunded'; /** * Three-letter ISO currency code */ currency: string; /** * Payment amount in cents */ amount: number; /** * Amount captured in cents (for auth-capture flow) */ amount_captured?: number | null; /** * Amount refunded in cents */ amount_refunded?: number; /** * Name of the payment processor that handled this payment */ gateway?: string | null; /** * Processor's transaction reference */ gateway_transaction_id?: string | null; /** * Normalized response code from the processor */ gateway_response_code?: string | null; /** * Human-readable response message from the processor */ gateway_response_text?: string | null; /** * Payment method type (card, ach, wallet) */ payment_method_type?: string | null; /** * Card brand (visa, mastercard, etc.) */ card_brand?: string | null; /** * Last 4 digits of card */ card_last_four?: string | null; /** * Payment channel. card_present: terminal/POS payment. card_not_present: online or recurring payment. bank_transfer: ACH/direct debit. manual: manually recorded. */ payment_channel?: 'card_present' | 'card_not_present' | 'bank_transfer' | 'manual' | null; /** * Card entry mode for card-present (terminal) payments. null for online payments. */ entry_mode?: 'emv_chip' | 'contactless' | 'magnetic_stripe' | 'manual_entry' | 'fallback' | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; created_at: string; updated_at: string; authorized_at?: string | null; captured_at?: string | null; voided_at?: string | null; refunded_at?: string | null; }; /** * Error response returned when a payment operation fails. */ type PaymentErrorResponse = { error: { type: string; code: string; message: string; param?: string; }; }; /** * Parameters for capturing a previously authorized payment. Optionally specify a partial capture amount. */ type CapturePaymentRequest = { /** * Amount to capture in cents. Defaults to full authorized amount. Must be <= authorized amount. */ amount?: number; }; /** * Parameters for voiding a payment before settlement. Include a reason for your records. */ type CancelPaymentRequest = { /** * Reason for cancellation/void */ reason?: string; }; type AccountingInvoicePaymentRequest = { id: string; object: 'accounting_invoice_payment_request'; merchant_id: string; provider: string; connection_id: string; provider_account_id: string; external_invoice_id: string; external_invoice_number?: string | null; external_invoice_status?: string | null; external_invoice_url?: string | null; external_invoice_issued_at?: string | null; external_invoice_due_at?: string | null; external_invoice_updated_at?: string | null; external_customer_id?: string | null; external_customer_reference?: string | null; external_customer_name?: string | null; external_customer_email?: string | null; amount_due_minor: number; total_amount_minor?: number | null; amount_paid_minor?: number | null; currency: string; checkout_session_id?: string | null; checkout_url?: string | null; checkout_expires_at?: string | null; checkout_success_url?: string | null; checkout_cancel_url?: string | null; checkout_allowed_methods?: Array | null; status: string; sync_status: string; idempotency_key: string; payload_fingerprint: string; created_at: string; updated_at: string; }; /** * Create an accounting-led invoice payment request and mint/reuse a checkout session. */ type CreateAccountingInvoicePaymentRequestInput = { provider: 'quickbooks_online' | 'xero'; connection_id: string; provider_account_id: string; external_invoice: { id: string; number?: string | null; status?: string | null; url?: string | null; issued_at?: string | null; due_at?: string | null; updated_at?: string | null; }; external_customer?: { id?: string | null; reference?: string | null; name?: string | null; email?: string | null; } | null; amount_due_minor: number; total_amount_minor?: number | null; amount_paid_minor?: number | null; currency: string; checkout?: { success_url?: string | null; cancel_url?: string | null; allowed_methods?: Array<'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'> | null; } | null; payload_fingerprint?: string | null; provider_metadata?: { [key: string]: unknown; } | null; safe_provider_invoice_snapshot?: { [key: string]: unknown; } | null; }; type WebhookEndpoint = { /** * Unique identifier for the webhook endpoint */ id: string; /** * The URL that receives webhook POST requests */ url: string; /** * Optional human-readable description */ description: string | null; /** * Event types this endpoint subscribes to */ enabled_events: Array; /** * Whether the endpoint is currently receiving events */ status: 'enabled' | 'disabled'; /** * Signing secret. Returned only on create or secret rotation. */ secret?: string; /** * Circuit breaker status. Opens after repeated delivery failures. */ circuit_breaker_state: 'closed' | 'open' | 'half_open'; /** * Total number of delivery attempts */ total_deliveries: number; /** * Number of successful deliveries */ successful_deliveries: number; /** * Number of failed deliveries */ failed_deliveries: number; /** * Timestamp of the most recent delivery attempt */ last_delivery_at: string | null; /** * When the endpoint was created */ created_at: string; /** * When the endpoint was last modified */ updated_at: string; }; type WebhookDeliveryListResponse = { object: 'list'; data: Array; has_more: boolean; url: string; }; /** * A record of a single webhook delivery attempt chain to one endpoint for one event. Use these records to debug specific delivery failures and to retry individual deliveries. */ type WebhookDelivery = { id: string; object: 'webhook_delivery'; endpoint_id: string; /** * The event this delivery attempted to send. */ event_id: string; event_type: string | null; /** * Delivery state. pending: queued or retrying. succeeded: 2xx response received. failed: last attempt failed, may retry based on attempts/max_attempts. dead_lettered: max attempts exhausted, will not retry automatically. */ status: 'pending' | 'succeeded' | 'failed' | 'dead_lettered'; attempts: number; max_attempts: number; /** * HTTP status code returned on the last attempt. */ last_status_code: number | null; /** * Truncated error message from the last failed attempt. */ last_error: string | null; last_error_code: string | null; last_duration_ms: number | null; last_attempt_at: string | null; next_retry_at: string | null; delivered_at: string | null; dead_lettered_at: string | null; dead_letter_reason: string | null; created_at: string; updated_at: string; }; type WebhookDeliveryErrorResponse = { error: { type: string; code: string; message: string; }; }; type WebhookDeliveryResponse = { data: WebhookDelivery; }; type WebhookDeliveryRetryResponse = { data: WebhookDelivery; }; type CustomerPortalErrorResponse = { error: { type: string; code: string; message: string; }; }; /** * Parameters for creating a customer-portal session. The authenticated merchant must already own the referenced customer. */ type CreateCustomerPortalSessionRequest = { /** * UUID of the customer this session will authenticate as. */ customer_id: string; /** * Lifetime of the session token in minutes. Between 5 and 240; default 60. Shorter TTLs reduce blast radius if a token leaks. */ ttl_minutes?: number; }; type PortalCustomerResponse = { data: PortalCustomer; }; /** * The authenticated customer, as visible through the customer-portal surface. This is a deliberately thinner projection than the merchant-facing `Customer` — it omits tax IDs, internal metadata, and anything that could leak merchant-side context to the customer. */ type PortalCustomer = { id: string; object: 'customer'; email: string | null; name: string | null; phone: string | null; company_name: string | null; default_currency: string | null; locale: string | null; created_at: string; }; type PortalSubscriptionList = { object: 'list'; data: Array; has_more: boolean; url: string; }; /** * A customer-facing subscription projection. Pricing and cadence fields are exposed; merchant-only bookkeeping fields (plan_id, external IDs) are not. */ type PortalSubscription = { id: string; object: 'subscription'; status: string; currency: string | null; amount_minor: number | null; interval: string | null; interval_count: number | null; billing_end_strategy: string | null; billing_max_cycles: number | null; current_period_start: string | null; current_period_end: string | null; trial_end: string | null; cancel_at: string | null; canceled_at: string | null; started_at: string | null; created_at: string; }; type PortalSubscriptionResponse = { data: PortalSubscription; }; type PortalSubscriptionCancelResponse = { data: PortalSubscription; }; type CancelSubscriptionRequest = { /** * If `true` (default), cancel at the end of the current period. If `false`, cancel immediately. */ cancel_at_period_end?: boolean; /** * Merchant-visible note recording why the customer canceled. */ reason?: string; }; type PortalInvoiceList = { object: 'list'; data: Array; has_more: boolean; url: string; }; /** * A customer-facing invoice projection. Lists and retrievals are scoped to invoices owned by the authenticated customer. */ type PortalInvoice = { id: string; object: 'invoice'; invoice_number: string | null; status: string; currency: string | null; subtotal: number | null; tax_amount: number | null; discount_amount: number | null; total: number; amount_paid: number | null; amount_due: number | null; invoice_date: string | null; due_date: string | null; paid_at: string | null; created_at: string; }; type PortalInvoiceResponse = { data: PortalInvoice; }; type PortalMandateList = { object: 'list'; data: Array; has_more: boolean; url: string; }; /** * A customer-facing Direct Debit mandate projection. Bank details are masked — only the last 4 digits of the account number are exposed. */ type PortalMandate = { id: string; object: 'mandate'; status: string; account_holder_name: string | null; account_number_last4: string | null; bank_name: string | null; mandate_reference: string | null; next_collection_date: string | null; created_at: string | null; }; type PortalReauthorizeMandateResponse = { data: PortalMandate; }; type PortalReauthorizeMandateRequest = { account_holder_name: string; sort_code: string; account_number: string; verification_token: string; acceptance: { accountHolder: true; soleSignatory: true; }; }; type PortalReauthorizeSendOtpResponse = { ok: boolean; }; type PortalReauthorizeVerifyOtpResponse = { verification_token: string; }; type PortalReauthorizeVerifyOtpRequest = { code: string; }; type CustomerMeterList = { object: 'list'; data: Array; /** * Customer-meter list responses are not paginated — every meter the merchant has is returned for the specified customer. */ has_more: false; url: string; }; /** * An on-the-fly aggregate of a customer's consumption for a single meter. RevKeen computes this live from `usage_events` — there is no separate `customer_meters` table to keep in sync. */ type CustomerMeter = { object: 'customer_meter'; customer_id: string; meter_id: string; meter_name: string; /** * The `event_name` the merchant's code posts to /v2/usage-events for this meter. */ meter_event_name: string; /** * How quantities are aggregated. Typical values: `sum`, `count`, `max`, `unique`. */ aggregation: string; /** * Human-readable unit for display (e.g. `tokens`, `requests`, `GB`). Merchant-configurable. */ unit_name: string | null; /** * Aggregate across all usage events for this (customer, meter) pair. The aggregation function applied matches the meter's `aggregation` field. */ total_quantity: number; /** * Number of `usage_events` rows that contributed to the aggregate. Diagnostic — not the aggregate itself. */ event_count: number; /** * Timestamp of the most recent usage event. Null if no events have been recorded. */ last_event_at: string | null; }; type CustomerMeterErrorResponse = { error: { type: string; code: string; message: string; }; }; type CustomerMeterResponse = { data: CustomerMeter; }; /** * A PaymentIntent tracks the lifecycle of a payment from creation through authorization, optional 3DS authentication, and final capture. */ type PaymentIntent = { /** * Public payment intent ID (pi_xxx) */ id: string; /** * Object type */ object: 'payment_intent'; /** * Amount in cents */ amount: number; /** * Amount that can be captured (for manual capture) */ amount_capturable: number; /** * Amount actually received */ amount_received: number; /** * Three-letter ISO currency code */ currency: string; /** * Customer ID */ customer: string; /** * Description for merchant reference */ description?: string | null; /** * Last error from payment attempt */ last_payment_error?: { /** * Error code */ code: string; /** * Human-readable error message */ message: string; /** * Card decline code if applicable */ decline_code?: string; /** * Payment method that caused the error */ payment_method?: { /** * Payment method ID */ id: string; /** * Payment method type */ type: string; }; } | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Action required from customer (3DS, etc.) */ next_action?: { /** * Type of action required */ type: 'redirect_to_url' | 'use_stripe_sdk' | 'display_bank_transfer_instructions'; /** * Present when type is redirect_to_url */ redirect_to_url?: { /** * URL to redirect customer for 3DS authentication */ url: string; /** * URL to return to after 3DS */ return_url: string; }; } | null; /** * Payment method ID */ payment_method?: string | null; /** * Email for receipt */ receipt_email?: string | null; /** * Statement descriptor */ statement_descriptor?: string | null; /** * Statement descriptor suffix */ statement_descriptor_suffix?: string | null; /** * Payment intent status. requires_payment_method: Needs payment method. requires_confirmation: Ready to confirm. requires_action: Requires customer action (3DS). processing: Being processed. succeeded: Payment complete. canceled: Canceled. */ status: 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'succeeded' | 'canceled'; /** * Capture method. automatic: Capture immediately on confirmation. manual: Authorize then capture separately. */ capture_method: 'automatic' | 'manual'; /** * Client secret for frontend confirmation */ client_secret: string; /** * When the intent was canceled */ canceled_at?: string | null; /** * Why the intent was canceled */ cancellation_reason?: 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'abandoned' | 'failed_invoice' | null; /** * Unix timestamp of creation */ created: number; /** * Whether in live mode */ livemode: boolean; }; /** * Error response returned when a payment intent operation fails. */ type PaymentIntentErrorResponse = { error: { /** * Error type (api_error, invalid_request_error, etc.) */ type: string; /** * Error code */ code: string; /** * Human-readable error message */ message: string; /** * Parameter that caused the error */ param?: string; }; }; /** * Parameters for creating a new payment intent. Specify the amount, currency, customer, and optionally a payment method and capture strategy. */ type CreatePaymentIntentRequest = { /** * Amount in cents. Must be greater than 0. */ amount: number; /** * Three-letter ISO currency code. Defaults to USD. */ currency?: string; /** * Customer ID to charge */ customer: string; /** * Payment method ID. If not provided, status will be requires_payment_method. */ payment_method?: string; /** * Capture method. Defaults to automatic. */ capture_method?: 'automatic' | 'manual'; /** * Description for merchant reference */ description?: string; /** * Statement descriptor shown on customer's statement */ statement_descriptor?: string; /** * Statement descriptor suffix */ statement_descriptor_suffix?: string; /** * Email to send receipt to */ receipt_email?: string; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Specific gateway merchant ID for multi-MID setups (NMI) */ gateway_merchant_id?: string; }; /** * A paginated list of payment intents matching the query filters. */ type PaymentIntentListResponse = { object: 'list'; data: Array; has_more: boolean; /** * The URL for accessing this list */ url: string; }; /** * Parameters for updating a payment intent before confirmation. Only amount, description, payment method, and metadata can be changed. */ type UpdatePaymentIntentRequest = { /** * Amount in cents */ amount?: number; /** * Three-letter ISO currency code */ currency?: string; /** * Payment method ID */ payment_method?: string; /** * Description for merchant reference */ description?: string; /** * Statement descriptor */ statement_descriptor?: string; /** * Statement descriptor suffix */ statement_descriptor_suffix?: string; /** * Email to send receipt to */ receipt_email?: string; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; }; /** * Parameters for confirming a payment intent. Optionally attach a payment method and specify a return URL for 3DS flows. */ type ConfirmPaymentIntentRequest = { /** * Payment method ID. Required if not already set on the intent. */ payment_method?: string; /** * URL to redirect to after 3DS authentication */ return_url?: string; }; /** * Parameters for capturing a previously authorized payment intent. Specify amount_to_capture for partial captures. */ type CapturePaymentIntentRequest = { /** * Amount to capture in cents. Defaults to full authorized amount. */ amount_to_capture?: number; }; /** * Parameters for canceling a payment intent that has not yet been captured. */ type CancelPaymentIntentRequest = { /** * Reason for cancellation */ cancellation_reason?: 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'abandoned' | 'failed_invoice'; }; /** * A SetupIntent saves a payment method for future use WITHOUT charging the customer. Use it to collect and verify card details before storing them. */ type SetupIntent = { /** * Unique identifier for the setup intent */ id: string; /** * Object type, always 'setup_intent' */ object: 'setup_intent'; /** * Public ID visible in API responses (seti_xxx format) */ public_id: string; /** * The status of the setup intent */ status: 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'succeeded' | 'canceled'; /** * ID of the customer this setup intent is for */ customer_id: string | null; /** * ID of the payment method being set up */ payment_method_id: string | null; /** * Allowed payment method types for this setup */ payment_method_types: Array; /** * Indicates how the payment method will be used */ usage: 'on_session' | 'off_session'; next_action: SetupIntentNextAction; /** * Client secret for frontend confirmation */ client_secret: string; /** * Name of the payment processor that handled this setup intent */ gateway: string; last_error: SetupIntentError; /** * Reason for cancellation if canceled */ cancellation_reason: 'abandoned' | 'requested_by_customer' | 'duplicate' | null; /** * Merchant description for reference */ description: string | null; /** * Custom metadata attached to the setup intent */ metadata: { [key: string]: unknown; }; /** * When the setup intent was confirmed */ confirmed_at: string | null; /** * When the setup intent was canceled */ canceled_at: string | null; /** * When the setup intent was created */ created_at: string; /** * When the setup intent was last updated */ updated_at: string; }; /** * Action required from customer (3DS redirect, etc.) */ type SetupIntentNextAction = { /** * The type of action to take */ type: 'redirect_to_url' | 'use_stripe_sdk'; /** * Redirect details for 3DS authentication */ redirect_to_url?: { /** * The URL to redirect the customer to */ url: string; /** * The URL to redirect back to after completion */ return_url: string; }; /** * SDK-specific data for client-side handling */ use_stripe_sdk?: { [key: string]: unknown; }; } | null; /** * Last error encountered during setup */ type SetupIntentError = { /** * Error code */ code: string; /** * Human-readable error message */ message: string; /** * Decline code from the payment gateway */ decline_code?: string; /** * The payment method that caused the error */ payment_method?: { id: string; type: string; }; } | null; /** * Parameters for creating a setup intent to save a payment method for a customer. */ type CreateSetupIntentRequest = { /** * ID of the customer to attach the payment method to */ customer_id?: string; /** * Allowed payment method types */ payment_method_types?: Array; /** * How the payment method will be used */ usage?: 'on_session' | 'off_session'; /** * Merchant description for reference */ description?: string; /** * Custom metadata to attach */ metadata?: { [key: string]: unknown; }; }; /** * A paginated list of setup intents matching the query filters. */ type SetupIntentList = { /** * Object type, always 'list' */ object: 'list'; /** * Array of setup intents */ data: Array; /** * Whether there are more results available */ has_more: boolean; /** * Total count of matching setup intents */ total_count: number; /** * URL for this list resource */ url: string; }; /** * Parameters for updating a setup intent before confirmation. */ type UpdateSetupIntentRequest = { /** * ID of the customer to attach the payment method to */ customer_id?: string; /** * Allowed payment method types */ payment_method_types?: Array; /** * Merchant description for reference */ description?: string; /** * Custom metadata to attach */ metadata?: { [key: string]: unknown; }; }; /** * Parameters for confirming a setup intent, which verifies the payment method and saves it for future use. */ type ConfirmSetupIntentRequest = { /** * ID of the payment method to confirm with */ payment_method_id?: string; /** * URL to redirect to after 3DS authentication */ return_url?: string; }; /** * Parameters for canceling a setup intent that is no longer needed. */ type CancelSetupIntentRequest = { /** * Reason for cancellation */ cancellation_reason?: 'abandoned' | 'requested_by_customer' | 'duplicate'; }; /** * A list of payment methods attached to a customer, with optional type filtering. */ type PaymentMethodList = { /** * Object type, always 'list' */ object: 'list'; /** * Array of payment methods */ data: Array; /** * Whether there are more results available */ has_more: boolean; /** * URL for this list resource */ url: string; }; /** * Parameters for updating a payment method's billing details or metadata. */ type UpdatePaymentMethodRequest = { billing_details?: BillingDetails & unknown; /** * Custom metadata to attach */ metadata?: { [key: string]: unknown; }; }; /** * Parameters for attaching a payment method to a customer. The payment method must have been created first. */ type AttachPaymentMethodRequest = { /** * ID of the customer to attach the payment method to */ customer_id: string; }; /** * A paginated list of events matching the query filters. */ type EventListResponse = { object: 'list'; data: Array; has_more: boolean; /** * The URL for accessing this list */ url: string; }; /** * An event represents something that happened in your account — a payment succeeded, an invoice was created, a subscription changed. Events are the source of truth for webhook delivery. */ type Event = { /** * Unique event identifier */ id: string; /** * Object type */ object: 'event'; /** * Event type (e.g., invoice.paid, payment.succeeded) */ type: string; /** * Event data containing the affected object */ data: { /** * The object that triggered the event (invoice, payment, etc.) */ object?: unknown; /** * Previous values of attributes that changed (for update events) */ previous_attributes?: unknown; }; request: EventRequest; /** * Number of webhooks still pending delivery for this event */ pending_webhooks: number; /** * API version used to render this event */ api_version: string | null; /** * Whether this event was produced in live mode */ livemode: boolean; /** * Unix timestamp when the event was created */ created: number; }; /** * Information about the request that triggered this event */ type EventRequest = { /** * Request ID that triggered this event (if applicable) */ id: string | null; /** * Idempotency key used in the request (if applicable) */ idempotency_key: string | null; } | null; /** * Error response returned when an event operation fails. */ type EventErrorResponse = { error: { /** * Error type */ type: string; /** * Error code */ code: string; /** * Human-readable error message */ message: string; /** * Parameter that caused the error */ param?: string; }; }; /** * Confirmation that a webhook event was resent to the specified endpoint. */ type ResendWebhookResponse = { /** * Whether the webhook was queued for resending */ success: boolean; /** * The webhook endpoint ID the event was sent to */ webhook_endpoint_id?: string; /** * Additional information */ message?: string; }; /** * The test event that was sent, including delivery status. */ type TestEventResponse = { /** * Whether the test event was created */ success: boolean; event?: Event & unknown; /** * Additional information */ message?: string; }; /** * Parameters for creating a test event to verify your webhook endpoint integration. */ type CreateTestEventRequest = { /** * The type of test event to create */ type: 'checkout.session.completed' | 'checkout.session.expired' | 'checkout.session.async_payment_succeeded' | 'checkout.session.async_payment_failed' | 'invoice.created' | 'invoice.finalized' | 'invoice.paid' | 'invoice.payment_failed' | 'invoice.voided' | 'invoice.marked_uncollectible' | 'invoice.upcoming' | 'invoice.sent' | 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.disputed' | 'payment_intent.created' | 'payment_intent.succeeded' | 'payment_intent.payment_failed' | 'payment_intent.canceled' | 'payment_intent.requires_action' | 'payment_method.attached' | 'payment_method.detached' | 'payment_method.updated' | 'subscription.created' | 'subscription.updated' | 'subscription.canceled' | 'subscription.paused' | 'subscription.resumed' | 'subscription.trial_will_end' | 'subscription.renewed' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'refund.created' | 'refund.updated' | 'refund.failed' | 'dispute.created' | 'dispute.updated' | 'dispute.closed' | 'order.created' | 'order.paid' | 'order.canceled'; }; /** * A subscription schedule defines future changes to a subscription. Each phase specifies different pricing, quantities, or plans that take effect at specified dates. */ type SubscriptionSchedule = { /** * Public schedule ID (sub_sched_xxx) */ id: string; /** * Object type */ object: 'subscription_schedule'; /** * Schedule status. not_started: Scheduled for future. active: Currently executing phases. completed: All phases finished. canceled: Manually canceled. released: Detached from subscription. */ status: 'not_started' | 'active' | 'completed' | 'canceled' | 'released'; /** * Customer ID */ customer: string | null; /** * Linked subscription ID */ subscription: string | null; /** * Current phase being executed */ current_phase: { /** * Phase start (Unix timestamp) */ start_date: number; /** * Phase end (Unix timestamp) */ end_date: number | null; } | null; /** * All phases in the schedule */ phases: Array; /** * What happens when the schedule completes. cancel: Cancel the subscription. release: Make subscription standalone. */ end_behavior: 'cancel' | 'release'; /** * When released (Unix timestamp) */ released_at?: number | null; /** * Subscription ID at release time */ released_subscription?: string | null; /** * Custom metadata */ metadata?: { [key: string]: unknown; }; /** * Unix timestamp of creation */ created: number; /** * Whether in live mode */ livemode: boolean; }; /** * A time-bounded phase within a subscription schedule, with its own pricing, quantities, and billing configuration. */ type SchedulePhase = { /** * Products/prices included in this phase */ items: Array; /** * When this phase starts (ISO 8601 date) */ start_date: string; /** * When this phase ends (null for indefinite) */ end_date?: string | null; /** * How to handle prorations when entering this phase */ proration_behavior?: 'create_prorations' | 'none' | 'always_invoice'; /** * Override billing cycle anchor for this phase */ billing_cycle_anchor?: string | null; /** * Payment method to use for this phase */ default_payment_method?: string | null; /** * How to collect payment for this phase */ collection_method?: 'charge_automatically' | 'send_invoice'; /** * Coupon code to apply during this phase */ coupon?: string | null; /** * End of trial period (if applicable) */ trial_end?: string | null; /** * Phase-specific metadata */ metadata?: { [key: string]: unknown; }; }; /** * A product-price pair within a schedule phase, defining what the customer is billed for during that phase. */ type PhaseItem = { /** * Price ID for this item */ price_id: string; /** * Quantity of this item */ quantity?: number; }; /** * Error response returned when a subscription schedule operation fails. */ type SubscriptionScheduleErrorResponse = { error: { /** * Error type */ type: string; /** * Error code */ code: string; /** * Human-readable error message */ message: string; /** * Parameter that caused the error */ param?: string; }; }; /** * Parameters for creating a subscription schedule with one or more phases of pricing and billing changes. */ type CreateSubscriptionScheduleRequest = { /** * Customer ID (required if no subscription) */ customer?: string; /** * Existing subscription to attach schedule to */ subscription?: string; /** * When schedule starts. 'now', ISO date, or Unix timestamp. Defaults to now. */ start_date?: 'now' | string | number; /** * Phases defining the schedule (at least one required) */ phases: Array; /** * What happens when all phases complete */ end_behavior?: 'cancel' | 'release'; /** * Custom metadata */ metadata?: { [key: string]: unknown; }; }; /** * A paginated list of subscription schedules matching the query filters. */ type SubscriptionScheduleListResponse = { object: 'list'; data: Array; has_more: boolean; /** * The URL for accessing this list */ url: string; }; /** * Parameters for updating a subscription schedule's phases before they take effect. */ type UpdateSubscriptionScheduleRequest = { /** * Replace all phases */ phases?: Array; /** * What happens when all phases complete */ end_behavior?: 'cancel' | 'release'; /** * Proration behavior when updating phases */ proration_behavior?: 'create_prorations' | 'none' | 'always_invoice'; /** * Custom metadata */ metadata?: { [key: string]: unknown; }; }; /** * Parameters for canceling a subscription schedule, optionally reverting the subscription to its pre-schedule state. */ type CancelSubscriptionScheduleRequest = { /** * Generate a final invoice immediately */ invoice_now?: boolean; /** * Prorate final invoice */ prorate?: boolean; }; /** * Parameters for releasing a subscription schedule, detaching it from the subscription while keeping current terms. */ type ReleaseSubscriptionScheduleRequest = { /** * Keep the subscription's cancel_at date if set */ preserve_cancel_date?: boolean; }; /** * A single terminal payment object with full device and transaction details. */ type TerminalPaymentResponse = { data: TerminalPayment; }; /** * A card-present payment processed through a POS terminal, with device details and card entry mode. */ type TerminalPayment = { /** * Unique identifier for this terminal payment attempt */ id: string; /** * Associated invoice ID, or null for walk-in/ad-hoc payments */ invoice_id: string | null; /** * The terminal device that processed (or is processing) this payment */ device_id: string | null; /** * Transaction type. sale: original charge. refund: money returned. void: pre-settlement cancellation. */ type: 'sale' | 'refund' | 'void'; /** * Payment lifecycle status. requested: command sent, awaiting card. in_progress: terminal processing. approved: payment succeeded. declined: issuer declined. cancelled: merchant cancelled. error: terminal error. timed_out: no response within 3 minutes. */ status: 'requested' | 'in_progress' | 'approved' | 'declined' | 'cancelled' | 'error' | 'timed_out' | 'standalone_approved' | 'standalone_declined'; /** * Amount in minor units (e.g., pence for GBP, cents for USD) */ amount_minor: number; /** * ISO 4217 currency code */ currency: string; /** * Payment reference (invoice number or custom reference) */ reference: string | null; /** * Serial number of the PAX terminal that processed this payment */ terminal_serial: string | null; /** * Unique Transaction Identifier from the terminal */ uti: string | null; /** * Authorization code from the payment processor. Present when approved. */ auth_code: string | null; /** * Terminal response code. '00' indicates approval. */ response_code: string | null; /** * Retrieval Reference Number for settlement reconciliation */ rrn: string | null; /** * Card network (e.g., VISA, MASTERCARD, AMEX) */ card_scheme: string | null; /** * Masked card number — only the last 4 digits are visible */ masked_pan: string | null; /** * How the card was read: contactless (NFC tap), emv_chip (chip insert), magnetic_stripe (swipe), manual_entry (keyed), or fallback (chip-to-swipe) */ entry_mode: string | null; /** * Human-readable error message when status is error or timed_out */ error_message: string | null; /** * ISO 8601 timestamp when the payment was initiated */ created_at: string; /** * ISO 8601 timestamp when the terminal returned a result, or null if still in progress */ completed_at: string | null; }; /** * Error response returned when a terminal payment operation fails. */ type TerminalPaymentErrorResponse = { error: string; message?: string; code?: string; }; /** * Parameters for initiating a card-present payment on a POS terminal device. */ type CreateTerminalPaymentRequest = { /** * The ID of the terminal device to send the payment to. Use List Devices to discover available device IDs. Even merchants with a single terminal must pass the device_id explicitly — there is no auto-routing fallback. */ device_id: string; /** * Amount in minor units (e.g., pence for GBP, cents for USD) */ amount_minor: number; /** * ISO 4217 currency code */ currency: string; /** * The invoice to charge. Omit for walk-in or ad-hoc payments where no invoice exists. When omitted, the terminal payment is recorded without an invoice association. */ invoice_id?: string; /** * Custom reference for the payment. Auto-generated if not provided. */ reference?: string; }; /** * A paginated list of terminal payments matching the query filters. */ type TerminalPaymentListResponse = { data: Array; meta: { count: number; limit: number; }; }; /** * Parameters for refunding a completed terminal payment, optionally specifying a partial amount. */ type RefundTerminalPaymentRequest = { /** * Amount to refund in minor units. Omit for a full refund. */ amount_minor?: number; /** * Reason for the refund */ reason?: string; }; /** * Parameters for voiding an unsettled terminal payment before end-of-day settlement. */ type VoidTerminalPaymentRequest = { /** * Reason for the void */ reason?: string; }; /** * A list of terminal devices registered for your merchant account. */ type TerminalDeviceListResponse = { data: Array; meta: { count: number; }; }; /** * A POS terminal device registered to your merchant account, with connection status and capabilities. */ type TerminalDevice = { /** * Unique identifier for this terminal device. Use this as the device_id when initiating payments. */ id: string; /** * Friendly name assigned to this device (e.g., 'Front Desk Terminal') */ device_name: string | null; /** * Serial number of the paired PAX terminal hardware */ terminal_serial: string | null; /** * The LAN IP address of the terminal as seen by the connector on the merchant's local network. This is not a publicly reachable address — all commands flow through the RevKeen cloud. */ terminal_ip: string | null; /** * Operating system of the machine running the Terminal Connector application */ platform: 'macos' | 'windows' | 'linux' | null; /** * Device connectivity status. online: connector connected and heartbeat within 5 minutes. offline: heartbeat stale or connector disconnected. pairing: connector registered but terminal not yet paired. */ status: 'online' | 'offline' | 'pairing'; /** * Whether a PAX terminal has been paired to this connector device. Must be true to accept payments. */ terminal_paired: boolean; /** * Whether the connector can currently reach the PAX terminal on the local network */ terminal_reachable: boolean | null; /** * Version of the Terminal Connector application */ app_version: string | null; /** * ISO 8601 timestamp of the last heartbeat received from this device. Devices with no heartbeat in 5 minutes are considered offline. */ last_heartbeat_at: string | null; }; /** * Error response returned when a terminal device operation fails. */ type TerminalDeviceErrorResponse = { error: string; message?: string; }; /** * A single terminal device with connection status and configuration details. */ type TerminalDeviceResponse = { data: TerminalDevice; }; /** * Result of a batch ingest operation showing how many events were accepted, skipped, duplicated, or rejected. duplicate means the event's idempotency_key has already been seen for this merchant. */ type BatchIngestResult = { object: 'usage_event_batch_result'; summary: { ingested: number; duplicate: number; skipped: number; failed: number; }; data: Array<{ index: number; status: 'ingested' | 'duplicate' | 'skipped' | 'failed'; id?: string; reason?: string; }>; }; /** * Error response returned when a usage event operation fails. */ type UsageEventError = { error: string | { message: string; type: string; }; }; /** * Usage event ingest request. Send either one usage event object directly, or wrap up to 1000 events in an events array. */ type UsageIngestRequest = UsageEvent | BatchIngestRequest; /** * A single usage event representing customer consumption of a metered resource. Provide one of customer_id, external_customer_id, or subscription_id. Idempotency is permanent per merchant via the usage_events merchant/idempotency unique index. Each subscription has one currency; usage events attributed to it are interpreted in that currency with no metering-layer FX conversion. */ type UsageEvent = { /** * Event name matching a meter's event_name */ name: string; /** * RevKeen customer ID. Prefer external_customer_id unless your system already stores RevKeen customer UUIDs. */ customer_id?: string; /** * Your external customer identifier. Recommended attribution field; unknown values fail rather than creating orphan usage. */ external_customer_id?: string; /** * Subscription ID to attribute usage to. Usage is assumed to share the subscription currency; RevKeen does not perform FX conversion in metering. */ subscription_id?: string; /** * Direct meter ID (alternative to event name matching) */ meter_id?: string; /** * Event quantity (default: 1). For percentage-priced meters, send the signed transaction amount in the subscription currency's minor units. */ quantity?: number; /** * ISO 8601 timestamp (default: now) */ timestamp?: string; /** * REQUIRED merchant-scoped deduplication key (REV-6490). Reusing the same key returns duplicate status and does not create another billable event. Compose it from stable business identifiers (entity ids, types), never from timestamps. */ idempotency_key: string; /** * Arbitrary properties for filtering and aggregation */ metadata?: { [key: string]: unknown; }; }; /** * A batch of usage events to ingest, supporting up to 1000 events per request. */ type BatchIngestRequest = { /** * Array of usage events (1–1000) */ events: Array; }; /** * Result of a dry-run ingest showing how events would be matched to meters without persisting them. */ type DryRunResult = { object: 'usage_event_dry_run_result'; summary: { would_ingest: number; would_skip: number; would_fail: number; }; data: Array<{ index: number; status: 'would_ingest' | 'would_skip' | 'would_fail'; validationDetails: { meterMatched: boolean; customerMatched: boolean; billableQuantity: number; filtersPassed: boolean; }; reason?: string; }>; }; /** * A paginated list of usage events matching the query filters. */ type UsageEventListResponse = { object: 'list'; /** * Array of usage event objects */ data: Array; has_more: boolean; }; /** * A persisted usage event record. */ type UsageEventRecord = { /** * Usage event ID */ id: string; /** * Owning merchant ID */ merchant_id: string; /** * Customer ID */ customer_id: string | null; /** * Subscription ID */ subscription_id: string | null; /** * Meter ID */ meter_id: string | null; /** * Event quantity */ quantity: number; /** * Event timestamp (ISO 8601) */ event_time: string; /** * Deduplication key */ idempotency_key: string | null; /** * External event identifier */ external_id: string | null; /** * Ingestion source */ source: string; /** * Arbitrary event metadata */ metadata: { [key: string]: unknown; }; /** * Arbitrary event properties used for filtering/aggregation */ properties: { [key: string]: unknown; }; /** * When the event was ingested (ISO 8601) */ ingestion_timestamp: string | null; /** * Creation timestamp (ISO 8601) */ created_at: string; }; /** * Aggregated usage totals grouped by meter and time period. */ type UsageAggregateResponse = { object: 'usage_aggregate'; meter_id: string; start_time: string; end_time: string; /** * Aggregated usage value */ value: number; /** * Number of events in range */ event_count: number; }; /** * Current-period usage balance across all meters for a customer, with per-meter breakdowns and estimated totals. */ type UsageBalanceResponse = { object: 'usage_balance'; meters: Array; /** * Total estimated charge across all meters */ total_estimated_amount_minor: number; /** * Total cost across all meters (null if no cost data) */ total_cost_minor: number | null; /** * Payment-processing cost from transaction_costs for matching paid transactions. Null when no matching settled/paid cost evidence is available. */ total_payment_processing_cost_minor: number | null; /** * RevKeen/platform fee from transaction_costs for matching paid transactions. Null when no matching settled/paid cost evidence is available. */ total_platform_fee_minor: number | null; /** * Total estimated charge minus AI provider COGS, payment-processing cost, and platform fee. Null until all cost inputs are available. */ true_net_margin_minor: number | null; /** * true_net_margin_minor as a percentage of total_estimated_amount_minor. Null until true-net margin is available. */ true_net_margin_percent: number | null; /** * Currency code */ currency: string; }; /** * Current-period usage for a single meter, including consumed units, included allowance, overage, and estimated cost. */ type UsageBalanceMeter = { /** * Meter ID */ meter_id: string; /** * Meter display name */ meter_name: string; /** * Attached price display name */ price_name: string | null; /** * Unit display name */ unit_name: string | null; /** * Pricing scheme used for estimated charges: per_unit, tiered, or percentage */ billing_scheme: string | null; /** * Tier mode when billing_scheme is tiered */ tiers_mode: string | null; /** * Per-unit amount in minor currency units when applicable. Null when the rate is sub-penny — see `unit_amount_decimal`. */ unit_amount_minor: number | null; /** * Exact per-unit rate in minor units as a decimal string (sub-penny safe, e.g. "0.02"). Mirrors Stripe's `unit_amount_decimal`. */ unit_amount_decimal?: string | null; /** * Package size when package-style metered pricing is configured */ package_size: number | null; /** * Percentage rate in basis points when billing_scheme is percentage. 70 = 0.7%. */ percentage_rate_bps: number | null; /** * Aggregated usage in current period */ current_value: number; /** * Units included in plan (0 if pure metered) */ included_quantity: number; /** * Usage consumed (same as current_value) */ used_quantity: number; /** * Remaining included units (max 0) */ remaining_included: number; /** * Units over allowance (max 0) */ overage_quantity: number; /** * Estimated charge for overage in minor units */ estimated_amount_minor: number; /** * Sum of event cost annotations (null if no cost data) */ total_cost_minor: number | null; /** * Estimated margin: revenue - cost (null if no cost data) */ margin_minor: number | null; /** * Currency code */ currency: string; /** * Current billing period start (ISO 8601) */ period_start: string; /** * Current billing period end (ISO 8601) */ period_end: string; /** * Most recent usage event timestamp in the current billing period */ last_event_at: string | null; }; type EntitlementListResponse = { data: Array; pagination: { limit: number; offset: number; total: number; }; customer: { id: string; email: string; name: string | null; }; }; type Entitlement = { id: string; customer_id: string; benefit_id: string; benefit: Benefit; granted_at: string; expires_at: string | null; metadata: { [key: string]: unknown; }; status: 'active' | 'trialing' | 'grace' | 'past_due' | 'restricted' | 'suspended' | 'canceled'; has_access: boolean; access_level: 'full' | 'partial' | 'none'; subscription_id: string | null; subscription_status: string | null; }; type Benefit = { id: string; name: string; description: string | null; benefit_type: string; benefit_key: string; category: string | null; icon_url: string | null; display_order: string | null; is_active: boolean | null; default_value?: unknown; config?: unknown; } | null; type EntitlementCheckResponse = { data: EntitlementCheck; }; type EntitlementCheck = { benefit_key: string; has_access: boolean; access_level: 'full' | 'partial' | 'none'; status: 'active' | 'trialing' | 'grace' | 'past_due' | 'restricted' | 'suspended' | 'canceled' | null; benefit: Benefit; reason: string | null; }; /** * A paginated list of transactions matching the query filters. */ type TransactionListResponse = { object: 'list'; data: Array; has_more: boolean; total_count?: number; }; /** * A financial movement in the unified transaction model. Every money movement — payments, refunds, voids, disputes — is recorded as a transaction linked to an invoice. */ type Transaction = { /** * Unique identifier for the transaction */ id: string; /** * Object type */ object: 'transaction'; /** * Transaction type. sale: original payment. refund: money returned. void: cancel before settlement. capture: capture a previous auth. dispute: chargeback. adjustment: manual correction. */ type: 'sale' | 'refund' | 'void' | 'capture' | 'dispute' | 'adjustment'; /** * Transaction status. pending: processing. succeeded: completed. failed: declined or errored. voided: canceled. */ status: 'pending' | 'succeeded' | 'failed' | 'voided'; /** * Associated invoice ID */ invoice_id: string; /** * Customer ID */ customer_id?: string | null; /** * Parent transaction ID (required for refunds, voids, disputes, adjustments) */ parent_transaction_id?: string | null; /** * Three-letter ISO currency code */ currency: string; /** * Transaction amount in minor units (cents) */ amount: number; /** * Amount refunded in minor units */ amount_refunded?: number; /** * Payment gateway (e.g., 'nmi') */ gateway?: string | null; /** * Gateway's transaction reference */ gateway_transaction_id?: string | null; /** * Gateway response code */ gateway_response_code?: string | null; /** * Gateway response message */ gateway_response_text?: string | null; /** * Payment method type (card, ach, wallet) */ payment_method_type?: string | null; /** * Card brand (visa, mastercard, etc.) */ card_brand?: string | null; /** * Last 4 digits of card */ card_last_four?: string | null; /** * Custom key-value metadata */ metadata?: { [key: string]: unknown; }; /** * Creation timestamp (ISO 8601) */ created_at: string; /** * Last update timestamp (ISO 8601) */ updated_at: string; }; /** * A single transaction object. */ type TransactionRetrieveResponse = { data: Transaction; }; /** * The created export job in 'pending' status. */ type ExportCreateResponse = { data: Export; }; /** * An async data export job. Create an export, poll for completion, then download the file via the presigned URL. */ type Export = { /** * Unique export job ID */ id: string; /** * Object type */ object: 'export'; /** * Export job status. pending: queued. processing: generating file. completed: ready for download. failed: export failed. */ status: 'pending' | 'processing' | 'completed' | 'failed'; /** * The type of resource to export. */ resource_type: 'customers' | 'invoices' | 'transactions' | 'subscriptions' | 'products' | 'payment_methods'; /** * Output file format. csv: Comma-separated values. xlsx: Excel workbook. */ format: 'csv' | 'xlsx'; /** * Presigned download URL (available when status is 'completed'). Expires after 1 hour. */ download_url?: string | null; /** * Total rows exported (available when completed) */ total_rows?: number | null; /** * File size in bytes (available when completed) */ file_size_bytes?: number | null; /** * Error message (if status is 'failed') */ error_message?: string | null; /** * When the export was requested (ISO 8601) */ created_at: string; /** * When the export completed (ISO 8601) */ completed_at?: string | null; }; /** * Parameters for creating an async data export. The export is processed in the background — poll GET /v2/exports/:id for status. */ type CreateExportRequest = { /** * The type of resource to export. */ resource_type: 'customers' | 'invoices' | 'transactions' | 'subscriptions' | 'products' | 'payment_methods'; /** * Output file format. csv: Comma-separated values. xlsx: Excel workbook. */ format?: 'csv' | 'xlsx'; /** * Filters to apply (e.g., { status: 'paid', created_gte: '2024-01-01' }) */ filters?: { [key: string]: unknown; }; /** * Column set to include. standard: common fields. full: all fields. minimal: IDs and key fields only. */ column_set?: 'standard' | 'full' | 'minimal'; }; /** * Export job status and details. */ type ExportRetrieveResponse = { data: Export; }; /** * The created import job in 'pending' status. */ type ImportCreateResponse = { data: Import; }; /** * An async data import job. Upload a CSV file to create records in bulk. Poll GET /v2/imports/:id for status and error details. */ type Import = { /** * Unique import job ID */ id: string; /** * Object type */ object: 'import'; /** * Import job status. pending: queued. validating: checking data. processing: creating records. completed: all rows imported. completed_with_errors: some rows failed. failed: import aborted. */ status: 'pending' | 'validating' | 'processing' | 'completed' | 'completed_with_errors' | 'failed'; /** * The type of resource to import. */ resource_type: 'customers' | 'products' | 'invoices'; /** * Total rows in the uploaded file */ total_rows?: number | null; /** * Number of rows processed so far */ processed_rows?: number | null; /** * Number of rows successfully imported */ success_count?: number | null; /** * Number of rows that failed */ error_count?: number | null; /** * Detailed error information for failed rows */ errors?: Array<{ /** * Row number (1-based) */ row: number; /** * Field that caused the error */ field?: string; /** * Error message */ message: string; }> | null; /** * When the import was created (ISO 8601) */ created_at: string; /** * When the import completed (ISO 8601) */ completed_at?: string | null; }; /** * Parameters for creating a bulk data import. Either provide a file_url or upload the CSV via multipart form data. */ type CreateImportRequest = { /** * The type of resource to import. */ resource_type: 'customers' | 'products' | 'invoices'; /** * URL to the CSV file to import (if not using multipart upload) */ file_url?: string; /** * Map CSV column names to resource fields (e.g., { 'Email Address': 'email', 'Full Name': 'name' }) */ column_mapping?: { [key: string]: unknown; }; /** * Behavior when a duplicate record is found. skip: ignore the row. update: merge new data. error: fail the row. */ on_duplicate?: 'skip' | 'update' | 'error'; }; /** * Import job status and progress. */ type ImportRetrieveResponse = { data: Import; }; type DdMandateRequestCreateResponse = { data: { id: string; merchant_id: string; customer_id: string; invoice_id: string | null; /** * Signed mandate-request token for the emailed link */ token: string; /** * Customer-facing URL that opens the sign flow */ signable_url: string; created_at: string | null; expires_at: string | null; status: string; /** * True when an existing live request was returned instead of creating a new one */ idempotent: boolean; }; }; type DdMandateRequestActiveResponse = { data: DdMandateRequestLifecycleItem; }; type DdMandateRequestLifecycleItem = { id: string; merchant_id: string; customer_id: string; invoice_id: string | null; subscription_id: string | null; mandate_id: string | null; /** * Internal raw request token. Do not expose directly to customers. */ token: string; /** * Customer-facing tracked URL: pay.revkeen.com/dd_ */ signable_url: string; created_at: string | null; expires_at: string | null; consumed_at: string | null; cancelled_at: string | null; expired_at: string | null; status: DdMandateRequestLifecycleStatus; notification_delivery_event_type: string | null; notification_delivery_status: string | null; notification_delivery_error: string | null; notification_delivery_updated_at: string | null; pdf_documents: Array; } | null; type DdMandateRequestLifecycleStatus = 'draft' | 'pending_signature' | 'consumed' | 'expired' | 'cancelled' | 'failed'; type DdMandatePdfReference = { id: string; mandate_request_id: string | null; mandate_id: string; customer_id: string; merchant_id: string; pdf_type: string; storage_key: string; pdf_url: string | null; generated_at: string; template_version: string; compliance_version: string; }; type DdMandateRequestHistoryResponse = { data: Array; }; /** * Public lookup of a pending signed mandate request. */ type MandateRequestLookupResponse = { data: { /** * Mandate request ID */ id: string; /** * Merchant ID */ merchant_id: string; /** * Merchant slug */ merchant_slug: string; /** * Customer ID */ customer_id: string; /** * Invoice ID, if the request is tied to an invoice */ invoice_id: string | null; /** * Expiry timestamp (ISO 8601) */ expires_at: string | null; /** * Mandate request status */ status: string; /** * Merchant display details */ merchant: { id: string; slug: string; name: string; }; /** * Customer details for prefilling the mandate form */ customer: { id: string; name: string | null; first_name: string; last_name: string; email: string | null; phone: string | null; }; /** * Invoice details, if the request is tied to an invoice */ invoice: { id: string; invoice_number: string | null; total: string | null; amount_due: string | null; currency: string | null; } | null; }; }; type DdMandateRequestConsumeResponse = { data: { id: string; customer_id: string; invoice_id: string | null; mandate_id: string | null; consumed_at: string | null; status: string; idempotent?: boolean; pdf_documents?: Array; }; }; type DdMandateRequestCancelResponse = { data: { id: string; customer_id: string; invoice_id: string | null; status: string; cancelled_at?: string | null; cancelled_by?: string | null; expired_at?: string | null; reason?: string | null; idempotent?: boolean; }; }; type DdCaptureSessionResponse = { data: DdCaptureSession; }; type DdCaptureSession = { id: string; /** * Plaintext capture-session token. Only present in the response that issues it (create / token re-issue); never returned on subsequent reads. */ session_token?: string; merchant_id: string; customer_id: string | null; checkout_session_id: string | null; mandate_request_id: string | null; source: string; status: string; account_holder_name: string | null; /** * Last 2 digits of the sort code — never the full value */ sort_code_last2: string | null; /** * Last 4 digits of the account number */ account_number_last4: string | null; bank_name: string | null; /** * Advance-notice date (YYYY-MM-DD) */ notice_date: string | null; /** * Bacs submission date (YYYY-MM-DD) */ submission_date: string | null; /** * Collection date (YYYY-MM-DD) */ collection_date: string | null; /** * Settlement date (YYYY-MM-DD) */ settlement_date: string | null; notice_days: number | null; /** * Mandate created from this capture session, once completed */ mandate_id: string | null; expires_at: string | null; completed_at: string | null; abandoned_at: string | null; created_at: string | null; updated_at: string | null; }; /** * Result of a Direct Debit bank-account validation check. */ type ValidateBankAccountResponse = { /** * Whether the account details passed modulus/sort-code validation */ valid: boolean; /** * Resolved bank name, if known */ bank_name: string | null; /** * Whether the account accepts Direct Debit instructions */ dd_enabled: boolean; /** * Validation error messages, if any */ errors?: Array | null; }; /** * Parameters for validating a UK bank account for Direct Debit eligibility. */ type ValidateBankAccountRequest = { /** * UK sort code (6 digits, dashes optional) */ sortCode: string; /** * UK account number (8 digits) */ accountNumber: string; }; /** * Backend-owned Direct Debit collection date chain (notice/submission/collection/settlement). */ type PreviewCollectionResponse = { /** * Advance-notice date (YYYY-MM-DD) */ notice_date: string; /** * Bacs submission date (YYYY-MM-DD) */ submission_date: string; /** * Collection date (YYYY-MM-DD) */ collection_date: string; /** * Settlement date (YYYY-MM-DD) */ settlement_date: string; /** * Whether the requested collection is eligible */ eligible: boolean; /** * Reason the collection is ineligible, if applicable */ ineligible_reason: string | null; /** * Advance-notice days applied */ notice_days: number; }; /** * Parameters for previewing the Direct Debit notice → collection → settlement date chain. */ type PreviewCollectionRequest = { /** * Preferred collection date (ISO date). Backend resolves the working-day chain. */ requestedCollectionDate?: string; /** * Subscription the collection is previewed for, if any */ subscriptionId?: string; }; /** * A single Direct Debit mandate. */ type MandateResponse = { data: Mandate; }; /** * A Direct Debit mandate (customer authorisation to collect via Bacs). */ type Mandate = { /** * Mandate ID */ id: string; /** * RevKeen mandate reference (Bacs DDI reference) */ mandate_ref: string; /** * Human-facing mandate reference */ mandate_reference: string | null; /** * Customer the mandate belongs to */ customer_id: string; /** * Mandate status */ status: string; /** * Name on the bank account */ account_holder_name: string | null; /** * Masked sort code — never the full value */ sort_code: string; /** * Last 4 digits of the account number */ account_number_last4: string | null; /** * Resolved bank name */ bank_name: string | null; /** * Bacs statement descriptor (max 18 chars) */ statement_name?: string | null; /** * Advance-notice days applied */ notice_days: number | null; /** * Earliest collection date (YYYY-MM-DD) */ first_collection_date?: string | null; /** * Next scheduled collection date (YYYY-MM-DD) */ next_collection_date?: string | null; /** * Recovery fallback card */ backup_payment_method_id?: string | null; /** * When the mandate became active (ISO 8601) */ activated_at?: string | null; /** * When the mandate was suspended (ISO 8601) */ suspended_at?: string | null; /** * When the mandate was cancelled (ISO 8601) */ cancelled_at?: string | null; /** * Most recent failure reason */ failure_reason?: string | null; /** * Mandate-request consumed on creation, if any */ mandate_request_id?: string | null; /** * Invoice linked via the mandate-request, if any */ invoice_id?: string | null; pdf_documents?: Array; /** * Creation timestamp (ISO 8601) */ created_at?: string | null; /** * Last-updated timestamp (ISO 8601) */ updated_at?: string | null; }; /** * Parameters for creating a Direct Debit mandate. Bank details are validated with the bureau and stored KMS-encrypted; only masked values are ever returned. */ type CreateMandateRequest = { /** * Customer the mandate is created for */ customerId: string; /** * Name on the bank account */ accountHolderName: string; /** * UK sort code (6 digits, dashes optional) */ sortCode: string; /** * UK account number (8 digits) */ accountNumber: string; /** * Stored card used as recovery fallback if a collection fails */ backupPaymentMethodId?: string; /** * Signed mandate-request token to consume on creation */ requestToken?: string; /** * Deprecated compatibility field; ignored for authorization evidence */ acceptance?: { acceptedAt: string; payerAddress: { [key: string]: unknown; }; guaranteeVersion: string; declarations: { [key: string]: boolean; }; }; }; /** * A list of Direct Debit mandates. */ type MandateListResponse = { data: Array; }; /** * Summary representation of a Direct Debit mandate in a list. */ type MandateListItem = { id: string; mandate_ref: string; mandate_reference: string | null; customer_id: string; status: string; account_holder_name: string | null; sort_code: string; account_number_last4: string | null; bank_name: string | null; notice_days: number | null; activated_at: string | null; created_at: string | null; }; /** * Result of a mandate lifecycle action. */ type MandateActionResponse = { data: { /** * Mandate ID */ id: string; /** * Resulting mandate status */ status: string; /** * Mandate reference (reinstate) */ mandate_reference?: string | null; }; }; /** * Optional parameters for a mandate lifecycle action (cancel / suspend / reinstate). */ type MandateActionRequest = { /** * Optional reason recorded on the audit trail */ reason?: string; }; /** * Result of scheduling a one-off Direct Debit collection. */ type ScheduleCollectionResponse = { data: CollectionSchedule; }; /** * A scheduled one-off Direct Debit collection. */ type CollectionSchedule = { /** * Collection schedule ID */ id: string | null; /** * Mandate the collection is scheduled against */ mandate_id: string; /** * Bureau schedule reference */ lz_schedule_id: string; /** * Collection amount in minor units (pence) */ amount_minor: number; /** * ISO 4217 currency */ currency: string; /** * invoice | payment_link */ source_type: string; /** * Invoice or payment-link ID the collection settles */ source_id: string; /** * Schedule status */ status: string; /** * Collection date (YYYY-MM-DD) */ collection_date: string | null; /** * Advance-notice date (YYYY-MM-DD) */ notice_date: string | null; /** * Bacs submission date (YYYY-MM-DD) */ submission_date: string | null; /** * True when an existing schedule for this source was returned instead of creating a duplicate */ already_scheduled: boolean; }; /** * Parameters for scheduling a one-off Direct Debit collection against an active mandate. L&Z confirms the permitted collection date; nothing is marked paid until the bureau confirms the collection outcome. */ type ScheduleCollectionRequest = { /** * Collection amount in minor units (pence) */ amountMinor: number; /** * ISO 4217 currency. Bacs collections are GBP-only. */ currency: string; /** * What the collection settles. The settlement webhook resolves invoices by this reference. */ sourceType: 'invoice' | 'payment_link'; /** * Invoice or payment-link ID the collection is for */ sourceId: string; /** * Earliest acceptable collection date (ISO date). The backend resolves the Bacs working-day chain; must be on/after the bureau's earliest allowed date. */ requestedCollectionDate?: string; }; type InvoicesListData = { body?: never; path?: never; query?: { /** * Filter by invoice status */ status?: string; /** * Filter by customer ID */ customerId?: string; /** * Maximum number of results (1-100) */ limit?: number; /** * Number of results to skip */ offset?: number | null; }; url: '/invoices'; }; type InvoicesListResponses = { /** * List of invoices */ 200: InvoiceListResponse; }; type InvoicesListResponse = InvoicesListResponses[keyof InvoicesListResponses]; type InvoicesCreateData = { /** * Invoice creation details */ body: { customer_uuid: string; invoice_number?: string; total_minor: number; currency?: string; due_date?: string; status?: string; /** * Key-value pairs for custom fields */ custom_fields?: { [key: string]: unknown; }; subscription_terms?: SubscriptionTerms; /** * Restrict checkout payment methods for this invoice. When set, narrows available rails for checkout sessions created against this invoice. Omit to use merchant default. */ allowed_methods?: Array<'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'>; }; path?: never; query?: never; url: '/invoices'; }; type InvoicesCreateResponses = { /** * Invoice created */ 201: InvoiceResponse; }; type InvoicesCreateResponse = InvoicesCreateResponses[keyof InvoicesCreateResponses]; type InvoicesGetData = { body?: never; path: { id: string; }; query?: never; url: '/invoices/{id}'; }; type InvoicesGetResponses = { /** * Invoice details */ 200: InvoiceResponse; }; type InvoicesGetResponse = InvoicesGetResponses[keyof InvoicesGetResponses]; type InvoicesUpdateData = { /** * Invoice update details */ body: { status?: string; total_minor?: number; due_date?: string; /** * Update the invoice's restricted payment methods. Empty array clears restriction (merchant defaults apply); omit to leave unchanged. */ allowed_methods?: Array<'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'>; /** * Subscription billing terms — set to null to remove */ subscription_terms?: { /** * How to collect payment for recurring invoices */ collection_method: 'charge_automatically' | 'send_invoice'; /** * When the subscription billing cycle starts */ start_mode: 'when_paid' | 'on_invoice_date' | 'first_of_next_month' | 'specific_date'; /** * Start date (ISO 8601) — required when start_mode is 'specific_date' */ start_date?: string; /** * How the subscription duration is determined */ duration_type: 'until_cancelled' | 'fixed_cycles' | 'end_date'; /** * Number of billing cycles — required when duration_type is 'fixed_cycles' */ duration_count?: number; /** * End date (ISO 8601) — required when duration_type is 'end_date' */ end_date?: string; /** * Whether to charge the first cycle immediately or defer to the start date */ first_payment_behavior: 'charge_first_cycle_now' | 'defer_first_cycle_to_start_date'; } | null; }; path: { id: string; }; query?: never; url: '/invoices/{id}'; }; type InvoicesUpdateResponses = { /** * Invoice updated */ 200: InvoiceResponse; }; type InvoicesUpdateResponse = InvoicesUpdateResponses[keyof InvoicesUpdateResponses]; type InvoicesMarginEstimateData = { /** * Margin estimate inputs */ body: { /** * Optional amount in minor units. Defaults to the invoice total. */ amount_minor?: number; /** * Rails to estimate. Defaults to invoice allowed_methods or all rails. */ rails?: Array<'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'>; /** * Single card scheme to estimate for card rail, e.g. visa or mastercard. */ card_scheme?: string; /** * Card schemes to estimate for card rail. */ card_schemes?: Array; }; path: { /** * Invoice ID. */ id: string; }; query?: never; url: '/invoices/{id}/margin-estimate'; }; type InvoicesMarginEstimateErrors = { /** * Invoice not found */ 404: unknown; }; type InvoicesMarginEstimateResponses = { /** * Margin estimates by rail */ 200: { data: { invoice_id: string; amount_minor: number; currency: string; estimates: Array<{ rail: 'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'; card_scheme: string | null; gross_minor: number; estimated_fee_minor: number; net_after_fees_minor: number; fee_breakdown: { percentage_fee_minor: number; fixed_fee_minor: number; minimum_fee_adjustment_minor: number; }; pricing_source: 'matrix'; matrix_version: string; }>; }; }; }; type InvoicesMarginEstimateResponse = InvoicesMarginEstimateResponses[keyof InvoicesMarginEstimateResponses]; type InvoicesFinalizeData = { /** * Finalization options */ body?: { /** * If true, automatically transitions to 'approved' status after finalization. */ auto_advance?: boolean; }; path: { id: string; }; query?: never; url: '/invoices/{id}/finalize'; }; type InvoicesFinalizeErrors = { /** * Invoice cannot be finalized (not in draft status or missing line items) */ 400: unknown; /** * Invoice not found */ 404: unknown; }; type InvoicesFinalizeResponses = { /** * Invoice finalized successfully */ 200: InvoiceResponse; }; type InvoicesFinalizeResponse = InvoicesFinalizeResponses[keyof InvoicesFinalizeResponses]; type InvoicesVoidData = { /** * Void details */ body?: { /** * Reason for voiding the invoice */ reason?: string; }; path: { id: string; }; query?: never; url: '/invoices/{id}/void'; }; type InvoicesVoidErrors = { /** * Invoice cannot be voided (has payments or already voided) */ 400: unknown; /** * Invoice not found */ 404: unknown; }; type InvoicesVoidResponses = { /** * Invoice voided successfully */ 200: InvoiceResponse; }; type InvoicesVoidResponse = InvoicesVoidResponses[keyof InvoicesVoidResponses]; type InvoicesSendData = { /** * Send options */ body?: { /** * Communication channel to send the invoice through */ channel?: 'email' | 'sms' | 'whatsapp'; /** * Optional custom template ID to use for the notification */ template_id?: string; }; path: { id: string; }; query?: never; url: '/invoices/{id}/send'; }; type InvoicesSendErrors = { /** * Invoice cannot be sent (not approved or missing customer contact) */ 400: unknown; /** * Invoice not found */ 404: unknown; }; type InvoicesSendResponses = { /** * Invoice sent successfully */ 200: InvoiceResponse; }; type InvoicesSendResponse = InvoicesSendResponses[keyof InvoicesSendResponses]; type ProductsListData = { body?: never; path?: never; query?: { /** * Page number */ page?: number; /** * Maximum number of results (1-100) */ limit?: number; /** * Search term to filter products */ search?: string; }; url: '/products'; }; type ProductsListErrors = { /** * Bad Request */ 400: ProductErrorResponse; /** * Unauthorized */ 401: { error: string; }; }; type ProductsListError = ProductsListErrors[keyof ProductsListErrors]; type ProductsListResponses = { /** * List of products */ 200: ProductListResponse; }; type ProductsListResponse = ProductsListResponses[keyof ProductsListResponses]; type ProductsCreateData = { /** * Product creation details */ body: CreateProductRequest; path?: never; query?: never; url: '/products'; }; type ProductsCreateErrors = { /** * Validation error */ 400: { error: string; }; /** * Unauthorized */ 401: { error: string; }; }; type ProductsCreateError = ProductsCreateErrors[keyof ProductsCreateErrors]; type ProductsCreateResponses = { /** * Product created successfully */ 201: ProductCreateResponse; }; type ProductsCreateResponse = ProductsCreateResponses[keyof ProductsCreateResponses]; type ProductsGetData = { body?: never; path: { id: string; }; query?: never; url: '/products/{id}'; }; type ProductsGetErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Product not found */ 404: { error: string; }; }; type ProductsGetError = ProductsGetErrors[keyof ProductsGetErrors]; type ProductsGetResponses = { /** * Product details */ 200: ProductRetrieveResponse; }; type ProductsGetResponse = ProductsGetResponses[keyof ProductsGetResponses]; type ProductsUpdateData = { /** * Product update details */ body: UpdateProductRequest; path: { id: string; }; query?: never; url: '/products/{id}'; }; type ProductsUpdateErrors = { /** * Validation error */ 400: { error: string; }; /** * Unauthorized */ 401: { error: string; }; /** * Product not found */ 404: { error: string; }; }; type ProductsUpdateError = ProductsUpdateErrors[keyof ProductsUpdateErrors]; type ProductsUpdateResponses = { /** * Product updated successfully */ 200: ProductUpdateResponse; }; type ProductsUpdateResponse = ProductsUpdateResponses[keyof ProductsUpdateResponses]; type CheckoutSessionsCreateData = { body?: CreateCheckoutSessionInput; path?: never; query?: never; url: '/checkout-sessions'; }; type CheckoutSessionsCreateErrors = { /** * Bad Request */ 400: CheckoutSessionErrorResponse; /** * Unauthorized */ 401: { error: string; }; /** * Not Found */ 404: { error: string; }; }; type CheckoutSessionsCreateError = CheckoutSessionsCreateErrors[keyof CheckoutSessionsCreateErrors]; type CheckoutSessionsCreateResponses = { /** * Checkout session created */ 201: CheckoutSessionCreateResponse; }; type CheckoutSessionsCreateResponse = CheckoutSessionsCreateResponses[keyof CheckoutSessionsCreateResponses]; type CheckoutSessionsGetData = { body?: never; path: { /** * Checkout session ID. */ id: string; }; query?: never; url: '/checkout-sessions/{id}'; }; type CheckoutSessionsGetErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Not Found */ 404: { error: string; }; /** * Internal Server Error */ 500: { error: string; }; }; type CheckoutSessionsGetError = CheckoutSessionsGetErrors[keyof CheckoutSessionsGetErrors]; type CheckoutSessionsGetResponses = { /** * Checkout session retrieved */ 200: CheckoutSessionRetrieveResponse; }; type CheckoutSessionsGetResponse = CheckoutSessionsGetResponses[keyof CheckoutSessionsGetResponses]; type CheckoutSessionsExpireData = { body?: never; path: { /** * Checkout session ID to expire. */ id: string; }; query?: never; url: '/checkout-sessions/{id}/expire'; }; type CheckoutSessionsExpireErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Not Found */ 404: { error: string; }; /** * Conflict — session is not in an expirable state */ 409: { error: string; }; }; type CheckoutSessionsExpireError = CheckoutSessionsExpireErrors[keyof CheckoutSessionsExpireErrors]; type CheckoutSessionsExpireResponses = { /** * Session expired */ 200: CheckoutSessionExpireResponse; }; type CheckoutSessionsExpireResponse = CheckoutSessionsExpireResponses[keyof CheckoutSessionsExpireResponses]; type CartSessionsCreateData = { body?: CreateCartSessionInput; path?: never; query?: never; url: '/cart-sessions'; }; type CartSessionsCreateErrors = { /** * Bad Request */ 400: CartSessionErrorResponse; /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Unprocessable — seed payment link is not cart-enabled (CART_NOT_ENABLED_FOR_LINK). */ 422: CartSessionErrorResponse; }; type CartSessionsCreateError = CartSessionsCreateErrors[keyof CartSessionsCreateErrors]; type CartSessionsCreateResponses = { /** * Cart session created */ 201: CartSessionResponse; }; type CartSessionsCreateResponse = CartSessionsCreateResponses[keyof CartSessionsCreateResponses]; type CartSessionsGetData = { body?: never; path: { id: string; }; query?: never; url: '/cart-sessions/{id}'; }; type CartSessionsGetErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; }; type CartSessionsGetError = CartSessionsGetErrors[keyof CartSessionsGetErrors]; type CartSessionsGetResponses = { /** * Cart session */ 200: CartSessionResponse; }; type CartSessionsGetResponse = CartSessionsGetResponses[keyof CartSessionsGetResponses]; type CartSessionsAddLineItemData = { body?: CartLineItemInput; path: { id: string; }; query?: never; url: '/cart-sessions/{id}/line-items'; }; type CartSessionsAddLineItemErrors = { /** * Bad Request */ 400: CartSessionErrorResponse; /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Conflict — cart is closed, empty (on convert), or has a pending discount code that blocks convert. */ 409: CartSessionErrorResponse; }; type CartSessionsAddLineItemError = CartSessionsAddLineItemErrors[keyof CartSessionsAddLineItemErrors]; type CartSessionsAddLineItemResponses = { /** * Line item added; updated cart returned */ 201: CartSessionResponse; }; type CartSessionsAddLineItemResponse = CartSessionsAddLineItemResponses[keyof CartSessionsAddLineItemResponses]; type CartSessionsRemoveLineItemData = { body?: never; path: { id: string; /** * Cart line item id (the `id` field returned on `cart_session.line_items[]`). */ lineId: string; }; query?: never; url: '/cart-sessions/{id}/line-items/{lineId}'; }; type CartSessionsRemoveLineItemErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Conflict — cart is closed, empty (on convert), or has a pending discount code that blocks convert. */ 409: CartSessionErrorResponse; }; type CartSessionsRemoveLineItemError = CartSessionsRemoveLineItemErrors[keyof CartSessionsRemoveLineItemErrors]; type CartSessionsRemoveLineItemResponses = { /** * Cart session */ 200: CartSessionResponse; }; type CartSessionsRemoveLineItemResponse = CartSessionsRemoveLineItemResponses[keyof CartSessionsRemoveLineItemResponses]; type CartSessionsUpdateLineItemData = { body?: UpdateCartLineItemInput; path: { id: string; /** * Cart line item id (the `id` field returned on `cart_session.line_items[]`). */ lineId: string; }; query?: never; url: '/cart-sessions/{id}/line-items/{lineId}'; }; type CartSessionsUpdateLineItemErrors = { /** * Bad Request */ 400: CartSessionErrorResponse; /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Conflict — cart is closed, empty (on convert), or has a pending discount code that blocks convert. */ 409: CartSessionErrorResponse; }; type CartSessionsUpdateLineItemError = CartSessionsUpdateLineItemErrors[keyof CartSessionsUpdateLineItemErrors]; type CartSessionsUpdateLineItemResponses = { /** * Cart session */ 200: CartSessionResponse; }; type CartSessionsUpdateLineItemResponse = CartSessionsUpdateLineItemResponses[keyof CartSessionsUpdateLineItemResponses]; type CartSessionsToggleAddOnData = { body?: ToggleCartAddOnInput; path: { id: string; }; query?: never; url: '/cart-sessions/{id}/add-ons'; }; type CartSessionsToggleAddOnErrors = { /** * Bad Request */ 400: CartSessionErrorResponse; /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Conflict — cart is closed, empty (on convert), or has a pending discount code that blocks convert. */ 409: CartSessionErrorResponse; }; type CartSessionsToggleAddOnError = CartSessionsToggleAddOnErrors[keyof CartSessionsToggleAddOnErrors]; type CartSessionsToggleAddOnResponses = { /** * Cart session */ 200: CartSessionResponse; }; type CartSessionsToggleAddOnResponse = CartSessionsToggleAddOnResponses[keyof CartSessionsToggleAddOnResponses]; type CartSessionsApplyDiscountCodeData = { body?: ApplyCartDiscountCodeInput; path: { id: string; }; query?: never; url: '/cart-sessions/{id}/discount-code'; }; type CartSessionsApplyDiscountCodeErrors = { /** * Bad Request */ 400: CartSessionErrorResponse; /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Conflict — cart is closed, empty (on convert), or has a pending discount code that blocks convert. */ 409: CartSessionErrorResponse; }; type CartSessionsApplyDiscountCodeError = CartSessionsApplyDiscountCodeErrors[keyof CartSessionsApplyDiscountCodeErrors]; type CartSessionsApplyDiscountCodeResponses = { /** * Cart session */ 200: CartSessionResponse; }; type CartSessionsApplyDiscountCodeResponse = CartSessionsApplyDiscountCodeResponses[keyof CartSessionsApplyDiscountCodeResponses]; type CartSessionsSetContactData = { body?: SetCartContactInput; path: { id: string; }; query?: never; url: '/cart-sessions/{id}/contact'; }; type CartSessionsSetContactErrors = { /** * Bad Request */ 400: CartSessionErrorResponse; /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Conflict — cart is closed, empty (on convert), or has a pending discount code that blocks convert. */ 409: CartSessionErrorResponse; }; type CartSessionsSetContactError = CartSessionsSetContactErrors[keyof CartSessionsSetContactErrors]; type CartSessionsSetContactResponses = { /** * Cart session */ 200: CartSessionResponse; }; type CartSessionsSetContactResponse = CartSessionsSetContactResponses[keyof CartSessionsSetContactResponses]; type CartSessionsConvertData = { body?: never; path: { id: string; }; query?: never; url: '/cart-sessions/{id}/convert'; }; type CartSessionsConvertErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Not Found — cart or line item not found, or not visible to your key. */ 404: CartSessionErrorResponse; /** * Conflict — cart is closed, empty (on convert), or has a pending discount code that blocks convert. */ 409: CartSessionErrorResponse; }; type CartSessionsConvertError = CartSessionsConvertErrors[keyof CartSessionsConvertErrors]; type CartSessionsConvertResponses = { /** * Cart converted; updated cart + new checkout session returned */ 201: CartConversionResponse; }; type CartSessionsConvertResponse = CartSessionsConvertResponses[keyof CartSessionsConvertResponses]; type CartApiKeysStatusData = { body?: never; path?: never; query?: never; url: '/cart-api-keys/status'; }; type CartApiKeysStatusErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Forbidden */ 403: { error: string; }; }; type CartApiKeysStatusError = CartApiKeysStatusErrors[keyof CartApiKeysStatusErrors]; type CartApiKeysStatusResponses = { /** * Cart key status */ 200: { success: boolean; data: { publishable: { kind: 'publishable' | 'secret'; present: boolean; active: boolean; id: string | null; unkey_key_id: string | null; scopes: Array; created_at: string | null; last_used_at: string | null; revoked_at: string | null; }; secret: { kind: 'publishable' | 'secret'; present: boolean; active: boolean; id: string | null; unkey_key_id: string | null; scopes: Array; created_at: string | null; last_used_at: string | null; revoked_at: string | null; }; ready: boolean; created?: Array<'publishable' | 'secret'>; publishable_api_key?: string; secret_api_key?: string; }; }; }; type CartApiKeysStatusResponse = CartApiKeysStatusResponses[keyof CartApiKeysStatusResponses]; type CartApiKeysEnsureData = { body?: never; path?: never; query?: never; url: '/cart-api-keys/ensure'; }; type CartApiKeysEnsureErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Forbidden */ 403: { error: string; }; }; type CartApiKeysEnsureError = CartApiKeysEnsureErrors[keyof CartApiKeysEnsureErrors]; type CartApiKeysEnsureResponses = { /** * Cart keys are present or were created */ 200: { success: boolean; data: { publishable: { kind: 'publishable' | 'secret'; present: boolean; active: boolean; id: string | null; unkey_key_id: string | null; scopes: Array; created_at: string | null; last_used_at: string | null; revoked_at: string | null; }; secret: { kind: 'publishable' | 'secret'; present: boolean; active: boolean; id: string | null; unkey_key_id: string | null; scopes: Array; created_at: string | null; last_used_at: string | null; revoked_at: string | null; }; ready: boolean; created?: Array<'publishable' | 'secret'>; publishable_api_key?: string; secret_api_key?: string; }; }; }; type CartApiKeysEnsureResponse = CartApiKeysEnsureResponses[keyof CartApiKeysEnsureResponses]; type CartApiKeysRotateData = { body?: { grace_hours?: number; }; path: { kind: 'publishable' | 'secret'; }; query?: never; url: '/cart-api-keys/{kind}/rotate'; }; type CartApiKeysRotateErrors = { /** * Bad request */ 400: { error: string; }; /** * Unauthorized */ 401: { error: string; }; /** * Forbidden */ 403: { error: string; }; }; type CartApiKeysRotateError = CartApiKeysRotateErrors[keyof CartApiKeysRotateErrors]; type CartApiKeysRotateResponses = { /** * Cart key rotated */ 200: { success: boolean; data: { api_key: string; id: string; unkey_key_id: string; key_kind: 'publishable' | 'secret'; rolled_from: string | null; old_key_expires_at: string | null; grace_hours: number; }; }; }; type CartApiKeysRotateResponse = CartApiKeysRotateResponses[keyof CartApiKeysRotateResponses]; type StorefrontProductsListData = { body?: never; path?: never; query?: { /** * Maximum products to return (default 50, max 100). */ limit?: number; }; url: '/storefront/products'; }; type StorefrontProductsListErrors = { /** * Unauthorized */ 401: StorefrontProductError; /** * Cart not enabled for this merchant (CART_DISABLED) */ 403: StorefrontProductError; }; type StorefrontProductsListError = StorefrontProductsListErrors[keyof StorefrontProductsListErrors]; type StorefrontProductsListResponses = { /** * Browser-safe product list */ 200: StorefrontProductListResponse; }; type StorefrontProductsListResponse = StorefrontProductsListResponses[keyof StorefrontProductsListResponses]; type StorefrontProductsGetData = { body?: never; path: { /** * Product UUID, merchant product reference, or slug. */ productId: string; }; query?: never; url: '/storefront/products/{productId}'; }; type StorefrontProductsGetErrors = { /** * Unauthorized */ 401: StorefrontProductError; /** * Cart not enabled for this merchant (CART_DISABLED) */ 403: StorefrontProductError; /** * Product not found, inactive, or archived */ 404: StorefrontProductError; }; type StorefrontProductsGetError = StorefrontProductsGetErrors[keyof StorefrontProductsGetErrors]; type StorefrontProductsGetResponses = { /** * Browser-safe product */ 200: StorefrontProductResponse; }; type StorefrontProductsGetResponse = StorefrontProductsGetResponses[keyof StorefrontProductsGetResponses]; type StorefrontOriginsListData = { body?: never; path?: never; query?: never; url: '/storefront/origins'; }; type StorefrontOriginsListErrors = { /** * Unauthorized */ 401: StorefrontOriginError; /** * Forbidden */ 403: StorefrontOriginError; }; type StorefrontOriginsListError = StorefrontOriginsListErrors[keyof StorefrontOriginsListErrors]; type StorefrontOriginsListResponses = { /** * Registered origins */ 200: StorefrontOriginListResponse; }; type StorefrontOriginsListResponse = StorefrontOriginsListResponses[keyof StorefrontOriginsListResponses]; type StorefrontOriginsCreateData = { body?: StorefrontOriginCreateRequest; path?: never; query?: never; url: '/storefront/origins'; }; type StorefrontOriginsCreateErrors = { /** * Invalid origin */ 400: StorefrontOriginError; /** * Unauthorized */ 401: StorefrontOriginError; /** * Forbidden */ 403: StorefrontOriginError; /** * Origin already registered */ 409: StorefrontOriginError; }; type StorefrontOriginsCreateError = StorefrontOriginsCreateErrors[keyof StorefrontOriginsCreateErrors]; type StorefrontOriginsCreateResponses = { /** * Origin registered */ 201: StorefrontOriginCreateResponse; }; type StorefrontOriginsCreateResponse = StorefrontOriginsCreateResponses[keyof StorefrontOriginsCreateResponses]; type StorefrontOriginsDeleteData = { body?: never; path: { /** * Storefront origin id. */ originId: string; }; query?: never; url: '/storefront/origins/{originId}'; }; type StorefrontOriginsDeleteErrors = { /** * Unauthorized */ 401: StorefrontOriginError; /** * Forbidden */ 403: StorefrontOriginError; /** * Origin not found */ 404: StorefrontOriginError; }; type StorefrontOriginsDeleteError = StorefrontOriginsDeleteErrors[keyof StorefrontOriginsDeleteErrors]; type StorefrontOriginsDeleteResponses = { /** * Origin removed */ 200: StorefrontOriginDeleteResponse; }; type StorefrontOriginsDeleteResponse = StorefrontOriginsDeleteResponses[keyof StorefrontOriginsDeleteResponses]; type StorefrontStatusGetData = { body?: never; path?: never; query?: never; url: '/storefront/status'; }; type StorefrontStatusGetErrors = { /** * Unauthorized */ 401: StorefrontStatusError; /** * Forbidden */ 403: StorefrontStatusError; }; type StorefrontStatusGetError = StorefrontStatusGetErrors[keyof StorefrontStatusGetErrors]; type StorefrontStatusGetResponses = { /** * Integration status report */ 200: StorefrontStatusResponse; }; type StorefrontStatusGetResponse = StorefrontStatusGetResponses[keyof StorefrontStatusGetResponses]; type CustomersListData = { body?: never; path?: never; query?: { /** * Maximum number of results (1-100) */ limit?: number; /** * Number of results to skip */ offset?: number | null; /** * Search term to filter customers */ search?: string; }; url: '/customers'; }; type CustomersListErrors = { /** * Unauthorized */ 401: unknown; }; type CustomersListResponses = { /** * List of customers */ 200: CustomerListResponse; }; type CustomersListResponse = CustomersListResponses[keyof CustomersListResponses]; type CustomersCreateData = { body?: { /** * Customer's email address (must be unique per merchant) */ email: string; /** * Customer's full name */ name?: string; /** * Customer's phone number */ phone?: string; /** * Customer's company name */ companyName?: string; /** * Billing address line 1 */ addressLine1?: string; /** * Billing address line 2 */ addressLine2?: string; /** * Billing address city */ city?: string; /** * Billing address state or county */ state?: string; /** * Billing address postal code */ postalCode?: string; /** * Billing address country code */ country?: string; /** * Arbitrary key-value metadata to attach to this customer */ metadata?: { [key: string]: unknown; }; /** * Merchant-defined custom fields displayed as columns in the dashboard */ customFields?: { [key: string]: unknown; }; }; path?: never; query?: never; url: '/customers'; }; type CustomersCreateErrors = { /** * Validation error */ 400: unknown; /** * Unauthorized */ 401: unknown; }; type CustomersCreateResponses = { /** * Customer created successfully */ 201: CustomerCreateResponse; }; type CustomersCreateResponse = CustomersCreateResponses[keyof CustomersCreateResponses]; type CustomersGetData = { body?: never; path: { /** * Customer UUID */ id: string; }; query?: never; url: '/customers/{id}'; }; type CustomersGetErrors = { /** * Unauthorized */ 401: unknown; /** * Customer not found */ 404: unknown; }; type CustomersGetResponses = { /** * Customer details */ 200: CustomerRetrieveResponse; }; type CustomersGetResponse = CustomersGetResponses[keyof CustomersGetResponses]; type CustomersUpdateData = { body?: { /** * Updated email address */ email?: string; /** * Updated full name */ name?: string; /** * Updated phone number */ phone?: string; /** * Updated company name */ companyName?: string; /** * Updated billing address line 1 */ addressLine1?: string; /** * Updated billing address line 2 */ addressLine2?: string; /** * Updated billing address city */ city?: string; /** * Updated billing address state or county */ state?: string; /** * Updated billing address postal code */ postalCode?: string; /** * Updated billing address country code */ country?: string; /** * Metadata to merge with existing values (set a key to null to remove it) */ metadata?: { [key: string]: unknown; }; /** * Merchant-defined custom fields displayed as columns in the dashboard */ customFields?: { [key: string]: unknown; }; }; path: { /** * Customer UUID */ id: string; }; query?: never; url: '/customers/{id}'; }; type CustomersUpdateErrors = { /** * Unauthorized */ 401: unknown; /** * Customer not found */ 404: unknown; }; type CustomersUpdateResponses = { /** * Customer updated successfully */ 200: CustomerUpdateResponse; }; type CustomersUpdateResponse = CustomersUpdateResponses[keyof CustomersUpdateResponses]; type CustomersPaymentRailsGetData = { body?: never; path: { /** * Customer UUID */ id: string; }; query?: { /** * Optional invoice context used to apply invoice-level rail restrictions. */ invoice_id?: string; }; url: '/customers/{id}/payment-rails'; }; type CustomersPaymentRailsGetErrors = { /** * Invalid invoice context */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Customer or invoice not found */ 404: unknown; }; type CustomersPaymentRailsGetResponses = { /** * Payment rail availability */ 200: { data: { customer_id: string; invoice_id?: string | null; rails: Array<{ rail: 'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'; available: boolean; reason_if_not: string | null; last_used_at: string | null; mandate_id?: string; mandate_ref?: string | null; }>; }; }; }; type CustomersPaymentRailsGetResponse = CustomersPaymentRailsGetResponses[keyof CustomersPaymentRailsGetResponses]; type CustomersPreferredRailsGetData = { body?: never; path: { /** * Customer UUID */ id: string; }; query?: { /** * Optional invoice context used to apply invoice-level rail restrictions and amount. */ invoice_id?: string; /** * Optional amount in minor units. Use amount_minor for the explicit alias. */ amount?: number | null; /** * Optional amount in minor units. Overrides invoice total for margin-aware ranking. */ amount_minor?: number | null; }; url: '/customers/{id}/preferred-rails'; }; type CustomersPreferredRailsGetErrors = { /** * Invalid invoice context */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Customer or invoice not found */ 404: unknown; }; type CustomersPreferredRailsGetResponses = { /** * Preferred rails */ 200: { data: { customer_id: string; invoice_id: string | null; amount_minor: number | null; currency: string | null; preferred_rails: Array<{ rail: 'card' | 'direct_debit' | 'pay_by_bank' | 'in_store'; available: boolean; reason_if_not: string | null; last_used_at: string | null; mandate_id?: string; mandate_ref?: string | null; rank: number; score: number; reason: string; reasons: Array; estimated_fee_minor?: number; net_after_fees_minor?: number; mandate?: { id: string; status: 'PENDING_LODGEMENT' | 'ACTIVE' | 'SUSPENDED' | 'CANCELLED' | 'FAILED'; created_at: string; bureau_suspend_confirmed?: boolean | null; }; }>; }; }; }; type CustomersPreferredRailsGetResponse = CustomersPreferredRailsGetResponses[keyof CustomersPreferredRailsGetResponses]; type CustomersPaymentMethodsListData = { body?: never; path: { /** * Customer UUID */ id: string; }; query?: never; url: '/customers/{id}/payment-methods'; }; type CustomersPaymentMethodsListErrors = { /** * Unauthorized */ 401: unknown; /** * Customer not found */ 404: unknown; }; type CustomersPaymentMethodsListResponses = { /** * Payment methods list */ 200: CustomerPaymentMethodsListResponse; }; type CustomersPaymentMethodsListResponse = CustomersPaymentMethodsListResponses[keyof CustomersPaymentMethodsListResponses]; type SubscriptionsListData = { body?: never; path?: never; query?: { /** * Page number */ page?: number; /** * Maximum number of results (1-100) */ limit?: number; /** * Filter by subscription status */ status?: 'active' | 'canceled' | 'past_due' | 'trialing' | 'paused' | 'incomplete' | 'incomplete_expired'; /** * Filter by customer UUID */ customerId?: string; }; url: '/subscriptions'; }; type SubscriptionsListErrors = { /** * Unauthorized */ 401: unknown; }; type SubscriptionsListResponses = { /** * List of subscriptions */ 200: SubscriptionListResponse; }; type SubscriptionsListResponse = SubscriptionsListResponses[keyof SubscriptionsListResponses]; type SubscriptionsCreateData = { body?: { customerId: string; businessId?: string; productId?: string; planId?: string; priceId?: string; paymentMethodId?: string; startDate?: string; currency?: string; quantity?: number; trialEnd?: string; billingAnchorDay?: number; pauseAtPeriodEnd?: boolean; cancelAtPeriodEnd?: boolean; billingStartsOn?: string; billingEndStrategy?: 'indefinite' | 'on_date' | 'after_cycles'; billingEndsOn?: string; billingMaxCycles?: number; prorationMode?: 'immediate' | 'next_invoice' | 'none'; metadata?: { [key: string]: unknown; }; }; path?: never; query?: never; url: '/subscriptions'; }; type SubscriptionsCreateErrors = { /** * Validation error */ 400: unknown; /** * Unauthorized */ 401: unknown; }; type SubscriptionsCreateResponses = { /** * Subscription created successfully */ 201: SubscriptionCreateResponse; }; type SubscriptionsCreateResponse = SubscriptionsCreateResponses[keyof SubscriptionsCreateResponses]; type SubscriptionsGetData = { body?: never; path: { /** * Subscription UUID */ id: string; }; query?: never; url: '/subscriptions/{id}'; }; type SubscriptionsGetErrors = { /** * Unauthorized */ 401: unknown; /** * Subscription not found */ 404: unknown; }; type SubscriptionsGetResponses = { /** * Subscription details */ 200: SubscriptionRetrieveResponse; }; type SubscriptionsGetResponse = SubscriptionsGetResponses[keyof SubscriptionsGetResponses]; type SubscriptionsUpdateData = { body?: { status?: 'trialing' | 'active' | 'past_due' | 'paused' | 'canceled' | 'expired'; amountMinor?: number; quantity?: number; nextBillingDate?: string; billingAnchorDay?: number; pauseAtPeriodEnd?: boolean; cancelAtPeriodEnd?: boolean; metadata?: { [key: string]: unknown; }; }; path: { /** * Subscription UUID */ id: string; }; query?: never; url: '/subscriptions/{id}'; }; type SubscriptionsUpdateErrors = { /** * Unauthorized */ 401: unknown; /** * Subscription not found */ 404: unknown; }; type SubscriptionsUpdateResponses = { /** * Subscription updated successfully */ 200: SubscriptionUpdateResponse; }; type SubscriptionsUpdateResponse = SubscriptionsUpdateResponses[keyof SubscriptionsUpdateResponses]; type SubscriptionsCancelData = { body?: CancelSubscriptionInput; path: { /** * Subscription UUID */ id: string; }; query?: never; url: '/subscriptions/{id}/cancel'; }; type SubscriptionsCancelErrors = { /** * Invalid subscription state for this operation */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Subscription not found */ 404: unknown; }; type SubscriptionsCancelResponses = { /** * Subscription canceled or cancellation scheduled */ 200: SubscriptionCancelSubscriptionResponse; }; type SubscriptionsCancelResponse = SubscriptionsCancelResponses[keyof SubscriptionsCancelResponses]; type AnalyticsRevenueMrrSummaryData = { body?: never; path?: never; query?: { /** * Calculate MRR as of this date (ISO 8601) */ asOfDate?: string; }; url: '/analytics/revenue/mrr-summary'; }; type AnalyticsRevenueMrrSummaryResponses = { /** * MRR metrics */ 200: { /** * Current Monthly Recurring Revenue in minor units */ current_mrr: number; /** * Previous period MRR in minor units */ previous_mrr: number; /** * Net MRR growth in minor units */ growth: number; /** * MRR from new subscriptions */ new_mrr: number; /** * MRR lost to churn */ churned_mrr: number; /** * MRR gained from upgrades */ expansion_mrr: number; /** * MRR lost to downgrades */ contraction_mrr: number; /** * Date the MRR was calculated as of */ as_of_date: string; }; }; type AnalyticsRevenueMrrSummaryResponse = AnalyticsRevenueMrrSummaryResponses[keyof AnalyticsRevenueMrrSummaryResponses]; type AnalyticsRevenueTimeSeriesData = { body?: never; path?: never; query: { /** * Start date (ISO 8601) */ startDate: string; /** * End date (ISO 8601) */ endDate: string; /** * Time granularity for data points */ granularity?: 'day' | 'week' | 'month' | 'quarter' | 'year'; }; url: '/analytics/revenue/time-series'; }; type AnalyticsRevenueTimeSeriesResponses = { /** * Revenue time series data */ 200: { data_points: Array<{ /** * Bucket date (ISO 8601) */ date: string; /** * Revenue for the bucket in minor units */ revenue: number; /** * Number of invoices in the bucket */ invoice_count: number; /** * Average invoice value in the bucket */ avg_invoice_value: number; }>; /** * Total revenue across the period in minor units */ total_revenue: number; /** * Total number of invoices across the period */ total_invoices: number; /** * Start of the period */ period_start: string; /** * End of the period */ period_end: string; }; }; type AnalyticsRevenueTimeSeriesResponse = AnalyticsRevenueTimeSeriesResponses[keyof AnalyticsRevenueTimeSeriesResponses]; type RefundsListData = { body?: never; path?: never; query?: { /** * Filter by refund status */ status?: 'pending' | 'processing' | 'succeeded' | 'failed' | 'canceled'; /** * Filter by original payment ID */ payment_id?: string; /** * Filter by payment gateway (nmi, stripe, etc.) */ gateway?: string; /** * Filter by refund reason */ reason?: 'customer_request' | 'duplicate' | 'fraudulent' | 'product_not_received' | 'product_unacceptable' | 'subscription_canceled' | 'other'; /** * ISO 8601 date - only refunds created after this date */ created_after?: string; /** * ISO 8601 date - only refunds created before this date */ created_before?: string; /** * Number of results to return (1-100) */ limit?: number; /** * Number of results to skip */ offset?: number | null; }; url: '/refunds'; }; type RefundsListErrors = { /** * Unauthorized */ 401: unknown; /** * Internal server error */ 500: unknown; }; type RefundsListResponses = { /** * List of refunds */ 200: RefundListResponse; }; type RefundsListResponse = RefundsListResponses[keyof RefundsListResponses]; type RefundsCreateData = { body?: CreateRefundInput; path?: never; query?: never; url: '/refunds'; }; type RefundsCreateErrors = { /** * Invalid request - payment not found, already fully refunded, or invalid amount */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Internal server error */ 500: unknown; }; type RefundsCreateResponses = { /** * Refund created successfully */ 201: RefundCreateResponse; }; type RefundsCreateResponse = RefundsCreateResponses[keyof RefundsCreateResponses]; type RefundsGetData = { body?: never; path: { /** * Refund public ID (ref_xxx) or UUID */ id: string; }; query?: never; url: '/refunds/{id}'; }; type RefundsGetErrors = { /** * Unauthorized */ 401: unknown; /** * Refund not found */ 404: unknown; /** * Internal server error */ 500: unknown; }; type RefundsGetResponses = { /** * Refund details */ 200: RefundRetrieveResponse; }; type RefundsGetResponse = RefundsGetResponses[keyof RefundsGetResponses]; type CreditNotesListData = { body?: never; path?: never; query?: { /** * Filter by credit note status */ status?: 'draft' | 'pending' | 'issued' | 'applied' | 'voided'; /** * Filter by invoice ID */ invoice_id?: string; /** * Filter by customer ID */ customer_id?: string; /** * Filter by credit method */ credit_method?: 'refund_to_payment_method' | 'customer_balance' | 'external'; /** * ISO 8601 date - only credit notes created after this date */ created_after?: string; /** * ISO 8601 date - only credit notes created before this date */ created_before?: string; /** * Number of results to return (1-100) */ limit?: number; /** * Number of results to skip */ offset?: number | null; }; url: '/credit_notes'; }; type CreditNotesListErrors = { /** * Unauthorized */ 401: unknown; /** * Internal server error */ 500: unknown; }; type CreditNotesListResponses = { /** * List of credit notes */ 200: CreditNoteListResponse & unknown; }; type CreditNotesListResponse = CreditNotesListResponses[keyof CreditNotesListResponses]; type CreditNotesCreateData = { body?: CreateCreditNoteInput; path?: never; query?: never; url: '/credit_notes'; }; type CreditNotesCreateErrors = { /** * Invalid request - invoice not eligible, amount exceeds creditable, or other validation error */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Duplicate idempotency key */ 409: unknown; /** * Internal server error */ 500: unknown; }; type CreditNotesCreateResponses = { /** * Credit note created successfully */ 201: CreditNoteCreateResponse; }; type CreditNotesCreateResponse = CreditNotesCreateResponses[keyof CreditNotesCreateResponses]; type CreditNotesGetData = { body?: never; path: { /** * Credit note UUID */ id: string; }; query?: never; url: '/credit_notes/{id}'; }; type CreditNotesGetErrors = { /** * Unauthorized */ 401: unknown; /** * Credit note not found */ 404: unknown; /** * Internal server error */ 500: unknown; }; type CreditNotesGetResponses = { /** * Credit note details */ 200: CreditNoteRetrieveResponse; }; type CreditNotesGetResponse = CreditNotesGetResponses[keyof CreditNotesGetResponses]; type CreditNotesVoidData = { body?: never; path: { /** * Credit note UUID */ id: string; }; query?: never; url: '/credit_notes/{id}/void'; }; type CreditNotesVoidErrors = { /** * Credit note cannot be voided (already voided or applied) */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Credit note not found */ 404: unknown; /** * Internal server error */ 500: unknown; }; type CreditNotesVoidResponses = { /** * Credit note voided successfully */ 200: CreditNoteVoidResponse; }; type CreditNotesVoidResponse = CreditNotesVoidResponses[keyof CreditNotesVoidResponses]; type CreditNotesListLinesData = { body?: never; path: { /** * Credit note UUID */ id: string; }; query?: { /** * Maximum number of line items to return (1-100, default 100). */ limit?: number; }; url: '/credit_notes/{id}/lines'; }; type CreditNotesListLinesErrors = { /** * Unauthorized */ 401: unknown; /** * Credit note not found */ 404: unknown; }; type CreditNotesListLinesResponses = { /** * Line items on the credit note. */ 200: CreditNoteLineList; }; type CreditNotesListLinesResponse = CreditNotesListLinesResponses[keyof CreditNotesListLinesResponses]; type CreditNotesPreviewData = { body: PreviewCreditNoteInput; path?: never; query?: never; url: '/credit_notes/preview'; }; type CreditNotesPreviewErrors = { /** * Invalid preview input */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Invoice not found */ 404: unknown; }; type CreditNotesPreviewResponses = { /** * Preview computed. */ 200: CreditNotePreviewResponse; }; type CreditNotesPreviewResponse = CreditNotesPreviewResponses[keyof CreditNotesPreviewResponses]; type PaymentLinksListData = { body?: never; path?: never; query?: { limit?: number; offset?: number | null; status?: 'draft' | 'active' | 'expired' | 'completed'; mode?: 'invoice' | 'subscription' | 'custom'; search?: string; }; url: '/payment-links'; }; type PaymentLinksListErrors = { /** * Validation error in query parameters */ 400: { error: string; details?: unknown; }; /** * Unauthorized - missing or invalid authentication */ 401: unknown; }; type PaymentLinksListError = PaymentLinksListErrors[keyof PaymentLinksListErrors]; type PaymentLinksListResponses = { /** * Payment links retrieved successfully */ 200: { data: Array<{ id: string; merchant_id: string; public_id: string; name?: string; slug?: string | null; mode: 'invoice' | 'subscription' | 'custom'; status: 'draft' | 'active' | 'expired' | 'completed'; amount_minor?: number | null; currency?: string; invoice_id?: string | null; subscription_id?: string | null; product_ids?: Array; line_items?: Array<{ product_id: string; price_id?: string | null; quantity: number; merchant_reference?: string | null; is_adhoc: boolean; product_details?: { name: string; description?: string | null; unit_amount: number; currency: string; recurring?: { interval: 'day' | 'week' | 'month' | 'year'; interval_count?: number; } | null; }; }>; /** * Custom URL to redirect after successful payment. Supports placeholders: {CHECKOUT_ID}, {TRANSACTION_ID}, {PAYMENT_ID}, {CUSTOMER_ID}, {AMOUNT}, {CURRENCY}, {PORTAL_URL}. If not set, redirects to RevKeen's default success page. */ success_url?: string | null; /** * Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured. */ cancel_url?: string | null; redirect_url?: string | null; collect_shipping?: boolean; allow_promotion_codes?: boolean; tax_behavior?: 'exclusive' | 'inclusive' | 'unspecified'; metadata?: { [key: string]: unknown; } | null; expires_at?: string | null; /** * Customer-facing checkout shape. bundle=all products together; single_select=radio picker; multi_select=cart with quantity per line. */ selection_mode?: 'bundle' | 'single_select' | 'multi_select'; /** * For single_select only — option pre-selected when checkout loads. Must reference a product attached to this payment link. */ default_product_id?: string | null; /** * For single_select only — option shown with a 'Popular' badge. */ highlighted_product_id?: string | null; created_at: string; updated_at: string; }>; pagination: { limit: number; offset: number; total: number; }; }; }; type PaymentLinksListResponse = PaymentLinksListResponses[keyof PaymentLinksListResponses]; type PaymentLinksCreateData = { body?: { product_ids?: Array; line_items?: Array<{ price?: string; price_data?: { currency?: string; unit_amount: number; product_data?: { name: string; description?: string | null; images?: Array | null; metadata?: { [key: string]: unknown; } | null; }; product?: string; recurring?: { interval: 'day' | 'week' | 'month' | 'year'; interval_count?: number; } | null; tax_behavior?: 'inclusive' | 'exclusive' | null; }; quantity?: number; merchant_reference?: string | null; }>; name?: string; slug?: string; mode?: 'invoice' | 'subscription' | 'custom'; amount_minor?: number; currency?: string; invoice_id?: string; subscription_id?: string; /** * Custom URL to redirect after successful payment. Supports placeholders: {CHECKOUT_ID}, {TRANSACTION_ID}, {PAYMENT_ID}, {CUSTOMER_ID}, {AMOUNT}, {CURRENCY}, {PORTAL_URL}. If not set, redirects to RevKeen's default success page. */ success_url?: string; /** * Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured. */ cancel_url?: string; redirect_url?: string; collect_shipping?: boolean; allow_promotion_codes?: boolean; tax_behavior?: 'exclusive' | 'inclusive' | 'unspecified'; metadata?: { [key: string]: unknown; }; expires_at?: string; /** * Customer-facing checkout shape. bundle=all products together (default); single_select=radio picker; multi_select=cart with quantity per line. Companion FKs (default_product_id, highlighted_product_id) are only valid when selection_mode='single_select'. */ selection_mode?: 'bundle' | 'single_select' | 'multi_select'; /** * For single_select only — option pre-selected when checkout loads. Must reference a product attached to this payment link. */ default_product_id?: string | null; /** * For single_select only — option shown with a 'Popular' badge in the picker. */ highlighted_product_id?: string | null; idempotency_key?: string; }; path?: never; query?: never; url: '/payment-links'; }; type PaymentLinksCreateErrors = { /** * Validation error or invalid input */ 400: { error: string; details?: unknown; }; /** * Unauthorized - missing or invalid authentication */ 401: unknown; /** * Conflict - payment link already exists */ 409: { error: string; details?: unknown; }; }; type PaymentLinksCreateError = PaymentLinksCreateErrors[keyof PaymentLinksCreateErrors]; type PaymentLinksCreateResponses = { /** * Payment link created successfully */ 201: { id: string; merchant_id: string; public_id: string; name?: string; slug?: string | null; mode: 'invoice' | 'subscription' | 'custom'; status: 'draft' | 'active' | 'expired' | 'completed'; amount_minor?: number | null; currency?: string; invoice_id?: string | null; subscription_id?: string | null; product_ids?: Array; line_items?: Array<{ product_id: string; price_id?: string | null; quantity: number; merchant_reference?: string | null; is_adhoc: boolean; product_details?: { name: string; description?: string | null; unit_amount: number; currency: string; recurring?: { interval: 'day' | 'week' | 'month' | 'year'; interval_count?: number; } | null; }; }>; /** * Custom URL to redirect after successful payment. Supports placeholders: {CHECKOUT_ID}, {TRANSACTION_ID}, {PAYMENT_ID}, {CUSTOMER_ID}, {AMOUNT}, {CURRENCY}, {PORTAL_URL}. If not set, redirects to RevKeen's default success page. */ success_url?: string | null; /** * Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured. */ cancel_url?: string | null; redirect_url?: string | null; collect_shipping?: boolean; allow_promotion_codes?: boolean; tax_behavior?: 'exclusive' | 'inclusive' | 'unspecified'; metadata?: { [key: string]: unknown; } | null; expires_at?: string | null; /** * Customer-facing checkout shape. bundle=all products together; single_select=radio picker; multi_select=cart with quantity per line. */ selection_mode?: 'bundle' | 'single_select' | 'multi_select'; /** * For single_select only — option pre-selected when checkout loads. Must reference a product attached to this payment link. */ default_product_id?: string | null; /** * For single_select only — option shown with a 'Popular' badge. */ highlighted_product_id?: string | null; created_at: string; updated_at: string; }; }; type PaymentLinksCreateResponse = PaymentLinksCreateResponses[keyof PaymentLinksCreateResponses]; type PaymentLinksGetData = { body?: never; path: { /** * Payment link UUID or public_id */ id: string; }; query?: never; url: '/payment-links/{id}'; }; type PaymentLinksGetErrors = { /** * Unauthorized - missing or invalid authentication */ 401: unknown; /** * Payment link not found */ 404: { error: string; details?: unknown; }; }; type PaymentLinksGetError = PaymentLinksGetErrors[keyof PaymentLinksGetErrors]; type PaymentLinksGetResponses = { /** * Payment link retrieved successfully */ 200: { id: string; merchant_id: string; public_id: string; name?: string; slug?: string | null; mode: 'invoice' | 'subscription' | 'custom'; status: 'draft' | 'active' | 'expired' | 'completed'; amount_minor?: number | null; currency?: string; invoice_id?: string | null; subscription_id?: string | null; product_ids?: Array; line_items?: Array<{ product_id: string; price_id?: string | null; quantity: number; merchant_reference?: string | null; is_adhoc: boolean; product_details?: { name: string; description?: string | null; unit_amount: number; currency: string; recurring?: { interval: 'day' | 'week' | 'month' | 'year'; interval_count?: number; } | null; }; }>; /** * Custom URL to redirect after successful payment. Supports placeholders: {CHECKOUT_ID}, {TRANSACTION_ID}, {PAYMENT_ID}, {CUSTOMER_ID}, {AMOUNT}, {CURRENCY}, {PORTAL_URL}. If not set, redirects to RevKeen's default success page. */ success_url?: string | null; /** * Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured. */ cancel_url?: string | null; redirect_url?: string | null; collect_shipping?: boolean; allow_promotion_codes?: boolean; tax_behavior?: 'exclusive' | 'inclusive' | 'unspecified'; metadata?: { [key: string]: unknown; } | null; expires_at?: string | null; /** * Customer-facing checkout shape. bundle=all products together; single_select=radio picker; multi_select=cart with quantity per line. */ selection_mode?: 'bundle' | 'single_select' | 'multi_select'; /** * For single_select only — option pre-selected when checkout loads. Must reference a product attached to this payment link. */ default_product_id?: string | null; /** * For single_select only — option shown with a 'Popular' badge. */ highlighted_product_id?: string | null; created_at: string; updated_at: string; }; }; type PaymentLinksGetResponse = PaymentLinksGetResponses[keyof PaymentLinksGetResponses]; type PaymentLinksExpireData = { body?: { reason?: string; }; path: { /** * Payment link UUID or public_id */ id: string; }; query?: never; url: '/payment-links/{id}/expire'; }; type PaymentLinksExpireErrors = { /** * Validation error or payment link already expired */ 400: { error: string; details?: unknown; }; /** * Unauthorized - missing or invalid authentication */ 401: unknown; /** * Payment link not found */ 404: { error: string; details?: unknown; }; }; type PaymentLinksExpireError = PaymentLinksExpireErrors[keyof PaymentLinksExpireErrors]; type PaymentLinksExpireResponses = { /** * Payment link expired successfully */ 200: { id: string; merchant_id: string; public_id: string; name?: string; slug?: string | null; mode: 'invoice' | 'subscription' | 'custom'; status: 'draft' | 'active' | 'expired' | 'completed'; amount_minor?: number | null; currency?: string; invoice_id?: string | null; subscription_id?: string | null; product_ids?: Array; line_items?: Array<{ product_id: string; price_id?: string | null; quantity: number; merchant_reference?: string | null; is_adhoc: boolean; product_details?: { name: string; description?: string | null; unit_amount: number; currency: string; recurring?: { interval: 'day' | 'week' | 'month' | 'year'; interval_count?: number; } | null; }; }>; /** * Custom URL to redirect after successful payment. Supports placeholders: {CHECKOUT_ID}, {TRANSACTION_ID}, {PAYMENT_ID}, {CUSTOMER_ID}, {AMOUNT}, {CURRENCY}, {PORTAL_URL}. If not set, redirects to RevKeen's default success page. */ success_url?: string | null; /** * Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured. */ cancel_url?: string | null; redirect_url?: string | null; collect_shipping?: boolean; allow_promotion_codes?: boolean; tax_behavior?: 'exclusive' | 'inclusive' | 'unspecified'; metadata?: { [key: string]: unknown; } | null; expires_at?: string | null; /** * Customer-facing checkout shape. bundle=all products together; single_select=radio picker; multi_select=cart with quantity per line. */ selection_mode?: 'bundle' | 'single_select' | 'multi_select'; /** * For single_select only — option pre-selected when checkout loads. Must reference a product attached to this payment link. */ default_product_id?: string | null; /** * For single_select only — option shown with a 'Popular' badge. */ highlighted_product_id?: string | null; created_at: string; updated_at: string; }; }; type PaymentLinksExpireResponse = PaymentLinksExpireResponses[keyof PaymentLinksExpireResponses]; type PaymentLinksUpdateData = { body?: { /** * New status for the payment link */ status: 'active' | 'inactive' | 'archived'; }; path: { /** * Payment link UUID or public_id */ id: string; }; query?: never; url: '/payment-links/{id}/status'; }; type PaymentLinksUpdateErrors = { /** * Invalid status transition (e.g., trying to reactivate archived link) */ 400: { error: string; details?: unknown; }; /** * Unauthorized - missing or invalid authentication */ 401: unknown; /** * Payment link not found */ 404: { error: string; details?: unknown; }; }; type PaymentLinksUpdateError = PaymentLinksUpdateErrors[keyof PaymentLinksUpdateErrors]; type PaymentLinksUpdateResponses = { /** * Status updated successfully */ 200: { id: string; status: 'active' | 'inactive' | 'archived'; status_changed_at: string; is_active: boolean; updated_at: string; }; }; type PaymentLinksUpdateResponse = PaymentLinksUpdateResponses[keyof PaymentLinksUpdateResponses]; type PaymentLinksDeactivateData = { body?: never; path: { /** * Payment link UUID or public_id */ id: string; }; query?: never; url: '/payment-links/{id}/deactivate'; }; type PaymentLinksDeactivateErrors = { /** * Link is already archived and cannot be modified */ 400: { error: string; details?: unknown; }; /** * Unauthorized */ 401: unknown; /** * Payment link not found */ 404: { error: string; details?: unknown; }; }; type PaymentLinksDeactivateError = PaymentLinksDeactivateErrors[keyof PaymentLinksDeactivateErrors]; type PaymentLinksDeactivateResponses = { /** * Payment link deactivated */ 200: { id: string; status: 'active' | 'inactive' | 'archived'; status_changed_at: string; is_active: boolean; updated_at: string; }; }; type PaymentLinksDeactivateResponse = PaymentLinksDeactivateResponses[keyof PaymentLinksDeactivateResponses]; type PaymentLinksActivateData = { body?: never; path: { /** * Payment link UUID or public_id */ id: string; }; query?: never; url: '/payment-links/{id}/activate'; }; type PaymentLinksActivateErrors = { /** * Link is archived and cannot be reactivated */ 400: { error: string; details?: unknown; }; /** * Unauthorized */ 401: unknown; /** * Payment link not found */ 404: { error: string; details?: unknown; }; }; type PaymentLinksActivateError = PaymentLinksActivateErrors[keyof PaymentLinksActivateErrors]; type PaymentLinksActivateResponses = { /** * Payment link activated */ 200: { id: string; status: 'active' | 'inactive' | 'archived'; status_changed_at: string; is_active: boolean; updated_at: string; }; }; type PaymentLinksActivateResponse = PaymentLinksActivateResponses[keyof PaymentLinksActivateResponses]; type PaymentLinksArchiveData = { body?: never; path: { /** * Payment link UUID or public_id */ id: string; }; query?: never; url: '/payment-links/{id}/archive'; }; type PaymentLinksArchiveErrors = { /** * Unauthorized */ 401: unknown; /** * Payment link not found */ 404: { error: string; details?: unknown; }; }; type PaymentLinksArchiveError = PaymentLinksArchiveErrors[keyof PaymentLinksArchiveErrors]; type PaymentLinksArchiveResponses = { /** * Payment link archived */ 200: { id: string; status: 'active' | 'inactive' | 'archived'; status_changed_at: string; is_active: boolean; updated_at: string; }; }; type PaymentLinksArchiveResponse = PaymentLinksArchiveResponses[keyof PaymentLinksArchiveResponses]; type PricesListData = { body?: never; path?: never; query?: { /** * Filter by product ID */ product_id?: string; /** * Filter by price type */ type?: 'one_time' | 'recurring'; /** * Filter by pricing model */ pricing_model?: 'fixed' | 'pay_what_you_want' | 'free'; /** * Filter by active status */ active?: 'true' | 'false'; /** * Filter by currency */ currency?: string; /** * Filter by lookup key */ lookup_key?: string; /** * Number of results (1-100) */ limit?: number; /** * Cursor for pagination (ID to start after) */ starting_after?: string; /** * Cursor for pagination (ID to end before) */ ending_before?: string; }; url: '/prices'; }; type PricesListErrors = { /** * Unauthorized */ 401: PriceErrorResponse; }; type PricesListError = PricesListErrors[keyof PricesListErrors]; type PricesListResponses = { /** * List of prices */ 200: PriceListResponse; }; type PricesListResponse = PricesListResponses[keyof PricesListResponses]; type PricesCreateData = { /** * Price creation details */ body: CreatePriceRequest; path?: never; query?: never; url: '/prices'; }; type PricesCreateErrors = { /** * Validation error */ 400: PriceErrorResponse; /** * Unauthorized */ 401: PriceErrorResponse; /** * Product not found */ 404: PriceErrorResponse; }; type PricesCreateError = PricesCreateErrors[keyof PricesCreateErrors]; type PricesCreateResponses = { /** * Price created successfully */ 201: Price; }; type PricesCreateResponse = PricesCreateResponses[keyof PricesCreateResponses]; type PricesArchiveData = { body?: never; path: { /** * Price ID */ id: string; }; query?: never; url: '/prices/{id}'; }; type PricesArchiveErrors = { /** * Unauthorized */ 401: PriceErrorResponse; /** * Price not found */ 404: PriceErrorResponse; }; type PricesArchiveError = PricesArchiveErrors[keyof PricesArchiveErrors]; type PricesArchiveResponses = { /** * Price archived successfully */ 200: Price; }; type PricesArchiveResponse = PricesArchiveResponses[keyof PricesArchiveResponses]; type PricesGetData = { body?: never; path: { /** * Price ID */ id: string; }; query?: never; url: '/prices/{id}'; }; type PricesGetErrors = { /** * Unauthorized */ 401: PriceErrorResponse; /** * Price not found */ 404: PriceErrorResponse; }; type PricesGetError = PricesGetErrors[keyof PricesGetErrors]; type PricesGetResponses = { /** * Price details */ 200: Price; }; type PricesGetResponse = PricesGetResponses[keyof PricesGetResponses]; type PricesUpdateData = { /** * Price update details */ body: UpdatePriceRequest; path: { /** * Price ID */ id: string; }; query?: never; url: '/prices/{id}'; }; type PricesUpdateErrors = { /** * Validation error */ 400: PriceErrorResponse; /** * Unauthorized */ 401: PriceErrorResponse; /** * Price not found */ 404: PriceErrorResponse; }; type PricesUpdateError = PricesUpdateErrors[keyof PricesUpdateErrors]; type PricesUpdateResponses = { /** * Price updated successfully */ 200: Price; }; type PricesUpdateResponse = PricesUpdateResponses[keyof PricesUpdateResponses]; type AccountingInvoicePaymentRequestsCreateData = { body?: CreateAccountingInvoicePaymentRequestInput; path?: never; query?: never; url: '/integrations/accounting/invoice-payment-requests'; }; type AccountingInvoicePaymentRequestsCreateErrors = { /** * Validation error */ 400: { error: string; }; /** * Not found */ 404: { error: string; }; /** * Idempotency / conflict */ 409: { error: string; }; }; type AccountingInvoicePaymentRequestsCreateError = AccountingInvoicePaymentRequestsCreateErrors[keyof AccountingInvoicePaymentRequestsCreateErrors]; type AccountingInvoicePaymentRequestsCreateResponses = { /** * Idempotent replay */ 200: { data: AccountingInvoicePaymentRequest; requestId?: string; }; /** * Created */ 201: { data: AccountingInvoicePaymentRequest; requestId?: string; }; }; type AccountingInvoicePaymentRequestsCreateResponse = AccountingInvoicePaymentRequestsCreateResponses[keyof AccountingInvoicePaymentRequestsCreateResponses]; type AccountingInvoicePaymentRequestsGetData = { body?: never; path: { id: string; }; query?: never; url: '/integrations/accounting/invoice-payment-requests/{id}'; }; type AccountingInvoicePaymentRequestsGetErrors = { /** * Not found */ 404: { error: string; }; }; type AccountingInvoicePaymentRequestsGetError = AccountingInvoicePaymentRequestsGetErrors[keyof AccountingInvoicePaymentRequestsGetErrors]; type AccountingInvoicePaymentRequestsGetResponses = { /** * OK */ 200: { data: AccountingInvoicePaymentRequest; requestId?: string; }; }; type AccountingInvoicePaymentRequestsGetResponse = AccountingInvoicePaymentRequestsGetResponses[keyof AccountingInvoicePaymentRequestsGetResponses]; type WebhookEndpointsListData = { body?: never; path?: never; query?: { /** * Filter by endpoint status */ status?: 'enabled' | 'disabled'; /** * Maximum number of results to return (1-100, default 20) */ limit?: number; /** * Number of results to skip for pagination */ offset?: number | null; }; url: '/webhook-endpoints'; }; type WebhookEndpointsListErrors = { /** * Authentication required */ 401: unknown; }; type WebhookEndpointsListResponses = { /** * List of webhook endpoints */ 200: { data: Array<{ /** * Unique identifier for the webhook endpoint */ id: string; /** * The URL that receives webhook POST requests */ url: string; /** * Optional human-readable description */ description: string | null; /** * Event types this endpoint subscribes to */ enabled_events: Array; /** * Whether the endpoint is currently receiving events */ status: 'enabled' | 'disabled'; /** * Circuit breaker status. Opens after repeated delivery failures. */ circuit_breaker_state: 'closed' | 'open' | 'half_open'; /** * Total number of delivery attempts */ total_deliveries: number; /** * Number of successful deliveries */ successful_deliveries: number; /** * Number of failed deliveries */ failed_deliveries: number; /** * Timestamp of the most recent delivery attempt */ last_delivery_at: string | null; /** * When the endpoint was created */ created_at: string; /** * When the endpoint was last modified */ updated_at: string; }>; meta: { /** * Total number of results */ total: number; /** * Page size */ limit: number; /** * Number of results skipped */ offset: number; /** * Whether more results exist beyond this page */ has_more: boolean; }; }; }; type WebhookEndpointsListResponse = WebhookEndpointsListResponses[keyof WebhookEndpointsListResponses]; type WebhookEndpointsCreateData = { body?: { /** * The URL to receive webhook POST requests. Must be HTTPS in production. */ url: string; /** * Event types to subscribe to. At least one event is required. */ enabled_events: Array; /** * Optional human-readable description (max 500 characters) */ description?: string; }; path?: never; query?: never; url: '/webhook-endpoints'; }; type WebhookEndpointsCreateErrors = { /** * Invalid request body */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Webhook endpoint already exists for this URL */ 409: unknown; }; type WebhookEndpointsCreateResponses = { /** * Created webhook endpoint */ 201: { data: WebhookEndpoint; }; }; type WebhookEndpointsCreateResponse = WebhookEndpointsCreateResponses[keyof WebhookEndpointsCreateResponses]; type WebhookEndpointsDeleteData = { body?: never; path: { /** * Webhook endpoint ID */ id: string; }; query?: never; url: '/webhook-endpoints/{id}'; }; type WebhookEndpointsDeleteErrors = { /** * Authentication required */ 401: unknown; /** * Webhook endpoint not found */ 404: unknown; }; type WebhookEndpointsDeleteResponses = { /** * Deleted webhook endpoint */ 200: { data: { id: string; deleted: true; }; }; }; type WebhookEndpointsDeleteResponse = WebhookEndpointsDeleteResponses[keyof WebhookEndpointsDeleteResponses]; type WebhookEndpointsGetData = { body?: never; path: { /** * Webhook endpoint ID */ id: string; }; query?: never; url: '/webhook-endpoints/{id}'; }; type WebhookEndpointsGetErrors = { /** * Authentication required */ 401: unknown; /** * Webhook endpoint not found */ 404: unknown; }; type WebhookEndpointsGetResponses = { /** * Webhook endpoint details */ 200: { data: { /** * Unique identifier for the webhook endpoint */ id: string; /** * The URL that receives webhook POST requests */ url: string; /** * Optional human-readable description */ description: string | null; /** * Event types this endpoint subscribes to */ enabled_events: Array; /** * Whether the endpoint is currently receiving events */ status: 'enabled' | 'disabled'; /** * Circuit breaker status. Opens after repeated delivery failures. */ circuit_breaker_state: 'closed' | 'open' | 'half_open'; /** * Total number of delivery attempts */ total_deliveries: number; /** * Number of successful deliveries */ successful_deliveries: number; /** * Number of failed deliveries */ failed_deliveries: number; /** * Timestamp of the most recent delivery attempt */ last_delivery_at: string | null; /** * When the endpoint was created */ created_at: string; /** * When the endpoint was last modified */ updated_at: string; }; }; }; type WebhookEndpointsGetResponse = WebhookEndpointsGetResponses[keyof WebhookEndpointsGetResponses]; type WebhookEndpointsUpdateData = { body?: { /** * New URL for the endpoint */ url?: string; /** * Replace the subscribed event types */ enabled_events?: Array; /** * Update the description */ description?: string | null; /** * Enable or disable the endpoint */ enabled?: boolean; }; path: { /** * Webhook endpoint ID */ id: string; }; query?: never; url: '/webhook-endpoints/{id}'; }; type WebhookEndpointsUpdateErrors = { /** * Invalid request body */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Webhook endpoint not found */ 404: unknown; }; type WebhookEndpointsUpdateResponses = { /** * Updated webhook endpoint */ 200: { data: { /** * Unique identifier for the webhook endpoint */ id: string; /** * The URL that receives webhook POST requests */ url: string; /** * Optional human-readable description */ description: string | null; /** * Event types this endpoint subscribes to */ enabled_events: Array; /** * Whether the endpoint is currently receiving events */ status: 'enabled' | 'disabled'; /** * Circuit breaker status. Opens after repeated delivery failures. */ circuit_breaker_state: 'closed' | 'open' | 'half_open'; /** * Total number of delivery attempts */ total_deliveries: number; /** * Number of successful deliveries */ successful_deliveries: number; /** * Number of failed deliveries */ failed_deliveries: number; /** * Timestamp of the most recent delivery attempt */ last_delivery_at: string | null; /** * When the endpoint was created */ created_at: string; /** * When the endpoint was last modified */ updated_at: string; }; }; }; type WebhookEndpointsUpdateResponse = WebhookEndpointsUpdateResponses[keyof WebhookEndpointsUpdateResponses]; type WebhookEndpointsRotateSecretData = { body?: never; path: { /** * Webhook endpoint ID */ id: string; }; query?: never; url: '/webhook-endpoints/{id}/rotate-secret'; }; type WebhookEndpointsRotateSecretErrors = { /** * Authentication required */ 401: unknown; /** * Webhook endpoint not found */ 404: unknown; }; type WebhookEndpointsRotateSecretResponses = { /** * Rotated signing secret */ 200: { data: WebhookEndpoint; }; }; type WebhookEndpointsRotateSecretResponse = WebhookEndpointsRotateSecretResponses[keyof WebhookEndpointsRotateSecretResponses]; type WebhookDeliveriesListData = { body?: never; path?: never; query?: { /** * Filter by webhook endpoint ID */ endpoint_id?: string; /** * Filter by source event ID */ event_id?: string; /** * Filter by delivery status */ status?: 'pending' | 'succeeded' | 'failed' | 'dead_lettered'; /** * Maximum number of deliveries to return (1-100, default 20). */ limit?: number; /** * Cursor — return deliveries created before the row with this ID. */ starting_after?: string; /** * Cursor — return deliveries created after the row with this ID. */ ending_before?: string; }; url: '/webhook-deliveries'; }; type WebhookDeliveriesListErrors = { /** * Unauthorized */ 401: WebhookDeliveryErrorResponse; }; type WebhookDeliveriesListError = WebhookDeliveriesListErrors[keyof WebhookDeliveriesListErrors]; type WebhookDeliveriesListResponses = { /** * Paginated list of webhook deliveries. */ 200: WebhookDeliveryListResponse; }; type WebhookDeliveriesListResponse = WebhookDeliveriesListResponses[keyof WebhookDeliveriesListResponses]; type WebhookDeliveriesGetData = { body?: never; path: { /** * Webhook delivery ID */ id: string; }; query?: never; url: '/webhook-deliveries/{id}'; }; type WebhookDeliveriesGetErrors = { /** * Webhook delivery not found */ 404: WebhookDeliveryErrorResponse; }; type WebhookDeliveriesGetError = WebhookDeliveriesGetErrors[keyof WebhookDeliveriesGetErrors]; type WebhookDeliveriesGetResponses = { /** * Webhook delivery details */ 200: WebhookDeliveryResponse; }; type WebhookDeliveriesGetResponse = WebhookDeliveriesGetResponses[keyof WebhookDeliveriesGetResponses]; type WebhookDeliveriesRetryData = { body?: never; path: { /** * Webhook delivery ID */ id: string; }; query?: never; url: '/webhook-deliveries/{id}/retry'; }; type WebhookDeliveriesRetryErrors = { /** * Webhook delivery not found */ 404: WebhookDeliveryErrorResponse; /** * Delivery already succeeded and cannot be retried. */ 409: WebhookDeliveryErrorResponse; }; type WebhookDeliveriesRetryError = WebhookDeliveriesRetryErrors[keyof WebhookDeliveriesRetryErrors]; type WebhookDeliveriesRetryResponses = { /** * Delivery queued for retry. */ 200: WebhookDeliveryRetryResponse; }; type WebhookDeliveriesRetryResponse = WebhookDeliveriesRetryResponses[keyof WebhookDeliveriesRetryResponses]; type CustomerPortalSessionsCreateData = { body: CreateCustomerPortalSessionRequest; path?: never; query?: never; url: '/customer-portal/sessions'; }; type CustomerPortalSessionsCreateErrors = { /** * Invalid or missing merchant API key. */ 401: CustomerPortalErrorResponse; /** * Customer not found for this merchant. */ 404: CustomerPortalErrorResponse; }; type CustomerPortalSessionsCreateError = CustomerPortalSessionsCreateErrors[keyof CustomerPortalSessionsCreateErrors]; type CustomerPortalSessionsCreateResponses = { /** * Session created. The bearer token is returned only once. */ 201: CustomerPortalSessionCreateResponse; }; type CustomerPortalSessionsCreateResponse = CustomerPortalSessionsCreateResponses[keyof CustomerPortalSessionsCreateResponses]; type CustomerPortalCustomerGetData = { body?: never; path?: never; query?: never; url: '/customer-portal/customer'; }; type CustomerPortalCustomerGetErrors = { /** * Missing or invalid customer-portal session token. */ 401: CustomerPortalErrorResponse; /** * Customer record no longer exists. */ 404: CustomerPortalErrorResponse; }; type CustomerPortalCustomerGetError = CustomerPortalCustomerGetErrors[keyof CustomerPortalCustomerGetErrors]; type CustomerPortalCustomerGetResponses = { /** * Authenticated customer. */ 200: PortalCustomerResponse; }; type CustomerPortalCustomerGetResponse = CustomerPortalCustomerGetResponses[keyof CustomerPortalCustomerGetResponses]; type CustomerPortalSubscriptionsListData = { body?: never; path?: never; query?: { /** * Maximum number of results to return (1-100, default 20). */ limit?: number; /** * Cursor — return results created before the row with this ID. */ starting_after?: string; /** * Cursor — return results created after the row with this ID. */ ending_before?: string; }; url: '/customer-portal/subscriptions'; }; type CustomerPortalSubscriptionsListErrors = { /** * Missing or invalid customer-portal session token. */ 401: CustomerPortalErrorResponse; }; type CustomerPortalSubscriptionsListError = CustomerPortalSubscriptionsListErrors[keyof CustomerPortalSubscriptionsListErrors]; type CustomerPortalSubscriptionsListResponses = { /** * Paginated list of subscriptions. */ 200: PortalSubscriptionList; }; type CustomerPortalSubscriptionsListResponse = CustomerPortalSubscriptionsListResponses[keyof CustomerPortalSubscriptionsListResponses]; type CustomerPortalSubscriptionsGetData = { body?: never; path: { /** * Subscription ID. */ id: string; }; query?: never; url: '/customer-portal/subscriptions/{id}'; }; type CustomerPortalSubscriptionsGetErrors = { /** * Unauthorized. */ 401: CustomerPortalErrorResponse; /** * Subscription not found. */ 404: CustomerPortalErrorResponse; }; type CustomerPortalSubscriptionsGetError = CustomerPortalSubscriptionsGetErrors[keyof CustomerPortalSubscriptionsGetErrors]; type CustomerPortalSubscriptionsGetResponses = { /** * Subscription details. */ 200: PortalSubscriptionResponse; }; type CustomerPortalSubscriptionsGetResponse = CustomerPortalSubscriptionsGetResponses[keyof CustomerPortalSubscriptionsGetResponses]; type CustomerPortalSubscriptionsCancelData = { body?: CancelSubscriptionRequest; path: { /** * Subscription ID to cancel. */ id: string; }; query?: never; url: '/customer-portal/subscriptions/{id}/cancel'; }; type CustomerPortalSubscriptionsCancelErrors = { /** * Unauthorized. */ 401: CustomerPortalErrorResponse; /** * Subscription not found. */ 404: CustomerPortalErrorResponse; }; type CustomerPortalSubscriptionsCancelError = CustomerPortalSubscriptionsCancelErrors[keyof CustomerPortalSubscriptionsCancelErrors]; type CustomerPortalSubscriptionsCancelResponses = { /** * Subscription canceled. */ 200: PortalSubscriptionCancelResponse; }; type CustomerPortalSubscriptionsCancelResponse = CustomerPortalSubscriptionsCancelResponses[keyof CustomerPortalSubscriptionsCancelResponses]; type CustomerPortalInvoicesListData = { body?: never; path?: never; query?: { /** * Maximum number of results to return (1-100, default 20). */ limit?: number; /** * Cursor — return results created before the row with this ID. */ starting_after?: string; /** * Cursor — return results created after the row with this ID. */ ending_before?: string; }; url: '/customer-portal/invoices'; }; type CustomerPortalInvoicesListErrors = { /** * Unauthorized. */ 401: CustomerPortalErrorResponse; }; type CustomerPortalInvoicesListError = CustomerPortalInvoicesListErrors[keyof CustomerPortalInvoicesListErrors]; type CustomerPortalInvoicesListResponses = { /** * Paginated list of invoices. */ 200: PortalInvoiceList; }; type CustomerPortalInvoicesListResponse = CustomerPortalInvoicesListResponses[keyof CustomerPortalInvoicesListResponses]; type CustomerPortalInvoicesGetData = { body?: never; path: { /** * Invoice ID. */ id: string; }; query?: never; url: '/customer-portal/invoices/{id}'; }; type CustomerPortalInvoicesGetErrors = { /** * Unauthorized. */ 401: CustomerPortalErrorResponse; /** * Invoice not found. */ 404: CustomerPortalErrorResponse; }; type CustomerPortalInvoicesGetError = CustomerPortalInvoicesGetErrors[keyof CustomerPortalInvoicesGetErrors]; type CustomerPortalInvoicesGetResponses = { /** * Invoice details. */ 200: PortalInvoiceResponse; }; type CustomerPortalInvoicesGetResponse = CustomerPortalInvoicesGetResponses[keyof CustomerPortalInvoicesGetResponses]; type CustomerPortalMandatesListData = { body?: never; path?: never; query?: never; url: '/customer-portal/mandates'; }; type CustomerPortalMandatesListErrors = { /** * Unauthorized. */ 401: CustomerPortalErrorResponse; /** * Direct Debit self-service is not enabled. */ 403: CustomerPortalErrorResponse; }; type CustomerPortalMandatesListError = CustomerPortalMandatesListErrors[keyof CustomerPortalMandatesListErrors]; type CustomerPortalMandatesListResponses = { /** * The customer's Direct Debit mandates. */ 200: PortalMandateList; }; type CustomerPortalMandatesListResponse = CustomerPortalMandatesListResponses[keyof CustomerPortalMandatesListResponses]; type CustomerPortalMandatesReauthorizeData = { body: PortalReauthorizeMandateRequest; path: { /** * ID of the mandate being amended. */ id: string; }; query?: never; url: '/customer-portal/mandates/{id}/re-authorize'; }; type CustomerPortalMandatesReauthorizeErrors = { /** * Validation failed or DD not enabled. */ 400: CustomerPortalErrorResponse; /** * Unauthorized. */ 401: CustomerPortalErrorResponse; /** * Direct Debit self-service is not enabled. */ 403: CustomerPortalErrorResponse; /** * Mandate not found. */ 404: CustomerPortalErrorResponse; /** * A bank-detail amendment is already in progress or the mandate changed concurrently. */ 409: CustomerPortalErrorResponse; /** * Customer record is missing required Direct Debit fields. */ 422: CustomerPortalErrorResponse; /** * The provider accepted the amendment but local persistence requires reconciliation. */ 500: CustomerPortalErrorResponse; /** * The provider rejected the amendment or its outcome requires reconciliation. */ 502: CustomerPortalErrorResponse; /** * Secure bank-detail storage is unavailable. */ 503: CustomerPortalErrorResponse; }; type CustomerPortalMandatesReauthorizeError = CustomerPortalMandatesReauthorizeErrors[keyof CustomerPortalMandatesReauthorizeErrors]; type CustomerPortalMandatesReauthorizeResponses = { /** * Existing mandate updated and returned to pending provider confirmation. */ 201: PortalReauthorizeMandateResponse; }; type CustomerPortalMandatesReauthorizeResponse = CustomerPortalMandatesReauthorizeResponses[keyof CustomerPortalMandatesReauthorizeResponses]; type CustomerPortalMandatesCancelData = { body?: { reason?: string; }; path: { /** * Mandate ID */ id: string; }; query?: never; url: '/customer-portal/mandates/{id}/cancel'; }; type CustomerPortalMandatesCancelErrors = { /** * Already cancelled or invalid. */ 400: CustomerPortalErrorResponse; /** * Self-service not enabled. */ 403: CustomerPortalErrorResponse; /** * Not found or not owned. */ 404: CustomerPortalErrorResponse; }; type CustomerPortalMandatesCancelError = CustomerPortalMandatesCancelErrors[keyof CustomerPortalMandatesCancelErrors]; type CustomerPortalMandatesCancelResponses = { /** * Mandate cancelled. */ 200: { data: PortalMandate; }; }; type CustomerPortalMandatesCancelResponse = CustomerPortalMandatesCancelResponses[keyof CustomerPortalMandatesCancelResponses]; type CustomerPortalMandatesReauthorizeSendOtpData = { body?: never; path: { id: string; }; query?: never; url: '/customer-portal/mandates/{id}/re-authorize/send-otp'; }; type CustomerPortalMandatesReauthorizeSendOtpErrors = { /** * DD not enabled. */ 400: CustomerPortalErrorResponse; /** * DD self-service not enabled. */ 403: CustomerPortalErrorResponse; /** * Mandate not found. */ 404: CustomerPortalErrorResponse; /** * Mandate not in an amendable state. */ 409: CustomerPortalErrorResponse; /** * Customer record is missing an email. */ 422: CustomerPortalErrorResponse; }; type CustomerPortalMandatesReauthorizeSendOtpError = CustomerPortalMandatesReauthorizeSendOtpErrors[keyof CustomerPortalMandatesReauthorizeSendOtpErrors]; type CustomerPortalMandatesReauthorizeSendOtpResponses = { /** * OTP dispatched (or silently rate-limited). */ 200: PortalReauthorizeSendOtpResponse; }; type CustomerPortalMandatesReauthorizeSendOtpResponse = CustomerPortalMandatesReauthorizeSendOtpResponses[keyof CustomerPortalMandatesReauthorizeSendOtpResponses]; type CustomerPortalMandatesReauthorizeVerifyOtpData = { body: PortalReauthorizeVerifyOtpRequest; path: { id: string; }; query?: never; url: '/customer-portal/mandates/{id}/re-authorize/verify-otp'; }; type CustomerPortalMandatesReauthorizeVerifyOtpErrors = { /** * Invalid or expired code / DD not enabled. */ 400: CustomerPortalErrorResponse; /** * DD self-service not enabled. */ 403: CustomerPortalErrorResponse; /** * Mandate not found. */ 404: CustomerPortalErrorResponse; /** * Customer record is missing an email. */ 422: CustomerPortalErrorResponse; }; type CustomerPortalMandatesReauthorizeVerifyOtpError = CustomerPortalMandatesReauthorizeVerifyOtpErrors[keyof CustomerPortalMandatesReauthorizeVerifyOtpErrors]; type CustomerPortalMandatesReauthorizeVerifyOtpResponses = { /** * Code verified; token issued. */ 200: PortalReauthorizeVerifyOtpResponse; }; type CustomerPortalMandatesReauthorizeVerifyOtpResponse = CustomerPortalMandatesReauthorizeVerifyOtpResponses[keyof CustomerPortalMandatesReauthorizeVerifyOtpResponses]; type CustomerMetersListData = { body?: never; path?: never; query: { /** * Customer UUID. Required — customer-meters are not queryable merchant-wide via this endpoint. Use /v2/meters for merchant-level meter definitions. */ customer_id: string; /** * Optional single-meter filter. When provided, the response contains at most one entry. */ meter_id?: string; }; url: '/customer-meters'; }; type CustomerMetersListErrors = { /** * Missing or invalid customer_id. */ 400: CustomerMeterErrorResponse; /** * Unauthorized. */ 401: CustomerMeterErrorResponse; }; type CustomerMetersListError = CustomerMetersListErrors[keyof CustomerMetersListErrors]; type CustomerMetersListResponses = { /** * List of customer-meter aggregates (one per meter the merchant has defined). */ 200: CustomerMeterList; }; type CustomerMetersListResponse = CustomerMetersListResponses[keyof CustomerMetersListResponses]; type CustomerMetersGetData = { body?: never; path: { /** * Customer UUID */ customer_id: string; /** * Meter UUID */ meter_id: string; }; query?: never; url: '/customer-meters/{customer_id}/{meter_id}'; }; type CustomerMetersGetErrors = { /** * Unauthorized. */ 401: CustomerMeterErrorResponse; /** * Meter not found. */ 404: CustomerMeterErrorResponse; }; type CustomerMetersGetError = CustomerMetersGetErrors[keyof CustomerMetersGetErrors]; type CustomerMetersGetResponses = { /** * Customer-meter aggregate. */ 200: CustomerMeterResponse; }; type CustomerMetersGetResponse = CustomerMetersGetResponses[keyof CustomerMetersGetResponses]; type PaymentIntentsListData = { body?: never; path?: never; query?: { /** * Filter by customer ID */ customer?: string; /** * Filter by status */ status?: 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'succeeded' | 'canceled'; /** * Filter by created_at >= (Unix timestamp) */ created_gte?: number | null; /** * Filter by created_at <= (Unix timestamp) */ created_lte?: number | null; /** * Maximum number of results (1-100) */ limit?: number; /** * Cursor for pagination - return results after this ID (pi_xxx) */ starting_after?: string; /** * Cursor for pagination - return results before this ID (pi_xxx) */ ending_before?: string; }; url: '/payment-intents'; }; type PaymentIntentsListErrors = { /** * Unauthorized */ 401: PaymentIntentErrorResponse; }; type PaymentIntentsListError = PaymentIntentsListErrors[keyof PaymentIntentsListErrors]; type PaymentIntentsListResponses = { /** * List of payment intents */ 200: PaymentIntentListResponse; }; type PaymentIntentsListResponse = PaymentIntentsListResponses[keyof PaymentIntentsListResponses]; type PaymentIntentsCreateData = { body?: CreatePaymentIntentRequest; path?: never; query?: never; url: '/payment-intents'; }; type PaymentIntentsCreateErrors = { /** * Invalid request */ 400: PaymentIntentErrorResponse; /** * Unauthorized */ 401: PaymentIntentErrorResponse; }; type PaymentIntentsCreateError = PaymentIntentsCreateErrors[keyof PaymentIntentsCreateErrors]; type PaymentIntentsCreateResponses = { /** * Payment intent created successfully */ 200: PaymentIntent; }; type PaymentIntentsCreateResponse = PaymentIntentsCreateResponses[keyof PaymentIntentsCreateResponses]; type PaymentIntentsGetData = { body?: never; path: { /** * Payment intent ID (pi_xxx) */ id: string; }; query?: never; url: '/payment-intents/{id}'; }; type PaymentIntentsGetErrors = { /** * Payment intent not found */ 404: PaymentIntentErrorResponse; }; type PaymentIntentsGetError = PaymentIntentsGetErrors[keyof PaymentIntentsGetErrors]; type PaymentIntentsGetResponses = { /** * Payment intent details */ 200: PaymentIntent; }; type PaymentIntentsGetResponse = PaymentIntentsGetResponses[keyof PaymentIntentsGetResponses]; type PaymentIntentsConfirmData = { body?: ConfirmPaymentIntentRequest; path: { /** * Payment intent ID (pi_xxx) */ id: string; }; query?: never; url: '/payment-intents/{id}/confirm'; }; type PaymentIntentsConfirmErrors = { /** * Invalid request or confirmation failed */ 400: PaymentIntentErrorResponse; /** * Payment intent not found */ 404: PaymentIntentErrorResponse; }; type PaymentIntentsConfirmError = PaymentIntentsConfirmErrors[keyof PaymentIntentsConfirmErrors]; type PaymentIntentsConfirmResponses = { /** * Confirmed payment intent */ 200: PaymentIntent; }; type PaymentIntentsConfirmResponse = PaymentIntentsConfirmResponses[keyof PaymentIntentsConfirmResponses]; type PaymentIntentsCaptureData = { body?: CapturePaymentIntentRequest; path: { /** * Payment intent ID (pi_xxx) */ id: string; }; query?: never; url: '/payment-intents/{id}/capture'; }; type PaymentIntentsCaptureErrors = { /** * Invalid request or capture failed */ 400: PaymentIntentErrorResponse; /** * Payment intent not found */ 404: PaymentIntentErrorResponse; }; type PaymentIntentsCaptureError = PaymentIntentsCaptureErrors[keyof PaymentIntentsCaptureErrors]; type PaymentIntentsCaptureResponses = { /** * Captured payment intent */ 200: PaymentIntent; }; type PaymentIntentsCaptureResponse = PaymentIntentsCaptureResponses[keyof PaymentIntentsCaptureResponses]; type PaymentIntentsCancelData = { body?: CancelPaymentIntentRequest; path: { /** * Payment intent ID (pi_xxx) */ id: string; }; query?: never; url: '/payment-intents/{id}/cancel'; }; type PaymentIntentsCancelErrors = { /** * Invalid request or cancellation failed */ 400: PaymentIntentErrorResponse; /** * Payment intent not found */ 404: PaymentIntentErrorResponse; }; type PaymentIntentsCancelError = PaymentIntentsCancelErrors[keyof PaymentIntentsCancelErrors]; type PaymentIntentsCancelResponses = { /** * Canceled payment intent */ 200: PaymentIntent; }; type PaymentIntentsCancelResponse = PaymentIntentsCancelResponses[keyof PaymentIntentsCancelResponses]; type EventsListData = { body?: never; path?: never; query?: { /** * Filter by event type (e.g., invoice.paid) */ type?: string; /** * Filter by multiple event types (comma-separated) */ types?: string; /** * Filter by customer ID */ customer_id?: string; /** * Filter by invoice ID */ invoice_id?: string; /** * Filter by subscription ID */ subscription_id?: string; /** * Filter by order ID */ order_id?: string; /** * Filter by created_at >= (Unix timestamp) */ created_gte?: number | null; /** * Filter by created_at <= (Unix timestamp) */ created_lte?: number | null; /** * Maximum number of results (1-100) */ limit?: number; /** * Cursor for pagination - return results after this event ID */ starting_after?: string; /** * Cursor for pagination - return results before this event ID */ ending_before?: string; }; url: '/events'; }; type EventsListErrors = { /** * Unauthorized */ 401: EventErrorResponse; }; type EventsListError = EventsListErrors[keyof EventsListErrors]; type EventsListResponses = { /** * List of events */ 200: EventListResponse; }; type EventsListResponse = EventsListResponses[keyof EventsListResponses]; type EventsGetData = { body?: never; path: { /** * Event ID */ id: string; }; query?: never; url: '/events/{id}'; }; type EventsGetErrors = { /** * Unauthorized */ 401: EventErrorResponse; /** * Event not found */ 404: EventErrorResponse; }; type EventsGetError = EventsGetErrors[keyof EventsGetErrors]; type EventsGetResponses = { /** * Event details */ 200: Event; }; type EventsGetResponse = EventsGetResponses[keyof EventsGetResponses]; type EventsResendData = { body?: never; path: { /** * Event ID */ id: string; }; query?: never; url: '/events/{id}/resend'; }; type EventsResendErrors = { /** * Unauthorized */ 401: EventErrorResponse; /** * Event not found */ 404: EventErrorResponse; }; type EventsResendError = EventsResendErrors[keyof EventsResendErrors]; type EventsResendResponses = { /** * Webhook queued for resending */ 200: ResendWebhookResponse; }; type EventsResendResponse = EventsResendResponses[keyof EventsResendResponses]; type EntitlementsListData = { body?: never; path?: never; query: { /** * Customer UUID (required) */ customer_id: string; /** * Include expired entitlements */ include_expired?: boolean | null; /** * Filter by benefit type */ benefit_type?: string; /** * Filter by category */ category?: string; /** * Maximum results (1-100) */ limit?: number; /** * Results to skip */ offset?: number | null; }; url: '/entitlements'; }; type EntitlementsListErrors = { /** * Missing customer_id */ 400: unknown; /** * Unauthorized */ 401: unknown; /** * Customer not found */ 404: unknown; }; type EntitlementsListResponses = { /** * List of customer entitlements */ 200: EntitlementListResponse; }; type EntitlementsListResponse = EntitlementsListResponses[keyof EntitlementsListResponses]; type EntitlementsCheckData = { body?: never; path?: never; query: { /** * Customer UUID (required) */ customer_id: string; /** * Benefit key to check */ benefit_key: string; }; url: '/entitlements/check'; }; type EntitlementsCheckErrors = { /** * Unauthorized */ 401: unknown; /** * Customer not found */ 404: unknown; }; type EntitlementsCheckResponses = { /** * Entitlement check result */ 200: EntitlementCheckResponse; }; type EntitlementsCheckResponse = EntitlementsCheckResponses[keyof EntitlementsCheckResponses]; type TransactionsListData = { body?: never; path?: never; query?: { /** * Filter by transaction type */ type?: 'sale' | 'refund' | 'void' | 'capture' | 'dispute' | 'adjustment'; /** * Filter by status */ status?: 'pending' | 'succeeded' | 'failed' | 'voided'; /** * Filter by customer ID */ customer_id?: string; /** * Filter by invoice ID */ invoice_id?: string; /** * Filter by created_at >= (Unix timestamp) */ created_gte?: number | null; /** * Filter by created_at <= (Unix timestamp) */ created_lte?: number | null; /** * Maximum number of results (1-100) */ limit?: number; /** * Cursor for pagination - return results after this ID */ starting_after?: string; /** * Cursor for pagination - return results before this ID */ ending_before?: string; }; url: '/transactions'; }; type TransactionsListErrors = { /** * Unauthorized */ 401: TransactionListResponse; }; type TransactionsListError = TransactionsListErrors[keyof TransactionsListErrors]; type TransactionsListResponses = { /** * List of transactions */ 200: TransactionListResponse; }; type TransactionsListResponse = TransactionsListResponses[keyof TransactionsListResponses]; type TransactionsGetData = { body?: never; path: { /** * Transaction UUID */ id: string; }; query?: never; url: '/transactions/{id}'; }; type TransactionsGetErrors = { /** * Unauthorized */ 401: { error: string; }; /** * Transaction not found */ 404: { error: string; }; }; type TransactionsGetError = TransactionsGetErrors[keyof TransactionsGetErrors]; type TransactionsGetResponses = { /** * Transaction details */ 200: TransactionRetrieveResponse; }; type TransactionsGetResponse = TransactionsGetResponses[keyof TransactionsGetResponses]; type DdMandateRequestsGetData = { body?: never; path: { /** * Signed mandate-request token from the emailed link */ token: string; }; query?: never; url: '/dd/mandate-requests/{token}'; }; type DdMandateRequestsGetErrors = { /** * Mandate request not found */ 404: unknown; /** * Too many mandate request lookups */ 429: unknown; }; type DdMandateRequestsGetResponses = { /** * Mandate request details */ 200: MandateRequestLookupResponse; }; type DdMandateRequestsGetResponse = DdMandateRequestsGetResponses[keyof DdMandateRequestsGetResponses]; type DdValidateData = { body?: ValidateBankAccountRequest; path?: never; query?: never; url: '/dd/validate'; }; type DdValidateErrors = { /** * Direct Debit not enabled, or invalid request */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Validation failed */ 500: unknown; }; type DdValidateResponses = { /** * Validation result */ 200: ValidateBankAccountResponse; }; type DdValidateResponse = DdValidateResponses[keyof DdValidateResponses]; type DdPreviewData = { body?: PreviewCollectionRequest; path?: never; query?: never; url: '/dd/preview'; }; type DdPreviewErrors = { /** * Direct Debit not enabled, or invalid request */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Preview failed */ 500: unknown; }; type DdPreviewResponses = { /** * Collection date chain */ 200: PreviewCollectionResponse; }; type DdPreviewResponse = DdPreviewResponses[keyof DdPreviewResponses]; type MandatesListData = { body?: never; path?: never; query?: { /** * Filter mandates by customer */ customerId?: string; /** * Filter mandates by status (e.g. active, suspended, cancelled) */ status?: string; }; url: '/mandates'; }; type MandatesListErrors = { /** * Authentication required */ 401: unknown; }; type MandatesListResponses = { /** * List of mandates */ 200: MandateListResponse; }; type MandatesListResponse = MandatesListResponses[keyof MandatesListResponses]; type MandatesCreateData = { body?: CreateMandateRequest; headers: { /** * Required stable key for this logical mandate submission. Reuse the same key only with an identical request. */ 'Idempotency-Key': string; }; path?: never; query?: never; url: '/mandates'; }; type MandatesCreateErrors = { /** * Invalid request, or Direct Debit not enabled */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Customer or mandate-request not found */ 404: unknown; /** * Idempotency conflict, submission in progress, existing mandate, or token mismatch */ 409: unknown; /** * Mandate request or capture session expired */ 410: unknown; /** * Customer record missing fields required for Bacs */ 422: unknown; /** * Bureau submission failed */ 502: unknown; /** * Secure credential storage unavailable */ 503: unknown; }; type MandatesCreateResponses = { /** * Mandate created */ 201: MandateResponse; }; type MandatesCreateResponse = MandatesCreateResponses[keyof MandatesCreateResponses]; type MandatesGetData = { body?: never; path: { /** * Mandate ID */ id: string; }; query?: never; url: '/mandates/{id}'; }; type MandatesGetErrors = { /** * Authentication required */ 401: unknown; /** * Mandate not found */ 404: unknown; }; type MandatesGetResponses = { /** * Mandate */ 200: MandateResponse; }; type MandatesGetResponse = MandatesGetResponses[keyof MandatesGetResponses]; type MandatesCancelData = { body?: MandateActionRequest; path: { /** * Mandate ID */ id: string; }; query?: never; url: '/mandates/{id}/cancel'; }; type MandatesCancelErrors = { /** * Mandate is already cancelled */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Mandate not found */ 404: unknown; }; type MandatesCancelResponses = { /** * Mandate cancelled */ 200: MandateActionResponse; }; type MandatesCancelResponse = MandatesCancelResponses[keyof MandatesCancelResponses]; type MandatesSuspendData = { body?: MandateActionRequest; path: { /** * Mandate ID */ id: string; }; query?: never; url: '/mandates/{id}/suspend'; }; type MandatesSuspendErrors = { /** * Mandate cannot be suspended from its current status */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Mandate not found */ 404: unknown; }; type MandatesSuspendResponses = { /** * Mandate suspended */ 200: MandateActionResponse; }; type MandatesSuspendResponse = MandatesSuspendResponses[keyof MandatesSuspendResponses]; type MandatesReinstateData = { body?: MandateActionRequest; path: { /** * Mandate ID */ id: string; }; query?: never; url: '/mandates/{id}/reinstate'; }; type MandatesReinstateErrors = { /** * Mandate is not suspended, or Direct Debit not enabled */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Mandate or customer not found */ 404: unknown; /** * Stored bank details unavailable/invalid, or missing bureau reference */ 409: unknown; /** * Customer record missing fields required for Bacs */ 422: unknown; /** * Bureau reinstatement failed */ 502: unknown; /** * Secure credential storage unavailable */ 503: unknown; }; type MandatesReinstateResponses = { /** * Mandate re-lodged (pending_lodgement) */ 200: MandateActionResponse; }; type MandatesReinstateResponse = MandatesReinstateResponses[keyof MandatesReinstateResponses]; type MandatesScheduleCollectionData = { body?: ScheduleCollectionRequest; path: { /** * Mandate ID */ id: string; }; query?: never; url: '/mandates/{id}/collections'; }; type MandatesScheduleCollectionErrors = { /** * Invalid request */ 400: unknown; /** * Authentication required */ 401: unknown; /** * Missing mandates:write scope */ 403: unknown; /** * Mandate not found */ 404: unknown; /** * Mandate is not active, or a collection for this source is already in flight */ 409: unknown; /** * Direct Debit not enabled, non-GBP currency, or the collection timeline is not eligible */ 422: unknown; /** * Bureau submission or advance-notice dispatch failed */ 502: unknown; }; type MandatesScheduleCollectionResponses = { /** * An existing schedule for this source was returned (idempotent retry) */ 200: ScheduleCollectionResponse; /** * Collection scheduled */ 201: ScheduleCollectionResponse; }; type MandatesScheduleCollectionResponse = MandatesScheduleCollectionResponses[keyof MandatesScheduleCollectionResponses]; type WebhooksPaymentSucceededWebhookPayload = WebhookEvent; type WebhooksPaymentSucceededWebhookRequest = { body: WebhooksPaymentSucceededWebhookPayload; key: 'payment.succeeded'; path?: never; query?: never; }; type WebhooksPaymentFailedWebhookPayload = WebhookEvent; type WebhooksPaymentFailedWebhookRequest = { body: WebhooksPaymentFailedWebhookPayload; key: 'payment.failed'; path?: never; query?: never; }; type WebhooksInvoiceCreatedWebhookPayload = WebhookEvent; type WebhooksInvoiceCreatedWebhookRequest = { body: WebhooksInvoiceCreatedWebhookPayload; key: 'invoice.created'; path?: never; query?: never; }; type WebhooksInvoicePaidWebhookPayload = WebhookEvent; type WebhooksInvoicePaidWebhookRequest = { body: WebhooksInvoicePaidWebhookPayload; key: 'invoice.paid'; path?: never; query?: never; }; type WebhooksInvoiceOverdueWebhookPayload = WebhookEvent; type WebhooksInvoiceOverdueWebhookRequest = { body: WebhooksInvoiceOverdueWebhookPayload; key: 'invoice.overdue'; path?: never; query?: never; }; type WebhooksSubscriptionCreatedWebhookPayload = WebhookEvent; type WebhooksSubscriptionCreatedWebhookRequest = { body: WebhooksSubscriptionCreatedWebhookPayload; key: 'subscription.created'; path?: never; query?: never; }; type WebhooksSubscriptionActivatedWebhookPayload = WebhookEvent; type WebhooksSubscriptionActivatedWebhookRequest = { body: WebhooksSubscriptionActivatedWebhookPayload; key: 'subscription.activated'; path?: never; query?: never; }; type WebhooksSubscriptionCanceledWebhookPayload = WebhookEvent; type WebhooksSubscriptionCanceledWebhookRequest = { body: WebhooksSubscriptionCanceledWebhookPayload; key: 'subscription.canceled'; path?: never; query?: never; }; type WebhooksSubscriptionRenewedWebhookPayload = WebhookEvent; type WebhooksSubscriptionRenewedWebhookRequest = { body: WebhooksSubscriptionRenewedWebhookPayload; key: 'subscription.renewed'; path?: never; query?: never; }; type WebhooksCustomerCreatedWebhookPayload = WebhookEvent; type WebhooksCustomerCreatedWebhookRequest = { body: WebhooksCustomerCreatedWebhookPayload; key: 'customer.created'; path?: never; query?: never; }; type WebhooksCustomerUpdatedWebhookPayload = WebhookEvent; type WebhooksCustomerUpdatedWebhookRequest = { body: WebhooksCustomerUpdatedWebhookPayload; key: 'customer.updated'; path?: never; query?: never; }; type WebhooksRefundCreatedWebhookPayload = WebhookEvent; type WebhooksRefundCreatedWebhookRequest = { body: WebhooksRefundCreatedWebhookPayload; key: 'refund.created'; path?: never; query?: never; }; type WebhooksRefundSucceededWebhookPayload = WebhookEvent; type WebhooksRefundSucceededWebhookRequest = { body: WebhooksRefundSucceededWebhookPayload; key: 'refund.succeeded'; path?: never; query?: never; }; type WebhooksVoidCreatedWebhookPayload = WebhookEvent; type WebhooksVoidCreatedWebhookRequest = { body: WebhooksVoidCreatedWebhookPayload; key: 'void.created'; path?: never; query?: never; }; type WebhooksVoidSucceededWebhookPayload = WebhookEvent; type WebhooksVoidSucceededWebhookRequest = { body: WebhooksVoidSucceededWebhookPayload; key: 'void.succeeded'; path?: never; query?: never; }; type WebhooksVoidFailedWebhookPayload = WebhookEvent; type WebhooksVoidFailedWebhookRequest = { body: WebhooksVoidFailedWebhookPayload; key: 'void.failed'; path?: never; query?: never; }; type WebhooksCreditNoteCreatedWebhookPayload = WebhookEvent; type WebhooksCreditNoteCreatedWebhookRequest = { body: WebhooksCreditNoteCreatedWebhookPayload; key: 'credit_note.created'; path?: never; query?: never; }; type WebhooksCreditNoteIssuedWebhookPayload = WebhookEvent; type WebhooksCreditNoteIssuedWebhookRequest = { body: WebhooksCreditNoteIssuedWebhookPayload; key: 'credit_note.issued'; path?: never; query?: never; }; type WebhooksCreditNoteVoidedWebhookPayload = WebhookEvent; type WebhooksCreditNoteVoidedWebhookRequest = { body: WebhooksCreditNoteVoidedWebhookPayload; key: 'credit_note.voided'; path?: never; query?: never; }; type WebhooksCheckoutSessionCompletedWebhookPayload = WebhookEvent; type WebhooksCheckoutSessionCompletedWebhookRequest = { body: WebhooksCheckoutSessionCompletedWebhookPayload; key: 'checkout.session.completed'; path?: never; query?: never; }; type WebhooksCheckoutSessionExpiredWebhookPayload = WebhookEvent; type WebhooksCheckoutSessionExpiredWebhookRequest = { body: WebhooksCheckoutSessionExpiredWebhookPayload; key: 'checkout.session.expired'; path?: never; query?: never; }; type WebhooksOrderCreatedWebhookPayload = WebhookEvent; type WebhooksOrderCreatedWebhookRequest = { body: WebhooksOrderCreatedWebhookPayload; key: 'order.created'; path?: never; query?: never; }; type WebhooksOrderPaidWebhookPayload = WebhookEvent; type WebhooksOrderPaidWebhookRequest = { body: WebhooksOrderPaidWebhookPayload; key: 'order.paid'; path?: never; query?: never; }; type WebhooksTerminalPaymentRequestedWebhookPayload = WebhookEvent; type WebhooksTerminalPaymentRequestedWebhookRequest = { body: WebhooksTerminalPaymentRequestedWebhookPayload; key: 'terminal_payment.requested'; path?: never; query?: never; }; type WebhooksTerminalPaymentSucceededWebhookPayload = WebhookEvent; type WebhooksTerminalPaymentSucceededWebhookRequest = { body: WebhooksTerminalPaymentSucceededWebhookPayload; key: 'terminal_payment.succeeded'; path?: never; query?: never; }; type WebhooksTerminalPaymentDeclinedWebhookPayload = WebhookEvent; type WebhooksTerminalPaymentDeclinedWebhookRequest = { body: WebhooksTerminalPaymentDeclinedWebhookPayload; key: 'terminal_payment.declined'; path?: never; query?: never; }; type WebhooksTerminalPaymentCancelledWebhookPayload = WebhookEvent; type WebhooksTerminalPaymentCancelledWebhookRequest = { body: WebhooksTerminalPaymentCancelledWebhookPayload; key: 'terminal_payment.cancelled'; path?: never; query?: never; }; type WebhooksTerminalPaymentErrorWebhookPayload = WebhookEvent; type WebhooksTerminalPaymentErrorWebhookRequest = { body: WebhooksTerminalPaymentErrorWebhookPayload; key: 'terminal_payment.error'; path?: never; query?: never; }; type WebhooksTerminalRefundSucceededWebhookPayload = WebhookEvent; type WebhooksTerminalRefundSucceededWebhookRequest = { body: WebhooksTerminalRefundSucceededWebhookPayload; key: 'terminal_refund.succeeded'; path?: never; query?: never; }; type WebhooksTerminalVoidSucceededWebhookPayload = WebhookEvent; type WebhooksTerminalVoidSucceededWebhookRequest = { body: WebhooksTerminalVoidSucceededWebhookPayload; key: 'terminal_void.succeeded'; path?: never; query?: never; }; type WebhooksOrderFulfilledWebhookPayload = WebhookEvent; type WebhooksOrderFulfilledWebhookRequest = { body: WebhooksOrderFulfilledWebhookPayload; key: 'order.fulfilled'; path?: never; query?: never; }; type WebhooksUsageThresholdReachedWebhookPayload = WebhookEvent; type WebhooksUsageThresholdReachedWebhookRequest = { body: WebhooksUsageThresholdReachedWebhookPayload; key: 'usage.threshold.reached'; path?: never; query?: never; }; type WebhooksUsagePeriodFinalizedWebhookPayload = WebhookEvent; type WebhooksUsagePeriodFinalizedWebhookRequest = { body: WebhooksUsagePeriodFinalizedWebhookPayload; key: 'usage.period_finalized'; path?: never; query?: never; }; type WebhooksUsageInvoiceCreatedWebhookPayload = WebhookEvent; type WebhooksUsageInvoiceCreatedWebhookRequest = { body: WebhooksUsageInvoiceCreatedWebhookPayload; key: 'usage.invoice.created'; path?: never; query?: never; }; type WebhooksUsageEventIngestedWebhookPayload = WebhookEvent; type WebhooksUsageEventIngestedWebhookRequest = { body: WebhooksUsageEventIngestedWebhookPayload; key: 'usage.event.ingested'; path?: never; query?: never; }; type WebhooksUsageEventRejectedWebhookPayload = WebhookEvent; type WebhooksUsageEventRejectedWebhookRequest = { body: WebhooksUsageEventRejectedWebhookPayload; key: 'usage.event.rejected'; path?: never; query?: never; }; type WebhooksMeterCreatedWebhookPayload = WebhookEvent; type WebhooksMeterCreatedWebhookRequest = { body: WebhooksMeterCreatedWebhookPayload; key: 'meter.created'; path?: never; query?: never; }; type WebhooksMeterUpdatedWebhookPayload = WebhookEvent; type WebhooksMeterUpdatedWebhookRequest = { body: WebhooksMeterUpdatedWebhookPayload; key: 'meter.updated'; path?: never; query?: never; }; type WebhooksMeterArchivedWebhookPayload = WebhookEvent; type WebhooksMeterArchivedWebhookRequest = { body: WebhooksMeterArchivedWebhookPayload; key: 'meter.archived'; path?: never; query?: never; }; type WebhooksMeterPriceCreatedWebhookPayload = WebhookEvent; type WebhooksMeterPriceCreatedWebhookRequest = { body: WebhooksMeterPriceCreatedWebhookPayload; key: 'meter_price.created'; path?: never; query?: never; }; type WebhooksMeterPriceUpdatedWebhookPayload = WebhookEvent; type WebhooksMeterPriceUpdatedWebhookRequest = { body: WebhooksMeterPriceUpdatedWebhookPayload; key: 'meter_price.updated'; path?: never; query?: never; }; type WebhooksMeterPriceDeactivatedWebhookPayload = WebhookEvent; type WebhooksMeterPriceDeactivatedWebhookRequest = { body: WebhooksMeterPriceDeactivatedWebhookPayload; key: 'meter_price.deactivated'; path?: never; query?: never; }; type WebhooksMandateCreatedWebhookPayload = WebhookEvent; type WebhooksMandateCreatedWebhookRequest = { body: WebhooksMandateCreatedWebhookPayload; key: 'mandate.created'; path?: never; query?: never; }; type WebhooksMandateActivatedWebhookPayload = WebhookEvent; type WebhooksMandateActivatedWebhookRequest = { body: WebhooksMandateActivatedWebhookPayload; key: 'mandate.activated'; path?: never; query?: never; }; type WebhooksMandateAuddisRejectedWebhookPayload = WebhookEvent; type WebhooksMandateAuddisRejectedWebhookRequest = { body: WebhooksMandateAuddisRejectedWebhookPayload; key: 'mandate.auddis_rejected'; path?: never; query?: never; }; type WebhooksMandateSuspendedWebhookPayload = WebhookEvent; type WebhooksMandateSuspendedWebhookRequest = { body: WebhooksMandateSuspendedWebhookPayload; key: 'mandate.suspended'; path?: never; query?: never; }; type WebhooksMandateCancelledWebhookPayload = WebhookEvent; type WebhooksMandateCancelledWebhookRequest = { body: WebhooksMandateCancelledWebhookPayload; key: 'mandate.cancelled'; path?: never; query?: never; }; type WebhooksCollectionScheduledWebhookPayload = WebhookEvent; type WebhooksCollectionScheduledWebhookRequest = { body: WebhooksCollectionScheduledWebhookPayload; key: 'collection.scheduled'; path?: never; query?: never; }; type WebhooksCollectionNoticeSentWebhookPayload = WebhookEvent; type WebhooksCollectionNoticeSentWebhookRequest = { body: WebhooksCollectionNoticeSentWebhookPayload; key: 'collection.notice_sent'; path?: never; query?: never; }; type WebhooksCollectionSucceededWebhookPayload = WebhookEvent; type WebhooksCollectionSucceededWebhookRequest = { body: WebhooksCollectionSucceededWebhookPayload; key: 'collection.succeeded'; path?: never; query?: never; }; type WebhooksCollectionFailedWebhookPayload = WebhookEvent; type WebhooksCollectionFailedWebhookRequest = { body: WebhooksCollectionFailedWebhookPayload; key: 'collection.failed'; path?: never; query?: never; }; type WebhooksCollectionIndemnityClaimedWebhookPayload = WebhookEvent; type WebhooksCollectionIndemnityClaimedWebhookRequest = { body: WebhooksCollectionIndemnityClaimedWebhookPayload; key: 'collection.indemnity_claimed'; path?: never; query?: never; }; type WebhooksSettlementCreatedWebhookPayload = WebhookEvent; type WebhooksSettlementCreatedWebhookRequest = { body: WebhooksSettlementCreatedWebhookPayload; key: 'settlement.created'; path?: never; query?: never; }; export type { CustomerMetersListResponse as $, AccountingInvoicePaymentRequestsCreateData as A, BatchIngestResult as B, CartApiKeysEnsureResponse as C, CartSessionsUpdateLineItemData as D, CartSessionsUpdateLineItemResponse as E, CheckoutSessionsCreateData as F, CheckoutSessionsCreateResponse as G, CheckoutSessionsExpireData as H, CheckoutSessionsExpireResponse as I, CheckoutSessionsGetData as J, CheckoutSessionsGetResponse as K, CreditNotesCreateData as L, CreditNotesCreateResponse as M, CreditNotesGetData as N, CreditNotesGetResponse as O, CreditNotesListData as P, CreditNotesListResponse as Q, CreditNotesListLinesData as R, CreditNotesListLinesResponse as S, CreditNotesPreviewData as T, UsageEvent as U, CreditNotesPreviewResponse as V, CreditNotesVoidData as W, CreditNotesVoidResponse as X, CustomerMetersGetData as Y, CustomerMetersGetResponse as Z, CustomerMetersListData as _, AccountingInvoicePaymentRequestsCreateResponse as a, InvoicesSendResponse as a$, CustomerPortalCustomerGetResponse as a0, CustomerPortalInvoicesGetData as a1, CustomerPortalInvoicesGetResponse as a2, CustomerPortalInvoicesListData as a3, CustomerPortalInvoicesListResponse as a4, CustomerPortalMandatesCancelData as a5, CustomerPortalMandatesCancelResponse as a6, CustomerPortalMandatesListResponse as a7, CustomerPortalMandatesReauthorizeData as a8, CustomerPortalMandatesReauthorizeResponse as a9, DdMandateRequestsGetData as aA, DdMandateRequestsGetResponse as aB, DdPreviewData as aC, DdPreviewResponse as aD, DdValidateData as aE, DdValidateResponse as aF, EntitlementsCheckData as aG, EntitlementsCheckResponse as aH, EntitlementsListData as aI, EntitlementsListResponse as aJ, EventsGetData as aK, EventsGetResponse as aL, EventsListData as aM, EventsListResponse as aN, EventsResendData as aO, EventsResendResponse as aP, InvoicesCreateData as aQ, InvoicesCreateResponse as aR, InvoicesFinalizeData as aS, InvoicesFinalizeResponse as aT, InvoicesGetData as aU, InvoicesGetResponse as aV, InvoicesListData as aW, InvoicesListResponse as aX, InvoicesMarginEstimateData as aY, InvoicesMarginEstimateResponse as aZ, InvoicesSendData as a_, CustomerPortalMandatesReauthorizeSendOtpData as aa, CustomerPortalMandatesReauthorizeSendOtpResponse as ab, CustomerPortalMandatesReauthorizeVerifyOtpData as ac, CustomerPortalMandatesReauthorizeVerifyOtpResponse as ad, CustomerPortalSessionsCreateData as ae, CustomerPortalSessionsCreateResponse as af, CustomerPortalSubscriptionsCancelData as ag, CustomerPortalSubscriptionsCancelResponse as ah, CustomerPortalSubscriptionsGetData as ai, CustomerPortalSubscriptionsGetResponse as aj, CustomerPortalSubscriptionsListData as ak, CustomerPortalSubscriptionsListResponse as al, CustomersCreateData as am, CustomersCreateResponse as an, CustomersGetData as ao, CustomersGetResponse as ap, CustomersListData as aq, CustomersListResponse as ar, CustomersPaymentMethodsListData as as, CustomersPaymentMethodsListResponse as at, CustomersPaymentRailsGetData as au, CustomersPaymentRailsGetResponse as av, CustomersPreferredRailsGetData as aw, CustomersPreferredRailsGetResponse as ax, CustomersUpdateData as ay, CustomersUpdateResponse as az, AccountingInvoicePaymentRequestsGetData as b, ProductsUpdateResponse as b$, InvoicesUpdateData as b0, InvoicesUpdateResponse as b1, InvoicesVoidData as b2, InvoicesVoidResponse as b3, MandatesCancelData as b4, MandatesCancelResponse as b5, MandatesCreateData as b6, MandatesCreateResponse as b7, MandatesGetData as b8, MandatesGetResponse as b9, PaymentLinksDeactivateData as bA, PaymentLinksDeactivateResponse as bB, PaymentLinksExpireData as bC, PaymentLinksExpireResponse as bD, PaymentLinksGetData as bE, PaymentLinksGetResponse as bF, PaymentLinksListData as bG, PaymentLinksListResponse as bH, PaymentLinksUpdateData as bI, PaymentLinksUpdateResponse as bJ, PricesArchiveData as bK, PricesArchiveResponse as bL, PricesCreateData as bM, PricesCreateResponse as bN, PricesGetData as bO, PricesGetResponse as bP, PricesListData as bQ, PricesListResponse as bR, PricesUpdateData as bS, PricesUpdateResponse as bT, ProductsCreateData as bU, ProductsCreateResponse as bV, ProductsGetData as bW, ProductsGetResponse as bX, ProductsListData as bY, ProductsListResponse as bZ, ProductsUpdateData as b_, MandatesListData as ba, MandatesListResponse as bb, MandatesReinstateData as bc, MandatesReinstateResponse as bd, MandatesScheduleCollectionData as be, MandatesScheduleCollectionResponse as bf, MandatesSuspendData as bg, MandatesSuspendResponse as bh, PaymentIntentsCancelData as bi, PaymentIntentsCancelResponse as bj, PaymentIntentsCaptureData as bk, PaymentIntentsCaptureResponse as bl, PaymentIntentsConfirmData as bm, PaymentIntentsConfirmResponse as bn, PaymentIntentsCreateData as bo, PaymentIntentsCreateResponse as bp, PaymentIntentsGetData as bq, PaymentIntentsGetResponse as br, PaymentIntentsListData as bs, PaymentIntentsListResponse as bt, PaymentLinksActivateData as bu, PaymentLinksActivateResponse as bv, PaymentLinksArchiveData as bw, PaymentLinksArchiveResponse as bx, PaymentLinksCreateData as by, PaymentLinksCreateResponse as bz, AccountingInvoicePaymentRequestsGetResponse as c, CartApiKeysStatusErrors as c$, RefundsCreateData as c0, RefundsCreateResponse as c1, RefundsGetData as c2, RefundsGetResponse as c3, RefundsListData as c4, RefundsListResponse as c5, StorefrontOriginsCreateData as c6, StorefrontOriginsCreateResponse as c7, StorefrontOriginsDeleteData as c8, StorefrontOriginsDeleteResponse as c9, WebhookEndpointsCreateData as cA, WebhookEndpointsCreateResponse as cB, WebhookEndpointsDeleteData as cC, WebhookEndpointsDeleteResponse as cD, WebhookEndpointsGetData as cE, WebhookEndpointsGetResponse as cF, WebhookEndpointsListData as cG, WebhookEndpointsListResponse as cH, WebhookEndpointsRotateSecretData as cI, WebhookEndpointsRotateSecretResponse as cJ, WebhookEndpointsUpdateData as cK, WebhookEndpointsUpdateResponse as cL, UsageIngestRequest as cM, DryRunResult as cN, AccountingInvoicePaymentRequestsCreateResponses as cO, AccountingInvoicePaymentRequestsCreateErrors as cP, AccountingInvoicePaymentRequestsGetResponses as cQ, AccountingInvoicePaymentRequestsGetErrors as cR, AnalyticsRevenueMrrSummaryResponses as cS, AnalyticsRevenueTimeSeriesResponses as cT, CartApiKeysEnsureData as cU, CartApiKeysEnsureResponses as cV, CartApiKeysEnsureErrors as cW, CartApiKeysRotateResponses as cX, CartApiKeysRotateErrors as cY, CartApiKeysStatusData as cZ, CartApiKeysStatusResponses as c_, StorefrontOriginsListResponse as ca, StorefrontProductsGetData as cb, StorefrontProductsGetResponse as cc, StorefrontProductsListData as cd, StorefrontProductsListResponse as ce, StorefrontStatusGetResponse as cf, SubscriptionsCancelData as cg, SubscriptionsCancelResponse as ch, SubscriptionsCreateData as ci, SubscriptionsCreateResponse as cj, SubscriptionsGetData as ck, SubscriptionsGetResponse as cl, SubscriptionsListData as cm, SubscriptionsListResponse as cn, SubscriptionsUpdateData as co, SubscriptionsUpdateResponse as cp, TransactionsGetData as cq, TransactionsGetResponse as cr, TransactionsListData as cs, TransactionsListResponse as ct, WebhookDeliveriesGetData as cu, WebhookDeliveriesGetResponse as cv, WebhookDeliveriesListData as cw, WebhookDeliveriesListResponse as cx, WebhookDeliveriesRetryData as cy, WebhookDeliveriesRetryResponse as cz, AnalyticsRevenueMrrSummaryData as d, CustomerPortalSubscriptionsGetResponses as d$, CartSessionsAddLineItemResponses as d0, CartSessionsAddLineItemErrors as d1, CartSessionsApplyDiscountCodeResponses as d2, CartSessionsApplyDiscountCodeErrors as d3, CartSessionsConvertResponses as d4, CartSessionsConvertErrors as d5, CartSessionsCreateResponses as d6, CartSessionsCreateErrors as d7, CartSessionsGetResponses as d8, CartSessionsGetErrors as d9, CreditNotesVoidErrors as dA, CustomerMetersGetResponses as dB, CustomerMetersGetErrors as dC, CustomerMetersListResponses as dD, CustomerMetersListErrors as dE, CustomerPortalCustomerGetData as dF, CustomerPortalCustomerGetResponses as dG, CustomerPortalCustomerGetErrors as dH, CustomerPortalInvoicesGetResponses as dI, CustomerPortalInvoicesGetErrors as dJ, CustomerPortalInvoicesListResponses as dK, CustomerPortalInvoicesListErrors as dL, CustomerPortalMandatesCancelResponses as dM, CustomerPortalMandatesCancelErrors as dN, CustomerPortalMandatesListData as dO, CustomerPortalMandatesListResponses as dP, CustomerPortalMandatesListErrors as dQ, CustomerPortalMandatesReauthorizeResponses as dR, CustomerPortalMandatesReauthorizeErrors as dS, CustomerPortalMandatesReauthorizeSendOtpResponses as dT, CustomerPortalMandatesReauthorizeSendOtpErrors as dU, CustomerPortalMandatesReauthorizeVerifyOtpResponses as dV, CustomerPortalMandatesReauthorizeVerifyOtpErrors as dW, CustomerPortalSessionsCreateResponses as dX, CustomerPortalSessionsCreateErrors as dY, CustomerPortalSubscriptionsCancelResponses as dZ, CustomerPortalSubscriptionsCancelErrors as d_, CartSessionsRemoveLineItemResponses as da, CartSessionsRemoveLineItemErrors as db, CartSessionsSetContactResponses as dc, CartSessionsSetContactErrors as dd, CartSessionsToggleAddOnResponses as de, CartSessionsToggleAddOnErrors as df, CartSessionsUpdateLineItemResponses as dg, CartSessionsUpdateLineItemErrors as dh, CheckoutSessionsCreateResponses as di, CheckoutSessionsCreateErrors as dj, CheckoutSessionsExpireResponses as dk, CheckoutSessionsExpireErrors as dl, CheckoutSessionsGetResponses as dm, CheckoutSessionsGetErrors as dn, CreditNotesCreateResponses as dp, CreditNotesCreateErrors as dq, CreditNotesGetResponses as dr, CreditNotesGetErrors as ds, CreditNotesListResponses as dt, CreditNotesListErrors as du, CreditNotesListLinesResponses as dv, CreditNotesListLinesErrors as dw, CreditNotesPreviewResponses as dx, CreditNotesPreviewErrors as dy, CreditNotesVoidResponses as dz, AnalyticsRevenueMrrSummaryResponse as e, PaymentIntentsConfirmResponses as e$, CustomerPortalSubscriptionsGetErrors as e0, CustomerPortalSubscriptionsListResponses as e1, CustomerPortalSubscriptionsListErrors as e2, CustomersCreateResponses as e3, CustomersCreateErrors as e4, CustomersGetResponses as e5, CustomersGetErrors as e6, CustomersListResponses as e7, CustomersListErrors as e8, CustomersPaymentMethodsListResponses as e9, InvoicesGetResponses as eA, InvoicesListResponses as eB, InvoicesMarginEstimateResponses as eC, InvoicesMarginEstimateErrors as eD, InvoicesSendResponses as eE, InvoicesSendErrors as eF, InvoicesUpdateResponses as eG, InvoicesVoidResponses as eH, InvoicesVoidErrors as eI, MandatesCancelResponses as eJ, MandatesCancelErrors as eK, MandatesCreateResponses as eL, MandatesCreateErrors as eM, MandatesGetResponses as eN, MandatesGetErrors as eO, MandatesListResponses as eP, MandatesListErrors as eQ, MandatesReinstateResponses as eR, MandatesReinstateErrors as eS, MandatesScheduleCollectionResponses as eT, MandatesScheduleCollectionErrors as eU, MandatesSuspendResponses as eV, MandatesSuspendErrors as eW, PaymentIntentsCancelResponses as eX, PaymentIntentsCancelErrors as eY, PaymentIntentsCaptureResponses as eZ, PaymentIntentsCaptureErrors as e_, CustomersPaymentMethodsListErrors as ea, CustomersPaymentRailsGetResponses as eb, CustomersPaymentRailsGetErrors as ec, CustomersPreferredRailsGetResponses as ed, CustomersPreferredRailsGetErrors as ee, CustomersUpdateResponses as ef, CustomersUpdateErrors as eg, DdMandateRequestsGetResponses as eh, DdMandateRequestsGetErrors as ei, DdPreviewResponses as ej, DdPreviewErrors as ek, DdValidateResponses as el, DdValidateErrors as em, EntitlementsCheckResponses as en, EntitlementsCheckErrors as eo, EntitlementsListResponses as ep, EntitlementsListErrors as eq, EventsGetResponses as er, EventsGetErrors as es, EventsListResponses as et, EventsListErrors as eu, EventsResendResponses as ev, EventsResendErrors as ew, InvoicesCreateResponses as ex, InvoicesFinalizeResponses as ey, InvoicesFinalizeErrors as ez, AnalyticsRevenueTimeSeriesData as f, SubscriptionsCreateResponses as f$, PaymentIntentsConfirmErrors as f0, PaymentIntentsCreateResponses as f1, PaymentIntentsCreateErrors as f2, PaymentIntentsGetResponses as f3, PaymentIntentsGetErrors as f4, PaymentIntentsListResponses as f5, PaymentIntentsListErrors as f6, PaymentLinksActivateResponses as f7, PaymentLinksActivateErrors as f8, PaymentLinksArchiveResponses as f9, ProductsGetErrors as fA, ProductsListResponses as fB, ProductsListErrors as fC, ProductsUpdateResponses as fD, ProductsUpdateErrors as fE, RefundsCreateResponses as fF, RefundsCreateErrors as fG, RefundsGetResponses as fH, RefundsGetErrors as fI, RefundsListResponses as fJ, RefundsListErrors as fK, StorefrontOriginsCreateResponses as fL, StorefrontOriginsCreateErrors as fM, StorefrontOriginsDeleteResponses as fN, StorefrontOriginsDeleteErrors as fO, StorefrontOriginsListData as fP, StorefrontOriginsListResponses as fQ, StorefrontOriginsListErrors as fR, StorefrontProductsGetResponses as fS, StorefrontProductsGetErrors as fT, StorefrontProductsListResponses as fU, StorefrontProductsListErrors as fV, StorefrontStatusGetData as fW, StorefrontStatusGetResponses as fX, StorefrontStatusGetErrors as fY, SubscriptionsCancelResponses as fZ, SubscriptionsCancelErrors as f_, PaymentLinksArchiveErrors as fa, PaymentLinksCreateResponses as fb, PaymentLinksCreateErrors as fc, PaymentLinksDeactivateResponses as fd, PaymentLinksDeactivateErrors as fe, PaymentLinksExpireResponses as ff, PaymentLinksExpireErrors as fg, PaymentLinksGetResponses as fh, PaymentLinksGetErrors as fi, PaymentLinksListResponses as fj, PaymentLinksListErrors as fk, PaymentLinksUpdateResponses as fl, PaymentLinksUpdateErrors as fm, PricesArchiveResponses as fn, PricesArchiveErrors as fo, PricesCreateResponses as fp, PricesCreateErrors as fq, PricesGetResponses as fr, PricesGetErrors as fs, PricesListResponses as ft, PricesListErrors as fu, PricesUpdateResponses as fv, PricesUpdateErrors as fw, ProductsCreateResponses as fx, ProductsCreateErrors as fy, ProductsGetResponses as fz, AnalyticsRevenueTimeSeriesResponse as g, CartLineItemInput as g$, SubscriptionsCreateErrors as g0, SubscriptionsGetResponses as g1, SubscriptionsGetErrors as g2, SubscriptionsListResponses as g3, SubscriptionsListErrors as g4, SubscriptionsUpdateResponses as g5, SubscriptionsUpdateErrors as g6, TransactionsGetResponses as g7, TransactionsGetErrors as g8, TransactionsListResponses as g9, BacsDirectDebitDetails as gA, BankAccountDetails as gB, BatchIngestRequest as gC, Benefit as gD, BillingAnchorRulesResponse as gE, BillingDetails as gF, BillingIntervalsResponse as gG, BillingPreviewErrorResponse as gH, BillingPreviewResponse as gI, Business as gJ, CancelOrderRequest as gK, CancelPaymentIntentRequest as gL, CancelPaymentRequest as gM, CancelSetupIntentRequest as gN, CancelSubscriptionInput as gO, CancelSubscriptionRequest as gP, CancelSubscriptionScheduleRequest as gQ, CapturePaymentIntentRequest as gR, CapturePaymentRequest as gS, CardDetails as gT, CartApiKeysEnsureError as gU, CartApiKeysRotateError as gV, CartApiKeysStatusError as gW, CartBillingAnchorRule as gX, CartCheckoutSession as gY, CartConversionResponse as gZ, CartLineItem as g_, TransactionsListErrors as ga, WebhookDeliveriesGetResponses as gb, WebhookDeliveriesGetErrors as gc, WebhookDeliveriesListResponses as gd, WebhookDeliveriesListErrors as ge, WebhookDeliveriesRetryResponses as gf, WebhookDeliveriesRetryErrors as gg, WebhookEndpointsCreateResponses as gh, WebhookEndpointsCreateErrors as gi, WebhookEndpointsDeleteResponses as gj, WebhookEndpointsDeleteErrors as gk, WebhookEndpointsGetResponses as gl, WebhookEndpointsGetErrors as gm, WebhookEndpointsListResponses as gn, WebhookEndpointsListErrors as go, WebhookEndpointsRotateSecretResponses as gp, WebhookEndpointsRotateSecretErrors as gq, WebhookEndpointsUpdateResponses as gr, WebhookEndpointsUpdateErrors as gs, AccountingInvoicePaymentRequest as gt, AccountingInvoicePaymentRequestsCreateError as gu, AccountingInvoicePaymentRequestsGetError as gv, ApplyCartDiscountCodeInput as gw, AttachPaymentMethodRequest as gx, AuthenticationError as gy, AvsCodeInterpretation as gz, CartApiKeysRotateData as h, CreditNoteLineList as h$, CartLineItemRecurring as h0, CartSession as h1, CartSessionErrorResponse as h2, CartSessionResponse as h3, CartSessionStatus as h4, CartSessionsAddLineItemError as h5, CartSessionsApplyDiscountCodeError as h6, CartSessionsConvertError as h7, CartSessionsCreateError as h8, CartSessionsGetError as h9, CreateCheckoutSessionInput as hA, CreateCreditNoteInput as hB, CreateCustomerPortalSessionRequest as hC, CreateDiscountInput as hD, CreateExportRequest as hE, CreateImportRequest as hF, CreateMandateRequest as hG, CreateMeterPriceRequest as hH, CreateMeterRequest as hI, CreateMeterResponse as hJ, CreateOrderRequest as hK, CreatePaymentIntentRequest as hL, CreatePriceRequest as hM, CreateProductRequest as hN, CreateRefundInput as hO, CreateSetupIntentRequest as hP, CreateSubscriptionItemInput as hQ, CreateSubscriptionScheduleRequest as hR, CreateTaxRateRequest as hS, CreateTerminalPaymentRequest as hT, CreateTestEventRequest as hU, CreateVoidInput as hV, CreditEligibilityResponse as hW, CreditNote as hX, CreditNoteCreateResponse as hY, CreditNoteEligibilityResponse as hZ, CreditNoteLine as h_, CartSessionsRemoveLineItemError as ha, CartSessionsSetContactError as hb, CartSessionsToggleAddOnError as hc, CartSessionsUpdateLineItemError as hd, CartStartRule as he, ChargeCaptureResponse as hf, ChargeCreateResponse as hg, ChargeDuplicateErrorResponse as hh, ChargeErrorResponse as hi, ChargeListResponse as hj, ChargeRefundResponse as hk, ChargeRetrieveResponse as hl, CheckoutSession as hm, CheckoutSessionCreateResponse as hn, CheckoutSessionErrorResponse as ho, CheckoutSessionExpireResponse as hp, CheckoutSessionRetrieveResponse as hq, CheckoutSessionsCreateError as hr, CheckoutSessionsExpireError as hs, CheckoutSessionsGetError as ht, ClientOptions as hu, CollectionSchedule as hv, ConfirmPaymentIntentRequest as hw, ConfirmSetupIntentRequest as hx, CreateAccountingInvoicePaymentRequestInput as hy, CreateCartSessionInput as hz, CartApiKeysRotateResponse as i, EventListResponse as i$, CreditNoteListResponse as i0, CreditNotePreview as i1, CreditNotePreviewResponse as i2, CreditNoteResponse as i3, CreditNoteRetrieveResponse as i4, CreditNoteVoidResponse as i5, CustomerCreateResponse as i6, CustomerInvoice as i7, CustomerListResponse as i8, CustomerMeter as i9, CustomerUpdateResponse as iA, CvvCodeInterpretation as iB, DdCaptureSession as iC, DdCaptureSessionResponse as iD, DdMandatePdfReference as iE, DdMandateRequestActiveResponse as iF, DdMandateRequestCancelResponse as iG, DdMandateRequestConsumeResponse as iH, DdMandateRequestCreateResponse as iI, DdMandateRequestHistoryResponse as iJ, DdMandateRequestLifecycleItem as iK, DdMandateRequestLifecycleStatus as iL, DeclineAnalyticsResponse as iM, Discount as iN, DiscountCreateResponse as iO, DiscountDeleteResponse as iP, DiscountListResponse as iQ, DiscountRetrieveResponse as iR, DiscountUpdateResponse as iS, Dispute as iT, Entitlement as iU, EntitlementCheck as iV, EntitlementCheckResponse as iW, EntitlementListResponse as iX, ErrorResponse as iY, Event as iZ, EventErrorResponse as i_, CustomerMeterErrorResponse as ia, CustomerMeterList as ib, CustomerMeterResponse as ic, CustomerMetersGetError as id, CustomerMetersListError as ie, CustomerOrder as ig, CustomerPayment as ih, CustomerPaymentMethodsListResponse as ii, CustomerPortalCustomerGetError as ij, CustomerPortalErrorResponse as ik, CustomerPortalInvoicesGetError as il, CustomerPortalInvoicesListError as im, CustomerPortalMandatesCancelError as io, CustomerPortalMandatesListError as ip, CustomerPortalMandatesReauthorizeError as iq, CustomerPortalMandatesReauthorizeSendOtpError as ir, CustomerPortalMandatesReauthorizeVerifyOtpError as is, CustomerPortalSessionCreateResponse as it, CustomerPortalSessionsCreateError as iu, CustomerPortalSubscriptionsCancelError as iv, CustomerPortalSubscriptionsGetError as iw, CustomerPortalSubscriptionsListError as ix, CustomerRetrieveResponse as iy, CustomerSubscription as iz, CartApiKeysStatusResponse as j, PaymentLinksGetError as j$, EventRequest as j0, EventsGetError as j1, EventsListError as j2, EventsResendError as j3, Export as j4, ExportCreateResponse as j5, ExportRetrieveResponse as j6, ExternalUpsertResponse as j7, ForbiddenError as j8, FulfillOrderRequest as j9, Order as jA, OrderErrorResponse as jB, OrderLineItem as jC, OrderListResponse as jD, Pagination as jE, PauseSubscriptionInput as jF, PayOrderRequest as jG, Payment as jH, PaymentAttempt as jI, PaymentAttemptErrorResponse as jJ, PaymentAttemptListResponse as jK, PaymentAttemptSingleResponse as jL, PaymentErrorResponse as jM, PaymentIntent as jN, PaymentIntentErrorResponse as jO, PaymentIntentListResponse as jP, PaymentIntentsCancelError as jQ, PaymentIntentsCaptureError as jR, PaymentIntentsConfirmError as jS, PaymentIntentsCreateError as jT, PaymentIntentsGetError as jU, PaymentIntentsListError as jV, PaymentLinksActivateError as jW, PaymentLinksArchiveError as jX, PaymentLinksCreateError as jY, PaymentLinksDeactivateError as jZ, PaymentLinksExpireError as j_, Import as ja, ImportCreateResponse as jb, ImportRetrieveResponse as jc, Invoice as jd, InvoiceCommentDetail as je, InvoiceCommentDetailResponse as jf, InvoiceCommentListDetailResponse as jg, InvoiceListResponse as jh, InvoiceResponse as ji, Mandate as jj, MandateActionRequest as jk, MandateActionResponse as jl, MandateListItem as jm, MandateListResponse as jn, MandateRequestLookupResponse as jo, MandateResponse as jp, MarkDeliveredResponse as jq, MeterError as jr, MeterGetResponse as js, MeterListResponse as jt, MeterPriceError as ju, MeterPriceListResponse as jv, MeterPriceResponse as jw, MeterPriceTierInput as jx, NotFoundError as jy, OpenDispute as jz, CartSessionsAddLineItemData as k, SetupIntentNextAction as k$, PaymentLinksListError as k0, PaymentLinksUpdateError as k1, PaymentListResponse as k2, PaymentMethod as k3, PaymentMethodList as k4, PaymentSecurityResponse as k5, PaymentSecurityResult as k6, Payout as k7, PayoutPayment as k8, PhaseItem as k9, PricesListError as kA, PricesUpdateError as kB, Product as kC, ProductCreateResponse as kD, ProductErrorResponse as kE, ProductListResponse as kF, ProductRetrieveResponse as kG, ProductUpdateResponse as kH, ProductsCreateError as kI, ProductsGetError as kJ, ProductsListError as kK, ProductsUpdateError as kL, Refund as kM, RefundCreateResponse as kN, RefundListResponse as kO, RefundRetrieveResponse as kP, RefundTerminalPaymentRequest as kQ, ReleaseSubscriptionScheduleRequest as kR, ResendWebhookResponse as kS, RetryEligibilityResponse as kT, ScheduleCollectionRequest as kU, ScheduleCollectionResponse as kV, SchedulePhase as kW, SetCartContactInput as kX, SetupIntent as kY, SetupIntentError as kZ, SetupIntentList as k_, PortalCustomer as ka, PortalCustomerResponse as kb, PortalInvoice as kc, PortalInvoiceList as kd, PortalInvoiceResponse as ke, PortalMandate as kf, PortalMandateList as kg, PortalReauthorizeMandateRequest as kh, PortalReauthorizeMandateResponse as ki, PortalReauthorizeSendOtpResponse as kj, PortalReauthorizeVerifyOtpRequest as kk, PortalReauthorizeVerifyOtpResponse as kl, PortalSubscription as km, PortalSubscriptionCancelResponse as kn, PortalSubscriptionList as ko, PortalSubscriptionResponse as kp, PreviewCollectionRequest as kq, PreviewCollectionResponse as kr, PreviewCreditNoteInput as ks, Price as kt, PriceErrorResponse as ku, PriceListResponse as kv, PriceTier as kw, PricesArchiveError as kx, PricesCreateError as ky, PricesGetError as kz, CartSessionsAddLineItemResponse as l, TransactionReversalEligibilityResponse as l$, StaleUpdateResponse as l0, StorefrontAvailability as l1, StorefrontKeyStatus as l2, StorefrontOrigin as l3, StorefrontOriginCreateRequest as l4, StorefrontOriginCreateResponse as l5, StorefrontOriginDeleteResponse as l6, StorefrontOriginError as l7, StorefrontOriginListResponse as l8, StorefrontOriginsCreateError as l9, SubscriptionPauseResponse as lA, SubscriptionPreviewRenewalResponse as lB, SubscriptionReactivateResponse as lC, SubscriptionResumeResponse as lD, SubscriptionRetrieveResponse as lE, SubscriptionSchedule as lF, SubscriptionScheduleErrorResponse as lG, SubscriptionScheduleListResponse as lH, SubscriptionTerms as lI, SubscriptionUpdateResponse as lJ, SuccessResponse as lK, TaxRate as lL, TaxRateErrorResponse as lM, TaxRateListResponse as lN, TerminalDevice as lO, TerminalDeviceErrorResponse as lP, TerminalDeviceListResponse as lQ, TerminalDeviceResponse as lR, TerminalPayment as lS, TerminalPaymentErrorResponse as lT, TerminalPaymentListResponse as lU, TerminalPaymentResponse as lV, TestEventResponse as lW, ToggleCartAddOnInput as lX, Transaction as lY, TransactionListResponse as lZ, TransactionRetrieveResponse as l_, StorefrontOriginsDeleteError as la, StorefrontOriginsListError as lb, StorefrontPrice as lc, StorefrontProduct as ld, StorefrontProductError as le, StorefrontProductListResponse as lf, StorefrontProductResponse as lg, StorefrontProductsGetError as lh, StorefrontProductsListError as li, StorefrontStatus as lj, StorefrontStatusCheck as lk, StorefrontStatusError as ll, StorefrontStatusGetError as lm, StorefrontStatusResponse as ln, Subscription as lo, SubscriptionCancelResponse as lp, SubscriptionCancelSubscriptionResponse as lq, SubscriptionChangePlanResponse as lr, SubscriptionChangeQuantityResponse as ls, SubscriptionCreateResponse as lt, SubscriptionItem as lu, SubscriptionItemCreateResponse as lv, SubscriptionItemDeleteResponse as lw, SubscriptionItemListResponse as lx, SubscriptionItemUpdateResponse as ly, SubscriptionListResponse as lz, CartSessionsApplyDiscountCodeData as m, WebhooksCustomerCreatedWebhookPayload as m$, TransactionsGetError as m0, TransactionsListError as m1, TransformQuantity as m2, UnchangedContentResponse as m3, UpdateCartLineItemInput as m4, UpdateDiscountInput as m5, UpdateMeterPriceRequest as m6, UpdateMeterRequest as m7, UpdateMeterResponse as m8, UpdateOrderRequest as m9, WebhookDeliveryErrorResponse as mA, WebhookDeliveryListResponse as mB, WebhookDeliveryResponse as mC, WebhookDeliveryRetryResponse as mD, WebhookEndpoint as mE, WebhookEvent as mF, Webhooks as mG, WebhooksCheckoutSessionCompletedWebhookPayload as mH, WebhooksCheckoutSessionCompletedWebhookRequest as mI, WebhooksCheckoutSessionExpiredWebhookPayload as mJ, WebhooksCheckoutSessionExpiredWebhookRequest as mK, WebhooksCollectionFailedWebhookPayload as mL, WebhooksCollectionFailedWebhookRequest as mM, WebhooksCollectionIndemnityClaimedWebhookPayload as mN, WebhooksCollectionIndemnityClaimedWebhookRequest as mO, WebhooksCollectionNoticeSentWebhookPayload as mP, WebhooksCollectionNoticeSentWebhookRequest as mQ, WebhooksCollectionScheduledWebhookPayload as mR, WebhooksCollectionScheduledWebhookRequest as mS, WebhooksCollectionSucceededWebhookPayload as mT, WebhooksCollectionSucceededWebhookRequest as mU, WebhooksCreditNoteCreatedWebhookPayload as mV, WebhooksCreditNoteCreatedWebhookRequest as mW, WebhooksCreditNoteIssuedWebhookPayload as mX, WebhooksCreditNoteIssuedWebhookRequest as mY, WebhooksCreditNoteVoidedWebhookPayload as mZ, WebhooksCreditNoteVoidedWebhookRequest as m_, UpdatePaymentIntentRequest as ma, UpdatePaymentMethodRequest as mb, UpdatePriceRequest as mc, UpdateProductRequest as md, UpdateSetupIntentRequest as me, UpdateSubscriptionItemInput as mf, UpdateSubscriptionScheduleRequest as mg, UpdateTaxRateRequest as mh, UsageAggregateResponse as mi, UsageBalanceMeter as mj, UsageBalanceResponse as mk, UsageEventError as ml, UsageEventListResponse as mm, UsageEventRecord as mn, ValidateBankAccountRequest as mo, ValidateBankAccountResponse as mp, ValidationError as mq, Void as mr, VoidCreateResponse as ms, VoidListResponse as mt, VoidRetrieveResponse as mu, VoidTerminalPaymentRequest as mv, WebhookDeliveriesGetError as mw, WebhookDeliveriesListError as mx, WebhookDeliveriesRetryError as my, WebhookDelivery as mz, CartSessionsApplyDiscountCodeResponse as n, WebhooksTerminalPaymentSucceededWebhookPayload as n$, WebhooksCustomerCreatedWebhookRequest as n0, WebhooksCustomerUpdatedWebhookPayload as n1, WebhooksCustomerUpdatedWebhookRequest as n2, WebhooksInvoiceCreatedWebhookPayload as n3, WebhooksInvoiceCreatedWebhookRequest as n4, WebhooksInvoiceOverdueWebhookPayload as n5, WebhooksInvoiceOverdueWebhookRequest as n6, WebhooksInvoicePaidWebhookPayload as n7, WebhooksInvoicePaidWebhookRequest as n8, WebhooksMandateActivatedWebhookPayload as n9, WebhooksOrderPaidWebhookRequest as nA, WebhooksPaymentFailedWebhookPayload as nB, WebhooksPaymentFailedWebhookRequest as nC, WebhooksPaymentSucceededWebhookPayload as nD, WebhooksPaymentSucceededWebhookRequest as nE, WebhooksRefundCreatedWebhookPayload as nF, WebhooksRefundCreatedWebhookRequest as nG, WebhooksRefundSucceededWebhookPayload as nH, WebhooksRefundSucceededWebhookRequest as nI, WebhooksSettlementCreatedWebhookPayload as nJ, WebhooksSettlementCreatedWebhookRequest as nK, WebhooksSubscriptionActivatedWebhookPayload as nL, WebhooksSubscriptionActivatedWebhookRequest as nM, WebhooksSubscriptionCanceledWebhookPayload as nN, WebhooksSubscriptionCanceledWebhookRequest as nO, WebhooksSubscriptionCreatedWebhookPayload as nP, WebhooksSubscriptionCreatedWebhookRequest as nQ, WebhooksSubscriptionRenewedWebhookPayload as nR, WebhooksSubscriptionRenewedWebhookRequest as nS, WebhooksTerminalPaymentCancelledWebhookPayload as nT, WebhooksTerminalPaymentCancelledWebhookRequest as nU, WebhooksTerminalPaymentDeclinedWebhookPayload as nV, WebhooksTerminalPaymentDeclinedWebhookRequest as nW, WebhooksTerminalPaymentErrorWebhookPayload as nX, WebhooksTerminalPaymentErrorWebhookRequest as nY, WebhooksTerminalPaymentRequestedWebhookPayload as nZ, WebhooksTerminalPaymentRequestedWebhookRequest as n_, WebhooksMandateActivatedWebhookRequest as na, WebhooksMandateAuddisRejectedWebhookPayload as nb, WebhooksMandateAuddisRejectedWebhookRequest as nc, WebhooksMandateCancelledWebhookPayload as nd, WebhooksMandateCancelledWebhookRequest as ne, WebhooksMandateCreatedWebhookPayload as nf, WebhooksMandateCreatedWebhookRequest as ng, WebhooksMandateSuspendedWebhookPayload as nh, WebhooksMandateSuspendedWebhookRequest as ni, WebhooksMeterArchivedWebhookPayload as nj, WebhooksMeterArchivedWebhookRequest as nk, WebhooksMeterCreatedWebhookPayload as nl, WebhooksMeterCreatedWebhookRequest as nm, WebhooksMeterPriceCreatedWebhookPayload as nn, WebhooksMeterPriceCreatedWebhookRequest as no, WebhooksMeterPriceDeactivatedWebhookPayload as np, WebhooksMeterPriceDeactivatedWebhookRequest as nq, WebhooksMeterPriceUpdatedWebhookPayload as nr, WebhooksMeterPriceUpdatedWebhookRequest as ns, WebhooksMeterUpdatedWebhookPayload as nt, WebhooksMeterUpdatedWebhookRequest as nu, WebhooksOrderCreatedWebhookPayload as nv, WebhooksOrderCreatedWebhookRequest as nw, WebhooksOrderFulfilledWebhookPayload as nx, WebhooksOrderFulfilledWebhookRequest as ny, WebhooksOrderPaidWebhookPayload as nz, CartSessionsConvertData as o, WebhooksTerminalPaymentSucceededWebhookRequest as o0, WebhooksTerminalRefundSucceededWebhookPayload as o1, WebhooksTerminalRefundSucceededWebhookRequest as o2, WebhooksTerminalVoidSucceededWebhookPayload as o3, WebhooksTerminalVoidSucceededWebhookRequest as o4, WebhooksUsageEventIngestedWebhookPayload as o5, WebhooksUsageEventIngestedWebhookRequest as o6, WebhooksUsageEventRejectedWebhookPayload as o7, WebhooksUsageEventRejectedWebhookRequest as o8, WebhooksUsageInvoiceCreatedWebhookPayload as o9, WebhooksUsageInvoiceCreatedWebhookRequest as oa, WebhooksUsagePeriodFinalizedWebhookPayload as ob, WebhooksUsagePeriodFinalizedWebhookRequest as oc, WebhooksUsageThresholdReachedWebhookPayload as od, WebhooksUsageThresholdReachedWebhookRequest as oe, WebhooksVoidCreatedWebhookPayload as of, WebhooksVoidCreatedWebhookRequest as og, WebhooksVoidFailedWebhookPayload as oh, WebhooksVoidFailedWebhookRequest as oi, WebhooksVoidSucceededWebhookPayload as oj, WebhooksVoidSucceededWebhookRequest as ok, CartSessionsConvertResponse as p, CartSessionsCreateData as q, CartSessionsCreateResponse as r, CartSessionsGetData as s, CartSessionsGetResponse as t, CartSessionsRemoveLineItemData as u, CartSessionsRemoveLineItemResponse as v, CartSessionsSetContactData as w, CartSessionsSetContactResponse as x, CartSessionsToggleAddOnData as y, CartSessionsToggleAddOnResponse as z };