{"openapi":"3.1.0","info":{"title":"RevKeen API","version":"2026-05-01","description":"RevKeen public REST API for payments, subscriptions, invoicing, and billing.\n\nAuthentication: send your API key in the `x-api-key` header.\nProduction uses `rk_live_*`; staging uses `rk_sandbox_*`.\n\nBase URLs:\n- Production: `https://api.revkeen.com/v2`\n- Staging: `https://staging-api.revkeen.com/v2`\n- Mock: `https://mock-api.revkeen.com/v2`\n\nFor the human-friendly reference, open `https://docs.revkeen.com/api-reference/openapi`.","contact":{"name":"RevKeen Support","email":"info@revkeen.com","url":"https://docs.revkeen.com"},"license":{"name":"Proprietary","url":"https://revkeen.com/terms"},"x-logo":{"url":"https://revkeen.com/logo.svg","altText":"RevKeen"},"x-scalar-sdk-installation":[{"lang":"TypeScript","description":"Install the official [TypeScript SDK](https://www.npmjs.com/package/@revkeen/sdk) from npm.","source":"npm install @revkeen/sdk"},{"lang":"Go","description":"Install the official [Go SDK](https://pkg.go.dev/github.com/revkeen/revkeen-go) via go get.","source":"go get github.com/revkeen/revkeen-go"},{"lang":"PHP","description":"Install the official [PHP SDK](https://packagist.org/packages/revkeen/sdk-php) from Packagist.","source":"composer require revkeen/sdk-php"}]},"x-tagGroups":[{"name":"🤖 Assistant & Automations","tags":["Automations"]},{"name":"💳 Core Payments","tags":["Payment Intents","Setup Intents","Charges","Payments","Refunds","Voids"]},{"name":"🔗 Checkout","tags":["Payment Links","Checkout Sessions"]},{"name":"📋 Billing & Subscriptions","tags":["Invoices","Credit Notes","Subscriptions","Subscription Schedules","Orders","Billing"]},{"name":"📊 Usage Billing","tags":["Meters","Usage Events","Usage"]},{"name":"📦 Products & Pricing","tags":["Products","Prices","Discounts","Tax Rates"]},{"name":"👥 Customers & Vault","tags":["Customers","Entitlements","Payment Methods"]},{"name":"💰 Money Movement","tags":["Transactions","Disputes","Payouts"]},{"name":"🔔 Webhooks & Events","tags":["Events","Webhook Endpoints"]},{"name":"🖥️ Terminal / Card Present","tags":["Terminal Payments","Terminal Devices"]},{"name":"📈 Analytics & Finance","tags":["Analytics","Finance"]},{"name":"📥 Data Management","tags":["Imports","Exports"]},{"name":"🔧 Developer Tools","tags":["Payment Attempts","External Sync","Integrations","Sync State"]}],"x-scalar-environments":[{"name":"🧪 Staging (Test Mode)","color":"#3B82F6","description":"Use rk_sandbox_* keys. No real charges.","variables":{"baseUrl":"https://staging-api.revkeen.com/v2","apiKeyPrefix":"rk_sandbox_"}},{"name":"🟢 Production (Live Mode)","color":"#10B981","description":"Use rk_live_* keys. Real transactions.","variables":{"baseUrl":"https://api.revkeen.com/v2","apiKeyPrefix":"rk_live_"}},{"name":"🤖 Mock Server (State Machine)","color":"#8B5CF6","description":"Hosted Scalar mock server for schema validation. No API key required.","variables":{"baseUrl":"https://mock-api.revkeen.com/v2","apiKeyPrefix":"mock_"}}],"servers":[{"url":"https://api.revkeen.com/v2","description":"Production"},{"url":"https://staging-api.revkeen.com/v2","description":"Staging"},{"url":"https://mock-api.revkeen.com/v2","description":"Mock"}],"security":[{"apiKey":[]},{"oauth2":[]}],"webhooks":{},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your RevKeen API key (powered by Unkey). Get it from [Dashboard > Settings > API Keys](https://app.revkeen.com/settings/api-keys). Use `rk_sandbox_*` for test mode and `rk_live_*` for production."},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Session token (internal dashboard use only)"},"oauth2":{"type":"oauth2","description":"OAuth 2.1 with PKCE for MCP clients and third-party integrations","flows":{"authorizationCode":{"authorizationUrl":"https://app.revkeen.com/api/auth/oauth2/authorize","tokenUrl":"https://api.revkeen.com/api/auth/oauth2/token","refreshUrl":"https://api.revkeen.com/api/auth/oauth2/token","scopes":{"checkout:read":"View checkout session details","checkout:write":"Create and manage checkout sessions","payment_links:read":"View payment links","payment_links:write":"Create and manage payment links","charges:read":"View one-time charges","charges:write":"Create one-time charges for customers","payments:read":"View payment details","payments:write":"Capture or void payments","payment_intents:read":"View payment intent details","payment_intents:write":"Create, confirm, capture, and cancel payment intents","setup_intents:read":"View setup intent details","setup_intents:write":"Create, confirm, and cancel setup intents","payment_methods:read":"View saved payment methods","payment_methods:write":"Attach and detach payment methods","invoices:read":"View invoices","invoices:write":"Create, update, and manage invoices","subscriptions:read":"View subscriptions","subscriptions:write":"Create, update, pause, and cancel subscriptions","subscription_schedules:read":"View subscription schedule details","subscription_schedules:write":"Create, update, cancel, and release subscription schedules","orders:read":"View orders","orders:write":"Create and manage orders","credit_notes:read":"View credit notes","credit_notes:write":"Create and void credit notes","products:read":"View product catalog","products:write":"Create and update products","prices:read":"View pricing information","prices:write":"Create and update prices","discounts:read":"View discount codes","discounts:write":"Create and manage discount codes","tax_rates:read":"View tax rate configurations","tax_rates:write":"Configure tax rates","meters:read":"View meter configurations","meters:write":"Create and update meters","usage:read":"View usage events and balances","usage:write":"Ingest usage events","customers:read":"View customer information","customers:write":"Create and update customers","businesses:read":"View business entities","businesses:write":"Manage business entities","refunds:read":"View refund details","refunds:write":"Issue refunds","voids:read":"View voided transactions","voids:write":"Void unsettled transactions","disputes:read":"View chargebacks and disputes","disputes:write":"Respond to disputes","payouts:read":"View payout and settlement data","terminal:read":"View terminal devices and card-present payments","terminal:write":"Initiate, cancel, refund, and void terminal payments","exports:read":"View and download data exports","exports:write":"Create data exports","imports:read":"View import status and history","imports:write":"Upload and run data imports","analytics:read":"View analytics and reports","finance:read":"View financial reports","comms:read":"View SMS and email delivery logs","comms:write":"Send SMS, email, and WhatsApp messages","automations:read":"View automations, runs, approvals, and traces","automations:write":"Create automations and trigger runs","apps:read":"View connected applications","apps:write":"Manage app connections","webhooks:read":"View webhook endpoints","webhooks:write":"Manage webhook endpoints","integrations:read":"View integration status and sync logs","integrations:write":"Activate, configure, and sync integrations","events:read":"View webhook event logs","events:write":"Resend and test webhook events","sync:read":"View sync watermarks and state","sync:write":"Update sync watermarks"}},"clientCredentials":{"tokenUrl":"https://api.revkeen.com/api/auth/oauth2/token","scopes":{"checkout:read":"View checkout session details","checkout:write":"Create and manage checkout sessions","payment_links:read":"View payment links","payment_links:write":"Create and manage payment links","charges:read":"View one-time charges","charges:write":"Create one-time charges for customers","payments:read":"View payment details","payments:write":"Capture or void payments","payment_intents:read":"View payment intent details","payment_intents:write":"Create, confirm, capture, and cancel payment intents","setup_intents:read":"View setup intent details","setup_intents:write":"Create, confirm, and cancel setup intents","payment_methods:read":"View saved payment methods","payment_methods:write":"Attach and detach payment methods","invoices:read":"View invoices","invoices:write":"Create, update, and manage invoices","subscriptions:read":"View subscriptions","subscriptions:write":"Create, update, pause, and cancel subscriptions","subscription_schedules:read":"View subscription schedule details","subscription_schedules:write":"Create, update, cancel, and release subscription schedules","orders:read":"View orders","orders:write":"Create and manage orders","credit_notes:read":"View credit notes","credit_notes:write":"Create and void credit notes","products:read":"View product catalog","products:write":"Create and update products","prices:read":"View pricing information","prices:write":"Create and update prices","discounts:read":"View discount codes","discounts:write":"Create and manage discount codes","tax_rates:read":"View tax rate configurations","tax_rates:write":"Configure tax rates","meters:read":"View meter configurations","meters:write":"Create and update meters","usage:read":"View usage events and balances","usage:write":"Ingest usage events","customers:read":"View customer information","customers:write":"Create and update customers","businesses:read":"View business entities","businesses:write":"Manage business entities","refunds:read":"View refund details","refunds:write":"Issue refunds","voids:read":"View voided transactions","voids:write":"Void unsettled transactions","disputes:read":"View chargebacks and disputes","disputes:write":"Respond to disputes","payouts:read":"View payout and settlement data","terminal:read":"View terminal devices and card-present payments","terminal:write":"Initiate, cancel, refund, and void terminal payments","exports:read":"View and download data exports","exports:write":"Create data exports","imports:read":"View import status and history","imports:write":"Upload and run data imports","analytics:read":"View analytics and reports","finance:read":"View financial reports","comms:read":"View SMS and email delivery logs","comms:write":"Send SMS, email, and WhatsApp messages","automations:read":"View automations, runs, approvals, and traces","automations:write":"Create automations and trigger runs","apps:read":"View connected applications","apps:write":"Manage app connections","webhooks:read":"View webhook endpoints","webhooks:write":"Manage webhook endpoints","integrations:read":"View integration status and sync logs","integrations:write":"Activate, configure, and sync integrations","events:read":"View webhook event logs","events:write":"Resend and test webhook events","sync:read":"View sync watermarks and state","sync:write":"Update sync watermarks"}}}}},"schemas":{"WebhookEvent":{"type":"object","description":"The envelope for all webhook event deliveries. Contains the event type, timestamp, and the affected object in the data field.","required":["id","type","created","data"],"properties":{"id":{"type":"string","description":"Unique event identifier","example":"evt_1a2b3c4d5e6f"},"type":{"type":"string","description":"Event type using dot notation (e.g., `payment.succeeded`)","example":"payment.succeeded"},"created":{"type":"integer","description":"Unix timestamp when the event was created","example":1705689600},"livemode":{"type":"boolean","description":"Whether this event occurred in live mode","example":true},"data":{"type":"object","description":"Event payload containing the affected object","properties":{"object":{"type":"object","description":"The object that triggered the event (e.g., Payment, Invoice, Subscription)"},"previous_attributes":{"type":"object","description":"Previous values of attributes that changed (for update events)"}}}}},"SubscriptionTerms":{"type":"object","properties":{"collection_method":{"type":"string","enum":["charge_automatically","send_invoice"],"description":"How to collect payment for recurring invoices","example":"charge_automatically"},"start_mode":{"type":"string","enum":["when_paid","on_invoice_date","first_of_next_month","specific_date"],"description":"When the subscription billing cycle starts","example":"when_paid"},"start_date":{"type":"string","description":"Start date (ISO 8601) — required when start_mode is 'specific_date'"},"duration_type":{"type":"string","enum":["until_cancelled","fixed_cycles","end_date"],"description":"How the subscription duration is determined","example":"until_cancelled"},"duration_count":{"type":"integer","minimum":1,"description":"Number of billing cycles — required when duration_type is 'fixed_cycles'","example":12},"end_date":{"type":"string","description":"End date (ISO 8601) — required when duration_type is 'end_date'"},"first_payment_behavior":{"type":"string","enum":["charge_first_cycle_now","defer_first_cycle_to_start_date"],"description":"Whether to charge the first cycle immediately or defer to the start date","example":"charge_first_cycle_now"}},"required":["collection_method","start_mode","duration_type","first_payment_behavior"],"description":"Subscription billing terms for recurring invoices"},"InvoiceListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"A list of invoices matching the query filters."},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique invoice identifier"},"customer_uuid":{"type":"string","format":"uuid","description":"ID of the customer this invoice belongs to"},"invoice_number":{"type":"string","description":"Merchant-assigned invoice number for reference"},"total_minor":{"type":"integer","description":"Total amount in minor units (cents)"},"currency":{"type":"string","description":"Three-letter ISO 4217 currency code"},"allowed_methods":{"type":["array","null"],"items":{"type":"string"},"description":"Allowed payment methods for checkout sessions against this invoice"},"status":{"type":"string","description":"Invoice lifecycle status: draft, open, finalized, paid, void, or uncollectible"},"due_date":{"type":["string","null"],"description":"Payment due date in ISO 8601 format"},"custom_fields":{"type":"object","additionalProperties":true,"description":"Key-value pairs for custom fields"},"external_source":{"type":["string","null"],"description":"External integration source (e.g., practicehub, wodify)","example":"practicehub"},"external_type":{"type":["string","null"],"description":"Type within external system (e.g., appointment, membership)","example":"appointment"},"external_id":{"type":["string","null"],"description":"ID from external system","example":"INV-12345"},"subscription_terms":{"type":["object","null"],"properties":{"collection_method":{"type":"string","enum":["charge_automatically","send_invoice"],"description":"How to collect payment for recurring invoices","example":"charge_automatically"},"start_mode":{"type":"string","enum":["when_paid","on_invoice_date","first_of_next_month","specific_date"],"description":"When the subscription billing cycle starts","example":"when_paid"},"start_date":{"type":"string","description":"Start date (ISO 8601) — required when start_mode is 'specific_date'"},"duration_type":{"type":"string","enum":["until_cancelled","fixed_cycles","end_date"],"description":"How the subscription duration is determined","example":"until_cancelled"},"duration_count":{"type":"integer","minimum":1,"description":"Number of billing cycles — required when duration_type is 'fixed_cycles'","example":12},"end_date":{"type":"string","description":"End date (ISO 8601) — required when duration_type is 'end_date'"},"first_payment_behavior":{"type":"string","enum":["charge_first_cycle_now","defer_first_cycle_to_start_date"],"description":"Whether to charge the first cycle immediately or defer to the start date","example":"charge_first_cycle_now"}},"required":["collection_method","start_mode","duration_type","first_payment_behavior"],"description":"Subscription billing terms for recurring invoices"},"created_at":{"type":"string","description":"When the invoice was created (ISO 8601)"},"updated_at":{"type":"string","description":"When the invoice was last updated (ISO 8601)"}},"required":["id","customer_uuid","total_minor","currency","status","created_at","updated_at"],"description":"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."},"InvoiceResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Invoice"},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"A single invoice object with request tracking metadata."},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"description":"Generic success confirmation for operations that do not return a resource."},"InvoiceCommentListDetailResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceCommentDetail"}},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"A list of invoice comments with extended author details."},"InvoiceCommentDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"invoiceId":{"type":"string","format":"uuid"},"userId":{"type":["string","null"]},"content":{"type":"string"},"isInternal":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":["string","null"]}},"required":["id","invoiceId","userId","content","isInternal","createdAt","updatedAt"],"description":"An invoice comment with extended author details including name, email, and avatar."},"InvoiceCommentDetailResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceCommentDetail"},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"A single invoice comment with extended author details."},"ExternalUpsertResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Invoice"},"created":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"requestId":{"type":"string"}},"required":["data","created","requestId"],"description":"Response from an external system upsert, indicating whether the invoice was created or updated along with any warnings."},"StaleUpdateResponse":{"type":"object","properties":{"ignored":{"type":"boolean","enum":[true]},"reason":{"type":"string","enum":["stale_update"]},"stored_timestamp":{"type":"string"},"incoming_timestamp":{"type":"string"},"requestId":{"type":"string"}},"required":["ignored","reason","stored_timestamp","incoming_timestamp","requestId"],"description":"Returned when an external upsert is skipped because the incoming timestamp is older than the stored version."},"CreditEligibilityResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"can_credit":{"type":"boolean","description":"Whether a credit note can be issued for this invoice"},"max_creditable_minor":{"type":"integer","description":"Maximum amount that can be credited in minor units"},"total_credited_minor":{"type":"integer","description":"Total amount already credited against this invoice"},"invoice_total_minor":{"type":"integer","description":"Original invoice total in minor units"},"reason":{"type":"string","description":"Reason why the invoice cannot be credited, if applicable"}},"required":["can_credit","max_creditable_minor","total_credited_minor","invoice_total_minor"]},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"Shows whether an invoice is eligible for a credit note and the maximum amount that can be credited."},"CreditNoteListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CreditNote"}},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"A list of credit notes matching the query filters."},"CreditNote":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique credit note identifier"},"credit_note_number":{"type":["string","null"],"description":"Sequential credit note number for accounting reference"},"invoice_id":{"type":"string","format":"uuid","description":"ID of the invoice this credit note applies to"},"customer_id":{"type":["string","null"],"format":"uuid","description":"ID of the customer who received the credit"},"amount_minor":{"type":"integer","description":"Credit amount in minor units (cents)"},"tax_amount_minor":{"type":["integer","null"],"description":"Tax portion of the credit in minor units"},"currency":{"type":"string","description":"Three-letter ISO 4217 currency code"},"status":{"type":"string","description":"Credit note status: draft, issued, or void"},"reason":{"type":["string","null"],"description":"Human-readable reason for the credit"},"reason_code":{"type":["string","null"],"description":"Machine-readable reason code (e.g., billing_error, customer_request)"},"credit_method":{"type":["string","null"],"description":"How the credit is applied: refund_to_payment_method, customer_balance, or external"},"pdf_url":{"type":["string","null"],"description":"URL to the credit note PDF document"},"issued_at":{"type":["string","null"],"description":"When the credit note was issued (ISO 8601)"},"created_at":{"type":"string","description":"When the credit note was created (ISO 8601)"},"updated_at":{"type":"string","description":"When the credit note was last updated (ISO 8601)"}},"required":["id","credit_note_number","invoice_id","customer_id","amount_minor","tax_amount_minor","currency","status","reason","reason_code","credit_method","pdf_url","issued_at","created_at","updated_at"],"description":"A formal accounting document that reduces the amount owed on a paid or partially paid invoice, used for refunds, billing corrections, and prorated cancellations."},"CreditNoteResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditNote"},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"A single credit note with request tracking metadata."},"ValidationError":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error"]},"code":{"type":"string","enum":["validation_error"]},"message":{"type":"string"},"param":{"type":"string"},"details":{"type":"object","properties":{"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Field-specific validation errors"}}},"request_id":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Returned when request parameters or body fail schema validation. The details.fields object maps each invalid parameter to its validation errors."},"AuthenticationError":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["authentication_error"]},"code":{"type":"string","enum":["authentication_failed","invalid_api_key","expired_api_key"]},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Returned when the API key is missing, invalid, or expired. Verify your x-api-key header contains a valid key."},"ForbiddenError":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["authentication_error"]},"code":{"type":"string","enum":["insufficient_permissions","forbidden"]},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Returned when the authenticated API key lacks the required scopes for the requested operation."},"NotFoundError":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error"]},"code":{"type":"string","enum":["resource_not_found"]},"message":{"type":"string"},"param":{"type":"string"},"request_id":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Returned when the requested resource does not exist or does not belong to this merchant."},"ProductListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"],"description":"A paginated list of products matching the query filters."},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier (UUID)"},"object":{"type":"string","enum":["product"],"description":"Object type"},"product_id":{"type":"string","description":"User-facing product identifier"},"name":{"type":"string","description":"Product display name"},"description":{"type":["string","null"],"description":"Product description"},"kind":{"type":"string","enum":["subscription","one_time","usage"],"description":"Product kind"},"pricing_model":{"type":"string","enum":["one_time","recurring","usage"],"description":"How the product is priced"},"amount_minor":{"type":["integer","null"],"description":"Price in minor units (cents/pence)"},"currency":{"type":"string","description":"Three-letter ISO currency code"},"interval":{"type":["string","null"],"description":"Billing interval (day, week, month, year)"},"interval_count":{"type":["integer","null"],"description":"Number of intervals between billings"},"trial_days":{"type":"integer","description":"Free trial period in days"},"fulfillment_type":{"type":"string","enum":["none","digital","physical"],"description":"Fulfillment type"},"billing_anchor_rule":{"type":["string","null"],"enum":["same_day","day_of_month","last_day",null],"description":"Billing date calculation rule"},"billing_anchor_day":{"type":["integer","null"],"description":"Day of month for billing (1-31)"},"first_charge_behavior":{"type":["string","null"],"enum":["immediate","next_anchor","prorate",null],"description":"First payment timing"},"end_behavior":{"type":["string","null"],"enum":["until_canceled","fixed_payments",null],"description":"Subscription end behavior"},"max_payments":{"type":["integer","null"],"description":"Max billing cycles for fixed-payment subscriptions"},"usage_meter_id":{"type":["string","null"],"description":"Associated usage meter ID"},"slug":{"type":["string","null"],"description":"URL-friendly slug"},"is_active":{"type":"boolean","description":"Whether the product is active"},"is_archived":{"type":"boolean","description":"Whether the product is archived"},"image_url":{"type":["string","null"],"description":"Product image URL"},"tax_behavior":{"type":["string","null"],"description":"Tax behavior (exclusive, inclusive, location)"},"tax_code":{"type":["string","null"],"description":"Tax code for tax calculation"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp (ISO 8601)"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp (ISO 8601)"}},"required":["id","object","product_id","name","kind","pricing_model","amount_minor","currency","trial_days","fulfillment_type","is_active","is_archived","created_at","updated_at"],"description":"A product defines what you sell — the name, billing type, price, and fulfillment method. Products can be one-time, recurring (subscription), or usage-based."},"Pagination":{"type":"object","properties":{"kind":{"type":"string","description":"Pagination type","example":"offset"},"page":{"type":"integer","description":"Current page number"},"limit":{"type":"integer","description":"Results per page"},"total":{"type":"integer","description":"Total matching results"},"totalPages":{"type":"integer","description":"Total pages available"}},"required":["kind","page","limit","total","totalPages"]},"ProductErrorResponse":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"description":"Error response returned when a product operation fails."},"ProductRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Product"}},"required":["data"],"description":"A single product object with full details and associated prices."},"ProductCreateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Product"}},"required":["data"],"description":"The newly created product object."},"CreateProductRequest":{"type":"object","properties":{"product_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["subscription","one_time","usage"]},"pricing_model":{"type":"string","enum":["one_time","recurring","usage"]},"amount_minor":{"type":"integer","minimum":0},"currency":{"type":"string","default":"USD"},"interval":{"type":["string","null"]},"interval_count":{"type":["integer","null"]},"trial_days":{"type":"integer","minimum":0},"usage_meter_id":{"type":["string","null"]},"slug":{"type":"string"},"fulfillment_type":{"type":"string","enum":["none","digital","physical"],"default":"none","description":"Fulfillment type for the product. Defaults to 'none' (service)."},"billing_anchor_rule":{"type":"string","enum":["same_day","day_of_month","last_day"],"description":"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_day":{"type":["integer","null"],"minimum":1,"maximum":31,"description":"Day of month (1-31) when billing_anchor_rule is 'day_of_month'"},"first_charge_behavior":{"type":"string","enum":["immediate","next_anchor","prorate"],"description":"When first payment is collected. immediate: Charge on start. next_anchor: Charge on first scheduled date. prorate: Prorate until first date."},"end_behavior":{"type":"string","enum":["until_canceled","fixed_payments"],"description":"How subscription ends. until_canceled: Runs forever. fixed_payments: Ends after N billing cycles."},"max_payments":{"type":["integer","null"],"minimum":1,"maximum":999,"description":"Max billing cycles when end_behavior is 'fixed_payments'"},"metadata":{"type":"object","additionalProperties":{},"description":"Arbitrary key-value metadata for the product"}},"required":["product_id","name","kind","pricing_model","amount_minor"],"description":"Parameters for creating a new product, including name, billing type, and pricing."},"ProductUpdateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Product"}},"required":["data"],"description":"The updated product object reflecting the changes."},"UpdateProductRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"amount_minor":{"type":"integer","minimum":0},"currency":{"type":"string"},"interval":{"type":["string","null"]},"interval_count":{"type":["integer","null"]},"trial_days":{"type":"integer","minimum":0},"is_active":{"type":"boolean"},"is_archived":{"type":"boolean"},"fulfillment_type":{"type":"string","enum":["none","digital","physical"],"description":"Fulfillment type for the product."},"billing_anchor_rule":{"type":"string","enum":["same_day","day_of_month","last_day"],"description":"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_day":{"type":["integer","null"],"minimum":1,"maximum":31},"first_charge_behavior":{"type":"string","enum":["immediate","next_anchor","prorate"],"description":"When first payment is collected. immediate: Charge on start. next_anchor: Charge on first scheduled date. prorate: Prorate until first date."},"end_behavior":{"type":"string","enum":["until_canceled","fixed_payments"],"description":"How subscription ends. until_canceled: Runs forever. fixed_payments: Ends after N billing cycles."},"max_payments":{"type":["integer","null"],"minimum":1,"maximum":999},"metadata":{"type":"object","additionalProperties":{},"description":"Arbitrary key-value metadata for the product"}},"description":"Parameters for updating an existing product. Only the provided fields are changed."},"CheckoutSessionCreateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"publicToken":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"customerId":{"type":"string"},"expiresAt":{"type":"string"},"allowedMethods":{"type":"array","items":{"type":"string"},"example":["card","in_store"]},"selectedMethod":{"type":["string","null"],"example":null}},"required":["id","url","publicToken","currency","expiresAt"]},"requestId":{"type":"string"}},"required":["data","requestId"],"description":"The created checkout session with the URL to redirect the customer to."},"CheckoutSessionErrorResponse":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"description":"Error response returned when a checkout session cannot be created."},"CreateCheckoutSessionInput":{"type":"object","properties":{"invoiceId":{"type":"string","format":"uuid","example":"inv_123"},"productId":{"type":"string","format":"uuid","example":"prod_123"},"amountMinor":{"type":"integer","exclusiveMinimum":0,"example":1000},"currency":{"type":"string","default":"USD","example":"USD"},"successUrl":{"type":"string","format":"uri","example":"https://example.com/success"},"cancelUrl":{"type":"string","format":"uri","example":"https://example.com/cancel"},"allowedMethods":{"type":"array","items":{"type":"string","enum":["card","in_store"]},"example":["card","in_store"],"description":"Payment methods to offer. Intersected with merchant capabilities. Defaults to merchant config."},"companionDeviceId":{"type":"string","format":"uuid","description":"Target a registered companion device. Session is pushed via SSE to the device."}},"description":"Parameters for creating a hosted checkout session. Customers are redirected to complete payment on a RevKeen-hosted page."},"CheckoutSessionRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CheckoutSession"},"requestId":{"type":"string"}},"required":["data","requestId"]},"CheckoutSession":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","enum":["checkout_session"]},"status":{"type":"string"},"mode":{"type":["string","null"]},"amount_total":{"type":["number","null"]},"currency":{"type":["string","null"]},"customer_id":{"type":["string","null"],"format":"uuid"},"payment_intent_id":{"type":["string","null"],"format":"uuid"},"invoice_id":{"type":["string","null"],"format":"uuid"},"subscription_id":{"type":["string","null"],"format":"uuid"},"url":{"type":["string","null"]},"success_url":{"type":["string","null"]},"cancel_url":{"type":["string","null"]},"expires_at":{"type":["string","null"]},"created_at":{"type":["string","null"]},"allowed_methods":{"type":"array","items":{"type":"string"},"example":["card","in_store"]},"selected_method":{"type":["string","null"],"example":null}},"required":["id","object","status","mode","amount_total","currency","customer_id","payment_intent_id","invoice_id","subscription_id","url","success_url","cancel_url","expires_at","created_at","allowed_methods","selected_method"],"description":"A checkout session represents a customer's intent to pay."},"CheckoutSessionExpireResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["expired"]},"expiredAt":{"type":"string"}},"required":["id","status","expiredAt"]},"requestId":{"type":"string"}},"required":["data","requestId"]},"Business":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier (UUID)"},"object":{"type":"string","enum":["business"],"description":"Object type"},"customer_id":{"type":["string","null"],"format":"uuid","description":"Associated customer ID"},"name":{"type":"string","description":"Business name"},"company_number":{"type":["string","null"],"description":"Company registration number"},"tax_identifier":{"type":["string","null"],"description":"Tax ID (VAT, EIN, etc.)"},"billing_email":{"type":["string","null"],"description":"Billing email address"},"billing_phone":{"type":["string","null"],"description":"Billing phone number"},"billing_address_line1":{"type":["string","null"],"description":"Billing address line 1"},"billing_address_line2":{"type":["string","null"],"description":"Billing address line 2"},"billing_city":{"type":["string","null"],"description":"Billing city"},"billing_postcode":{"type":["string","null"],"description":"Billing postcode/ZIP"},"billing_country":{"type":["string","null"],"description":"Billing country (ISO 3166-1 alpha-2)"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp (ISO 8601)"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp (ISO 8601)"}},"required":["id","object","name","created_at","updated_at"],"description":"A business entity (company) associated with a customer for B2B billing."},"CustomerInvoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"invoice_number":{"type":["string","null"]},"status":{"type":"string"},"total_minor":{"type":"integer"},"currency":{"type":"string"},"due_date":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","customer_id","invoice_number","status","total_minor","currency","due_date","created_at","updated_at"],"description":"An invoice belonging to a specific customer, with summarized billing details."},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"],"description":"Standard error response for customer sub-resource operations."},"CustomerSubscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid"},"price_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string"},"current_period_start":{"type":["string","null"]},"current_period_end":{"type":["string","null"]},"cancel_at_period_end":{"type":"boolean"},"canceled_at":{"type":["string","null"]},"trial_end":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","customer_id","price_id","status","current_period_start","current_period_end","cancel_at_period_end","canceled_at","trial_end","created_at","updated_at"],"description":"A subscription belonging to a specific customer, with plan and status details."},"CustomerOrder":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"public_id":{"type":"string"},"customer_id":{"type":"string","format":"uuid"},"status":{"type":"string"},"total_minor":{"type":"integer"},"currency":{"type":"string"},"fulfilled_at":{"type":["string","null"]},"canceled_at":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","public_id","customer_id","status","total_minor","currency","fulfilled_at","canceled_at","created_at","updated_at"],"description":"An order belonging to a specific customer, with line items and fulfillment status."},"CustomerPayment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customer_id":{"type":["string","null"],"format":"uuid"},"amount_minor":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string"},"payment_method_type":{"type":["string","null"]},"gateway_transaction_id":{"type":["string","null"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","customer_id","amount_minor","currency","status","payment_method_type","gateway_transaction_id","created_at","updated_at"],"description":"A payment transaction belonging to a specific customer, with amount, status, and gateway details."},"CustomerCreateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique customer identifier"},"merchantId":{"type":"string","format":"uuid","description":"ID of the merchant this customer belongs to"},"merchantRefId":{"type":"string","description":"Merchant-assigned reference ID for external system mapping"},"email":{"type":"string","format":"email","description":"Customer's email address"},"name":{"type":"string","description":"Customer's full name"},"phone":{"type":"string","description":"Customer's phone number"},"authUserId":{"type":"string","format":"uuid","description":"Linked Better Auth user ID for portal access"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata attached to this customer"},"customFields":{"type":"object","additionalProperties":true,"description":"Merchant-defined custom fields displayed as columns in the dashboard"},"createdAt":{"type":"string","format":"date-time","description":"When the customer was created (ISO 8601)"},"updatedAt":{"type":"string","format":"date-time","description":"When the customer was last updated (ISO 8601)"}},"required":["id","merchantId","email","createdAt","updatedAt"]}},"required":["data"],"description":"The newly created customer object."},"CustomerListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique customer identifier"},"merchantId":{"type":"string","format":"uuid","description":"ID of the merchant this customer belongs to"},"merchantRefId":{"type":"string","description":"Merchant-assigned reference ID for external system mapping"},"email":{"type":"string","format":"email","description":"Customer's email address"},"name":{"type":"string","description":"Customer's full name"},"phone":{"type":"string","description":"Customer's phone number"},"authUserId":{"type":"string","format":"uuid","description":"Linked Better Auth user ID for portal access"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata attached to this customer"},"customFields":{"type":"object","additionalProperties":true,"description":"Merchant-defined custom fields displayed as columns in the dashboard"},"createdAt":{"type":"string","format":"date-time","description":"When the customer was created (ISO 8601)"},"updatedAt":{"type":"string","format":"date-time","description":"When the customer was last updated (ISO 8601)"}},"required":["id","merchantId","email","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["limit","offset"]}},"required":["data","pagination"],"description":"A paginated list of customers matching the query filters."},"CustomerRetrieveResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique customer identifier"},"merchantId":{"type":"string","format":"uuid","description":"ID of the merchant this customer belongs to"},"merchantRefId":{"type":"string","description":"Merchant-assigned reference ID for external system mapping"},"email":{"type":"string","format":"email","description":"Customer's email address"},"name":{"type":"string","description":"Customer's full name"},"phone":{"type":"string","description":"Customer's phone number"},"authUserId":{"type":"string","format":"uuid","description":"Linked Better Auth user ID for portal access"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata attached to this customer"},"customFields":{"type":"object","additionalProperties":true,"description":"Merchant-defined custom fields displayed as columns in the dashboard"},"createdAt":{"type":"string","format":"date-time","description":"When the customer was created (ISO 8601)"},"updatedAt":{"type":"string","format":"date-time","description":"When the customer was last updated (ISO 8601)"}},"required":["id","merchantId","email","createdAt","updatedAt"]}},"required":["data"],"description":"A single customer object with full details."},"CustomerUpdateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique customer identifier"},"merchantId":{"type":"string","format":"uuid","description":"ID of the merchant this customer belongs to"},"merchantRefId":{"type":"string","description":"Merchant-assigned reference ID for external system mapping"},"email":{"type":"string","format":"email","description":"Customer's email address"},"name":{"type":"string","description":"Customer's full name"},"phone":{"type":"string","description":"Customer's phone number"},"authUserId":{"type":"string","format":"uuid","description":"Linked Better Auth user ID for portal access"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata attached to this customer"},"customFields":{"type":"object","additionalProperties":true,"description":"Merchant-defined custom fields displayed as columns in the dashboard"},"createdAt":{"type":"string","format":"date-time","description":"When the customer was created (ISO 8601)"},"updatedAt":{"type":"string","format":"date-time","description":"When the customer was last updated (ISO 8601)"}},"required":["id","merchantId","email","createdAt","updatedAt"]}},"required":["data"],"description":"The updated customer object reflecting the changes."},"CustomerPaymentMethodsListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}}},"required":["data"],"description":"A list of payment methods attached to a customer."},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the payment method","example":"550e8400-e29b-41d4-a716-446655440000"},"object":{"type":"string","enum":["payment_method"],"description":"Object type, always 'payment_method'"},"public_id":{"type":["string","null"],"description":"Public ID visible in API responses (pm_xxx format)","example":"pm_1a2b3c4d5e6f"},"type":{"type":"string","enum":["card","bank_account","us_bank_account"],"description":"The type of payment method","example":"card"},"status":{"type":"string","enum":["active","inactive","expired"],"description":"The status of the payment method","example":"active"},"customer_id":{"type":"string","format":"uuid","description":"ID of the customer this payment method belongs to"},"is_default":{"type":"boolean","description":"Whether this is the customer's default payment method"},"card":{"$ref":"#/components/schemas/CardDetails"},"us_bank_account":{"$ref":"#/components/schemas/BankAccountDetails"},"billing_details":{"$ref":"#/components/schemas/BillingDetails"},"metadata":{"type":"object","additionalProperties":{},"description":"Custom metadata attached to the payment method"},"created_at":{"type":"string","format":"date-time","description":"When the payment method was created"},"updated_at":{"type":"string","format":"date-time","description":"When the payment method was last updated"}},"required":["id","object","public_id","type","status","customer_id","is_default","card","us_bank_account","billing_details","metadata","created_at","updated_at"],"description":"A saved payment instrument (card, bank account, etc.) attached to a customer for future charges."},"CardDetails":{"type":["object","null"],"properties":{"brand":{"type":["string","null"],"enum":["visa","mastercard","amex","discover","diners","jcb","unionpay","unknown",null],"description":"The card brand","example":"visa"},"last4":{"type":["string","null"],"minLength":4,"maxLength":4,"description":"The last 4 digits of the card number","example":"4242"},"exp_month":{"type":["integer","null"],"minimum":1,"maximum":12,"description":"Expiration month (1-12)","example":12},"exp_year":{"type":["integer","null"],"description":"Expiration year","example":2028},"funding":{"type":["string","null"],"enum":["credit","debit","prepaid","unknown",null],"description":"The card funding type","example":"credit"}},"required":["brand","last4","exp_month","exp_year","funding"],"description":"Card details (if type is 'card')"},"BankAccountDetails":{"type":["object","null"],"properties":{"bank_name":{"type":["string","null"],"description":"The name of the bank","example":"Chase"},"last4":{"type":["string","null"],"minLength":4,"maxLength":4,"description":"The last 4 digits of the account number","example":"6789"},"routing_number_last4":{"type":["string","null"],"minLength":4,"maxLength":4,"description":"The last 4 digits of the routing number","example":"1234"},"account_type":{"type":["string","null"],"enum":["checking","savings",null],"description":"The type of bank account","example":"checking"}},"required":["bank_name","last4","routing_number_last4","account_type"],"description":"Bank account details (if type is 'us_bank_account')"},"BillingDetails":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"description":"Full name on the payment method"},"email":{"type":["string","null"],"format":"email","description":"Email address"},"phone":{"type":["string","null"],"description":"Phone number"},"address":{"type":["object","null"],"properties":{"line1":{"type":["string","null"]},"line2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"postal_code":{"type":["string","null"]},"country":{"type":["string","null"]}},"required":["line1","line2","city","state","postal_code","country"],"description":"Billing address"}},"required":["name","email","phone","address"],"description":"Billing details associated with the payment method"},"CustomerPortalSessionCreateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","customerId","merchantId","url","expiresAt","createdAt"]}},"required":["data"],"description":"A portal session URL that redirects the customer to their self-service billing portal."},"SubscriptionCreateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"required":["data"],"description":"The newly created subscription with billing schedule and initial invoice details."},"SubscriptionListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"}},"required":["page","limit","total","totalPages"]}},"required":["data","pagination"],"description":"A paginated list of subscriptions matching the query filters."},"SubscriptionRetrieveResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"required":["data"],"description":"A single subscription object with full plan, billing, and status details."},"SubscriptionUpdateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"required":["data"],"description":"The updated subscription reflecting the changes to metadata or billing parameters."},"SubscriptionChangePlanResponse":{"type":"object","properties":{"subscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]},"proration":{"type":"object","description":"Proration details"},"previousPlanId":{"type":"string"},"invoiceCreated":{"type":"boolean"}},"required":["subscription","invoiceCreated"],"description":"The subscription after a plan change, with proration details and updated billing schedule."},"SubscriptionChangeQuantityResponse":{"type":"object","properties":{"subscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]},"proration":{"type":"object","description":"Proration details"},"previousQuantity":{"type":"number"},"invoiceCreated":{"type":"boolean"}},"required":["subscription","invoiceCreated"],"description":"The subscription after a quantity change, with proration details if applicable."},"SubscriptionCancelResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"description":"The subscription after cancellation, showing the effective end date and final billing period."},"SubscriptionPreviewRenewalResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"subscriptionId":{"type":"string","format":"uuid"},"currentPeriodEnd":{"type":"string","format":"date-time"},"upcomingRenewals":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"integer","minimum":1},"date":{"type":"string","format":"date-time"},"formattedDate":{"type":"string"},"dayName":{"type":"string"},"amountMinor":{"type":"integer"},"formattedAmount":{"type":"string"},"isTrialEnd":{"type":"boolean"},"isFirstCharge":{"type":"boolean"},"isFinalPayment":{"type":"boolean"}},"required":["sequence","date","formattedDate","dayName","amountMinor","formattedAmount"]}},"nextInvoiceAmountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["subscriptionId","currentPeriodEnd","upcomingRenewals","nextInvoiceAmountMinor","currency"]}},"required":["data"],"description":"A preview of the next renewal charge, including line items, amounts, and billing date."},"SubscriptionPauseResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"required":["data"],"description":"The subscription after being paused, showing the pause effective date and planned resume date."},"PauseSubscriptionInput":{"type":"object","properties":{"behavior":{"type":"string","enum":["keep_as_draft","mark_uncollectible","void"],"default":"keep_as_draft","description":"How to handle invoices during the pause period","example":"keep_as_draft"},"resumes_at":{"type":"string","format":"date-time","description":"ISO 8601 date when the subscription should automatically resume. If not provided, subscription stays paused until manually resumed.","example":"2024-02-15T00:00:00Z"}},"description":"Parameters for pausing an active subscription. Specify when billing should resume."},"SubscriptionResumeResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"required":["data"],"description":"The subscription after being resumed from a paused state, with the next billing date."},"SubscriptionCancelSubscriptionResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"required":["data"],"description":"The subscription after being canceled with the specified cancellation parameters."},"CancelSubscriptionInput":{"type":"object","properties":{"mode":{"type":"string","enum":["immediately","period_end"],"description":"Cancel mode: \"immediately\" revokes access now, \"period_end\" schedules cancellation at billing period end"},"reason":{"type":"string","description":"Optional reason for cancellation"}},"required":["mode"],"description":"Parameters for canceling a subscription, including whether to cancel immediately or at period end."},"SubscriptionReactivateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchantId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["trialing","active","past_due","paused","canceled","expired"]},"quantity":{"type":"integer","minimum":1},"amountMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"billingInterval":{"type":"string","enum":["day","week","month","year"]},"currentPeriodStart":{"type":"string","format":"date-time"},"currentPeriodEnd":{"type":"string","format":"date-time"},"trialEnd":{"type":"string","format":"date-time"},"canceledAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"dunning":{"type":["object","null"],"properties":{"isInDunning":{"type":"boolean"},"phase":{"type":["number","null"]},"phaseLabel":{"type":["string","null"]},"phaseSeverity":{"type":["string","null"],"enum":["info","warning","critical",null]},"retryCount":{"type":"number"},"totalPossibleRetries":{"type":"number"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"daysInDunning":{"type":"number"},"accessRestricted":{"type":"boolean"}},"required":["isInDunning","phase","phaseLabel","phaseSeverity","retryCount","totalPossibleRetries","nextRetryAt","daysInDunning","accessRestricted"]}},"required":["id","merchantId","customerId","status","quantity","amountMinor","currency","billingInterval","currentPeriodStart","currentPeriodEnd","createdAt","updatedAt"]}},"required":["data"],"description":"The subscription after being reactivated from a canceled state, with updated billing schedule."},"SubscriptionItemListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionItem"}},"meta":{"type":"object","properties":{"total":{"type":"number","example":10},"limit":{"type":"number","example":100},"offset":{"type":"number","example":0},"has_more":{"type":"boolean","example":false}},"required":["total","limit","offset","has_more"]}},"required":["data","meta"],"description":"A list of line items in a subscription."},"SubscriptionItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"subscription_id":{"type":"string","format":"uuid","example":"660e8400-e29b-41d4-a716-446655440000"},"product_id":{"type":["string","null"],"format":"uuid","example":"770e8400-e29b-41d4-a716-446655440000"},"price_id":{"type":["string","null"],"format":"uuid","example":"880e8400-e29b-41d4-a716-446655440000"},"description":{"type":["string","null"],"example":"Pro Plan - Monthly"},"quantity":{"type":"integer","minimum":1,"example":1,"description":"Item quantity"},"currency":{"type":"string","example":"USD"},"unit_amount_minor":{"type":"integer","example":2999,"description":"Unit price in cents"},"fulfillment_type":{"type":"string","enum":["none","physical","digital"],"example":"none","description":"none: service (no order), physical: creates shipping order, digital: creates download order"},"metadata":{"type":"object","additionalProperties":{},"description":"Custom key-value metadata"},"created_at":{"type":"string","example":"2024-01-15T10:30:00Z"},"updated_at":{"type":"string","example":"2024-01-15T10:30:00Z"}},"required":["id","subscription_id","product_id","price_id","description","quantity","currency","unit_amount_minor","fulfillment_type","created_at","updated_at"],"description":"A line item within a subscription, representing a specific product and price that the customer is billed for each cycle."},"SubscriptionItemCreateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SubscriptionItem"}},"required":["data"],"description":"The newly added subscription line item."},"CreateSubscriptionItemInput":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"Product UUID to link to this item"},"price_id":{"type":"string","format":"uuid","description":"Price UUID to link to this item"},"description":{"type":"string","maxLength":500,"description":"Item description"},"quantity":{"type":"integer","minimum":1,"default":1,"description":"Item quantity","example":1},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code","example":"USD"},"unit_amount_minor":{"type":"integer","minimum":0,"description":"Unit price in cents","example":2999},"fulfillment_type":{"type":"string","enum":["none","physical","digital"],"default":"none","description":"Determines if orders are created on renewal","example":"none"},"metadata":{"type":"object","additionalProperties":{},"description":"Custom key-value metadata"}},"required":["currency","unit_amount_minor"],"description":"Parameters for adding a new line item to an existing subscription."},"SubscriptionItemUpdateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SubscriptionItem"}},"required":["data"],"description":"The updated subscription line item reflecting the changes."},"UpdateSubscriptionItemInput":{"type":"object","properties":{"quantity":{"type":"integer","minimum":1,"description":"Item quantity"},"description":{"type":"string","maxLength":500,"description":"Item description"},"unit_amount_minor":{"type":"integer","minimum":0,"description":"Unit price in cents"},"fulfillment_type":{"type":"string","enum":["none","physical","digital"],"description":"Determines if orders are created on renewal"},"metadata":{"type":"object","additionalProperties":{},"description":"Custom key-value metadata"}},"description":"Parameters for updating a subscription line item, such as changing the quantity."},"SubscriptionItemDeleteResponse":{"type":"object","properties":{"success":{"type":"boolean"},"deleted_id":{"type":"string","format":"uuid"}},"required":["success","deleted_id"],"description":"Confirmation that the subscription line item was removed."},"Payout":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"public_id":{"type":"string","example":"pyt_abc123xyz"},"gateway":{"type":"string","description":"Name of the payment processor that produced this payout batch"},"gateway_payout_id":{"type":"string","example":"batch_12345"},"gross_amount_minor":{"type":"number","example":100000,"description":"Gross amount in cents"},"fees_amount_minor":{"type":"number","example":2500,"description":"Fees in cents"},"net_amount_minor":{"type":"number","example":97500,"description":"Net amount in cents"},"currency":{"type":"string","example":"USD"},"charges_count":{"type":["number","null"],"example":42},"refunds_count":{"type":["number","null"],"example":2},"chargebacks_count":{"type":["number","null"],"example":0},"status":{"type":"string","enum":["pending","in_transit","paid","failed","canceled"],"example":"paid"},"arrival_date":{"type":["string","null"],"example":"2024-01-15"},"settled_at":{"type":["string","null"],"example":"2024-01-15T10:30:00Z"},"created_at":{"type":"string","example":"2024-01-14T08:00:00Z"}},"required":["id","public_id","gateway","gateway_payout_id","gross_amount_minor","fees_amount_minor","net_amount_minor","currency","charges_count","refunds_count","chargebacks_count","status","arrival_date","settled_at","created_at"],"description":"A payout represents funds settled from processed payments to your bank account. Track settlement batches and reconcile amounts."},"PayoutPayment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"public_id":{"type":["string","null"]},"amount_minor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"},"kind":{"type":["string","null"]},"paid_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","public_id","amount_minor","currency","status","kind","paid_at","created_at"],"description":"A payment included in a payout settlement batch, with amount and fee details."},"RefundListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}},"meta":{"type":"object","properties":{"total":{"type":"number","example":100,"description":"Total number of results matching the query"},"limit":{"type":"number","example":20,"description":"Maximum results per page"},"offset":{"type":"number","example":0,"description":"Number of results skipped"},"has_more":{"type":"boolean","example":true,"description":"Whether more results exist beyond this page"}},"required":["total","limit","offset","has_more"]}},"required":["data","meta"],"description":"A paginated list of refunds matching the query filters."},"Refund":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"public_id":{"type":"string","example":"ref_abc123xyz"},"payment_id":{"type":"string","format":"uuid","example":"660e8400-e29b-41d4-a716-446655440000","description":"The original payment ID this refund is for (alias for parent_transaction_id)"},"parent_transaction_id":{"type":"string","format":"uuid","example":"660e8400-e29b-41d4-a716-446655440000","description":"Parent transaction ID in unified transaction model. Same as payment_id for refunds."},"order_id":{"type":["string","null"],"format":"uuid","example":null},"gateway":{"type":"string","description":"Name of the payment processor that handled this refund"},"gateway_refund_id":{"type":["string","null"],"example":"txn_refund_12345"},"amount_minor":{"type":"number","example":5000,"description":"Refund amount in cents"},"currency":{"type":"string","example":"USD"},"reason":{"type":["string","null"],"enum":["customer_request","duplicate","fraudulent","product_not_received","product_unacceptable","subscription_canceled","other",null],"example":"customer_request"},"reason_details":{"type":["string","null"],"example":"Customer changed their mind"},"status":{"type":"string","enum":["pending","processing","succeeded","failed","canceled"],"example":"succeeded"},"failure_reason":{"type":["string","null"],"example":null},"failure_code":{"type":["string","null"],"example":null},"processed_at":{"type":["string","null"],"example":"2024-01-15T10:30:00Z"},"created_at":{"type":"string","example":"2024-01-14T08:00:00Z"}},"required":["id","public_id","payment_id","parent_transaction_id","order_id","gateway","gateway_refund_id","amount_minor","currency","reason","reason_details","status","failure_reason","failure_code","processed_at","created_at"],"description":"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."},"RefundRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Refund"}},"required":["data"],"description":"A single refund object with full details."},"RefundCreateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Refund"}},"required":["data"],"description":"The newly created refund object, including the gateway response details."},"CreateRefundInput":{"type":"object","properties":{"payment_id":{"type":"string","format":"uuid","description":"The ID of the payment to refund","example":"660e8400-e29b-41d4-a716-446655440000"},"amount_minor":{"type":"number","minimum":1,"description":"Amount to refund in cents. If not provided, refunds the full remaining amount.","example":5000},"reason":{"type":"string","enum":["customer_request","duplicate","fraudulent","product_not_received","product_unacceptable","subscription_canceled","other"],"description":"Reason for the refund","example":"customer_request"},"reason_details":{"type":"string","maxLength":500,"description":"Additional details about the refund reason","example":"Customer requested refund via support ticket #12345"}},"required":["payment_id"],"description":"Parameters for creating a refund. Specify the transaction ID and optionally a partial amount."},"VoidListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Void"}},"meta":{"type":"object","properties":{"total":{"type":"number","example":100,"description":"Total number of results matching the query"},"limit":{"type":"number","example":20,"description":"Maximum results per page"},"offset":{"type":"number","example":0,"description":"Number of results skipped"},"has_more":{"type":"boolean","example":true,"description":"Whether more results exist beyond this page"}},"required":["total","limit","offset","has_more"]}},"required":["data","meta"],"description":"A paginated list of voids matching the query filters."},"Void":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"public_id":{"type":"string","example":"void_abc123xyz"},"payment_id":{"type":"string","format":"uuid","example":"660e8400-e29b-41d4-a716-446655440000","description":"The original payment ID this void is for (alias for parent_transaction_id)"},"parent_transaction_id":{"type":"string","format":"uuid","example":"660e8400-e29b-41d4-a716-446655440000","description":"Parent transaction ID in unified transaction model."},"order_id":{"type":["string","null"],"format":"uuid","example":null},"gateway":{"type":"string","description":"Name of the payment processor that handled this void"},"gateway_void_id":{"type":["string","null"],"example":"txn_void_12345"},"amount_minor":{"type":"number","example":10000,"description":"Void amount in cents (always full amount of original transaction)"},"currency":{"type":"string","example":"USD"},"reason":{"type":["string","null"],"example":"Customer requested cancellation"},"reason_code":{"type":["string","null"],"enum":["customer_request","duplicate","fraudulent","error","other",null],"example":"customer_request"},"status":{"type":"string","enum":["pending","processing","succeeded","failed"],"example":"succeeded"},"failure_reason":{"type":["string","null"],"example":null},"failure_code":{"type":["string","null"],"example":null},"voided_at":{"type":["string","null"],"example":"2024-01-15T10:30:00Z"},"created_at":{"type":"string","example":"2024-01-14T08:00:00Z"}},"required":["id","public_id","payment_id","parent_transaction_id","order_id","gateway","gateway_void_id","amount_minor","currency","reason","reason_code","status","failure_reason","failure_code","voided_at","created_at"],"description":"A void cancels an unsettled payment before gateway settlement. Voids are always for the full amount — use a refund for settled payments."},"VoidRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Void"}},"required":["data"],"description":"A single void object with full details."},"VoidCreateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Void"}},"required":["data"],"description":"The newly created void object confirming the unsettled payment was canceled."},"CreateVoidInput":{"type":"object","properties":{"payment_id":{"type":"string","format":"uuid","description":"The ID of the payment to void. Must be unsettled.","example":"660e8400-e29b-41d4-a716-446655440000"},"reason":{"type":"string","maxLength":500,"description":"Reason for the void","example":"Customer requested cancellation before shipment"},"reason_code":{"type":"string","enum":["customer_request","duplicate","fraudulent","error","other"],"description":"Standardized reason code for the void","example":"customer_request"}},"required":["payment_id"],"description":"Parameters for creating a void. Specify the transaction ID of the unsettled payment to cancel."},"CreditNoteRetrieveResponse":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/CreditNote"},{"description":"A credit note formally reduces the amount owed on an invoice. It is the accounting counterpart of a refund — the credit note is the document, the refund is the money movement."}]}},"required":["data"],"description":"A single credit note with full details including the associated invoice and refund."},"CreditNoteCreateResponse":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/CreditNote"},{"description":"A credit note formally reduces the amount owed on an invoice. It is the accounting counterpart of a refund — the credit note is the document, the refund is the money movement."}]}},"required":["data"],"description":"The newly created credit note with issued status and PDF URL."},"CreateCreditNoteInput":{"type":"object","properties":{"invoice_id":{"type":"string","format":"uuid","description":"The ID of the invoice to issue a credit note for","example":"660e8400-e29b-41d4-a716-446655440000"},"amount_minor":{"type":"integer","minimum":1,"maximum":2000000000,"description":"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.","example":5000},"tax_amount_minor":{"type":"integer","minimum":0,"maximum":2000000000,"description":"Tax portion of the credit in minor units (cents). For UK/EU VAT compliance. Capped at 2,000,000,000.","example":500},"credit_method":{"type":"string","enum":["refund_to_payment_method","customer_balance","external"],"default":"refund_to_payment_method","description":"How the credit should be applied","example":"refund_to_payment_method"},"reason":{"type":"string","maxLength":500,"description":"Reason for the credit note","example":"Service not provided as agreed"},"reason_code":{"type":"string","enum":["customer_request","duplicate_charge","service_issue","billing_error","subscription_cancellation","proration","other"],"description":"Standardized reason code","example":"customer_request"},"cancel_subscription":{"type":"boolean","default":false,"description":"Whether to cancel the associated subscription after issuing","example":false},"is_prorated":{"type":"boolean","description":"Whether this credit note represents a prorated amount","example":false},"proration_days_total":{"type":"integer","minimum":1,"maximum":366,"description":"Total days in the billing period (for prorated credits). Constrained to 1–366.","example":30},"proration_days_unused":{"type":"integer","minimum":0,"maximum":366,"description":"Unused days in the billing period (for prorated credits). Must be <= proration_days_total. Constrained to 0–366.","example":12},"idempotency_key":{"type":"string","maxLength":255,"description":"Idempotency key to prevent duplicate credit notes"},"metadata":{"type":"object","additionalProperties":{},"description":"Arbitrary key-value metadata"},"auto_route":{"type":"boolean","default":false,"description":"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.","example":false}},"required":["invoice_id","amount_minor"],"description":"Parameters for creating a credit note against an invoice, specifying the amount, reason, and whether to issue a refund."},"CreditNoteVoidResponse":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/CreditNote"},{"description":"A credit note formally reduces the amount owed on an invoice. It is the accounting counterpart of a refund — the credit note is the document, the refund is the money movement."}]}},"required":["data"],"description":"The credit note after being voided, reversing its accounting effect."},"CreditNoteEligibilityResponse":{"type":"object","properties":{"invoice_id":{"type":"string","format":"uuid"},"total_amount_minor":{"type":"number"},"total_paid_minor":{"type":"number"},"total_credited_minor":{"type":"number"},"max_creditable_minor":{"type":"number"},"eligible":{"type":"boolean"},"payments":{"type":"array","items":{"type":"object","properties":{"transaction_id":{"type":"string","format":"uuid"},"gateway":{"type":"string"},"payment_method":{"type":["string","null"]},"amount_minor":{"type":"number"},"amount_refunded_minor":{"type":"number"},"amount_available_minor":{"type":"number"},"card_brand":{"type":["string","null"]},"card_last4":{"type":["string","null"]},"terminal_serial":{"type":["string","null"]},"available_operations":{"type":"array","items":{"type":"string"}},"constraints":{"type":"object","properties":{"partial_supported":{"type":"boolean"},"requires_card_present":{"type":"boolean"},"requires_terminal_online":{"type":"boolean"}},"required":["partial_supported","requires_card_present","requires_terminal_online"]}},"required":["transaction_id","gateway","payment_method","amount_minor","amount_refunded_minor","amount_available_minor","card_brand","card_last4","terminal_serial","available_operations","constraints"]}}},"required":["invoice_id","total_amount_minor","total_paid_minor","total_credited_minor","max_creditable_minor","eligible","payments"],"description":"Eligibility details showing whether a credit note can be issued for the specified invoice and the maximum creditable amount."},"TransactionReversalEligibilityResponse":{"type":"object","properties":{"can_reverse":{"type":"boolean"},"transaction_id":{"type":"string","format":"uuid"},"gateway":{"type":"string"},"payment_method":{"type":["string","null"]},"available_operations":{"type":"array","items":{"type":"string"}},"constraints":{"type":"object","properties":{"max_amount":{"type":"number"},"partial_supported":{"type":"boolean"},"requires_card_present":{"type":"boolean"},"requires_terminal_online":{"type":"boolean"},"requires_customer_iban":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["max_amount","partial_supported","requires_card_present","requires_terminal_online","requires_customer_iban","reason"]},"card_brand":{"type":["string","null"]},"card_last4":{"type":["string","null"]},"terminal_serial":{"type":["string","null"]},"terminal_uti":{"type":["string","null"]}},"required":["can_reverse","transaction_id","gateway","payment_method","available_operations","constraints","card_brand","card_last4","terminal_serial","terminal_uti"],"description":"Details about which reversal methods (refund, void, or credit note) are available for a specific transaction."},"CreditNoteLineList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/CreditNoteLine"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"]},"CreditNoteLine":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"abcd1234-e29b-41d4-a716-446655440000"},"object":{"type":"string","enum":["credit_note_line"]},"credit_note_id":{"type":"string","format":"uuid"},"invoice_line_item_id":{"type":["string","null"],"format":"uuid","description":"The invoice line item this credit line applies to, when the credit was scoped to a specific line. Null for invoice-level credits."},"description":{"type":"string","example":"Pro Plan subscription — prorated for unused 12 days"},"quantity":{"type":"integer","example":1},"unit_amount_minor":{"type":"integer","description":"Per-unit credit amount in cents","example":5000},"total_amount_minor":{"type":"integer","description":"Total credit for this line in cents","example":5000},"metadata":{"type":["object","null"],"additionalProperties":{}},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","credit_note_id","invoice_line_item_id","description","quantity","unit_amount_minor","total_amount_minor","metadata","created_at"],"description":"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."},"CreditNotePreviewResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreditNotePreview"}},"required":["data"]},"CreditNotePreview":{"type":"object","properties":{"object":{"type":"string","enum":["credit_note_preview"]},"invoice_id":{"type":"string","format":"uuid"},"proposed_amount_minor":{"type":"integer"},"proposed_tax_amount_minor":{"type":["integer","null"]},"currency":{"type":"string"},"invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"total_minor":{"type":"integer"},"amount_paid_minor":{"type":"integer"},"amount_due_minor":{"type":"integer"},"previously_credited_minor":{"type":"integer"},"max_creditable_minor":{"type":"integer"}},"required":["id","total_minor","amount_paid_minor","amount_due_minor","previously_credited_minor","max_creditable_minor"]},"after_credit":{"type":"object","properties":{"new_amount_due_minor":{"type":"integer"},"new_amount_credited_minor":{"type":"integer"},"would_leave_outstanding":{"type":"boolean","description":"True if applying this credit would leave a non-zero balance on the invoice."}},"required":["new_amount_due_minor","new_amount_credited_minor","would_leave_outstanding"]},"exceeds_max_creditable":{"type":"boolean","description":"True if `amount_minor` exceeds the invoice's remaining creditable amount. A real create call would be rejected."},"credit_method":{"type":"string"}},"required":["object","invoice_id","proposed_amount_minor","proposed_tax_amount_minor","currency","invoice","after_credit","exceeds_max_creditable","credit_method"],"description":"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."},"PreviewCreditNoteInput":{"type":"object","properties":{"invoice_id":{"type":"string","format":"uuid","description":"Invoice to preview a credit note against.","example":"660e8400-e29b-41d4-a716-446655440000"},"amount_minor":{"type":"integer","minimum":1,"description":"Proposed credit amount in cents. The preview validates that this does not exceed the invoice's outstanding creditable amount.","example":5000},"tax_amount_minor":{"type":"integer","minimum":0,"description":"Proposed tax portion of the credit in cents.","example":500},"credit_method":{"type":"string","enum":["refund_to_payment_method","customer_balance","external"],"description":"Planned credit method. Defaults to refund_to_payment_method.","example":"refund_to_payment_method"},"reason_code":{"type":"string","enum":["customer_request","duplicate_charge","service_issue","billing_error","subscription_cancellation","proration","other"]}},"required":["invoice_id","amount_minor"],"description":"Parameters to preview a credit note without persisting it. The response shows what the credit note would look like if created with these fields."},"Dispute":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","description":"Unique identifier for the dispute"},"public_id":{"type":"string","example":"dsp_abc123xyz","description":"Public-facing dispute identifier"},"payment_id":{"type":["string","null"],"format":"uuid","example":"660e8400-e29b-41d4-a716-446655440000","description":"The original payment ID this dispute is for (alias for parent_transaction_id)"},"parent_transaction_id":{"type":["string","null"],"format":"uuid","example":"660e8400-e29b-41d4-a716-446655440000","description":"Parent transaction ID in unified transaction model. Same as payment_id for disputes."},"gateway":{"type":"string","description":"Name of the payment processor that handled the original transaction"},"gateway_dispute_id":{"type":"string","example":"chargeback_12345","description":"Dispute identifier assigned by the payment gateway"},"gateway_transaction_id":{"type":["string","null"],"example":"txn_original_12345","description":"Original transaction identifier from the payment gateway"},"amount_minor":{"type":"number","example":10000,"description":"Disputed amount in cents"},"currency":{"type":"string","example":"USD","description":"Three-letter ISO 4217 currency code"},"reason_code":{"type":["string","null"],"example":"4837","description":"Card network reason code"},"reason":{"type":["string","null"],"example":"Fraudulent transaction","description":"Human-readable reason for the dispute"},"network_reason_code":{"type":["string","null"],"example":"83","description":"Card network-specific reason code"},"network_reason_description":{"type":["string","null"],"example":"Fraud - Card-Absent Environment","description":"Card network-specific reason description"},"customer_name":{"type":["string","null"],"example":"John Doe","description":"Name of the customer who filed the dispute"},"card_brand":{"type":["string","null"],"example":"visa","description":"Card brand used for the original payment"},"card_last4":{"type":["string","null"],"example":"4242","description":"Last four digits of the card used for the original payment"},"evidence_due_by":{"type":["string","null"],"example":"2024-01-25T23:59:59Z","description":"Deadline for submitting evidence to contest the dispute"},"evidence_submitted":{"type":"boolean","example":false,"description":"Whether evidence has been submitted for this dispute"},"evidence_submitted_at":{"type":["string","null"],"example":null,"description":"Timestamp when evidence was submitted"},"status":{"type":"string","enum":["needs_response","under_review","won","lost","warning_closed","warning_needs_response"],"example":"needs_response","description":"Current status of the dispute lifecycle"},"resolution":{"type":["string","null"],"enum":["won","lost","withdrawn",null],"example":null,"description":"Final resolution outcome of the dispute"},"resolved_at":{"type":["string","null"],"example":null,"description":"Timestamp when the dispute was resolved"},"disputed_at":{"type":"string","example":"2024-01-15T10:30:00Z","description":"Timestamp when the dispute was filed"},"created_at":{"type":"string","example":"2024-01-15T10:30:00Z","description":"Timestamp when the dispute record was created"}},"required":["id","public_id","payment_id","parent_transaction_id","gateway","gateway_dispute_id","gateway_transaction_id","amount_minor","currency","reason_code","reason","network_reason_code","network_reason_description","customer_name","card_brand","card_last4","evidence_due_by","evidence_submitted","evidence_submitted_at","status","resolution","resolved_at","disputed_at","created_at"],"description":"A dispute (chargeback) represents a customer's challenge to a charge with their card issuer. Track lifecycle stages and submit evidence to contest."},"OpenDispute":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the dispute"},"public_id":{"type":"string","description":"Public-facing dispute identifier"},"payment_id":{"type":["string","null"],"format":"uuid","description":"The original payment ID this dispute is for"},"parent_transaction_id":{"type":["string","null"],"format":"uuid","description":"Parent transaction ID in unified transaction model"},"gateway":{"type":"string","description":"Payment gateway that processed the original transaction"},"amount_minor":{"type":"number","description":"Disputed amount in cents"},"currency":{"type":"string","description":"Three-letter ISO 4217 currency code"},"reason":{"type":["string","null"],"description":"Human-readable reason for the dispute"},"customer_name":{"type":["string","null"],"description":"Name of the customer who filed the dispute"},"card_brand":{"type":["string","null"],"description":"Card brand used for the original payment"},"card_last4":{"type":["string","null"],"description":"Last four digits of the card used for the original payment"},"evidence_due_by":{"type":["string","null"],"description":"Deadline for submitting evidence to contest the dispute"},"days_until_due":{"type":["number","null"],"description":"Number of days remaining until the evidence deadline"},"is_overdue":{"type":"boolean","description":"Whether the evidence submission deadline has passed"},"disputed_at":{"type":"string","description":"Timestamp when the dispute was filed"}},"required":["id","public_id","payment_id","parent_transaction_id","gateway","amount_minor","currency","reason","customer_name","card_brand","card_last4","evidence_due_by","days_until_due","is_overdue","disputed_at"],"description":"An open dispute requiring action, with urgency indicators for evidence submission deadlines."},"DiscountListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Discount"}},"meta":{"type":"object","properties":{"total":{"type":"number","example":100},"limit":{"type":"number","example":20},"offset":{"type":"number","example":0},"has_more":{"type":"boolean","example":true}},"required":["total","limit","offset","has_more"]}},"required":["data","meta"],"description":"A paginated list of discounts matching the query filters."},"Discount":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"code":{"type":"string","example":"SUMMER20"},"name":{"type":["string","null"],"example":"Summer Sale 20% Off"},"description":{"type":["string","null"],"example":"20% off for summer promotion"},"discount_type":{"type":"string","example":"percentage"},"discount_value":{"type":"number","example":20,"description":"Amount off (cents) or percentage"},"applies_to":{"type":["string","null"],"example":"all"},"product_ids":{"type":["array","null"],"items":{"type":"string"},"example":null},"max_redemptions":{"type":["number","null"],"example":100},"current_redemptions":{"type":["number","null"],"example":25},"valid_from":{"type":["string","null"],"example":"2024-06-01T00:00:00Z"},"valid_until":{"type":["string","null"],"example":"2024-08-31T23:59:59Z"},"recurring_type":{"type":["string","null"],"example":"once"},"recurring_cycles":{"type":["number","null"],"example":null},"first_time_customer":{"type":["boolean","null"],"example":false},"is_active":{"type":["boolean","null"],"example":true},"created_at":{"type":["string","null"],"example":"2024-01-14T08:00:00Z"},"updated_at":{"type":["string","null"],"example":"2024-01-14T08:00:00Z"}},"required":["id","code","name","description","discount_type","discount_value","applies_to","product_ids","max_redemptions","current_redemptions","valid_from","valid_until","recurring_type","recurring_cycles","first_time_customer","is_active","created_at","updated_at"],"description":"A discount code that applies a percentage or fixed amount reduction to charges, invoices, or subscriptions."},"DiscountRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Discount"}},"required":["data"],"description":"A single discount object with full details and usage statistics."},"DiscountCreateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Discount"}},"required":["data"],"description":"The newly created discount object."},"CreateDiscountInput":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":50,"description":"Unique discount code (will be uppercased)","example":"SUMMER20"},"name":{"type":"string","minLength":1,"maxLength":255,"description":"Human-readable name","example":"Summer Sale 20% Off"},"description":{"type":"string","maxLength":1000,"description":"Optional description","example":"20% off for summer promotion"},"discount_type":{"type":"string","enum":["percentage","fixed_amount"],"description":"Type of discount","example":"percentage"},"discount_value":{"type":"number","minimum":0.01,"description":"Discount value - percentage (1-100) or amount in cents","example":20},"applies_to":{"type":"string","enum":["all","specific_products"],"default":"all","description":"Which products the discount applies to","example":"all"},"scope":{"type":"string","enum":["entire_order","specific_products","subscription_only","one_time_only"],"description":"Scope of where discount can be applied","example":"entire_order"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Product IDs if applies_to is 'specific_products'"},"max_redemptions":{"type":"integer","minimum":1,"description":"Maximum total redemptions allowed","example":100},"max_redemptions_per_user":{"type":"integer","minimum":0,"default":0,"description":"Maximum redemptions per customer (0 = unlimited)","example":1},"valid_from":{"type":"string","description":"Start date (ISO 8601)","example":"2024-06-01T00:00:00Z"},"valid_until":{"type":"string","description":"End date (ISO 8601)","example":"2024-08-31T23:59:59Z"},"recurring_type":{"type":"string","enum":["once","forever","repeating"],"description":"How the discount applies to recurring payments","example":"once"},"recurring_cycles":{"type":"integer","minimum":1,"description":"Number of billing cycles (only if recurring_type is 'repeating')","example":3},"first_time_customer":{"type":"boolean","default":false,"description":"Only available to first-time customers","example":false}},"required":["code","name","discount_type","discount_value"],"description":"Parameters for creating a new discount code with amount, type, and usage limits."},"DiscountUpdateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Discount"}},"required":["data"],"description":"The updated discount object reflecting the changes."},"UpdateDiscountInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":["string","null"],"maxLength":1000},"discount_value":{"type":"number","minimum":0.01},"applies_to":{"type":"string","enum":["all","specific_products"]},"scope":{"type":"string","enum":["entire_order","specific_products","subscription_only","one_time_only"]},"product_ids":{"type":["array","null"],"items":{"type":"string"}},"max_redemptions":{"type":["integer","null"],"minimum":1},"max_redemptions_per_user":{"type":"integer","minimum":0},"valid_from":{"type":["string","null"]},"valid_until":{"type":["string","null"]},"is_active":{"type":"boolean"},"is_archived":{"type":"boolean"},"recurring_type":{"type":["string","null"],"enum":["once","forever","repeating",null]},"recurring_cycles":{"type":["integer","null"],"minimum":1},"first_time_customer":{"type":"boolean"}},"description":"Parameters for updating an existing discount. Active discounts can only have metadata and usage limits modified."},"DiscountDeleteResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Discount"}},"required":["data"],"description":"Confirmation that the discount was successfully deleted."},"PaymentAttemptListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentAttempt"}},"meta":{"type":"object","properties":{"count":{"type":"integer","description":"Number of results returned"},"limit":{"type":"integer","description":"Limit used in query"}},"required":["count"]}},"required":["data","meta"],"description":"A paginated list of payment attempts matching the query filters."},"PaymentAttempt":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the payment attempt"},"public_id":{"type":["string","null"],"description":"External reference ID (payatt_xxx format). Used as order_id in gateway requests.","example":"payatt_abc123xyz789"},"gateway_order_id":{"type":["string","null"],"description":"Order ID sent to the processor. Format: payatt_<public_id>. Primary correlation key for webhook mapping.","example":"payatt_abc123xyz789"},"gateway_transaction_id":{"type":["string","null"],"description":"Processor-assigned transaction reference.","example":"12345678901"},"payment_id":{"type":["string","null"],"format":"uuid","description":"Logical payment (PaymentIntent) this attempt belongs to"},"invoice_id":{"type":["string","null"],"format":"uuid","description":"Associated invoice ID"},"subscription_id":{"type":["string","null"],"format":"uuid","description":"Associated subscription ID"},"checkout_session_id":{"type":["string","null"],"format":"uuid","description":"Associated checkout session ID"},"billing_run_id":{"type":["string","null"],"format":"uuid","description":"Billing run ID for batch reconciliation"},"gateway":{"type":"string","description":"Name of the payment processor that handled this attempt"},"gateway_code":{"type":"string","description":"Processor-returned response code"},"gateway_message":{"type":"string","description":"Processor-returned response message"},"category":{"type":"string","enum":["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"],"description":"Normalized error category for the payment attempt"},"severity":{"type":"string","enum":["info","warn","error"],"description":"Severity level for logging/monitoring"},"retryability":{"type":"string","enum":["retry_now","retry_later","do_not_retry"],"description":"Retry behavior recommendation. retry_now: Safe to retry immediately. retry_later: Retry after delay. do_not_retry: Hard decline, don't retry."},"customer_action":{"type":"string","enum":["try_again","use_other_method","update_card","contact_bank","contact_merchant","none"],"description":"Recommended action for the customer"},"merchant_action":{"type":"string","enum":["none","collect_new_pm","fix_config","contact_support","fraud_review","schedule_retry","contact_bank","stop_recurring"],"description":"Recommended action for the merchant"},"subscription_directive":{"type":"string","enum":["none","stop_all","stop_program","update_cardholder_data"],"description":"Directive for subscription handling after decline"},"safe_customer_message_key":{"type":"string","description":"Template key for customer-facing message"},"decline_type":{"type":["string","null"],"enum":["soft","hard",null],"description":"Decline classification. soft: May succeed on retry. hard: Will not succeed on retry."},"attempt_status":{"type":"string","enum":["pending","succeeded","failed","canceled"],"description":"Final outcome status of the attempt"},"amount_cents":{"type":["integer","null"],"description":"Payment amount in cents"},"currency":{"type":["string","null"],"description":"Three-letter ISO currency code"},"payment_method_last4":{"type":["string","null"],"description":"Last 4 digits of card"},"payment_method_brand":{"type":["string","null"],"description":"Card brand (visa, mastercard, etc.)"},"attempt_number":{"type":"integer","description":"Attempt sequence number (1 = first attempt)"},"retry_attempt_number":{"type":"integer","description":"Legacy retry attempt number"},"max_retry_attempts":{"type":["integer","null"],"description":"Maximum retry attempts allowed"},"next_retry_at":{"type":["string","null"],"format":"date-time","description":"Next scheduled retry timestamp"},"is_scheduled_retry":{"type":"boolean","description":"Whether this was a scheduled retry"},"is_manual_retry":{"type":"boolean","description":"Whether this was a manual retry"},"created_at":{"type":"string","format":"date-time","description":"When the attempt was created"},"updated_at":{"type":"string","format":"date-time","description":"When the attempt was last updated"}},"required":["id","public_id","gateway_order_id","gateway_transaction_id","payment_id","invoice_id","subscription_id","checkout_session_id","billing_run_id","gateway","gateway_code","gateway_message","category","severity","retryability","customer_action","merchant_action","subscription_directive","safe_customer_message_key","decline_type","attempt_status","amount_cents","currency","payment_method_last4","payment_method_brand","attempt_number","retry_attempt_number","max_retry_attempts","next_retry_at","is_scheduled_retry","is_manual_retry","created_at","updated_at"],"description":"A record of an individual payment processing attempt, including gateway response codes, AVS/CVV results, and retry metadata."},"PaymentAttemptErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}},"required":["error"],"description":"Error response returned when a payment attempt lookup fails."},"PaymentAttemptSingleResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentAttempt"}},"required":["data"],"description":"A single payment attempt with full gateway response details."},"RetryEligibilityResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"should_retry":{"type":"boolean","description":"Whether the subscription should be retried"},"reason":{"type":"string","description":"Explanation for the retry decision"},"last_attempt":{"allOf":[{"$ref":"#/components/schemas/PaymentAttempt"},{"type":["object","null"],"description":"Most recent payment attempt"}]}},"required":["should_retry","reason","last_attempt"]}},"required":["data"],"description":"Assessment of whether a failed payment attempt is eligible for retry, including recommended retry strategy."},"DeclineAnalyticsResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"total_attempts":{"type":"integer"},"approved_count":{"type":"integer"},"declined_count":{"type":"integer"},"approval_rate":{"type":"number"},"soft_decline_count":{"type":"integer"},"hard_decline_count":{"type":"integer"},"top_decline_categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"count":{"type":"integer"}},"required":["category","count"]}},"by_gateway":{"type":"object","additionalProperties":{"type":"object","properties":{"total":{"type":"integer"},"approved":{"type":"integer"},"declined":{"type":"integer"}}},"description":"Breakdown by gateway"}},"required":["total_attempts","approved_count","declined_count","approval_rate","soft_decline_count","hard_decline_count","top_decline_categories","by_gateway"]}},"required":["data"],"description":"Analytics data about payment decline patterns, including decline codes, rates, and trends."},"PaymentSecurityResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentSecurityResult"}},"required":["data"],"description":"Response containing the security verification results (AVS/CVV) for a specific payment attempt."},"PaymentSecurityResult":{"type":"object","properties":{"avs":{"$ref":"#/components/schemas/AvsCodeInterpretation"},"cvv":{"$ref":"#/components/schemas/CvvCodeInterpretation"},"overall_risk_level":{"type":"string","enum":["low","medium","high","unknown"],"description":"Combined risk level from AVS + CVV checks"},"recommendation":{"type":"string","enum":["accept","review","decline"],"description":"Recommended action based on security checks"}},"required":["avs","cvv","overall_risk_level","recommendation"],"description":"Combined AVS and CVV verification results for a payment attempt."},"AvsCodeInterpretation":{"type":["object","null"],"properties":{"code":{"type":"string","description":"Raw AVS response code from gateway"},"match_type":{"type":"string","enum":["full_match","partial_match","no_match","not_supported","not_available","error"],"description":"Type of address match"},"address_match":{"type":["boolean","null"],"description":"Whether the street address matched"},"zip_match":{"type":["boolean","null"],"description":"Whether the ZIP/postal code matched"},"description":{"type":"string","description":"Human-readable description of the AVS result"},"risk_level":{"type":"string","enum":["low","medium","high","unknown"],"description":"Risk level based on AVS result. low: full match, medium: partial match, high: no match"}},"required":["code","match_type","address_match","zip_match","description","risk_level"],"description":"AVS verification result"},"CvvCodeInterpretation":{"type":["object","null"],"properties":{"code":{"type":"string","description":"Raw CVV response code from gateway"},"match_type":{"type":"string","enum":["match","no_match","not_processed","not_provided","issuer_not_certified","error"],"description":"Type of CVV match"},"description":{"type":"string","description":"Human-readable description of the CVV result"},"risk_level":{"type":"string","enum":["low","medium","high","unknown"],"description":"Risk level based on CVV result. low: match, medium: not processed, high: no match"}},"required":["code","match_type","description","risk_level"],"description":"CVV verification result"},"ChargeCreateResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"customerId":{"type":"string","minLength":1},"invoiceId":{"type":["string","null"],"minLength":1},"paymentMethodId":{"type":["string","null"],"minLength":1},"amountMinor":{"type":"integer"},"amountCapturedMinor":{"type":"integer"},"amountRefundedMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["pending","processing","succeeded","failed","refunded","partially_refunded","voided"]},"description":{"type":"string"},"statementDescriptor":{"type":["string","null"]},"failureCode":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"gatewayTransactionId":{"type":["string","null"]},"receiptUrl":{"type":["string","null"]},"captured":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","customerId","invoiceId","paymentMethodId","amountMinor","amountCapturedMinor","amountRefundedMinor","currency","status","description","statementDescriptor","failureCode","failureMessage","gatewayTransactionId","receiptUrl","captured","metadata","createdAt","updatedAt"]}},"required":["data"],"description":"The newly created charge object with gateway response details."},"ChargeErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"],"description":"Error response returned when a charge operation fails due to a gateway decline or validation error."},"ChargeDuplicateErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"existingChargeId":{"type":"string"}},"required":["error"],"description":"Error response returned when a duplicate charge is detected via idempotency key."},"ChargeListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"customerId":{"type":"string","minLength":1},"invoiceId":{"type":["string","null"],"minLength":1},"paymentMethodId":{"type":["string","null"],"minLength":1},"amountMinor":{"type":"integer"},"amountCapturedMinor":{"type":"integer"},"amountRefundedMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["pending","processing","succeeded","failed","refunded","partially_refunded","voided"]},"description":{"type":"string"},"statementDescriptor":{"type":["string","null"]},"failureCode":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"gatewayTransactionId":{"type":["string","null"]},"receiptUrl":{"type":["string","null"]},"captured":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","customerId","invoiceId","paymentMethodId","amountMinor","amountCapturedMinor","amountRefundedMinor","currency","status","description","statementDescriptor","failureCode","failureMessage","gatewayTransactionId","receiptUrl","captured","metadata","createdAt","updatedAt"]}},"pagination":{"type":"object","properties":{"page":{"type":"number","description":"Current page number"},"limit":{"type":"number","description":"Maximum results per page"},"total":{"type":"number","description":"Total number of results matching the query"},"totalPages":{"type":"number","description":"Total number of pages available"}},"required":["page","limit","total","totalPages"]}},"required":["data","pagination"],"description":"A paginated list of charges matching the query filters."},"ChargeRetrieveResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"customerId":{"type":"string","minLength":1},"invoiceId":{"type":["string","null"],"minLength":1},"paymentMethodId":{"type":["string","null"],"minLength":1},"amountMinor":{"type":"integer"},"amountCapturedMinor":{"type":"integer"},"amountRefundedMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["pending","processing","succeeded","failed","refunded","partially_refunded","voided"]},"description":{"type":"string"},"statementDescriptor":{"type":["string","null"]},"failureCode":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"gatewayTransactionId":{"type":["string","null"]},"receiptUrl":{"type":["string","null"]},"captured":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","customerId","invoiceId","paymentMethodId","amountMinor","amountCapturedMinor","amountRefundedMinor","currency","status","description","statementDescriptor","failureCode","failureMessage","gatewayTransactionId","receiptUrl","captured","metadata","createdAt","updatedAt"]}},"required":["data"],"description":"A single charge object with full details."},"ChargeCaptureResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"customerId":{"type":"string","minLength":1},"invoiceId":{"type":["string","null"],"minLength":1},"paymentMethodId":{"type":["string","null"],"minLength":1},"amountMinor":{"type":"integer"},"amountCapturedMinor":{"type":"integer"},"amountRefundedMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["pending","processing","succeeded","failed","refunded","partially_refunded","voided"]},"description":{"type":"string"},"statementDescriptor":{"type":["string","null"]},"failureCode":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"gatewayTransactionId":{"type":["string","null"]},"receiptUrl":{"type":["string","null"]},"captured":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","customerId","invoiceId","paymentMethodId","amountMinor","amountCapturedMinor","amountRefundedMinor","currency","status","description","statementDescriptor","failureCode","failureMessage","gatewayTransactionId","receiptUrl","captured","metadata","createdAt","updatedAt"]}},"required":["data"],"description":"The charge object after capturing the authorized funds."},"ChargeRefundResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"customerId":{"type":"string","minLength":1},"invoiceId":{"type":["string","null"],"minLength":1},"paymentMethodId":{"type":["string","null"],"minLength":1},"amountMinor":{"type":"integer"},"amountCapturedMinor":{"type":"integer"},"amountRefundedMinor":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["pending","processing","succeeded","failed","refunded","partially_refunded","voided"]},"description":{"type":"string"},"statementDescriptor":{"type":["string","null"]},"failureCode":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"gatewayTransactionId":{"type":["string","null"]},"receiptUrl":{"type":["string","null"]},"captured":{"type":"boolean"},"metadata":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","customerId","invoiceId","paymentMethodId","amountMinor","amountCapturedMinor","amountRefundedMinor","currency","status","description","statementDescriptor","failureCode","failureMessage","gatewayTransactionId","receiptUrl","captured","metadata","createdAt","updatedAt"]}},"required":["data"],"description":"The charge object after processing a full or partial refund."},"BillingPreviewResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"integer","minimum":1},"date":{"type":"string","format":"date-time"},"formattedDate":{"type":"string"},"dayName":{"type":"string"},"amountMinor":{"type":"integer"},"formattedAmount":{"type":"string"},"isTrialEnd":{"type":"boolean"},"isFirstCharge":{"type":"boolean"},"isFinalPayment":{"type":"boolean"}},"required":["sequence","date","formattedDate","dayName","amountMinor","formattedAmount"]}},"summary":{"type":"string"},"totalAmountMinor":{"type":"integer"},"firstChargeDate":{"type":"string","format":"date-time"},"trialEndDate":{"type":["string","null"],"format":"date-time"},"scheduleEndDate":{"type":["string","null"],"format":"date-time"},"timezone":{"type":"string"}},"required":["items","summary","totalAmountMinor","firstChargeDate","trialEndDate","scheduleEndDate","timezone"]}},"required":["data"],"description":"A preview of upcoming billing charges for a subscription, showing line items, amounts, and billing dates."},"BillingPreviewErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"field":{"type":"string"}},"required":["error"],"description":"Error response when a billing preview cannot be generated."},"BillingIntervalsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["value","label","description"]}}},"required":["data"],"description":"Available billing intervals (monthly, quarterly, yearly) with their configuration and pricing multipliers."},"BillingAnchorRulesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"requiresAnchorDay":{"type":"boolean"}},"required":["value","label","description","requiresAnchorDay"]}}},"required":["data"],"description":"Billing anchor rules that determine how billing dates are calculated for different start modes and intervals."},"PriceListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"has_more":{"type":"boolean"},"total_count":{"type":"integer"}},"required":["object","data","has_more"],"description":"A paginated list of prices matching the query filters."},"Price":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the price"},"object":{"type":"string","enum":["price"],"description":"Object type"},"product_id":{"type":"string","format":"uuid","description":"ID of the product this price belongs to"},"active":{"type":"boolean","description":"Whether the price is active"},"currency":{"type":"string","description":"Three-letter ISO currency code (lowercase)"},"unit_amount":{"type":["integer","null"],"description":"Price in minor units (cents)"},"type":{"type":"string","enum":["one_time","recurring"],"description":"Price type"},"pricing_model":{"type":"string","enum":["fixed","pay_what_you_want","free"],"description":"Pricing model"},"interval":{"type":["string","null"],"enum":["day","week","month","year",null],"description":"Billing interval (recurring only)"},"interval_count":{"type":["integer","null"],"description":"Number of intervals between billings"},"trial_period_days":{"type":["integer","null"],"description":"Trial period in days (recurring only)"},"minimum_amount":{"type":["integer","null"],"description":"PWYW: minimum amount in cents"},"maximum_amount":{"type":["integer","null"],"description":"PWYW: maximum amount in cents"},"suggested_amount":{"type":["integer","null"],"description":"PWYW: suggested amount in cents"},"preset_amounts":{"type":["array","null"],"items":{"type":"integer"},"description":"PWYW: quick-select amounts"},"nickname":{"type":["string","null"],"description":"Display name (e.g., 'Monthly', 'Annual - Save 17%')"},"lookup_key":{"type":["string","null"],"description":"Stable key for API lookups"},"billing_scheme":{"type":"string","enum":["per_unit","tiered"],"description":"Billing scheme. Defaults to `per_unit`. Set to `tiered` along with `tiers_mode` + `tiers` to use graduated or volume pricing."},"tiers_mode":{"type":["string","null"],"enum":["graduated","volume",null],"description":"Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be null otherwise."},"tiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PriceTier"},"description":"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."},"transform_quantity":{"type":["object","null"],"properties":{"divide_by":{"type":"integer","exclusiveMinimum":0,"description":"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."},"round":{"type":"string","enum":["up","down"],"description":"Rounding mode when quantity is not an exact multiple of `divide_by`."}},"required":["divide_by","round"],"description":"Optional quantity transform (package pricing) applied before tier lookup. Immutable after creation."},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","object","product_id","active","currency","unit_amount","type","pricing_model","billing_scheme","created_at","updated_at"],"description":"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."},"PriceTier":{"type":"object","properties":{"up_to":{"type":["integer","null"],"exclusiveMinimum":0,"description":"Upper bound of this tier (1-based inclusive). `null` = open-ended catch-all. Only the FINAL tier may set `up_to: null`."},"unit_amount_minor":{"type":["integer","null"],"minimum":0,"description":"Per-unit charge in minor currency units (cents). May be null if the tier charges only a flat fee."},"flat_amount_minor":{"type":["integer","null"],"minimum":0,"description":"Flat fee charged once when quantity enters this tier. May be null if the tier charges only a per-unit amount."}},"required":["up_to","unit_amount_minor","flat_amount_minor"]},"PriceErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Error response returned when a price operation fails."},"CreatePriceRequest":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"ID of the product this price belongs to"},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"usd","description":"Three-letter ISO currency code"},"unit_amount":{"type":"integer","minimum":0,"description":"Price in minor units (cents). Required for fixed pricing."},"type":{"type":"string","enum":["one_time","recurring"],"default":"one_time","description":"Price type"},"pricing_model":{"type":"string","enum":["fixed","pay_what_you_want","free"],"default":"fixed","description":"Pricing model"},"interval":{"type":"string","enum":["day","week","month","year"],"description":"Billing interval (required for recurring)"},"interval_count":{"type":"integer","minimum":1,"maximum":12,"description":"Number of intervals between billings (1-12)"},"trial_period_days":{"type":"integer","minimum":0,"maximum":730,"description":"Trial period in days (0-730)"},"minimum_amount":{"type":"integer","minimum":0,"description":"PWYW: minimum amount in cents"},"maximum_amount":{"type":"integer","minimum":0,"description":"PWYW: maximum amount in cents"},"suggested_amount":{"type":"integer","minimum":0,"description":"PWYW: suggested amount in cents"},"preset_amounts":{"type":"array","items":{"type":"integer","minimum":0},"maxItems":10,"description":"PWYW: quick-select amounts (max 10)"},"nickname":{"type":"string","maxLength":100,"description":"Display name (e.g., 'Monthly', 'Annual')"},"lookup_key":{"type":"string","maxLength":100,"description":"Stable key for API lookups"},"billing_scheme":{"type":"string","enum":["per_unit","tiered"],"description":"Billing scheme. Defaults to `per_unit`. Set to `tiered` with `tiers_mode` + `tiers` for graduated or volume pricing."},"tiers_mode":{"type":"string","enum":["graduated","volume"],"description":"Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be omitted otherwise."},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/PriceTier"},"minItems":2,"maxItems":50,"description":"Price tiers (ordered by `up_to`, min 2, max 50). Required when `billing_scheme` is `tiered`. Final tier MUST have `up_to: null`."},"transform_quantity":{"$ref":"#/components/schemas/TransformQuantity"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"}},"required":["product_id"],"description":"Parameters for creating a new price. Specify the product, amount, currency, and billing interval."},"TransformQuantity":{"type":"object","properties":{"divide_by":{"type":"integer","exclusiveMinimum":0,"description":"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."},"round":{"type":"string","enum":["up","down"],"description":"Rounding mode when quantity is not an exact multiple of `divide_by`."}},"required":["divide_by","round"],"description":"Optional quantity transform (package pricing) applied before tier lookup."},"UpdatePriceRequest":{"type":"object","properties":{"active":{"type":"boolean","description":"Whether the price is active"},"nickname":{"type":["string","null"],"maxLength":100,"description":"Display name"},"lookup_key":{"type":["string","null"],"maxLength":100,"description":"Stable key for API lookups"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"}},"description":"Parameters for updating an existing price. Amounts cannot be changed — archive and create a new price instead."},"MeterListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Array of meter objects"},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"count":{"type":"number"}},"required":["limit","offset","count"]}},"required":["data","pagination"],"description":"A list of meters for the merchant."},"MeterError":{"type":"object","properties":{"error":{"anyOf":[{"type":"string"},{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"}},"required":["message","type"]}]}},"required":["error"],"description":"Error response returned when a meter operation fails."},"MeterGetResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{},"description":"Meter object"}},"required":["data"],"description":"A single meter object with configuration details."},"CreateMeterResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{},"description":"Created meter object"}},"required":["data"],"description":"The newly created meter object."},"CreateMeterRequest":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable meter name","example":"API Calls"},"event_name":{"type":"string","description":"Event name to match against","example":"api_call"},"aggregation":{"type":"string","enum":["sum","count","count_unique","max","last"],"default":"count","description":"Aggregation method","example":"count"},"slug":{"type":"string","description":"URL-safe identifier","example":"api-calls"},"description":{"type":"string","description":"Meter description"},"value_key":{"type":"string","description":"Property key for sum/max/last aggregations","example":"tokens"},"filter_conditions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Filter conditions for matching events"},"unique_count_key":{"type":"string","description":"Property key for count_unique aggregation"},"unit_name":{"type":"string","description":"Display unit name","example":"calls"},"carry_forward":{"type":"boolean","description":"Carry forward last value across periods"},"metadata":{"type":"object","additionalProperties":{},"description":"Arbitrary key-value metadata"},"alert_thresholds":{"type":"array","items":{"type":"number","minimum":1,"maximum":200},"maxItems":5,"description":"Threshold percentages that trigger usage.threshold.reached webhooks.","example":[50,80,100]}},"required":["name","event_name"],"description":"Parameters for creating a new usage meter with aggregation rules and event matching."},"UpdateMeterResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{},"description":"Updated meter object"}},"required":["data"],"description":"The updated meter object reflecting the changes."},"UpdateMeterRequest":{"type":"object","properties":{"name":{"type":"string","description":"Updated meter name"},"slug":{"type":"string","description":"Updated slug"},"description":{"type":"string","description":"Updated description"},"status":{"type":"string","enum":["active","archived","draft"],"description":"Meter status"},"value_key":{"type":"string","description":"Updated value key"},"filter_conditions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Updated filter conditions"},"unique_count_key":{"type":"string","description":"Updated unique count key"},"unit_name":{"type":"string","description":"Updated unit name"},"carry_forward":{"type":"boolean","description":"Updated carry forward setting"},"metadata":{"type":"object","additionalProperties":{},"description":"Updated metadata"},"alert_thresholds":{"type":"array","items":{"type":"number","minimum":1,"maximum":200},"maxItems":5,"description":"Updated threshold percentages for usage.threshold.reached webhooks.","example":[50,80,100]}},"description":"Parameters for updating an existing meter. Only display name and metadata can be changed."},"MeterPriceResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{},"description":"Price object with tiers"}},"required":["data"],"description":"A single meter price with per-unit cost and billing configuration."},"MeterPriceError":{"type":"object","properties":{"error":{"anyOf":[{"type":"string"},{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"}},"required":["message","type"]}]}},"required":["error"],"description":"Error response returned when a meter price operation fails."},"CreateMeterPriceRequest":{"type":"object","properties":{"pricing_model":{"type":"string","enum":["per_unit","graduated","volume","package"],"description":"Pricing model","example":"per_unit"},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code","example":"GBP"},"unit_amount_minor":{"type":"integer","minimum":0,"description":"Price per unit in minor units (for per_unit)","example":100},"flat_fee_minor":{"type":"integer","minimum":0,"description":"Base charge per period in minor units","example":0},"package_size":{"type":"integer","minimum":1,"description":"Units per package (for package model)","example":100},"cost_per_unit_minor":{"type":"integer","minimum":0,"description":"Merchant's cost per unit for margin intelligence","example":5},"tiers":{"type":"array","items":{"type":"object","properties":{"first_unit":{"type":"integer","minimum":0,"description":"Start of tier range","example":1},"last_unit":{"type":["integer","null"],"minimum":1,"description":"End of tier range (null = unbounded)","example":1000},"unit_amount_minor":{"type":"integer","minimum":0,"description":"Per-unit price in this tier (minor units)","example":10},"flat_amount_minor":{"type":"integer","minimum":0,"description":"Flat fee for entering this tier (minor units)","example":0}},"required":["first_unit","unit_amount_minor"]},"description":"Tier configuration (for graduated and volume)"}},"required":["pricing_model","currency"],"description":"Parameters for creating a price attached to a usage meter, defining per-unit cost and billing thresholds."},"MeterPriceListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Array of price objects"}},"required":["data"],"description":"A list of prices attached to a meter."},"UpdateMeterPriceRequest":{"type":"object","properties":{"unit_amount_minor":{"type":"integer","minimum":0},"flat_fee_minor":{"type":"integer","minimum":0},"package_size":{"type":"integer","minimum":1},"cost_per_unit_minor":{"type":"integer","minimum":0},"tiers":{"type":"array","items":{"type":"object","properties":{"first_unit":{"type":"integer","minimum":0,"description":"Start of tier range","example":1},"last_unit":{"type":["integer","null"],"minimum":1,"description":"End of tier range (null = unbounded)","example":1000},"unit_amount_minor":{"type":"integer","minimum":0,"description":"Per-unit price in this tier (minor units)","example":10},"flat_amount_minor":{"type":"integer","minimum":0,"description":"Flat fee for entering this tier (minor units)","example":0}},"required":["first_unit","unit_amount_minor"]}}},"description":"Parameters for updating a meter price. Active prices on existing subscriptions are not retroactively changed."},"TaxRateListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/TaxRate"}},"has_more":{"type":"boolean"},"total_count":{"type":"integer"}},"required":["object","data","has_more"],"description":"A paginated list of tax rates."},"TaxRate":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the tax rate"},"object":{"type":"string","enum":["tax_rate"],"description":"Object type"},"display_name":{"type":"string","description":"Display name for the tax rate"},"description":{"type":["string","null"],"description":"Description of the tax rate"},"jurisdiction":{"type":["string","null"],"description":"Tax jurisdiction (e.g., 'US-CA', 'DE', 'GB')"},"percentage":{"type":"number","description":"Tax percentage (e.g., 8.25 for 8.25%)"},"inclusive":{"type":"boolean","description":"Whether tax is included in displayed price (EU style)"},"tax_type":{"type":"string","enum":["vat","sales_tax","gst","other"],"description":"Type of tax"},"country":{"type":["string","null"],"description":"ISO country code"},"state":{"type":["string","null"],"description":"State/province code"},"active":{"type":"boolean","description":"Whether the tax rate is active"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","object","display_name","percentage","inclusive","tax_type","active","created_at","updated_at"],"description":"A manually configured tax rate applied to invoices and charges. For automatic tax calculation, use the Quaderno integration instead."},"TaxRateErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Error response returned when a tax rate operation fails."},"CreateTaxRateRequest":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the tax rate"},"description":{"type":"string","maxLength":500,"description":"Description of the tax rate"},"jurisdiction":{"type":"string","maxLength":50,"description":"Tax jurisdiction (e.g., 'US-CA', 'DE', 'GB')"},"percentage":{"type":"number","minimum":0,"maximum":100,"description":"Tax percentage (e.g., 8.25 for 8.25%)"},"inclusive":{"type":"boolean","default":false,"description":"Whether tax is included in displayed price"},"tax_type":{"type":"string","enum":["vat","sales_tax","gst","other"],"default":"vat","description":"Type of tax"},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 2-letter country code"},"state":{"type":"string","maxLength":10,"description":"State/province code"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"}},"required":["display_name","percentage"],"description":"Parameters for creating a new tax rate with a percentage and jurisdiction details."},"UpdateTaxRateRequest":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":100,"description":"Display name for the tax rate"},"description":{"type":["string","null"],"maxLength":500,"description":"Description of the tax rate"},"jurisdiction":{"type":["string","null"],"maxLength":50,"description":"Tax jurisdiction"},"country":{"type":["string","null"],"minLength":2,"maxLength":2,"description":"ISO 2-letter country code"},"state":{"type":["string","null"],"maxLength":10,"description":"State/province code"},"active":{"type":"boolean","description":"Whether the tax rate is active"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"}},"description":"Parameters for updating a tax rate. Active tax rates on existing invoices are not retroactively changed."},"OrderListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"has_more":{"type":"boolean"},"total_count":{"type":"integer"}},"required":["object","data","has_more"],"description":"A paginated list of orders matching the query filters."},"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the order"},"object":{"type":"string","enum":["order"],"description":"Object type"},"public_id":{"type":"string","description":"Public-facing order ID"},"customer_id":{"type":["string","null"],"format":"uuid","description":"ID of the customer"},"status":{"type":"string","enum":["draft","pending","paid","partially_paid","refunded","canceled","fulfilled"],"description":"Order status. draft: Being built. pending: Awaiting payment. paid: Fully paid. partially_paid: Partial payment received. refunded: Refunded. canceled: Canceled. fulfilled: Shipped/delivered."},"billing_type":{"type":"string","enum":["one_time","recurring"],"description":"Billing type. one_time: Single purchase. recurring: Subscription-based."},"fulfillment_status":{"type":["string","null"],"enum":["unfulfilled","partial","fulfilled","returned",null],"description":"Fulfillment status for physical goods."},"currency":{"type":"string","description":"Three-letter ISO currency code"},"subtotal":{"type":"integer","description":"Subtotal in cents"},"discount":{"type":"integer","description":"Total discount in cents"},"tax":{"type":"integer","description":"Total tax in cents"},"total":{"type":"integer","description":"Total amount in cents"},"amount_paid":{"type":"integer","description":"Amount paid in cents"},"amount_refunded":{"type":"integer","description":"Amount refunded in cents"},"amount_due":{"type":"integer","description":"Amount still due in cents"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/OrderLineItem"}},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"notes":{"type":["string","null"]},"invoice_id":{"type":["string","null"],"format":"uuid","description":"ID of the linked invoice (Commercial Truth)"},"subscription_id":{"type":["string","null"],"format":"uuid","description":"ID of the linked subscription (for recurring fulfillment)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"paid_at":{"type":["string","null"],"format":"date-time"},"canceled_at":{"type":["string","null"],"format":"date-time"},"fulfilled_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"}},"required":["id","object","public_id","status","billing_type","currency","subtotal","discount","tax","total","amount_paid","amount_refunded","amount_due","created_at","updated_at"],"description":"An order represents a one-off purchase with lifecycle operations: create, pay, cancel, and fulfill."},"OrderLineItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"product_id":{"type":["string","null"],"format":"uuid"},"description":{"type":"string"},"quantity":{"type":"integer","minimum":1},"unit_price":{"type":"integer","description":"Unit price in cents"},"subtotal":{"type":"integer","description":"Subtotal in cents (unit_price * quantity)"},"discount":{"type":"integer","default":0,"description":"Discount in cents"},"tax":{"type":"integer","default":0,"description":"Tax in cents"},"total":{"type":"integer","description":"Total in cents (subtotal - discount + tax)"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"position":{"type":"integer","default":0}},"required":["id","description","quantity","unit_price","subtotal","total"],"description":"A line item within an order, representing a product, quantity, and unit price."},"OrderErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Error response returned when an order operation fails."},"CreateOrderRequest":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"Customer ID (optional for guest orders)"},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"usd","description":"Three-letter ISO currency code"},"billing_type":{"type":"string","enum":["one_time","recurring"],"default":"one_time","description":"Billing type. one_time: Single purchase. recurring: Subscription-based."},"line_items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","description":"Product ID (optional for ad-hoc items)"},"description":{"type":"string","minLength":1,"maxLength":500},"quantity":{"type":"integer","minimum":1,"default":1},"unit_price":{"type":"integer","minimum":0,"description":"Unit price in cents"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"}},"required":["description","unit_price"]},"minItems":1,"description":"Order line items (at least one required)"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"notes":{"type":"string","maxLength":1000},"expires_at":{"type":"string","format":"date-time","description":"Expiration timestamp for the order"},"invoice_id":{"type":"string","format":"uuid","description":"ID of the linked invoice (Commercial Truth)"},"subscription_id":{"type":"string","format":"uuid","description":"ID of the linked subscription (for recurring fulfillment)"}},"required":["line_items"],"description":"Parameters for creating a new order with line items and customer association."},"UpdateOrderRequest":{"type":"object","properties":{"customer_id":{"type":["string","null"],"format":"uuid"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"notes":{"type":["string","null"],"maxLength":1000}},"description":"Parameters for updating order metadata or notes before fulfillment."},"PayOrderRequest":{"type":"object","properties":{"payment_method_id":{"type":"string","format":"uuid","description":"Saved payment method ID"},"payment_token":{"type":"string","description":"One-time payment token"},"amount":{"type":"integer","minimum":1,"description":"Partial payment amount in cents (defaults to full amount_due)"}},"description":"Parameters for paying an order, specifying the payment method and optional partial amount."},"CancelOrderRequest":{"type":"object","properties":{"reason":{"type":"string","maxLength":500,"description":"Reason for cancellation"}},"description":"Parameters for canceling an order before fulfillment."},"FulfillOrderRequest":{"type":"object","properties":{"tracking_number":{"type":"string","maxLength":100,"description":"Shipping tracking number"},"carrier":{"type":"string","maxLength":50,"description":"Shipping carrier (e.g., 'ups', 'fedex', 'usps')"},"line_item_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Specific line items to fulfill (defaults to all)"},"notify_customer":{"type":"boolean","default":true,"description":"Send fulfillment notification to customer"}},"description":"Parameters for marking an order as fulfilled, with optional tracking and shipping details."},"PaymentListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"has_more":{"type":"boolean"},"total_count":{"type":"integer"}},"required":["object","data","has_more"],"description":"A paginated list of payments matching the query filters."},"Payment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the payment"},"object":{"type":"string","enum":["payment"],"description":"Object type"},"invoice_id":{"type":["string","null"],"format":"uuid","description":"Associated invoice ID"},"customer_id":{"type":["string","null"],"format":"uuid","description":"Customer ID"},"status":{"type":"string","enum":["pending","authorized","captured","succeeded","failed","voided","refunded","partially_refunded"],"description":"Payment status. pending: Processing. authorized: Funds reserved. captured/succeeded: Funds collected. failed: Payment failed. voided: Canceled before capture. refunded/partially_refunded: Returned to customer."},"currency":{"type":"string","description":"Three-letter ISO currency code"},"amount":{"type":"integer","description":"Payment amount in cents"},"amount_captured":{"type":["integer","null"],"description":"Amount captured in cents (for auth-capture flow)"},"amount_refunded":{"type":"integer","default":0,"description":"Amount refunded in cents"},"gateway":{"type":["string","null"],"description":"Name of the payment processor that handled this payment"},"gateway_transaction_id":{"type":["string","null"],"description":"Processor's transaction reference"},"gateway_response_code":{"type":["string","null"],"description":"Normalized response code from the processor"},"gateway_response_text":{"type":["string","null"],"description":"Human-readable response message from the processor"},"payment_method_type":{"type":["string","null"],"description":"Payment method type (card, ach, wallet)"},"card_brand":{"type":["string","null"],"description":"Card brand (visa, mastercard, etc.)"},"card_last_four":{"type":["string","null"],"description":"Last 4 digits of card"},"payment_channel":{"type":["string","null"],"enum":["card_present","card_not_present","bank_transfer","manual",null],"description":"Payment channel. card_present: terminal/POS payment. card_not_present: online or recurring payment. bank_transfer: ACH/direct debit. manual: manually recorded."},"entry_mode":{"type":["string","null"],"enum":["emv_chip","contactless","magnetic_stripe","manual_entry","fallback",null],"description":"Card entry mode for card-present (terminal) payments. null for online payments."},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"authorized_at":{"type":["string","null"],"format":"date-time"},"captured_at":{"type":["string","null"],"format":"date-time"},"voided_at":{"type":["string","null"],"format":"date-time"},"refunded_at":{"type":["string","null"],"format":"date-time"}},"required":["id","object","status","currency","amount","created_at","updated_at"],"description":"A completed or in-progress money movement. Payments represent funds transferred between a customer and your account across all channels — online, terminal, and recurring."},"PaymentErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"}},"required":["type","code","message"]}},"required":["error"],"description":"Error response returned when a payment operation fails."},"CapturePaymentRequest":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"description":"Amount to capture in cents. Defaults to full authorized amount. Must be <= authorized amount."}},"description":"Parameters for capturing a previously authorized payment. Optionally specify a partial capture amount."},"CancelPaymentRequest":{"type":"object","properties":{"reason":{"type":"string","maxLength":500,"description":"Reason for cancellation/void"}},"description":"Parameters for voiding a payment before settlement. Include a reason for your records."},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the webhook endpoint","example":"550e8400-e29b-41d4-a716-446655440000"},"url":{"type":"string","format":"uri","description":"The URL that receives webhook POST requests","example":"https://api.example.com/webhooks/revkeen"},"description":{"type":["string","null"],"description":"Optional human-readable description","example":"Production webhook endpoint"},"enabled_events":{"type":"array","items":{"type":"string"},"description":"Event types this endpoint subscribes to","example":["invoice.paid","payment.succeeded"]},"status":{"type":"string","enum":["enabled","disabled"],"description":"Whether the endpoint is currently receiving events","example":"enabled"},"secret":{"type":"string","description":"Signing secret. Returned only on create or secret rotation.","example":"whsec_0123456789abcdef"},"circuit_breaker_state":{"type":"string","enum":["closed","open","half_open"],"description":"Circuit breaker status. Opens after repeated delivery failures.","example":"closed"},"total_deliveries":{"type":"number","description":"Total number of delivery attempts","example":12},"successful_deliveries":{"type":"number","description":"Number of successful deliveries","example":10},"failed_deliveries":{"type":"number","description":"Number of failed deliveries","example":2},"last_delivery_at":{"type":["string","null"],"description":"Timestamp of the most recent delivery attempt","example":"2026-04-02T10:00:00.000Z"},"created_at":{"type":"string","description":"When the endpoint was created","example":"2026-04-02T10:00:00.000Z"},"updated_at":{"type":"string","description":"When the endpoint was last modified","example":"2026-04-02T10:00:00.000Z"}},"required":["id","url","description","enabled_events","status","circuit_breaker_state","total_deliveries","successful_deliveries","failed_deliveries","last_delivery_at","created_at","updated_at"]},"WebhookDeliveryListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"object":{"type":"string","enum":["webhook_delivery"],"example":"webhook_delivery"},"endpoint_id":{"type":"string","format":"uuid","example":"7c1cbf21-0b6c-4c27-9d60-8a9f0a7e6d91"},"event_id":{"type":"string","format":"uuid","description":"The event this delivery attempted to send.","example":"1f8d9e0b-3a2e-4d9a-b0fe-1c2a3f4d5e6f"},"event_type":{"type":["string","null"],"example":"invoice.paid"},"status":{"type":"string","enum":["pending","succeeded","failed","dead_lettered"],"description":"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."},"attempts":{"type":"integer","example":2},"max_attempts":{"type":"integer","example":8},"last_status_code":{"type":["integer","null"],"description":"HTTP status code returned on the last attempt.","example":502},"last_error":{"type":["string","null"],"description":"Truncated error message from the last failed attempt.","example":"connect ETIMEDOUT"},"last_error_code":{"type":["string","null"],"example":"ETIMEDOUT"},"last_duration_ms":{"type":["integer","null"],"example":1532},"last_attempt_at":{"type":["string","null"],"format":"date-time"},"next_retry_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"dead_lettered_at":{"type":["string","null"],"format":"date-time"},"dead_letter_reason":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","endpoint_id","event_id","event_type","status","attempts","max_attempts","last_status_code","last_error","last_error_code","last_duration_ms","last_attempt_at","next_retry_at","delivered_at","dead_lettered_at","dead_letter_reason","created_at","updated_at"],"description":"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."},"WebhookDeliveryErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["type","code","message"]}},"required":["error"]},"WebhookDeliveryResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"}},"required":["data"]},"WebhookDeliveryRetryResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"}},"required":["data"]},"CustomerPortalErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["type","code","message"]}},"required":["error"]},"CreateCustomerPortalSessionRequest":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"UUID of the customer this session will authenticate as.","example":"cus_a1b2c3d4e5f6"},"ttl_minutes":{"type":"integer","minimum":5,"maximum":240,"description":"Lifetime of the session token in minutes. Between 5 and 240; default 60. Shorter TTLs reduce blast radius if a token leaks.","example":60}},"required":["customer_id"],"description":"Parameters for creating a customer-portal session. The authenticated merchant must already own the referenced customer."},"PortalCustomerResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalCustomer"}},"required":["data"]},"PortalCustomer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","enum":["customer"]},"email":{"type":["string","null"],"format":"email"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"company_name":{"type":["string","null"]},"default_currency":{"type":["string","null"]},"locale":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","email","name","phone","company_name","default_currency","locale","created_at"],"description":"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."},"PortalSubscriptionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/PortalSubscription"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"]},"PortalSubscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","enum":["subscription"]},"status":{"type":"string"},"currency":{"type":["string","null"]},"amount_minor":{"type":["integer","null"]},"interval":{"type":["string","null"]},"interval_count":{"type":["integer","null"]},"current_period_start":{"type":["string","null"],"format":"date-time"},"current_period_end":{"type":["string","null"],"format":"date-time"},"trial_end":{"type":["string","null"],"format":"date-time"},"cancel_at":{"type":["string","null"],"format":"date-time"},"canceled_at":{"type":["string","null"],"format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","status","currency","amount_minor","interval","interval_count","current_period_start","current_period_end","trial_end","cancel_at","canceled_at","started_at","created_at"],"description":"A customer-facing subscription projection. Pricing and cadence fields are exposed; merchant-only bookkeeping fields (plan_id, external IDs) are not."},"PortalSubscriptionResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalSubscription"}},"required":["data"]},"PortalSubscriptionCancelResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalSubscription"}},"required":["data"]},"CancelSubscriptionRequest":{"type":"object","properties":{"cancel_at_period_end":{"type":"boolean","default":true,"description":"If `true` (default), cancel at the end of the current period. If `false`, cancel immediately."},"reason":{"type":"string","maxLength":500,"description":"Merchant-visible note recording why the customer canceled."}}},"PortalInvoiceList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/PortalInvoice"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"]},"PortalInvoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","enum":["invoice"]},"invoice_number":{"type":["string","null"]},"status":{"type":"string"},"currency":{"type":["string","null"]},"subtotal":{"type":["integer","null"]},"tax_amount":{"type":["integer","null"]},"discount_amount":{"type":["integer","null"]},"total":{"type":"integer"},"amount_paid":{"type":["integer","null"]},"amount_due":{"type":["integer","null"]},"invoice_date":{"type":["string","null"],"format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time"},"paid_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","invoice_number","status","currency","subtotal","tax_amount","discount_amount","total","amount_paid","amount_due","invoice_date","due_date","paid_at","created_at"],"description":"A customer-facing invoice projection. Lists and retrievals are scoped to invoices owned by the authenticated customer."},"PortalInvoiceResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PortalInvoice"}},"required":["data"]},"CustomerMeterList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerMeter"}},"has_more":{"type":"boolean","enum":[false],"description":"Customer-meter list responses are not paginated — every meter the merchant has is returned for the specified customer."},"url":{"type":"string"}},"required":["object","data","has_more","url"]},"CustomerMeter":{"type":"object","properties":{"object":{"type":"string","enum":["customer_meter"]},"customer_id":{"type":"string","format":"uuid"},"meter_id":{"type":"string","format":"uuid"},"meter_name":{"type":"string"},"meter_event_name":{"type":"string","description":"The `event_name` the merchant's code posts to /v2/usage-events for this meter.","example":"api_request"},"aggregation":{"type":"string","description":"How quantities are aggregated. Typical values: `sum`, `count`, `max`, `unique`.","example":"sum"},"unit_name":{"type":["string","null"],"description":"Human-readable unit for display (e.g. `tokens`, `requests`, `GB`). Merchant-configurable.","example":"requests"},"total_quantity":{"type":"number","description":"Aggregate across all usage events for this (customer, meter) pair. The aggregation function applied matches the meter's `aggregation` field.","example":4820},"event_count":{"type":"integer","description":"Number of `usage_events` rows that contributed to the aggregate. Diagnostic — not the aggregate itself.","example":412},"last_event_at":{"type":["string","null"],"format":"date-time","description":"Timestamp of the most recent usage event. Null if no events have been recorded."}},"required":["object","customer_id","meter_id","meter_name","meter_event_name","aggregation","unit_name","total_quantity","event_count","last_event_at"],"description":"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."},"CustomerMeterErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["type","code","message"]}},"required":["error"]},"CustomerMeterResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CustomerMeter"}},"required":["data"]},"PaymentIntent":{"type":"object","properties":{"id":{"type":"string","description":"Public payment intent ID (pi_xxx)"},"object":{"type":"string","enum":["payment_intent"],"description":"Object type"},"amount":{"type":"integer","description":"Amount in cents"},"amount_capturable":{"type":"integer","description":"Amount that can be captured (for manual capture)"},"amount_received":{"type":"integer","description":"Amount actually received"},"currency":{"type":"string","description":"Three-letter ISO currency code"},"customer":{"type":"string","format":"uuid","description":"Customer ID"},"description":{"type":["string","null"],"description":"Description for merchant reference"},"last_payment_error":{"type":["object","null"],"properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"decline_code":{"type":"string","description":"Card decline code if applicable"},"payment_method":{"type":"object","properties":{"id":{"type":"string","description":"Payment method ID"},"type":{"type":"string","description":"Payment method type"}},"required":["id","type"],"description":"Payment method that caused the error"}},"required":["code","message"],"description":"Last error from payment attempt"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"next_action":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["redirect_to_url","use_stripe_sdk","display_bank_transfer_instructions"],"description":"Type of action required"},"redirect_to_url":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"URL to redirect customer for 3DS authentication"},"return_url":{"type":"string","format":"uri","description":"URL to return to after 3DS"}},"required":["url","return_url"],"description":"Present when type is redirect_to_url"}},"required":["type"],"description":"Action required from customer (3DS, etc.)"},"payment_method":{"type":["string","null"],"format":"uuid","description":"Payment method ID"},"receipt_email":{"type":["string","null"],"format":"email","description":"Email for receipt"},"statement_descriptor":{"type":["string","null"],"description":"Statement descriptor"},"statement_descriptor_suffix":{"type":["string","null"],"description":"Statement descriptor suffix"},"status":{"type":"string","enum":["requires_payment_method","requires_confirmation","requires_action","processing","succeeded","canceled"],"description":"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."},"capture_method":{"type":"string","enum":["automatic","manual"],"description":"Capture method. automatic: Capture immediately on confirmation. manual: Authorize then capture separately."},"client_secret":{"type":"string","description":"Client secret for frontend confirmation"},"canceled_at":{"type":["string","null"],"format":"date-time","description":"When the intent was canceled"},"cancellation_reason":{"type":["string","null"],"enum":["duplicate","fraudulent","requested_by_customer","abandoned","failed_invoice",null],"description":"Why the intent was canceled"},"created":{"type":"integer","description":"Unix timestamp of creation"},"livemode":{"type":"boolean","description":"Whether in live mode"}},"required":["id","object","amount","amount_capturable","amount_received","currency","customer","status","capture_method","client_secret","created","livemode"],"description":"A PaymentIntent tracks the lifecycle of a payment from creation through authorization, optional 3DS authentication, and final capture."},"PaymentIntentErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","description":"Error type (api_error, invalid_request_error, etc.)"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"param":{"type":"string","description":"Parameter that caused the error"}},"required":["type","code","message"]}},"required":["error"],"description":"Error response returned when a payment intent operation fails."},"CreatePaymentIntentRequest":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"description":"Amount in cents. Must be greater than 0.","example":5000},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD","description":"Three-letter ISO currency code. Defaults to USD.","example":"USD"},"customer":{"type":"string","format":"uuid","description":"Customer ID to charge"},"payment_method":{"type":"string","format":"uuid","description":"Payment method ID. If not provided, status will be requires_payment_method."},"capture_method":{"type":"string","enum":["automatic","manual"],"default":"automatic","description":"Capture method. Defaults to automatic."},"description":{"type":"string","maxLength":500,"description":"Description for merchant reference"},"statement_descriptor":{"type":"string","maxLength":22,"description":"Statement descriptor shown on customer's statement"},"statement_descriptor_suffix":{"type":"string","maxLength":22,"description":"Statement descriptor suffix"},"receipt_email":{"type":"string","format":"email","description":"Email to send receipt to"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"gateway_merchant_id":{"type":"string","description":"Specific gateway merchant ID for multi-MID setups (NMI)"}},"required":["amount","customer"],"description":"Parameters for creating a new payment intent. Specify the amount, currency, customer, and optionally a payment method and capture strategy."},"PaymentIntentListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentIntent"}},"has_more":{"type":"boolean"},"url":{"type":"string","description":"The URL for accessing this list"}},"required":["object","data","has_more","url"],"description":"A paginated list of payment intents matching the query filters."},"UpdatePaymentIntentRequest":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"description":"Amount in cents"},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"Three-letter ISO currency code"},"payment_method":{"type":"string","format":"uuid","description":"Payment method ID"},"description":{"type":"string","maxLength":500,"description":"Description for merchant reference"},"statement_descriptor":{"type":"string","maxLength":22,"description":"Statement descriptor"},"statement_descriptor_suffix":{"type":"string","maxLength":22,"description":"Statement descriptor suffix"},"receipt_email":{"type":"string","format":"email","description":"Email to send receipt to"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"}},"description":"Parameters for updating a payment intent before confirmation. Only amount, description, payment method, and metadata can be changed."},"ConfirmPaymentIntentRequest":{"type":"object","properties":{"payment_method":{"type":"string","format":"uuid","description":"Payment method ID. Required if not already set on the intent."},"return_url":{"type":"string","format":"uri","description":"URL to redirect to after 3DS authentication"}},"description":"Parameters for confirming a payment intent. Optionally attach a payment method and specify a return URL for 3DS flows."},"CapturePaymentIntentRequest":{"type":"object","properties":{"amount_to_capture":{"type":"integer","minimum":1,"description":"Amount to capture in cents. Defaults to full authorized amount."}},"description":"Parameters for capturing a previously authorized payment intent. Specify amount_to_capture for partial captures."},"CancelPaymentIntentRequest":{"type":"object","properties":{"cancellation_reason":{"type":"string","enum":["duplicate","fraudulent","requested_by_customer","abandoned","failed_invoice"],"description":"Reason for cancellation"}},"description":"Parameters for canceling a payment intent that has not yet been captured."},"SetupIntent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the setup intent","example":"550e8400-e29b-41d4-a716-446655440000"},"object":{"type":"string","enum":["setup_intent"],"description":"Object type, always 'setup_intent'"},"public_id":{"type":"string","description":"Public ID visible in API responses (seti_xxx format)","example":"seti_1a2b3c4d5e6f"},"status":{"type":"string","enum":["requires_payment_method","requires_confirmation","requires_action","processing","succeeded","canceled"],"description":"The status of the setup intent","example":"requires_payment_method"},"customer_id":{"type":["string","null"],"format":"uuid","description":"ID of the customer this setup intent is for"},"payment_method_id":{"type":["string","null"],"format":"uuid","description":"ID of the payment method being set up"},"payment_method_types":{"type":"array","items":{"type":"string"},"description":"Allowed payment method types for this setup","example":["card"]},"usage":{"type":"string","enum":["on_session","off_session"],"description":"Indicates how the payment method will be used","example":"off_session"},"next_action":{"$ref":"#/components/schemas/SetupIntentNextAction"},"client_secret":{"type":"string","description":"Client secret for frontend confirmation","example":"seti_1a2b3c4d5e6f_secret_xyz789"},"gateway":{"type":"string","description":"Name of the payment processor that handled this setup intent"},"last_error":{"$ref":"#/components/schemas/SetupIntentError"},"cancellation_reason":{"type":["string","null"],"enum":["abandoned","requested_by_customer","duplicate",null],"description":"Reason for cancellation if canceled","example":"requested_by_customer"},"description":{"type":["string","null"],"description":"Merchant description for reference"},"metadata":{"type":"object","additionalProperties":{},"description":"Custom metadata attached to the setup intent"},"confirmed_at":{"type":["string","null"],"format":"date-time","description":"When the setup intent was confirmed"},"canceled_at":{"type":["string","null"],"format":"date-time","description":"When the setup intent was canceled"},"created_at":{"type":"string","format":"date-time","description":"When the setup intent was created"},"updated_at":{"type":"string","format":"date-time","description":"When the setup intent was last updated"}},"required":["id","object","public_id","status","customer_id","payment_method_id","payment_method_types","usage","next_action","client_secret","gateway","last_error","cancellation_reason","description","metadata","confirmed_at","canceled_at","created_at","updated_at"],"description":"A SetupIntent saves a payment method for future use WITHOUT charging the customer. Use it to collect and verify card details before storing them."},"SetupIntentNextAction":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["redirect_to_url","use_stripe_sdk"],"description":"The type of action to take"},"redirect_to_url":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL to redirect the customer to"},"return_url":{"type":"string","format":"uri","description":"The URL to redirect back to after completion"}},"required":["url","return_url"],"description":"Redirect details for 3DS authentication"},"use_stripe_sdk":{"type":"object","additionalProperties":{},"description":"SDK-specific data for client-side handling"}},"required":["type"],"description":"Action required from customer (3DS redirect, etc.)"},"SetupIntentError":{"type":["object","null"],"properties":{"code":{"type":"string","description":"Error code","example":"authentication_failed"},"message":{"type":"string","description":"Human-readable error message","example":"3DS authentication failed"},"decline_code":{"type":"string","description":"Decline code from the payment gateway","example":"authentication_required"},"payment_method":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"],"description":"The payment method that caused the error"}},"required":["code","message"],"description":"Last error encountered during setup"},"CreateSetupIntentRequest":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"ID of the customer to attach the payment method to","example":"550e8400-e29b-41d4-a716-446655440000"},"payment_method_types":{"type":"array","items":{"type":"string"},"default":["card"],"description":"Allowed payment method types","example":["card"]},"usage":{"type":"string","enum":["on_session","off_session"],"default":"off_session","description":"How the payment method will be used","example":"off_session"},"description":{"type":"string","description":"Merchant description for reference","example":"Saving card for subscription payments"},"metadata":{"type":"object","additionalProperties":{},"description":"Custom metadata to attach","example":{"source":"checkout"}}},"description":"Parameters for creating a setup intent to save a payment method for a customer."},"SetupIntentList":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"description":"Object type, always 'list'"},"data":{"type":"array","items":{"$ref":"#/components/schemas/SetupIntent"},"description":"Array of setup intents"},"has_more":{"type":"boolean","description":"Whether there are more results available"},"total_count":{"type":"integer","description":"Total count of matching setup intents"},"url":{"type":"string","description":"URL for this list resource","example":"/v2/setup-intents"}},"required":["object","data","has_more","total_count","url"],"description":"A paginated list of setup intents matching the query filters."},"UpdateSetupIntentRequest":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"ID of the customer to attach the payment method to"},"payment_method_types":{"type":"array","items":{"type":"string"},"description":"Allowed payment method types"},"description":{"type":"string","description":"Merchant description for reference"},"metadata":{"type":"object","additionalProperties":{},"description":"Custom metadata to attach"}},"description":"Parameters for updating a setup intent before confirmation."},"ConfirmSetupIntentRequest":{"type":"object","properties":{"payment_method_id":{"type":"string","format":"uuid","description":"ID of the payment method to confirm with","example":"550e8400-e29b-41d4-a716-446655440000"},"return_url":{"type":"string","format":"uri","description":"URL to redirect to after 3DS authentication","example":"https://example.com/setup/complete"}},"description":"Parameters for confirming a setup intent, which verifies the payment method and saves it for future use."},"CancelSetupIntentRequest":{"type":"object","properties":{"cancellation_reason":{"type":"string","enum":["abandoned","requested_by_customer","duplicate"],"description":"Reason for cancellation","example":"requested_by_customer"}},"description":"Parameters for canceling a setup intent that is no longer needed."},"PaymentMethodList":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"description":"Object type, always 'list'"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"},"description":"Array of payment methods"},"has_more":{"type":"boolean","description":"Whether there are more results available"},"url":{"type":"string","description":"URL for this list resource","example":"/v2/payment-methods"}},"required":["object","data","has_more","url"],"description":"A list of payment methods attached to a customer, with optional type filtering."},"UpdatePaymentMethodRequest":{"type":"object","properties":{"billing_details":{"allOf":[{"$ref":"#/components/schemas/BillingDetails"},{"description":"Updated billing details"}]},"metadata":{"type":"object","additionalProperties":{},"description":"Custom metadata to attach"}},"description":"Parameters for updating a payment method's billing details or metadata."},"AttachPaymentMethodRequest":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"ID of the customer to attach the payment method to","example":"550e8400-e29b-41d4-a716-446655440000"}},"required":["customer_id"],"description":"Parameters for attaching a payment method to a customer. The payment method must have been created first."},"EventListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"has_more":{"type":"boolean"},"url":{"type":"string","description":"The URL for accessing this list"}},"required":["object","data","has_more","url"],"description":"A paginated list of events matching the query filters."},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique event identifier"},"object":{"type":"string","enum":["event"],"description":"Object type"},"type":{"type":"string","description":"Event type (e.g., invoice.paid, payment.succeeded)","example":"invoice.paid"},"data":{"type":"object","properties":{"object":{"description":"The object that triggered the event (invoice, payment, etc.)"},"previous_attributes":{"description":"Previous values of attributes that changed (for update events)"}},"description":"Event data containing the affected object"},"request":{"$ref":"#/components/schemas/EventRequest"},"pending_webhooks":{"type":"integer","description":"Number of webhooks still pending delivery for this event","example":0},"api_version":{"type":["string","null"],"description":"API version used to render this event","example":"2026-01-15"},"livemode":{"type":"boolean","description":"Whether this event was produced in live mode","example":true},"created":{"type":"integer","description":"Unix timestamp when the event was created","example":1704067200}},"required":["id","object","type","data","request","pending_webhooks","api_version","livemode","created"],"description":"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."},"EventRequest":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"description":"Request ID that triggered this event (if applicable)"},"idempotency_key":{"type":["string","null"],"description":"Idempotency key used in the request (if applicable)"}},"required":["id","idempotency_key"],"description":"Information about the request that triggered this event"},"EventErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","description":"Error type"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"param":{"type":"string","description":"Parameter that caused the error"}},"required":["type","code","message"]}},"required":["error"],"description":"Error response returned when an event operation fails."},"ResendWebhookResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the webhook was queued for resending"},"webhook_endpoint_id":{"type":"string","format":"uuid","description":"The webhook endpoint ID the event was sent to"},"message":{"type":"string","description":"Additional information"}},"required":["success"],"description":"Confirmation that a webhook event was resent to the specified endpoint."},"TestEventResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the test event was created"},"event":{"allOf":[{"$ref":"#/components/schemas/Event"},{"description":"The created test event"}]},"message":{"type":"string","description":"Additional information"}},"required":["success"],"description":"The test event that was sent, including delivery status."},"CreateTestEventRequest":{"type":"object","properties":{"type":{"type":"string","enum":["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"],"description":"The type of test event to create","example":"invoice.paid"}},"required":["type"],"description":"Parameters for creating a test event to verify your webhook endpoint integration."},"SubscriptionSchedule":{"type":"object","properties":{"id":{"type":"string","description":"Public schedule ID (sub_sched_xxx)"},"object":{"type":"string","enum":["subscription_schedule"],"description":"Object type"},"status":{"type":"string","enum":["not_started","active","completed","canceled","released"],"description":"Schedule status. not_started: Scheduled for future. active: Currently executing phases. completed: All phases finished. canceled: Manually canceled. released: Detached from subscription."},"customer":{"type":["string","null"],"format":"uuid","description":"Customer ID"},"subscription":{"type":["string","null"],"format":"uuid","description":"Linked subscription ID"},"current_phase":{"type":["object","null"],"properties":{"start_date":{"type":"integer","description":"Phase start (Unix timestamp)"},"end_date":{"type":["integer","null"],"description":"Phase end (Unix timestamp)"}},"required":["start_date","end_date"],"description":"Current phase being executed"},"phases":{"type":"array","items":{"$ref":"#/components/schemas/SchedulePhase"},"description":"All phases in the schedule"},"end_behavior":{"type":"string","enum":["cancel","release"],"description":"What happens when the schedule completes. cancel: Cancel the subscription. release: Make subscription standalone."},"released_at":{"type":["integer","null"],"description":"When released (Unix timestamp)"},"released_subscription":{"type":["string","null"],"format":"uuid","description":"Subscription ID at release time"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom metadata"},"created":{"type":"integer","description":"Unix timestamp of creation"},"livemode":{"type":"boolean","description":"Whether in live mode"}},"required":["id","object","status","customer","subscription","current_phase","phases","end_behavior","created","livemode"],"description":"A subscription schedule defines future changes to a subscription. Each phase specifies different pricing, quantities, or plans that take effect at specified dates."},"SchedulePhase":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PhaseItem"},"minItems":1,"description":"Products/prices included in this phase"},"start_date":{"type":"string","description":"When this phase starts (ISO 8601 date)","example":"2026-03-01T00:00:00Z"},"end_date":{"type":["string","null"],"description":"When this phase ends (null for indefinite)","example":"2026-06-01T00:00:00Z"},"proration_behavior":{"type":"string","enum":["create_prorations","none","always_invoice"],"description":"How to handle prorations when entering this phase"},"billing_cycle_anchor":{"type":["string","null"],"description":"Override billing cycle anchor for this phase"},"default_payment_method":{"type":["string","null"],"format":"uuid","description":"Payment method to use for this phase"},"collection_method":{"type":"string","enum":["charge_automatically","send_invoice"],"description":"How to collect payment for this phase"},"coupon":{"type":["string","null"],"description":"Coupon code to apply during this phase"},"trial_end":{"type":["string","null"],"description":"End of trial period (if applicable)"},"metadata":{"type":"object","additionalProperties":true,"description":"Phase-specific metadata"}},"required":["items","start_date"],"description":"A time-bounded phase within a subscription schedule, with its own pricing, quantities, and billing configuration."},"PhaseItem":{"type":"object","properties":{"price_id":{"type":"string","format":"uuid","description":"Price ID for this item"},"quantity":{"type":"integer","minimum":1,"default":1,"description":"Quantity of this item"}},"required":["price_id"],"description":"A product-price pair within a schedule phase, defining what the customer is billed for during that phase."},"SubscriptionScheduleErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","description":"Error type"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"param":{"type":"string","description":"Parameter that caused the error"}},"required":["type","code","message"]}},"required":["error"],"description":"Error response returned when a subscription schedule operation fails."},"CreateSubscriptionScheduleRequest":{"type":"object","properties":{"customer":{"type":"string","format":"uuid","description":"Customer ID (required if no subscription)"},"subscription":{"type":"string","format":"uuid","description":"Existing subscription to attach schedule to"},"start_date":{"anyOf":[{"type":"string","enum":["now"]},{"type":"string","format":"date-time"},{"type":"integer"}],"description":"When schedule starts. 'now', ISO date, or Unix timestamp. Defaults to now.","example":"now"},"phases":{"type":"array","items":{"$ref":"#/components/schemas/SchedulePhase"},"minItems":1,"description":"Phases defining the schedule (at least one required)"},"end_behavior":{"type":"string","enum":["cancel","release"],"default":"cancel","description":"What happens when all phases complete"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom metadata"}},"required":["phases"],"description":"Parameters for creating a subscription schedule with one or more phases of pricing and billing changes."},"SubscriptionScheduleListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionSchedule"}},"has_more":{"type":"boolean"},"url":{"type":"string","description":"The URL for accessing this list"}},"required":["object","data","has_more","url"],"description":"A paginated list of subscription schedules matching the query filters."},"UpdateSubscriptionScheduleRequest":{"type":"object","properties":{"phases":{"type":"array","items":{"$ref":"#/components/schemas/SchedulePhase"},"minItems":1,"description":"Replace all phases"},"end_behavior":{"type":"string","enum":["cancel","release"],"description":"What happens when all phases complete"},"proration_behavior":{"type":"string","enum":["create_prorations","none","always_invoice"],"description":"Proration behavior when updating phases"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom metadata"}},"description":"Parameters for updating a subscription schedule's phases before they take effect."},"CancelSubscriptionScheduleRequest":{"type":"object","properties":{"invoice_now":{"type":"boolean","description":"Generate a final invoice immediately"},"prorate":{"type":"boolean","description":"Prorate final invoice"}},"description":"Parameters for canceling a subscription schedule, optionally reverting the subscription to its pre-schedule state."},"ReleaseSubscriptionScheduleRequest":{"type":"object","properties":{"preserve_cancel_date":{"type":"boolean","description":"Keep the subscription's cancel_at date if set"}},"description":"Parameters for releasing a subscription schedule, detaching it from the subscription while keeping current terms."},"TerminalPaymentResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TerminalPayment"}},"required":["data"],"description":"A single terminal payment object with full device and transaction details."},"TerminalPayment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this terminal payment attempt"},"invoice_id":{"type":["string","null"],"format":"uuid","description":"Associated invoice ID, or null for walk-in/ad-hoc payments"},"device_id":{"type":["string","null"],"format":"uuid","description":"The terminal device that processed (or is processing) this payment"},"type":{"type":"string","enum":["sale","refund","void"],"description":"Transaction type. sale: original charge. refund: money returned. void: pre-settlement cancellation."},"status":{"type":"string","enum":["requested","in_progress","approved","declined","cancelled","error","timed_out","standalone_approved","standalone_declined"],"description":"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."},"amount_minor":{"type":"number","description":"Amount in minor units (e.g., pence for GBP, cents for USD)"},"currency":{"type":"string","description":"ISO 4217 currency code"},"reference":{"type":["string","null"],"description":"Payment reference (invoice number or custom reference)"},"terminal_serial":{"type":["string","null"],"description":"Serial number of the PAX terminal that processed this payment"},"uti":{"type":["string","null"],"description":"Unique Transaction Identifier from the terminal"},"auth_code":{"type":["string","null"],"description":"Authorization code from the payment processor. Present when approved."},"response_code":{"type":["string","null"],"description":"Terminal response code. '00' indicates approval."},"rrn":{"type":["string","null"],"description":"Retrieval Reference Number for settlement reconciliation"},"card_scheme":{"type":["string","null"],"description":"Card network (e.g., VISA, MASTERCARD, AMEX)"},"masked_pan":{"type":["string","null"],"description":"Masked card number — only the last 4 digits are visible"},"entry_mode":{"type":["string","null"],"description":"How the card was read: contactless (NFC tap), emv_chip (chip insert), magnetic_stripe (swipe), manual_entry (keyed), or fallback (chip-to-swipe)"},"error_message":{"type":["string","null"],"description":"Human-readable error message when status is error or timed_out"},"created_at":{"type":"string","description":"ISO 8601 timestamp when the payment was initiated"},"completed_at":{"type":["string","null"],"description":"ISO 8601 timestamp when the terminal returned a result, or null if still in progress"}},"required":["id","invoice_id","device_id","type","status","amount_minor","currency","reference","terminal_serial","uti","auth_code","response_code","rrn","card_scheme","masked_pan","entry_mode","error_message","created_at","completed_at"],"description":"A card-present payment processed through a POS terminal, with device details and card entry mode."},"TerminalPaymentErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}},"required":["error"],"description":"Error response returned when a terminal payment operation fails."},"CreateTerminalPaymentRequest":{"type":"object","properties":{"device_id":{"type":"string","format":"uuid","description":"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.","example":"d1e2f3a4-b5c6-7890-abcd-ef1234567890"},"amount_minor":{"type":"integer","exclusiveMinimum":0,"description":"Amount in minor units (e.g., pence for GBP, cents for USD)","example":5000},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 currency code","example":"GBP"},"invoice_id":{"type":"string","format":"uuid","description":"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."},"reference":{"type":"string","maxLength":200,"description":"Custom reference for the payment. Auto-generated if not provided.","example":"walk-in-sale-001"}},"required":["device_id","amount_minor","currency"],"description":"Parameters for initiating a card-present payment on a POS terminal device."},"TerminalPaymentListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TerminalPayment"}},"meta":{"type":"object","properties":{"count":{"type":"number"},"limit":{"type":"number"}},"required":["count","limit"]}},"required":["data","meta"],"description":"A paginated list of terminal payments matching the query filters."},"RefundTerminalPaymentRequest":{"type":"object","properties":{"amount_minor":{"type":"integer","exclusiveMinimum":0,"description":"Amount to refund in minor units. Omit for a full refund.","example":2500},"reason":{"type":"string","maxLength":500,"description":"Reason for the refund","example":"Customer return"}},"description":"Parameters for refunding a completed terminal payment, optionally specifying a partial amount."},"VoidTerminalPaymentRequest":{"type":"object","properties":{"reason":{"type":"string","maxLength":500,"description":"Reason for the void","example":"Duplicate charge"}},"description":"Parameters for voiding an unsettled terminal payment before end-of-day settlement."},"TerminalDeviceListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TerminalDevice"}},"meta":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["data","meta"],"description":"A list of terminal devices registered for your merchant account."},"TerminalDevice":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for this terminal device. Use this as the device_id when initiating payments."},"device_name":{"type":["string","null"],"description":"Friendly name assigned to this device (e.g., 'Front Desk Terminal')"},"terminal_serial":{"type":["string","null"],"description":"Serial number of the paired PAX terminal hardware"},"terminal_ip":{"type":["string","null"],"description":"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."},"platform":{"type":["string","null"],"enum":["macos","windows","linux",null],"description":"Operating system of the machine running the Terminal Connector application"},"status":{"type":"string","enum":["online","offline","pairing"],"description":"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."},"terminal_paired":{"type":"boolean","description":"Whether a PAX terminal has been paired to this connector device. Must be true to accept payments."},"terminal_reachable":{"type":["boolean","null"],"description":"Whether the connector can currently reach the PAX terminal on the local network"},"app_version":{"type":["string","null"],"description":"Version of the Terminal Connector application"},"last_heartbeat_at":{"type":["string","null"],"description":"ISO 8601 timestamp of the last heartbeat received from this device. Devices with no heartbeat in 5 minutes are considered offline."}},"required":["id","device_name","terminal_serial","terminal_ip","platform","status","terminal_paired","terminal_reachable","app_version","last_heartbeat_at"],"description":"A POS terminal device registered to your merchant account, with connection status and capabilities."},"TerminalDeviceErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"description":"Error response returned when a terminal device operation fails."},"TerminalDeviceResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TerminalDevice"}},"required":["data"],"description":"A single terminal device with connection status and configuration details."},"BatchIngestResult":{"type":"object","properties":{"object":{"type":"string","enum":["usage_event_batch_result"]},"summary":{"type":"object","properties":{"ingested":{"type":"number"},"duplicate":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"}},"required":["ingested","duplicate","skipped","failed"]},"data":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"status":{"type":"string","enum":["ingested","duplicate","skipped","failed"]},"id":{"type":"string"},"reason":{"type":"string"}},"required":["index","status"]}}},"required":["object","summary","data"],"description":"Result of a batch ingest operation showing how many events were accepted and any that were rejected."},"UsageEventError":{"type":"object","properties":{"error":{"anyOf":[{"type":"string"},{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"}},"required":["message","type"]}]}},"required":["error"],"description":"Error response returned when a usage event operation fails."},"BatchIngestRequest":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/UsageEvent"},"minItems":1,"maxItems":1000,"description":"Array of usage events (1–1000)"}},"required":["events"],"description":"A batch of usage events to ingest, supporting up to 1000 events per request."},"UsageEvent":{"type":"object","properties":{"name":{"type":"string","description":"Event name matching a meter's event_name","example":"api_call"},"customer_id":{"type":"string","description":"RevKeen customer ID"},"external_customer_id":{"type":"string","description":"Your external customer identifier","example":"usr_123"},"subscription_id":{"type":"string","description":"Subscription ID to attribute usage to"},"meter_id":{"type":"string","description":"Direct meter ID (alternative to event name matching)"},"quantity":{"type":"number","default":1,"description":"Event quantity (default: 1)","example":1},"timestamp":{"type":"string","description":"ISO 8601 timestamp (default: now)","example":"2026-03-14T10:30:00Z"},"idempotency_key":{"type":"string","description":"Unique key for deduplication","example":"evt_unique_123"},"metadata":{"type":"object","additionalProperties":{},"description":"Arbitrary properties for filtering and aggregation"}},"required":["name"],"description":"A single usage event representing customer consumption of a metered resource."},"DryRunResult":{"type":"object","properties":{"object":{"type":"string","enum":["usage_event_dry_run_result"]},"summary":{"type":"object","properties":{"would_ingest":{"type":"number"},"would_skip":{"type":"number"},"would_fail":{"type":"number"}},"required":["would_ingest","would_skip","would_fail"]},"data":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"status":{"type":"string","enum":["would_ingest","would_skip","would_fail"]},"validationDetails":{"type":"object","properties":{"meterMatched":{"type":"boolean"},"customerMatched":{"type":"boolean"},"billableQuantity":{"type":"number"},"filtersPassed":{"type":"boolean"}},"required":["meterMatched","customerMatched","billableQuantity","filtersPassed"]},"reason":{"type":"string"}},"required":["index","status","validationDetails"]}}},"required":["object","summary","data"],"description":"Result of a dry-run ingest showing how events would be matched to meters without persisting them."},"UsageEventListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Array of usage event objects"},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"description":"A paginated list of usage events matching the query filters."},"UsageAggregateResponse":{"type":"object","properties":{"object":{"type":"string","enum":["usage_aggregate"]},"meter_id":{"type":"string"},"start_time":{"type":"string"},"end_time":{"type":"string"},"value":{"type":"number","description":"Aggregated usage value"},"event_count":{"type":"number","description":"Number of events in range"}},"required":["object","meter_id","start_time","end_time","value","event_count"],"description":"Aggregated usage totals grouped by meter and time period."},"UsageBalanceResponse":{"type":"object","properties":{"object":{"type":"string","enum":["usage_balance"]},"meters":{"type":"array","items":{"$ref":"#/components/schemas/UsageBalanceMeter"}},"total_estimated_amount_minor":{"type":"number","description":"Total estimated charge across all meters","example":2500},"total_cost_minor":{"type":["number","null"],"description":"Total cost across all meters (null if no cost data)"},"currency":{"type":"string","description":"Currency code","example":"usd"}},"required":["object","meters","total_estimated_amount_minor","total_cost_minor","currency"],"description":"Current-period usage balance across all meters for a customer, with per-meter breakdowns and estimated totals."},"UsageBalanceMeter":{"type":"object","properties":{"meter_id":{"type":"string","description":"Meter ID","example":"mtr_abc123"},"meter_name":{"type":"string","description":"Meter display name","example":"API Calls"},"unit_name":{"type":["string","null"],"description":"Unit display name","example":"calls"},"current_value":{"type":"number","description":"Aggregated usage in current period","example":1250},"included_quantity":{"type":"number","description":"Units included in plan (0 if pure metered)","example":1000},"used_quantity":{"type":"number","description":"Usage consumed (same as current_value)","example":1250},"remaining_included":{"type":"number","description":"Remaining included units (max 0)","example":0},"overage_quantity":{"type":"number","description":"Units over allowance (max 0)","example":250},"estimated_amount_minor":{"type":"number","description":"Estimated charge for overage in minor units","example":2500},"total_cost_minor":{"type":["number","null"],"description":"Sum of event cost annotations (null if no cost data)"},"margin_minor":{"type":["number","null"],"description":"Estimated margin: revenue - cost (null if no cost data)"},"currency":{"type":"string","description":"Currency code","example":"usd"},"period_start":{"type":"string","description":"Current billing period start (ISO 8601)","example":"2026-03-01T00:00:00.000Z"},"period_end":{"type":"string","description":"Current billing period end (ISO 8601)","example":"2026-03-31T23:59:59.999Z"}},"required":["meter_id","meter_name","unit_name","current_value","included_quantity","used_quantity","remaining_included","overage_quantity","estimated_amount_minor","total_cost_minor","margin_minor","currency","period_start","period_end"],"description":"Current-period usage for a single meter, including consumed units, included allowance, overage, and estimated cost."},"EntitlementListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Entitlement"}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["limit","offset","total"]},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","email","name"]}},"required":["data","pagination","customer"]},"Entitlement":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"benefitId":{"type":"string","format":"uuid"},"benefit":{"$ref":"#/components/schemas/Benefit"},"grantedAt":{"type":"string","format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["active","trialing","grace","past_due","restricted","suspended","canceled"]},"hasAccess":{"type":"boolean"},"accessLevel":{"type":"string","enum":["full","partial","none"]},"subscriptionId":{"type":["string","null"],"format":"uuid"},"subscriptionStatus":{"type":["string","null"]}},"required":["id","customerId","benefitId","benefit","grantedAt","expiresAt","metadata","status","hasAccess","accessLevel","subscriptionId","subscriptionStatus"]},"Benefit":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"benefitType":{"type":"string"},"benefitKey":{"type":"string"},"category":{"type":["string","null"]},"iconUrl":{"type":["string","null"]},"displayOrder":{"type":["string","null"]},"isActive":{"type":["boolean","null"]},"defaultValue":{},"config":{}},"required":["id","name","description","benefitType","benefitKey","category","iconUrl","displayOrder","isActive"]},"EntitlementCheckResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EntitlementCheck"}},"required":["data"]},"EntitlementCheck":{"type":"object","properties":{"benefitKey":{"type":"string"},"hasAccess":{"type":"boolean"},"accessLevel":{"type":"string","enum":["full","partial","none"]},"status":{"type":["string","null"],"enum":["active","trialing","grace","past_due","restricted","suspended","canceled",null]},"benefit":{"$ref":"#/components/schemas/Benefit"},"reason":{"type":["string","null"]}},"required":["benefitKey","hasAccess","accessLevel","status","benefit","reason"]},"TransactionListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"has_more":{"type":"boolean"},"total_count":{"type":"integer"}},"required":["object","data","has_more"],"description":"A paginated list of transactions matching the query filters."},"Transaction":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the transaction"},"object":{"type":"string","enum":["transaction"],"description":"Object type"},"type":{"type":"string","enum":["sale","refund","void","capture","dispute","adjustment"],"description":"Transaction type. sale: original payment. refund: money returned. void: cancel before settlement. capture: capture a previous auth. dispute: chargeback. adjustment: manual correction."},"status":{"type":"string","enum":["pending","succeeded","failed","voided"],"description":"Transaction status. pending: processing. succeeded: completed. failed: declined or errored. voided: canceled."},"invoice_id":{"type":"string","format":"uuid","description":"Associated invoice ID"},"customer_id":{"type":["string","null"],"format":"uuid","description":"Customer ID"},"parent_transaction_id":{"type":["string","null"],"format":"uuid","description":"Parent transaction ID (required for refunds, voids, disputes, adjustments)"},"currency":{"type":"string","description":"Three-letter ISO currency code"},"amount":{"type":"integer","description":"Transaction amount in minor units (cents)"},"amount_refunded":{"type":"integer","default":0,"description":"Amount refunded in minor units"},"gateway":{"type":["string","null"],"description":"Payment gateway (e.g., 'nmi')"},"gateway_transaction_id":{"type":["string","null"],"description":"Gateway's transaction reference"},"gateway_response_code":{"type":["string","null"],"description":"Gateway response code"},"gateway_response_text":{"type":["string","null"],"description":"Gateway response message"},"payment_method_type":{"type":["string","null"],"description":"Payment method type (card, ach, wallet)"},"card_brand":{"type":["string","null"],"description":"Card brand (visa, mastercard, etc.)"},"card_last_four":{"type":["string","null"],"description":"Last 4 digits of card"},"metadata":{"type":"object","additionalProperties":true,"description":"Custom key-value metadata"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp (ISO 8601)"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp (ISO 8601)"}},"required":["id","object","type","status","invoice_id","currency","amount","created_at","updated_at"],"description":"A financial movement in the unified transaction model. Every money movement — payments, refunds, voids, disputes — is recorded as a transaction linked to an invoice."},"TransactionRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}},"required":["data"],"description":"A single transaction object."},"ExportCreateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Export"}},"required":["data"],"description":"The created export job in 'pending' status."},"Export":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique export job ID"},"object":{"type":"string","enum":["export"],"description":"Object type"},"status":{"type":"string","enum":["pending","processing","completed","failed"],"description":"Export job status. pending: queued. processing: generating file. completed: ready for download. failed: export failed."},"resource_type":{"type":"string","enum":["customers","invoices","transactions","subscriptions","products","payment_methods"],"description":"The type of resource to export."},"format":{"type":"string","enum":["csv","xlsx"],"description":"Output file format. csv: Comma-separated values. xlsx: Excel workbook."},"download_url":{"type":["string","null"],"format":"uri","description":"Presigned download URL (available when status is 'completed'). Expires after 1 hour."},"total_rows":{"type":["integer","null"],"description":"Total rows exported (available when completed)"},"file_size_bytes":{"type":["integer","null"],"description":"File size in bytes (available when completed)"},"error_message":{"type":["string","null"],"description":"Error message (if status is 'failed')"},"created_at":{"type":"string","format":"date-time","description":"When the export was requested (ISO 8601)"},"completed_at":{"type":["string","null"],"format":"date-time","description":"When the export completed (ISO 8601)"}},"required":["id","object","status","resource_type","format","created_at"],"description":"An async data export job. Create an export, poll for completion, then download the file via the presigned URL."},"CreateExportRequest":{"type":"object","properties":{"resource_type":{"type":"string","enum":["customers","invoices","transactions","subscriptions","products","payment_methods"],"description":"The type of resource to export."},"format":{"type":"string","enum":["csv","xlsx"],"default":"csv","description":"Output file format. csv: Comma-separated values. xlsx: Excel workbook."},"filters":{"type":"object","additionalProperties":true,"description":"Filters to apply (e.g., { status: 'paid', created_gte: '2024-01-01' })"},"column_set":{"type":"string","enum":["standard","full","minimal"],"default":"standard","description":"Column set to include. standard: common fields. full: all fields. minimal: IDs and key fields only."}},"required":["resource_type"],"description":"Parameters for creating an async data export. The export is processed in the background — poll GET /v2/exports/:id for status."},"ExportRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Export"}},"required":["data"],"description":"Export job status and details."},"ImportCreateResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Import"}},"required":["data"],"description":"The created import job in 'pending' status."},"Import":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique import job ID"},"object":{"type":"string","enum":["import"],"description":"Object type"},"status":{"type":"string","enum":["pending","validating","processing","completed","completed_with_errors","failed"],"description":"Import job status. pending: queued. validating: checking data. processing: creating records. completed: all rows imported. completed_with_errors: some rows failed. failed: import aborted."},"resource_type":{"type":"string","enum":["customers","products","invoices"],"description":"The type of resource to import."},"total_rows":{"type":["integer","null"],"description":"Total rows in the uploaded file"},"processed_rows":{"type":["integer","null"],"description":"Number of rows processed so far"},"success_count":{"type":["integer","null"],"description":"Number of rows successfully imported"},"error_count":{"type":["integer","null"],"description":"Number of rows that failed"},"errors":{"type":["array","null"],"items":{"type":"object","properties":{"row":{"type":"integer","description":"Row number (1-based)"},"field":{"type":"string","description":"Field that caused the error"},"message":{"type":"string","description":"Error message"}},"required":["row","message"]},"description":"Detailed error information for failed rows"},"created_at":{"type":"string","format":"date-time","description":"When the import was created (ISO 8601)"},"completed_at":{"type":["string","null"],"format":"date-time","description":"When the import completed (ISO 8601)"}},"required":["id","object","status","resource_type","created_at"],"description":"An async data import job. Upload a CSV file to create records in bulk. Poll GET /v2/imports/:id for status and error details."},"CreateImportRequest":{"type":"object","properties":{"resource_type":{"type":"string","enum":["customers","products","invoices"],"description":"The type of resource to import."},"file_url":{"type":"string","format":"uri","description":"URL to the CSV file to import (if not using multipart upload)"},"column_mapping":{"type":"object","additionalProperties":true,"description":"Map CSV column names to resource fields (e.g., { 'Email Address': 'email', 'Full Name': 'name' })"},"on_duplicate":{"type":"string","enum":["skip","update","error"],"default":"skip","description":"Behavior when a duplicate record is found. skip: ignore the row. update: merge new data. error: fail the row."}},"required":["resource_type"],"description":"Parameters for creating a bulk data import. Either provide a file_url or upload the CSV via multipart form data."},"ImportRetrieveResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Import"}},"required":["data"],"description":"Import job status and progress."}},"parameters":{}},"tags":[{"name":"Automations","description":"Saved Assistant automations and queued runs. Use these endpoints to list automations, retrieve the current immutable definition, create new automations, and queue manual executions.\n\n**Required Scopes:**\n- `automations:read` - List and retrieve automations\n- `automations:write` - Create automations and queue runs","x-displayName":"Automations"},{"name":"Payment Intents","description":"Payment Intents represent the intent to collect payment. They support 3DS/SCA authentication, manual capture, and provide a client secret for frontend confirmation.\n\n**Required Scopes:**\n- `payment_intents:read` - List and retrieve payment intents\n- `payment_intents:write` - Create, confirm, capture, cancel payment intents\n\n**MCP Tools:** `payments_list`, `payments_get`, `payments_capture`","x-displayName":"Payment Intents"},{"name":"Setup Intents","description":"Setup Intents save payment methods WITHOUT charging. Use them to collect card details for future use (subscriptions, saved cards) or to verify cards with 3DS/SCA before storing.\n\n**Required Scopes:**\n- `setup_intents:read` - List and retrieve setup intents\n- `setup_intents:write` - Create, confirm, cancel setup intents\n\n**MCP Tools:** Available via `customers_*` tools","x-displayName":"Setup Intents"},{"name":"Payment Methods","description":"Payment Methods represent a customer's saved payment instrument (card, bank account, etc.). Attach, detach, and manage payment methods for customers.\n\n**Required Scopes:**\n- `payment_methods:read` - List and retrieve payment methods\n- `payment_methods:write` - Attach, detach, update payment methods","x-displayName":"Payment Methods"},{"name":"Payment Links","description":"Create shareable payment links for invoices, subscriptions, or custom amounts. Customers complete payment on a hosted page.\n\n**Required Scopes:**\n- `payment_links:read` - List and retrieve payment links\n- `payment_links:write` - Create and update payment links","x-displayName":"Payment Links"},{"name":"Checkout Sessions","description":"Create hosted checkout pages for one-time payments or subscription sign-ups. Redirect customers to RevKeen-hosted payment forms.\n\n**Required Scopes:**\n- `checkout:read` - List and retrieve sessions\n- `checkout:write` - Create checkout sessions","x-displayName":"Checkout Sessions"},{"name":"Charges","description":"Create one-time charges for existing customers. Use for setup fees, overages, or ad-hoc payments.\n\n**Required Scopes:**\n- `charges:read` - List and retrieve charges\n- `charges:write` - Create charges","x-displayName":"Charges"},{"name":"Payments","description":"Payment objects represent completed or in-progress money movements. Use them to capture authorized funds, void pending authorizations, and retrieve transaction details across all payment channels (online, terminal, and recurring).\n\n**Required Scopes:**\n- `payments:read` - List and retrieve payments\n- `payments:write` - Capture, void payments\n\n**MCP Tools:** `payments_list`, `payments_get`, `payments_capture`, `payments_void`","x-displayName":"Payments"},{"name":"Invoices","description":"Invoices are the canonical record of what a customer owes or has paid. Every subscription cycle generates an invoice automatically, and you can also create one-off invoices for ad-hoc charges. Invoices progress through a lifecycle: `draft` → `open` → `finalized` → `paid`.\n\n**Required Scopes:**\n- `invoices:read` - List and retrieve invoices\n- `invoices:write` - Create, update, send, finalize invoices\n\n**MCP Tools:** `invoices_list`, `invoices_get`, `invoices_create`, `invoices_send`, `invoices_finalize`","x-displayName":"Invoices"},{"name":"Subscriptions","description":"Subscriptions manage recurring billing cycles for your customers. Create subscriptions to automatically charge customers on a schedule, with support for trials, prorations, plan changes, and dunning for failed payments.\n\n**Required Scopes:**\n- `subscriptions:read` - List and retrieve subscriptions\n- `subscriptions:write` - Create, update, cancel subscriptions\n\n**MCP Tools:** `subscriptions_get`","x-displayName":"Subscriptions"},{"name":"Subscription Schedules","description":"Schedule future changes to subscriptions. Define phases with different pricing, quantities, or plans that take effect at specified dates.\n\n**Required Scopes:**\n- `subscription_schedules:read` - List and retrieve schedules\n- `subscription_schedules:write` - Create, update, release schedules","x-displayName":"Subscription Schedules"},{"name":"Orders","description":"One-off purchases with lifecycle operations: create, pay, cancel, and fulfill.\n\n**Required Scopes:**\n- `orders:read` - List and retrieve orders\n- `orders:write` - Create, cancel, fulfill orders\n\n**MCP Tools:** `orders_list`, `orders_create`, `orders_cancel`, `orders_fulfill`","x-displayName":"Orders"},{"name":"Billing","description":"Billing utilities let you preview upcoming charges and billing schedules before they execute. Use these endpoints to show customers what they will be charged and when, or to validate pricing changes before applying them.\n\n**Required Scopes:**\n- `billing:read` - Preview billing schedules","x-displayName":"Billing Utilities"},{"name":"Products","description":"Products represent the goods or services you sell. Each product can have multiple prices for different currencies, billing intervals, or pricing models. Products are used across subscriptions, one-off charges, and checkout sessions.\n\n**Required Scopes:**\n- `products:read` - List and retrieve products\n- `products:write` - Create, update, archive products","x-displayName":"Products"},{"name":"Prices","description":"Prices define how much and how often to charge for a product. A single product can have multiple prices — different currencies, billing intervals, or pricing tiers. Supports fixed-amount, pay-what-you-want, tiered, and free pricing models.\n\n**Required Scopes:**\n- `prices:read` - List and retrieve prices\n- `prices:write` - Create, update, archive prices","x-displayName":"Prices"},{"name":"Discounts","description":"Create discount codes for percentage or fixed amount off. Set usage limits and expiration dates.\n\n**Required Scopes:**\n- `discounts:read` - List and retrieve discounts\n- `discounts:write` - Create, update, delete discounts","x-displayName":"Discounts"},{"name":"Tax Rates","description":"Configure manual tax rate overrides. Quaderno handles automatic tax calculation.\n\n**Required Scopes:**\n- `tax_rates:read` - List and retrieve tax rates\n- `tax_rates:write` - Create, update tax rates","x-displayName":"Tax Rates"},{"name":"Customers","description":"Customer objects represent the individuals or businesses you bill. Use them to store contact information, attach payment methods, and track billing history across subscriptions and one-off payments. Every charge, invoice, and subscription belongs to a customer.\n\n**Required Scopes:**\n- `customers:read` - List and retrieve customers\n- `customers:write` - Create, update, delete customers\n\n**MCP Tools:** `customers_list`, `customers_get`, `customers_create`, `customers_update`","x-displayName":"Customers"},{"name":"Entitlements","description":"Entitlements grant customers access to features, benefits, or content tied to their subscription or purchase. Use these endpoints to list granted entitlements for a customer and to check whether a customer currently has access to a specific benefit.\n\n**Required Scopes:**\n- `entitlements:read` - List and check customer entitlements","x-displayName":"Entitlements"},{"name":"Refunds","description":"Refund objects represent money returned to a customer after a completed payment. You can issue full or partial refunds, and they automatically create a child transaction linked to the original payment for audit trail purposes.\n\n**Required Scopes:**\n- `refunds:read` - List and retrieve refunds\n- `refunds:write` - Create refunds\n\n**MCP Tools:** `refunds_create`","x-displayName":"Refunds"},{"name":"Voids","description":"Cancel unsettled transactions before gateway settlement. Voids are always for the full amount — no partial voids. If the transaction has already settled, use a refund instead.\n\n**Required Scopes:**\n- `voids:read` - List and retrieve voids\n- `voids:write` - Create voids","x-displayName":"Voids"},{"name":"Credit Notes","description":"Issue formal accounting corrections for paid or partially paid invoices. A credit note is the accounting document; a refund is the money movement. They are often created together.\n\n**Required Scopes:**\n- `credit_notes:read` - List and retrieve credit notes\n- `credit_notes:write` - Create and void credit notes","x-displayName":"Credit Notes"},{"name":"Disputes","description":"Dispute objects represent a customer's challenge to a charge with their card issuer (a chargeback). When a dispute is opened, you can submit evidence to contest it or accept the dispute. RevKeen tracks the dispute lifecycle and notifies you via webhooks at each stage.\n\n**Required Scopes:**\n- `disputes:read` - List and retrieve disputes\n- `disputes:write` - Submit evidence, accept disputes","x-displayName":"Disputes"},{"name":"Payouts","description":"Payout objects represent funds settled to your bank account from processed payments. Track settlement batches, reconcile amounts, and monitor payout timing across all payment gateways.\n\n**Required Scopes:**\n- `payouts:read` - List and retrieve payouts","x-displayName":"Payouts"},{"name":"Events","description":"Event objects represent something that happened in your account — a payment succeeded, an invoice was created, a subscription was canceled. Events are the source of truth for webhook delivery. Use them to debug webhook issues, replay missed events, or build an audit trail.\n\n**Required Scopes:**\n- `events:read` - List and retrieve events\n- `events:write` - Resend webhook events","x-displayName":"Events"},{"name":"Webhooks","description":"Receive real-time event notifications. Configure endpoints for payment events, invoice updates, and more.\n\n## Signature Verification\n\nAll webhooks include a signature in the `X-Revkeen-Signature` header for verification:\n\n```\nX-Revkeen-Signature: t=1705689600,v1=abc123...\n```\n\n**Node.js Example:**\n```javascript\nconst crypto = require('crypto');\n\nfunction verifyWebhook(payload, signature, secret) {\n  const [timestamp, hash] = signature.split(',').map(s => s.split('=')[1]);\n  const expectedHash = crypto\n    .createHmac('sha256', secret)\n    .update(`${timestamp}.${payload}`)\n    .digest('hex');\n  return crypto.timingSafeEqual(Buffer.from(hash), Buffer.from(expectedHash));\n}\n```\n\n## Event Types\n\nEvents use dot notation: `{resource}.{action}`\n- `payment.succeeded`, `payment.failed`\n- `invoice.created`, `invoice.paid`, `invoice.overdue`\n- `subscription.created`, `subscription.canceled`, `subscription.renewed`\n- `customer.created`, `customer.updated`\n- `checkout.session.completed`, `checkout.session.expired`\n- `usage.threshold.reached`, `usage.period_finalized`, `usage.event.rejected`\n\nUse wildcards in endpoint configuration: `invoice.*` or `*` for all events.\n","x-displayName":"Webhooks"},{"name":"Webhook Endpoints","description":"Webhook endpoint objects let you register URLs that RevKeen will notify when events occur in your account — payments, subscription changes, invoice updates, and more. Each endpoint can subscribe to specific event types or use wildcards to receive all events.","x-displayName":"Webhook Endpoints"},{"name":"Webhook Deliveries","description":"Individual webhook delivery attempts. Each record represents one attempt chain to one endpoint for one event, capturing the HTTP status code, error, duration, and retry schedule. Use these to debug a specific failed delivery (for example, a 503 from a staging endpoint) and to queue an immediate retry. This is the grain Stripe and Polar expose for webhook debugging — use `/v2/events/:id/resend` when you want to re-dispatch the event across **all** endpoints instead.","x-displayName":"Webhook Deliveries"},{"name":"Customer Portal","description":"A programmatic customer-portal surface. Mint a short-lived bearer token via `POST /v2/customer-portal/sessions` for a specific customer, then hand that token to the customer's browser or to an app acting on their behalf. Subsequent `/v2/customer-portal/*` calls authenticate as that customer — returning only that customer's own subscriptions and invoices, and letting them self-cancel a subscription.\n\nThis is distinct from the hosted customer portal (cookie-based, rendered by RevKeen). Use the hosted portal when you want a drop-in self-service page; use the programmatic surface here when you're embedding self-service inside your own app with your own UI.\n\nTokens are Polar-shaped: prefix `rkcps_`, 60-minute default TTL, no server-side revocation list in v1 (short TTL and re-mint are the revocation story).","x-displayName":"Customer Portal"},{"name":"Customer Meters","description":"Per-customer usage aggregates, computed live from `usage_events`. Given a customer, return the total consumption per meter the merchant has defined. Use this to power \"current usage\" UI inside embedded portals — Polar exposes the same primitive and it's the shape billing-savvy agents expect.\n\nRevKeen does not maintain a separate `customer_meters` table. Aggregates are derived on demand from `usage_events` grouped by `(customer_id, meter_id)`. This keeps the write path cheap and always up-to-date; there is no batch to fall behind.\n\nThe path uses a composite ID `(customer_id, meter_id)` rather than a synthetic single-segment ID because both components are first-class entities the caller already holds.","x-displayName":"Customer Meters"},{"name":"Terminal Payments","description":"Initiate and manage card-present payments via POS terminal devices. Send sale, refund, and void commands to PAX terminals through the RevKeen connector.\n\n**Required Scopes:**\n- `terminal:read` - List and retrieve terminal payments\n- `terminal:write` - Initiate, cancel, refund, void terminal payments\n\n**MCP Tools:** `terminal_payments_initiate`, `terminal_payments_list`, `terminal_payments_get`, `terminal_payments_cancel`, `terminal_payments_refund`, `terminal_payments_void`","x-displayName":"Terminal Payments"},{"name":"Terminal Devices","description":"List and inspect terminal devices registered for your merchant account. Use this endpoint to discover device IDs before initiating terminal payments.\n\n**Required Scopes:**\n- `terminal:read` - List and retrieve terminal devices\n\n**MCP Tools:** `terminal_devices_list`, `terminal_devices_get`","x-displayName":"Terminal Devices"},{"name":"Payment Attempts","description":"Track payment attempts across all gateways. Analyze retry patterns and failure reasons.","x-displayName":"Payment Attempts"},{"name":"External Sync","description":"Sync data with external systems (PracticeHub, Wodify). Upsert by external ID with timestamp-based conflict resolution.","x-displayName":"External Sync"},{"name":"Integrations","description":"Manage external integrations (PracticeHub, Wodify). List active integrations and update status.","x-displayName":"Integrations"},{"name":"Sync State","description":"Track sync progress for external integrations. Get and update sync state by resource type.","x-displayName":"Sync State"},{"name":"Meters","description":"Create and manage usage meters. Meters define how usage events are aggregated for billing. Attach prices to meters for automated usage-based invoicing.\n\n**Required Scopes:**\n- `prices:read` - List and retrieve meters and prices\n- `prices:write` - Create, update, archive meters and prices\n\n**MCP Tools:** `meters_list`, `meters_get`, `meters_create`, `meters_update`, `meters_create_price`, `meters_list_prices`, `meters_update_price`, `meters_deactivate_price`","x-displayName":"Meters"},{"name":"Usage Events","description":"Ingest, query, and aggregate usage events. Events are matched to meters by event name or meter ID and streamed to ClickHouse for real-time aggregation.\n\n**Required Scopes:**\n- `usage:read` - Query events, aggregate usage\n- `usage:write` - Ingest events\n\n**MCP Tools:** `usage_events_ingest`, `usage_events_list`, `usage_events_aggregate`, `usage_events_dry_run`","x-displayName":"Usage Events"},{"name":"Usage","description":"Query current-period usage balance with estimated costs per meter. Includes included allowance, overage, and margin data.\n\n**Required Scopes:**\n- `usage:read` - Get usage balance\n\n**MCP Tools:** `usage_balance_get`","x-displayName":"Usage Balance"},{"name":"Analytics","description":"Revenue analytics including MRR summaries, time-series data, accounts receivable aging, days sales outstanding (DSO), and customer lifetime value (LTV). Use these endpoints to build dashboards and financial reports.\n\n**Required Scopes:**\n- `analytics:read` - Access analytics endpoints","x-displayName":"Analytics"},{"name":"Finance","description":"Financial summaries and income reports. Get a high-level overview of your business finances including revenue, expenses, and net income.\n\n**Required Scopes:**\n- `finance:read` - Access finance endpoints","x-displayName":"Finance"},{"name":"Transactions","description":"Transactions represent all financial movements in the unified transaction model. This includes sales, refunds, voids, captures, disputes, and adjustments. Every transaction is linked to an invoice and child transactions reference their parent.\n\n**Required Scopes:**\n- `payments:read` - List and retrieve transactions","x-displayName":"Transactions"},{"name":"Imports","description":"Bulk data import jobs. Upload a CSV file to create customers, products, or invoices in bulk. Imports are processed asynchronously — poll `GET /v2/imports/:id` for progress and error details.\n\n**Required Scopes:**\n- `imports:read` - Check import status\n- `imports:write` - Create import jobs","x-displayName":"Imports"},{"name":"Exports","description":"Bulk data export jobs. Generate CSV or XLSX files of customers, invoices, transactions, subscriptions, products, or payment methods. Exports are processed asynchronously — poll `GET /v2/exports/:id` for status and download URL.\n\n**Required Scopes:**\n- `exports:read` - Check export status\n- `exports:write` - Create export jobs","x-displayName":"Exports"}],"paths":{"/invoices":{"get":{"operationId":"invoices_list","tags":["Invoices"],"x-fern-sdk-group-name":["invoices"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/invoices\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { invoicesList } from \"@revkeen/sdk\";\n\nconst { data, error } = await invoicesList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.InvoicesAPI.InvoicesList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\InvoicesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->invoicesList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"python","label":"Python SDK","source":"from revkeen import RevKeen\nimport os\n\nrk = RevKeen(api_key=os.environ[\"REVKEEN_API_KEY\"])\n\n# List all invoices\ninvoices = rk.invoices.list()\n\n# Filter by status\nopen_invoices = rk.invoices.list(status=\"open\", limit=10)\n\nfor invoice in open_invoices.data:\n    print(f\"{invoice.id}: {invoice.total_minor / 100} {invoice.currency}\")"}],"summary":"List invoices","description":"List invoices with pagination and filtering.\n\n---\n\n**Related endpoints**\n\n- `PUT /invoices/external/batch` — Batch upsert invoices by external ID\n- `POST /invoices` — Create invoice\n- `GET /invoices/{id}` — Get invoice\n- `PATCH /invoices/{id}` — Update invoice\n- `DELETE /invoices/{id}` — Delete invoice\n- `POST /invoices/{id}/refund` — Refund invoice\n- `POST /invoices/{id}/reject` — Reject invoice\n- `GET /invoices/{id}/comments` — List invoice comments\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","description":"Filter by invoice status"},"required":false,"description":"Filter by invoice status","name":"status","in":"query"},{"schema":{"type":"string","description":"Filter by customer ID"},"required":false,"description":"Filter by customer ID","name":"customerId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results (1-100)"},"required":false,"description":"Maximum number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of results to skip"},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of invoices","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}}},"x-cli-group":"invoices","x-cli-name":"list"},"post":{"operationId":"invoices_create","tags":["Invoices"],"x-fern-sdk-group-name":["invoices"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/invoices\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"customer_uuid\": \"00000000-0000-0000-0000-000000000000\",\n    \"total_minor\": 0\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { invoicesCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await invoicesCreate({\n  body: {\n    \"customer_uuid\": \"00000000-0000-0000-0000-000000000000\",\n    \"total_minor\": 0\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.InvoicesAPI.InvoicesCreate(ctx)\n// req = req.InvoicesCreateRequest(InvoicesCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\InvoicesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->invoicesCreate(/* InvoicesCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"python","label":"Python SDK","source":"from revkeen import RevKeen\nimport os\n\nrk = RevKeen(api_key=os.environ[\"REVKEEN_API_KEY\"])\n\ninvoice = rk.invoices.create(\n    customer_id=\"cus_xxx\",\n    items=[\n        {\n            \"description\": \"Premium Plan - Monthly\",\n            \"amount\": 4999,\n            \"quantity\": 1,\n        }\n    ],\n    currency=\"usd\",\n    due_date=\"2026-02-01\",\n    # Optional: set recurring billing schedule\n    subscription_terms={\n        \"collection_method\": \"charge_automatically\",\n        \"start_mode\": \"when_paid\",\n        \"duration_type\": \"until_cancelled\",\n        \"first_payment_behavior\": \"charge_first_cycle_now\",\n    },\n)\n\nprint(invoice.id)  # inv_xxx"}],"summary":"Create invoice","description":"Create a new invoice.\n\n---\n\n**Related endpoints**\n\n- `PUT /invoices/external/batch` — Batch upsert invoices by external ID\n- `GET /invoices` — List invoices\n- `GET /invoices/{id}` — Get invoice\n- `PATCH /invoices/{id}` — Update invoice\n- `DELETE /invoices/{id}` — Delete invoice\n- `POST /invoices/{id}/refund` — Refund invoice\n- `POST /invoices/{id}/reject` — Reject invoice\n- `GET /invoices/{id}/comments` — List invoice comments\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"description":"Invoice creation details","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer_uuid":{"type":"string","format":"uuid"},"invoice_number":{"type":"string"},"total_minor":{"type":"integer"},"currency":{"type":"string","default":"USD"},"due_date":{"type":"string"},"status":{"type":"string"},"custom_fields":{"type":"object","additionalProperties":true,"description":"Key-value pairs for custom fields"},"subscription_terms":{"$ref":"#/components/schemas/SubscriptionTerms"},"allowed_methods":{"type":"array","items":{"type":"string","enum":["card","in_store"]},"example":["card","in_store"],"description":"Restrict checkout payment methods for this invoice. When set, narrows available rails for checkout sessions created against this invoice. Omit to use merchant default."}},"required":["customer_uuid","total_minor"]}}}},"responses":{"201":{"description":"Invoice created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}}},"x-cli-group":"invoices","x-cli-name":"create"}},"/invoices/{id}/finalize":{"post":{"operationId":"invoices_finalize","tags":["Invoices"],"x-fern-sdk-group-name":["invoices"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/invoices/00000000-0000-0000-0000-000000000000/finalize\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"auto_advance\": false\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { invoicesFinalize } from \"@revkeen/sdk\";\n\nconst { data, error } = await invoicesFinalize({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"auto_advance\": false\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.InvoicesAPI.InvoicesFinalize(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.InvoicesFinalizeRequest(InvoicesFinalizeRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\InvoicesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->invoicesFinalize(\"00000000-0000-0000-0000-000000000000\", /* InvoicesFinalizeRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"python","label":"Python SDK","source":"from revkeen import RevKeen\nimport os\n\nrk = RevKeen(api_key=os.environ[\"REVKEEN_API_KEY\"])\n\n# Finalize a draft invoice (locks for payment)\ninvoice = rk.invoices.finalize(\"inv_xxx\")\n\nprint(invoice.status)  # 'open' (ready for payment)"}],"summary":"Finalize an invoice","description":"Finalizes a draft invoice, locking it for payment. Assigns invoice number and generates public token. After finalization, financial fields become immutable.\n\n---\n\n**Related endpoints**\n\n- `PUT /invoices/external/batch` — Batch upsert invoices by external ID\n- `GET /invoices` — List invoices\n- `POST /invoices` — Create invoice\n- `GET /invoices/{id}` — Get invoice\n- `PATCH /invoices/{id}` — Update invoice\n- `DELETE /invoices/{id}` — Delete invoice\n- `POST /invoices/{id}/refund` — Refund invoice\n- `POST /invoices/{id}/reject` — Reject invoice\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"Finalization options","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"auto_advance":{"type":"boolean","description":"If true, automatically transitions to 'approved' status after finalization.","example":false}}}}}},"responses":{"200":{"description":"Invoice finalized successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"400":{"description":"Invoice cannot be finalized (not in draft status or missing line items)"},"404":{"description":"Invoice not found"}},"x-cli-group":"invoices","x-cli-name":"finalize"}},"/invoices/{id}/void":{"post":{"operationId":"invoices_void","tags":["Invoices"],"x-fern-sdk-group-name":["invoices"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/invoices/00000000-0000-0000-0000-000000000000/void\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"reason\": \"Customer requested cancellation\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { invoicesVoid } from \"@revkeen/sdk\";\n\nconst { data, error } = await invoicesVoid({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"reason\": \"Customer requested cancellation\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.InvoicesAPI.InvoicesVoid(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.InvoicesVoidRequest(InvoicesVoidRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\InvoicesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->invoicesVoid(\"00000000-0000-0000-0000-000000000000\", /* InvoicesVoidRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"python","label":"Python SDK","source":"from revkeen import RevKeen\nimport os\n\nrk = RevKeen(api_key=os.environ[\"REVKEEN_API_KEY\"])\n\n# Void an unpaid invoice\ninvoice = rk.invoices.void(\"inv_xxx\")\n\nprint(invoice.status)  # 'void'"}],"summary":"Void an invoice","description":"Voids an invoice. Only invoices without recorded payments can be voided. Use refund instead for paid invoices.\n\n---\n\n**Related endpoints**\n\n- `PUT /invoices/external/batch` — Batch upsert invoices by external ID\n- `GET /invoices` — List invoices\n- `POST /invoices` — Create invoice\n- `GET /invoices/{id}` — Get invoice\n- `PATCH /invoices/{id}` — Update invoice\n- `DELETE /invoices/{id}` — Delete invoice\n- `POST /invoices/{id}/refund` — Refund invoice\n- `POST /invoices/{id}/reject` — Reject invoice\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"Void details","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500,"description":"Reason for voiding the invoice","example":"Customer requested cancellation"}}}}}},"responses":{"200":{"description":"Invoice voided successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"400":{"description":"Invoice cannot be voided (has payments or already voided)"},"404":{"description":"Invoice not found"}},"x-cli-group":"invoices","x-cli-name":"void"}},"/invoices/{id}/send":{"post":{"operationId":"invoices_send","tags":["Invoices"],"x-fern-sdk-group-name":["invoices"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/invoices/00000000-0000-0000-0000-000000000000/send\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"channel\": \"email\",\n    \"template_id\": \"00000000-0000-0000-0000-000000000000\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { invoicesSend } from \"@revkeen/sdk\";\n\nconst { data, error } = await invoicesSend({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"channel\": \"email\",\n    \"template_id\": \"00000000-0000-0000-0000-000000000000\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.InvoicesAPI.InvoicesSend(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.InvoicesSendRequest(InvoicesSendRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\InvoicesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->invoicesSend(\"00000000-0000-0000-0000-000000000000\", /* InvoicesSendRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"python","label":"Python SDK","source":"from revkeen import RevKeen\nimport os\n\nrk = RevKeen(api_key=os.environ[\"REVKEEN_API_KEY\"])\n\n# Send invoice via email to customer\ninvoice = rk.invoices.send(\"inv_xxx\")\n\nprint(f\"Invoice sent to: {invoice.customer_email}\")"}],"summary":"Send an invoice","description":"Sends an invoice to the customer via the specified channel (email, SMS, or WhatsApp). Invoice must be approved first.\n\n---\n\n**Related endpoints**\n\n- `PUT /invoices/external/batch` — Batch upsert invoices by external ID\n- `GET /invoices` — List invoices\n- `POST /invoices` — Create invoice\n- `GET /invoices/{id}` — Get invoice\n- `PATCH /invoices/{id}` — Update invoice\n- `DELETE /invoices/{id}` — Delete invoice\n- `POST /invoices/{id}/refund` — Refund invoice\n- `POST /invoices/{id}/reject` — Reject invoice\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"Send options","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms","whatsapp"],"default":"email","description":"Communication channel to send the invoice through","example":"email"},"template_id":{"type":"string","format":"uuid","description":"Optional custom template ID to use for the notification"}}}}}},"responses":{"200":{"description":"Invoice sent successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"}}}},"400":{"description":"Invoice cannot be sent (not approved or missing customer contact)"},"404":{"description":"Invoice not found"}},"x-cli-group":"invoices","x-cli-name":"send"}},"/products":{"get":{"operationId":"products_list","tags":["Products"],"x-fern-sdk-group-name":["products"],"summary":"List products","description":"List products with pagination and optional search.\n\n---\n\n**Related endpoints**\n\n- `POST /products` — Create product\n- `GET /products/{id}` — Get product by ID\n- `PATCH /products/{id}` — Update product\n- `PUT /products/external/{source}/{externalId}` — Upsert product by external ID\n- `PUT /products/external/batch` — Batch upsert products by external ID\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results (1-100)"},"required":false,"description":"Maximum number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":"string","description":"Search term to filter products"},"required":false,"description":"Search term to filter products","name":"search","in":"query"}],"responses":{"200":{"description":"List of products","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"products","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/products\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { productsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await productsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.ProductsAPI.ProductsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\ProductsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->productsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"post":{"operationId":"products_create","tags":["Products"],"x-fern-sdk-group-name":["products"],"summary":"Create product","description":"Create a new product. Requires 'products:write' scope.\n\n---\n\n**Related endpoints**\n\n- `GET /products` — List products\n- `GET /products/{id}` — Get product by ID\n- `PATCH /products/{id}` — Update product\n- `PUT /products/external/{source}/{externalId}` — Upsert product by external ID\n- `PUT /products/external/batch` — Batch upsert products by external ID\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"description":"Product creation details","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductRequest"}}}},"responses":{"201":{"description":"Product created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreateResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"products","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/products\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"product_id\": \"string\",\n    \"name\": \"string\",\n    \"description\": null,\n    \"kind\": \"subscription\",\n    \"pricing_model\": \"one_time\",\n    \"amount_minor\": 0,\n    \"currency\": \"USD\",\n    \"interval\": null,\n    \"interval_count\": null,\n    \"trial_days\": 0,\n    \"usage_meter_id\": null,\n    \"slug\": \"string\",\n    \"fulfillment_type\": \"none\",\n    \"billing_anchor_rule\": \"same_day\",\n    \"billing_anchor_day\": null,\n    \"first_charge_behavior\": \"immediate\",\n    \"end_behavior\": \"until_canceled\",\n    \"max_payments\": null,\n    \"metadata\": {}\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { productsCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await productsCreate({\n  body: {\n    \"product_id\": \"string\",\n    \"name\": \"string\",\n    \"description\": null,\n    \"kind\": \"subscription\",\n    \"pricing_model\": \"one_time\",\n    \"amount_minor\": 0,\n    \"currency\": \"USD\",\n    \"interval\": null,\n    \"interval_count\": null,\n    \"trial_days\": 0,\n    \"usage_meter_id\": null,\n    \"slug\": \"string\",\n    \"fulfillment_type\": \"none\",\n    \"billing_anchor_rule\": \"same_day\",\n    \"billing_anchor_day\": null,\n    \"first_charge_behavior\": \"immediate\",\n    \"end_behavior\": \"until_canceled\",\n    \"max_payments\": null,\n    \"metadata\": {}\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.ProductsAPI.ProductsCreate(ctx)\n// req = req.ProductsCreateRequest(ProductsCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\ProductsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->productsCreate(/* ProductsCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/products/{id}":{"get":{"operationId":"products_get","tags":["Products"],"x-fern-sdk-group-name":["products"],"summary":"Get product by ID","description":"Get a product by its ID. Requires 'products:read' scope.\n\n---\n\n**Related endpoints**\n\n- `GET /products` — List products\n- `POST /products` — Create product\n- `PATCH /products/{id}` — Update product\n- `PUT /products/external/{source}/{externalId}` — Upsert product by external ID\n- `PUT /products/external/batch` — Batch upsert products by external ID\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","example":"prod_123"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Product details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRetrieveResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"products","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/products/prod_123\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { productsGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await productsGet({\n  path: { id: \"prod_123\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.ProductsAPI.ProductsGet(ctx)\n// path param id = \"prod_123\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\ProductsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->productsGet(\"prod_123\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"patch":{"operationId":"products_update","tags":["Products"],"x-fern-sdk-group-name":["products"],"summary":"Update product","description":"Update an existing product. Requires 'products:write' scope.\n\n---\n\n**Related endpoints**\n\n- `GET /products` — List products\n- `POST /products` — Create product\n- `GET /products/{id}` — Get product by ID\n- `PUT /products/external/{source}/{externalId}` — Upsert product by external ID\n- `PUT /products/external/batch` — Batch upsert products by external ID\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","example":"prod_123"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"Product update details","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductRequest"}}}},"responses":{"200":{"description":"Product updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdateResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"products","x-cli-name":"update","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH \"https://api.revkeen.com/v2/products/prod_123\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"string\",\n    \"description\": null,\n    \"amount_minor\": 0,\n    \"currency\": \"string\",\n    \"interval\": null,\n    \"interval_count\": null,\n    \"trial_days\": 0,\n    \"is_active\": false,\n    \"is_archived\": false,\n    \"fulfillment_type\": \"none\",\n    \"billing_anchor_rule\": \"same_day\",\n    \"billing_anchor_day\": null,\n    \"first_charge_behavior\": \"immediate\",\n    \"end_behavior\": \"until_canceled\",\n    \"max_payments\": null,\n    \"metadata\": {}\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { productsUpdate } from \"@revkeen/sdk\";\n\nconst { data, error } = await productsUpdate({\n  path: { id: \"prod_123\" },\n  body: {\n    \"name\": \"string\",\n    \"description\": null,\n    \"amount_minor\": 0,\n    \"currency\": \"string\",\n    \"interval\": null,\n    \"interval_count\": null,\n    \"trial_days\": 0,\n    \"is_active\": false,\n    \"is_archived\": false,\n    \"fulfillment_type\": \"none\",\n    \"billing_anchor_rule\": \"same_day\",\n    \"billing_anchor_day\": null,\n    \"first_charge_behavior\": \"immediate\",\n    \"end_behavior\": \"until_canceled\",\n    \"max_payments\": null,\n    \"metadata\": {}\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.ProductsAPI.ProductsUpdate(ctx)\n// path param id = \"prod_123\"\n// req = req.ProductsUpdateRequest(ProductsUpdateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\ProductsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->productsUpdate(\"prod_123\", /* ProductsUpdateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/checkout-sessions":{"post":{"operationId":"checkout_sessions_create","tags":["Checkout Sessions"],"x-fern-sdk-group-name":["checkout","sessions"],"summary":"Create a checkout session","description":"Create a checkout session for an invoice or product.\n\n---\n\n**Related endpoints**\n\n- `GET /checkout-sessions/{id}` — Retrieve a checkout session\n- `POST /checkout-sessions/{id}/expire` — Expire a checkout session\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionInput"}}}},"responses":{"201":{"description":"Checkout session created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionCreateResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"checkout-sessions","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/checkout-sessions\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"invoiceId\": \"inv_123\",\n    \"productId\": \"prod_123\",\n    \"amountMinor\": 1000,\n    \"currency\": \"USD\",\n    \"successUrl\": \"https://example.com/success\",\n    \"cancelUrl\": \"https://example.com/cancel\",\n    \"allowedMethods\": [\n      \"card\",\n      \"in_store\"\n    ],\n    \"companionDeviceId\": \"00000000-0000-0000-0000-000000000000\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { checkoutSessionsCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await checkoutSessionsCreate({\n  body: {\n    \"invoiceId\": \"inv_123\",\n    \"productId\": \"prod_123\",\n    \"amountMinor\": 1000,\n    \"currency\": \"USD\",\n    \"successUrl\": \"https://example.com/success\",\n    \"cancelUrl\": \"https://example.com/cancel\",\n    \"allowedMethods\": [\n      \"card\",\n      \"in_store\"\n    ],\n    \"companionDeviceId\": \"00000000-0000-0000-0000-000000000000\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CheckoutAPI.CheckoutSessionsCreate(ctx)\n// req = req.CheckoutSessionsCreateRequest(CheckoutSessionsCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CheckoutApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->checkoutSessionsCreate(/* CheckoutSessionsCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/checkout-sessions/{id}":{"get":{"operationId":"checkout_sessions_get","tags":["Checkout Sessions"],"x-fern-sdk-group-name":["checkout","sessions"],"summary":"Retrieve a checkout session","description":"Retrieve a checkout session by its ID.\n\n---\n\n**Related endpoints**\n\n- `POST /checkout-sessions` — Create a checkout session\n- `POST /checkout-sessions/{id}/expire` — Expire a checkout session\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Checkout session retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionRetrieveResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"checkout-sessions","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/checkout-sessions/550e8400-e29b-41d4-a716-446655440000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { checkoutSessionsGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await checkoutSessionsGet({\n  path: { id: \"550e8400-e29b-41d4-a716-446655440000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CheckoutAPI.CheckoutSessionsGet(ctx)\n// path param id = \"550e8400-e29b-41d4-a716-446655440000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CheckoutApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->checkoutSessionsGet(\"550e8400-e29b-41d4-a716-446655440000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/checkout-sessions/{id}/expire":{"post":{"operationId":"checkout_sessions_expire","tags":["Checkout Sessions"],"x-fern-sdk-group-name":["checkout","sessions"],"summary":"Expire a checkout session","description":"Manually expire an open checkout session. Only sessions with status 'open' or 'pending' and no active payment attempt can be expired.\n\n---\n\n**Related endpoints**\n\n- `POST /checkout-sessions` — Create a checkout session\n- `GET /checkout-sessions/{id}` — Retrieve a checkout session\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n- `409 conflict` — Idempotency-Key collision with a different body, or a concurrent state-transition conflict.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionExpireResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict — session is not in an expirable state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"checkout-sessions","x-cli-name":"expire","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/checkout-sessions/550e8400-e29b-41d4-a716-446655440000/expire\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { checkoutSessionsExpire } from \"@revkeen/sdk\";\n\nconst { data, error } = await checkoutSessionsExpire({\n  path: { id: \"550e8400-e29b-41d4-a716-446655440000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CheckoutAPI.CheckoutSessionsExpire(ctx)\n// path param id = \"550e8400-e29b-41d4-a716-446655440000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CheckoutApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->checkoutSessionsExpire(\"550e8400-e29b-41d4-a716-446655440000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customers":{"post":{"operationId":"customers_create","tags":["Customers"],"x-fern-sdk-group-name":["customers"],"summary":"Create a new customer","description":"Create a new customer record in the merchant's account\n\n---\n\n**Related endpoints**\n\n- `GET /customers/{customerId}/invoices` — List customer invoices\n- `GET /customers/{customerId}/subscriptions` — List customer subscriptions\n- `GET /customers/{customerId}/orders` — List customer orders\n- `GET /customers/{customerId}/payments` — List customer payments\n- `PUT /customers/external/batch` — Batch upsert customers by external ID\n- `GET /customers` — List customers\n- `GET /customers/{id}` — Get customer by ID\n- `PATCH /customers/{id}` — Update customer details\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Customer's email address (must be unique per merchant)"},"name":{"type":"string","description":"Customer's full name"},"phone":{"type":"string","description":"Customer's phone number"},"metadata":{"type":"object","additionalProperties":true,"description":"Arbitrary key-value metadata to attach to this customer"},"customFields":{"type":"object","additionalProperties":true,"description":"Merchant-defined custom fields displayed as columns in the dashboard"}},"required":["email"]}}}},"responses":{"201":{"description":"Customer created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreateResponse"}}}},"400":{"description":"Validation error"},"401":{"description":"Unauthorized"}},"x-cli-group":"customers","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/customers\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"customer@example.com\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { customersCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await customersCreate({\n  body: {\n    \"email\": \"customer@example.com\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomersAPI.CustomersCreate(ctx)\n// req = req.CustomersCreateRequest(CustomersCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomersApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customersCreate(/* CustomersCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"get":{"operationId":"customers_list","tags":["Customers"],"x-fern-sdk-group-name":["customers"],"summary":"List customers","description":"Retrieve a paginated list of customers for the merchant\n\n---\n\n**Related endpoints**\n\n- `GET /customers/{customerId}/invoices` — List customer invoices\n- `GET /customers/{customerId}/subscriptions` — List customer subscriptions\n- `GET /customers/{customerId}/orders` — List customer orders\n- `GET /customers/{customerId}/payments` — List customer payments\n- `PUT /customers/external/batch` — Batch upsert customers by external ID\n- `POST /customers` — Create a new customer\n- `GET /customers/{id}` — Get customer by ID\n- `PATCH /customers/{id}` — Update customer details\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results (1-100)"},"required":false,"description":"Maximum number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of results to skip"},"required":false,"description":"Number of results to skip","name":"offset","in":"query"},{"schema":{"type":"string","description":"Search term to filter customers"},"required":false,"description":"Search term to filter customers","name":"search","in":"query"}],"responses":{"200":{"description":"List of customers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListResponse"}}}},"401":{"description":"Unauthorized"}},"x-cli-group":"customers","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customers\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customersList } from \"@revkeen/sdk\";\n\nconst { data, error } = await customersList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomersAPI.CustomersList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomersApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customersList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customers/{id}":{"get":{"operationId":"customers_get","tags":["Customers"],"x-fern-sdk-group-name":["customers"],"summary":"Get customer by ID","description":"Retrieve detailed information about a specific customer\n\n---\n\n**Related endpoints**\n\n- `GET /customers/{customerId}/invoices` — List customer invoices\n- `GET /customers/{customerId}/subscriptions` — List customer subscriptions\n- `GET /customers/{customerId}/orders` — List customer orders\n- `GET /customers/{customerId}/payments` — List customer payments\n- `PUT /customers/external/batch` — Batch upsert customers by external ID\n- `POST /customers` — Create a new customer\n- `GET /customers` — List customers\n- `PATCH /customers/{id}` — Update customer details\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Customer UUID"},"required":true,"description":"Customer UUID","name":"id","in":"path"}],"responses":{"200":{"description":"Customer details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerRetrieveResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"}},"x-cli-group":"customers","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customers/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customersGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await customersGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomersAPI.CustomersGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomersApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customersGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"patch":{"operationId":"customers_update","tags":["Customers"],"x-fern-sdk-group-name":["customers"],"summary":"Update customer details","description":"Update an existing customer's information\n\n---\n\n**Related endpoints**\n\n- `GET /customers/{customerId}/invoices` — List customer invoices\n- `GET /customers/{customerId}/subscriptions` — List customer subscriptions\n- `GET /customers/{customerId}/orders` — List customer orders\n- `GET /customers/{customerId}/payments` — List customer payments\n- `PUT /customers/external/batch` — Batch upsert customers by external ID\n- `POST /customers` — Create a new customer\n- `GET /customers` — List customers\n- `GET /customers/{id}` — Get customer by ID\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Customer UUID"},"required":true,"description":"Customer UUID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Updated email address"},"name":{"type":"string","description":"Updated full name"},"phone":{"type":"string","description":"Updated phone number"},"metadata":{"type":"object","additionalProperties":true,"description":"Metadata to merge with existing values (set a key to null to remove it)"},"customFields":{"type":"object","additionalProperties":true,"description":"Merchant-defined custom fields displayed as columns in the dashboard"}}}}}},"responses":{"200":{"description":"Customer updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"}},"x-cli-group":"customers","x-cli-name":"update","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH \"https://api.revkeen.com/v2/customers/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"customer@example.com\",\n    \"name\": \"string\",\n    \"phone\": \"string\",\n    \"metadata\": {},\n    \"customFields\": {}\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { customersUpdate } from \"@revkeen/sdk\";\n\nconst { data, error } = await customersUpdate({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"email\": \"customer@example.com\",\n    \"name\": \"string\",\n    \"phone\": \"string\",\n    \"metadata\": {},\n    \"customFields\": {}\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomersAPI.CustomersUpdate(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.CustomersUpdateRequest(CustomersUpdateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomersApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customersUpdate(\"00000000-0000-0000-0000-000000000000\", /* CustomersUpdateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customers/{id}/payment-methods":{"get":{"operationId":"customers_payment_methods_list","tags":["Customers","Payment Methods"],"x-fern-sdk-group-name":["customers","paymentMethods"],"summary":"Get customer payment methods","description":"Retrieve all payment methods for a customer\n\n---\n\n**Related endpoints**\n\n- `GET /customers/{customerId}/invoices` — List customer invoices\n- `GET /customers/{customerId}/subscriptions` — List customer subscriptions\n- `GET /customers/{customerId}/orders` — List customer orders\n- `GET /customers/{customerId}/payments` — List customer payments\n- `PUT /customers/external/batch` — Batch upsert customers by external ID\n- `POST /customers` — Create a new customer\n- `GET /customers` — List customers\n- `GET /customers/{id}` — Get customer by ID\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Customer UUID"},"required":true,"description":"Customer UUID","name":"id","in":"path"}],"responses":{"200":{"description":"Payment methods list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPaymentMethodsListResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"}},"x-cli-group":"customers","x-cli-name":"payment-methods-list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customers/00000000-0000-0000-0000-000000000000/payment-methods\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customersPaymentMethodsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await customersPaymentMethodsList({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomersAPI.CustomersPaymentMethodsList(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomersApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customersPaymentMethodsList(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/subscriptions":{"post":{"operationId":"subscriptions_create","tags":["Subscriptions"],"x-fern-sdk-group-name":["subscriptions"],"summary":"Create a new subscription","description":"Create a new subscription for a customer\n\n---\n\n**Related endpoints**\n\n- `GET /subscriptions` — List subscriptions\n- `GET /subscriptions/{id}` — Get subscription by ID\n- `PATCH /subscriptions/{id}` — Update subscription details\n- `DELETE /subscriptions/{id}` — Delete subscription\n- `POST /subscriptions/{id}/change-plan` — Change subscription plan\n- `POST /subscriptions/{id}/change-quantity` — Change subscription quantity\n- `POST /subscriptions/{id}/preview-renewal` — Preview subscription renewal\n- `POST /subscriptions/{id}/pause` — Pause subscription\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid"},"businessId":{"type":"string","format":"uuid"},"productId":{"type":"string","format":"uuid"},"planId":{"type":"string","format":"uuid"},"priceId":{"type":"string","format":"uuid"},"paymentMethodId":{"type":"string","format":"uuid"},"startDate":{"type":"string"},"currency":{"type":"string","default":"USD"},"quantity":{"type":"integer","minimum":1,"default":1},"trialEnd":{"type":"string","format":"date-time"},"billingAnchorDay":{"type":"integer","minimum":1,"maximum":31},"pauseAtPeriodEnd":{"type":"boolean"},"cancelAtPeriodEnd":{"type":"boolean"},"billingStartsOn":{"type":"string","format":"date-time"},"billingEndStrategy":{"type":"string","enum":["indefinite","on_date","after_cycles"]},"billingEndsOn":{"type":"string","format":"date-time"},"billingMaxCycles":{"type":"integer","minimum":1},"prorationMode":{"type":"string","enum":["immediate","next_invoice","none"]},"metadata":{"type":"object","additionalProperties":{}}},"required":["customerId"]}}}},"responses":{"201":{"description":"Subscription created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCreateResponse"}}}},"400":{"description":"Validation error"},"401":{"description":"Unauthorized"}},"x-cli-group":"subscriptions","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/subscriptions\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"customerId\": \"00000000-0000-0000-0000-000000000000\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { subscriptionsCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await subscriptionsCreate({\n  body: {\n    \"customerId\": \"00000000-0000-0000-0000-000000000000\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.SubscriptionsAPI.SubscriptionsCreate(ctx)\n// req = req.SubscriptionsCreateRequest(SubscriptionsCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\SubscriptionsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->subscriptionsCreate(/* SubscriptionsCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"get":{"operationId":"subscriptions_list","tags":["Subscriptions"],"x-fern-sdk-group-name":["subscriptions"],"summary":"List subscriptions","description":"Retrieve a paginated list of subscriptions with optional filters\n\n---\n\n**Related endpoints**\n\n- `POST /subscriptions` — Create a new subscription\n- `GET /subscriptions/{id}` — Get subscription by ID\n- `PATCH /subscriptions/{id}` — Update subscription details\n- `DELETE /subscriptions/{id}` — Delete subscription\n- `POST /subscriptions/{id}/change-plan` — Change subscription plan\n- `POST /subscriptions/{id}/change-quantity` — Change subscription quantity\n- `POST /subscriptions/{id}/preview-renewal` — Preview subscription renewal\n- `POST /subscriptions/{id}/pause` — Pause subscription\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results (1-100)"},"required":false,"description":"Maximum number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":"string","enum":["active","canceled","past_due","trialing","paused","incomplete","incomplete_expired"],"description":"Filter by subscription status"},"required":false,"description":"Filter by subscription status","name":"status","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by customer UUID"},"required":false,"description":"Filter by customer UUID","name":"customerId","in":"query"}],"responses":{"200":{"description":"List of subscriptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionListResponse"}}}},"401":{"description":"Unauthorized"}},"x-cli-group":"subscriptions","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/subscriptions\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { subscriptionsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await subscriptionsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.SubscriptionsAPI.SubscriptionsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\SubscriptionsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->subscriptionsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/subscriptions/{id}/cancel":{"post":{"operationId":"subscriptions_cancel","tags":["Subscriptions"],"x-fern-sdk-group-name":["subscriptions"],"summary":"Cancel subscription","description":"Cancel a subscription either immediately or at the end of the current billing period.\n\n**Modes:**\n- `immediately`: Status set to \"canceled\", access revoked now\n- `period_end`: cancelAtPeriodEnd flag set, access continues until period end\n\n---\n\n**Related endpoints**\n\n- `POST /subscriptions` — Create a new subscription\n- `GET /subscriptions` — List subscriptions\n- `GET /subscriptions/{id}` — Get subscription by ID\n- `PATCH /subscriptions/{id}` — Update subscription details\n- `DELETE /subscriptions/{id}` — Delete subscription\n- `POST /subscriptions/{id}/change-plan` — Change subscription plan\n- `POST /subscriptions/{id}/change-quantity` — Change subscription quantity\n- `POST /subscriptions/{id}/preview-renewal` — Preview subscription renewal\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Subscription UUID"},"required":true,"description":"Subscription UUID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionInput"}}}},"responses":{"200":{"description":"Subscription canceled or cancellation scheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCancelSubscriptionResponse"}}}},"400":{"description":"Invalid subscription state for this operation"},"401":{"description":"Unauthorized"},"404":{"description":"Subscription not found"}},"x-cli-group":"subscriptions","x-cli-name":"cancel","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/subscriptions/00000000-0000-0000-0000-000000000000/cancel\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"mode\": \"immediately\",\n    \"reason\": \"string\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { subscriptionsCancel } from \"@revkeen/sdk\";\n\nconst { data, error } = await subscriptionsCancel({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"mode\": \"immediately\",\n    \"reason\": \"string\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.SubscriptionsAPI.SubscriptionsCancel(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.SubscriptionsCancelRequest(SubscriptionsCancelRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\SubscriptionsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->subscriptionsCancel(\"00000000-0000-0000-0000-000000000000\", /* SubscriptionsCancelRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/analytics/revenue/mrr-summary":{"get":{"operationId":"analytics_revenue_mrr_summary","tags":["Analytics"],"summary":"MRR Summary","description":"Get Monthly Recurring Revenue metrics and growth\n\n---\n\n**Related endpoints**\n\n- `GET /analytics/revenue/time-series` — Revenue Time Series\n- `GET /analytics/invoices/ar-aging` — A/R Aging Report\n- `GET /analytics/collections/dso` — Days Sales Outstanding\n- `GET /analytics/customers/ltv` — Customer LTV\n- `GET /analytics/customers/{customerId}` — Customer Analytics\n- `GET /analytics/payment-links/conversion` — Payment Link Conversion\n- `GET /analytics/checkout/funnel` — Checkout Funnel Analytics\n- `GET /analytics/checkout/abandonment/summary` — Abandonment Alert Summary","parameters":[{"schema":{"type":"string","format":"date-time","description":"Calculate MRR as of this date (ISO 8601)","example":"2024-01-31T23:59:59Z"},"required":false,"description":"Calculate MRR as of this date (ISO 8601)","name":"asOfDate","in":"query"}],"responses":{"200":{"description":"MRR metrics","content":{"application/json":{"schema":{"type":"object","properties":{"currentMrr":{"type":"number"},"previousMrr":{"type":"number"},"growth":{"type":"number"},"newMrr":{"type":"number"},"churnedMrr":{"type":"number"},"expansionMrr":{"type":"number"},"contractionMrr":{"type":"number"},"asOfDate":{"type":"string"}},"required":["currentMrr","previousMrr","growth","newMrr","churnedMrr","expansionMrr","contractionMrr","asOfDate"]}}}}},"x-cli-group":"analytics","x-cli-name":"revenue-mrr-summary","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/analytics/revenue/mrr-summary\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { analyticsRevenueMrrSummary } from \"@revkeen/sdk\";\n\nconst { data, error } = await analyticsRevenueMrrSummary();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.AnalyticsAPI.AnalyticsRevenueMrrSummary(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\AnalyticsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->analyticsRevenueMrrSummary();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/analytics/revenue/time-series":{"get":{"operationId":"analytics_revenue_time_series","tags":["Analytics"],"summary":"Revenue Time Series","description":"Get revenue data over time with configurable granularity\n\n---\n\n**Related endpoints**\n\n- `GET /analytics/revenue/mrr-summary` — MRR Summary\n- `GET /analytics/invoices/ar-aging` — A/R Aging Report\n- `GET /analytics/collections/dso` — Days Sales Outstanding\n- `GET /analytics/customers/ltv` — Customer LTV\n- `GET /analytics/customers/{customerId}` — Customer Analytics\n- `GET /analytics/payment-links/conversion` — Payment Link Conversion\n- `GET /analytics/checkout/funnel` — Checkout Funnel Analytics\n- `GET /analytics/checkout/abandonment/summary` — Abandonment Alert Summary","parameters":[{"schema":{"type":"string","format":"date-time","description":"Start date (ISO 8601)","example":"2024-01-01T00:00:00Z"},"required":true,"description":"Start date (ISO 8601)","name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","description":"End date (ISO 8601)","example":"2024-12-31T23:59:59Z"},"required":true,"description":"End date (ISO 8601)","name":"endDate","in":"query"},{"schema":{"type":"string","enum":["day","week","month","quarter","year"],"default":"month","description":"Time granularity for data points"},"required":false,"description":"Time granularity for data points","name":"granularity","in":"query"}],"responses":{"200":{"description":"Revenue time series data","content":{"application/json":{"schema":{"type":"object","properties":{"dataPoints":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"revenue":{"type":"number"},"invoiceCount":{"type":"number"},"avgInvoiceValue":{"type":"number"}},"required":["date","revenue","invoiceCount","avgInvoiceValue"]}},"totalRevenue":{"type":"number"},"totalInvoices":{"type":"number"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"}},"required":["dataPoints","totalRevenue","totalInvoices","periodStart","periodEnd"]}}}}},"x-cli-group":"analytics","x-cli-name":"revenue-time-series","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/analytics/revenue/time-series?startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { analyticsRevenueTimeSeries } from \"@revkeen/sdk\";\n\nconst { data, error } = await analyticsRevenueTimeSeries({\n  query: { startDate: \"2024-01-01T00:00:00Z\", endDate: \"2024-12-31T23:59:59Z\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.AnalyticsAPI.AnalyticsRevenueTimeSeries(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\AnalyticsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->analyticsRevenueTimeSeries();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/refunds":{"get":{"operationId":"refunds_list","tags":["Refunds"],"x-fern-sdk-group-name":["refunds"],"summary":"List refunds","description":"Retrieve a paginated list of refunds with optional filters. Results are ordered by creation date (newest first).\n\n---\n\n**Related endpoints**\n\n- `POST /refunds` — Create a refund\n- `GET /refunds/{id}` — Get refund by ID\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","enum":["pending","processing","succeeded","failed","canceled"],"description":"Filter by refund status"},"required":false,"description":"Filter by refund status","name":"status","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by original payment ID"},"required":false,"description":"Filter by original payment ID","name":"payment_id","in":"query"},{"schema":{"type":"string","description":"Filter by payment gateway (nmi, stripe, etc.)"},"required":false,"description":"Filter by payment gateway (nmi, stripe, etc.)","name":"gateway","in":"query"},{"schema":{"type":"string","enum":["customer_request","duplicate","fraudulent","product_not_received","product_unacceptable","subscription_canceled","other"],"description":"Filter by refund reason"},"required":false,"description":"Filter by refund reason","name":"reason","in":"query"},{"schema":{"type":"string","description":"ISO 8601 date - only refunds created after this date","example":"2024-01-01T00:00:00Z"},"required":false,"description":"ISO 8601 date - only refunds created after this date","name":"created_after","in":"query"},{"schema":{"type":"string","description":"ISO 8601 date - only refunds created before this date","example":"2024-12-31T23:59:59Z"},"required":false,"description":"ISO 8601 date - only refunds created before this date","name":"created_before","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":20,"description":"Number of results to return (1-100)","example":20},"required":false,"description":"Number of results to return (1-100)","name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"default":0,"description":"Number of results to skip","example":0},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of refunds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundListResponse"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"x-cli-group":"refunds","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/refunds\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { refundsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await refundsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.RefundsAPI.RefundsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\RefundsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->refundsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"post":{"operationId":"refunds_create","tags":["Refunds"],"x-fern-sdk-group-name":["refunds"],"summary":"Create a refund","description":"Initiate a refund for a payment. The refund will be processed through the original payment gateway.\n\n---\n\n**Related endpoints**\n\n- `GET /refunds` — List refunds\n- `GET /refunds/{id}` — Get refund by ID\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefundInput"}}}},"responses":{"201":{"description":"Refund created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundCreateResponse"}}}},"400":{"description":"Invalid request - payment not found, already fully refunded, or invalid amount"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"x-cli-group":"refunds","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/refunds\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"payment_id\": \"660e8400-e29b-41d4-a716-446655440000\",\n    \"amount_minor\": 5000,\n    \"reason\": \"customer_request\",\n    \"reason_details\": \"Customer requested refund via support ticket #12345\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { refundsCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await refundsCreate({\n  body: {\n    \"payment_id\": \"660e8400-e29b-41d4-a716-446655440000\",\n    \"amount_minor\": 5000,\n    \"reason\": \"customer_request\",\n    \"reason_details\": \"Customer requested refund via support ticket #12345\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.RefundsAPI.RefundsCreate(ctx)\n// req = req.RefundsCreateRequest(RefundsCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\RefundsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->refundsCreate(/* RefundsCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/refunds/{id}":{"get":{"operationId":"refunds_get","tags":["Refunds"],"x-fern-sdk-group-name":["refunds"],"summary":"Get refund by ID","description":"Retrieve a single refund by its public ID (ref_xxx) or internal UUID.\n\n---\n\n**Related endpoints**\n\n- `GET /refunds` — List refunds\n- `POST /refunds` — Create a refund\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","description":"Refund public ID (ref_xxx) or UUID"},"required":true,"description":"Refund public ID (ref_xxx) or UUID","name":"id","in":"path"}],"responses":{"200":{"description":"Refund details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRetrieveResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Refund not found"},"500":{"description":"Internal server error"}},"x-cli-group":"refunds","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/refunds/string\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { refundsGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await refundsGet({\n  path: { id: \"string\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.RefundsAPI.RefundsGet(ctx)\n// path param id = \"string\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\RefundsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->refundsGet(\"string\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/credit_notes":{"get":{"operationId":"credit_notes_list","tags":["Credit Notes"],"x-fern-sdk-group-name":["creditNotes"],"summary":"List credit notes","description":"Retrieve a paginated list of credit notes with optional filters. Results are ordered by creation date (newest first).\n\n---\n\n**Related endpoints**\n\n- `POST /credit_notes` — Create a credit note\n- `GET /credit_notes/{id}` — Get credit note by ID\n- `POST /credit_notes/{id}/void` — Void a credit note\n- `GET /credit_notes/invoice/{invoice_id}/eligibility` — Check credit note eligibility for an invoice\n- `GET /credit_notes/transaction/{transaction_id}/reversal-eligibility` — Check reversal eligibility for a transaction\n- `GET /credit_notes/{id}/lines` — List line items on a credit note\n- `POST /credit_notes/preview` — Preview a credit note without creating it\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","enum":["draft","pending","issued","applied","voided"],"description":"Filter by credit note status"},"required":false,"description":"Filter by credit note status","name":"status","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by invoice ID"},"required":false,"description":"Filter by invoice ID","name":"invoice_id","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by customer ID"},"required":false,"description":"Filter by customer ID","name":"customer_id","in":"query"},{"schema":{"type":"string","enum":["refund_to_payment_method","customer_balance","external"],"description":"Filter by credit method"},"required":false,"description":"Filter by credit method","name":"credit_method","in":"query"},{"schema":{"type":"string","description":"ISO 8601 date - only credit notes created after this date","example":"2024-01-01T00:00:00Z"},"required":false,"description":"ISO 8601 date - only credit notes created after this date","name":"created_after","in":"query"},{"schema":{"type":"string","description":"ISO 8601 date - only credit notes created before this date","example":"2024-12-31T23:59:59Z"},"required":false,"description":"ISO 8601 date - only credit notes created before this date","name":"created_before","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":20,"description":"Number of results to return (1-100)","example":20},"required":false,"description":"Number of results to return (1-100)","name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"default":0,"description":"Number of results to skip","example":0},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of credit notes","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreditNoteListResponse"},{"description":"A paginated list of credit notes matching the query filters."}]}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"x-cli-group":"credit-notes","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/credit_notes\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { creditNotesList } from \"@revkeen/sdk\";\n\nconst { data, error } = await creditNotesList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CreditAPI.CreditNotesList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CreditApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->creditNotesList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"post":{"operationId":"credit_notes_create","tags":["Credit Notes"],"x-fern-sdk-group-name":["creditNotes"],"summary":"Create a credit note","description":"Issue a credit note for a paid or partially paid invoice. The credit can be applied via refund to payment method, customer balance, or marked as external.\n\n---\n\n**Related endpoints**\n\n- `GET /credit_notes` — List credit notes\n- `GET /credit_notes/{id}` — Get credit note by ID\n- `POST /credit_notes/{id}/void` — Void a credit note\n- `GET /credit_notes/invoice/{invoice_id}/eligibility` — Check credit note eligibility for an invoice\n- `GET /credit_notes/transaction/{transaction_id}/reversal-eligibility` — Check reversal eligibility for a transaction\n- `GET /credit_notes/{id}/lines` — List line items on a credit note\n- `POST /credit_notes/preview` — Preview a credit note without creating it\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `409 conflict` — Idempotency-Key collision with a different body, or a concurrent state-transition conflict.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditNoteInput"}}}},"responses":{"201":{"description":"Credit note created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteCreateResponse"}}}},"400":{"description":"Invalid request - invoice not eligible, amount exceeds creditable, or other validation error"},"401":{"description":"Unauthorized"},"409":{"description":"Duplicate idempotency key"},"500":{"description":"Internal server error"}},"x-cli-group":"credit-notes","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/credit_notes\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"invoice_id\": \"660e8400-e29b-41d4-a716-446655440000\",\n    \"amount_minor\": 5000,\n    \"tax_amount_minor\": 500,\n    \"credit_method\": \"refund_to_payment_method\",\n    \"reason\": \"Service not provided as agreed\",\n    \"reason_code\": \"customer_request\",\n    \"cancel_subscription\": false,\n    \"is_prorated\": false,\n    \"proration_days_total\": 30,\n    \"proration_days_unused\": 12,\n    \"idempotency_key\": \"string\",\n    \"metadata\": {},\n    \"auto_route\": false\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { creditNotesCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await creditNotesCreate({\n  body: {\n    \"invoice_id\": \"660e8400-e29b-41d4-a716-446655440000\",\n    \"amount_minor\": 5000,\n    \"tax_amount_minor\": 500,\n    \"credit_method\": \"refund_to_payment_method\",\n    \"reason\": \"Service not provided as agreed\",\n    \"reason_code\": \"customer_request\",\n    \"cancel_subscription\": false,\n    \"is_prorated\": false,\n    \"proration_days_total\": 30,\n    \"proration_days_unused\": 12,\n    \"idempotency_key\": \"string\",\n    \"metadata\": {},\n    \"auto_route\": false\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CreditAPI.CreditNotesCreate(ctx)\n// req = req.CreditNotesCreateRequest(CreditNotesCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CreditApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->creditNotesCreate(/* CreditNotesCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/credit_notes/{id}":{"get":{"operationId":"credit_notes_get","tags":["Credit Notes"],"x-fern-sdk-group-name":["creditNotes"],"summary":"Get credit note by ID","description":"Retrieve a single credit note by its UUID.\n\n---\n\n**Related endpoints**\n\n- `GET /credit_notes` — List credit notes\n- `POST /credit_notes` — Create a credit note\n- `POST /credit_notes/{id}/void` — Void a credit note\n- `GET /credit_notes/invoice/{invoice_id}/eligibility` — Check credit note eligibility for an invoice\n- `GET /credit_notes/transaction/{transaction_id}/reversal-eligibility` — Check reversal eligibility for a transaction\n- `GET /credit_notes/{id}/lines` — List line items on a credit note\n- `POST /credit_notes/preview` — Preview a credit note without creating it\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Credit note UUID"},"required":true,"description":"Credit note UUID","name":"id","in":"path"}],"responses":{"200":{"description":"Credit note details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteRetrieveResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Credit note not found"},"500":{"description":"Internal server error"}},"x-cli-group":"credit-notes","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/credit_notes/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { creditNotesGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await creditNotesGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CreditAPI.CreditNotesGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CreditApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->creditNotesGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/credit_notes/{id}/void":{"post":{"operationId":"credit_notes_void","tags":["Credit Notes"],"x-fern-sdk-group-name":["creditNotes"],"summary":"Void a credit note","description":"Void a credit note that has been issued but not yet fully applied. This is an accounting void — it reverses the credit without creating a new financial transaction.\n\n---\n\n**Related endpoints**\n\n- `GET /credit_notes` — List credit notes\n- `POST /credit_notes` — Create a credit note\n- `GET /credit_notes/{id}` — Get credit note by ID\n- `GET /credit_notes/invoice/{invoice_id}/eligibility` — Check credit note eligibility for an invoice\n- `GET /credit_notes/transaction/{transaction_id}/reversal-eligibility` — Check reversal eligibility for a transaction\n- `GET /credit_notes/{id}/lines` — List line items on a credit note\n- `POST /credit_notes/preview` — Preview a credit note without creating it\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Credit note UUID"},"required":true,"description":"Credit note UUID","name":"id","in":"path"}],"responses":{"200":{"description":"Credit note voided successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteVoidResponse"}}}},"400":{"description":"Credit note cannot be voided (already voided or applied)"},"401":{"description":"Unauthorized"},"404":{"description":"Credit note not found"},"500":{"description":"Internal server error"}},"x-cli-group":"credit-notes","x-cli-name":"void","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/credit_notes/00000000-0000-0000-0000-000000000000/void\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { creditNotesVoid } from \"@revkeen/sdk\";\n\nconst { data, error } = await creditNotesVoid({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CreditAPI.CreditNotesVoid(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CreditApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->creditNotesVoid(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/credit_notes/{id}/lines":{"get":{"operationId":"credit_notes_list_lines","tags":["Credit Notes"],"x-fern-sdk-group-name":["creditNotes"],"summary":"List line items on a credit note","description":"Returns the line items attached to a credit note. Each line describes a portion of the invoice that the credit applies to — either a whole invoice line or a prorated slice. Use this to reconstruct the credit's effect per invoice line (for example, when displaying the credit breakdown in your own UI).\n\n---\n\n**Related endpoints**\n\n- `GET /credit_notes` — List credit notes\n- `POST /credit_notes` — Create a credit note\n- `GET /credit_notes/{id}` — Get credit note by ID\n- `POST /credit_notes/{id}/void` — Void a credit note\n- `GET /credit_notes/invoice/{invoice_id}/eligibility` — Check credit note eligibility for an invoice\n- `GET /credit_notes/transaction/{transaction_id}/reversal-eligibility` — Check reversal eligibility for a transaction\n- `POST /credit_notes/preview` — Preview a credit note without creating it\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Credit note UUID"},"required":true,"description":"Credit note UUID","name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Line items on the credit note.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteLineList"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Credit note not found"}},"x-cli-group":"credit-notes","x-cli-name":"list-lines","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/credit_notes/00000000-0000-0000-0000-000000000000/lines\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { creditNotesListLines } from \"@revkeen/sdk\";\n\nconst { data, error } = await creditNotesListLines({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CreditAPI.CreditNotesListLines(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CreditApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->creditNotesListLines(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/credit_notes/preview":{"post":{"operationId":"credit_notes_preview","tags":["Credit Notes"],"x-fern-sdk-group-name":["creditNotes"],"summary":"Preview a credit note without creating it","description":"Compute what a credit note would look like against a specific invoice without persisting anything. Use this to validate amounts and show a \"here's what will happen\" UI before the merchant commits. No side effects — no DB writes, no events emitted, no refunds initiated. Mirrors Stripe's `POST /v1/credit_notes/preview`.\n\n---\n\n**Related endpoints**\n\n- `GET /credit_notes` — List credit notes\n- `POST /credit_notes` — Create a credit note\n- `GET /credit_notes/{id}` — Get credit note by ID\n- `POST /credit_notes/{id}/void` — Void a credit note\n- `GET /credit_notes/invoice/{invoice_id}/eligibility` — Check credit note eligibility for an invoice\n- `GET /credit_notes/transaction/{transaction_id}/reversal-eligibility` — Check reversal eligibility for a transaction\n- `GET /credit_notes/{id}/lines` — List line items on a credit note\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewCreditNoteInput"}}}},"responses":{"200":{"description":"Preview computed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNotePreviewResponse"}}}},"400":{"description":"Invalid preview input"},"401":{"description":"Unauthorized"},"404":{"description":"Invoice not found"}},"x-cli-group":"credit-notes","x-cli-name":"preview","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/credit_notes/preview\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"invoice_id\": \"660e8400-e29b-41d4-a716-446655440000\",\n    \"amount_minor\": 5000,\n    \"tax_amount_minor\": 500,\n    \"credit_method\": \"refund_to_payment_method\",\n    \"reason_code\": \"customer_request\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { creditNotesPreview } from \"@revkeen/sdk\";\n\nconst { data, error } = await creditNotesPreview({\n  body: {\n    \"invoice_id\": \"660e8400-e29b-41d4-a716-446655440000\",\n    \"amount_minor\": 5000,\n    \"tax_amount_minor\": 500,\n    \"credit_method\": \"refund_to_payment_method\",\n    \"reason_code\": \"customer_request\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CreditAPI.CreditNotesPreview(ctx)\n// req = req.CreditNotesPreviewRequest(CreditNotesPreviewRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CreditApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->creditNotesPreview(/* CreditNotesPreviewRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-links":{"post":{"operationId":"payment_links_create","tags":["Payment Links"],"summary":"Create a new payment link","description":"Create a new payment link for invoices, subscriptions, or custom amounts\n\n---\n\n**Related endpoints**\n\n- `GET /payment-links` — List payment links\n- `GET /payment-links/{id}` — Get payment link by ID\n- `POST /payment-links/{id}/expire` — Expire a payment link (deprecated)\n- `PATCH /payment-links/{id}/status` — Update payment link status\n- `POST /payment-links/{id}/deactivate` — Deactivate a payment link (deprecated)\n- `POST /payment-links/{id}/activate` — Activate a payment link (deprecated)\n- `POST /payment-links/{id}/archive` — Archive a payment link (deprecated)\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `409 conflict` — Idempotency-Key collision with a different body, or a concurrent state-transition conflict.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"line_items":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string","format":"uuid"},"price_data":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"unit_amount":{"type":"integer","minimum":0},"product_data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"]},"images":{"type":["array","null"],"items":{"type":"string","format":"uri"}},"metadata":{"type":["object","null"],"additionalProperties":{}}},"required":["name"]},"product":{"type":"string","format":"uuid"},"recurring":{"type":["object","null"],"properties":{"interval":{"type":"string","enum":["day","week","month","year"]},"interval_count":{"type":"integer","minimum":1,"default":1}},"required":["interval"]},"tax_behavior":{"type":["string","null"],"enum":["inclusive","exclusive",null]}},"required":["unit_amount"]},"quantity":{"type":"integer","minimum":1,"default":1},"merchant_reference":{"type":["string","null"],"maxLength":255}}}},"name":{"type":"string"},"slug":{"type":"string"},"mode":{"type":"string","enum":["invoice","subscription","custom"],"default":"custom"},"amount_minor":{"type":"integer","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"invoice_id":{"type":"string","format":"uuid"},"subscription_id":{"type":"string","format":"uuid"},"success_url":{"type":"string","format":"uri","description":"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."},"cancel_url":{"type":"string","format":"uri","description":"Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured."},"redirect_url":{"type":"string","format":"uri"},"collect_shipping":{"type":"boolean","default":false},"allow_promotion_codes":{"type":"boolean","default":true},"tax_behavior":{"type":"string","enum":["exclusive","inclusive","unspecified"],"default":"unspecified"},"metadata":{"type":"object","additionalProperties":{}},"expires_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string"}}}}}},"responses":{"201":{"description":"Payment link created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchant_id":{"type":"string","format":"uuid"},"public_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"mode":{"type":"string","enum":["invoice","subscription","custom"]},"status":{"type":"string","enum":["draft","active","expired","completed"]},"amount_minor":{"type":["integer","null"]},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"invoice_id":{"type":["string","null"],"format":"uuid"},"subscription_id":{"type":["string","null"],"format":"uuid"},"product_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"line_items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"price_id":{"type":["string","null"],"format":"uuid"},"quantity":{"type":"integer","minimum":1},"merchant_reference":{"type":["string","null"]},"is_adhoc":{"type":"boolean"},"product_details":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"unit_amount":{"type":"integer"},"currency":{"type":"string"},"recurring":{"type":["object","null"],"properties":{"interval":{"type":"string","enum":["day","week","month","year"]},"interval_count":{"type":"integer","minimum":1,"default":1}},"required":["interval"]}},"required":["name","unit_amount","currency"]}},"required":["product_id","quantity","is_adhoc"]}},"success_url":{"type":["string","null"],"format":"uri","description":"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."},"cancel_url":{"type":["string","null"],"format":"uri","description":"Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured."},"redirect_url":{"type":["string","null"],"format":"uri"},"collect_shipping":{"type":"boolean","default":false},"allow_promotion_codes":{"type":"boolean","default":true},"tax_behavior":{"type":"string","enum":["exclusive","inclusive","unspecified"],"default":"unspecified"},"metadata":{"type":["object","null"],"additionalProperties":{}},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","merchant_id","public_id","mode","status","created_at","updated_at"]}}}},"400":{"description":"Validation error or invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}},"401":{"description":"Unauthorized - missing or invalid authentication"},"409":{"description":"Conflict - payment link already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}}},"x-cli-group":"payment-links","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-links\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"product_ids\": [\n      \"00000000-0000-0000-0000-000000000000\"\n    ],\n    \"line_items\": [\n      {\n        \"price\": \"00000000-0000-0000-0000-000000000000\",\n        \"price_data\": {\n          \"currency\": \"USD\",\n          \"unit_amount\": 0,\n          \"product_data\": {\n            \"name\": null,\n            \"description\": null,\n            \"images\": null,\n            \"metadata\": null\n          },\n          \"product\": \"00000000-0000-0000-0000-000000000000\",\n          \"recurring\": null,\n          \"tax_behavior\": \"inclusive\"\n        },\n        \"quantity\": 1,\n        \"merchant_reference\": null\n      }\n    ],\n    \"name\": \"string\",\n    \"slug\": \"string\",\n    \"mode\": \"custom\",\n    \"amount_minor\": 0,\n    \"currency\": \"USD\",\n    \"invoice_id\": \"00000000-0000-0000-0000-000000000000\",\n    \"subscription_id\": \"00000000-0000-0000-0000-000000000000\",\n    \"success_url\": \"https://example.com\",\n    \"cancel_url\": \"https://example.com\",\n    \"redirect_url\": \"https://example.com\",\n    \"collect_shipping\": false,\n    \"allow_promotion_codes\": true,\n    \"tax_behavior\": \"unspecified\",\n    \"metadata\": {},\n    \"expires_at\": \"2026-01-01T00:00:00Z\",\n    \"idempotency_key\": \"string\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksCreate({\n  body: {\n    \"product_ids\": [\n      \"00000000-0000-0000-0000-000000000000\"\n    ],\n    \"line_items\": [\n      {\n        \"price\": \"00000000-0000-0000-0000-000000000000\",\n        \"price_data\": {\n          \"currency\": \"USD\",\n          \"unit_amount\": 0,\n          \"product_data\": {\n            \"name\": null,\n            \"description\": null,\n            \"images\": null,\n            \"metadata\": null\n          },\n          \"product\": \"00000000-0000-0000-0000-000000000000\",\n          \"recurring\": null,\n          \"tax_behavior\": \"inclusive\"\n        },\n        \"quantity\": 1,\n        \"merchant_reference\": null\n      }\n    ],\n    \"name\": \"string\",\n    \"slug\": \"string\",\n    \"mode\": \"custom\",\n    \"amount_minor\": 0,\n    \"currency\": \"USD\",\n    \"invoice_id\": \"00000000-0000-0000-0000-000000000000\",\n    \"subscription_id\": \"00000000-0000-0000-0000-000000000000\",\n    \"success_url\": \"https://example.com\",\n    \"cancel_url\": \"https://example.com\",\n    \"redirect_url\": \"https://example.com\",\n    \"collect_shipping\": false,\n    \"allow_promotion_codes\": true,\n    \"tax_behavior\": \"unspecified\",\n    \"metadata\": {},\n    \"expires_at\": \"2026-01-01T00:00:00Z\",\n    \"idempotency_key\": \"string\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksCreate(ctx)\n// req = req.PaymentLinksCreateRequest(PaymentLinksCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksCreate(/* PaymentLinksCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"get":{"operationId":"payment_links_list","tags":["Payment Links"],"summary":"List payment links","description":"List payment links for the authenticated merchant with pagination and filters\n\n---\n\n**Related endpoints**\n\n- `POST /payment-links` — Create a new payment link\n- `GET /payment-links/{id}` — Get payment link by ID\n- `POST /payment-links/{id}/expire` — Expire a payment link (deprecated)\n- `PATCH /payment-links/{id}/status` — Update payment link status\n- `POST /payment-links/{id}/deactivate` — Deactivate a payment link (deprecated)\n- `POST /payment-links/{id}/activate` — Activate a payment link (deprecated)\n- `POST /payment-links/{id}/archive` — Archive a payment link (deprecated)\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","enum":["draft","active","expired","completed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["invoice","subscription","custom"]},"required":false,"name":"mode","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Payment links retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchant_id":{"type":"string","format":"uuid"},"public_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"mode":{"type":"string","enum":["invoice","subscription","custom"]},"status":{"type":"string","enum":["draft","active","expired","completed"]},"amount_minor":{"type":["integer","null"]},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"invoice_id":{"type":["string","null"],"format":"uuid"},"subscription_id":{"type":["string","null"],"format":"uuid"},"product_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"line_items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"price_id":{"type":["string","null"],"format":"uuid"},"quantity":{"type":"integer","minimum":1},"merchant_reference":{"type":["string","null"]},"is_adhoc":{"type":"boolean"},"product_details":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"unit_amount":{"type":"integer"},"currency":{"type":"string"},"recurring":{"type":["object","null"],"properties":{"interval":{"type":"string","enum":["day","week","month","year"]},"interval_count":{"type":"integer","minimum":1,"default":1}},"required":["interval"]}},"required":["name","unit_amount","currency"]}},"required":["product_id","quantity","is_adhoc"]}},"success_url":{"type":["string","null"],"format":"uri","description":"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."},"cancel_url":{"type":["string","null"],"format":"uri","description":"Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured."},"redirect_url":{"type":["string","null"],"format":"uri"},"collect_shipping":{"type":"boolean","default":false},"allow_promotion_codes":{"type":"boolean","default":true},"tax_behavior":{"type":"string","enum":["exclusive","inclusive","unspecified"],"default":"unspecified"},"metadata":{"type":["object","null"],"additionalProperties":{}},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","merchant_id","public_id","mode","status","created_at","updated_at"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["limit","offset","total"]}},"required":["data","pagination"]}}}},"400":{"description":"Validation error in query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}},"401":{"description":"Unauthorized - missing or invalid authentication"}},"x-cli-group":"payment-links","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/payment-links\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksList } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-links/{id}":{"get":{"operationId":"payment_links_get","tags":["Payment Links"],"summary":"Get payment link by ID","description":"Retrieve a payment link by its UUID or public_id\n\n---\n\n**Related endpoints**\n\n- `POST /payment-links` — Create a new payment link\n- `GET /payment-links` — List payment links\n- `POST /payment-links/{id}/expire` — Expire a payment link (deprecated)\n- `PATCH /payment-links/{id}/status` — Update payment link status\n- `POST /payment-links/{id}/deactivate` — Deactivate a payment link (deprecated)\n- `POST /payment-links/{id}/activate` — Activate a payment link (deprecated)\n- `POST /payment-links/{id}/archive` — Archive a payment link (deprecated)\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","minLength":1,"description":"Payment link UUID or public_id"},"required":true,"description":"Payment link UUID or public_id","name":"id","in":"path"}],"responses":{"200":{"description":"Payment link retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchant_id":{"type":"string","format":"uuid"},"public_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"mode":{"type":"string","enum":["invoice","subscription","custom"]},"status":{"type":"string","enum":["draft","active","expired","completed"]},"amount_minor":{"type":["integer","null"]},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"invoice_id":{"type":["string","null"],"format":"uuid"},"subscription_id":{"type":["string","null"],"format":"uuid"},"product_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"line_items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"price_id":{"type":["string","null"],"format":"uuid"},"quantity":{"type":"integer","minimum":1},"merchant_reference":{"type":["string","null"]},"is_adhoc":{"type":"boolean"},"product_details":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"unit_amount":{"type":"integer"},"currency":{"type":"string"},"recurring":{"type":["object","null"],"properties":{"interval":{"type":"string","enum":["day","week","month","year"]},"interval_count":{"type":"integer","minimum":1,"default":1}},"required":["interval"]}},"required":["name","unit_amount","currency"]}},"required":["product_id","quantity","is_adhoc"]}},"success_url":{"type":["string","null"],"format":"uri","description":"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."},"cancel_url":{"type":["string","null"],"format":"uri","description":"Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured."},"redirect_url":{"type":["string","null"],"format":"uri"},"collect_shipping":{"type":"boolean","default":false},"allow_promotion_codes":{"type":"boolean","default":true},"tax_behavior":{"type":"string","enum":["exclusive","inclusive","unspecified"],"default":"unspecified"},"metadata":{"type":["object","null"],"additionalProperties":{}},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","merchant_id","public_id","mode","status","created_at","updated_at"]}}}},"401":{"description":"Unauthorized - missing or invalid authentication"},"404":{"description":"Payment link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}}},"x-cli-group":"payment-links","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/payment-links/string\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksGet({\n  path: { id: \"string\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksGet(ctx)\n// path param id = \"string\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksGet(\"string\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-links/{id}/expire":{"post":{"operationId":"payment_links_expire","tags":["Payment Links"],"deprecated":true,"summary":"Expire a payment link (deprecated)","description":"**Deprecated — use `PATCH /v2/payment-links/{id}/status` with `status: \"expired\"` instead.** This convenience endpoint will be removed in a future API version. Mark a payment link as expired, preventing further use.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-links` — Create a new payment link\n- `GET /payment-links` — List payment links\n- `GET /payment-links/{id}` — Get payment link by ID\n- `PATCH /payment-links/{id}/status` — Update payment link status\n- `POST /payment-links/{id}/deactivate` — Deactivate a payment link (deprecated)\n- `POST /payment-links/{id}/activate` — Activate a payment link (deprecated)\n- `POST /payment-links/{id}/archive` — Archive a payment link (deprecated)\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","minLength":1,"description":"Payment link UUID or public_id"},"required":true,"description":"Payment link UUID or public_id","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Payment link expired successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"merchant_id":{"type":"string","format":"uuid"},"public_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":["string","null"]},"mode":{"type":"string","enum":["invoice","subscription","custom"]},"status":{"type":"string","enum":["draft","active","expired","completed"]},"amount_minor":{"type":["integer","null"]},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"invoice_id":{"type":["string","null"],"format":"uuid"},"subscription_id":{"type":["string","null"],"format":"uuid"},"product_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"line_items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid"},"price_id":{"type":["string","null"],"format":"uuid"},"quantity":{"type":"integer","minimum":1},"merchant_reference":{"type":["string","null"]},"is_adhoc":{"type":"boolean"},"product_details":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"unit_amount":{"type":"integer"},"currency":{"type":"string"},"recurring":{"type":["object","null"],"properties":{"interval":{"type":"string","enum":["day","week","month","year"]},"interval_count":{"type":"integer","minimum":1,"default":1}},"required":["interval"]}},"required":["name","unit_amount","currency"]}},"required":["product_id","quantity","is_adhoc"]}},"success_url":{"type":["string","null"],"format":"uri","description":"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."},"cancel_url":{"type":["string","null"],"format":"uri","description":"Custom URL to redirect if customer cancels the checkout. If not set, no cancel redirect is configured."},"redirect_url":{"type":["string","null"],"format":"uri"},"collect_shipping":{"type":"boolean","default":false},"allow_promotion_codes":{"type":"boolean","default":true},"tax_behavior":{"type":"string","enum":["exclusive","inclusive","unspecified"],"default":"unspecified"},"metadata":{"type":["object","null"],"additionalProperties":{}},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","merchant_id","public_id","mode","status","created_at","updated_at"]}}}},"400":{"description":"Validation error or payment link already expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}},"401":{"description":"Unauthorized - missing or invalid authentication"},"404":{"description":"Payment link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}}},"x-cli-group":"payment-links","x-cli-name":"expire","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-links/string/expire\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"reason\": \"string\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksExpire } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksExpire({\n  path: { id: \"string\" },\n  body: {\n    \"reason\": \"string\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksExpire(ctx)\n// path param id = \"string\"\n// req = req.PaymentLinksExpireRequest(PaymentLinksExpireRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksExpire(\"string\", /* PaymentLinksExpireRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-links/{id}/status":{"patch":{"operationId":"payment_links_update","tags":["Payment Links"],"summary":"Update payment link status","description":"Change the status of a payment link. Active links accept payments, inactive links are temporarily disabled, and archived links are permanently disabled and cannot be reactivated.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-links` — Create a new payment link\n- `GET /payment-links` — List payment links\n- `GET /payment-links/{id}` — Get payment link by ID\n- `POST /payment-links/{id}/expire` — Expire a payment link (deprecated)\n- `POST /payment-links/{id}/deactivate` — Deactivate a payment link (deprecated)\n- `POST /payment-links/{id}/activate` — Activate a payment link (deprecated)\n- `POST /payment-links/{id}/archive` — Archive a payment link (deprecated)\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","minLength":1,"description":"Payment link UUID or public_id"},"required":true,"description":"Payment link UUID or public_id","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","inactive","archived"],"description":"New status for the payment link"}},"required":["status"]}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","inactive","archived"]},"status_changed_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","status_changed_at","is_active","updated_at"]}}}},"400":{"description":"Invalid status transition (e.g., trying to reactivate archived link)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}},"401":{"description":"Unauthorized - missing or invalid authentication"},"404":{"description":"Payment link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}}},"x-cli-group":"payment-links","x-cli-name":"update","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH \"https://api.revkeen.com/v2/payment-links/string/status\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"status\": \"active\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksUpdate } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksUpdate({\n  path: { id: \"string\" },\n  body: {\n    \"status\": \"active\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksUpdate(ctx)\n// path param id = \"string\"\n// req = req.PaymentLinksUpdateRequest(PaymentLinksUpdateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksUpdate(\"string\", /* PaymentLinksUpdateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-links/{id}/deactivate":{"post":{"operationId":"payment_links_deactivate","tags":["Payment Links"],"deprecated":true,"summary":"Deactivate a payment link (deprecated)","description":"**Deprecated — use `PATCH /v2/payment-links/{id}/status` with `status: \"inactive\"` instead.** This convenience endpoint will be removed in a future API version. Temporarily disable a payment link. It can be reactivated later.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-links` — Create a new payment link\n- `GET /payment-links` — List payment links\n- `GET /payment-links/{id}` — Get payment link by ID\n- `POST /payment-links/{id}/expire` — Expire a payment link (deprecated)\n- `PATCH /payment-links/{id}/status` — Update payment link status\n- `POST /payment-links/{id}/activate` — Activate a payment link (deprecated)\n- `POST /payment-links/{id}/archive` — Archive a payment link (deprecated)\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","minLength":1,"description":"Payment link UUID or public_id"},"required":true,"description":"Payment link UUID or public_id","name":"id","in":"path"}],"responses":{"200":{"description":"Payment link deactivated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","inactive","archived"]},"status_changed_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","status_changed_at","is_active","updated_at"]}}}},"400":{"description":"Link is already archived and cannot be modified","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}},"401":{"description":"Unauthorized"},"404":{"description":"Payment link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}}},"x-cli-group":"payment-links","x-cli-name":"deactivate","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-links/string/deactivate\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksDeactivate } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksDeactivate({\n  path: { id: \"string\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksDeactivate(ctx)\n// path param id = \"string\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksDeactivate(\"string\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-links/{id}/activate":{"post":{"operationId":"payment_links_activate","tags":["Payment Links"],"deprecated":true,"summary":"Activate a payment link (deprecated)","description":"**Deprecated — use `PATCH /v2/payment-links/{id}/status` with `status: \"active\"` instead.** This convenience endpoint will be removed in a future API version. Enable a payment link to accept payments. Cannot be used on archived links.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-links` — Create a new payment link\n- `GET /payment-links` — List payment links\n- `GET /payment-links/{id}` — Get payment link by ID\n- `POST /payment-links/{id}/expire` — Expire a payment link (deprecated)\n- `PATCH /payment-links/{id}/status` — Update payment link status\n- `POST /payment-links/{id}/deactivate` — Deactivate a payment link (deprecated)\n- `POST /payment-links/{id}/archive` — Archive a payment link (deprecated)\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","minLength":1,"description":"Payment link UUID or public_id"},"required":true,"description":"Payment link UUID or public_id","name":"id","in":"path"}],"responses":{"200":{"description":"Payment link activated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","inactive","archived"]},"status_changed_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","status_changed_at","is_active","updated_at"]}}}},"400":{"description":"Link is archived and cannot be reactivated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}},"401":{"description":"Unauthorized"},"404":{"description":"Payment link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}}},"x-cli-group":"payment-links","x-cli-name":"activate","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-links/string/activate\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksActivate } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksActivate({\n  path: { id: \"string\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksActivate(ctx)\n// path param id = \"string\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksActivate(\"string\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-links/{id}/archive":{"post":{"operationId":"payment_links_archive","tags":["Payment Links"],"deprecated":true,"summary":"Archive a payment link (deprecated)","description":"**Deprecated — use `PATCH /v2/payment-links/{id}/status` with `status: \"archived\"` instead.** This convenience endpoint will be removed in a future API version. Permanently disable a payment link. This action cannot be undone.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-links` — Create a new payment link\n- `GET /payment-links` — List payment links\n- `GET /payment-links/{id}` — Get payment link by ID\n- `POST /payment-links/{id}/expire` — Expire a payment link (deprecated)\n- `PATCH /payment-links/{id}/status` — Update payment link status\n- `POST /payment-links/{id}/deactivate` — Deactivate a payment link (deprecated)\n- `POST /payment-links/{id}/activate` — Activate a payment link (deprecated)\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","minLength":1,"description":"Payment link UUID or public_id"},"required":true,"description":"Payment link UUID or public_id","name":"id","in":"path"}],"responses":{"200":{"description":"Payment link archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","inactive","archived"]},"status_changed_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","status_changed_at","is_active","updated_at"]}}}},"401":{"description":"Unauthorized"},"404":{"description":"Payment link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"details":{}},"required":["error"]}}}}},"x-cli-group":"payment-links","x-cli-name":"archive","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-links/string/archive\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { paymentLinksArchive } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentLinksArchive({\n  path: { id: \"string\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentLinksArchive(ctx)\n// path param id = \"string\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentLinksArchive(\"string\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/prices":{"get":{"operationId":"prices_list","tags":["Prices"],"x-fern-sdk-group-name":["prices"],"summary":"List prices","description":"List all prices for the authenticated merchant. Supports filtering and cursor-based pagination.\n\n---\n\n**Related endpoints**\n\n- `POST /prices` — Create a price\n- `GET /prices/{id}` — Retrieve a price\n- `PATCH /prices/{id}` — Update a price\n- `DELETE /prices/{id}` — Archive a price\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Filter by product ID"},"required":false,"description":"Filter by product ID","name":"product_id","in":"query"},{"schema":{"type":"string","enum":["one_time","recurring"],"description":"Filter by price type"},"required":false,"description":"Filter by price type","name":"type","in":"query"},{"schema":{"type":"string","enum":["fixed","pay_what_you_want","free"],"description":"Filter by pricing model"},"required":false,"description":"Filter by pricing model","name":"pricing_model","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Filter by active status"},"required":false,"description":"Filter by active status","name":"active","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":3,"description":"Filter by currency"},"required":false,"description":"Filter by currency","name":"currency","in":"query"},{"schema":{"type":"string","description":"Filter by lookup key"},"required":false,"description":"Filter by lookup key","name":"lookup_key","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of results (1-100)"},"required":false,"description":"Number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor for pagination (ID to start after)"},"required":false,"description":"Cursor for pagination (ID to start after)","name":"starting_after","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor for pagination (ID to end before)"},"required":false,"description":"Cursor for pagination (ID to end before)","name":"ending_before","in":"query"}],"responses":{"200":{"description":"List of prices","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}}},"x-cli-group":"prices","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/prices\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { pricesList } from \"@revkeen/sdk\";\n\nconst { data, error } = await pricesList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PricesAPI.PricesList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PricesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->pricesList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"post":{"operationId":"prices_create","tags":["Prices"],"x-fern-sdk-group-name":["prices"],"summary":"Create a price","description":"Creates a new price for a product. Supports fixed, pay-what-you-want, and free pricing models.\n\n---\n\n**Related endpoints**\n\n- `GET /prices` — List prices\n- `GET /prices/{id}` — Retrieve a price\n- `PATCH /prices/{id}` — Update a price\n- `DELETE /prices/{id}` — Archive a price\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"description":"Price creation details","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePriceRequest"}}}},"responses":{"201":{"description":"Price created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}}},"x-cli-group":"prices","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/prices\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"product_id\": \"00000000-0000-0000-0000-000000000000\",\n    \"currency\": \"usd\",\n    \"unit_amount\": 0,\n    \"type\": \"one_time\",\n    \"pricing_model\": \"fixed\",\n    \"interval\": \"day\",\n    \"interval_count\": 0,\n    \"trial_period_days\": 0,\n    \"minimum_amount\": 0,\n    \"maximum_amount\": 0,\n    \"suggested_amount\": 0,\n    \"preset_amounts\": [\n      0\n    ],\n    \"nickname\": \"string\",\n    \"lookup_key\": \"string\",\n    \"billing_scheme\": \"per_unit\",\n    \"tiers_mode\": \"graduated\",\n    \"tiers\": [\n      {\n        \"up_to\": null,\n        \"unit_amount_minor\": null,\n        \"flat_amount_minor\": null\n      }\n    ],\n    \"transform_quantity\": {\n      \"divide_by\": 0,\n      \"round\": \"up\"\n    },\n    \"metadata\": {}\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { pricesCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await pricesCreate({\n  body: {\n    \"product_id\": \"00000000-0000-0000-0000-000000000000\",\n    \"currency\": \"usd\",\n    \"unit_amount\": 0,\n    \"type\": \"one_time\",\n    \"pricing_model\": \"fixed\",\n    \"interval\": \"day\",\n    \"interval_count\": 0,\n    \"trial_period_days\": 0,\n    \"minimum_amount\": 0,\n    \"maximum_amount\": 0,\n    \"suggested_amount\": 0,\n    \"preset_amounts\": [\n      0\n    ],\n    \"nickname\": \"string\",\n    \"lookup_key\": \"string\",\n    \"billing_scheme\": \"per_unit\",\n    \"tiers_mode\": \"graduated\",\n    \"tiers\": [\n      {\n        \"up_to\": null,\n        \"unit_amount_minor\": null,\n        \"flat_amount_minor\": null\n      }\n    ],\n    \"transform_quantity\": {\n      \"divide_by\": 0,\n      \"round\": \"up\"\n    },\n    \"metadata\": {}\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PricesAPI.PricesCreate(ctx)\n// req = req.PricesCreateRequest(PricesCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PricesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->pricesCreate(/* PricesCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/prices/{id}":{"get":{"operationId":"prices_get","tags":["Prices"],"x-fern-sdk-group-name":["prices"],"summary":"Retrieve a price","description":"Retrieves a price by its ID.\n\n---\n\n**Related endpoints**\n\n- `GET /prices` — List prices\n- `POST /prices` — Create a price\n- `PATCH /prices/{id}` — Update a price\n- `DELETE /prices/{id}` — Archive a price\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Price ID"},"required":true,"description":"Price ID","name":"id","in":"path"}],"responses":{"200":{"description":"Price details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}},"404":{"description":"Price not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}}},"x-cli-group":"prices","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/prices/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { pricesGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await pricesGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PricesAPI.PricesGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PricesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->pricesGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"patch":{"operationId":"prices_update","tags":["Prices"],"x-fern-sdk-group-name":["prices"],"summary":"Update a price","description":"Updates a price. Only certain fields can be updated (active, nickname, lookup_key, metadata). Core pricing fields are immutable.\n\n---\n\n**Related endpoints**\n\n- `GET /prices` — List prices\n- `POST /prices` — Create a price\n- `GET /prices/{id}` — Retrieve a price\n- `DELETE /prices/{id}` — Archive a price\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Price ID"},"required":true,"description":"Price ID","name":"id","in":"path"}],"requestBody":{"description":"Price update details","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePriceRequest"}}}},"responses":{"200":{"description":"Price updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}},"404":{"description":"Price not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}}},"x-cli-group":"prices","x-cli-name":"update","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH \"https://api.revkeen.com/v2/prices/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"active\": false,\n    \"nickname\": null,\n    \"lookup_key\": null,\n    \"metadata\": {}\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { pricesUpdate } from \"@revkeen/sdk\";\n\nconst { data, error } = await pricesUpdate({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"active\": false,\n    \"nickname\": null,\n    \"lookup_key\": null,\n    \"metadata\": {}\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PricesAPI.PricesUpdate(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.PricesUpdateRequest(PricesUpdateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PricesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->pricesUpdate(\"00000000-0000-0000-0000-000000000000\", /* PricesUpdateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"delete":{"operationId":"prices_archive","tags":["Prices"],"x-fern-sdk-group-name":["prices"],"summary":"Archive a price","description":"Archives a price by setting active to false. The price remains in the system but cannot be used for new purchases.\n\n---\n\n**Related endpoints**\n\n- `GET /prices` — List prices\n- `POST /prices` — Create a price\n- `GET /prices/{id}` — Retrieve a price\n- `PATCH /prices/{id}` — Update a price\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Price ID"},"required":true,"description":"Price ID","name":"id","in":"path"}],"responses":{"200":{"description":"Price archived successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}},"404":{"description":"Price not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceErrorResponse"}}}}},"x-cli-group":"prices","x-cli-name":"archive","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://api.revkeen.com/v2/prices/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { pricesArchive } from \"@revkeen/sdk\";\n\nconst { data, error } = await pricesArchive({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PricesAPI.PricesArchive(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PricesApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->pricesArchive(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/webhook-endpoints":{"get":{"operationId":"webhook_endpoints_list","tags":["Webhook Endpoints"],"x-fern-sdk-group-name":["webhookEndpoints"],"summary":"List webhook endpoints","description":"List all webhook endpoints for the authenticated merchant. Supports filtering by status and pagination.\n\n---\n\n**Related endpoints**\n\n- `POST /webhook-endpoints` — Create webhook endpoint\n- `GET /webhook-endpoints/{id}` — Get webhook endpoint\n- `PATCH /webhook-endpoints/{id}` — Update webhook endpoint\n- `DELETE /webhook-endpoints/{id}` — Delete webhook endpoint\n- `POST /webhook-endpoints/{id}/rotate-secret` — Rotate signing secret\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","enum":["enabled","disabled"],"description":"Filter by endpoint status"},"required":false,"description":"Filter by endpoint status","name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results to return (1-100, default 20)"},"required":false,"description":"Maximum number of results to return (1-100, default 20)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Number of results to skip for pagination"},"required":false,"description":"Number of results to skip for pagination","name":"offset","in":"query"}],"responses":{"200":{"description":"List of webhook endpoints","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the webhook endpoint","example":"550e8400-e29b-41d4-a716-446655440000"},"url":{"type":"string","format":"uri","description":"The URL that receives webhook POST requests","example":"https://api.example.com/webhooks/revkeen"},"description":{"type":["string","null"],"description":"Optional human-readable description","example":"Production webhook endpoint"},"enabled_events":{"type":"array","items":{"type":"string"},"description":"Event types this endpoint subscribes to","example":["invoice.paid","payment.succeeded"]},"status":{"type":"string","enum":["enabled","disabled"],"description":"Whether the endpoint is currently receiving events","example":"enabled"},"circuit_breaker_state":{"type":"string","enum":["closed","open","half_open"],"description":"Circuit breaker status. Opens after repeated delivery failures.","example":"closed"},"total_deliveries":{"type":"number","description":"Total number of delivery attempts","example":12},"successful_deliveries":{"type":"number","description":"Number of successful deliveries","example":10},"failed_deliveries":{"type":"number","description":"Number of failed deliveries","example":2},"last_delivery_at":{"type":["string","null"],"description":"Timestamp of the most recent delivery attempt","example":"2026-04-02T10:00:00.000Z"},"created_at":{"type":"string","description":"When the endpoint was created","example":"2026-04-02T10:00:00.000Z"},"updated_at":{"type":"string","description":"When the endpoint was last modified","example":"2026-04-02T10:00:00.000Z"}},"required":["id","url","description","enabled_events","status","circuit_breaker_state","total_deliveries","successful_deliveries","failed_deliveries","last_delivery_at","created_at","updated_at"]}},"meta":{"type":"object","properties":{"total":{"type":"number","description":"Total number of results"},"limit":{"type":"number","description":"Page size"},"offset":{"type":"number","description":"Number of results skipped"},"has_more":{"type":"boolean","description":"Whether more results exist beyond this page"}},"required":["total","limit","offset","has_more"]}},"required":["data","meta"]}}}}},"x-cli-group":"webhook-endpoints","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/webhook-endpoints\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { webhookEndpointsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookEndpointsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookEndpointsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookEndpointsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"post":{"operationId":"webhook_endpoints_create","tags":["Webhook Endpoints"],"x-fern-sdk-group-name":["webhookEndpoints"],"summary":"Create webhook endpoint","description":"Create a webhook endpoint to receive event notifications at the given URL. Returns the endpoint with its signing secret — store the secret securely, it is only shown once.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-endpoints` — List webhook endpoints\n- `GET /webhook-endpoints/{id}` — Get webhook endpoint\n- `PATCH /webhook-endpoints/{id}` — Update webhook endpoint\n- `DELETE /webhook-endpoints/{id}` — Delete webhook endpoint\n- `POST /webhook-endpoints/{id}/rotate-secret` — Rotate signing secret\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL to receive webhook POST requests. Must be HTTPS in production."},"enabled_events":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Event types to subscribe to. At least one event is required."},"description":{"type":"string","maxLength":500,"description":"Optional human-readable description (max 500 characters)"}},"required":["url","enabled_events"]}}}},"responses":{"201":{"description":"Created webhook endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["data"]}}}}},"x-cli-group":"webhook-endpoints","x-cli-name":"create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/webhook-endpoints\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"url\": \"https://example.com\",\n    \"enabled_events\": [\n      \"string\"\n    ]\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { webhookEndpointsCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookEndpointsCreate({\n  body: {\n    \"url\": \"https://example.com\",\n    \"enabled_events\": [\n      \"string\"\n    ]\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookEndpointsCreate(ctx)\n// req = req.WebhookEndpointsCreateRequest(WebhookEndpointsCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookEndpointsCreate(/* WebhookEndpointsCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/webhook-endpoints/{id}":{"get":{"operationId":"webhook_endpoints_get","tags":["Webhook Endpoints"],"x-fern-sdk-group-name":["webhookEndpoints"],"summary":"Get webhook endpoint","description":"Retrieve a single webhook endpoint by ID, including delivery statistics.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-endpoints` — List webhook endpoints\n- `POST /webhook-endpoints` — Create webhook endpoint\n- `PATCH /webhook-endpoints/{id}` — Update webhook endpoint\n- `DELETE /webhook-endpoints/{id}` — Delete webhook endpoint\n- `POST /webhook-endpoints/{id}/rotate-secret` — Rotate signing secret","parameters":[{"schema":{"type":"string","format":"uuid","description":"Webhook endpoint ID"},"required":true,"description":"Webhook endpoint ID","name":"id","in":"path"}],"responses":{"200":{"description":"Webhook endpoint details","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the webhook endpoint","example":"550e8400-e29b-41d4-a716-446655440000"},"url":{"type":"string","format":"uri","description":"The URL that receives webhook POST requests","example":"https://api.example.com/webhooks/revkeen"},"description":{"type":["string","null"],"description":"Optional human-readable description","example":"Production webhook endpoint"},"enabled_events":{"type":"array","items":{"type":"string"},"description":"Event types this endpoint subscribes to","example":["invoice.paid","payment.succeeded"]},"status":{"type":"string","enum":["enabled","disabled"],"description":"Whether the endpoint is currently receiving events","example":"enabled"},"circuit_breaker_state":{"type":"string","enum":["closed","open","half_open"],"description":"Circuit breaker status. Opens after repeated delivery failures.","example":"closed"},"total_deliveries":{"type":"number","description":"Total number of delivery attempts","example":12},"successful_deliveries":{"type":"number","description":"Number of successful deliveries","example":10},"failed_deliveries":{"type":"number","description":"Number of failed deliveries","example":2},"last_delivery_at":{"type":["string","null"],"description":"Timestamp of the most recent delivery attempt","example":"2026-04-02T10:00:00.000Z"},"created_at":{"type":"string","description":"When the endpoint was created","example":"2026-04-02T10:00:00.000Z"},"updated_at":{"type":"string","description":"When the endpoint was last modified","example":"2026-04-02T10:00:00.000Z"}},"required":["id","url","description","enabled_events","status","circuit_breaker_state","total_deliveries","successful_deliveries","failed_deliveries","last_delivery_at","created_at","updated_at"]}},"required":["data"]}}}}},"x-cli-group":"webhook-endpoints","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/webhook-endpoints/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { webhookEndpointsGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookEndpointsGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookEndpointsGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookEndpointsGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"patch":{"operationId":"webhook_endpoints_update","tags":["Webhook Endpoints"],"x-fern-sdk-group-name":["webhookEndpoints"],"summary":"Update webhook endpoint","description":"Update a webhook endpoint's URL, subscribed events, description, or enabled status.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-endpoints` — List webhook endpoints\n- `POST /webhook-endpoints` — Create webhook endpoint\n- `GET /webhook-endpoints/{id}` — Get webhook endpoint\n- `DELETE /webhook-endpoints/{id}` — Delete webhook endpoint\n- `POST /webhook-endpoints/{id}/rotate-secret` — Rotate signing secret\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Webhook endpoint ID"},"required":true,"description":"Webhook endpoint ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"New URL for the endpoint"},"enabled_events":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Replace the subscribed event types"},"description":{"type":["string","null"],"maxLength":500,"description":"Update the description"},"enabled":{"type":"boolean","description":"Enable or disable the endpoint"}}}}}},"responses":{"200":{"description":"Updated webhook endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the webhook endpoint","example":"550e8400-e29b-41d4-a716-446655440000"},"url":{"type":"string","format":"uri","description":"The URL that receives webhook POST requests","example":"https://api.example.com/webhooks/revkeen"},"description":{"type":["string","null"],"description":"Optional human-readable description","example":"Production webhook endpoint"},"enabled_events":{"type":"array","items":{"type":"string"},"description":"Event types this endpoint subscribes to","example":["invoice.paid","payment.succeeded"]},"status":{"type":"string","enum":["enabled","disabled"],"description":"Whether the endpoint is currently receiving events","example":"enabled"},"circuit_breaker_state":{"type":"string","enum":["closed","open","half_open"],"description":"Circuit breaker status. Opens after repeated delivery failures.","example":"closed"},"total_deliveries":{"type":"number","description":"Total number of delivery attempts","example":12},"successful_deliveries":{"type":"number","description":"Number of successful deliveries","example":10},"failed_deliveries":{"type":"number","description":"Number of failed deliveries","example":2},"last_delivery_at":{"type":["string","null"],"description":"Timestamp of the most recent delivery attempt","example":"2026-04-02T10:00:00.000Z"},"created_at":{"type":"string","description":"When the endpoint was created","example":"2026-04-02T10:00:00.000Z"},"updated_at":{"type":"string","description":"When the endpoint was last modified","example":"2026-04-02T10:00:00.000Z"}},"required":["id","url","description","enabled_events","status","circuit_breaker_state","total_deliveries","successful_deliveries","failed_deliveries","last_delivery_at","created_at","updated_at"]}},"required":["data"]}}}}},"x-cli-group":"webhook-endpoints","x-cli-name":"update","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X PATCH \"https://api.revkeen.com/v2/webhook-endpoints/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"url\": \"https://example.com\",\n    \"enabled_events\": [\n      \"string\"\n    ],\n    \"description\": null,\n    \"enabled\": false\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { webhookEndpointsUpdate } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookEndpointsUpdate({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"url\": \"https://example.com\",\n    \"enabled_events\": [\n      \"string\"\n    ],\n    \"description\": null,\n    \"enabled\": false\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookEndpointsUpdate(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.WebhookEndpointsUpdateRequest(WebhookEndpointsUpdateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookEndpointsUpdate(\"00000000-0000-0000-0000-000000000000\", /* WebhookEndpointsUpdateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]},"delete":{"operationId":"webhook_endpoints_delete","tags":["Webhook Endpoints"],"x-fern-sdk-group-name":["webhookEndpoints"],"summary":"Delete webhook endpoint","description":"Permanently delete a webhook endpoint and all its event subscriptions.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-endpoints` — List webhook endpoints\n- `POST /webhook-endpoints` — Create webhook endpoint\n- `GET /webhook-endpoints/{id}` — Get webhook endpoint\n- `PATCH /webhook-endpoints/{id}` — Update webhook endpoint\n- `POST /webhook-endpoints/{id}/rotate-secret` — Rotate signing secret\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Webhook endpoint ID"},"required":true,"description":"Webhook endpoint ID","name":"id","in":"path"}],"responses":{"200":{"description":"Deleted webhook endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}},"required":["data"]}}}}},"x-cli-group":"webhook-endpoints","x-cli-name":"delete","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X DELETE \"https://api.revkeen.com/v2/webhook-endpoints/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { webhookEndpointsDelete } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookEndpointsDelete({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookEndpointsDelete(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookEndpointsDelete(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/webhook-endpoints/{id}/rotate-secret":{"post":{"operationId":"webhook_endpoints_rotate_secret","tags":["Webhook Endpoints"],"x-fern-sdk-group-name":["webhookEndpoints"],"summary":"Rotate signing secret","description":"Generate a new signing secret for a webhook endpoint. The old secret is immediately invalidated. Store the new secret securely — it is only returned in this response.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-endpoints` — List webhook endpoints\n- `POST /webhook-endpoints` — Create webhook endpoint\n- `GET /webhook-endpoints/{id}` — Get webhook endpoint\n- `PATCH /webhook-endpoints/{id}` — Update webhook endpoint\n- `DELETE /webhook-endpoints/{id}` — Delete webhook endpoint\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Webhook endpoint ID"},"required":true,"description":"Webhook endpoint ID","name":"id","in":"path"}],"responses":{"200":{"description":"Rotated signing secret","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["data"]}}}}},"x-cli-group":"webhook-endpoints","x-cli-name":"rotate-secret","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/webhook-endpoints/00000000-0000-0000-0000-000000000000/rotate-secret\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { webhookEndpointsRotateSecret } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookEndpointsRotateSecret({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookEndpointsRotateSecret(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookEndpointsRotateSecret(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/webhook-deliveries":{"get":{"operationId":"webhook_deliveries_list","tags":["Webhook Deliveries"],"x-fern-sdk-group-name":["webhookDeliveries"],"summary":"List webhook deliveries","description":"List individual webhook delivery attempts across all endpoints for the authenticated merchant. Use filters to scope to a specific endpoint, a specific event, or a specific delivery status. Results are returned in reverse chronological order.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-deliveries/{id}` — Retrieve a webhook delivery\n- `POST /webhook-deliveries/{id}/retry` — Retry a webhook delivery\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Filter by webhook endpoint ID"},"required":false,"description":"Filter by webhook endpoint ID","name":"endpoint_id","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by source event ID"},"required":false,"description":"Filter by source event ID","name":"event_id","in":"query"},{"schema":{"type":"string","enum":["pending","succeeded","failed","dead_lettered"],"description":"Filter by delivery status"},"required":false,"description":"Filter by delivery status","name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor — return deliveries created before the row with this ID."},"required":false,"description":"Cursor — return deliveries created before the row with this ID.","name":"starting_after","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor — return deliveries created after the row with this ID."},"required":false,"description":"Cursor — return deliveries created after the row with this ID.","name":"ending_before","in":"query"}],"responses":{"200":{"description":"Paginated list of webhook deliveries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryErrorResponse"}}}}},"x-cli-group":"webhook-deliveries","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/webhook-deliveries\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { webhookDeliveriesList } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookDeliveriesList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookDeliveriesList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookDeliveriesList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/webhook-deliveries/{id}":{"get":{"operationId":"webhook_deliveries_get","tags":["Webhook Deliveries"],"x-fern-sdk-group-name":["webhookDeliveries"],"summary":"Retrieve a webhook delivery","description":"Retrieve the details of a single webhook delivery including its last attempt outcome.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-deliveries` — List webhook deliveries\n- `POST /webhook-deliveries/{id}/retry` — Retry a webhook delivery\n\n**Common errors**\n\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Webhook delivery ID"},"required":true,"description":"Webhook delivery ID","name":"id","in":"path"}],"responses":{"200":{"description":"Webhook delivery details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryResponse"}}}},"404":{"description":"Webhook delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryErrorResponse"}}}}},"x-cli-group":"webhook-deliveries","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/webhook-deliveries/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { webhookDeliveriesGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookDeliveriesGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookDeliveriesGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookDeliveriesGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/webhook-deliveries/{id}/retry":{"post":{"operationId":"webhook_deliveries_retry","tags":["Webhook Deliveries"],"x-fern-sdk-group-name":["webhookDeliveries"],"summary":"Retry a webhook delivery","description":"Queue an immediate retry of this delivery. The delivery is marked `pending` and `next_retry_at` is set to now; the dispatcher picks it up on its next tick. Calling retry on an already-pending delivery just advances its retry time. Dead-lettered deliveries can be retried once; succeeded deliveries cannot.\n\n---\n\n**Related endpoints**\n\n- `GET /webhook-deliveries` — List webhook deliveries\n- `GET /webhook-deliveries/{id}` — Retrieve a webhook delivery\n\n**Common errors**\n\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n- `409 conflict` — Idempotency-Key collision with a different body, or a concurrent state-transition conflict.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Webhook delivery ID"},"required":true,"description":"Webhook delivery ID","name":"id","in":"path"}],"responses":{"200":{"description":"Delivery queued for retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryRetryResponse"}}}},"404":{"description":"Webhook delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryErrorResponse"}}}},"409":{"description":"Delivery already succeeded and cannot be retried.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryErrorResponse"}}}}},"x-cli-group":"webhook-deliveries","x-cli-name":"retry","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/webhook-deliveries/00000000-0000-0000-0000-000000000000/retry\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { webhookDeliveriesRetry } from \"@revkeen/sdk\";\n\nconst { data, error } = await webhookDeliveriesRetry({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.WebhookAPI.WebhookDeliveriesRetry(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\WebhookApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->webhookDeliveriesRetry(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-portal/sessions":{"post":{"operationId":"customer_portal_sessions_create","tags":["Customer Portal"],"x-fern-sdk-group-name":["customerPortal","sessions"],"summary":"Create a customer-portal session","description":"Mint a short-lived bearer token that authenticates a specific customer against /v2/customer-portal/*. Returns an opaque `rkcps_...` token that expires in 60 minutes by default. Call this server-side from the merchant's backend, then hand the token to the customer's browser or embedded client. Treat the token like a password — never log it and never expose it to untrusted code.\n\n---\n\n**Related endpoints**\n\n- `GET /customer-portal/customer` — Retrieve the authenticated customer\n- `GET /customer-portal/subscriptions` — List the authenticated customer's subscriptions\n- `GET /customer-portal/subscriptions/{id}` — Retrieve a subscription\n- `POST /customer-portal/subscriptions/{id}/cancel` — Cancel a subscription\n- `GET /customer-portal/invoices` — List the authenticated customer's invoices\n- `GET /customer-portal/invoices/{id}` — Retrieve an invoice\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerPortalSessionRequest"}}}},"responses":{"201":{"description":"Session created. The bearer token is returned only once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalSessionCreateResponse"}}}},"401":{"description":"Invalid or missing merchant API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}},"404":{"description":"Customer not found for this merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}}},"x-cli-group":"customer-portal","x-cli-name":"sessions-create","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/customer-portal/sessions\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"customer_id\": \"cus_a1b2c3d4e5f6\",\n    \"ttl_minutes\": 60\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { customerPortalSessionsCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerPortalSessionsCreate({\n  body: {\n    \"customer_id\": \"cus_a1b2c3d4e5f6\",\n    \"ttl_minutes\": 60\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerPortalSessionsCreate(ctx)\n// req = req.CustomerPortalSessionsCreateRequest(CustomerPortalSessionsCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerPortalSessionsCreate(/* CustomerPortalSessionsCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-portal/customer":{"get":{"operationId":"customer_portal_customer_get","tags":["Customer Portal"],"x-fern-sdk-group-name":["customerPortal"],"summary":"Retrieve the authenticated customer","description":"Returns the customer represented by the bearer token. Useful as a warm-up / identity check when an embedded portal page loads.\n\n---\n\n**Related endpoints**\n\n- `POST /customer-portal/sessions` — Create a customer-portal session\n- `GET /customer-portal/subscriptions` — List the authenticated customer's subscriptions\n- `GET /customer-portal/subscriptions/{id}` — Retrieve a subscription\n- `POST /customer-portal/subscriptions/{id}/cancel` — Cancel a subscription\n- `GET /customer-portal/invoices` — List the authenticated customer's invoices\n- `GET /customer-portal/invoices/{id}` — Retrieve an invoice\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","responses":{"200":{"description":"Authenticated customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalCustomerResponse"}}}},"401":{"description":"Missing or invalid customer-portal session token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}},"404":{"description":"Customer record no longer exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}}},"x-cli-group":"customer-portal","x-cli-name":"customer-get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customer-portal/customer\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customerPortalCustomerGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerPortalCustomerGet();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerPortalCustomerGet(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerPortalCustomerGet();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-portal/subscriptions":{"get":{"operationId":"customer_portal_subscriptions_list","tags":["Customer Portal"],"x-fern-sdk-group-name":["customerPortal","subscriptions"],"summary":"List the authenticated customer's subscriptions","description":"Returns subscriptions where the customer is the subscriber. Results are reverse-chronological by creation time and paginate via `starting_after` / `ending_before` cursors.\n\n---\n\n**Related endpoints**\n\n- `POST /customer-portal/sessions` — Create a customer-portal session\n- `GET /customer-portal/customer` — Retrieve the authenticated customer\n- `GET /customer-portal/subscriptions/{id}` — Retrieve a subscription\n- `POST /customer-portal/subscriptions/{id}/cancel` — Cancel a subscription\n- `GET /customer-portal/invoices` — List the authenticated customer's invoices\n- `GET /customer-portal/invoices/{id}` — Retrieve an invoice\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"starting_after","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"ending_before","in":"query"}],"responses":{"200":{"description":"Paginated list of subscriptions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscriptionList"}}}},"401":{"description":"Missing or invalid customer-portal session token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}}},"x-cli-group":"customer-portal","x-cli-name":"subscriptions-list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customer-portal/subscriptions\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customerPortalSubscriptionsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerPortalSubscriptionsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerPortalSubscriptionsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerPortalSubscriptionsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-portal/subscriptions/{id}":{"get":{"operationId":"customer_portal_subscriptions_get","tags":["Customer Portal"],"x-fern-sdk-group-name":["customerPortal","subscriptions"],"summary":"Retrieve a subscription","description":"Returns a subscription owned by the authenticated customer. 404s on cross-customer access even if the subscription exists.\n\n---\n\n**Related endpoints**\n\n- `POST /customer-portal/sessions` — Create a customer-portal session\n- `GET /customer-portal/customer` — Retrieve the authenticated customer\n- `GET /customer-portal/subscriptions` — List the authenticated customer's subscriptions\n- `POST /customer-portal/subscriptions/{id}/cancel` — Cancel a subscription\n- `GET /customer-portal/invoices` — List the authenticated customer's invoices\n- `GET /customer-portal/invoices/{id}` — Retrieve an invoice\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Subscription details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscriptionResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}},"404":{"description":"Subscription not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}}},"x-cli-group":"customer-portal","x-cli-name":"subscriptions-get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customer-portal/subscriptions/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customerPortalSubscriptionsGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerPortalSubscriptionsGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerPortalSubscriptionsGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerPortalSubscriptionsGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-portal/subscriptions/{id}/cancel":{"post":{"operationId":"customer_portal_subscriptions_cancel","tags":["Customer Portal"],"x-fern-sdk-group-name":["customerPortal","subscriptions"],"summary":"Cancel a subscription","description":"Cancel a subscription owned by the authenticated customer. By default the subscription is scheduled to cancel at the end of the current billing period — set `cancel_at_period_end=false` to cancel immediately. Idempotent — cancelling an already-canceled subscription is a no-op that returns the current state.\n\n---\n\n**Related endpoints**\n\n- `POST /customer-portal/sessions` — Create a customer-portal session\n- `GET /customer-portal/customer` — Retrieve the authenticated customer\n- `GET /customer-portal/subscriptions` — List the authenticated customer's subscriptions\n- `GET /customer-portal/subscriptions/{id}` — Retrieve a subscription\n- `GET /customer-portal/invoices` — List the authenticated customer's invoices\n- `GET /customer-portal/invoices/{id}` — Retrieve an invoice\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionRequest"}}}},"responses":{"200":{"description":"Subscription canceled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscriptionCancelResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}},"404":{"description":"Subscription not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}}},"x-cli-group":"customer-portal","x-cli-name":"subscriptions-cancel","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/customer-portal/subscriptions/00000000-0000-0000-0000-000000000000/cancel\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"cancel_at_period_end\": true,\n    \"reason\": \"string\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { customerPortalSubscriptionsCancel } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerPortalSubscriptionsCancel({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n  body: {\n    \"cancel_at_period_end\": true,\n    \"reason\": \"string\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerPortalSubscriptionsCancel(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\n// req = req.CustomerPortalSubscriptionsCancelRequest(CustomerPortalSubscriptionsCancelRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerPortalSubscriptionsCancel(\"00000000-0000-0000-0000-000000000000\", /* CustomerPortalSubscriptionsCancelRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-portal/invoices":{"get":{"operationId":"customer_portal_invoices_list","tags":["Customer Portal"],"x-fern-sdk-group-name":["customerPortal","invoices"],"summary":"List the authenticated customer's invoices","description":"Returns invoices owned by the authenticated customer, reverse-chronological by `invoice_date`. Use the same `starting_after`/`ending_before` cursor pattern as subscriptions.\n\n---\n\n**Related endpoints**\n\n- `POST /customer-portal/sessions` — Create a customer-portal session\n- `GET /customer-portal/customer` — Retrieve the authenticated customer\n- `GET /customer-portal/subscriptions` — List the authenticated customer's subscriptions\n- `GET /customer-portal/subscriptions/{id}` — Retrieve a subscription\n- `POST /customer-portal/subscriptions/{id}/cancel` — Cancel a subscription\n- `GET /customer-portal/invoices/{id}` — Retrieve an invoice\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"starting_after","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"ending_before","in":"query"}],"responses":{"200":{"description":"Paginated list of invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalInvoiceList"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}}},"x-cli-group":"customer-portal","x-cli-name":"invoices-list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customer-portal/invoices\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customerPortalInvoicesList } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerPortalInvoicesList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerPortalInvoicesList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerPortalInvoicesList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-portal/invoices/{id}":{"get":{"operationId":"customer_portal_invoices_get","tags":["Customer Portal"],"x-fern-sdk-group-name":["customerPortal","invoices"],"summary":"Retrieve an invoice","description":"Returns an invoice owned by the authenticated customer.\n\n---\n\n**Related endpoints**\n\n- `POST /customer-portal/sessions` — Create a customer-portal session\n- `GET /customer-portal/customer` — Retrieve the authenticated customer\n- `GET /customer-portal/subscriptions` — List the authenticated customer's subscriptions\n- `GET /customer-portal/subscriptions/{id}` — Retrieve a subscription\n- `POST /customer-portal/subscriptions/{id}/cancel` — Cancel a subscription\n- `GET /customer-portal/invoices` — List the authenticated customer's invoices\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Invoice details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalInvoiceResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}},"404":{"description":"Invoice not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalErrorResponse"}}}}},"x-cli-group":"customer-portal","x-cli-name":"invoices-get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customer-portal/invoices/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customerPortalInvoicesGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerPortalInvoicesGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerPortalInvoicesGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerPortalInvoicesGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-meters":{"get":{"operationId":"customer_meters_list","tags":["Customer Meters"],"x-fern-sdk-group-name":["customerMeters"],"summary":"List a customer's meter usage","description":"Returns per-meter aggregates for a single customer. Requires a `customer_id` query parameter. For each meter the merchant has defined, the response includes the aggregate quantity (applying the meter's native aggregation function), the event count, and the most recent event timestamp.\n\nUse this to render a customer's current consumption snapshot in your own UI — for example, a usage dashboard showing \"4,820 / 10,000 requests this period\".\n\n---\n\n**Related endpoints**\n\n- `GET /customer-meters/{customer_id}/{meter_id}` — Retrieve a customer-meter aggregate\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Customer UUID. Required — customer-meters are not queryable merchant-wide via this endpoint. Use /v2/meters for merchant-level meter definitions."},"required":true,"description":"Customer UUID. Required — customer-meters are not queryable merchant-wide via this endpoint. Use /v2/meters for merchant-level meter definitions.","name":"customer_id","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Optional single-meter filter. When provided, the response contains at most one entry."},"required":false,"description":"Optional single-meter filter. When provided, the response contains at most one entry.","name":"meter_id","in":"query"}],"responses":{"200":{"description":"List of customer-meter aggregates (one per meter the merchant has defined).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerMeterList"}}}},"400":{"description":"Missing or invalid customer_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerMeterErrorResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerMeterErrorResponse"}}}}},"x-cli-group":"customer-meters","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customer-meters?customer_id=value\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customerMetersList } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerMetersList({\n  query: { customerId: \"value\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerMetersList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerMetersList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/customer-meters/{customer_id}/{meter_id}":{"get":{"operationId":"customer_meters_get","tags":["Customer Meters"],"x-fern-sdk-group-name":["customerMeters"],"summary":"Retrieve a customer-meter aggregate","description":"Returns a single customer-meter aggregate for the specified customer + meter pair. Returns 404 only if the meter itself does not exist on the merchant — if the meter exists but the customer has zero events, the response returns an aggregate with `total_quantity: 0`, `event_count: 0`, `last_event_at: null`.\n\n---\n\n**Related endpoints**\n\n- `GET /customer-meters` — List a customer's meter usage\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Customer UUID"},"required":true,"description":"Customer UUID","name":"customer_id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Meter UUID"},"required":true,"description":"Meter UUID","name":"meter_id","in":"path"}],"responses":{"200":{"description":"Customer-meter aggregate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerMeterResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerMeterErrorResponse"}}}},"404":{"description":"Meter not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerMeterErrorResponse"}}}}},"x-cli-group":"customer-meters","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/customer-meters/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { customerMetersGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await customerMetersGet({\n  path: { customerId: \"00000000-0000-0000-0000-000000000000\", meterId: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.CustomerAPI.CustomerMetersGet(ctx)\n// path param customer_id = \"00000000-0000-0000-0000-000000000000\"\n// path param meter_id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\CustomerApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->customerMetersGet(\"00000000-0000-0000-0000-000000000000\", \"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/payment-intents":{"post":{"operationId":"payment_intents_create","tags":["Payment Intents"],"x-fern-sdk-group-name":["payment_intents"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-intents\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount\": 5000,\n    \"currency\": \"USD\",\n    \"customer\": \"00000000-0000-0000-0000-000000000000\",\n    \"payment_method\": \"00000000-0000-0000-0000-000000000000\",\n    \"capture_method\": \"automatic\",\n    \"description\": \"string\",\n    \"statement_descriptor\": \"string\",\n    \"statement_descriptor_suffix\": \"string\",\n    \"receipt_email\": \"customer@example.com\",\n    \"metadata\": {},\n    \"gateway_merchant_id\": \"string\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { paymentIntentsCreate } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentIntentsCreate({\n  body: {\n    \"amount\": 5000,\n    \"currency\": \"USD\",\n    \"customer\": \"00000000-0000-0000-0000-000000000000\",\n    \"payment_method\": \"00000000-0000-0000-0000-000000000000\",\n    \"capture_method\": \"automatic\",\n    \"description\": \"string\",\n    \"statement_descriptor\": \"string\",\n    \"statement_descriptor_suffix\": \"string\",\n    \"receipt_email\": \"customer@example.com\",\n    \"metadata\": {},\n    \"gateway_merchant_id\": \"string\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentIntentsCreate(ctx)\n// req = req.PaymentIntentsCreateRequest(PaymentIntentsCreateRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentIntentsCreate(/* PaymentIntentsCreateRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"shell","label":"cURL","source":"curl -X POST https://api.revkeen.com/v2/payment-intents \\\n  -H \"Authorization: Bearer sk_live_xxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount\": 5000,\n    \"currency\": \"USD\",\n    \"customer\": \"cus_xxx\"\n  }'"},{"lang":"python","label":"Python","source":"from revkeen import RevKeen\n\nclient = RevKeen(api_key=\"sk_live_xxx\")\n\npayment_intent = client.payment_intents.create(\n    amount=5000,\n    currency=\"USD\",\n    customer=\"cus_xxx\",\n)\n\nprint(payment_intent.client_secret)"}],"summary":"Create a payment intent","description":"Creates a payment intent to orchestrate payment collection with support for 3DS/SCA authentication.\n\n---\n\n**Related endpoints**\n\n- `GET /payment-intents` — List payment intents\n- `GET /payment-intents/{id}` — Retrieve a payment intent\n- `POST /payment-intents/{id}` — Update a payment intent\n- `POST /payment-intents/{id}/confirm` — Confirm a payment intent\n- `POST /payment-intents/{id}/capture` — Capture a payment intent\n- `POST /payment-intents/{id}/cancel` — Cancel a payment intent\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentIntentRequest"}}}},"responses":{"200":{"description":"Payment intent created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}}},"x-cli-group":"payment-intents","x-cli-name":"create"},"get":{"operationId":"payment_intents_list","tags":["Payment Intents"],"x-fern-sdk-group-name":["payment_intents"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/payment-intents\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { paymentIntentsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentIntentsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentIntentsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentIntentsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"shell","label":"cURL","source":"curl https://api.revkeen.com/v2/payment-intents?limit=10 \\\n  -H \"Authorization: Bearer sk_live_xxx\""},{"lang":"python","label":"Python","source":"from revkeen import RevKeen\n\nclient = RevKeen(api_key=\"sk_live_xxx\")\n\npayment_intents = client.payment_intents.list(limit=10)\n\nfor pi in payment_intents.data:\n    print(pi.id, pi.status)"}],"summary":"List payment intents","description":"Returns a list of payment intents with optional filtering.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-intents` — Create a payment intent\n- `GET /payment-intents/{id}` — Retrieve a payment intent\n- `POST /payment-intents/{id}` — Update a payment intent\n- `POST /payment-intents/{id}/confirm` — Confirm a payment intent\n- `POST /payment-intents/{id}/capture` — Capture a payment intent\n- `POST /payment-intents/{id}/cancel` — Cancel a payment intent\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Filter by customer ID"},"required":false,"description":"Filter by customer ID","name":"customer","in":"query"},{"schema":{"type":"string","enum":["requires_payment_method","requires_confirmation","requires_action","processing","succeeded","canceled"],"description":"Filter by status"},"required":false,"description":"Filter by status","name":"status","in":"query"},{"schema":{"type":["number","null"],"description":"Filter by created_at >= (Unix timestamp)"},"required":false,"description":"Filter by created_at >= (Unix timestamp)","name":"created_gte","in":"query"},{"schema":{"type":["number","null"],"description":"Filter by created_at <= (Unix timestamp)"},"required":false,"description":"Filter by created_at <= (Unix timestamp)","name":"created_lte","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results (1-100)"},"required":false,"description":"Maximum number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":"string","description":"Cursor for pagination - return results after this ID (pi_xxx)"},"required":false,"description":"Cursor for pagination - return results after this ID (pi_xxx)","name":"starting_after","in":"query"},{"schema":{"type":"string","description":"Cursor for pagination - return results before this ID (pi_xxx)"},"required":false,"description":"Cursor for pagination - return results before this ID (pi_xxx)","name":"ending_before","in":"query"}],"responses":{"200":{"description":"List of payment intents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}}},"x-cli-group":"payment-intents","x-cli-name":"list"}},"/payment-intents/{id}/confirm":{"post":{"operationId":"payment_intents_confirm","tags":["Payment Intents"],"x-fern-sdk-group-name":["payment_intents"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-intents/string/confirm\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"payment_method\": \"00000000-0000-0000-0000-000000000000\",\n    \"return_url\": \"https://example.com\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { paymentIntentsConfirm } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentIntentsConfirm({\n  path: { id: \"string\" },\n  body: {\n    \"payment_method\": \"00000000-0000-0000-0000-000000000000\",\n    \"return_url\": \"https://example.com\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentIntentsConfirm(ctx)\n// path param id = \"string\"\n// req = req.PaymentIntentsConfirmRequest(PaymentIntentsConfirmRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentIntentsConfirm(\"string\", /* PaymentIntentsConfirmRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"shell","label":"cURL","source":"curl -X POST https://api.revkeen.com/v2/payment-intents/pi_xxx/confirm \\\n  -H \"Authorization: Bearer sk_live_xxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"payment_method\": \"pm_xxx\",\n    \"return_url\": \"https://yoursite.com/checkout/complete\"\n  }'"},{"lang":"python","label":"Python","source":"from revkeen import RevKeen\n\nclient = RevKeen(api_key=\"sk_live_xxx\")\n\npayment_intent = client.payment_intents.confirm(\n    \"pi_xxx\",\n    payment_method=\"pm_xxx\",\n    return_url=\"https://yoursite.com/checkout/complete\",\n)\n\nif payment_intent.status == \"requires_action\":\n    # Redirect to 3DS authentication\n    print(f\"Redirect to: {payment_intent.next_action.redirect_to_url.url}\")"}],"summary":"Confirm a payment intent","description":"Confirms the payment intent. May return requires_action if 3DS authentication is needed.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-intents` — Create a payment intent\n- `GET /payment-intents` — List payment intents\n- `GET /payment-intents/{id}` — Retrieve a payment intent\n- `POST /payment-intents/{id}` — Update a payment intent\n- `POST /payment-intents/{id}/capture` — Capture a payment intent\n- `POST /payment-intents/{id}/cancel` — Cancel a payment intent\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","description":"Payment intent ID (pi_xxx)"},"required":true,"description":"Payment intent ID (pi_xxx)","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPaymentIntentRequest"}}}},"responses":{"200":{"description":"Confirmed payment intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"400":{"description":"Invalid request or confirmation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}},"404":{"description":"Payment intent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}}},"x-cli-group":"payment-intents","x-cli-name":"confirm"}},"/payment-intents/{id}/capture":{"post":{"operationId":"payment_intents_capture","tags":["Payment Intents"],"x-fern-sdk-group-name":["payment_intents"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-intents/string/capture\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"amount_to_capture\": 0\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { paymentIntentsCapture } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentIntentsCapture({\n  path: { id: \"string\" },\n  body: {\n    \"amount_to_capture\": 0\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentIntentsCapture(ctx)\n// path param id = \"string\"\n// req = req.PaymentIntentsCaptureRequest(PaymentIntentsCaptureRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentIntentsCapture(\"string\", /* PaymentIntentsCaptureRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"shell","label":"cURL","source":"curl -X POST https://api.revkeen.com/v2/payment-intents/pi_xxx/capture \\\n  -H \"Authorization: Bearer sk_live_xxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{}'"},{"lang":"python","label":"Python","source":"from revkeen import RevKeen\n\nclient = RevKeen(api_key=\"sk_live_xxx\")\n\npayment_intent = client.payment_intents.capture(\"pi_xxx\")\n\nprint(f\"Captured: {payment_intent.amount_received}\")"}],"summary":"Capture a payment intent","description":"Captures a payment intent that was created with capture_method=manual.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-intents` — Create a payment intent\n- `GET /payment-intents` — List payment intents\n- `GET /payment-intents/{id}` — Retrieve a payment intent\n- `POST /payment-intents/{id}` — Update a payment intent\n- `POST /payment-intents/{id}/confirm` — Confirm a payment intent\n- `POST /payment-intents/{id}/cancel` — Cancel a payment intent\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","description":"Payment intent ID (pi_xxx)"},"required":true,"description":"Payment intent ID (pi_xxx)","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapturePaymentIntentRequest"}}}},"responses":{"200":{"description":"Captured payment intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"400":{"description":"Invalid request or capture failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}},"404":{"description":"Payment intent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}}},"x-cli-group":"payment-intents","x-cli-name":"capture"}},"/payment-intents/{id}/cancel":{"post":{"operationId":"payment_intents_cancel","tags":["Payment Intents"],"x-fern-sdk-group-name":["payment_intents"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/payment-intents/string/cancel\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"cancellation_reason\": \"duplicate\"\n  }'"},{"lang":"typescript","label":"TypeScript","source":"import { paymentIntentsCancel } from \"@revkeen/sdk\";\n\nconst { data, error } = await paymentIntentsCancel({\n  path: { id: \"string\" },\n  body: {\n    \"cancellation_reason\": \"duplicate\"\n  },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.PaymentAPI.PaymentIntentsCancel(ctx)\n// path param id = \"string\"\n// req = req.PaymentIntentsCancelRequest(PaymentIntentsCancelRequest{...})  // populate from the request schema\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\PaymentApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->paymentIntentsCancel(\"string\", /* PaymentIntentsCancelRequest */);\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"shell","label":"cURL","source":"curl -X POST https://api.revkeen.com/v2/payment-intents/pi_xxx/cancel \\\n  -H \"Authorization: Bearer sk_live_xxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cancellation_reason\": \"requested_by_customer\"}'"},{"lang":"python","label":"Python","source":"from revkeen import RevKeen\n\nclient = RevKeen(api_key=\"sk_live_xxx\")\n\npayment_intent = client.payment_intents.cancel(\n    \"pi_xxx\",\n    cancellation_reason=\"requested_by_customer\",\n)\n\nprint(f\"Canceled: {payment_intent.status}\")"}],"summary":"Cancel a payment intent","description":"Cancels a payment intent. Cannot cancel if already succeeded or canceled.\n\n---\n\n**Related endpoints**\n\n- `POST /payment-intents` — Create a payment intent\n- `GET /payment-intents` — List payment intents\n- `GET /payment-intents/{id}` — Retrieve a payment intent\n- `POST /payment-intents/{id}` — Update a payment intent\n- `POST /payment-intents/{id}/confirm` — Confirm a payment intent\n- `POST /payment-intents/{id}/capture` — Capture a payment intent\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","description":"Payment intent ID (pi_xxx)"},"required":true,"description":"Payment intent ID (pi_xxx)","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPaymentIntentRequest"}}}},"responses":{"200":{"description":"Canceled payment intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"400":{"description":"Invalid request or cancellation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}},"404":{"description":"Payment intent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentErrorResponse"}}}}},"x-cli-group":"payment-intents","x-cli-name":"cancel"}},"/events":{"get":{"operationId":"events_list","tags":["Events"],"x-fern-sdk-group-name":["events"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/events\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { eventsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await eventsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.EventsAPI.EventsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\EventsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->eventsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"shell","label":"cURL","source":"curl \"https://api.revkeen.com/v2/events?type=invoice.paid&limit=10\" \\\n  -H \"Authorization: Bearer sk_live_xxx\""},{"lang":"python","label":"Python","source":"from revkeen import RevKeen\n\nclient = RevKeen(api_key=\"sk_live_xxx\")\n\nevents = client.events.list(type=\"invoice.paid\", limit=10)\n\nfor event in events.data:\n    print(event.type, event.data.object)"}],"summary":"List events","description":"Returns a list of events with optional filters. Events are returned in reverse chronological order.\n\n---\n\n**Related endpoints**\n\n- `GET /events/{id}` — Retrieve an event\n- `POST /events/{id}/resend` — Resend webhook for an event\n- `POST /events/test` — Create a test event\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","description":"Filter by event type (e.g., invoice.paid)","example":"invoice.paid"},"required":false,"description":"Filter by event type (e.g., invoice.paid)","name":"type","in":"query"},{"schema":{"type":"string","description":"Filter by multiple event types (comma-separated)","example":"invoice.paid,payment.succeeded"},"required":false,"description":"Filter by multiple event types (comma-separated)","name":"types","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by customer ID"},"required":false,"description":"Filter by customer ID","name":"customer_id","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by invoice ID"},"required":false,"description":"Filter by invoice ID","name":"invoice_id","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by subscription ID"},"required":false,"description":"Filter by subscription ID","name":"subscription_id","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by order ID"},"required":false,"description":"Filter by order ID","name":"order_id","in":"query"},{"schema":{"type":["number","null"],"description":"Filter by created_at >= (Unix timestamp)"},"required":false,"description":"Filter by created_at >= (Unix timestamp)","name":"created_gte","in":"query"},{"schema":{"type":["number","null"],"description":"Filter by created_at <= (Unix timestamp)"},"required":false,"description":"Filter by created_at <= (Unix timestamp)","name":"created_lte","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results (1-100)"},"required":false,"description":"Maximum number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor for pagination - return results after this event ID"},"required":false,"description":"Cursor for pagination - return results after this event ID","name":"starting_after","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor for pagination - return results before this event ID"},"required":false,"description":"Cursor for pagination - return results before this event ID","name":"ending_before","in":"query"}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventErrorResponse"}}}}},"x-cli-group":"events","x-cli-name":"list"}},"/events/{id}":{"get":{"operationId":"events_get","tags":["Events"],"x-fern-sdk-group-name":["events"],"x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/events/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { eventsGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await eventsGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.EventsAPI.EventsGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\EventsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->eventsGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"},{"lang":"shell","label":"cURL","source":"curl https://api.revkeen.com/v2/events/evt_xxx \\\n  -H \"Authorization: Bearer sk_live_xxx\""},{"lang":"python","label":"Python","source":"from revkeen import RevKeen\n\nclient = RevKeen(api_key=\"sk_live_xxx\")\n\nevent = client.events.retrieve(\"evt_xxx\")\n\nprint(event.type, event.data)"}],"summary":"Retrieve an event","description":"Retrieves the details of an event by its ID.\n\n---\n\n**Related endpoints**\n\n- `GET /events` — List events\n- `POST /events/{id}/resend` — Resend webhook for an event\n- `POST /events/test` — Create a test event\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"responses":{"200":{"description":"Event details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventErrorResponse"}}}},"404":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventErrorResponse"}}}}},"x-cli-group":"events","x-cli-name":"get"}},"/events/{id}/resend":{"post":{"operationId":"events_resend","tags":["Events"],"x-fern-sdk-group-name":["events"],"summary":"Resend webhook for an event","description":"Queues the event to be resent to all configured webhook endpoints.\n\n---\n\n**Related endpoints**\n\n- `GET /events` — List events\n- `GET /events/{id}` — Retrieve an event\n- `POST /events/test` — Create a test event\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Idempotency**\n\nPass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).","parameters":[{"schema":{"type":"string","format":"uuid","description":"Event ID"},"required":true,"description":"Event ID","name":"id","in":"path"}],"responses":{"200":{"description":"Webhook queued for resending","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendWebhookResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventErrorResponse"}}}},"404":{"description":"Event not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventErrorResponse"}}}}},"x-cli-group":"events","x-cli-name":"resend","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl -X POST \"https://api.revkeen.com/v2/events/00000000-0000-0000-0000-000000000000/resend\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { eventsResend } from \"@revkeen/sdk\";\n\nconst { data, error } = await eventsResend({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.EventsAPI.EventsResend(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\EventsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->eventsResend(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/entitlements":{"get":{"operationId":"entitlements_list","tags":["Entitlements"],"x-fern-sdk-group-name":["entitlements"],"summary":"List entitlements","description":"Retrieve all entitlements for a customer. Pass `customer_id` as a query parameter. Includes computed access status based on subscription state.\n\n---\n\n**Related endpoints**\n\n- `GET /customers/{customerId}/entitlements` — List customer entitlements\n- `POST /customers/{customerId}/entitlements` — Grant entitlement to customer\n- `DELETE /customers/{customerId}/entitlements` — Revoke entitlement by benefit key\n- `GET /customers/{customerId}/entitlements/check` — Check customer entitlement\n- `DELETE /customers/{customerId}/entitlements/{entitlementId}` — Revoke entitlement by ID\n- `GET /entitlements/check` — Check entitlement access\n\n**Common errors**\n\n- `400 invalid_request` — malformed payload or failed validation.\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Customer UUID (required)"},"required":true,"description":"Customer UUID (required)","name":"customer_id","in":"query"},{"schema":{"type":["boolean","null"],"default":false,"description":"Include expired entitlements"},"required":false,"description":"Include expired entitlements","name":"include_expired","in":"query"},{"schema":{"type":"string","description":"Filter by benefit type"},"required":false,"description":"Filter by benefit type","name":"benefit_type","in":"query"},{"schema":{"type":"string","description":"Filter by category"},"required":false,"description":"Filter by category","name":"category","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Maximum results (1-100)"},"required":false,"description":"Maximum results (1-100)","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Results to skip"},"required":false,"description":"Results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of customer entitlements","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementListResponse"}}}},"400":{"description":"Missing customer_id"},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"}},"x-cli-group":"entitlements","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/entitlements?customer_id=value\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { entitlementsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await entitlementsList({\n  query: { customerId: \"value\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.EntitlementsAPI.EntitlementsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\EntitlementsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->entitlementsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/entitlements/check":{"get":{"operationId":"entitlements_check","tags":["Entitlements"],"x-fern-sdk-group-name":["entitlements"],"summary":"Check entitlement access","description":"Check if a customer has access to a specific benefit by key. This is the primary endpoint for feature gating and licensing checks.\n\n---\n\n**Related endpoints**\n\n- `GET /customers/{customerId}/entitlements` — List customer entitlements\n- `POST /customers/{customerId}/entitlements` — Grant entitlement to customer\n- `DELETE /customers/{customerId}/entitlements` — Revoke entitlement by benefit key\n- `GET /customers/{customerId}/entitlements/check` — Check customer entitlement\n- `DELETE /customers/{customerId}/entitlements/{entitlementId}` — Revoke entitlement by ID\n- `GET /entitlements` — List entitlements\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Customer UUID (required)"},"required":true,"description":"Customer UUID (required)","name":"customer_id","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Benefit key to check"},"required":true,"description":"Benefit key to check","name":"benefit_key","in":"query"}],"responses":{"200":{"description":"Entitlement check result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementCheckResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"}},"x-cli-group":"entitlements","x-cli-name":"check","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/entitlements/check?customer_id=value&benefit_key=value\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { entitlementsCheck } from \"@revkeen/sdk\";\n\nconst { data, error } = await entitlementsCheck({\n  query: { customerId: \"value\", benefitKey: \"value\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.EntitlementsAPI.EntitlementsCheck(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\EntitlementsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->entitlementsCheck();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/transactions":{"get":{"operationId":"transactions_list","tags":["Transactions"],"x-fern-sdk-group-name":["transactions"],"summary":"List transactions","description":"List all transactions for the authenticated merchant. Transactions represent the unified financial truth — every sale, refund, void, capture, dispute, and adjustment.\n\n---\n\n**Related endpoints**\n\n- `GET /transactions/{id}` — Get transaction by ID\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n\n**Pagination**\n\nOffset-based with `limit` (default 25, max 100) and `offset`. The response `pagination` block includes `total` and `hasMore`. See [the pagination guide](/docs/fundamentals/pagination) for SDK auto-paging helpers.","parameters":[{"schema":{"type":"string","enum":["sale","refund","void","capture","dispute","adjustment"],"description":"Filter by transaction type"},"required":false,"description":"Filter by transaction type","name":"type","in":"query"},{"schema":{"type":"string","enum":["pending","succeeded","failed","voided"],"description":"Filter by status"},"required":false,"description":"Filter by status","name":"status","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by customer ID"},"required":false,"description":"Filter by customer ID","name":"customer_id","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Filter by invoice ID"},"required":false,"description":"Filter by invoice ID","name":"invoice_id","in":"query"},{"schema":{"type":["number","null"],"description":"Filter by created_at >= (Unix timestamp)"},"required":false,"description":"Filter by created_at >= (Unix timestamp)","name":"created_gte","in":"query"},{"schema":{"type":["number","null"],"description":"Filter by created_at <= (Unix timestamp)"},"required":false,"description":"Filter by created_at <= (Unix timestamp)","name":"created_lte","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of results (1-100)"},"required":false,"description":"Maximum number of results (1-100)","name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor for pagination - return results after this ID"},"required":false,"description":"Cursor for pagination - return results after this ID","name":"starting_after","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Cursor for pagination - return results before this ID"},"required":false,"description":"Cursor for pagination - return results before this ID","name":"ending_before","in":"query"}],"responses":{"200":{"description":"List of transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionListResponse"}}}}},"x-cli-group":"transactions","x-cli-name":"list","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/transactions\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { transactionsList } from \"@revkeen/sdk\";\n\nconst { data, error } = await transactionsList();\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.TransactionsAPI.TransactionsList(ctx)\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\TransactionsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->transactionsList();\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}},"/transactions/{id}":{"get":{"operationId":"transactions_get","tags":["Transactions"],"x-fern-sdk-group-name":["transactions"],"summary":"Get transaction by ID","description":"Retrieve a single transaction by its ID.\n\n---\n\n**Related endpoints**\n\n- `GET /transactions` — List transactions\n\n**Common errors**\n\n- `401 unauthenticated` — missing, malformed, or revoked API key.\n- `404 resource_missing` — the referenced resource does not exist or is not visible to your key.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Transaction UUID"},"required":true,"description":"Transaction UUID","name":"id","in":"path"}],"responses":{"200":{"description":"Transaction details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionRetrieveResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Transaction not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}},"x-cli-group":"transactions","x-cli-name":"get","x-codeSamples":[{"lang":"curl","label":"cURL","source":"curl \"https://api.revkeen.com/v2/transactions/00000000-0000-0000-0000-000000000000\" \\\n  -H \"x-api-key: $REVKEEN_API_KEY\""},{"lang":"typescript","label":"TypeScript","source":"import { transactionsGet } from \"@revkeen/sdk\";\n\nconst { data, error } = await transactionsGet({\n  path: { id: \"00000000-0000-0000-0000-000000000000\" },\n});\nif (error) throw error;\nconsole.log(data);"},{"lang":"go","label":"Go","source":"import (\n    \"context\"\n\n    revkeen \"github.com/RevKeen/sdk-go\"\n)\n\nctx := context.Background()\nclient := revkeen.NewAPIClient(revkeen.NewConfiguration())\n\nreq := client.TransactionsAPI.TransactionsGet(ctx)\n// path param id = \"00000000-0000-0000-0000-000000000000\"\nresult, _, err := req.Execute()\nif err != nil {\n    return err\n}\nfmt.Println(result)"},{"lang":"php","label":"PHP","source":"<?php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = RevKeen\\Configuration::getDefaultConfiguration()\n    ->setApiKey('x-api-key', getenv('REVKEEN_API_KEY'));\n\n$api = new RevKeen\\Api\\TransactionsApi(new GuzzleHttp\\Client(), $config);\n\ntry {\n    $result = $api->transactionsGet(\"00000000-0000-0000-0000-000000000000\");\n    var_dump($result);\n} catch (RevKeen\\ApiException $e) {\n    echo 'API error: ', $e->getMessage();\n}"}]}}}}