{"openapi":"3.1.0","info":{"title":"meteroid","description":"","license":{"name":"LicenseRef-Proprietary","identifier":"LicenseRef-Proprietary"},"version":"0.1.0"},"paths":{"/api/v1/addons":{"get":{"tags":["Add-ons"],"summary":"List add-ons","operationId":"list_addons","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string"}},{"name":"include_archived","in":"query","description":"Include archived add-ons in the results (default: false)","required":false,"schema":{"type":"boolean"}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `name`, `created_at`. Direction: `asc` or `desc`. Default: `created_at.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of add-ons","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOnListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Add-ons"],"summary":"Create an add-on","operationId":"create_addon","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAddOnRequest"}}},"required":true},"responses":{"201":{"description":"Add-on created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOn"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/addons/{addon_id}":{"get":{"tags":["Add-ons"],"summary":"Get add-on details","operationId":"get_addon","parameters":[{"name":"addon_id","in":"path","description":"Add-on ID","required":true,"schema":{"$ref":"#/components/schemas/AddOnId"}}],"responses":{"200":{"description":"Add-on details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOn"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Add-on not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Add-ons"],"summary":"Update an add-on","operationId":"update_addon","parameters":[{"name":"addon_id","in":"path","description":"Add-on ID","required":true,"schema":{"$ref":"#/components/schemas/AddOnId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAddOnRequest"}}},"required":true},"responses":{"200":{"description":"Add-on updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOn"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Add-on not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/addons/{addon_id}/archive":{"post":{"tags":["Add-ons"],"summary":"Archive an add-on","operationId":"archive_addon","parameters":[{"name":"addon_id","in":"path","description":"Add-on ID","required":true,"schema":{"$ref":"#/components/schemas/AddOnId"}}],"responses":{"204":{"description":"Add-on archived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Add-on not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/addons/{addon_id}/entitlements":{"get":{"tags":["Add-ons","Entitlements"],"summary":"List add-on entitlements","operationId":"list_add_on_entitlements","parameters":[{"name":"addon_id","in":"path","description":"Add-on ID","required":true,"schema":{"$ref":"#/components/schemas/AddOnId"}}],"responses":{"200":{"description":"Resolved entitlements for this add-on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvedEntitlementListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Add-on not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Add-ons","Entitlements"],"summary":"Create add-on entitlements","description":"Entitlements already present on this add-on are skipped.","operationId":"create_add_on_entitlements","parameters":[{"name":"addon_id","in":"path","description":"Add-on ID","required":true,"schema":{"$ref":"#/components/schemas/AddOnId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEntitlementsRequest"}}},"required":true},"responses":{"201":{"description":"Entitlements created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Add-on not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/addons/{addon_id}/unarchive":{"post":{"tags":["Add-ons"],"summary":"Unarchive an add-on","operationId":"unarchive_addon","parameters":[{"name":"addon_id","in":"path","description":"Add-on ID","required":true,"schema":{"$ref":"#/components/schemas/AddOnId"}}],"responses":{"204":{"description":"Add-on unarchived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Add-on not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/batch-jobs":{"get":{"tags":["Batch Jobs"],"summary":"List batch jobs","description":"List batch jobs with optional filtering by type and status.","operationId":"list_batch_jobs","parameters":[{"name":"job_type","in":"query","required":false,"schema":{"type":"string","title":"BatchJobType","enum":["EVENT_CSV_IMPORT","CUSTOMER_CSV_IMPORT","SUBSCRIPTION_CSV_IMPORT","SUBSCRIPTION_PLAN_MIGRATION","TAX_REPORT_EXPORT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","title":"BatchJobStatus","enum":["PENDING","CHUNKING","PROCESSING","COMPLETED","COMPLETED_WITH_ERRORS","FAILED","CANCELLED"]}}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of batch jobs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchJobListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/batch-jobs/{batch_job_id}":{"get":{"tags":["Batch Jobs"],"summary":"Get batch job detail","description":"Retrieve a single batch job with its chunks and failures.","operationId":"get_batch_job","parameters":[{"name":"batch_job_id","in":"path","description":"Batch job ID","required":true,"schema":{"$ref":"#/components/schemas/BatchJobId"}}],"responses":{"200":{"description":"Batch job detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchJobDetailResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Batch job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/batch-jobs/{batch_job_id}/failures":{"get":{"tags":["Batch Jobs"],"summary":"List batch job failures","description":"Retrieve paginated failures for a batch job.","operationId":"list_batch_job_failures","parameters":[{"name":"batch_job_id","in":"path","description":"Batch job ID","required":true,"schema":{"$ref":"#/components/schemas/BatchJobId"}},{"name":"chunk_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BatchJobChunkId"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"List of failures","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchJobFailuresResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Batch job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/checkout-sessions":{"get":{"tags":["Checkout Sessions"],"summary":"List checkout sessions","operationId":"list_checkout_sessions","parameters":[{"name":"customer_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CustomerId"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","title":"CheckoutSessionStatus","enum":["CREATED","AWAITING_PAYMENT","COMPLETED","EXPIRED","CANCELLED"]}}],"responses":{"200":{"description":"List of checkout sessions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCheckoutSessionsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Checkout Sessions"],"summary":"Create a checkout session","operationId":"create_checkout_session","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionRequest"}}},"required":true},"responses":{"200":{"description":"Checkout session created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/checkout-sessions/{id}":{"get":{"tags":["Checkout Sessions"],"summary":"Get a checkout session by ID","operationId":"get_checkout_session","parameters":[{"name":"id","in":"path","description":"Checkout session ID","required":true,"schema":{"$ref":"#/components/schemas/CheckoutSessionId"}}],"responses":{"200":{"description":"Checkout session details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCheckoutSessionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/checkout-sessions/{id}/cancel":{"post":{"tags":["Checkout Sessions"],"summary":"Cancel a checkout session","operationId":"cancel_checkout_session","parameters":[{"name":"id","in":"path","description":"Checkout session ID","required":true,"schema":{"$ref":"#/components/schemas/CheckoutSessionId"}}],"responses":{"200":{"description":"Checkout session cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelCheckoutSessionResponse"}}}},"400":{"description":"Bad request - session cannot be cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/connected-accounts":{"get":{"tags":["Connect"],"summary":"List connected accounts","description":"List all connected accounts for this platform.","operationId":"list_connected_accounts","responses":{"200":{"description":"List of connected accounts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccountsResponse"}}}},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Connect"],"summary":"Create connected account","description":"Create a new connected account (Express flow). Returns the account\nand an onboarding link for the user to complete setup.","operationId":"create_connected_account","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConnectedAccountRequest"}}},"required":true},"responses":{"201":{"description":"Connected account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccount"}}}},"401":{"description":"Unauthorized"},"409":{"description":"Account already exists"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/connected-accounts/{id}":{"get":{"tags":["Connect"],"summary":"Get connected account","description":"Retrieve a connected account by ID.","operationId":"get_connected_account","parameters":[{"name":"id","in":"path","description":"Connected account ID","required":true,"schema":{"$ref":"#/components/schemas/ConnectedAccountId"}}],"responses":{"200":{"description":"Connected account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccount"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["Connect"],"summary":"Disconnect account","description":"Revoke a connected account. All associated tokens are invalidated.","operationId":"disconnect_account","parameters":[{"name":"id","in":"path","description":"Connected account ID","required":true,"schema":{"$ref":"#/components/schemas/ConnectedAccountId"}}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/connected-accounts/{id}/onboarding":{"post":{"tags":["Connect"],"summary":"Create onboarding link","description":"Generate a new onboarding link for a connected account. Any existing\nunused link is invalidated. The link expires after a configured duration.","operationId":"create_onboarding_link","parameters":[{"name":"id","in":"path","description":"Connected account ID","required":true,"schema":{"$ref":"#/components/schemas/ConnectedAccountId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOnboardingLinkRequest"}}},"required":true},"responses":{"201":{"description":"Onboarding link created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingLinkResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/coupons":{"get":{"tags":["Coupons"],"summary":"List coupons","operationId":"list_coupons","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","title":"CouponFilter","enum":["ALL","ACTIVE","INACTIVE","ARCHIVED"]}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `code`, `created_at`, `expires_at`. Direction: `asc` or `desc`. Default: `created_at.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of coupons","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Coupons"],"summary":"Create a coupon","operationId":"create_coupon","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCouponRequest"}}},"required":true},"responses":{"201":{"description":"Coupon created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/coupons/{coupon_id}":{"get":{"tags":["Coupons"],"summary":"Get coupon details","operationId":"get_coupon","parameters":[{"name":"coupon_id","in":"path","description":"Coupon ID","required":true,"schema":{"$ref":"#/components/schemas/CouponId"}}],"responses":{"200":{"description":"Coupon details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Coupon not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Coupons"],"summary":"Update a coupon","operationId":"update_coupon","parameters":[{"name":"coupon_id","in":"path","description":"Coupon ID","required":true,"schema":{"$ref":"#/components/schemas/CouponId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCouponRequest"}}},"required":true},"responses":{"200":{"description":"Coupon updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Coupon not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/coupons/{coupon_id}/archive":{"post":{"tags":["Coupons"],"summary":"Archive a coupon","operationId":"archive_coupon","parameters":[{"name":"coupon_id","in":"path","description":"Coupon ID","required":true,"schema":{"$ref":"#/components/schemas/CouponId"}}],"responses":{"204":{"description":"Coupon archived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Coupon not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/coupons/{coupon_id}/disable":{"post":{"tags":["Coupons"],"summary":"Disable a coupon","operationId":"disable_coupon","parameters":[{"name":"coupon_id","in":"path","description":"Coupon ID","required":true,"schema":{"$ref":"#/components/schemas/CouponId"}}],"responses":{"204":{"description":"Coupon disabled"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Coupon not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/coupons/{coupon_id}/enable":{"post":{"tags":["Coupons"],"summary":"Enable a coupon","operationId":"enable_coupon","parameters":[{"name":"coupon_id","in":"path","description":"Coupon ID","required":true,"schema":{"$ref":"#/components/schemas/CouponId"}}],"responses":{"204":{"description":"Coupon enabled"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Coupon not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/coupons/{coupon_id}/unarchive":{"post":{"tags":["Coupons"],"summary":"Unarchive a coupon","operationId":"unarchive_coupon","parameters":[{"name":"coupon_id","in":"path","description":"Coupon ID","required":true,"schema":{"$ref":"#/components/schemas/CouponId"}}],"responses":{"204":{"description":"Coupon unarchived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Coupon not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/credit-notes":{"get":{"tags":["Credit Notes"],"summary":"List credit notes","description":"List a tenant's credit notes, optionally filtered by customer, invoice or status.","operationId":"list_credit_notes","parameters":[{"name":"customer_id","in":"query","description":"Filter by customer ID","required":false,"schema":{"$ref":"#/components/schemas/CustomerId"}},{"name":"invoice_id","in":"query","description":"Filter by invoice ID","required":false,"schema":{"$ref":"#/components/schemas/InvoiceId"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","title":"CreditNoteStatus","enum":["DRAFT","FINALIZED","VOIDED"]}},{"name":"search","in":"query","description":"Free-text search over credit note number.","required":false,"schema":{"type":"string"}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `created_at`, `credit_note_number`, `total`, `status`. Direction: `asc` or `desc`. Default: `created_at.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of credit notes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/credit-notes/{credit_note_id}":{"get":{"tags":["Credit Notes"],"summary":"Get credit note","description":"Retrieve a single credit note by ID.","operationId":"get_credit_note_by_id","parameters":[{"name":"credit_note_id","in":"path","description":"Credit Note ID","required":true,"schema":{"$ref":"#/components/schemas/CreditNoteId"},"example":"cn_123"}],"responses":{"200":{"description":"Credit note details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNote"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Credit note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/credit-notes/{credit_note_id}/custom-properties":{"patch":{"tags":["Credit Notes"],"summary":"Update credit note custom properties","description":"Merge custom property values onto a credit note (send a key with `null` to remove it).\nValues are validated against the tenant's `CREDIT_NOTE` property definitions. Allowed at any\nstatus — custom properties are external workflow metadata and stay editable after the credit\nnote is finalized.","operationId":"patch_credit_note_custom_properties","parameters":[{"name":"credit_note_id","in":"path","description":"Credit Note ID","required":true,"schema":{"$ref":"#/components/schemas/CreditNoteId"},"example":"cn_123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteCustomPropertiesRequest"}}},"required":true},"responses":{"200":{"description":"Updated credit note","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNote"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Credit note not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/credit-notes/{credit_note_id}/download":{"get":{"tags":["Credit Notes"],"operationId":"download_credit_note_pdf","parameters":[{"name":"credit_note_id","in":"path","description":"Credit Note ID","required":true,"schema":{"$ref":"#/components/schemas/CreditNoteId"},"example":"cn_123"}],"responses":{"200":{"description":"Credit Note PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary","description":"Unused dummy struct only used for an OpenAPI definition."}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Credit note not found or PDF not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/credit-notes/{credit_note_id}/xml":{"get":{"tags":["Credit Notes"],"summary":"Download credit note e-invoice XML","description":"Download the structured e-invoice (EN 16931 XML) issued with a credit note. For\nFactur-X the same XML is also embedded in the PDF.","operationId":"download_credit_note_xml","parameters":[{"name":"credit_note_id","in":"path","description":"Credit Note ID","required":true,"schema":{"$ref":"#/components/schemas/CreditNoteId"},"example":"cn_123"}],"responses":{"200":{"description":"Credit Note e-invoice XML","content":{"application/xml":{"schema":{"type":"string","format":"binary","description":"Unused dummy struct only used for an OpenAPI definition."}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Credit note not found, or not issued as an e-invoice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/custom-property-definitions":{"get":{"tags":["Custom Properties"],"summary":"List custom property definitions","operationId":"list_definitions","parameters":[{"name":"entity_type","in":"query","description":"Filter to a single entity type.","required":false,"schema":{"$ref":"#/components/schemas/CustomPropertyEntityType"}},{"name":"include_archived","in":"query","description":"Include archived (soft-deleted) definitions. Defaults to false.","required":false,"schema":{"type":"boolean"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of custom property definitions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPropertyDefinitionListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Custom Properties"],"summary":"Create a custom property definition","operationId":"create_definition","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPropertyDefinitionCreateRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPropertyDefinition"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"409":{"description":"A definition with this key already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/custom-property-definitions/{id}":{"get":{"tags":["Custom Properties"],"summary":"Get a custom property definition","operationId":"get_definition","parameters":[{"name":"id","in":"path","description":"custom property definition ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Custom property definition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPropertyDefinition"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"put":{"tags":["Custom Properties"],"summary":"Update a custom property definition","operationId":"update_definition","parameters":[{"name":"id","in":"path","description":"custom property definition ID","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPropertyDefinitionUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPropertyDefinition"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["Custom Properties"],"summary":"Archive a custom property definition","description":"Soft-deletes the definition. Existing property values on entities are preserved; the definition\nsimply stops being enforced on new writes.","operationId":"archive_definition","parameters":[{"name":"id","in":"path","description":"custom property definition ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPropertyDefinition"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/customers":{"get":{"tags":["Customers"],"summary":"List customers","description":"List customers with optional pagination and search filtering.","operationId":"list_customers","parameters":[{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `name`, `email`, `alias`, `created_at`. Direction: `asc` or `desc`. Default: `created_at.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"List of customers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Customers"],"summary":"Create customer","operationId":"create_customer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreateRequest"}}},"required":true},"responses":{"201":{"description":"Customer successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"409":{"description":"Customer already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/customers/{id_or_alias}":{"get":{"tags":["Customers"],"summary":"Get customer","description":"Retrieve a single customer by ID or alias.","operationId":"get_customer","parameters":[{"name":"id_or_alias","in":"path","description":"customer ID or alias","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"put":{"tags":["Customers"],"summary":"Update customer","operationId":"update_customer","parameters":[{"name":"id_or_alias","in":"path","description":"customer ID or alias","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["Customers"],"summary":"Archive a customer","description":"No linked entity will be deleted. You need to terminate all active subscriptions before archiving a customer, or the call will fail.","operationId":"archive_customer","parameters":[{"name":"id_or_alias","in":"path","description":"customer ID or alias","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Customers"],"summary":"Patch customer","description":"Partially update a customer. Only provided fields will be updated.","operationId":"patch_customer","parameters":[{"name":"id_or_alias","in":"path","description":"customer ID or alias","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPatchRequest"}}},"required":true},"responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/customers/{id_or_alias}/entitlements":{"get":{"tags":["Customers","Entitlements"],"summary":"List customer entitlements","operationId":"get_effective_entitlements","parameters":[{"name":"id_or_alias","in":"path","description":"Customer ID or alias","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Customer entitlements","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveEntitlementListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/customers/{id_or_alias}/portal-token":{"post":{"tags":["Customers"],"summary":"Generate a portal token for a customer","description":"Generates a JWT token that grants access to the customer portal.\nThe token can be used to access invoices, payment methods, and other portal features.","operationId":"create_portal_token","parameters":[{"name":"id_or_alias","in":"path","description":"customer ID or alias","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalTokenRequest"}}},"required":true},"responses":{"200":{"description":"Portal token generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalTokenResponse"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/customers/{id_or_alias}/unarchive":{"post":{"tags":["Customers"],"summary":"Restore an archived customer","operationId":"unarchive_customer","parameters":[{"name":"id_or_alias","in":"path","description":"customer ID or alias","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/entitlements/{entitlement_id}":{"get":{"tags":["Entitlements"],"summary":"Get entitlement details","operationId":"get_entitlement","parameters":[{"name":"entitlement_id","in":"path","description":"Entitlement ID","required":true,"schema":{"$ref":"#/components/schemas/EntitlementId"}}],"responses":{"200":{"description":"Entitlement details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entitlement"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Entitlement not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["Entitlements"],"summary":"Delete an entitlement","operationId":"delete_entitlement","parameters":[{"name":"entitlement_id","in":"path","description":"Entitlement ID","required":true,"schema":{"$ref":"#/components/schemas/EntitlementId"}}],"responses":{"204":{"description":"Entitlement deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Entitlement not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Entitlements"],"summary":"Update an entitlement","description":"The new value must match the feature's declared type.","operationId":"update_entitlement","parameters":[{"name":"entitlement_id","in":"path","description":"Entitlement ID","required":true,"schema":{"$ref":"#/components/schemas/EntitlementId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEntitlementRequest"}}},"required":true},"responses":{"200":{"description":"Entitlement updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entitlement"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Entitlement not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/events/ingest":{"post":{"tags":["Events"],"summary":"Ingest events","description":"Ingest usage events for metering and billing purposes.\n\nEvents are deduplicated by `(event_id, customer_id)` — re-sending the same pair will not be\ndouble-counted. If timestamps differ across duplicates, the event with the latest timestamp is used.\n\nBy default, any invalid event rejects the entire batch. Set `allow_partial_failures` to `true` to ingest valid events and receive per-event failure details in the response body.","operationId":"ingest_events","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestEventsRequest"}}},"required":true},"responses":{"200":{"description":"Events ingested successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestEventsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/features":{"get":{"tags":["Features"],"summary":"List features","operationId":"list_features","parameters":[{"name":"statuses","in":"query","description":"Filter by feature status. Repeat the param to select multiple, omit to return all.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureStatus"}}},{"name":"product_id","in":"query","description":"Filter by product. Omit to return features across all products.","required":false,"schema":{"$ref":"#/components/schemas/ProductId"}},{"name":"search","in":"query","description":"Search by feature name.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of features","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Features"],"summary":"Create a feature","operationId":"create_feature","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFeatureRequest"}}},"required":true},"responses":{"201":{"description":"Feature created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feature"}}}},"400":{"description":"Bad request, including an unknown product or metric reference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"409":{"description":"A feature with this code already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/features/{id_or_code}":{"get":{"tags":["Features"],"summary":"Get feature details","operationId":"get_feature","parameters":[{"name":"id_or_code","in":"path","description":"Feature ID or code","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Feature details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feature"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Feature not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Features"],"summary":"Update a feature","description":"Partially update feature fields. Code, feature type and product are immutable.","operationId":"update_feature","parameters":[{"name":"id_or_code","in":"path","description":"Feature ID or code","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFeatureRequest"}}},"required":true},"responses":{"200":{"description":"Feature updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feature"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Feature not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/features/{id_or_code}/archive":{"post":{"tags":["Features"],"summary":"Archive a feature","description":"Keeps the feature and its entitlements but hides them from resolution.","operationId":"archive_feature","parameters":[{"name":"id_or_code","in":"path","description":"Feature ID or code","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Feature archived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Feature not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/features/{id_or_code}/unarchive":{"post":{"tags":["Features"],"summary":"Unarchive a feature","operationId":"unarchive_feature","parameters":[{"name":"id_or_code","in":"path","description":"Feature ID or code","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Feature unarchived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Feature not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/invoices":{"get":{"tags":["Invoices"],"summary":"List invoices","description":"List invoices with optional filtering by customer, subscription, or status.","operationId":"list_invoices","parameters":[{"name":"customer_id","in":"query","description":"Filter by customer ID or alias","required":false,"schema":{"type":"string"}},{"name":"subscription_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SubscriptionId"}},{"name":"statuses","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","title":"InvoiceStatus","enum":["DRAFT","FINALIZED","UNCOLLECTIBLE","VOID","CLOSED"]}}},{"name":"einvoicing_status","in":"query","description":"Only invoices whose e-invoice was generated, or failed. Invoices from entities that\nhad not opted in carry no status and match neither.","required":false,"schema":{"type":"string","title":"EInvoicingStatus","description":"Whether the structured e-invoice was produced with the accounting PDF. Absent when the\ninvoicing entity had not opted in at the time the invoice was issued.","enum":["GENERATED","FAILED"]}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `invoice_number`, `customer_name`, `amount`, `invoice_date`, `status`, `payment_status`. Direction: `asc` or `desc`. Default: `invoice_date.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of invoices","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/invoices/{invoice_id}":{"get":{"tags":["Invoices"],"summary":"Get invoice","description":"Retrieve a single invoice with its payment transactions.","operationId":"get_invoice_by_id","parameters":[{"name":"invoice_id","in":"path","description":"Invoice ID","required":true,"schema":{"$ref":"#/components/schemas/InvoiceId"},"example":"inv_123"}],"responses":{"200":{"description":"Invoice details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Invoice not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/invoices/{invoice_id}/custom-properties":{"patch":{"tags":["Invoices"],"summary":"Update invoice custom properties","description":"Merge custom property values onto an invoice (send a key with `null` to remove it).\nValues are validated against the tenant's `INVOICE` property definitions. Allowed at any\nstatus — custom properties are external workflow metadata and stay editable after the invoice\nis finalized.","operationId":"patch_invoice_custom_properties","parameters":[{"name":"invoice_id","in":"path","description":"Invoice ID","required":true,"schema":{"$ref":"#/components/schemas/InvoiceId"},"example":"inv_123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCustomPropertiesRequest"}}},"required":true},"responses":{"200":{"description":"Updated invoice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Invoice not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/invoices/{invoice_id}/download":{"get":{"tags":["Invoices"],"summary":"Download invoice PDF","description":"Download the PDF document for an invoice.","operationId":"download_invoice_pdf","parameters":[{"name":"invoice_id","in":"path","description":"Invoice ID","required":true,"schema":{"$ref":"#/components/schemas/InvoiceId"},"example":"inv_123"}],"responses":{"200":{"description":"Invoice PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary","description":"Unused dummy struct only used for an OpenAPI definition."}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Invoice not found or PDF not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/invoices/{invoice_id}/refresh":{"post":{"tags":["Invoices"],"summary":"Refresh invoice","description":"Recompute a draft invoice against current usage, credits, coupons and tax, and return it.\nDrafts are also refreshed periodically in the background; use this to force it, e.g. after\ningesting late events. Rejected while a payment for the invoice is in progress or when the\ninvoice was merged into a consolidated parent.","operationId":"refresh_invoice","parameters":[{"name":"invoice_id","in":"path","description":"Invoice ID","required":true,"schema":{"$ref":"#/components/schemas/InvoiceId"},"example":"inv_123"}],"responses":{"200":{"description":"Refreshed invoice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Invoice cannot be refreshed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Invoice not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/invoices/{invoice_id}/xml":{"get":{"tags":["Invoices"],"summary":"Download invoice e-invoice XML","description":"Download the structured e-invoice (EN 16931 XML) issued with an invoice. For\nFactur-X the same XML is also embedded in the PDF.","operationId":"download_invoice_xml","parameters":[{"name":"invoice_id","in":"path","description":"Invoice ID","required":true,"schema":{"$ref":"#/components/schemas/InvoiceId"},"example":"inv_123"}],"responses":{"200":{"description":"Invoice e-invoice XML","content":{"application/xml":{"schema":{"type":"string","format":"binary","description":"Unused dummy struct only used for an OpenAPI definition."}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Invoice not found, or not issued as an e-invoice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/metrics":{"get":{"tags":["Metrics"],"summary":"List billable metrics","operationId":"list_metrics","parameters":[{"name":"product_family_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProductFamilyId"}},{"name":"search","in":"query","description":"Search by metric name or code","required":false,"schema":{"type":"string"}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `name`, `code`, `created_at`. Direction: `asc` or `desc`. Default: `name.asc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Metrics"],"summary":"Create a billable metric","operationId":"create_metric","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMetricRequest"}}},"required":true},"responses":{"201":{"description":"Metric created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/metrics/{metric_id}":{"get":{"tags":["Metrics"],"summary":"Get metric details","operationId":"get_metric","parameters":[{"name":"metric_id","in":"path","description":"Metric ID","required":true,"schema":{"$ref":"#/components/schemas/BillableMetricId"}}],"responses":{"200":{"description":"Metric details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Metrics"],"summary":"Update a billable metric","description":"Partially update metric fields. Code and aggregation_type are immutable.","operationId":"update_metric","parameters":[{"name":"metric_id","in":"path","description":"Metric ID","required":true,"schema":{"$ref":"#/components/schemas/BillableMetricId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMetricRequest"}}},"required":true},"responses":{"200":{"description":"Metric updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/metrics/{metric_id}/archive":{"post":{"tags":["Metrics"],"summary":"Archive a billable metric","operationId":"archive_metric","parameters":[{"name":"metric_id","in":"path","description":"Metric ID","required":true,"schema":{"$ref":"#/components/schemas/BillableMetricId"}}],"responses":{"204":{"description":"Metric archived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/metrics/{metric_id}/unarchive":{"post":{"tags":["Metrics"],"summary":"Unarchive a billable metric","operationId":"unarchive_metric","parameters":[{"name":"metric_id","in":"path","description":"Metric ID","required":true,"schema":{"$ref":"#/components/schemas/BillableMetricId"}}],"responses":{"204":{"description":"Metric unarchived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Metric not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/oauth-apps":{"get":{"tags":["OAuth Apps"],"summary":"List OAuth apps","description":"List all OAuth applications registered for this platform.","operationId":"list_oauth_apps","responses":{"200":{"description":"List of OAuth apps","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppsResponse"}}}},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["OAuth Apps"],"summary":"Create OAuth app","description":"Register a new OAuth application. Returns the app with its client secret\n(only shown once).","operationId":"create_oauth_app","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOAuthAppRequest"}}},"required":true},"responses":{"201":{"description":"OAuth app created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppWithSecret"}}}},"401":{"description":"Unauthorized"},"409":{"description":"Duplicate app name"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/oauth-apps/{id}":{"get":{"tags":["OAuth Apps"],"summary":"Get OAuth app","description":"Retrieve an OAuth application by ID.","operationId":"get_oauth_app","parameters":[{"name":"id","in":"path","description":"OAuth app ID","required":true,"schema":{"$ref":"#/components/schemas/OAuthAppId"}}],"responses":{"200":{"description":"OAuth app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthApp"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["OAuth Apps"],"summary":"Delete OAuth app","description":"Delete an OAuth application and revoke all associated tokens.","operationId":"delete_oauth_app","parameters":[{"name":"id","in":"path","description":"OAuth app ID","required":true,"schema":{"$ref":"#/components/schemas/OAuthAppId"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/oauth-apps/{id}/rotate":{"post":{"tags":["OAuth Apps"],"summary":"Rotate client secret","description":"Generate a new client secret for an OAuth app. The old secret is\nimmediately invalidated.","operationId":"rotate_client_secret","parameters":[{"name":"id","in":"path","description":"OAuth app ID","required":true,"schema":{"$ref":"#/components/schemas/OAuthAppId"}}],"responses":{"200":{"description":"Rotated secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotatedSecret"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/oauth/introspect":{"post":{"tags":["OAuth"],"summary":"Introspect token","description":"Token introspection endpoint (RFC 7662). Requires client credentials\nvia HTTP Basic auth.","operationId":"introspect_endpoint","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/IntrospectionRequest"}}},"required":true},"responses":{"200":{"description":"Introspection response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenIntrospectionResponse"}}}},"401":{"description":"Invalid client credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}}}},"/api/v1/oauth/revoke":{"post":{"tags":["OAuth"],"summary":"Revoke token","description":"Token revocation endpoint (RFC 7009). Always returns 200 per spec.\nRequires client credentials via HTTP Basic auth.","operationId":"revoke_endpoint","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/RevocationRequest"}}},"required":true},"responses":{"200":{"description":"Token revoked (or was already invalid)"},"401":{"description":"Invalid client credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}}}},"/api/v1/oauth/token":{"post":{"tags":["OAuth"],"summary":"Exchange tokens","description":"OAuth 2.0 token endpoint. Supports two grant types:\n- `authorization_code`: Exchange an authorization code for tokens\n- `refresh_token`: Refresh an access token\n\nAuthenticate via HTTP Basic auth (`client_id:client_secret`) or body parameters.","operationId":"token_endpoint","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Token response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorResponse"}}}},"401":{"description":"Invalid client credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}}}},"/api/v1/plan-versions/{plan_version_id}/entitlements":{"get":{"tags":["Plans","Entitlements"],"summary":"List plan version entitlements","operationId":"list_plan_version_entitlements","parameters":[{"name":"plan_version_id","in":"path","description":"Plan version ID","required":true,"schema":{"$ref":"#/components/schemas/PlanVersionId"}}],"responses":{"200":{"description":"Resolved entitlements for this plan version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvedEntitlementListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Plans","Entitlements"],"summary":"Create plan version entitlements","description":"Entitlements already present on this plan version are skipped.","operationId":"create_plan_version_entitlements","parameters":[{"name":"plan_version_id","in":"path","description":"Plan version ID","required":true,"schema":{"$ref":"#/components/schemas/PlanVersionId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEntitlementsRequest"}}},"required":true},"responses":{"201":{"description":"Entitlements created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/plans":{"get":{"tags":["Plans"],"summary":"List plans","operationId":"list_plans","parameters":[{"name":"product_family_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProductFamilyId"}},{"name":"search","in":"query","description":"Search by plan name","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by plan status (can be repeated)","required":false,"schema":{"type":"array","items":{"type":"string","title":"PlanStatus","enum":["DRAFT","ACTIVE","INACTIVE","ARCHIVED"]}}},{"name":"plan_type","in":"query","description":"Filter by plan type (can be repeated)","required":false,"schema":{"type":"array","items":{"type":"string","title":"PlanType","enum":["STANDARD","FREE","CUSTOM"]}}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `name`, `status`, `plan_type`, `created_at`. Direction: `asc` or `desc`. Default: `created_at.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of plans","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Plans"],"summary":"Create a plan","description":"Create a new plan with components and pricing. Set `status` to `ACTIVE` to\npublish immediately, or `DRAFT` to stage for review.","operationId":"create_plan","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanRequest"}}},"required":true},"responses":{"201":{"description":"Plan created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/plans/versions/{plan_version_id}/minimum":{"put":{"tags":["Plans"],"summary":"Set or replace the plan-level minimum commitment for a draft plan version.","operationId":"set_plan_minimum","parameters":[{"name":"plan_version_id","in":"path","description":"Plan version ID","required":true,"schema":{"$ref":"#/components/schemas/PlanVersionId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimumCommitment"}}},"required":true},"responses":{"200":{"description":"Minimum commitment saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinimumCommitment"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["Plans"],"summary":"Remove the plan-level minimum commitment for a draft plan version.","operationId":"delete_plan_minimum","parameters":[{"name":"plan_version_id","in":"path","description":"Plan version ID","required":true,"schema":{"$ref":"#/components/schemas/PlanVersionId"}}],"responses":{"204":{"description":"Minimum commitment removed"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/plans/{plan_id}":{"get":{"tags":["Plans"],"summary":"Get plan details","description":"Retrieve a specific plan. Use `?version=draft` for the draft version,\n`?version=2` for a specific version number, or omit for the active version.","operationId":"get_plan_details","parameters":[{"name":"plan_id","in":"path","description":"Plan ID","required":true,"schema":{"$ref":"#/components/schemas/PlanId"}},{"name":"version","in":"query","description":"Filter by version: \"draft\", a version number, or omitted for active","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Plan details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"put":{"tags":["Plans"],"summary":"Replace a plan","description":"Full replacement of a plan's version. On a draft plan, updates in-place.\nOn a published plan, creates a new version. Set `status` to `DRAFT` to\nstage as a new draft without publishing.","operationId":"replace_plan","parameters":[{"name":"plan_id","in":"path","description":"Plan ID","required":true,"schema":{"$ref":"#/components/schemas/PlanId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplacePlanRequest"}}},"required":true},"responses":{"200":{"description":"Plan updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Plans"],"summary":"Update plan metadata","description":"Partially update plan-level fields (name, description, self_service_rank).\nDoes not modify version-level configuration or components.","operationId":"patch_plan","parameters":[{"name":"plan_id","in":"path","description":"Plan ID","required":true,"schema":{"$ref":"#/components/schemas/PlanId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchPlanRequest"}}},"required":true},"responses":{"200":{"description":"Plan updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/plans/{plan_id}/archive":{"post":{"tags":["Plans"],"summary":"Archive a plan","operationId":"archive_plan","parameters":[{"name":"plan_id","in":"path","description":"Plan ID","required":true,"schema":{"$ref":"#/components/schemas/PlanId"}}],"responses":{"204":{"description":"Plan archived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/plans/{plan_id}/publish":{"post":{"tags":["Plans"],"summary":"Publish a draft plan version","description":"Publishes the current draft version, making it the active version.","operationId":"publish_plan","parameters":[{"name":"plan_id","in":"path","description":"Plan ID","required":true,"schema":{"$ref":"#/components/schemas/PlanId"}}],"responses":{"200":{"description":"Plan published","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"409":{"description":"No draft version to publish","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/plans/{plan_id}/unarchive":{"post":{"tags":["Plans"],"summary":"Unarchive a plan","operationId":"unarchive_plan","parameters":[{"name":"plan_id","in":"path","description":"Plan ID","required":true,"schema":{"$ref":"#/components/schemas/PlanId"}}],"responses":{"204":{"description":"Plan unarchived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/plans/{plan_id}/versions":{"get":{"tags":["Plans"],"summary":"List plan versions","operationId":"list_plan_versions","parameters":[{"name":"plan_id","in":"path","description":"Plan ID","required":true,"schema":{"$ref":"#/components/schemas/PlanId"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"Plan versions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanVersionListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/product_families":{"get":{"tags":["Product Families"],"summary":"List product families","operationId":"list_product_families","parameters":[{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `name`, `created_at`. Direction: `asc` or `desc`. Default: `created_at.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of product families","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductFamilyListResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error"}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Product Families"],"summary":"Create product family","operationId":"create_product_family","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductFamilyCreateRequest"}}},"required":true},"responses":{"201":{"description":"Customer successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductFamily"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error"}},"security":[{"bearer_auth":[]}]}},"/api/v1/product_families/{id_or_alias}":{"get":{"tags":["Product Families"],"summary":"Get product family","description":"Retrieve a single product family by ID or alias.","operationId":"get_product_family_by_id_or_alias","parameters":[{"name":"id_or_alias","in":"path","description":"product_family ID or alias","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"ProductFamily","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductFamily"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error"}},"security":[{"bearer_auth":[]}]}},"/api/v1/products":{"get":{"tags":["Products"],"summary":"List products","operationId":"list_products","parameters":[{"name":"product_family_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ProductFamilyId"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `name`, `created_at`. Direction: `asc` or `desc`. Default: `name.asc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of products","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Products"],"summary":"Create a product","operationId":"create_product","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductRequest"}}},"required":true},"responses":{"201":{"description":"Product created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/products/{product_id}":{"get":{"tags":["Products"],"summary":"Get product details","operationId":"get_product","parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"$ref":"#/components/schemas/ProductId"}}],"responses":{"200":{"description":"Product details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Products"],"summary":"Update a product","description":"Partially update product fields. The fee_type is immutable and cannot be changed.","operationId":"update_product","parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"$ref":"#/components/schemas/ProductId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductRequest"}}},"required":true},"responses":{"200":{"description":"Product updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/products/{product_id}/archive":{"post":{"tags":["Products"],"summary":"Archive a product","operationId":"archive_product","parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"$ref":"#/components/schemas/ProductId"}}],"responses":{"204":{"description":"Product archived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/products/{product_id}/entitlements":{"get":{"tags":["Products","Entitlements"],"summary":"List product entitlements","operationId":"list_product_entitlements","parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"$ref":"#/components/schemas/ProductId"}}],"responses":{"200":{"description":"List entitlements for this product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvedEntitlementListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Products","Entitlements"],"summary":"Create product entitlements","description":"A product has no entitlement rows of its own: its entitlements are the feature-level\ndefaults of the features scoped to it, which is what `GET` on this path resolves. Every\nspec must therefore target a feature belonging to `product_id`. Features that already\ncarry a default entitlement are skipped.\n\nSpecs are validated up front, but the writes are not atomic: each feature is written on\nits own, so a failure part-way can leave earlier specs committed. Retrying is safe.","operationId":"create_product_entitlements","parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"$ref":"#/components/schemas/ProductId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEntitlementsRequest"}}},"required":true},"responses":{"201":{"description":"Entitlements created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementListResponse"}}}},"400":{"description":"Bad request, including a feature that is unknown or outside the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/products/{product_id}/unarchive":{"post":{"tags":["Products"],"summary":"Unarchive a product","operationId":"unarchive_product","parameters":[{"name":"product_id","in":"path","description":"Product ID","required":true,"schema":{"$ref":"#/components/schemas/ProductId"}}],"responses":{"204":{"description":"Product unarchived"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"List subscriptions","description":"List subscriptions with optional filtering by customer or plan.","operationId":"list_subscriptions","parameters":[{"name":"customer_id","in":"query","description":"Filter by customer ID or alias","required":false,"schema":{"type":"string"}},{"name":"plan_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PlanId"}},{"name":"statuses","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","title":"SubscriptionStatus","enum":["PENDING_ACTIVATION","PENDING_CHARGE","TRIAL_ACTIVE","ACTIVE","TRIAL_EXPIRED","PAUSED","SUSPENDED","CANCELLED","ABORTED","COMPLETED","SUPERSEDED","ERRORED"]}}},{"name":"order_by","in":"query","description":"Sort order. Format: `column.direction`. Allowed columns: `customer_name`, `plan_name`, `mrr_cents`, `billing_start_date`, `end_date`, `status`, `created_at`. Direction: `asc` or `desc`. Default: `created_at.desc`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"per_page","in":"query","description":"Number of items per page","required":false,"schema":{"type":"integer","format":"int32","maximum":100,"minimum":1}}],"responses":{"200":{"description":"List of subscriptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"post":{"tags":["Subscriptions"],"summary":"Create subscription","description":"Create a new subscription for a customer with a specific plan.","operationId":"create_subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCreateRequest"}}},"required":true},"responses":{"201":{"description":"Subscription successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetails"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/subscriptions/{subscription_id}":{"get":{"tags":["Subscriptions"],"summary":"Get subscription details","description":"Retrieve detailed information about a subscription including price components and schedules.","operationId":"subscription_details","parameters":[{"name":"subscription_id","in":"path","description":"Subscription ID","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionId"}}],"responses":{"200":{"description":"Details of subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionDetails"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Subscriptions"],"summary":"Update subscription","description":"Update subscription settings like payment configuration, billing options, etc.","operationId":"update_subscription","parameters":[{"name":"subscription_id","in":"path","description":"Subscription ID","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Subscription updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionUpdateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/subscriptions/{subscription_id}/cancel":{"post":{"tags":["Subscriptions"],"summary":"Cancel subscription","description":"Cancel a subscription either immediately or at the end of the billing period.","operationId":"cancel_subscription","parameters":[{"name":"subscription_id","in":"path","description":"Subscription ID","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionId"},"example":"sub_123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"Subscription canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/subscriptions/{subscription_id}/entitlements":{"get":{"tags":["Subscriptions","Entitlements"],"summary":"List subscription entitlements","operationId":"list_subscription_entitlements","parameters":[{"name":"subscription_id","in":"path","description":"Subscription ID","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionId"}}],"responses":{"200":{"description":"Effective entitlements for this subscription, with live usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EffectiveEntitlementListResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/subscriptions/{subscription_id}/summary":{"get":{"tags":["Subscriptions"],"summary":"Get subscription summary","description":"Retrieve a subscription without its components, add-ons, coupons and entitlements: the same\nshape as list items, for callers that only need status and billing dates.","operationId":"subscription_summary","parameters":[{"name":"subscription_id","in":"path","description":"Subscription ID","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionId"}}],"responses":{"200":{"description":"Subscription summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/usage/customer/{customer_id}":{"get":{"tags":["Usage"],"summary":"Get customer usage","description":"Retrieve aggregated usage data for a customer over a specified period.","operationId":"get_customer_usage","parameters":[{"name":"customer_id","in":"path","description":"Customer ID or alias","required":true,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"metric_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BillableMetricId"}}],"responses":{"200":{"description":"Customer usage data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/usage/subscription/{subscription_id}":{"get":{"tags":["Usage"],"summary":"Get subscription usage","description":"Retrieve aggregated usage data for a subscription's usage-based components.\nIf start_date/end_date are omitted, defaults to the current billing period.","operationId":"get_subscription_usage","parameters":[{"name":"subscription_id","in":"path","description":"Subscription ID","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionId"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"metric_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BillableMetricId"}}],"responses":{"200":{"description":"Subscription usage data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/api/v1/usage/summary":{"get":{"tags":["Usage"],"summary":"Get usage summary","description":"Retrieve aggregated usage data across all customers for the tenant.","operationId":"get_usage_summary","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"metric_id","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BillableMetricId"}}],"responses":{"200":{"description":"Usage summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestErrorResponse"}}}}},"security":[{"bearer_auth":[]}]}}},"components":{"schemas":{"AddOn":{"type":"object","required":["id","name","product_id","price_id","self_serviceable","created_at"],"properties":{"archived_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/Entitlement"}},"fee_type":{"oneOf":[{"$ref":"#/components/schemas/ProductFeeTypeEnum"},{"type":"null"}]},"id":{"$ref":"#/components/schemas/AddOnId"},"max_instances_per_subscription":{"type":["integer","null"],"format":"int32"},"name":{"type":"string"},"price_id":{"$ref":"#/components/schemas/PriceId"},"product_id":{"$ref":"#/components/schemas/ProductId"},"self_serviceable":{"type":"boolean"}}},"AddOnEvent":{"allOf":[{"$ref":"#/components/schemas/AddOnEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"AddOnEventData":{"type":"object","required":["add_on_id","name","product_id","price_id","self_serviceable","created_at"],"properties":{"add_on_id":{"$ref":"#/components/schemas/AddOnId"},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"fee_type":{"oneOf":[{"$ref":"#/components/schemas/ProductFeeTypeEnum"},{"type":"null"}]},"max_instances_per_subscription":{"type":["integer","null"],"format":"int32"},"name":{"type":"string"},"price_id":{"$ref":"#/components/schemas/PriceId"},"product_id":{"$ref":"#/components/schemas/ProductId"},"self_serviceable":{"type":"boolean"}}},"AddOnId":{"type":"string","format":"MeteroidId","examples":["add_7n42DGM5Tflk9n8mt7Fhc7"]},"AddOnListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AddOn"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"Address":{"type":"object","properties":{"city":{"type":["string","null"]},"country":{"oneOf":[{"$ref":"#/components/schemas/CountryCode"},{"type":"null"}]},"line1":{"type":["string","null"]},"line2":{"type":["string","null"]},"state":{"type":["string","null"]},"zip_code":{"type":["string","null"]}}},"AllComponentsScope":{"type":"object","description":"Every revenue line counts toward the floor."},"AppliedCoupon":{"type":"object","required":["id","coupon_id","is_active","created_at"],"properties":{"applied_amount":{"type":["string","null"],"format":"decimal"},"applied_count":{"type":["integer","null"],"format":"int32"},"coupon_id":{"$ref":"#/components/schemas/CouponId"},"created_at":{"type":"string","format":"date-time"},"id":{"$ref":"#/components/schemas/AppliedCouponId"},"is_active":{"type":"boolean"},"last_applied_at":{"type":["string","null"],"format":"date-time"}}},"AppliedCouponDetailed":{"type":"object","required":["coupon","applied_coupon"],"properties":{"applied_coupon":{"$ref":"#/components/schemas/AppliedCoupon"},"coupon":{"$ref":"#/components/schemas/SubscriptionCoupon"}}},"AppliedCouponId":{"type":"string","format":"MeteroidId","examples":["sub_cou_7n42DGM5Tflk9n8mt7Fhc7"]},"AvailableParameters":{"type":"object","properties":{"billing_periods":{"type":"object","description":"Map of component_id -> available billing periods (e.g., \"MONTHLY\", \"ANNUAL\")","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/BillingPeriodEnum"}},"propertyNames":{"type":"string"}},"capacity_thresholds":{"type":"object","description":"Map of component_id -> available capacity values","additionalProperties":{"type":"array","items":{"type":"integer","format":"int64","minimum":0}},"propertyNames":{"type":"string"}},"slot_components":{"type":"array","items":{"type":"string"},"description":"List of component_ids that support slot parametrization (initial slot count)"}}},"BankAccountId":{"type":"string","format":"MeteroidId","examples":["ba_7n42DGM5Tflk9n8mt7Fhc7"]},"BankTransferPaymentMethodConfig":{"type":"object","properties":{"account_id":{"oneOf":[{"$ref":"#/components/schemas/BankAccountId"},{"type":"null"}]}}},"BatchJobChunkId":{"type":"string","format":"MeteroidId","examples":["bjch_7n42DGM5Tflk9n8mt7Fhc7"]},"BatchJobDetailResponse":{"type":"object","required":["id","job_type","status","processed_items","failed_items","created_by","created_at","failure_count","has_error_csv","has_output"],"properties":{"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"created_by":{"type":"string","format":"uuid"},"error_csv_url":{"type":["string","null"]},"failed_items":{"type":"integer","format":"int32"},"failure_count":{"type":"integer","format":"int64"},"has_error_csv":{"type":"boolean"},"has_output":{"type":"boolean"},"id":{"$ref":"#/components/schemas/BatchJobId"},"input_file_name":{"type":["string","null"]},"input_file_url":{"type":["string","null"]},"job_type":{"$ref":"#/components/schemas/BatchJobType"},"output_url":{"type":["string","null"]},"processed_items":{"type":"integer","format":"int32"},"status":{"$ref":"#/components/schemas/BatchJobStatus"},"total_items":{"type":["integer","null"],"format":"int32"}}},"BatchJobFailuresResponse":{"type":"object","required":["data","total_count"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BatchJobItemFailureResponse"}},"total_count":{"type":"integer","format":"int64"}}},"BatchJobId":{"type":"string","format":"MeteroidId","examples":["bjob_7n42DGM5Tflk9n8mt7Fhc7"]},"BatchJobItemFailureResponse":{"type":"object","required":["id","chunk_id","item_index","reason"],"properties":{"chunk_id":{"$ref":"#/components/schemas/BatchJobChunkId"},"id":{"type":"string","format":"uuid"},"item_identifier":{"type":["string","null"]},"item_index":{"type":"integer","format":"int32"},"reason":{"type":"string"}}},"BatchJobListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BatchJobResponse"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"BatchJobResponse":{"type":"object","required":["id","job_type","status","processed_items","failed_items","created_by","created_at"],"properties":{"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"created_by":{"type":"string","format":"uuid"},"failed_items":{"type":"integer","format":"int32"},"id":{"$ref":"#/components/schemas/BatchJobId"},"input_file_name":{"type":["string","null"]},"job_type":{"$ref":"#/components/schemas/BatchJobType"},"processed_items":{"type":"integer","format":"int32"},"status":{"$ref":"#/components/schemas/BatchJobStatus"},"total_items":{"type":["integer","null"],"format":"int32"}}},"BatchJobStatus":{"type":"string","title":"BatchJobStatus","enum":["PENDING","CHUNKING","PROCESSING","COMPLETED","COMPLETED_WITH_ERRORS","FAILED","CANCELLED"]},"BatchJobType":{"type":"string","title":"BatchJobType","enum":["EVENT_CSV_IMPORT","CUSTOMER_CSV_IMPORT","SUBSCRIPTION_CSV_IMPORT","SUBSCRIPTION_PLAN_MIGRATION","TAX_REPORT_EXPORT"]},"BillableMetricId":{"type":"string","format":"MeteroidId","examples":["bm_7n42DGM5Tflk9n8mt7Fhc7"]},"BillingConfig":{"type":"object","properties":{"billing_cycles":{"type":["integer","null"],"format":"int32"},"net_terms":{"type":"integer","format":"int32"},"period_start_day":{"type":["integer","null"],"format":"int32"}}},"BillingCycleResetPeriod":{"type":"object","description":"Resets each time your subscription renews — anchored to your billing cycle."},"BillingMetricAggregateEnum":{"type":"string","enum":["COUNT","LATEST","MAX","MIN","MEAN","SUM","COUNT_DISTINCT"]},"BillingPeriodEnum":{"type":"string","enum":["MONTHLY","QUARTERLY","SEMIANNUAL","ANNUAL"]},"BillingType":{"type":"string","enum":["ADVANCE","ARREARS"]},"BillingTypeEnum":{"type":"string","enum":["ADVANCE","ARREARS"]},"BooleanConfigValue":{"type":"object","description":"A boolean config value.","required":["value"],"properties":{"value":{"type":"boolean"}}},"BooleanEffectiveEntitlementValue":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}},"BooleanEntitlementValue":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}},"BooleanFeatureType":{"type":"object"},"BooleanResolvedEntitlementValue":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}},"CalendarResetPeriod":{"type":"object","description":"Resets on calendar boundaries (e.g. the 1st of every month) — not tied to subscription start date.","required":["unit","interval"],"properties":{"interval":{"type":"integer","format":"int32","minimum":0},"unit":{"$ref":"#/components/schemas/CalendarUnit"}}},"CalendarUnit":{"type":"string","enum":["HOUR","DAY","WEEK","MONTH","YEAR"]},"CancelCheckoutSessionResponse":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/CheckoutSession"}}},"CancelSubscriptionRequest":{"type":"object","properties":{"effective_date":{"type":["string","null"],"format":"date","description":"If not provided, the cancellation will be effective at the end of the current billing or committed period."},"reason":{"type":["string","null"]}}},"CancelSubscriptionResponse":{"type":"object","required":["subscription"],"properties":{"subscription":{"$ref":"#/components/schemas/Subscription"}}},"CapacityFee":{"type":"object","required":["rate","included","overage_rate","metric_id"],"properties":{"included":{"type":"integer","format":"int64","minimum":0},"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"overage_rate":{"type":"string","format":"decimal"},"rate":{"type":"string","format":"decimal"}}},"CapacityFeeStructure":{"type":"object","required":["metric_id"],"properties":{"metric_id":{"$ref":"#/components/schemas/BillableMetricId"}}},"CapacityPlanFee":{"type":"object","description":"Capacity-based fee with included committed usage and overage","required":["metric_id","thresholds","cadence"],"properties":{"cadence":{"$ref":"#/components/schemas/BillingPeriodEnum"},"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"thresholds":{"type":"array","items":{"$ref":"#/components/schemas/CapacityThreshold"}}}},"CapacityPricing":{"type":"object","required":["rate","included","overage_rate"],"properties":{"included":{"type":"integer","format":"int64","minimum":0},"overage_rate":{"type":"string","format":"decimal"},"rate":{"type":"string","format":"decimal"}}},"CapacityThreshold":{"type":"object","required":["included_amount","price","per_unit_overage"],"properties":{"included_amount":{"type":"integer","format":"int64","minimum":0},"per_unit_overage":{"type":"string","format":"decimal"},"price":{"type":"string","format":"decimal"}}},"CheckoutSession":{"type":"object","required":["id","customer_id","plan_version_id","status","checkout_type","created_at"],"properties":{"billing_day_anchor":{"type":["integer","null"],"format":"int32"},"billing_start_date":{"type":["string","null"],"format":"date"},"cancel_url":{"type":["string","null"]},"checkout_type":{"$ref":"#/components/schemas/CheckoutType"},"checkout_url":{"type":["string","null"]},"completed_at":{"type":["string","null"],"format":"date-time"},"coupon_code":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"expires_at":{"type":["string","null"],"format":"date-time","description":"When the session expires. None means the session never expires."},"id":{"$ref":"#/components/schemas/CheckoutSessionId"},"net_terms":{"type":["integer","null"],"format":"int32"},"payment_methods_config":{"oneOf":[{"$ref":"#/components/schemas/PaymentMethodsConfig"},{"type":"null"}]},"plan_version_id":{"$ref":"#/components/schemas/PlanVersionId"},"status":{"$ref":"#/components/schemas/CheckoutSessionStatus"},"subscription_id":{"oneOf":[{"$ref":"#/components/schemas/SubscriptionId"},{"type":"null"}]},"success_url":{"type":["string","null"]},"trial_duration_days":{"type":["integer","null"],"format":"int32"}}},"CheckoutSessionId":{"type":"string","format":"MeteroidId","examples":["che_7n42DGM5Tflk9n8mt7Fhc7"]},"CheckoutSessionStatus":{"type":"string","title":"CheckoutSessionStatus","enum":["CREATED","AWAITING_PAYMENT","COMPLETED","EXPIRED","CANCELLED"]},"CheckoutType":{"type":"string","enum":["SELF_SERVE","SUBSCRIPTION_ACTIVATION","PLAN_CHANGE","ADDON_PURCHASE"]},"ComponentOverride":{"type":"object","required":["component_id","name","price_entry"],"properties":{"component_id":{"$ref":"#/components/schemas/PriceComponentId"},"name":{"type":"string"},"price_entry":{"$ref":"#/components/schemas/PriceEntry"}}},"ComponentParameterization":{"type":"object","required":["component_id","parameters"],"properties":{"component_id":{"$ref":"#/components/schemas/PriceComponentId"},"parameters":{"$ref":"#/components/schemas/ComponentParameters"}}},"ComponentParameters":{"type":"object","properties":{"billing_period":{"oneOf":[{"$ref":"#/components/schemas/BillingPeriodEnum"},{"type":"null"}]},"committed_capacity":{"type":["integer","null"],"format":"int64","minimum":0},"initial_slot_count":{"type":["integer","null"],"format":"int32","minimum":0}}},"ComponentsScope":{"type":"object","description":"Component names — matched against `ReplacePlanRequest::components[].name`.","required":["component_names"],"properties":{"component_names":{"type":"array","items":{"type":"string"}}}},"ConfigEffectiveEntitlementValue":{"type":"object","required":["value"],"properties":{"value":{"$ref":"#/components/schemas/ConfigValue"}}},"ConfigEntitlementValue":{"type":"object","required":["value"],"properties":{"value":{"$ref":"#/components/schemas/ConfigValue"}}},"ConfigFeatureType":{"type":"object","description":"A static, typed configuration value. No metric — resolved synchronously.","required":["value_type"],"properties":{"options":{"type":"array","items":{"type":"string"},"description":"Allowed values when `value_type = SELECT`. Empty otherwise."},"value_type":{"$ref":"#/components/schemas/ConfigValueType","description":"The feature's value type, fixed at creation."}}},"ConfigResolvedEntitlementValue":{"type":"object","required":["value"],"properties":{"value":{"$ref":"#/components/schemas/ConfigValue"}}},"ConfigValue":{"oneOf":[{"$ref":"#/components/schemas/NumberConfigValue"},{"$ref":"#/components/schemas/BooleanConfigValue"},{"$ref":"#/components/schemas/TextConfigValue"},{"$ref":"#/components/schemas/JsonConfigValue"}],"description":"A static, typed configuration value carried by a Config entitlement. Resolved synchronously\nthrough the entitlement hierarchy — no metric, no usage counter.","discriminator":{"propertyName":"kind","mapping":{"BOOLEAN":"#/components/schemas/BooleanConfigValue","JSON":"#/components/schemas/JsonConfigValue","NUMBER":"#/components/schemas/NumberConfigValue","TEXT":"#/components/schemas/TextConfigValue"}}},"ConfigValueType":{"type":"string","description":"Authoritative value type of a Config feature. `MAP`/`JSON` both carry a JSON value.","enum":["NUMBER","BOOLEAN","TEXT","MAP","JSON","SELECT"]},"ConnectedAccount":{"type":"object","description":"A connected account (relationship between platform and connected org)","required":["id","platform_organization_id","connection_type","status","onboarding_mode","created_at"],"properties":{"connected_organization_id":{"oneOf":[{"$ref":"#/components/schemas/OrganizationId","description":"For express accounts in pending status, this may be None until onboarding completes"},{"type":"null"}]},"connected_tenant_id":{"oneOf":[{"$ref":"#/components/schemas/TenantId","description":"Tenant ID for express accounts (single-tenant). None for standard accounts (use tenant header)."},{"type":"null"}]},"connection_type":{"$ref":"#/components/schemas/ConnectionType"},"created_at":{"type":"string","format":"date-time"},"id":{"$ref":"#/components/schemas/ConnectedAccountId"},"metadata":{},"onboarding_completed_at":{"type":["string","null"],"format":"date-time"},"onboarding_mode":{"$ref":"#/components/schemas/OnboardingMode"},"pending_country":{"oneOf":[{"$ref":"#/components/schemas/CountryCode","description":"Country code for the organization to be created (express flow only)"},{"type":"null"}]},"pending_email":{"type":["string","null"],"description":"Email of the user being invited (express flow only)"},"pending_organization_name":{"type":["string","null"],"description":"Name of the organization to be created (express flow only)"},"platform_customer_id":{"oneOf":[{"$ref":"#/components/schemas/CustomerId"},{"type":"null"}]},"platform_organization_id":{"$ref":"#/components/schemas/OrganizationId"},"revoked_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#/components/schemas/ConnectionStatus"}}},"ConnectedAccountId":{"type":"string","format":"MeteroidId","examples":["cacc_7n42DGM5Tflk9n8mt7Fhc7"]},"ConnectedAccountsResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectedAccount"}}}},"ConnectionStatus":{"type":"string","description":"Status of a connected account","enum":["pending","active","revoked","suspended"]},"ConnectionType":{"type":"string","description":"Type of connection between platform and connected account","enum":["standard","express"]},"CountryCode":{"type":"string","format":"CountryCode","examples":["US","GB","FR"]},"Coupon":{"type":"object","required":["id","code","discount","reusable","disabled","created_at","redemption_count","plan_ids"],"properties":{"archived_at":{"type":["string","null"],"format":"date-time"},"code":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"disabled":{"type":"boolean"},"discount":{"$ref":"#/components/schemas/CouponDiscount"},"expires_at":{"type":["string","null"],"format":"date-time"},"id":{"$ref":"#/components/schemas/CouponId"},"plan_ids":{"type":"array","items":{"$ref":"#/components/schemas/PlanId"}},"recurring_value":{"type":["integer","null"],"format":"int32"},"redemption_count":{"type":"integer","format":"int32"},"redemption_limit":{"type":["integer","null"],"format":"int32"},"reusable":{"type":"boolean"}}},"CouponDiscount":{"oneOf":[{"$ref":"#/components/schemas/PercentageDiscount"},{"$ref":"#/components/schemas/FixedDiscount"}],"discriminator":{"propertyName":"type","mapping":{"FIXED":"#/components/schemas/FixedDiscount","PERCENTAGE":"#/components/schemas/PercentageDiscount"}}},"CouponEvent":{"allOf":[{"$ref":"#/components/schemas/CouponEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"CouponEventData":{"type":"object","required":["coupon_id","code","description","discount","reusable","disabled","created_at"],"properties":{"code":{"type":"string"},"coupon_id":{"$ref":"#/components/schemas/CouponId"},"created_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"disabled":{"type":"boolean"},"discount":{"$ref":"#/components/schemas/CouponDiscount"},"expires_at":{"type":["string","null"],"format":"date-time"},"recurring_value":{"type":["integer","null"],"format":"int32"},"redemption_limit":{"type":["integer","null"],"format":"int32"},"reusable":{"type":"boolean"}}},"CouponId":{"type":"string","format":"MeteroidId","examples":["cou_7n42DGM5Tflk9n8mt7Fhc7"]},"CouponLineItem":{"type":"object","required":["coupon_id","name","total"],"properties":{"coupon_id":{"type":"string"},"name":{"type":"string"},"total":{"type":"integer","format":"int64"}}},"CouponListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"CreateAddOnRequest":{"type":"object","required":["name","product_id","price_id"],"properties":{"description":{"type":["string","null"]},"max_instances_per_subscription":{"type":["integer","null"],"format":"int32"},"name":{"type":"string"},"price_id":{"$ref":"#/components/schemas/PriceId"},"product_id":{"$ref":"#/components/schemas/ProductId"},"self_serviceable":{"type":"boolean"}}},"CreateCheckoutSessionRequest":{"type":"object","required":["customer_id","plan_version_id"],"properties":{"add_ons":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CreateSubscriptionAddOn"}},"auto_advance_invoices":{"type":["boolean","null"],"description":"If false, invoices will stay in Draft until manually reviewed and finalized. Default is true."},"billing_day_anchor":{"type":["integer","null"],"format":"int32"},"billing_start_date":{"type":["string","null"],"format":"date"},"cancel_url":{"type":["string","null"],"description":"Absolute http(s) URL offered to the customer to leave the checkout without paying."},"charge_automatically":{"type":["boolean","null"],"description":"Automatically try to charge the customer's configured payment method on finalize. Default is true."},"components":{"oneOf":[{"$ref":"#/components/schemas/CreateSubscriptionComponents"},{"type":"null"}]},"coupon_code":{"type":["string","null"]},"coupon_ids":{"type":"array","items":{"$ref":"#/components/schemas/CouponId"}},"customer_id":{"type":"string","format":"CustomerId or customer alias","description":"Customer ID or alias"},"end_date":{"type":["string","null"],"format":"date"},"expires_in_hours":{"type":["integer","null"],"format":"int32","description":"Session expiry time in hours. Default is 1 hour for self-serve checkout.","minimum":0},"invoice_memo":{"type":["string","null"]},"invoice_threshold":{"type":["string","null"],"format":"decimal"},"metadata":{},"net_terms":{"type":["integer","null"],"format":"int32"},"payment_methods_config":{"oneOf":[{"$ref":"#/components/schemas/PaymentMethodsConfig","description":"Payment methods configuration. If not specified, inherits from the invoicing entity."},{"type":"null"}]},"plan_version_id":{"$ref":"#/components/schemas/PlanVersionId"},"purchase_order":{"type":["string","null"]},"success_url":{"type":["string","null"],"description":"Absolute http(s) URL the customer is sent to after a successful checkout.\n`checkout_session_id` is appended as a query parameter. Without it the customer stays on\nthe hosted confirmation page."},"trial_duration_days":{"type":["integer","null"],"format":"int32"}}},"CreateCheckoutSessionResponse":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/CheckoutSession"}}},"CreateConnectedAccountRequest":{"type":"object","required":["connected_organization_id"],"properties":{"connected_organization_id":{"type":"string","format":"uuid"},"connection_type":{"oneOf":[{"$ref":"#/components/schemas/ConnectionType"},{"type":"null"}]},"metadata":{},"platform_customer_id":{"oneOf":[{"$ref":"#/components/schemas/CustomerId"},{"type":"null"}]}}},"CreateCouponRequest":{"type":"object","required":["code","discount"],"properties":{"code":{"type":"string"},"description":{"type":["string","null"]},"discount":{"$ref":"#/components/schemas/CouponDiscount"},"expires_at":{"type":["string","null"],"format":"date-time"},"plan_ids":{"type":"array","items":{"$ref":"#/components/schemas/PlanId"}},"recurring_value":{"type":["integer","null"],"format":"int32"},"redemption_limit":{"type":["integer","null"],"format":"int32"},"reusable":{"type":"boolean"}}},"CreateEntitlementsRequest":{"type":"object","description":"Entitlements already present on the entity are skipped, so the call can be replayed.","required":["entitlements"],"properties":{"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/EntitlementSpecRequest"}}}},"CreateFeatureRequest":{"type":"object","required":["name","code","feature_type"],"properties":{"code":{"type":"string","description":"Unique key used to reference this feature in your code. Cannot be changed after creation."},"description":{"type":["string","null"]},"entitlement":{"oneOf":[{"$ref":"#/components/schemas/EntitlementValue","description":"Feature-level (default) entitlement, applied to all subscriptions as the lowest-priority."},{"type":"null"}]},"feature_type":{"$ref":"#/components/schemas/FeatureType","description":"Fixed at creation — a feature never changes type."},"name":{"type":"string"},"product_id":{"oneOf":[{"$ref":"#/components/schemas/ProductId","description":"Product this feature belongs to. Omit for a tenant-global feature."},{"type":"null"}]}}},"CreateMetricRequest":{"type":"object","required":["name","code","aggregation_type","product_family_id"],"properties":{"aggregation_key":{"type":["string","null"]},"aggregation_type":{"$ref":"#/components/schemas/BillingMetricAggregateEnum"},"code":{"type":"string"},"description":{"type":["string","null"]},"filters":{"type":["array","null"],"items":{"$ref":"#/components/schemas/MetricFilter"},"description":"Pre-aggregation property filters. Optional and backward-compatible; omit for none."},"name":{"type":"string"},"product_family_id":{"$ref":"#/components/schemas/ProductFamilyId"},"product_id":{"oneOf":[{"$ref":"#/components/schemas/ProductId"},{"type":"null"}]},"segmentation_matrix":{"oneOf":[{"$ref":"#/components/schemas/MetricSegmentationMatrix"},{"type":"null"}]},"unit_conversion":{"oneOf":[{"$ref":"#/components/schemas/UnitConversion"},{"type":"null"}]},"usage_group_key":{"type":["string","null"]}}},"CreateOAuthAppRequest":{"type":"object","required":["name","redirect_uris"],"properties":{"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":["array","null"],"items":{"type":"string"}}}},"CreateOnboardingLinkRequest":{"type":"object","required":["redirect_url"],"properties":{"redirect_url":{"type":"string"}}},"CreatePlanRequest":{"type":"object","required":["name","product_family_id","plan_type","status","currency","components"],"properties":{"add_ons":{"type":"array","items":{"$ref":"#/components/schemas/PlanAddOnInput"}},"billing":{"oneOf":[{"$ref":"#/components/schemas/BillingConfig"},{"type":"null"}]},"components":{"type":"array","items":{"$ref":"#/components/schemas/PriceComponentInput"}},"currency":{"type":"string"},"description":{"type":["string","null"]},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/EntitlementSpecRequest"},"description":"Entitlements to attach to this plan's version. Replacing a published plan creates a\nnew version, and entitlements belong to a version, so passing them here keeps them\nattached to whichever version the call produces."},"name":{"type":"string"},"plan_type":{"$ref":"#/components/schemas/PlanTypeEnum"},"product_family_id":{"$ref":"#/components/schemas/ProductFamilyId"},"self_service_rank":{"type":["integer","null"],"format":"int32"},"status":{"$ref":"#/components/schemas/PlanStatusEnum"},"tax_inclusive":{"type":"boolean","description":"The plan's amounts are quoted tax-included (\"9.99 incl. VAT\"): tax is carved out of\nthem at invoice time instead of being added on top, so the customer pays the quoted\nprice whatever rate applies. A customer who bears no tax (reverse charge, exempt,\nexport) still pays it in full. Defaults to `false`."},"trial":{"oneOf":[{"$ref":"#/components/schemas/TrialConfig"},{"type":"null"}]}}},"CreateProductRequest":{"type":"object","required":["name","product_family_id","fee_structure"],"properties":{"catalog":{"type":"boolean"},"description":{"type":["string","null"]},"fee_structure":{"$ref":"#/components/schemas/ProductFeeStructure"},"name":{"type":"string"},"product_family_id":{"$ref":"#/components/schemas/ProductFamilyId"}}},"CreateSubscriptionAddOn":{"type":"object","required":["add_on_id"],"properties":{"add_on_id":{"$ref":"#/components/schemas/AddOnId"},"customization":{"oneOf":[{"$ref":"#/components/schemas/SubscriptionAddOnCustomization"},{"type":"null"}]},"quantity":{"type":"integer","format":"int32","minimum":0}}},"CreateSubscriptionComponents":{"type":"object","properties":{"extra_components":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ExtraComponent"}},"overridden_components":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ComponentOverride"}},"parameterized_components":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ComponentParameterization"}},"remove_components":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PriceComponentId"}}}},"CreditNote":{"type":"object","required":["id","credit_note_number","status","credit_type","customer_id","invoice_id","invoice_number","currency","subtotal","tax_amount","total","refunded_amount_cents","credited_amount_cents","line_items","tax_breakdown","created_at","custom_properties"],"properties":{"created_at":{"type":"string","format":"date-time"},"credit_note_number":{"type":"string"},"credit_type":{"$ref":"#/components/schemas/CreditType"},"credited_amount_cents":{"type":"integer","format":"int64"},"currency":{"$ref":"#/components/schemas/Currency"},"custom_properties":{"description":"User-defined custom property values, keyed by definition `key`."},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"finalized_at":{"type":["string","null"],"format":"date-time"},"id":{"$ref":"#/components/schemas/CreditNoteId"},"invoice_id":{"$ref":"#/components/schemas/InvoiceId"},"invoice_number":{"type":"string"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLineItem"}},"memo":{"type":["string","null"]},"plan_version_id":{"oneOf":[{"$ref":"#/components/schemas/PlanVersionId"},{"type":"null"}]},"reason":{"type":["string","null"]},"refunded_amount_cents":{"type":"integer","format":"int64"},"status":{"$ref":"#/components/schemas/CreditNoteStatus"},"subscription_id":{"oneOf":[{"$ref":"#/components/schemas/SubscriptionId"},{"type":"null"}]},"subtotal":{"type":"integer","format":"int64"},"tax_amount":{"type":"integer","format":"int64"},"tax_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/TaxBreakdownItem"}},"total":{"type":"integer","format":"int64"},"updated_at":{"type":["string","null"],"format":"date-time"},"voided_at":{"type":["string","null"],"format":"date-time"}}},"CreditNoteCustomPropertiesRequest":{"type":"object","description":"Merge update of a credit note's custom property values (send a key with `null` to remove it).\nAllowed at any status — custom properties stay editable after the credit note is finalized.","required":["custom_properties"],"properties":{"custom_properties":{}}},"CreditNoteEvent":{"allOf":[{"$ref":"#/components/schemas/CreditNoteEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"CreditNoteEventData":{"type":"object","required":["credit_note_id","customer_id","invoice_id","status","currency","subtotal","total","tax_amount","refunded_amount_cents","credited_amount_cents","line_items","tax_breakdown","custom_properties","created_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"credit_note_id":{"$ref":"#/components/schemas/CreditNoteId"},"credit_note_number":{"type":["string","null"],"description":"Absent while the credit note is a draft — the number is assigned at finalization."},"credited_amount_cents":{"type":"integer","format":"int64"},"currency":{"type":"string"},"custom_properties":{"description":"User-defined custom property values, keyed by definition key."},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"invoice_id":{"$ref":"#/components/schemas/InvoiceId"},"invoice_number":{"type":["string","null"],"description":"Number of the invoice being credited."},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLineItem"},"description":"Credited line items (negated amounts)."},"memo":{"type":["string","null"]},"reason":{"type":["string","null"]},"refunded_amount_cents":{"type":"integer","format":"int64"},"status":{"$ref":"#/components/schemas/CreditNoteStatus"},"subtotal":{"type":"integer","format":"int64"},"tax_amount":{"type":"integer","format":"int64"},"tax_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/TaxBreakdownItem"},"description":"Per-rate tax (VAT) breakdown for the credited amount."},"total":{"type":"integer","format":"int64"}}},"CreditNoteId":{"type":"string","format":"MeteroidId","examples":["crn_7n42DGM5Tflk9n8mt7Fhc7"]},"CreditNoteListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CreditNote"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"CreditNoteStatus":{"type":"string","title":"CreditNoteStatus","enum":["DRAFT","FINALIZED","VOIDED"]},"CreditType":{"type":"string","title":"CreditType","enum":["CREDIT_TO_BALANCE","REFUND","DEBT_CANCELLATION"]},"Currency":{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNH","CNY","COP","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLL","SOS","SRD","SSP","STD","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XOF","XPF","YER","ZAR","ZMW","ZWL"],"examples":["EUR"]},"CustomPropertyDefinition":{"type":"object","required":["id","entity_type","key","name","property_type","config","required","display_order","archived"],"properties":{"archived":{"type":"boolean"},"config":{"$ref":"#/components/schemas/PropertyConfig"},"default_value":{},"description":{"type":["string","null"]},"display_order":{"type":"integer","format":"int32"},"entity_type":{"$ref":"#/components/schemas/CustomPropertyEntityType"},"id":{"$ref":"#/components/schemas/CustomPropertyDefinitionId"},"key":{"type":"string"},"name":{"type":"string"},"property_type":{"$ref":"#/components/schemas/CustomPropertyType"},"required":{"type":"boolean"}}},"CustomPropertyDefinitionCreateRequest":{"type":"object","required":["entity_type","key","name","property_type"],"properties":{"config":{"$ref":"#/components/schemas/PropertyConfig"},"default_value":{},"description":{"type":["string","null"]},"display_order":{"type":"integer","format":"int32"},"entity_type":{"$ref":"#/components/schemas/CustomPropertyEntityType"},"key":{"type":"string","description":"Immutable machine name; letters, digits and underscores only. Unique per entity type."},"name":{"type":"string"},"property_type":{"$ref":"#/components/schemas/CustomPropertyType"},"required":{"type":"boolean"}}},"CustomPropertyDefinitionId":{"type":"string","format":"MeteroidId","examples":["cpd_7n42DGM5Tflk9n8mt7Fhc7"]},"CustomPropertyDefinitionListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomPropertyDefinition"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"CustomPropertyDefinitionUpdateRequest":{"type":"object","description":"Update of a definition. `key`, `entity_type` and `property_type` are immutable and cannot be\nchanged here. Any field left absent is unchanged.","properties":{"config":{"oneOf":[{"$ref":"#/components/schemas/PropertyConfig"},{"type":"null"}]},"default_value":{},"description":{"type":["string","null"]},"display_order":{"type":["integer","null"],"format":"int32"},"name":{"type":["string","null"]},"required":{"type":["boolean","null"]}}},"CustomPropertyEntityType":{"type":"string","enum":["CUSTOMER","SUBSCRIPTION","INVOICE","CREDIT_NOTE","QUOTE"]},"CustomPropertyType":{"type":"string","enum":["TEXT","NUMBER","BOOLEAN","DATE","DATETIME","SINGLE_SELECT","MULTI_SELECT","JSON","URL","EMAIL"]},"CustomTaxRate":{"type":"object","required":["tax_code","name","rate"],"properties":{"name":{"type":"string"},"rate":{"type":"string"},"tax_code":{"type":"string"}}},"Customer":{"type":"object","required":["id","name","invoicing_emails","currency","invoicing_entity_id","custom_taxes","custom_properties","preferred_locales"],"properties":{"alias":{"type":["string","null"]},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"billing_email":{"type":["string","null"]},"buyer_reference":{"type":["string","null"],"description":"BT-10 — the reference the buyer routes invoices by (a Leitweg-ID for German\npublic bodies). Required by XRechnung."},"connected_account_id":{"type":["string","null"]},"currency":{"$ref":"#/components/schemas/Currency"},"custom_properties":{"description":"User-defined custom property values, keyed by definition `key`."},"custom_taxes":{"type":"array","items":{"$ref":"#/components/schemas/CustomTaxRate"}},"customer_type":{"$ref":"#/components/schemas/CustomerType"},"first_name":{"type":["string","null"]},"id":{"$ref":"#/components/schemas/CustomerId"},"invoicing_emails":{"type":"array","items":{"type":"string"}},"invoicing_entity_id":{"$ref":"#/components/schemas/InvoicingEntityId"},"invoicing_language":{"type":["string","null"],"description":"Deprecated: the first entry of `preferred_locales`.","deprecated":true},"last_name":{"type":["string","null"]},"legal_number":{"type":["string","null"],"description":"BT-47 — the buyer's national register identifier (SIREN/SIRET, HRB)."},"name":{"type":"string"},"phone":{"type":["string","null"]},"preferred_locales":{"type":"array","items":{"type":"string"},"description":"Preferred document languages, most-preferred first (BCP-47 tags, e.g.\n`[\"fr-FR\", \"en\"]`); overrides the invoicing entity default."},"shipping_address":{"oneOf":[{"$ref":"#/components/schemas/ShippingAddress"},{"type":"null"}]},"vat_number":{"type":["string","null"]}}},"CustomerCreateRequest":{"type":"object","required":["invoicing_emails","currency","custom_taxes"],"properties":{"alias":{"type":["string","null"]},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"billing_email":{"type":["string","null"]},"buyer_reference":{"type":["string","null"],"description":"BT-10 — the reference the buyer routes invoices by (a Leitweg-ID for German\npublic bodies). Required by XRechnung."},"connected_account_id":{"type":["string","null"]},"currency":{"$ref":"#/components/schemas/Currency"},"custom_properties":{"description":"User-defined custom property values, keyed by definition `key`. Validated against the\ntenant's `CUSTOMER` property definitions. Omit to leave unset."},"custom_taxes":{"type":"array","items":{"$ref":"#/components/schemas/CustomTaxRate"}},"customer_type":{"$ref":"#/components/schemas/CustomerType","description":"`INDIVIDUAL` requires `first_name`, `last_name`, and a billing-address country."},"exemption_reason":{"type":["string","null"],"description":"Free-text legal exemption mention surfaced on exempt invoices."},"first_name":{"type":["string","null"]},"invoicing_emails":{"type":"array","items":{"type":"string"}},"invoicing_entity_id":{"oneOf":[{"$ref":"#/components/schemas/InvoicingEntityId"},{"type":"null"}]},"invoicing_language":{"type":["string","null"],"description":"Deprecated: use `preferred_locales`. Applied only when `preferred_locales` is absent.","deprecated":true},"is_tax_exempt":{"type":["boolean","null"]},"last_name":{"type":["string","null"]},"legal_number":{"type":["string","null"],"description":"BT-47 — the buyer's national register identifier (SIREN/SIRET, HRB)."},"name":{"type":"string","description":"Required for `COMPANY`. Ignored for `INDIVIDUAL`: derived from `first_name` + `last_name`."},"phone":{"type":["string","null"]},"preferred_locales":{"type":["array","null"],"items":{"type":"string"},"description":"Preferred document languages, most-preferred first (BCP-47 tags, e.g.\n`[\"fr-FR\", \"en\"]`); overrides the invoicing entity default. The first one the\nrenderer has a template for wins, so an unsupported entry alongside a supported\none just falls through; a list of only unsupported ones is rejected."},"shipping_address":{"oneOf":[{"$ref":"#/components/schemas/ShippingAddress"},{"type":"null"}]},"vat_number":{"type":["string","null"]}}},"CustomerDetails":{"type":"object","required":["id","name","snapshot_at"],"properties":{"alias":{"type":["string","null"]},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"email":{"type":["string","null"]},"id":{"$ref":"#/components/schemas/CustomerId"},"name":{"type":"string"},"snapshot_at":{"type":"string","format":"date-time"},"vat_number":{"type":["string","null"]}}},"CustomerEvent":{"allOf":[{"$ref":"#/components/schemas/CustomerEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}],"description":"Event-specific webhook schemas for type-safe webhook payloads"},"CustomerEventData":{"type":"object","required":["customer_id","name","invoicing_emails","currency","custom_properties"],"properties":{"alias":{"type":["string","null"]},"billing_email":{"type":["string","null"]},"currency":{"type":"string"},"custom_properties":{"description":"User-defined custom property values, keyed by definition key."},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"invoicing_emails":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"phone":{"type":["string","null"]}}},"CustomerId":{"type":"string","format":"MeteroidId","examples":["cus_7n42DGM5Tflk9n8mt7Fhc7"]},"CustomerListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"CustomerPatchRequest":{"type":"object","properties":{"alias":{"type":["string","null"]},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"billing_email":{"type":["string","null"]},"buyer_reference":{"type":["string","null"],"description":"BT-10 — the reference the buyer routes invoices by (a Leitweg-ID for German\npublic bodies). Required by XRechnung."},"currency":{"oneOf":[{"$ref":"#/components/schemas/Currency"},{"type":"null"}]},"custom_properties":{"description":"Partial update of custom property values (merge; send a key with `null` to remove it).\nOmit to leave unchanged."},"custom_taxes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CustomTaxRate"}},"customer_type":{"oneOf":[{"$ref":"#/components/schemas/CustomerType"},{"type":"null"}]},"exemption_reason":{"type":["string","null"],"description":"Free-text legal exemption mention surfaced on exempt invoices."},"first_name":{"type":["string","null"]},"invoicing_emails":{"type":["array","null"],"items":{"type":"string"}},"invoicing_entity_id":{"oneOf":[{"$ref":"#/components/schemas/InvoicingEntityId"},{"type":"null"}]},"invoicing_language":{"type":["string","null"],"description":"Deprecated: use `preferred_locales`. Applied only when `preferred_locales` is absent.","deprecated":true},"is_tax_exempt":{"type":["boolean","null"]},"last_name":{"type":["string","null"]},"legal_number":{"type":["string","null"],"description":"BT-47 — the buyer's national register identifier (SIREN/SIRET, HRB)."},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"preferred_locales":{"type":["array","null"],"items":{"type":"string"},"description":"Preferred document languages, most-preferred first (BCP-47 tags, e.g.\n`[\"fr-FR\", \"en\"]`); overrides the invoicing entity default. Omit to leave\nunchanged, send `[]` to reset to that default."},"shipping_address":{"oneOf":[{"$ref":"#/components/schemas/ShippingAddress"},{"type":"null"}]},"vat_number":{"type":["string","null"]}}},"CustomerPaymentMethodId":{"type":"string","format":"MeteroidId","examples":["pm_7n42DGM5Tflk9n8mt7Fhc7"]},"CustomerPortalScope":{"type":"string","description":"What a customer portal token may do.","enum":["read","manage"]},"CustomerPortalTokenRequest":{"type":"object","properties":{"expires_in_seconds":{"type":["integer","null"],"format":"int32","description":"Token lifetime in seconds. Defaults to 86400 (24 hours).\nMust be between 60 and 2592000 (30 days).","minimum":0},"scopes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CustomerPortalScope"},"description":"Scopes granted to the token. Defaults to `[\"read\", \"manage\"]`.\nUse `[\"read\"]` for tokens that only read billing state, e.g. to gate features in a browser.","minItems":1}}},"CustomerPortalTokenResponse":{"type":"object","required":["token","expires_at","portal_url","portal_link","api_url"],"properties":{"api_url":{"type":"string","description":"Base URL of the public REST API"},"expires_at":{"type":"string","format":"date-time","description":"When the token expires (RFC 3339)"},"portal_link":{"type":"string","description":"Hosted customer portal URL, token included"},"portal_url":{"type":"string","description":"Base URL of the customer portal"},"token":{"type":"string","description":"JWT token for portal access"}}},"CustomerType":{"type":"string","description":"Company vs. individual (B2C). Defaults to `COMPANY`.","enum":["COMPANY","INDIVIDUAL"]},"CustomerUpdateRequest":{"type":"object","required":["invoicing_emails","currency","invoicing_entity_id","custom_taxes"],"properties":{"alias":{"type":["string","null"]},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"billing_email":{"type":["string","null"]},"buyer_reference":{"type":["string","null"],"description":"BT-10 — the reference the buyer routes invoices by (a Leitweg-ID for German\npublic bodies). Required by XRechnung."},"currency":{"$ref":"#/components/schemas/Currency"},"custom_properties":{"description":"User-defined custom property values (full replace). Omit to leave unchanged."},"custom_taxes":{"type":"array","items":{"$ref":"#/components/schemas/CustomTaxRate"}},"customer_type":{"oneOf":[{"$ref":"#/components/schemas/CustomerType","description":"`INDIVIDUAL` requires `first_name`, `last_name`, and a billing-address country.\nOmit to keep the stored type — a full replace never silently reclassifies a customer."},{"type":"null"}]},"exemption_reason":{"type":["string","null"],"description":"Free-text legal exemption mention surfaced on exempt invoices."},"first_name":{"type":["string","null"],"description":"Omit to keep the stored value (a full replace does not blank a person's name)."},"invoicing_emails":{"type":"array","items":{"type":"string"}},"invoicing_entity_id":{"$ref":"#/components/schemas/InvoicingEntityId"},"invoicing_language":{"type":["string","null"],"description":"Deprecated: use `preferred_locales`. Applied only when `preferred_locales` is absent.","deprecated":true},"is_tax_exempt":{"type":["boolean","null"]},"last_name":{"type":["string","null"]},"legal_number":{"type":["string","null"],"description":"BT-47 — the buyer's national register identifier (SIREN/SIRET, HRB)."},"name":{"type":"string","description":"Required for `COMPANY`. Ignored for `INDIVIDUAL`: derived from `first_name` + `last_name`."},"phone":{"type":["string","null"]},"preferred_locales":{"type":["array","null"],"items":{"type":"string"},"description":"Preferred document languages, most-preferred first (BCP-47 tags, e.g.\n`[\"fr-FR\", \"en\"]`); overrides the invoicing entity default. Omit or send `[]` to\nreset to that default (full-replace update)."},"shipping_address":{"oneOf":[{"$ref":"#/components/schemas/ShippingAddress"},{"type":"null"}]},"vat_number":{"type":["string","null"]}}},"DeclineKind":{"type":"string","description":"Why the payment provider declined a charge.","enum":["INSUFFICIENT_FUNDS","DO_NOT_HONOR","CARD_EXPIRED","AUTHENTICATION_REQUIRED","MANDATE_INACTIVE","FRAUD","PROCESSING_ERROR","OTHER"]},"DoubleSegmentationMatrix":{"type":"object","required":["dimension1","dimension2"],"properties":{"dimension1":{"$ref":"#/components/schemas/MetricDimension"},"dimension2":{"$ref":"#/components/schemas/MetricDimension"}}},"EInvoicingFinding":{"type":"object","description":"One rule the document did not satisfy, in the standard's own vocabulary.","required":["rule","term","message"],"properties":{"hint":{"type":["string","null"]},"message":{"type":"string"},"rule":{"type":"string","description":"The rule identifier — \"BR-11\", \"PEPPOL-EN16931-R003\"."},"term":{"type":"string","description":"The business term path it is about — \"BG-8/BT-55\"."}}},"EInvoicingStatus":{"type":"string","title":"EInvoicingStatus","description":"Whether the structured e-invoice was produced with the accounting PDF. Absent when the\ninvoicing entity had not opted in at the time the invoice was issued.","enum":["GENERATED","FAILED"]},"EffectiveEntitlement":{"type":"object","description":"Merged entitlement value for a feature for a specific customer, enriched with live usage data.","required":["feature","value"],"properties":{"feature":{"$ref":"#/components/schemas/FeatureRef"},"value":{"$ref":"#/components/schemas/EffectiveEntitlementValue"}}},"EffectiveEntitlementListResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EffectiveEntitlement"}}}},"EffectiveEntitlementValue":{"oneOf":[{"$ref":"#/components/schemas/BooleanEffectiveEntitlementValue"},{"$ref":"#/components/schemas/MeteredEffectiveEntitlementValue"},{"$ref":"#/components/schemas/ConfigEffectiveEntitlementValue"}],"discriminator":{"propertyName":"type","mapping":{"BOOLEAN":"#/components/schemas/BooleanEffectiveEntitlementValue","CONFIG":"#/components/schemas/ConfigEffectiveEntitlementValue","METERED":"#/components/schemas/MeteredEffectiveEntitlementValue"}}},"Entitlement":{"type":"object","description":"A raw entitlement row attached to one entity (feature, plan version, add-on, or subscription).","required":["id","feature_id","value","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"feature_id":{"$ref":"#/components/schemas/FeatureId"},"id":{"$ref":"#/components/schemas/EntitlementId"},"updated_at":{"type":"string","format":"date-time"},"value":{"$ref":"#/components/schemas/EntitlementValue"}}},"EntitlementId":{"type":"string","format":"MeteroidId","examples":["ent_7n42DGM5Tflk9n8mt7Fhc7"]},"EntitlementListResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Entitlement"}}}},"EntitlementProductRef":{"type":"object","description":"Minimal reference to the product a feature belongs to.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/ProductId"},"name":{"type":"string"}}},"EntitlementSpecRequest":{"type":"object","description":"One entitlement to create: which feature, and the value granted by the entity.","required":["feature_id","value"],"properties":{"feature_id":{"$ref":"#/components/schemas/FeatureId"},"value":{"$ref":"#/components/schemas/EntitlementValue"}}},"EntitlementValue":{"oneOf":[{"$ref":"#/components/schemas/BooleanEntitlementValue"},{"$ref":"#/components/schemas/MeteredEntitlementValue"},{"$ref":"#/components/schemas/ConfigEntitlementValue"}],"discriminator":{"propertyName":"type","mapping":{"BOOLEAN":"#/components/schemas/BooleanEntitlementValue","CONFIG":"#/components/schemas/ConfigEntitlementValue","METERED":"#/components/schemas/MeteredEntitlementValue"}}},"ErrorCode":{"type":"string","enum":["BAD_REQUEST","NOT_FOUND","CONFLICT","FORBIDDEN","UNAUTHORIZED","TOKEN_EXPIRED","TOO_MANY_REQUESTS","INTERNAL_SERVER_ERROR"]},"Event":{"type":"object","required":["event_id","code","customer_id","timestamp"],"properties":{"code":{"type":"string","description":"Billable metric code. Max 512 characters."},"customer_id":{"type":"string","description":"Meteroid customer ID or external customer alias."},"event_id":{"type":"string","description":"Unique event identifier. Max 255 characters. A UUID or ULID is recommended."},"properties":{"type":"object","description":"Arbitrary string key-value pairs used by billable metrics for filtering and aggregation.","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"region":"us-east-1","tier":"pro","bytes":"1048576"}},"timestamp":{"type":"string","description":"RFC 3339 timestamp. Defaults to ingestion time if omitted.\nMust be between 24 hours ago and 1 hour from now. Set `allow_backfilling` to remove the past limit.","example":"2026-01-15T10:30:00Z"}}},"EventId":{"type":"string","format":"MeteroidId","examples":["evt_7n42DGM5Tflk9n8mt7Fhc7"]},"EventType":{"type":"string","enum":["metric.created","customer.created","subscription.created","subscription.updated","subscription.cancelled","subscription.ended","invoice.created","invoice.finalized","invoice.paid","invoice.voided","invoice.closed","invoice.consolidated","invoice.deleted","invoice.accounting_pdf_generated","quote.accepted","quote.converted","credit_note.created","credit_note.finalized","credit_note.voided","plan.created","plan.published","plan.archived","product.created","product.updated","product.archived","metric.updated","metric.archived","coupon.created","coupon.updated","coupon.archived","addon.created","addon.updated","addon.archived","refund.issued","refund.settled","refund.failed","payment.reversed","payment.failed"]},"ExistingPriceRef":{"type":"object","required":["id"],"properties":{"id":{"$ref":"#/components/schemas/PriceId"}}},"ExistingProductRef":{"type":"object","required":["id"],"properties":{"id":{"$ref":"#/components/schemas/ProductId"}}},"ExternalPaymentMethodConfig":{"type":"object"},"ExtraComponent":{"type":"object","required":["name","product_ref","price_entry"],"properties":{"name":{"type":"string"},"price_entry":{"$ref":"#/components/schemas/PriceEntry"},"product_ref":{"$ref":"#/components/schemas/ProductRef"}}},"ExtraRecurringBillingTypeEnum":{"type":"string","enum":["ADVANCE","ARREARS"]},"ExtraRecurringFeeStructure":{"type":"object","required":["billing_type"],"properties":{"billing_type":{"$ref":"#/components/schemas/ExtraRecurringBillingTypeEnum"}}},"ExtraRecurringPlanFee":{"type":"object","description":"Extra recurring fee","required":["unit_price","quantity","billing_type","cadence"],"properties":{"billing_type":{"$ref":"#/components/schemas/BillingType"},"cadence":{"$ref":"#/components/schemas/BillingPeriodEnum"},"quantity":{"type":"integer","format":"int32","minimum":0},"unit_price":{"type":"string","format":"decimal"}}},"ExtraRecurringPricing":{"type":"object","required":["unit_price","quantity"],"properties":{"quantity":{"type":"integer","format":"int32","minimum":0},"unit_price":{"type":"string","format":"decimal"}}},"Feature":{"type":"object","required":["id","name","code","feature_type","status","created_at"],"properties":{"code":{"type":"string","description":"Unique key used to reference this feature in your code. Cannot be changed after creation."},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"entitlement":{"oneOf":[{"$ref":"#/components/schemas/Entitlement","description":"Feature-level (default) entitlement, applied to all subscriptions as the lowest-priority."},{"type":"null"}]},"feature_type":{"$ref":"#/components/schemas/FeatureType"},"id":{"$ref":"#/components/schemas/FeatureId"},"name":{"type":"string"},"product":{"oneOf":[{"$ref":"#/components/schemas/EntitlementProductRef","description":"Product this feature belongs to."},{"type":"null"}]},"status":{"$ref":"#/components/schemas/FeatureStatus"}}},"FeatureId":{"type":"string","format":"MeteroidId","examples":["feat_7n42DGM5Tflk9n8mt7Fhc7"]},"FeatureListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Feature"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"FeatureRef":{"type":"object","required":["id","name","code"],"properties":{"code":{"type":"string","description":"Unique key used to reference this feature in your code. Cannot be changed after creation."},"id":{"$ref":"#/components/schemas/FeatureId"},"name":{"type":"string"},"product":{"oneOf":[{"$ref":"#/components/schemas/EntitlementProductRef"},{"type":"null"}]}}},"FeatureStatus":{"type":"string","description":"Lifecycle status of a feature.","enum":["ACTIVE","DISABLED","ARCHIVED"]},"FeatureType":{"oneOf":[{"$ref":"#/components/schemas/BooleanFeatureType"},{"$ref":"#/components/schemas/MeteredFeatureType"},{"$ref":"#/components/schemas/ConfigFeatureType"}],"discriminator":{"propertyName":"type","mapping":{"BOOLEAN":"#/components/schemas/BooleanFeatureType","CONFIG":"#/components/schemas/ConfigFeatureType","METERED":"#/components/schemas/MeteredFeatureType"}}},"Fee":{"oneOf":[{"$ref":"#/components/schemas/RatePlanFee"},{"$ref":"#/components/schemas/SlotPlanFee"},{"$ref":"#/components/schemas/CapacityPlanFee"},{"$ref":"#/components/schemas/UsagePlanFee"},{"$ref":"#/components/schemas/ExtraRecurringPlanFee"},{"$ref":"#/components/schemas/OneTimePlanFee"}],"discriminator":{"propertyName":"type","mapping":{"CAPACITY":"#/components/schemas/CapacityPlanFee","EXTRA_RECURRING":"#/components/schemas/ExtraRecurringPlanFee","ONE_TIME":"#/components/schemas/OneTimePlanFee","RATE":"#/components/schemas/RatePlanFee","SLOT":"#/components/schemas/SlotPlanFee","USAGE":"#/components/schemas/UsagePlanFee"}}},"FixedDiscount":{"type":"object","required":["currency","amount"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"}}},"FixedWindowResetPeriod":{"type":"object","description":"Resets at regular intervals — anchored to your subscription's exact activation time.","required":["unit","interval"],"properties":{"interval":{"type":"integer","format":"int32","minimum":0},"unit":{"$ref":"#/components/schemas/CalendarUnit"}}},"GetCheckoutSessionResponse":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/CheckoutSession"}}},"GroupedUsage":{"type":"object","required":["value","dimensions"],"properties":{"dimensions":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"value":{"type":"string","format":"decimal"}}},"IngestEventsRequest":{"type":"object","required":["events"],"properties":{"allow_backfilling":{"type":["boolean","null"],"description":"Allow events with timestamps more than 1 day in the past. Defaults to `false`."},"allow_partial_failures":{"type":["boolean","null"],"description":"Accept the batch even if some events fail validation. Defaults to `false`.\nWhen `true`, valid events are ingested and failures are reported in the response body.\nWhen `false` (default), any invalid event rejects the entire batch."},"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"},"description":"1–100 events per request."}}},"IngestEventsResponse":{"type":"object","properties":{"failures":{"type":"array","items":{"$ref":"#/components/schemas/IngestFailure"},"description":"Events that failed to ingest. Omitted when no failures."}}},"IngestFailure":{"type":"object","required":["event_id","reason"],"properties":{"event_id":{"type":"string"},"reason":{"type":"string"}}},"IntrospectionRequest":{"type":"object","description":"Token introspection request","required":["token"],"properties":{"token":{"type":"string","description":"The token to introspect"}}},"Invoice":{"type":"object","required":["id","invoice_number","status","customer_id","currency","invoice_date","tax_inclusive","subtotal","subtotal_recurring","tax_amount","total","amount_due","line_items","tax_breakdown","transactions","payment_status","customer_details","applied_credits","coupons","invoice_type","net_terms","created_at","custom_properties"],"properties":{"amount_due":{"type":"integer","format":"int64"},"applied_credits":{"type":"integer","format":"int64"},"billing_period_start":{"type":["string","null"],"format":"date","description":"The period/moment this invoice is about — the subscription period start, or the invoice's\nown date for manual/one-off. Stable and always present, distinct from `invoice_date` (the\nemission date). Shown as \"Invoice date\"."},"child_invoice_id":{"oneOf":[{"$ref":"#/components/schemas/InvoiceId","description":"Set on a cancelled invoice that has been reissued: the corrective invoice replacing it."},{"type":"null"}]},"coupons":{"type":"array","items":{"$ref":"#/components/schemas/CouponLineItem"}},"created_at":{"type":"string","format":"date-time"},"currency":{"$ref":"#/components/schemas/Currency"},"custom_properties":{"description":"User-defined custom property values, keyed by definition `key`."},"customer_details":{"$ref":"#/components/schemas/CustomerDetails"},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"due_date":{"type":["string","null"],"format":"date"},"einvoicing_status":{"oneOf":[{"$ref":"#/components/schemas/EInvoicingStatus","description":"Absent when the invoicing entity had not opted in to e-invoicing."},{"type":"null"}]},"finalized_at":{"type":["string","null"],"format":"date-time"},"id":{"$ref":"#/components/schemas/InvoiceId"},"invoice_date":{"type":"string","format":"date"},"invoice_number":{"type":"string"},"invoice_type":{"$ref":"#/components/schemas/InvoiceType"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLineItem"}},"marked_as_uncollectible_at":{"type":["string","null"],"format":"date-time"},"memo":{"type":["string","null"]},"net_terms":{"type":"integer","format":"int32"},"paid_at":{"type":["string","null"],"format":"date-time"},"parent_invoice_id":{"oneOf":[{"$ref":"#/components/schemas/InvoiceId","description":"Set on a corrective invoice: the cancelled invoice this one replaces\n(\"cancels and replaces\"). The original is credited in full by a credit note."},{"type":"null"}]},"payment_status":{"$ref":"#/components/schemas/InvoicePaymentStatus"},"purchase_order":{"type":["string","null"]},"reference":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"subscription_id":{"oneOf":[{"$ref":"#/components/schemas/SubscriptionId"},{"type":"null"}]},"subtotal":{"type":"integer","format":"int64"},"subtotal_recurring":{"type":"integer","format":"int64"},"tax_amount":{"type":"integer","format":"int64"},"tax_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/TaxBreakdownItem"}},"tax_inclusive":{"type":"boolean","description":"The prices billed were quoted tax-included. Amounts are net regardless: the tax was\ncarved out of the quoted price, so `total` is that price to the unit."},"total":{"type":"integer","format":"int64"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"updated_at":{"type":["string","null"],"format":"date-time"},"voided_at":{"type":["string","null"],"format":"date-time"}}},"InvoiceCustomPropertiesRequest":{"type":"object","description":"Merge update of an invoice's custom property values (send a key with `null` to remove it).\nAllowed at any status — custom properties stay editable after the invoice is finalized.","required":["custom_properties"],"properties":{"custom_properties":{}}},"InvoiceDocumentsEvent":{"allOf":[{"$ref":"#/components/schemas/InvoiceDocumentsEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"InvoiceDocumentsEventData":{"type":"object","description":"Emitted once the accounting PDF is stored. This is also the moment the e-invoicing\noutcome is known: the structured document is produced with the PDF, not at finalization.","required":["invoice_id","customer_id","pdf_document_id","einvoicing_findings"],"properties":{"customer_id":{"$ref":"#/components/schemas/CustomerId"},"einvoicing_error":{"type":["string","null"],"description":"Set when generation failed for a reason that is not a business rule."},"einvoicing_findings":{"type":"array","items":{"$ref":"#/components/schemas/EInvoicingFinding"},"description":"Empty unless the status is `failed`."},"einvoicing_profile":{"type":["string","null"],"description":"The profile the document was checked against, e.g. \"EN 16931\"."},"einvoicing_status":{"oneOf":[{"$ref":"#/components/schemas/EInvoicingStatus","description":"Absent when the invoicing entity had not opted in."},{"type":"null"}]},"invoice_id":{"$ref":"#/components/schemas/InvoiceId"},"pdf_document_id":{"type":"string"},"xml_document_id":{"type":["string","null"],"description":"The structured e-invoice stored beside the PDF, when one was produced."}}},"InvoiceEvent":{"allOf":[{"$ref":"#/components/schemas/InvoiceEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"InvoiceEventData":{"type":"object","required":["invoice_id","customer_id","status","currency","total","tax_amount","created_at","custom_properties"],"properties":{"consolidated_into_invoice_id":{"oneOf":[{"$ref":"#/components/schemas/InvoiceId","description":"Set on `invoice.consolidated`: the parent invoice this one was merged into."},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"currency":{"type":"string"},"custom_properties":{"description":"User-defined custom property values, keyed by definition key."},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"invoice_id":{"$ref":"#/components/schemas/InvoiceId"},"invoice_number":{"type":["string","null"],"description":"Absent while the invoice is a draft — the number is assigned at finalization."},"parent_invoice_id":{"oneOf":[{"$ref":"#/components/schemas/InvoiceId","description":"Set on a corrective invoice: the cancelled invoice this one replaces\n(\"cancels and replaces\"). The original is credited in full by a credit note."},{"type":"null"}]},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"tax_amount":{"type":"integer","format":"int64"},"total":{"type":"integer","format":"int64"}}},"InvoiceId":{"type":"string","format":"MeteroidId","examples":["inv_7n42DGM5Tflk9n8mt7Fhc7"]},"InvoiceLineItem":{"type":"object","required":["name","amount_total","start_date","end_date","tax_rate","sub_line_items"],"properties":{"amount_total":{"type":"integer","format":"int64"},"description":{"type":["string","null"]},"end_date":{"type":"string","format":"date"},"name":{"type":"string"},"quantity":{"type":"string","format":"decimal"},"quoted_unit_price":{"type":"string","format":"decimal","description":"The tax-included unit price the customer was quoted, on a line billed from\ntax-inclusive prices. `unit_price` is its net counterpart."},"start_date":{"type":"string","format":"date"},"sub_line_items":{"type":"array","items":{"$ref":"#/components/schemas/SubLineItem"}},"tax_rate":{"type":"string","format":"decimal"},"unit_price":{"type":"string","format":"decimal"}}},"InvoiceListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"InvoicePaymentStatus":{"type":"string","enum":["UNPAID","PARTIALLY_PAID","PAID","ERRORED","PROCESSING"]},"InvoiceStatus":{"type":"string","title":"InvoiceStatus","enum":["DRAFT","FINALIZED","UNCOLLECTIBLE","VOID","CLOSED"]},"InvoiceType":{"type":"string","enum":["RECURRING","ONE_OFF","ADJUSTMENT","USAGE_THRESHOLD"]},"InvoicingEntityId":{"type":"string","format":"MeteroidId","examples":["ive_7n42DGM5Tflk9n8mt7Fhc7"]},"JsonConfigValue":{"type":"object","description":"A structured (JSON) config value — the \"metadata\" case, several fields in one entitlement.","required":["value"],"properties":{"value":{}}},"LinkedSegmentationMatrix":{"type":"object","required":["dimension1_key","dimension2_key","values"],"properties":{"dimension1_key":{"type":"string"},"dimension2_key":{"type":"string"},"values":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"propertyNames":{"type":"string"}}}},"ListCheckoutSessionsResponse":{"type":"object","required":["sessions"],"properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutSession"}}}},"MatrixDimension":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}},"MatrixPlanPricing":{"type":"object","required":["rates"],"properties":{"rates":{"type":"array","items":{"$ref":"#/components/schemas/MatrixRow"}}}},"MatrixPricing":{"type":"object","required":["rates"],"properties":{"rates":{"type":"array","items":{"$ref":"#/components/schemas/MatrixRow"}}}},"MatrixRow":{"type":"object","required":["dimension1","per_unit_price"],"properties":{"dimension1":{"$ref":"#/components/schemas/MatrixDimension"},"dimension2":{"oneOf":[{"$ref":"#/components/schemas/MatrixDimension"},{"type":"null"}]},"per_unit_price":{"type":"string","format":"decimal"}}},"MeteredEffectiveEntitlementValue":{"type":"object","required":["spec","usage"],"properties":{"spec":{"$ref":"#/components/schemas/MeteredEntitlementSpec"},"usage":{"$ref":"#/components/schemas/MeteredEntitlementUsage"}}},"MeteredEntitlementSpec":{"type":"object","required":["metric_id","reset_period","enabled"],"properties":{"enabled":{"type":"boolean"},"limit":{"type":["string","null"],"format":"decimal"},"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"reset_period":{"$ref":"#/components/schemas/ResetPeriod"}}},"MeteredEntitlementUsage":{"type":"object","properties":{"consumed":{"type":["string","null"],"format":"decimal"},"remaining":{"type":["string","null"],"format":"decimal"},"reset_at":{"type":["string","null"],"format":"date-time"}}},"MeteredEntitlementValue":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Per-entitlement kill switch. `false` means disabled."},"limit":{"type":["string","null"],"format":"decimal","description":"Cap on usage. Null means unlimited."},"reset_period":{"$ref":"#/components/schemas/ResetPeriod"}}},"MeteredFeatureType":{"type":"object","required":["metric_id"],"properties":{"metric_id":{"$ref":"#/components/schemas/BillableMetricId"}}},"MeteredResolvedEntitlementValue":{"type":"object","required":["metric_id","reset_period","enabled"],"properties":{"enabled":{"type":"boolean"},"limit":{"type":["string","null"],"format":"decimal"},"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"reset_period":{"$ref":"#/components/schemas/ResetPeriod"}}},"Metric":{"type":"object","required":["id","name","code","aggregation_type","product_family_id","created_at"],"properties":{"aggregation_key":{"type":["string","null"]},"aggregation_type":{"$ref":"#/components/schemas/BillingMetricAggregateEnum"},"archived_at":{"type":["string","null"],"format":"date-time"},"code":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"filters":{"type":"array","items":{"$ref":"#/components/schemas/MetricFilter"}},"id":{"$ref":"#/components/schemas/BillableMetricId"},"name":{"type":"string"},"product_family_id":{"$ref":"#/components/schemas/ProductFamilyId"},"product_id":{"oneOf":[{"$ref":"#/components/schemas/ProductId"},{"type":"null"}]},"segmentation_matrix":{"oneOf":[{"$ref":"#/components/schemas/MetricSegmentationMatrix"},{"type":"null"}]},"unit_conversion":{"oneOf":[{"$ref":"#/components/schemas/UnitConversion"},{"type":"null"}]},"usage_group_key":{"type":["string","null"]}}},"MetricDimension":{"type":"object","required":["key","values"],"properties":{"key":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}}},"MetricEvent":{"allOf":[{"$ref":"#/components/schemas/MetricEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"MetricEventData":{"type":"object","required":["metric_id","name","code","aggregation_type","created_at","product_family_id"],"properties":{"aggregation_key":{"type":["string","null"]},"aggregation_type":{"$ref":"#/components/schemas/BillingMetricAggregateEnum"},"code":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"name":{"type":"string"},"product_family_id":{"$ref":"#/components/schemas/ProductFamilyId"},"product_id":{"oneOf":[{"$ref":"#/components/schemas/ProductId"},{"type":"null"}]},"segmentation_matrix":{"oneOf":[{"$ref":"#/components/schemas/MetricSegmentationMatrix"},{"type":"null"}]},"unit_conversion_factor":{"type":["integer","null"],"format":"int32"},"unit_conversion_rounding":{"oneOf":[{"$ref":"#/components/schemas/UnitConversionRoundingEnum"},{"type":"null"}]},"usage_group_key":{"type":["string","null"]}}},"MetricFilter":{"type":"object","description":"A pre-aggregation filter: only events whose `property` matches feed the metric's\naggregation. Distinct from a segmentation dimension (which splits pricing). Multiple\nfilters are ANDed.","required":["property","op","values"],"properties":{"op":{"$ref":"#/components/schemas/MetricFilterOperator"},"property":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}}},"MetricFilterOperator":{"type":"string","description":"Operator of a pre-aggregation [`MetricFilter`]. `EQUAL`/`NOT_EQUAL` are the single-value\nforms of `IN`/`NOT_IN`. Negation (`NOT_EQUAL`/`NOT_IN`) is presence-required: an event\nmissing the property is excluded.","enum":["EQUAL","NOT_EQUAL","IN","NOT_IN"]},"MetricListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MetricSummary"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"MetricSegmentationMatrix":{"oneOf":[{"$ref":"#/components/schemas/MetricDimension"},{"$ref":"#/components/schemas/DoubleSegmentationMatrix"},{"$ref":"#/components/schemas/LinkedSegmentationMatrix"}],"discriminator":{"propertyName":"type","mapping":{"DOUBLE":"#/components/schemas/DoubleSegmentationMatrix","LINKED":"#/components/schemas/LinkedSegmentationMatrix","SINGLE":"#/components/schemas/MetricDimension"}}},"MetricSummary":{"type":"object","required":["id","name","code","aggregation_type","created_at"],"properties":{"aggregation_key":{"type":["string","null"]},"aggregation_type":{"$ref":"#/components/schemas/BillingMetricAggregateEnum"},"archived_at":{"type":["string","null"],"format":"date-time"},"code":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"id":{"$ref":"#/components/schemas/BillableMetricId"},"name":{"type":"string"}}},"MetricUsage":{"type":"object","required":["metric_id","metric_name","metric_code","total_value","grouped_usage"],"properties":{"grouped_usage":{"type":"array","items":{"$ref":"#/components/schemas/GroupedUsage"}},"metric_code":{"type":"string"},"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"metric_name":{"type":"string"},"total_value":{"type":"string","format":"decimal"}}},"MinimumCommitment":{"type":"object","required":["amount","scope"],"properties":{"amount":{"type":"string","description":"Decimal string in the plan currency, e.g. \"100.00\"."},"scope":{"$ref":"#/components/schemas/MinimumCommitmentScope"}}},"MinimumCommitmentInput":{"type":"object","required":["amount","scope"],"properties":{"amount":{"type":"string","description":"Decimal string in the plan currency."},"scope":{"$ref":"#/components/schemas/MinimumCommitmentInputScope"}}},"MinimumCommitmentInputScope":{"oneOf":[{"$ref":"#/components/schemas/AllComponentsScope"},{"$ref":"#/components/schemas/ComponentsScope"}],"discriminator":{"propertyName":"type","mapping":{"all_components":"#/components/schemas/AllComponentsScope","components":"#/components/schemas/ComponentsScope"}}},"MinimumCommitmentScope":{"oneOf":[{"$ref":"#/components/schemas/AllComponentsScope"},{"$ref":"#/components/schemas/ProductsScope"}],"discriminator":{"propertyName":"type","mapping":{"all_components":"#/components/schemas/AllComponentsScope","products":"#/components/schemas/ProductsScope"}}},"NeverResetPeriod":{"type":"object","description":"Never resets — counts all usage since the subscription was activated."},"NewProductRef":{"type":"object","required":["name","fee_type","fee_structure"],"properties":{"fee_structure":{"$ref":"#/components/schemas/ProductFeeStructure"},"fee_type":{"$ref":"#/components/schemas/ProductFeeTypeEnum"},"name":{"type":"string"}}},"NumberConfigValue":{"type":"object","description":"A number config value (decimal, encoded as a string).","required":["value"],"properties":{"value":{"type":"string","format":"decimal"}}},"OAuthApp":{"type":"object","description":"An OAuth application registered by a platform","required":["id","organization_id","name","client_id","client_secret_hint","redirect_uris","scopes","is_active","created_at"],"properties":{"client_id":{"type":"string"},"client_secret_hint":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"id":{"$ref":"#/components/schemas/OAuthAppId"},"is_active":{"type":"boolean"},"name":{"type":"string"},"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"updated_at":{"type":["string","null"],"format":"date-time"}}},"OAuthAppId":{"type":"string","format":"MeteroidId","examples":["app_7n42DGM5Tflk9n8mt7Fhc7"]},"OAuthAppWithSecret":{"type":"object","description":"Result of creating an OAuth app (includes the plain-text secret)","required":["app","client_secret"],"properties":{"app":{"$ref":"#/components/schemas/OAuthApp"},"client_secret":{"type":"string"}}},"OAuthAppsResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OAuthApp"}}}},"OAuthErrorCode":{"type":"string","description":"OAuth 2.0 error codes as per RFC 6749","enum":["invalid_request","unauthorized_client","access_denied","unsupported_response_type","invalid_scope","server_error","temporarily_unavailable","invalid_grant","invalid_client","unsupported_grant_type"]},"OAuthErrorResponse":{"type":"object","description":"OAuth 2.0 error response as per RFC 6749 Section 5.2","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/OAuthErrorCode"},"error_description":{"type":["string","null"]},"error_uri":{"type":["string","null"]}}},"OnboardingLinkResponse":{"type":"object","description":"Result of creating an onboarding link","required":["url","expires_at"],"properties":{"expires_at":{"type":"string","format":"date-time"},"url":{"type":"string"}}},"OnboardingMode":{"type":"string","description":"Onboarding mode for connected accounts","enum":["express","full"]},"OneTimeFee":{"type":"object","required":["rate","quantity"],"properties":{"quantity":{"type":"integer","format":"int32","minimum":0},"rate":{"type":"string","format":"decimal"}}},"OneTimeFeeStructure":{"type":"object"},"OneTimePlanFee":{"type":"object","description":"One-time fee","required":["unit_price","quantity"],"properties":{"quantity":{"type":"integer","format":"int32","minimum":0},"unit_price":{"type":"string","format":"decimal"}}},"OneTimePricing":{"type":"object","required":["unit_price","quantity"],"properties":{"quantity":{"type":"integer","format":"int32","minimum":0},"unit_price":{"type":"string","format":"decimal"}}},"OnlineMethodConfig":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"}}},"OnlineMethodsConfig":{"type":"object","properties":{"card":{"oneOf":[{"$ref":"#/components/schemas/OnlineMethodConfig"},{"type":"null"}]},"direct_debit":{"oneOf":[{"$ref":"#/components/schemas/OnlineMethodConfig"},{"type":"null"}]}}},"OnlinePaymentMethodConfig":{"type":"object","properties":{"config":{"oneOf":[{"$ref":"#/components/schemas/OnlineMethodsConfig","description":"If None, inherits all online providers from invoicing entity."},{"type":"null"}]}}},"OrganizationId":{"type":"string","format":"MeteroidId","examples":["org_7n42DGM5Tflk9n8mt7Fhc7"]},"PackagePlanPricing":{"type":"object","required":["block_size","rate"],"properties":{"block_size":{"type":"integer","format":"int64","minimum":0},"rate":{"type":"string","format":"decimal"}}},"PackagePricing":{"type":"object","required":["block_size","rate"],"properties":{"block_size":{"type":"integer","format":"int64","minimum":0},"rate":{"type":"string","format":"decimal"}}},"PaginationResponse":{"type":"object","required":["page","per_page","total_items","total_pages"],"properties":{"page":{"type":"integer","format":"int32","minimum":0},"per_page":{"type":"integer","format":"int32","minimum":0},"total_items":{"type":"integer","format":"int64","minimum":0},"total_pages":{"type":"integer","format":"int32","minimum":0}}},"PatchPlanRequest":{"type":"object","properties":{"description":{"type":["string","null"]},"name":{"type":["string","null"]},"self_service_rank":{"type":["integer","null"],"format":"int32"}}},"PaymentEvent":{"allOf":[{"$ref":"#/components/schemas/RefundEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"PaymentMethodInfo":{"type":"object","required":["payment_method_type"],"properties":{"account_number_hint":{"type":["string","null"]},"card_brand":{"type":["string","null"]},"card_last4":{"type":["string","null"]},"payment_method_type":{"$ref":"#/components/schemas/PaymentMethodTypeEnum"}}},"PaymentMethodTypeEnum":{"type":"string","enum":["CARD","BANK_TRANSFER","WALLET","OTHER"]},"PaymentMethodsConfig":{"oneOf":[{"$ref":"#/components/schemas/OnlinePaymentMethodConfig"},{"$ref":"#/components/schemas/BankTransferPaymentMethodConfig"},{"$ref":"#/components/schemas/ExternalPaymentMethodConfig"}],"description":"Online (card/direct debit), BankTransfer, or External.","discriminator":{"propertyName":"type","mapping":{"bank_transfer":"#/components/schemas/BankTransferPaymentMethodConfig","external":"#/components/schemas/ExternalPaymentMethodConfig","online":"#/components/schemas/OnlinePaymentMethodConfig"}}},"PaymentStatusEnum":{"type":"string","enum":["READY","PENDING","SETTLED","CANCELLED","FAILED","REFUNDED"]},"PaymentTransactionId":{"type":"string","format":"MeteroidId","examples":["pay_7n42DGM5Tflk9n8mt7Fhc7"]},"PaymentTypeEnum":{"type":"string","enum":["PAYMENT","REFUND"]},"PerUnitPlanPricing":{"type":"object","required":["rate"],"properties":{"rate":{"type":"string","format":"decimal"}}},"PerUnitPricing":{"type":"object","required":["rate"],"properties":{"rate":{"type":"string","format":"decimal"}}},"PercentageDiscount":{"type":"object","required":["percentage"],"properties":{"percentage":{"type":"string"}}},"Plan":{"type":"object","required":["id","name","created_at","plan_type","status","product_family","version_id","version","currency","tax_inclusive","net_terms","price_components","available_parameters"],"properties":{"available_parameters":{"$ref":"#/components/schemas/AvailableParameters"},"billing_cycles":{"type":["integer","null"],"format":"int32"},"created_at":{"type":"string","format":"date-time"},"currency":{"type":"string"},"description":{"type":["string","null"]},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/Entitlement"}},"id":{"$ref":"#/components/schemas/PlanId"},"minimum_commitment":{"oneOf":[{"$ref":"#/components/schemas/MinimumCommitment","description":"Plan-level minimum commitment (period true-up floor). When set, every billing-period\ninvoice for this plan is guaranteed to be at least `minimum_commitment.amount` after\ndiscounts, with a \"Minimum commitment\" line filling any shortfall."},{"type":"null"}]},"name":{"type":"string"},"net_terms":{"type":"integer","format":"int32"},"period_start_day":{"type":["integer","null"],"format":"int32"},"plan_type":{"$ref":"#/components/schemas/PlanTypeEnum"},"price_components":{"type":"array","items":{"$ref":"#/components/schemas/PriceComponent"}},"product_family":{"$ref":"#/components/schemas/ProductFamily"},"self_service_rank":{"type":["integer","null"],"format":"int32"},"status":{"$ref":"#/components/schemas/PlanStatusEnum"},"tax_inclusive":{"type":"boolean","description":"The plan's amounts are quoted tax-included (\"9.99 incl. VAT\"): tax is carved out of\nthem at invoice time instead of being added on top, so the customer pays the quoted\nprice whatever rate applies. A customer who bears no tax (reverse charge, exempt,\nexport) still pays it in full. Defaults to `false`."},"trial":{"oneOf":[{"$ref":"#/components/schemas/TrialConfig"},{"type":"null"}]},"version":{"type":"integer","format":"int32"},"version_id":{"$ref":"#/components/schemas/PlanVersionId"}}},"PlanAddOnInput":{"type":"object","required":["add_on_id"],"properties":{"add_on_id":{"$ref":"#/components/schemas/AddOnId"},"max_instances":{"type":["integer","null"],"format":"int32"},"price_id":{"oneOf":[{"$ref":"#/components/schemas/PriceId"},{"type":"null"}]},"self_serviceable":{"type":["boolean","null"]}}},"PlanEvent":{"allOf":[{"$ref":"#/components/schemas/PlanEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"PlanEventData":{"type":"object","required":["plan_id","name","plan_type","status","currency","version","created_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"currency":{"type":"string"},"description":{"type":["string","null"]},"name":{"type":"string"},"plan_id":{"$ref":"#/components/schemas/PlanId"},"plan_type":{"$ref":"#/components/schemas/PlanTypeEnum"},"status":{"$ref":"#/components/schemas/PlanStatusEnum"},"version":{"type":"integer","format":"int32"}}},"PlanId":{"type":"string","format":"MeteroidId","examples":["plan_7n42DGM5Tflk9n8mt7Fhc7"]},"PlanListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"PlanStatusEnum":{"type":"string","title":"PlanStatus","enum":["DRAFT","ACTIVE","INACTIVE","ARCHIVED"]},"PlanTypeEnum":{"type":"string","title":"PlanType","enum":["STANDARD","FREE","CUSTOM"]},"PlanUsagePricingModel":{"oneOf":[{"$ref":"#/components/schemas/PerUnitPlanPricing"},{"$ref":"#/components/schemas/TieredPlanPricing"},{"$ref":"#/components/schemas/VolumePlanPricing"},{"$ref":"#/components/schemas/PackagePlanPricing"},{"$ref":"#/components/schemas/MatrixPlanPricing"}],"discriminator":{"propertyName":"type","mapping":{"MATRIX":"#/components/schemas/MatrixPlanPricing","PACKAGE":"#/components/schemas/PackagePlanPricing","PER_UNIT":"#/components/schemas/PerUnitPlanPricing","TIERED":"#/components/schemas/TieredPlanPricing","VOLUME":"#/components/schemas/VolumePlanPricing"}}},"PlanVersionId":{"type":"string","format":"MeteroidId","examples":["plv_7n42DGM5Tflk9n8mt7Fhc7"]},"PlanVersionListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlanVersionSummary"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"PlanVersionSummary":{"type":"object","required":["id","version","is_draft","currency","created_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"currency":{"type":"string"},"id":{"$ref":"#/components/schemas/PlanVersionId"},"is_draft":{"type":"boolean"},"version":{"type":"integer","format":"int32"}}},"PriceComponent":{"type":"object","required":["id","name"],"properties":{"fee":{"oneOf":[{"$ref":"#/components/schemas/Fee"},{"type":"null"}]},"id":{"$ref":"#/components/schemas/PriceComponentId"},"name":{"type":"string"},"product_id":{"oneOf":[{"$ref":"#/components/schemas/ProductId"},{"type":"null"}]}}},"PriceComponentId":{"type":"string","format":"MeteroidId","examples":["price_7n42DGM5Tflk9n8mt7Fhc7"]},"PriceComponentInput":{"type":"object","required":["name","fee"],"properties":{"fee":{"$ref":"#/components/schemas/Fee"},"name":{"type":"string"},"product_id":{"oneOf":[{"$ref":"#/components/schemas/ProductId"},{"type":"null"}]}}},"PriceEntry":{"oneOf":[{"$ref":"#/components/schemas/ExistingPriceRef"},{"$ref":"#/components/schemas/PriceInput"}],"discriminator":{"propertyName":"type","mapping":{"EXISTING":"#/components/schemas/ExistingPriceRef","NEW":"#/components/schemas/PriceInput"}}},"PriceId":{"type":"string","format":"MeteroidId","examples":["pri_7n42DGM5Tflk9n8mt7Fhc7"]},"PriceInput":{"type":"object","required":["cadence","currency","pricing"],"properties":{"cadence":{"$ref":"#/components/schemas/BillingPeriodEnum"},"currency":{"type":"string"},"pricing":{"$ref":"#/components/schemas/Pricing"}}},"Pricing":{"oneOf":[{"$ref":"#/components/schemas/RatePricing"},{"$ref":"#/components/schemas/SlotPricing"},{"$ref":"#/components/schemas/CapacityPricing"},{"$ref":"#/components/schemas/UsagePricing"},{"$ref":"#/components/schemas/ExtraRecurringPricing"},{"$ref":"#/components/schemas/OneTimePricing"}],"discriminator":{"propertyName":"type","mapping":{"CAPACITY":"#/components/schemas/CapacityPricing","EXTRA_RECURRING":"#/components/schemas/ExtraRecurringPricing","ONE_TIME":"#/components/schemas/OneTimePricing","RATE":"#/components/schemas/RatePricing","SLOT":"#/components/schemas/SlotPricing","USAGE":"#/components/schemas/UsagePricing"}}},"Product":{"type":"object","required":["id","name","fee_type","fee_structure","product_family_id","catalog","created_at"],"properties":{"archived_at":{"type":["string","null"],"format":"date-time"},"catalog":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"fee_structure":{"$ref":"#/components/schemas/ProductFeeStructure"},"fee_type":{"$ref":"#/components/schemas/ProductFeeTypeEnum"},"id":{"$ref":"#/components/schemas/ProductId"},"name":{"type":"string"},"product_family_id":{"$ref":"#/components/schemas/ProductFamilyId"}}},"ProductEvent":{"allOf":[{"$ref":"#/components/schemas/ProductEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"ProductEventData":{"type":"object","required":["product_id","name","fee_type","product_family_id","created_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"description":{"type":["string","null"]},"fee_type":{"$ref":"#/components/schemas/ProductFeeTypeEnum"},"name":{"type":"string"},"product_family_id":{"$ref":"#/components/schemas/ProductFamilyId"},"product_id":{"$ref":"#/components/schemas/ProductId"}}},"ProductFamily":{"type":"object","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/ProductFamilyId"},"name":{"type":"string"}}},"ProductFamilyCreateRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"ProductFamilyId":{"type":"string","format":"MeteroidId","examples":["pf_7n42DGM5Tflk9n8mt7Fhc7"]},"ProductFamilyListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductFamily"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"ProductFeeStructure":{"oneOf":[{"$ref":"#/components/schemas/RateFeeStructure"},{"$ref":"#/components/schemas/SlotFeeStructure"},{"$ref":"#/components/schemas/CapacityFeeStructure"},{"$ref":"#/components/schemas/UsageFeeStructure"},{"$ref":"#/components/schemas/ExtraRecurringFeeStructure"},{"$ref":"#/components/schemas/OneTimeFeeStructure"}],"discriminator":{"propertyName":"type","mapping":{"CAPACITY":"#/components/schemas/CapacityFeeStructure","EXTRA_RECURRING":"#/components/schemas/ExtraRecurringFeeStructure","ONE_TIME":"#/components/schemas/OneTimeFeeStructure","RATE":"#/components/schemas/RateFeeStructure","SLOT":"#/components/schemas/SlotFeeStructure","USAGE":"#/components/schemas/UsageFeeStructure"}}},"ProductFeeTypeEnum":{"type":"string","enum":["RATE","SLOT","CAPACITY","USAGE","EXTRA_RECURRING","ONE_TIME"]},"ProductId":{"type":"string","format":"MeteroidId","examples":["prd_7n42DGM5Tflk9n8mt7Fhc7"]},"ProductListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"ProductRef":{"oneOf":[{"$ref":"#/components/schemas/ExistingProductRef"},{"$ref":"#/components/schemas/NewProductRef"}],"discriminator":{"propertyName":"type","mapping":{"EXISTING":"#/components/schemas/ExistingProductRef","NEW":"#/components/schemas/NewProductRef"}}},"ProductsScope":{"type":"object","description":"Only lines for the listed products count. A product is the identity shared by plan\ncomponents, overrides and ad-hoc extras, so a subscription's billed set is matched uniformly.","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}}}},"PropertyConfig":{"type":"object","description":"Type-specific configuration. Only the fields relevant to `property_type` are interpreted.","properties":{"max":{"type":["number","null"],"format":"double"},"max_length":{"type":["integer","null"],"format":"int32","description":"Maximum length for `TEXT`.","minimum":0},"min":{"type":["number","null"],"format":"double","description":"Inclusive numeric bounds for `NUMBER`."},"options":{"type":["array","null"],"items":{"$ref":"#/components/schemas/SelectOption"},"description":"Allowed choices for `SINGLE_SELECT` / `MULTI_SELECT`."}}},"QuoteEvent":{"allOf":[{"$ref":"#/components/schemas/QuoteEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"QuoteEventData":{"type":"object","required":["quote_id","customer_id"],"properties":{"customer_id":{"$ref":"#/components/schemas/CustomerId"},"quote_id":{"$ref":"#/components/schemas/QuoteId"},"subscription_id":{"oneOf":[{"$ref":"#/components/schemas/SubscriptionId"},{"type":"null"}]}}},"QuoteId":{"type":"string","format":"MeteroidId","examples":["quo_7n42DGM5Tflk9n8mt7Fhc7"]},"RateFee":{"type":"object","required":["rate"],"properties":{"rate":{"type":"string","format":"decimal"}}},"RateFeeStructure":{"type":"object"},"RatePlanFee":{"type":"object","description":"Recurring rate fee (e.g., monthly subscription)","required":["rates"],"properties":{"rates":{"type":"array","items":{"$ref":"#/components/schemas/TermRate"}}}},"RatePricing":{"type":"object","required":["rate"],"properties":{"rate":{"type":"string","format":"decimal"}}},"RecurringFee":{"type":"object","required":["rate","quantity","billing_type"],"properties":{"billing_type":{"$ref":"#/components/schemas/BillingTypeEnum"},"quantity":{"type":"integer","format":"int32","minimum":0},"rate":{"type":"string","format":"decimal"}}},"RefundEventData":{"type":"object","description":"A refund row, or the payment that failed or was clawed back — the same shape the REST invoice\nexposes as a transaction. `reversal_reason` is deliberately absent: it is free provider text and is\nnot carried on the outbox event.","required":["transaction_id","amount","currency","status","payment_type","amount_refunded","amount_reversed"],"properties":{"amount":{"type":"integer","format":"int64"},"amount_refunded":{"type":"integer","format":"int64"},"amount_reversed":{"type":"integer","format":"int64"},"credit_note_id":{"oneOf":[{"$ref":"#/components/schemas/CreditNoteId"},{"type":"null"}]},"currency":{"type":"string"},"decline_kind":{"oneOf":[{"$ref":"#/components/schemas/DeclineKind"},{"type":"null"}]},"error":{"type":["string","null"]},"invoice_id":{"oneOf":[{"$ref":"#/components/schemas/InvoiceId"},{"type":"null"}]},"parent_transaction_id":{"oneOf":[{"$ref":"#/components/schemas/PaymentTransactionId"},{"type":"null"}]},"payment_type":{"$ref":"#/components/schemas/PaymentTypeEnum"},"processed_at":{"type":["string","null"],"format":"date-time"},"provider_transaction_id":{"type":["string","null"]},"refund_mode":{"oneOf":[{"$ref":"#/components/schemas/RefundMode"},{"type":"null"}]},"reversal_kind":{"oneOf":[{"$ref":"#/components/schemas/ReversalKind"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/PaymentStatusEnum"},"transaction_id":{"$ref":"#/components/schemas/PaymentTransactionId"}}},"RefundMode":{"type":"string","description":"How a voluntary refund was issued: through the provider, or recorded after a wire or cash\nmovement made outside Meteroid.","enum":["ONLINE","OFFLINE"]},"ReplacePlanRequest":{"type":"object","required":["name","currency","components"],"properties":{"add_ons":{"type":"array","items":{"$ref":"#/components/schemas/PlanAddOnInput"}},"billing":{"oneOf":[{"$ref":"#/components/schemas/BillingConfig"},{"type":"null"}]},"components":{"type":"array","items":{"$ref":"#/components/schemas/PriceComponentInput"}},"currency":{"type":"string"},"description":{"type":["string","null"]},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/EntitlementSpecRequest"},"description":"Entitlements to attach to this plan's version. Replacing a published plan creates a\nnew version, and entitlements belong to a version, so passing them here keeps them\nattached to whichever version the call produces."},"minimum_commitment":{"oneOf":[{"$ref":"#/components/schemas/MinimumCommitmentInput","description":"Optional plan-level period minimum commitment. Component scope must reference names\nthat exist in `components` (matched by name, not by ID, since component IDs are\nassigned by the server). Use `MinimumCommitmentInput` so the client can express\nscope by component name."},{"type":"null"}]},"name":{"type":"string"},"status":{"oneOf":[{"$ref":"#/components/schemas/PlanStatusEnum"},{"type":"null"}]},"tax_inclusive":{"type":"boolean","description":"The plan's amounts are quoted tax-included (\"9.99 incl. VAT\"): tax is carved out of\nthem at invoice time instead of being added on top, so the customer pays the quoted\nprice whatever rate applies. A customer who bears no tax (reverse charge, exempt,\nexport) still pays it in full. Defaults to `false`."},"trial":{"oneOf":[{"$ref":"#/components/schemas/TrialConfig"},{"type":"null"}]}}},"ResetPeriod":{"oneOf":[{"$ref":"#/components/schemas/BillingCycleResetPeriod","description":"Resets each time your subscription renews — anchored to your billing cycle."},{"$ref":"#/components/schemas/CalendarResetPeriod","description":"Resets on calendar boundaries (e.g. the 1st of every month) — not tied to subscription start date."},{"$ref":"#/components/schemas/FixedWindowResetPeriod","description":"Resets at regular intervals — anchored to your subscription's exact activation time."},{"$ref":"#/components/schemas/SlidingWindowResetPeriod","description":"Always ends at now — e.g. 30 days means the last 30 days, old usage drops off automatically."},{"$ref":"#/components/schemas/NeverResetPeriod","description":"Never resets — counts all usage since the subscription was activated."}],"discriminator":{"propertyName":"type","mapping":{"BILLING_CYCLE":"#/components/schemas/BillingCycleResetPeriod","CALENDAR":"#/components/schemas/CalendarResetPeriod","FIXED_WINDOW":"#/components/schemas/FixedWindowResetPeriod","NEVER":"#/components/schemas/NeverResetPeriod","SLIDING_WINDOW":"#/components/schemas/SlidingWindowResetPeriod"}}},"ResolvedEntitlement":{"type":"object","description":"Merged entitlement value for a feature across the priority hierarchy, without usage data.","required":["feature","value"],"properties":{"feature":{"$ref":"#/components/schemas/FeatureRef"},"value":{"$ref":"#/components/schemas/ResolvedEntitlementValue"}}},"ResolvedEntitlementListResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ResolvedEntitlement"}}}},"ResolvedEntitlementValue":{"oneOf":[{"$ref":"#/components/schemas/BooleanResolvedEntitlementValue"},{"$ref":"#/components/schemas/MeteredResolvedEntitlementValue"},{"$ref":"#/components/schemas/ConfigResolvedEntitlementValue"}],"discriminator":{"propertyName":"type","mapping":{"BOOLEAN":"#/components/schemas/BooleanResolvedEntitlementValue","CONFIG":"#/components/schemas/ConfigResolvedEntitlementValue","METERED":"#/components/schemas/MeteredResolvedEntitlementValue"}}},"RestErrorResponse":{"type":"object","required":["code","message"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string"}}},"ReversalKind":{"type":"string","description":"Why a payment was involuntarily clawed back.","enum":["REFUND","CHARGEBACK","DEBTOR_RECALL","INSUFFICIENT_FUNDS","MANDATE_INVALID","RETURNED","DISPUTE","OTHER"]},"RevocationRequest":{"type":"object","description":"Token revocation request","required":["token"],"properties":{"token":{"type":"string","description":"The token to revoke"},"token_type_hint":{"type":["string","null"],"description":"Optional hint about the token type (access_token or refresh_token)"}}},"RotatedSecret":{"type":"object","description":"Result of rotating a client secret","required":["client_secret","client_secret_hint"],"properties":{"client_secret":{"type":"string"},"client_secret_hint":{"type":"string"}}},"SelectOption":{"type":"object","required":["value"],"properties":{"label":{"type":["string","null"]},"value":{"type":"string"}}},"ShippingAddress":{"type":"object","required":["same_as_billing"],"properties":{"address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"same_as_billing":{"type":"boolean"}}},"SlidingWindowResetPeriod":{"type":"object","description":"Always ends at now — e.g. 30 days means the last 30 days, old usage drops off automatically.","required":["unit","interval"],"properties":{"interval":{"type":"integer","format":"int32","minimum":0},"unit":{"$ref":"#/components/schemas/CalendarUnit"}}},"SlotDowngradePolicyEnum":{"type":"string","enum":["REMOVE_AT_END_OF_PERIOD"]},"SlotFee":{"type":"object","required":["unit","unit_rate","initial_slots"],"properties":{"initial_slots":{"type":"integer","format":"int32","minimum":0},"max_slots":{"type":["integer","null"],"format":"int32","minimum":0},"min_slots":{"type":["integer","null"],"format":"int32","minimum":0},"unit":{"type":"string"},"unit_rate":{"type":"string","format":"decimal"}}},"SlotFeeStructure":{"type":"object","required":["slot_unit_name","upgrade_policy","downgrade_policy"],"properties":{"downgrade_policy":{"$ref":"#/components/schemas/SlotDowngradePolicyEnum"},"slot_unit_name":{"type":"string"},"upgrade_policy":{"$ref":"#/components/schemas/SlotUpgradePolicyEnum"}}},"SlotPlanFee":{"type":"object","description":"Slot-based fee (e.g., per-seat pricing)","required":["rates","slot_unit_name"],"properties":{"minimum_count":{"type":["integer","null"],"format":"int32","minimum":0},"quota":{"type":["integer","null"],"format":"int32","minimum":0},"rates":{"type":"array","items":{"$ref":"#/components/schemas/TermRate"}},"slot_unit_name":{"type":"string"}}},"SlotPricing":{"type":"object","required":["unit_rate"],"properties":{"max_slots":{"type":["integer","null"],"format":"int32","minimum":0},"min_slots":{"type":["integer","null"],"format":"int32","minimum":0},"unit_rate":{"type":"string","format":"decimal"}}},"SlotUpgradePolicyEnum":{"type":"string","enum":["PRORATED"]},"SubLineItem":{"type":"object","required":["id","name","total","quantity","unit_price"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"string","format":"decimal"},"total":{"type":"integer","format":"int64"},"unit_price":{"type":"string","format":"decimal"}}},"Subscription":{"type":"object","required":["id","customer_id","customer_name","billing_day_anchor","currency","plan_id","plan_name","plan_version_id","plan_version","status","start_date","current_period_start","net_terms","mrr_cents","period","created_at","tax_inclusive","auto_advance_invoices","charge_automatically","custom_properties"],"properties":{"activated_at":{"type":["string","null"],"format":"date-time","description":"When the subscription was activated (first payment or activation condition met)"},"auto_advance_invoices":{"type":"boolean","description":"If false, invoices will stay in Draft until manually reviewed and finalized. Default to true."},"billing_day_anchor":{"type":"integer","format":"int32"},"billing_start_date":{"type":["string","null"],"format":"date","description":"When billing started (after any trial period)"},"charge_automatically":{"type":"boolean","description":"Automatically try to charge the customer's configured payment method on finalize."},"created_at":{"type":"string","format":"date-time","description":"When the subscription was created"},"currency":{"$ref":"#/components/schemas/Currency"},"current_period_end":{"type":["string","null"],"format":"date","description":"Current billing period end date"},"current_period_start":{"type":"string","format":"date","description":"Current billing period start date"},"custom_properties":{"description":"User-defined custom property values, keyed by definition `key`."},"customer_alias":{"type":["string","null"]},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"customer_name":{"type":"string"},"end_date":{"type":["string","null"],"format":"date","description":"When the subscription ends (if set)"},"id":{"$ref":"#/components/schemas/SubscriptionId"},"invoice_memo":{"type":["string","null"],"description":"Default memo for invoices"},"mrr_cents":{"type":"integer","format":"int64","description":"Monthly recurring revenue in cents","minimum":0},"net_terms":{"type":"integer","format":"int32","description":"Payment terms in days (0 = due on issue)","minimum":0},"payment_methods_config":{"oneOf":[{"$ref":"#/components/schemas/PaymentMethodsConfig","description":"Payment methods configuration (Online, BankTransfer, or External)"},{"type":"null"}]},"period":{"$ref":"#/components/schemas/BillingPeriodEnum","description":"Billing period (monthly, annual, etc.)"},"plan_description":{"type":["string","null"]},"plan_id":{"$ref":"#/components/schemas/PlanId"},"plan_name":{"type":"string"},"plan_version":{"type":"integer","format":"int32","minimum":0},"plan_version_id":{"$ref":"#/components/schemas/PlanVersionId"},"purchase_order":{"type":["string","null"]},"start_date":{"type":"string","format":"date","description":"When the subscription contract starts (benefits apply from this date)"},"status":{"$ref":"#/components/schemas/SubscriptionStatusEnum"},"tax_inclusive":{"type":"boolean","description":"The subscription's prices are quoted tax-included (snapshotted from its plan version)."},"trial_duration":{"type":["integer","null"],"format":"int32","description":"Trial duration in days","minimum":0}}},"SubscriptionActivationConditionEnum":{"type":"string","enum":["ON_START","ON_CHECKOUT","MANUAL"]},"SubscriptionAddOn":{"type":"object","required":["name","period","fee","quantity"],"properties":{"add_on_id":{"$ref":"#/components/schemas/AddOnId"},"fee":{"$ref":"#/components/schemas/SubscriptionFee"},"id":{"$ref":"#/components/schemas/SubscriptionAddOnId"},"name":{"type":"string"},"period":{"$ref":"#/components/schemas/SubscriptionFeeBillingPeriodEnum"},"quantity":{"type":"integer","format":"int32","minimum":0}}},"SubscriptionAddOnCustomization":{"oneOf":[{"$ref":"#/components/schemas/SubscriptionAddOnPriceOverride"},{"$ref":"#/components/schemas/SubscriptionAddOnParameterization"}],"discriminator":{"propertyName":"type","mapping":{"PARAMETERIZATION":"#/components/schemas/SubscriptionAddOnParameterization","PRICE_OVERRIDE":"#/components/schemas/SubscriptionAddOnPriceOverride"}}},"SubscriptionAddOnId":{"type":"string","format":"MeteroidId","examples":["sub_add_7n42DGM5Tflk9n8mt7Fhc7"]},"SubscriptionAddOnParameterization":{"type":"object","properties":{"billing_period":{"oneOf":[{"$ref":"#/components/schemas/BillingPeriodEnum"},{"type":"null"}]},"committed_capacity":{"type":["integer","null"],"format":"int64","minimum":0},"initial_slot_count":{"type":["integer","null"],"format":"int32","minimum":0}}},"SubscriptionAddOnPriceOverride":{"type":"object","required":["price_entry"],"properties":{"name":{"type":["string","null"]},"price_entry":{"$ref":"#/components/schemas/PriceEntry"}}},"SubscriptionComponent":{"type":"object","required":["name","period","fee"],"properties":{"fee":{"$ref":"#/components/schemas/SubscriptionFee"},"name":{"type":"string"},"period":{"$ref":"#/components/schemas/SubscriptionFeeBillingPeriodEnum"},"price_component_id":{"oneOf":[{"$ref":"#/components/schemas/PriceComponentId"},{"type":"null"}]},"product_id":{"oneOf":[{"$ref":"#/components/schemas/ProductId"},{"type":"null"}]}}},"SubscriptionCoupon":{"type":"object","description":"Coupon as embedded in subscription details — a subset of the `Coupon` resource\nreturned by the coupons API.","required":["id","code","description","discount","reusable","disabled"],"properties":{"code":{"type":"string"},"description":{"type":"string"},"disabled":{"type":"boolean"},"discount":{"$ref":"#/components/schemas/CouponDiscount"},"expires_at":{"type":["string","null"],"format":"date-time"},"id":{"$ref":"#/components/schemas/CouponId"},"recurring_value":{"type":["integer","null"],"format":"int32"},"redemption_limit":{"type":["integer","null"],"format":"int32"},"reusable":{"type":"boolean"}}},"SubscriptionCreateRequest":{"type":"object","required":["plan_id","customer_id_or_alias","start_date","activation_condition"],"properties":{"activation_condition":{"$ref":"#/components/schemas/SubscriptionActivationConditionEnum"},"add_ons":{"type":"array","items":{"$ref":"#/components/schemas/CreateSubscriptionAddOn"}},"auto_advance_invoices":{"type":"boolean"},"backdate_invoices":{"type":"boolean","description":"Historical import mode: when true, invoices finalized for this subscription keep their\nbilling-period date as the invoice date instead of being stamped with the emission date."},"billing_day_anchor":{"type":["integer","null"],"format":"int32","maximum":32767,"minimum":1},"charge_automatically":{"type":"boolean"},"coupon_codes":{"type":"array","items":{"type":"string"}},"custom_properties":{"description":"User-defined custom property values, keyed by definition `key`. Validated against the\ntenant's subscription definitions."},"customer_id_or_alias":{"type":"string","format":"CustomerId or customer alias"},"end_date":{"type":"string","format":"date","examples":["2025-11-01"]},"invoice_memo":{"type":"string"},"net_terms":{"type":"integer","format":"int32","minimum":0},"payment_methods_config":{"$ref":"#/components/schemas/PaymentMethodsConfig","description":"Payment methods configuration. If not specified, inherits from the invoicing entity."},"plan_id":{"$ref":"#/components/schemas/PlanId"},"price_components":{"$ref":"#/components/schemas/CreateSubscriptionComponents"},"purchase_order":{"type":["string","null"]},"skip_past_invoices":{"type":"boolean","description":"Migration mode: when true with a past start_date, skip creating invoices for past cycles.\nThe subscription will be set to the current billing period with correct cycle_index."},"start_date":{"type":"string","format":"date","examples":["2024-11-01"]},"trial_days":{"type":"integer","format":"int32","minimum":0},"version":{"type":"integer","format":"int32"}}},"SubscriptionDetails":{"type":"object","required":["id","customer_id","customer_name","billing_day_anchor","currency","plan_id","plan_name","plan_version_id","plan_version","status","start_date","current_period_start","net_terms","mrr_cents","period","created_at","tax_inclusive","auto_advance_invoices","charge_automatically","components","add_ons","applied_coupons","custom_properties"],"properties":{"activated_at":{"type":["string","null"],"format":"date-time","description":"When the subscription was activated (first payment or activation condition met)"},"add_ons":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionAddOn"}},"applied_coupons":{"type":"array","items":{"$ref":"#/components/schemas/AppliedCouponDetailed"}},"auto_advance_invoices":{"type":"boolean"},"billing_day_anchor":{"type":"integer","format":"int32"},"billing_start_date":{"type":["string","null"],"format":"date","description":"When billing started (after any trial period)"},"charge_automatically":{"type":"boolean"},"checkout_url":{"type":["string","null"]},"components":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionComponent"}},"created_at":{"type":"string","format":"date-time","description":"When the subscription was created"},"currency":{"$ref":"#/components/schemas/Currency"},"current_period_end":{"type":["string","null"],"format":"date","description":"Current billing period end date"},"current_period_start":{"type":"string","format":"date","description":"Current billing period start date"},"custom_properties":{"description":"User-defined custom property values, keyed by definition `key`."},"customer_alias":{"type":["string","null"]},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"customer_name":{"type":"string"},"end_date":{"type":["string","null"],"format":"date","description":"When the subscription ends (if set)"},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/Entitlement"}},"id":{"$ref":"#/components/schemas/SubscriptionId"},"invoice_memo":{"type":["string","null"],"description":"Default memo for invoices"},"minimum_commitment":{"oneOf":[{"$ref":"#/components/schemas/MinimumCommitment","description":"Materialized minimum-commitment floor on this subscription (plan snapshot or operator\noverride). Read-only here — set it at creation, or change it via a subscription amendment."},{"type":"null"}]},"mrr_cents":{"type":"integer","format":"int64","description":"Monthly recurring revenue in cents","minimum":0},"net_terms":{"type":"integer","format":"int32","description":"Payment terms in days (0 = due on issue)","minimum":0},"payment_methods_config":{"oneOf":[{"$ref":"#/components/schemas/PaymentMethodsConfig"},{"type":"null"}]},"period":{"$ref":"#/components/schemas/BillingPeriodEnum","description":"Billing period (monthly, annual, etc.)"},"plan_id":{"$ref":"#/components/schemas/PlanId"},"plan_name":{"type":"string"},"plan_version":{"type":"integer","format":"int32","minimum":0},"plan_version_id":{"$ref":"#/components/schemas/PlanVersionId"},"purchase_order":{"type":["string","null"]},"start_date":{"type":"string","format":"date","description":"When the subscription contract starts (benefits apply from this date)"},"status":{"$ref":"#/components/schemas/SubscriptionStatusEnum"},"tax_inclusive":{"type":"boolean","description":"The subscription's prices are quoted tax-included (snapshotted from its plan version)."},"trial_duration":{"type":["integer","null"],"format":"int32","description":"Trial duration in days","minimum":0}}},"SubscriptionEvent":{"allOf":[{"$ref":"#/components/schemas/SubscriptionEventData"},{"type":"object","required":["id","type","timestamp"],"properties":{"id":{"$ref":"#/components/schemas/EventId"},"timestamp":{"type":"string","format":"date-time"},"type":{"$ref":"#/components/schemas/EventType"}}}]},"SubscriptionEventData":{"type":"object","required":["subscription_id","customer_id","customer_name","billing_day_anchor","currency","start_date","plan_name","version","created_at","net_terms","mrr_cents","period","status","auto_advance_invoices","charge_automatically","custom_properties"],"properties":{"activated_at":{"type":["string","null"],"format":"date-time"},"auto_advance_invoices":{"type":"boolean"},"billing_day_anchor":{"type":"integer","format":"int32","minimum":0},"billing_start_date":{"type":["string","null"],"format":"date"},"cancellation_reason":{"type":["string","null"],"description":"Present on `subscription.cancelled` when a reason was supplied."},"change_type":{"oneOf":[{"$ref":"#/components/schemas/SubscriptionUpdateType","description":"Present on `subscription.updated`: which mutation fired the event."},{"type":"null"}]},"charge_automatically":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"currency":{"type":"string"},"custom_properties":{"description":"User-defined custom property values, keyed by definition key."},"customer_alias":{"type":["string","null"]},"customer_id":{"$ref":"#/components/schemas/CustomerId"},"customer_name":{"type":"string"},"end_date":{"type":["string","null"],"format":"date"},"invoice_memo":{"type":["string","null"]},"invoice_threshold":{"type":["string","null"]},"mrr_cents":{"type":"integer","format":"int64","minimum":0},"net_terms":{"type":"integer","format":"int32","minimum":0},"period":{"$ref":"#/components/schemas/BillingPeriodEnum"},"plan_name":{"type":"string"},"purchase_order":{"type":["string","null"]},"start_date":{"type":"string","format":"date"},"status":{"$ref":"#/components/schemas/SubscriptionStatusEnum"},"subscription_id":{"$ref":"#/components/schemas/SubscriptionId"},"trial_duration":{"type":["integer","null"],"format":"int32","minimum":0},"version":{"type":"integer","format":"int32","minimum":0}}},"SubscriptionFee":{"oneOf":[{"$ref":"#/components/schemas/RateFee"},{"$ref":"#/components/schemas/OneTimeFee"},{"$ref":"#/components/schemas/RecurringFee"},{"$ref":"#/components/schemas/CapacityFee"},{"$ref":"#/components/schemas/SlotFee"},{"$ref":"#/components/schemas/UsageFee"}],"discriminator":{"propertyName":"type","mapping":{"CAPACITY":"#/components/schemas/CapacityFee","ONE_TIME":"#/components/schemas/OneTimeFee","RATE":"#/components/schemas/RateFee","RECURRING":"#/components/schemas/RecurringFee","SLOT":"#/components/schemas/SlotFee","USAGE":"#/components/schemas/UsageFee"}}},"SubscriptionFeeBillingPeriodEnum":{"type":"string","enum":["ONE_TIME","MONTHLY","QUARTERLY","SEMIANNUAL","ANNUAL"]},"SubscriptionId":{"type":"string","format":"MeteroidId","examples":["sub_7n42DGM5Tflk9n8mt7Fhc7"]},"SubscriptionListResponse":{"type":"object","required":["data","pagination_meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"pagination_meta":{"$ref":"#/components/schemas/PaginationResponse"}}},"SubscriptionStatusEnum":{"type":"string","title":"SubscriptionStatus","enum":["PENDING_ACTIVATION","PENDING_CHARGE","TRIAL_ACTIVE","ACTIVE","TRIAL_EXPIRED","PAUSED","SUSPENDED","CANCELLED","ABORTED","COMPLETED","SUPERSEDED","ERRORED"]},"SubscriptionUpdateRequest":{"type":"object","properties":{"auto_advance_invoices":{"type":["boolean","null"],"description":"If false, invoices will stay in Draft until manually reviewed and finalized."},"charge_automatically":{"type":["boolean","null"],"description":"Automatically try to charge the customer's configured payment method on finalize."},"custom_properties":{"description":"Partial update of custom property values (merge; send a key with `null` to remove it).\nValidated against the tenant's `SUBSCRIPTION` property definitions. Omit to leave unchanged."},"invoice_memo":{"type":["string","null"],"description":"Default memo for invoices"},"net_terms":{"type":["integer","null"],"format":"int32","description":"Payment terms in days (0 = due on issue)","minimum":0},"payment_methods_config":{"oneOf":[{"$ref":"#/components/schemas/PaymentMethodsConfig","description":"Payment methods configuration (Online, BankTransfer, or External)"},{"type":"null"}]},"purchase_order":{"type":["string","null"],"description":"Purchase order number"}}},"SubscriptionUpdateResponse":{"type":"object","required":["subscription"],"properties":{"subscription":{"$ref":"#/components/schemas/SubscriptionDetails"}}},"SubscriptionUpdateType":{"type":"string","description":"Identifies which mutation triggered a `subscription.updated` webhook.","enum":["activated","trial_ended","billing_configuration_updated","plan_changed","amended","units_changed","paused","cancellation_scheduled"]},"TaxBreakdownItem":{"type":"object","required":["taxable_amount","tax_amount","tax_rate","name"],"properties":{"exemption_reason":{"type":["string","null"],"description":"Free-text legal exemption mention (EU exempt/reverse-charge invoices)."},"exemption_type":{"oneOf":[{"$ref":"#/components/schemas/TaxExemptionType"},{"type":"null"}]},"name":{"type":"string"},"tax_amount":{"type":"integer","format":"int64"},"tax_rate":{"type":"string","format":"decimal"},"tax_reference":{"type":["string","null"],"description":"Accounting/reporting code of the tax rate for this line, for exports."},"taxable_amount":{"type":"integer","format":"int64"}}},"TaxExemptionType":{"type":"string","enum":["REVERSE_CHARGE","TAX_EXEMPT","NOT_REGISTERED","EXPORT","NO_VAT_TERRITORY"]},"TenantId":{"type":"string","format":"MeteroidId","examples":["ten_7n42DGM5Tflk9n8mt7Fhc7"]},"TermRate":{"type":"object","required":["term","price"],"properties":{"price":{"type":"string","format":"decimal"},"term":{"$ref":"#/components/schemas/BillingPeriodEnum"}}},"TextConfigValue":{"type":"object","description":"A text config value.","required":["value"],"properties":{"value":{"type":"string"}}},"TierRow":{"type":"object","required":["first_unit","rate"],"properties":{"first_unit":{"type":"integer","format":"int64","minimum":0},"flat_cap":{"type":["string","null"],"format":"decimal"},"flat_fee":{"type":["string","null"],"format":"decimal"},"rate":{"type":"string","format":"decimal"}}},"TieredPlanPricing":{"type":"object","required":["tiers"],"properties":{"block_size":{"type":["integer","null"],"format":"int64","minimum":0},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/TierRow"}}}},"TieredPricing":{"type":"object","required":["tiers"],"properties":{"block_size":{"type":["integer","null"],"format":"int64","minimum":0},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/TierRow"}}}},"TokenIntrospectionResponse":{"type":"object","description":"Token introspection response as per RFC 7662","required":["active"],"properties":{"active":{"type":"boolean"},"client_id":{"type":["string","null"]},"exp":{"type":["integer","null"],"format":"int64"},"iat":{"type":["integer","null"],"format":"int64"},"scope":{"type":["string","null"]},"sub":{"type":["string","null"]},"token_type":{"type":["string","null"]}}},"TokenRequest":{"type":"object","description":"Token request (from POST body, application/x-www-form-urlencoded)","required":["grant_type"],"properties":{"client_id":{"type":["string","null"],"description":"Client ID (if not using HTTP Basic auth)"},"client_secret":{"type":["string","null"],"description":"Client secret (if not using HTTP Basic auth)"},"code":{"type":["string","null"],"description":"Authorization code (for authorization_code grant)"},"code_verifier":{"type":["string","null"],"description":"PKCE code verifier (for authorization_code grant with PKCE)"},"grant_type":{"type":"string","description":"Grant type: \"authorization_code\" or \"refresh_token\""},"redirect_uri":{"type":["string","null"],"description":"Redirect URI (for authorization_code grant, must match the one used in /authorize)"},"refresh_token":{"type":["string","null"],"description":"Refresh token (for refresh_token grant)"}}},"TokenResponse":{"type":"object","description":"Token response as per OAuth 2.0 spec","required":["access_token","token_type","expires_in"],"properties":{"access_token":{"type":"string"},"expires_in":{"type":"integer","format":"int64"},"refresh_token":{"type":["string","null"]},"scope":{"type":["string","null"]},"token_type":{"type":"string"}}},"Transaction":{"type":"object","required":["id","amount","currency","status","payment_type","amount_refunded","amount_reversed"],"properties":{"amount":{"type":"integer","format":"int64","minimum":0},"amount_refunded":{"type":"integer","format":"int64","description":"On a PAYMENT: how much was voluntarily given back (the sum of its settled REFUND\nchildren). The invoice stays paid — the Refund credit note is what reduces it."},"amount_reversed":{"type":"integer","format":"int64","description":"On a PAYMENT: how much was involuntarily clawed back (chargeback, bank recall, lost\ndispute). This is what the invoice nets out, reopening it."},"credit_note_id":{"oneOf":[{"$ref":"#/components/schemas/CreditNoteId","description":"Set on a REFUND drawn against a finalized Refund credit note."},{"type":"null"}]},"currency":{"type":"string"},"error":{"type":["string","null"]},"id":{"$ref":"#/components/schemas/PaymentTransactionId"},"parent_transaction_id":{"oneOf":[{"$ref":"#/components/schemas/PaymentTransactionId","description":"Set on a REFUND: the settled payment the money is given back from."},{"type":"null"}]},"payment_method_id":{"oneOf":[{"$ref":"#/components/schemas/CustomerPaymentMethodId"},{"type":"null"}]},"payment_method_info":{"oneOf":[{"$ref":"#/components/schemas/PaymentMethodInfo"},{"type":"null"}]},"payment_type":{"$ref":"#/components/schemas/PaymentTypeEnum"},"processed_at":{"type":["string","null"],"format":"date-time"},"provider_transaction_id":{"type":["string","null"]},"refund_mode":{"oneOf":[{"$ref":"#/components/schemas/RefundMode"},{"type":"null"}]},"reversal_kind":{"oneOf":[{"$ref":"#/components/schemas/ReversalKind"},{"type":"null"}]},"reversal_reason":{"type":["string","null"],"description":"The provider's raw cause, or what the operator typed when reversing by hand."},"status":{"$ref":"#/components/schemas/PaymentStatusEnum"}}},"TrialConfig":{"type":"object","required":["duration_days","is_free"],"properties":{"duration_days":{"type":"integer","format":"int32","minimum":0},"is_free":{"type":"boolean"},"trialing_plan_id":{"oneOf":[{"$ref":"#/components/schemas/PlanId"},{"type":"null"}]}}},"UnitConversion":{"type":"object","required":["factor","rounding"],"properties":{"factor":{"type":"integer","format":"int32"},"rounding":{"$ref":"#/components/schemas/UnitConversionRoundingEnum"}}},"UnitConversionRoundingEnum":{"type":"string","enum":["UP","DOWN","NEAREST","NEAREST_HALF","NEAREST_DECILE","NONE"]},"UpdateAddOnRequest":{"type":"object","properties":{"description":{"type":["string","null"]},"max_instances_per_subscription":{"type":["integer","null"],"format":"int32"},"name":{"type":["string","null"]},"price_id":{"oneOf":[{"$ref":"#/components/schemas/PriceId"},{"type":"null"}]},"self_serviceable":{"type":["boolean","null"]}}},"UpdateCouponRequest":{"type":"object","properties":{"description":{"type":["string","null"]},"discount":{"oneOf":[{"$ref":"#/components/schemas/CouponDiscount"},{"type":"null"}]},"plan_ids":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PlanId"}}}},"UpdateEntitlementRequest":{"type":"object","properties":{"value":{"oneOf":[{"$ref":"#/components/schemas/EntitlementValue","description":"Omit to leave the entitlement unchanged. Must match the feature's type."},{"type":"null"}]}}},"UpdateFeatureRequest":{"type":"object","description":"Partial update. Code, feature type and product are immutable.","properties":{"description":{"type":["string","null"],"description":"Omit to leave unchanged; send `null` to clear."},"name":{"type":["string","null"]}}},"UpdateMetricRequest":{"type":"object","properties":{"description":{"type":["string","null"]},"filters":{"type":["array","null"],"items":{"$ref":"#/components/schemas/MetricFilter"},"description":"Absent = leave filters untouched; present (even empty) = replace them."},"name":{"type":["string","null"]},"segmentation_matrix":{"oneOf":[{"$ref":"#/components/schemas/MetricSegmentationMatrix"},{"type":"null"}]},"unit_conversion":{"oneOf":[{"$ref":"#/components/schemas/UnitConversion"},{"type":"null"}]}}},"UpdateProductRequest":{"type":"object","properties":{"description":{"type":["string","null"]},"fee_structure":{"oneOf":[{"$ref":"#/components/schemas/ProductFeeStructure"},{"type":"null"}]},"name":{"type":["string","null"]}}},"UsageFee":{"type":"object","required":["metric_id","model"],"properties":{"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"model":{"$ref":"#/components/schemas/UsagePricingModel"}}},"UsageFeeStructure":{"type":"object","required":["metric_id","model"],"properties":{"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"model":{"$ref":"#/components/schemas/UsageModelEnum"}}},"UsageModelEnum":{"type":"string","enum":["PER_UNIT","TIERED","VOLUME","PACKAGE","MATRIX"]},"UsagePlanFee":{"type":"object","description":"Usage-based fee","required":["metric_id","pricing","cadence"],"properties":{"cadence":{"$ref":"#/components/schemas/BillingPeriodEnum"},"metric_id":{"$ref":"#/components/schemas/BillableMetricId"},"pricing":{"$ref":"#/components/schemas/PlanUsagePricingModel"}}},"UsagePricing":{"type":"object","required":["model"],"properties":{"model":{"$ref":"#/components/schemas/UsagePricingModel"}}},"UsagePricingModel":{"oneOf":[{"$ref":"#/components/schemas/PerUnitPricing"},{"$ref":"#/components/schemas/TieredPricing"},{"$ref":"#/components/schemas/VolumePricing"},{"$ref":"#/components/schemas/PackagePricing"},{"$ref":"#/components/schemas/MatrixPricing"}],"discriminator":{"propertyName":"type","mapping":{"MATRIX":"#/components/schemas/MatrixPricing","PACKAGE":"#/components/schemas/PackagePricing","PER_UNIT":"#/components/schemas/PerUnitPricing","TIERED":"#/components/schemas/TieredPricing","VOLUME":"#/components/schemas/VolumePricing"}}},"UsageResponse":{"type":"object","required":["period_start","period_end","usage"],"properties":{"period_end":{"type":"string","format":"date"},"period_start":{"type":"string","format":"date"},"usage":{"type":"array","items":{"$ref":"#/components/schemas/MetricUsage"}}}},"VolumePlanPricing":{"type":"object","required":["tiers"],"properties":{"block_size":{"type":["integer","null"],"format":"int64","minimum":0},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/TierRow"}}}},"VolumePricing":{"type":"object","required":["tiers"],"properties":{"block_size":{"type":["integer","null"],"format":"int64","minimum":0},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/TierRow"}}}}},"securitySchemes":{"bearer_auth":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Meteroid","description":"Meteroid API"},{"name":"Add-ons"},{"name":"Batch Jobs"},{"name":"Checkout Sessions"},{"name":"Connect","description":"Manage connected accounts (Express & Standard)"},{"name":"Coupons"},{"name":"Credit Notes"},{"name":"Custom Properties"},{"name":"Customers"},{"name":"Entitlements"},{"name":"Events"},{"name":"Features"},{"name":"Invoices"},{"name":"Metrics"},{"name":"OAuth","description":"OAuth 2.0 token endpoints (public, client-credentials auth)"},{"name":"OAuth Apps","description":"Manage OAuth applications for Connect integrations"},{"name":"Plans"},{"name":"Product Families"},{"name":"Products"},{"name":"Subscriptions"},{"name":"Usage"}],"webhooks":{"addon.archived":{"post":{"summary":"addon.archived webhook","description":"An add-on was archived","operationId":"webhook_addon_archived","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOnEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"addon.archived","add_on_id":"add_7n42DGM5Tflk9n8mt7Fhc7","name":"Extra Storage","description":"Additional storage capacity","product_id":"prd_7n42DGM5Tflk9n8mt7Fhc7","price_id":"pri_7n42DGM5Tflk9n8mt7Fhc7","fee_type":"USAGE","self_serviceable":true,"max_instances_per_subscription":5,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"addon.created":{"post":{"summary":"addon.created webhook","description":"A new add-on was created","operationId":"webhook_addon_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOnEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"addon.created","add_on_id":"add_7n42DGM5Tflk9n8mt7Fhc7","name":"Extra Storage","description":"Additional storage capacity","product_id":"prd_7n42DGM5Tflk9n8mt7Fhc7","price_id":"pri_7n42DGM5Tflk9n8mt7Fhc7","fee_type":"USAGE","self_serviceable":true,"max_instances_per_subscription":5,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"addon.updated":{"post":{"summary":"addon.updated webhook","description":"An add-on was updated","operationId":"webhook_addon_updated","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOnEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"addon.updated","add_on_id":"add_7n42DGM5Tflk9n8mt7Fhc7","name":"Extra Storage","description":"Additional storage capacity","product_id":"prd_7n42DGM5Tflk9n8mt7Fhc7","price_id":"pri_7n42DGM5Tflk9n8mt7Fhc7","fee_type":"USAGE","self_serviceable":true,"max_instances_per_subscription":5,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"coupon.archived":{"post":{"summary":"coupon.archived webhook","description":"A coupon was archived","operationId":"webhook_coupon_archived","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"coupon.archived","coupon_id":"cou_7n42DGM5Tflk9n8mt7Fhc7","code":"WELCOME20","description":"20% off for new customers","discount":{"type":"PERCENTAGE","percentage":"20"},"redemption_limit":100,"recurring_value":3,"reusable":false,"disabled":false,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"coupon.created":{"post":{"summary":"coupon.created webhook","description":"A new coupon was created","operationId":"webhook_coupon_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"coupon.created","coupon_id":"cou_7n42DGM5Tflk9n8mt7Fhc7","code":"WELCOME20","description":"20% off for new customers","discount":{"type":"PERCENTAGE","percentage":"20"},"redemption_limit":100,"recurring_value":3,"reusable":false,"disabled":false,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"coupon.updated":{"post":{"summary":"coupon.updated webhook","description":"A coupon was updated","operationId":"webhook_coupon_updated","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"coupon.updated","coupon_id":"cou_7n42DGM5Tflk9n8mt7Fhc7","code":"WELCOME20","description":"20% off for new customers","discount":{"type":"PERCENTAGE","percentage":"20"},"redemption_limit":100,"recurring_value":3,"reusable":false,"disabled":false,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"credit_note.created":{"post":{"summary":"credit_note.created webhook","description":"A new credit note was created","operationId":"webhook_credit_note_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"credit_note.created","credit_note_id":"crn_7n42DGM5Tflk9n8mt7Fhc7","credit_note_number":"CN-000001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","status":"DRAFT","currency":"EUR","subtotal":4000,"total":5000,"tax_amount":1000,"refunded_amount_cents":0,"credited_amount_cents":5000,"line_items":[],"tax_breakdown":[],"reason":"Partial refund","custom_properties":{},"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"credit_note.finalized":{"post":{"summary":"credit_note.finalized webhook","description":"A credit note was finalized","operationId":"webhook_credit_note_finalized","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"credit_note.finalized","credit_note_id":"crn_7n42DGM5Tflk9n8mt7Fhc7","credit_note_number":"CN-000001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","status":"DRAFT","currency":"EUR","subtotal":4000,"total":5000,"tax_amount":1000,"refunded_amount_cents":0,"credited_amount_cents":5000,"line_items":[],"tax_breakdown":[],"reason":"Partial refund","custom_properties":{},"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"credit_note.voided":{"post":{"summary":"credit_note.voided webhook","description":"A credit note was voided","operationId":"webhook_credit_note_voided","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"credit_note.voided","credit_note_id":"crn_7n42DGM5Tflk9n8mt7Fhc7","credit_note_number":"CN-000001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","status":"DRAFT","currency":"EUR","subtotal":4000,"total":5000,"tax_amount":1000,"refunded_amount_cents":0,"credited_amount_cents":5000,"line_items":[],"tax_breakdown":[],"reason":"Partial refund","custom_properties":{},"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"customer.created":{"post":{"summary":"customer.created webhook","description":"A new customer was created","operationId":"webhook_customer_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"customer.created","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","name":"Acme Corporation","alias":"ACME","billing_email":"billing@acme.example","invoicing_emails":["invoices@acme.example"],"phone":"+1-555-0123","currency":"USD","custom_properties":{"account_tier":"enterprise"},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.accounting_pdf_generated":{"post":{"summary":"invoice.accounting_pdf_generated webhook","description":"The accounting PDF of a finalized invoice was stored, with the e-invoicing outcome when the invoicing entity opted in","operationId":"webhook_invoice_accounting_pdf_generated","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDocumentsEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.accounting_pdf_generated","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","pdf_document_id":"doc_01HXYZ","einvoicing_status":"FAILED","einvoicing_profile":"EN 16931","einvoicing_findings":[{"rule":"BR-11","term":"BG-8/BT-55","message":"The Buyer postal address shall contain a Buyer country code."}],"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.closed":{"post":{"summary":"invoice.closed webhook","description":"An empty recurring invoice was closed with nothing to bill","operationId":"webhook_invoice_closed","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.closed","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","status":"DRAFT","currency":"EUR","total":10000,"tax_amount":2000,"created_at":"1970-01-01T00:00:00.000Z","custom_properties":{},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.consolidated":{"post":{"summary":"invoice.consolidated webhook","description":"An invoice was merged into a consolidated invoice and is superseded by its parent","operationId":"webhook_invoice_consolidated","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.consolidated","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","status":"DRAFT","currency":"EUR","total":10000,"tax_amount":2000,"created_at":"1970-01-01T00:00:00.000Z","custom_properties":{},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.created":{"post":{"summary":"invoice.created webhook","description":"A new invoice was created","operationId":"webhook_invoice_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.created","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","status":"DRAFT","currency":"EUR","total":10000,"tax_amount":2000,"created_at":"1970-01-01T00:00:00.000Z","custom_properties":{},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.deleted":{"post":{"summary":"invoice.deleted webhook","description":"A draft invoice was deleted","operationId":"webhook_invoice_deleted","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.deleted","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","status":"DRAFT","currency":"EUR","total":10000,"tax_amount":2000,"created_at":"1970-01-01T00:00:00.000Z","custom_properties":{},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.finalized":{"post":{"summary":"invoice.finalized webhook","description":"An invoice was finalized","operationId":"webhook_invoice_finalized","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.finalized","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","status":"DRAFT","currency":"EUR","total":10000,"tax_amount":2000,"created_at":"1970-01-01T00:00:00.000Z","custom_properties":{},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.paid":{"post":{"summary":"invoice.paid webhook","description":"An invoice was paid","operationId":"webhook_invoice_paid","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.paid","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","status":"DRAFT","currency":"EUR","total":10000,"tax_amount":2000,"created_at":"1970-01-01T00:00:00.000Z","custom_properties":{},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice.voided":{"post":{"summary":"invoice.voided webhook","description":"An invoice was voided","operationId":"webhook_invoice_voided","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"invoice.voided","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","invoice_number":"INV-0001","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","status":"DRAFT","currency":"EUR","total":10000,"tax_amount":2000,"created_at":"1970-01-01T00:00:00.000Z","custom_properties":{},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"metric.archived":{"post":{"summary":"metric.archived webhook","description":"A billable metric was archived","operationId":"webhook_metric_archived","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"metric.archived","metric_id":"bm_7n42DGM5Tflk9n8mt7Fhc7","name":"Api Calls","code":"api_calls","aggregation_type":"COUNT","created_at":"1970-01-01T00:00:00","product_family_id":"pf_7n42DGM5Tflk9n8mt7Fhc7","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"metric.created":{"post":{"summary":"metric.created webhook","description":"A new billable metric was created","operationId":"webhook_metric_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"metric.created","metric_id":"bm_7n42DGM5Tflk9n8mt7Fhc7","name":"Api Calls","code":"api_calls","aggregation_type":"COUNT","created_at":"1970-01-01T00:00:00","product_family_id":"pf_7n42DGM5Tflk9n8mt7Fhc7","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"metric.updated":{"post":{"summary":"metric.updated webhook","description":"A billable metric was updated","operationId":"webhook_metric_updated","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"metric.updated","metric_id":"bm_7n42DGM5Tflk9n8mt7Fhc7","name":"Api Calls","code":"api_calls","aggregation_type":"COUNT","created_at":"1970-01-01T00:00:00","product_family_id":"pf_7n42DGM5Tflk9n8mt7Fhc7","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"payment.failed":{"post":{"summary":"payment.failed webhook","description":"A payment attempt was declined or failed; no money moved","operationId":"webhook_payment_failed","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"payment.failed","transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","provider_transaction_id":"pi_3Q1abcDEF","amount":2500,"currency":"EUR","status":"FAILED","payment_type":"PAYMENT","error":"Your card has expired.","decline_kind":"CARD_EXPIRED","amount_refunded":0,"amount_reversed":0,"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"payment.reversed":{"post":{"summary":"payment.reversed webhook","description":"A settled payment was clawed back (chargeback, bank recall, lost dispute) and its invoice reopened","operationId":"webhook_payment_reversed","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"payment.reversed","transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","provider_transaction_id":"re_3Q1abcDEF","amount":2500,"currency":"EUR","status":"SETTLED","payment_type":"REFUND","processed_at":"1970-01-01T00:00:00.000Z","amount_refunded":0,"amount_reversed":0,"parent_transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","credit_note_id":"crn_7n42DGM5Tflk9n8mt7Fhc7","refund_mode":"ONLINE","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"plan.archived":{"post":{"summary":"plan.archived webhook","description":"A plan was archived","operationId":"webhook_plan_archived","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"plan.archived","plan_id":"plan_7n42DGM5Tflk9n8mt7Fhc7","name":"Enterprise Plan","description":"Our enterprise tier","plan_type":"STANDARD","status":"ACTIVE","currency":"USD","version":1,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"plan.created":{"post":{"summary":"plan.created webhook","description":"A new plan was created","operationId":"webhook_plan_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"plan.created","plan_id":"plan_7n42DGM5Tflk9n8mt7Fhc7","name":"Enterprise Plan","description":"Our enterprise tier","plan_type":"STANDARD","status":"ACTIVE","currency":"USD","version":1,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"plan.published":{"post":{"summary":"plan.published webhook","description":"A plan version was published","operationId":"webhook_plan_published","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"plan.published","plan_id":"plan_7n42DGM5Tflk9n8mt7Fhc7","name":"Enterprise Plan","description":"Our enterprise tier","plan_type":"STANDARD","status":"ACTIVE","currency":"USD","version":1,"created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"product.archived":{"post":{"summary":"product.archived webhook","description":"A product was archived","operationId":"webhook_product_archived","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"product.archived","product_id":"prd_7n42DGM5Tflk9n8mt7Fhc7","name":"API Calls Product","description":"Usage-based API calls product","fee_type":"USAGE","product_family_id":"pf_7n42DGM5Tflk9n8mt7Fhc7","created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"product.created":{"post":{"summary":"product.created webhook","description":"A new product was created","operationId":"webhook_product_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"product.created","product_id":"prd_7n42DGM5Tflk9n8mt7Fhc7","name":"API Calls Product","description":"Usage-based API calls product","fee_type":"USAGE","product_family_id":"pf_7n42DGM5Tflk9n8mt7Fhc7","created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"product.updated":{"post":{"summary":"product.updated webhook","description":"A product was updated","operationId":"webhook_product_updated","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"product.updated","product_id":"prd_7n42DGM5Tflk9n8mt7Fhc7","name":"API Calls Product","description":"Usage-based API calls product","fee_type":"USAGE","product_family_id":"pf_7n42DGM5Tflk9n8mt7Fhc7","created_at":"1970-01-01T00:00:00.000Z","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"quote.accepted":{"post":{"summary":"quote.accepted webhook","description":"A quote was accepted","operationId":"webhook_quote_accepted","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"quote.accepted","quote_id":"quo_7n42DGM5Tflk9n8mt7Fhc7","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"quote.converted":{"post":{"summary":"quote.converted webhook","description":"A quote was converted into subscription","operationId":"webhook_quote_converted","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"quote.converted","quote_id":"quo_7n42DGM5Tflk9n8mt7Fhc7","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"refund.failed":{"post":{"summary":"refund.failed webhook","description":"The payment provider refused the refund; no money moved","operationId":"webhook_refund_failed","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"refund.failed","transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","provider_transaction_id":"re_3Q1abcDEF","amount":2500,"currency":"EUR","status":"SETTLED","payment_type":"REFUND","processed_at":"1970-01-01T00:00:00.000Z","amount_refunded":0,"amount_reversed":0,"parent_transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","credit_note_id":"crn_7n42DGM5Tflk9n8mt7Fhc7","refund_mode":"ONLINE","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"refund.issued":{"post":{"summary":"refund.issued webhook","description":"A refund was created and is on its way to the payment provider","operationId":"webhook_refund_issued","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"refund.issued","transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","provider_transaction_id":"re_3Q1abcDEF","amount":2500,"currency":"EUR","status":"SETTLED","payment_type":"REFUND","processed_at":"1970-01-01T00:00:00.000Z","amount_refunded":0,"amount_reversed":0,"parent_transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","credit_note_id":"crn_7n42DGM5Tflk9n8mt7Fhc7","refund_mode":"ONLINE","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"refund.settled":{"post":{"summary":"refund.settled webhook","description":"A refund was paid back to the customer; the invoice keeps its amount due","operationId":"webhook_refund_settled","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"refund.settled","transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","invoice_id":"inv_7n42DGM5Tflk9n8mt7Fhc7","provider_transaction_id":"re_3Q1abcDEF","amount":2500,"currency":"EUR","status":"SETTLED","payment_type":"REFUND","processed_at":"1970-01-01T00:00:00.000Z","amount_refunded":0,"amount_reversed":0,"parent_transaction_id":"pay_7n42DGM5Tflk9n8mt7Fhc7","credit_note_id":"crn_7n42DGM5Tflk9n8mt7Fhc7","refund_mode":"ONLINE","timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"subscription.cancelled":{"post":{"summary":"subscription.cancelled webhook","description":"A subscription was cancelled (its cancellation took effect)","operationId":"webhook_subscription_cancelled","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"subscription.cancelled","subscription_id":"sub_7n42DGM5Tflk9n8mt7Fhc7","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","customer_alias":"ACME","customer_name":"Acme Corporation","billing_day_anchor":1,"currency":"EUR","start_date":"1970-01-01","plan_name":"default","version":0,"created_at":"1970-01-01T00:00:00.000Z","net_terms":0,"mrr_cents":0,"period":"MONTHLY","status":"PENDING_ACTIVATION","auto_advance_invoices":true,"charge_automatically":true,"custom_properties":{"pdp_external_status":"approved"},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"subscription.created":{"post":{"summary":"subscription.created webhook","description":"A new subscription was created","operationId":"webhook_subscription_created","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"subscription.created","subscription_id":"sub_7n42DGM5Tflk9n8mt7Fhc7","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","customer_alias":"ACME","customer_name":"Acme Corporation","billing_day_anchor":1,"currency":"EUR","start_date":"1970-01-01","plan_name":"default","version":0,"created_at":"1970-01-01T00:00:00.000Z","net_terms":0,"mrr_cents":0,"period":"MONTHLY","status":"PENDING_ACTIVATION","auto_advance_invoices":true,"charge_automatically":true,"custom_properties":{"pdp_external_status":"approved"},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"subscription.ended":{"post":{"summary":"subscription.ended webhook","description":"A subscription ended by reaching its fixed end date","operationId":"webhook_subscription_ended","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"subscription.ended","subscription_id":"sub_7n42DGM5Tflk9n8mt7Fhc7","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","customer_alias":"ACME","customer_name":"Acme Corporation","billing_day_anchor":1,"currency":"EUR","start_date":"1970-01-01","plan_name":"default","version":0,"created_at":"1970-01-01T00:00:00.000Z","net_terms":0,"mrr_cents":0,"period":"MONTHLY","status":"PENDING_ACTIVATION","auto_advance_invoices":true,"charge_automatically":true,"custom_properties":{"pdp_external_status":"approved"},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"subscription.updated":{"post":{"summary":"subscription.updated webhook","description":"A subscription was updated (plan change, amendment, seats, billing configuration, ...)","operationId":"webhook_subscription_updated","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEvent"},"example":{"id":"evt_7n42DGM5Tflk9n8mt7Fhc7","type":"subscription.updated","subscription_id":"sub_7n42DGM5Tflk9n8mt7Fhc7","customer_id":"cus_7n42DGM5Tflk9n8mt7Fhc7","customer_alias":"ACME","customer_name":"Acme Corporation","billing_day_anchor":1,"currency":"EUR","start_date":"1970-01-01","plan_name":"default","version":0,"created_at":"1970-01-01T00:00:00.000Z","net_terms":0,"mrr_cents":0,"period":"MONTHLY","status":"PENDING_ACTIVATION","auto_advance_invoices":true,"charge_automatically":true,"custom_properties":{"pdp_external_status":"approved"},"timestamp":"1970-01-01T00:00:00.000Z"}}}},"responses":{"200":{"description":"Webhook received successfully"}}}}}}