# Troubleshooting This guide covers some of the most common issues developers encounter when integrating with Credyt and how to troubleshoot them effectively. ### The customer is not billed for usage events[​](#the-customer-is-not-billed-for-usage-events "Direct link to The customer is not billed for usage events") If your customer isn't being billed after sending usage events, you should check the following: **1. Ensure you have subscribed your customer to the product** Credyt will accept any usage event for a customer, even if they are not subscribed to a corresponding product. This is to ensure your Credyt integration doesn't break as you generate new events from your system. To validate that the customer is subscribed to a product, [retrieve the customers details](https://docs.credyt.ai/api/customers-create.md) and inspect their `subscriptions`, for example: * REST API * TypeScript SDK * Python SDK GET https\://api.credyt.ai/customers/cust\_4qh0wajx2n9qtazh2tghzkyan2 ```http ``` **Response** ```json { "id": "cust_4qh0wajx2n9qtazh2tghzkyan2", "external_id": "951832085fee4033a2878f841a24149a", "name": "Joan Parker", "active_subscription_count": 1, "created_at": "2025-11-14T03:25:02.885Z", "external_accounts": [], "subscriptions": [ { "id": "sub_4t2fz8a57hje7fjazkrc08jg5n", "started_at": "2025-10-23T11:11:40.100Z", "status": "active", "products": [ { "id": "prp_4t2fz8a57hje7fjazkrc08jg5n", "code": "glitch_video_std", "version": 1 } ] } ] } ``` ```typescript await client.customers.get("cust_4qh0wajx2n9qtazh2tghzkyan2"); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/customersGetSample.ts#L11) **SDK response object** ```typescript const response = { id: "cust_4qh0wajx2n9qtazh2tghzkyan2", externalId: "951832085fee4033a2878f841a24149a", name: "Joan Parker", activeSubscriptionCount: 1, createdAt: "2025-11-14T03:25:02.885Z", externalAccounts: [], subscriptions: [ { id: "sub_4t2fz8a57hje7fjazkrc08jg5n", startedAt: "2025-10-23T11:11:40.100Z", status: "active", products: [ { id: "prp_4t2fz8a57hje7fjazkrc08jg5n", code: "glitch_video_std", version: 1, }, ], }, ], }; ``` ```python response = client.customers.get( customer_id="cust_4qh0wajx2n9qtazh2tghzkyan2", ) ``` [View full sample on GitHub](https://github.com/credyt/sdk-python/blob/main/samples/customers_get_get_a_customer.py#L20) **SDK response object** ```python response = { "id": "cust_4qh0wajx2n9qtazh2tghzkyan2", "external_id": "951832085fee4033a2878f841a24149a", "name": "Joan Parker", "active_subscription_count": 1, "created_at": "2025-11-14T03:25:02.885Z", "external_accounts": [], "subscriptions": [ { "id": "sub_4t2fz8a57hje7fjazkrc08jg5n", "started_at": "2025-10-23T11:11:40.100Z", "status": "active", "products": [ { "id": "prp_4t2fz8a57hje7fjazkrc08jg5n", "code": "glitch_video_std", "version": 1, }, ], }, ], } ``` If the customer is not subscribed to your desired product, a new subscription can be added via the Customers API. **2. Verify that the customer is subscribed to a product version that uses the same event\_type** Usage events don't directly reference a product or product version. Instead, billing is resolved based on the `event_type` field in the event payload. [Retrieve the customer's details](https://docs.credyt.ai/api/customers-create.md) to confirm the customer's active subscriptions and which product versions they are subscribed to. Then check the `event_type` configuration of the subscribed product versions. If no active subscription matches the event's `event_type`, the event won't be billed. **3. Check that the usage event matches the product configuration** Billing depends on event fields aligning with the product's usage configuration. To help troubleshoot, you can [retrieve a list of usage events](https://docs.credyt.ai/api/events-list.md) and provide the `customer_id` query parameter. For detailed information about each event, including the applicable fees and the product configuration it was matched against, [retrieve the specific event's details](https://docs.credyt.ai/api/events-get.md). Make sure: * The event's `event_type` matches what's defined in the product version. * The `customer_id` belongs to a customer with a valid subscription. * For volume-based pricing, confirm that your `usage_calculation` setup matches: * `usage_type` * `volume_field` * `billable_dimension` (if applicable) * Each event must include a unique `id` — duplicate event IDs are ignored to prevent double billing. tip Use the [Simulate Usage](https://docs.credyt.ai/api/products-simulate-usage.md) endpoint to test your pricing configuration in isolation. It accepts draft product versions and doesn't require a `customer_id`, making it ideal for testing your setup and troubleshooting configuration issues step by step. ### The customer balance is negative[​](#the-customer-balance-is-negative "Direct link to The customer balance is negative") A negative balance is an expected condition in Credyt. Credyt allows balances to go negative to ensure that ongoing or multi-step tasks aren't interrupted when end customer's funds are depleted mid-process. This approach prevents failed operations due to minor balance delays and provides a smoother end-user experience. You can check customer's balance at any time with `GET /customers/:customerId/wallet` Based on the balance information, you can decide whether to pause access to your product or prompt the customer to top up their wallet. Once the customer tops up their account, Credyt will automatically correct the negative balance by deducting the owed amount from the next deposit. ### The customer does not have any balances/accounts[​](#the-customer-does-not-have-any-balancesaccounts "Direct link to The customer does not have any balances/accounts") Customer wallets are created automatically when the customer is subscribed to a product or when a top-up is initiated. To ensure wallets are correctly set up, it's important that customers are subscribed to the relevant products when they are created - this helps avoid any misconfigurations. ### Billing Portal link has expired[​](#billing-portal-link-has-expired "Direct link to Billing Portal link has expired") When a Billing Portal link expires, Credyt automatically redirects the customer to the `return_url` you provided when generating the link. To keep the experience seamless, you can: 1. Listen for this redirect event at your `return_url`. 2. Automatically request a new Billing Portal link from Credyt using your backend logic. 3. Redirect the customer back to the refreshed link without manual intervention. This ensures that customers always have uninterrupted access to their Billing Portal, even when older links expire. ### Stripe Tax is not calculated at Checkout[​](#stripe-tax-is-not-calculated-at-checkout "Direct link to Stripe Tax is not calculated at Checkout") If you don't see Stripe Tax applied during checkout, it's usually because Stripe Tax needs to be explicitly activated on the connected Stripe account used for processing payments. Additionally, for tax calculation to work correctly, the customer's country of residence submitted during checkout must be configured for tax collection in Stripe Tax. When testing with Credyt's built-in Stripe account, setting the customer's country to the **United Kingdom (UK)** allows you to observe how tax behaves during checkout and in the top-up history. If you'd like to connect and test with your own Stripe test account, please reach out to us at for assistance.