# Locai Billing Service Docs ## Docs - [Create a new addon](https://billing-docs.platform.ai71services.ai/billing-api-reference/addon/create-a-new-addon.md) - [Deactivate an addon and stop auto-renewal](https://billing-docs.platform.ai71services.ai/billing-api-reference/addon/deactivate-an-addon-and-stop-auto-renewal.md) - [Get a single addon by ID](https://billing-docs.platform.ai71services.ai/billing-api-reference/addon/get-a-single-addon-by-id.md) - [Get all addons](https://billing-docs.platform.ai71services.ai/billing-api-reference/addon/get-all-addons.md) - [Update an addon](https://billing-docs.platform.ai71services.ai/billing-api-reference/addon/update-an-addon.md) - [Create new billable metric](https://billing-docs.platform.ai71services.ai/billing-api-reference/billable-metric/create-new-billable-metric.md) - [Get All Billable Metrics](https://billing-docs.platform.ai71services.ai/billing-api-reference/billable-metric/get-all-billable-metrics.md) - [Get Billable Metric by Code](https://billing-docs.platform.ai71services.ai/billing-api-reference/billable-metric/get-billable-metric-by-code.md) - [Update billable metric](https://billing-docs.platform.ai71services.ai/billing-api-reference/billable-metric/update-billable-metric.md) - [Create billing config](https://billing-docs.platform.ai71services.ai/billing-api-reference/billing-configs/create-billing-config.md): Create a new billing config with the provided details. Note: This endpoint is restricted for internal use only. - [Delete billing config](https://billing-docs.platform.ai71services.ai/billing-api-reference/billing-configs/delete-billing-config.md) - [Get all billing configs](https://billing-docs.platform.ai71services.ai/billing-api-reference/billing-configs/get-all-billing-configs.md) - [Get billing config by category](https://billing-docs.platform.ai71services.ai/billing-api-reference/billing-configs/get-billing-config-by-category.md) - [Get billing config by ID](https://billing-docs.platform.ai71services.ai/billing-api-reference/billing-configs/get-billing-config-by-id.md) - [Update billing config](https://billing-docs.platform.ai71services.ai/billing-api-reference/billing-configs/update-billing-config.md): Updates a billing config with the provided details. Note: This endpoint is restricted for internal use only. - [Create a new charge](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/create-a-new-charge.md) - [Delete a charge and its associated billable metric](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/delete-a-charge-and-its-associated-billable-metric.md) - [Get a charge by ID](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/get-a-charge-by-id.md) - [Get a charge by its code](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/get-a-charge-by-its-code.md) - [Get all charges](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/get-all-charges.md) - [Get all charges available for a plan](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/get-all-charges-available-for-a-plan.md) - [Get all charges for a specific entitlement](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/get-all-charges-for-a-specific-entitlement.md) - [Update a charge](https://billing-docs.platform.ai71services.ai/billing-api-reference/charges/update-a-charge.md) - [Check the health status of the service](https://billing-docs.platform.ai71services.ai/billing-api-reference/check-the-health-status-of-the-service.md) - [Get customer by external customer ID](https://billing-docs.platform.ai71services.ai/billing-api-reference/customers/get-customer-by-external-customer-id.md): Retrieves customer information using their external ID (org ID) - [Get customer current usage](https://billing-docs.platform.ai71services.ai/billing-api-reference/customers/get-customer-current-usage.md): Retrieves the current usage for the authenticated customer - [Check user entitlement status](https://billing-docs.platform.ai71services.ai/billing-api-reference/entitlements/check-user-entitlement-status.md) - [Get usage and quota for a subscription and entitlement](https://billing-docs.platform.ai71services.ai/billing-api-reference/entitlements/get-usage-and-quota-for-a-subscription-and-entitlement.md) - [Report entitlement usage](https://billing-docs.platform.ai71services.ai/billing-api-reference/entitlements/report-entitlement-usage.md) - [Create invoice template](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoice-templates/create-invoice-template.md): Creates a new invoice template with specified layout and components. - Validates required fields and component structure - Ensures unique template names - Optionally sets as default template Requires admin access. - [Delete template](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoice-templates/delete-template.md): Deletes an invoice template. Cannot delete the default template. - [Get default template](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoice-templates/get-default-template.md): Retrieves the currently set default invoice template - [Get template by ID](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoice-templates/get-template-by-id.md): Retrieves a specific invoice template by its unique identifier - [List all invoice templates](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoice-templates/list-all-invoice-templates.md): Retrieves all available invoice templates. Requires admin access. - [Preview template](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoice-templates/preview-template.md): Generates a preview of an invoice template with customizable data. - Uses template ID to get layout and components - Accepts optional preview data to customize all aspects of the preview - Returns PDF buffer of preview invoice - [Update template](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoice-templates/update-template.md): Updates an existing invoice template. - [Create new invoice](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoices/create-new-invoice.md): Create a new invoice for the authenticated customer. - [Finalize invoice](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoices/finalize-invoice.md): Finalize an invoice, making it ready for payment. - [Generate PDF for invoice](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoices/generate-pdf-for-invoice.md): Generate and download a PDF version of the specified invoice. - [Get customer invoices](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoices/get-customer-invoices.md): Retrieve all invoices for the authenticated customer. - [Get invoice by ID](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoices/get-invoice-by-id.md): Retrieve details of a specific invoice. - [Update invoice](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoices/update-invoice.md): Update an existing invoice. Only draft invoices can be updated. - [Void invoice](https://billing-docs.platform.ai71services.ai/billing-api-reference/invoices/void-invoice.md): Void an existing invoice, marking it as cancelled. - [Create a new notification config](https://billing-docs.platform.ai71services.ai/billing-api-reference/notification-configs/create-a-new-notification-config.md): Create a new notification config with the provided details. Note: This endpoint is restricted for internal use only. - [Delete notification config](https://billing-docs.platform.ai71services.ai/billing-api-reference/notification-configs/delete-notification-config.md) - [Get all notification configs](https://billing-docs.platform.ai71services.ai/billing-api-reference/notification-configs/get-all-notification-configs.md) - [Get notification config by ID](https://billing-docs.platform.ai71services.ai/billing-api-reference/notification-configs/get-notification-config-by-id.md) - [Update notification config](https://billing-docs.platform.ai71services.ai/billing-api-reference/notification-configs/update-notification-config.md): Updates a notification config with the provided details. Note: This endpoint is restricted for internal use only. - [Create a payment intent](https://billing-docs.platform.ai71services.ai/billing-api-reference/payments/create-a-payment-intent.md) - [Handle payment callback](https://billing-docs.platform.ai71services.ai/billing-api-reference/payments/handle-payment-callback.md) - [Retrieve payment intent](https://billing-docs.platform.ai71services.ai/billing-api-reference/payments/retrieve-payment-intent.md) - [Add an entitlement to a plan](https://billing-docs.platform.ai71services.ai/billing-api-reference/plans/add-an-entitlement-to-a-plan.md): Add an entitlement to a plan with the provided details. Note: This endpoint is restricted for internal use only. - [Create a new plan](https://billing-docs.platform.ai71services.ai/billing-api-reference/plans/create-a-new-plan.md): Create a new plan with the provided details. Note: This endpoint is restricted for internal use only. - [Delete a plan](https://billing-docs.platform.ai71services.ai/billing-api-reference/plans/delete-a-plan.md): Delete a plan with the provided code. Note: This endpoint is restricted for internal use only. Cannot delete plans with active subscriptions. - [Get a specific plan by Code](https://billing-docs.platform.ai71services.ai/billing-api-reference/plans/get-a-specific-plan-by-code.md) - [Get all plans](https://billing-docs.platform.ai71services.ai/billing-api-reference/plans/get-all-plans.md) - [Add seats to the current subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/add-seats-to-the-current-subscription.md) - [Create a new subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/create-a-new-subscription.md): Creates a new subscription for a customer. Requires authentication and admin privileges if organization ID is present. - [Delete a subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/delete-a-subscription.md) - [Get all addons for the current subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/get-all-addons-for-the-current-subscription.md): Returns list of addons purchased for the current subscription - [Get all subscriptions](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/get-all-subscriptions.md): Retrieves all subscriptions in the system. Admin access only. - [Get compatible addons for current subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/get-compatible-addons-for-current-subscription.md): Returns list of addons that can be purchased for the current subscription - [Get current subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/get-current-subscription.md): Retrieves the current active subscription for the authenticated user - [Get the number of seats for the current subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/get-the-number-of-seats-for-the-current-subscription.md) - [Report subscription usage](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/report-subscription-usage.md) - [Terminate subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/terminate-subscription.md): Terminates the current active subscription. Requires authentication and admin privileges if organization ID is present. - [Update subscription](https://billing-docs.platform.ai71services.ai/billing-api-reference/subscriptions/update-subscription.md): Updates an existing subscription. Requires authentication and admin privileges if organization ID is present. - [Admins add metering limit for any user](https://billing-docs.platform.ai71services.ai/billing-api-reference/user-configs/admins-add-metering-limit-for-any-user.md) - [Admins delete metering limit for any user](https://billing-docs.platform.ai71services.ai/billing-api-reference/user-configs/admins-delete-metering-limit-for-any-user.md) - [Admins update metering limit for any user](https://billing-docs.platform.ai71services.ai/billing-api-reference/user-configs/admins-update-metering-limit-for-any-user.md) - [Authenticated user add metering limit for any user](https://billing-docs.platform.ai71services.ai/billing-api-reference/user-configs/authenticated-user-add-metering-limit-for-any-user.md) - [Authenticated user update metering limit for any user](https://billing-docs.platform.ai71services.ai/billing-api-reference/user-configs/authenticated-user-update-metering-limit-for-any-user.md) - [Check the health status of the service](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/check-the-health-status-of-the-service.md) - [Create a new entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/entitlements/create-a-new-entitlement.md): Creates a new entitlement definition - [Delete an entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/entitlements/delete-an-entitlement.md): Removes an entitlement definition - [Find entitlement by code](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/entitlements/find-entitlement-by-code.md): Retrieves a specific entitlement by its code - [Get a single entitlement by ID](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/entitlements/get-a-single-entitlement-by-id.md): Retrieves a specific entitlement by its ID - [Get all entitlements](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/entitlements/get-all-entitlements.md): Retrieves all entitlement definitions - [Update an entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/entitlements/update-an-entitlement.md): Updates an existing entitlement definition - [Create a new plan entitlement quota](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/plan-entitlement-quotas/create-a-new-plan-entitlement-quota.md): Creates a new quota for a specific plan and entitlement combination - [Delete a plan entitlement quota](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/plan-entitlement-quotas/delete-a-plan-entitlement-quota.md): Removes a plan entitlement quota and its associated data - [Get a specific plan entitlement quota](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/plan-entitlement-quotas/get-a-specific-plan-entitlement-quota.md): Retrieves a specific plan entitlement quota by its ID - [Get all plan entitlement quotas](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/plan-entitlement-quotas/get-all-plan-entitlement-quotas.md): Retrieves all plan entitlement quotas with their associated entitlements - [Get plan entitlement quotas by plan ID and optional entitlement code](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/plan-entitlement-quotas/get-plan-entitlement-quotas-by-plan-id-and-optional-entitlement-code.md): Retrieves quotas for a specific plan, optionally filtered by entitlement code - [Update a plan entitlement quota](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/plan-entitlement-quotas/update-a-plan-entitlement-quota.md): Updates an existing plan entitlement quota with new values - [Check if an entitlement is entitled to a given usage](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/check-if-an-entitlement-is-entitled-to-a-given-usage.md) - [Create a subscription entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/create-a-subscription-entitlement.md): Creates a new entitlement for a subscription - [Get all entitlements for a subscription](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/get-all-entitlements-for-a-subscription.md): Retrieves all entitlements associated with a subscription - [Get status of an entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/get-status-of-an-entitlement.md): Retrieves detailed status information for a specific entitlement - [Get usage info for an entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/get-usage-info-for-an-entitlement.md): Retrieves current usage information for a specific entitlement - [Initialize subscription entitlements from plan](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/initialize-subscription-entitlements-from-plan.md): Creates entitlements for a subscription based on the plan configuration - [Remove an entitlement from a subscription](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/remove-an-entitlement-from-a-subscription.md): Deletes an entitlement from a subscription - [Report usage for an entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/report-usage-for-an-entitlement.md): Updates the usage count for a specific entitlement - [Update quota for an entitlement](https://billing-docs.platform.ai71services.ai/entitlements-api-reference/subscription-entitlements/update-quota-for-an-entitlement.md): Updates the quota limit for a specific entitlement - [Features](https://billing-docs.platform.ai71services.ai/introduction.md) - [BillingLayout](https://billing-docs.platform.ai71services.ai/sdk/components/BillingLayout.md) - [BillingModal](https://billing-docs.platform.ai71services.ai/sdk/components/BillingModal.md) - [ContactModal](https://billing-docs.platform.ai71services.ai/sdk/components/ContactModal.md) - [EmbeddedCheckoutForm](https://billing-docs.platform.ai71services.ai/sdk/components/EmbeddedCheckoutForm.md) - [EntitlementUsageLimitModal](https://billing-docs.platform.ai71services.ai/sdk/components/EntitlementUsageLimitModal.md) - [ManageBilling](https://billing-docs.platform.ai71services.ai/sdk/components/ManageBilling.md) - [ManagePlans](https://billing-docs.platform.ai71services.ai/sdk/components/ManagePlans.md) - [Payment](https://billing-docs.platform.ai71services.ai/sdk/components/Payment.md) - [PricingTable](https://billing-docs.platform.ai71services.ai/sdk/components/PricingTable.md) - [SuccessModal](https://billing-docs.platform.ai71services.ai/sdk/components/SuccessModal.md) - [UpgradeModal](https://billing-docs.platform.ai71services.ai/sdk/components/UpgradeModal.md) - [useBillingContext](https://billing-docs.platform.ai71services.ai/sdk/hooks/useBillingContext.md) - [useBillingPlans](https://billing-docs.platform.ai71services.ai/sdk/hooks/useBillingPlans.md) - [useCreatePaymentIntent](https://billing-docs.platform.ai71services.ai/sdk/hooks/useCreatePaymentIntent.md) - [useCreateSubscription](https://billing-docs.platform.ai71services.ai/sdk/hooks/useCreateSubscription.md) - [useIsUserEntitledTo](https://billing-docs.platform.ai71services.ai/sdk/hooks/useIsUserEntitledTo.md) - [useSendEmail](https://billing-docs.platform.ai71services.ai/sdk/hooks/useSendEmail.md) - [useSubscription](https://billing-docs.platform.ai71services.ai/sdk/hooks/useSubscription.md) - [useUpdateSubscription](https://billing-docs.platform.ai71services.ai/sdk/hooks/useUpdateSubscription.md) - [Introduction](https://billing-docs.platform.ai71services.ai/sdk/intro.md) - [Quickstart](https://billing-docs.platform.ai71services.ai/sdk/quickstart.md) - [Initial Setup](https://billing-docs.platform.ai71services.ai/sdk/setup.md) - [SDK Usage Guide](https://billing-docs.platform.ai71services.ai/sdk/usage.md) - [Authentication and Plans](https://billing-docs.platform.ai71services.ai/tutorials/authentication-and-plans.md): Learn how to authenticate and retrieve billing plans - [Entitlements Usage](https://billing-docs.platform.ai71services.ai/tutorials/entitlements-usage.md) - [Introduction to Billing Service](https://billing-docs.platform.ai71services.ai/tutorials/introduction.md) - [Payment Flow with Stripe](https://billing-docs.platform.ai71services.ai/tutorials/payment-flow.md): Learn how to implement the payment flow using Stripe - [Setup Integration](https://billing-docs.platform.ai71services.ai/tutorials/setup-integration.md) ## OpenAPI Specs - [billing_api_docs](https://billing-docs.platform.ai71services.ai/specs/billing_api_docs.json) - [entitlements_api_docs](https://billing-docs.platform.ai71services.ai/specs/entitlements_api_docs.json) - [openapi](https://billing-docs.platform.ai71services.ai/api-reference/openapi.json) ## Optional - [Slack](https://locai-workspace.slack.com/archives/C07HH8ERYHG) - [Contribute](https://github.com/LocAI1/Billing/pulls) - [Feature Request / Issues](https://github.com/LocAI1/Billing/issues)