# Recurring Fixed Fee Pricing With Recurring Fixed Fee Pricing you can charge your customers a fixed rate for access to your products or services on a recurring basis. This is ideal for SaaS products with tiered plans, monthly memberships, or any service with predictable recurring charges. When you subscribe a customer to a product with fixed fee pricing, Credyt automatically handles the billing cycle, invoicing, and payment collection according to the configuration you specify. ## Creating a Monthly Fixed Fee Product[​](#creating-a-monthly-fixed-fee-product "Direct link to Creating a Monthly Fixed Fee Product") [API Reference](https://docs.credyt.ai/api/products-create.md) Before you can subscribe your customers, you need to create products with fixed fee prices. Products are created via the Products API. ### Example[​](#example "Direct link to Example") In this example we create a new product `glitch_pro` that costs $20.00/month and requires payment upfront. * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/products ```json { "name": "Glitch Pro Subscription", "code": "glitch_pro", "prices": [ { "id": "prc_4asvwjbgbypk6d9z3xp95ttrc8", "name": "Monthly Subscription", "type": "fixed", "billing_model": { "type": "recurring", "recurring": { "interval": "month" } }, "pricing": [ { "asset": "USD", "values": [ { "unit_price": 20 } ] } ] } ], "publish": true } ``` **Response** ```json { "id": "prp_4e28n8kk41931f5yt5em49ecw7", "code": "glitch_pro", "version": 1, "status": "published", "is_default": true } ``` ```typescript await client.products.create({ name: "Glitch Pro Subscription", code: "glitch_pro", prices: [ { id: "prc_4asvwjbgbypk6d9z3xp95ttrc8", name: "Monthly Subscription", type: "fixed", billingModel: { type: "recurring", recurring: { interval: "month", }, }, pricing: [ { asset: "USD", values: [ { unitPrice: 20, }, ], }, ], }, ], publish: true, }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/productsCreateSample.ts#L160) **SDK response object** ```typescript const response = { id: "prp_4e28n8kk41931f5yt5em49ecw7", code: "glitch_pro", version: 1, status: "published", isDefault: true, }; ``` ```python response = client.products.create( body={ "name": "Glitch Pro Subscription", "code": "glitch_pro", "prices": [ { "id": "prc_4asvwjbgbypk6d9z3xp95ttrc8", "name": "Monthly Subscription", "type": "fixed", "billing_model": { "type": "recurring", "recurring": { "interval": "month", }, }, "pricing": [ { "asset": "USD", "values": [ { "unit_price": 20, }, ], }, ], }, ], "publish": True, }, ) ``` [View full sample on GitHub](https://github.com/credyt/sdk-python/blob/main/samples/products_create_monthly_fixed_fee.py#L20) **SDK response object** ```python response = { "id": "prp_4e28n8kk41931f5yt5em49ecw7", "code": "glitch_pro", "version": 1, "status": "published", "is_default": True, } ``` ## Subscribing Customers[​](#subscribing-customers "Direct link to Subscribing Customers") [API Reference](https://docs.credyt.ai/api/customers-create.md) Once you've created your fixed fee product, you can subscribe customers by referencing this product code when creating the customer: * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/customers ```json { "name": "John Doe", "external_id": "18991", "email": "j.doe@gmail.com", "subscriptions": [ { "return_url": "https://glitch.ai/account", "failure_url": "https://glitch.ai/callbacks/credyt/failure", "products": [ { "code": "glitch_pro" } ] } ] } ``` **Response** ```json { "id": "cust_473cr1y0ghbyc3m1yfbwvn3nxx", "subscriptions": [ { "id": "sub_411xhg4kqakf3d8ybezbzta558", "status": "action_required", "products": [ { "id": "prp_4e28n8kk41931f5yt5em49ecw7", "code": "glitch_pro", "version": "default", "status": "action_required" } ], "required_actions": [ { "type": "payment", "redirect_url": "https://billing.credyt.ai/api/sign-in?token=xyz" } ] } ] } ``` ```typescript await client.customers.create({ name: "John Doe", externalId: "18991", email: "j.doe@gmail.com", subscriptions: [ { returnUrl: "https://glitch.ai/account", failureUrl: "https://glitch.ai/callbacks/credyt/failure", products: [ { code: "glitch_pro", }, ], }, ], }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/customersCreateSample.ts#L88) **SDK response object** ```typescript const response = { id: "cust_473cr1y0ghbyc3m1yfbwvn3nxx", subscriptions: [ { id: "sub_411xhg4kqakf3d8ybezbzta558", status: "action_required", products: [ { id: "prp_4e28n8kk41931f5yt5em49ecw7", code: "glitch_pro", version: "default", status: "action_required", }, ], requiredActions: [ { type: "payment", redirectUrl: "https://billing.credyt.ai/api/sign-in?token=xyz", }, ], }, ], }; ``` ```python response = client.customers.create( body={ "name": "John Doe", "external_id": "18991", "email": "j.doe@gmail.com", "subscriptions": [ { "return_url": "https://glitch.ai/account", "failure_url": "https://glitch.ai/callbacks/credyt/failure", "products": [ { "code": "glitch_pro", }, ], }, ], }, ) ``` [View full sample on GitHub](https://github.com/credyt/sdk-python/blob/main/samples/customers_create_subscribe_to_glitch_pro.py#L20) **SDK response object** ```python response = { "id": "cust_473cr1y0ghbyc3m1yfbwvn3nxx", "subscriptions": [ { "id": "sub_411xhg4kqakf3d8ybezbzta558", "status": "action_required", "products": [ { "id": "prp_4e28n8kk41931f5yt5em49ecw7", "code": "glitch_pro", "version": "default", "status": "action_required", }, ], "required_actions": [ { "type": "payment", "redirect_url": "https://billing.credyt.ai/api/sign-in?token=xyz", }, ], }, ], } ``` Return and Failure URLs When adding a customer to a paid recurring subscription product, a link is provided for the customer to enter their card details. You specify both the URL the customer should return to when exiting the portal (`return_url`) and the failure URL (`failure_url`) we will redirect them to if their session expires or there are any issues. You can find more about failure handling [here](https://docs.credyt.ai/features/billing-portal.md). When a subscription requires further action before it can be activated, such as collecting an initial payment, its status will be set to `action_required` and it will contain one or more actions in the `required_actions` array. When payment is required there will be a required action of `type: payment` with a corresponding `redirect_url` you should redirect your customer to. If the subscription starts in the future, then a required action of `type: payment_method` is returned with a `redirect_url` to collect the customer's card details. This will typically be a link to the [Billing Portal](https://docs.credyt.ai/features/billing-portal.md) where your customer will be prompted to complete payment. ## Webhook Notifications[​](#webhook-notifications "Direct link to Webhook Notifications") To receive a notification when the customer has completed the required actions, subscribe to the `subscription.activated` webhook.