- ListPlans - List all billing plans
- ListPrices - List all billing prices
- CreatePrice - Create a custom billing price
- ListSubscriptionItems - List all subscription items
- CancelSubscriptionItem - Cancel a subscription item
- ExtendSubscriptionItemFreeTrial - Extend free trial for a subscription item
- CreatePriceTransition - Create a price transition for a subscription item
- ListStatements - List all billing statements
- GetStatement - Retrieve a billing statement
- GetStatementPaymentAttempts - List payment attempts for a billing statement
Returns a list of all billing plans for the instance. The plans are returned sorted by creation date, with the newest plans appearing first. This includes both free and paid plans. Pagination is supported.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.ListPlansAsync(
limit: 20,
offset: 10
);
// handle response| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Paginated |
bool | ➖ | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. |
|
Limit |
long | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset. |
20 |
Offset |
long | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit. |
10 |
PayerType |
PayerType | ➖ | Filter plans by payer type |
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Returns a list of all prices for the instance. The prices are returned sorted by amount ascending, then by creation date descending. This includes both default and custom prices. Pagination is supported.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.ListPricesAsync(
limit: 20,
offset: 10
);
// handle response| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Paginated |
bool | ➖ | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. |
|
Limit |
long | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset. |
20 |
Offset |
long | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit. |
10 |
PlanId |
string | ➖ | Filter prices by plan ID |
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Creates a custom price for a billing plan. Custom prices allow you to offer different pricing to specific customers while maintaining the same plan structure.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
CreateBillingPriceRequest req = new CreateBillingPriceRequest() {
PlanId = "<id>",
Amount = 826545,
};
var res = await sdk.Billing.CreatePriceAsync(req);
// handle response| Parameter | Type | Required | Description |
|---|---|---|---|
request |
CreateBillingPriceRequest | ✔️ | The request object to use for the request. |
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Returns a list of all subscription items for the instance. The subscription items are returned sorted by creation date, with the newest appearing first. This includes subscriptions for both users and organizations. Pagination is supported.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
using Clerk.BackendAPI.Models.Operations;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
GetCommerceSubscriptionItemListRequest req = new GetCommerceSubscriptionItemListRequest() {
Limit = 20,
Offset = 10,
};
var res = await sdk.Billing.ListSubscriptionItemsAsync(req);
// handle response| Parameter | Type | Required | Description |
|---|---|---|---|
request |
GetCommerceSubscriptionItemListRequest | ✔️ | The request object to use for the request. |
GetCommerceSubscriptionItemListResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Cancel a specific subscription item. The subscription item can be canceled immediately or at the end of the current billing period.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.CancelSubscriptionItemAsync(
subscriptionItemId: "<id>",
endNow: false
);
// handle response| Parameter | Type | Required | Description |
|---|---|---|---|
SubscriptionItemId |
string | ✔️ | The ID of the subscription item to cancel |
EndNow |
bool | ➖ | Whether to cancel the subscription immediately (true) or at the end of the current billing period (false, default) |
CancelCommerceSubscriptionItemResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 403, 404, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Extends the free trial period for a specific subscription item to the specified timestamp. The subscription item must be currently in a free trial period, and the plan must support free trials. The timestamp must be in the future and not more than 365 days from the end of the current trial period This operation is idempotent - repeated requests with the same timestamp will not change the trial period.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
using System;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.ExtendSubscriptionItemFreeTrialAsync(
subscriptionItemId: "<id>",
extendFreeTrialRequest: new ExtendFreeTrialRequest() {
ExtendTo = System.DateTime.Parse("2026-01-08T00:00:00Z"),
}
);
// handle response| Parameter | Type | Required | Description |
|---|---|---|---|
SubscriptionItemId |
string | ✔️ | The ID of the subscription item to extend the free trial for |
ExtendFreeTrialRequest |
ExtendFreeTrialRequest | ✔️ | Parameters for extending the free trial |
ExtendBillingSubscriptionItemFreeTrialResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 403, 404, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Creates a price transition for the specified subscription item. This may create an upcoming subscription item or activate immediately depending on plan and payer rules.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.CreatePriceTransitionAsync(
subscriptionItemId: "<id>",
priceTransitionRequest: new PriceTransitionRequest() {
FromPriceId = "<id>",
ToPriceId = "<id>",
}
);
// handle response| Parameter | Type | Required | Description |
|---|---|---|---|
SubscriptionItemId |
string | ✔️ | The ID of the subscription item to transition |
PriceTransitionRequest |
PriceTransitionRequest | ✔️ | Parameters for the price transition |
CreateBillingPriceTransitionResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 403, 404, 409, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Returns a list of all billing statements for the instance. The statements are returned sorted by creation date, with the newest statements appearing first. Pagination is supported.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.ListStatementsAsync(
limit: 20,
offset: 10
);
// handle response| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Paginated |
bool | ➖ | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. |
|
Limit |
long | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset. |
20 |
Offset |
long | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit. |
10 |
GetBillingStatementListResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Retrieves the details of a billing statement.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.GetStatementAsync(statementID: "<id>");
// handle response| Parameter | Type | Required | Description |
|---|---|---|---|
StatementID |
string | ✔️ | The ID of the statement to retrieve. |
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |
Returns a list of all payment attempts for a specific billing statement. The payment attempts are returned sorted by creation date, with the newest payment attempts appearing first. Pagination is supported.
using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Components;
var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");
var res = await sdk.Billing.GetStatementPaymentAttemptsAsync(
statementID: "<id>",
limit: 20,
offset: 10
);
// handle response| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
StatementID |
string | ✔️ | The ID of the statement to retrieve payment attempts for. | |
Paginated |
bool | ➖ | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. |
|
Limit |
long | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset. |
20 |
Offset |
long | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit. |
10 |
GetBillingStatementPaymentAttemptsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 400, 401, 404, 422 | application/json |
| Clerk.BackendAPI.Models.Errors.ClerkErrors | 500 | application/json |
| Clerk.BackendAPI.Models.Errors.SDKError | 4XX, 5XX | */* |