# Credyt for Platforms Preview Feature Credyt for Platforms is currently in preview. Please contact our [support team](mailto:support@credyt.ai) for access. ## Overview[​](#overview "Direct link to Overview") Credyt for Platforms (C4P) enables software platforms to embed Credyt's capabilities into their own products. Typical use-cases include: * Traditional invoice-native billing platforms looking to introduce real-time, usage-based billing and credit accounts * Commerce platforms wishing to introduce reward programs and store credit capabilities * Fintech platforms who need flexible wallet infrastructure to store and move value * Marketplaces with advanced money flows or a need to unify both open and closed-loop payments With C4P, each of your customers (or merchants) has a fully partitioned Credyt account with access to the capabilities you enable. Your customers can then create their own products, register their customers and bill them for usage, or interact with customer wallets directly. ## Integration[​](#integration "Direct link to Integration") ### Account Structure[​](#account-structure "Direct link to Account Structure") Your customers exist in C4P as a *Connected Account* under your main platform account. Connected Accounts are unique per environment, so you may safely test in isolation. Connected Accounts can optionally be configured with their own wallets under your platform's management account. This if often desirable if you wish to implement usage-based billing for your own customers. ### Security[​](#security "Direct link to Security") Integration between partners and Credyt is API-based. API access is secured using your platform's API key. The target connected account is specified via the `X-CREDYT-ACCOUNT` header. note At this stage we do not support API access directly from a connected account. Credyt API requests should always be initiated from your environment. Additionally you can access the Credyt Portal as the connected account for easy access to their account state and activity. ### Actors and their interaction[​](#actors-and-their-interaction "Direct link to Actors and their interaction") Activities that use Credyt typically involve the following actors: 1. Your Customer's Customer (referred to as the *End User* in this context) 2. Your Customer 3. Your Platform 4. Credyt Interaction between these actors is typically sequential making Credyt invisible to your customers and the end user. ### Example[​](#example "Direct link to Example") The following sequence of interactions would take place when the end-user performs a billable activity. 1. End user performs billable activity e.g. "Generate image" 2. Customer submits usage events to your platform 3. Your platform validates and identifies the customer 4. Your platform forwards usage events to Credyt 5. Credyt calculates any usage fees and debits the end user's wallet 6. Credyt may additionally send key events (such as low balance thresholds) to your platform via Webhook The complexity of your integration with Credyt will vary on how embedded our capabilities are into your existing products. In many cases it may be as simple as building a lightweight mapping and proxy layer between the two systems. ### Webhooks[​](#webhooks "Direct link to Webhooks") To receive notifications of key events and activities within your connected accounts, you can register a webhook endpoint that specifically receives C4P activity. The webhook payload will include the Connected Account's ID so that you can correlate to your customer and take the necessary action. This is the pattern typically used by billing providers to trigger automatic wallet top-ups in response to low threshold events: Balance Threshold webhook ```json { "id": "whe_48b9cet5d6h6vf2rwg4w3ezkw2", "account": "acc_4y7dxxqt8dzzpf4w58te001zxb", "event_type": "balance_threshold_hit", "occurred_at": "2026-01-07T13:19:18.265Z", "data": { "customer_id": "cust_4tqzchnwchbwf87m7g86pw0xmm", "account_id": "default:USD", "available": 9.24, "threshold": 10.0 } } ``` ## Quickstart[​](#quickstart "Direct link to Quickstart") ### Create a webhook for C4P[​](#create-a-webhook-for-c4p "Direct link to Create a webhook for C4P") Create a new webhook endpoint to receive events from your connected accounts: * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/webhooks ```json { "url": "https://integrations.tradbill.com/credyt/c4p", "connect": true } ``` **Response** ```json { "id": "whd_01abc123", "secret": "whsec_••••••", "created_at": "2026-04-14T10:00:00Z" } ``` ```typescript await client.webhooks.createWebhookDestination({ url: "https://integrations.tradbill.com/credyt/c4p", connect: true, }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/webhooksWebhooksCreateWebhookDestinationSample.ts#L11) **SDK response object** ```typescript const response = { id: "whd_01abc123", secret: "whsec_••••••", createdAt: "2026-04-14T10:00:00Z", }; ``` ```python response = client.webhooks.create_webhook_destination( body={ "url": "https://integrations.tradbill.com/credyt/c4p", "connect": True, }, ) ``` **SDK response object** ```python response = { "id": "whd_01abc123", "secret": "whsec_••••••", "created_at": "2026-04-14T10:00:00Z", } ``` ### Create a connected account[​](#create-a-connected-account "Direct link to Create a connected account") Before you customer can begin using Credyt's capabilities they must be set up as a connected account: * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/accounts ```json { "name": "BingoLingo", "external_id": "4bc6fbfc5493" } ``` **Response** ```json { "id": "acc_4tvras4k598tdb256atm8axemw" } ``` ```typescript await client.accounts.create({ name: "BingoLingo", externalId: "4bc6fbfc5493", }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/accountsCreateSample.ts#L11) **SDK response object** ```typescript const response = { id: "acc_4tvras4k598tdb256atm8axemw", }; ``` ```python response = client.accounts.create( body={ "name": "BingoLingo", "external_id": "4bc6fbfc5493", }, ) ``` [View full sample on GitHub](https://github.com/credyt/sdk-python/blob/main/samples/accounts_create_create_connected_account.py#L20) **SDK response object** ```python response = { "id": "acc_4tvras4k598tdb256atm8axemw", } ``` ### Create a customer (the end user)[​](#create-a-customer-the-end-user "Direct link to Create a customer (the end user)") Each of your customer's customers (the end user) should be created as a `customer` object under the connected account, by specifying the `X-CREDYT-ACCOUNT` header: * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/customers ```json { "name": "Francis Gutmann DDS", "external_id": "b7bac50a20bf44aa893bfd614d7631ae" } ``` **Response** ```json { "id": "cust_4s8epv6ej86aeep682pmcbhhm6", "subscriptions": [] } ``` ```typescript await client.customers.create({ name: "Francis Gutmann DDS", externalId: "b7bac50a20bf44aa893bfd614d7631ae", }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/customersCreateSample.ts#L11) **SDK response object** ```typescript const response = { id: "cust_4s8epv6ej86aeep682pmcbhhm6", subscriptions: [], }; ``` ```python response = client.customers.create( body={ "name": "Francis Gutmann DDS", "external_id": "b7bac50a20bf44aa893bfd614d7631ae", }, ) ``` [View full sample on GitHub](https://github.com/credyt/sdk-python/blob/main/samples/customers_create_create_end_user.py#L20) **SDK response object** ```python response = { "id": "cust_4s8epv6ej86aeep682pmcbhhm6", "subscriptions": [], } ``` ### Add credit to the end-user's wallet[​](#add-credit-to-the-end-users-wallet "Direct link to Add credit to the end-user's wallet") Suppose you're a billing platform and wish to credit the end-user's wallet each time a subscription payment is collected. This can be achieved by using the Wallet API: * REST API * TypeScript SDK * Python SDK POST https\://api.credyt.ai/customers/cust\_4s8epv6ej86aeep682pmcbhhm6/wallet/adjustments ```json { "transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "asset": "USD", "amount": 20, "reason": "external_topup", "metadata": { "payment_id": "4c81c0ff-d050-4e85-b111-13a7f3f251fa" } } ``` **Response** ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created_at": "2026-04-14T10:00:00Z" } ``` ```typescript await client.customerWalletOps.createAdjustment("cust_4s8epv6ej86aeep682pmcbhhm6", { transactionId: "3fa85f64-5717-4562-b3fc-2c963f66afa6", asset: "USD", amount: 20, reason: "external_topup", metadata: { paymentId: "4c81c0ff-d050-4e85-b111-13a7f3f251fa", }, }); ``` [View full sample on GitHub](https://github.com/credyt/sdk-ts/blob/main/samples/walletsCustomerWalletOpsCreateAdjustmentSample.ts#L23) **SDK response object** ```typescript const response = { id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", createdAt: "2026-04-14T10:00:00Z", }; ``` ```python response = client.customer_wallet_ops.create_adjustment( customer_id="cust_4s8epv6ej86aeep682pmcbhhm6", body={ "transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "asset": "USD", "amount": 20, "reason": "external_topup", "metadata": { "payment_id": "4c81c0ff-d050-4e85-b111-13a7f3f251fa", }, }, ) ``` **SDK response object** ```python response = { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created_at": "2026-04-14T10:00:00Z", } ``` ## Using other APIs[​](#using-other-apis "Direct link to Using other APIs") We invite you to explore the broader Credyt documentation for details on how to interact with Credyt on behalf of your customers. ## Restrictions[​](#restrictions "Direct link to Restrictions") The following capabilities are restricted or not yet supported. ### Direct API Access[​](#direct-api-access "Direct link to Direct API Access") It is not possible to create API keys for connected accounts. API access is only granted via your platform's API Keys and the specified `X-CREDYT-ACCOUNT` header. ### Webhooks[​](#webhooks-1 "Direct link to Webhooks") You can not create webhook endpoints for a specific connected account. You can however, create a webhook endpoint on your platform account that subscribes to connect account events, as described [here](#create-a-webhook-for-c4p). ### Top-ups[​](#top-ups "Direct link to Top-ups") Currently top-ups via our built-in Stripe integration are not supported on connected accounts. Instead platforms using C4P must implement payment processing themselves. If you require this functionality please [contact support](mailto:support@credyt.ai).