Skip to main content

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

API Reference

Before you can subscribe your customers, you need to create products with fixed fee prices. Products are created via the Products API.

Example

In this example we create a new product glitch_pro that costs $20.00/month and requires payment upfront.

POST https://api.credyt.ai/products
{
"name": "Glitch Pro Subscription",
"code": "glitch_pro",
"prices": [
{
"name": "Monthly Subscription",
"type": "fixed",
"billing_model": {
"type": "recurring",
"recurring": {
"interval": "month"
}
},
"pricing": [
{
"asset": "USD",
"values": [
{
"unit_price": 20.0
}
]
}
]
}
],
"publish": true
}

Subscribing Customers

API Reference

Once you've created your fixed fee product, you can subscribe customers by referencing this product code when creating the customer:

POST https://api.credyt.ai/customers
{
"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"
}
]
}
]
}
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.

Response:

{
"id": "cust_473cr1y0ghbyc3m1yfbwvn3nxx",
"subscriptions": [
{
"id": "sub_411xhg4kqakf3d8ybezbzta558",
"status": "pending",
"products": [
{
"id": "prp_4e28n8kk41931f5yt5em49ecw7",
"code": "glitch_pro",
"version": "default"
}
],
"required_actions": [
{
"type": "payment",
"redirect_url": "https://billing.credyt.ai/api/..."
}
]
}
]
}

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 where your customer will be prompted to complete payment.

Webhook Notifications

To receive a notification when the customer has completed the required actions, subscribe to the subscription.activated webhook.