Knox Docs Sign in

API reference

Test mode. Use your secret key on your server; live processing is currently disabled.

https://api.knoxapi.com

Send form-encoded requests with Authorization: Bearer sk_test_....

Complete OpenAPI specification · Integration guide

Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.

GET /v1/subscription_schedules

List all schedules

Retrieves the list of your subscription schedules.

Request parameters

ParameterLocationTypeDescription
canceled_atqueryone of multiple schemasOnly return subscription schedules that were created canceled the given date interval.
completed_atqueryone of multiple schemasOnly return subscription schedules that completed during the given date interval.
createdqueryone of multiple schemasOnly return subscription schedules that were created during the given date interval.
customerquerystringOnly return subscription schedules for the given customer. The response will not include subscription schedules for customers with a test clock attached if this parameter is not set.
customer_accountquerystringOnly return subscription schedules for the given account.
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
released_atqueryone of multiple schemasOnly return subscription schedules that were released during the given date interval.
scheduledquerybooleanOnly return subscription schedules that have not started yet.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of subscription_schedule
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/subscription_schedules

Create a schedule

Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.

Request parameters

FieldTypeDescription
billing_modeobjectControls how prorations and invoices for subscriptions are calculated and orchestrated.
customerstringThe identifier of the customer to create the subscription schedule for.
customer_accountstringThe identifier of the account to create the subscription schedule for.
default_settingsobjectObject representing the subscription schedule's default settings.
end_behaviorstringBehavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
expandarray of stringSpecifies which fields in the response should be expanded.
from_subscriptionstringMigrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
phasesarray of objectList representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
start_dateone of multiple schemasWhen the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately, and to avoid unexpected behavior due to request delays or clock skew resulting in a slightly backdated or postdated start. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the schedule.
billing_mode requiredsubscriptions_resource_billing_mode
canceled_atintegerTime at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
completed_atintegerTime at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
current_phaseone of multiple schemasObject representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
customer requiredone of multiple schemasID of the customer who owns the subscription schedule.
customer_accountstringID of the account who owns the subscription schedule.
default_settings requiredsubscription_schedules_resource_default_settings
end_behavior requiredstringBehavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
phases requiredarray of subscription_schedule_phase_configurationConfiguration for the subscription schedule's phases.
released_atintegerTime at which the subscription schedule was released. Measured in seconds since the Unix epoch.
released_subscriptionstringID of the subscription once managed by the subscription schedule (if it is released).
status requiredstringThe present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://docs.stripe.com/billing/subscriptions/subscription-schedules).
subscriptionone of multiple schemasID of the subscription managed by the subscription schedule.
test_clockone of multiple schemasID of the test clock this subscription schedule belongs to.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/subscription_schedules/{schedule}

Retrieve a schedule

Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
schedulepathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the schedule.
billing_mode requiredsubscriptions_resource_billing_mode
canceled_atintegerTime at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
completed_atintegerTime at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
current_phaseone of multiple schemasObject representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
customer requiredone of multiple schemasID of the customer who owns the subscription schedule.
customer_accountstringID of the account who owns the subscription schedule.
default_settings requiredsubscription_schedules_resource_default_settings
end_behavior requiredstringBehavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
phases requiredarray of subscription_schedule_phase_configurationConfiguration for the subscription schedule's phases.
released_atintegerTime at which the subscription schedule was released. Measured in seconds since the Unix epoch.
released_subscriptionstringID of the subscription once managed by the subscription schedule (if it is released).
status requiredstringThe present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://docs.stripe.com/billing/subscriptions/subscription-schedules).
subscriptionone of multiple schemasID of the subscription managed by the subscription schedule.
test_clockone of multiple schemasID of the test clock this subscription schedule belongs to.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/subscription_schedules/{schedule}

Update a schedule

Updates an existing subscription schedule.

Request parameters

ParameterLocationTypeDescription
schedulepathstring
FieldTypeDescription
default_settingsobjectObject representing the subscription schedule's default settings.
end_behaviorstringBehavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
phasesarray of objectList representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted.
proration_behaviorstringIf the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the schedule.
billing_mode requiredsubscriptions_resource_billing_mode
canceled_atintegerTime at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
completed_atintegerTime at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
current_phaseone of multiple schemasObject representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
customer requiredone of multiple schemasID of the customer who owns the subscription schedule.
customer_accountstringID of the account who owns the subscription schedule.
default_settings requiredsubscription_schedules_resource_default_settings
end_behavior requiredstringBehavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
phases requiredarray of subscription_schedule_phase_configurationConfiguration for the subscription schedule's phases.
released_atintegerTime at which the subscription schedule was released. Measured in seconds since the Unix epoch.
released_subscriptionstringID of the subscription once managed by the subscription schedule (if it is released).
status requiredstringThe present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://docs.stripe.com/billing/subscriptions/subscription-schedules).
subscriptionone of multiple schemasID of the subscription managed by the subscription schedule.
test_clockone of multiple schemasID of the test clock this subscription schedule belongs to.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/subscription_schedules/{schedule}/cancel

Cancel a schedule

Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.

Request parameters

ParameterLocationTypeDescription
schedulepathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
invoice_nowbooleanIf the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`.
proratebooleanIf the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`.

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the schedule.
billing_mode requiredsubscriptions_resource_billing_mode
canceled_atintegerTime at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
completed_atintegerTime at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
current_phaseone of multiple schemasObject representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
customer requiredone of multiple schemasID of the customer who owns the subscription schedule.
customer_accountstringID of the account who owns the subscription schedule.
default_settings requiredsubscription_schedules_resource_default_settings
end_behavior requiredstringBehavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
phases requiredarray of subscription_schedule_phase_configurationConfiguration for the subscription schedule's phases.
released_atintegerTime at which the subscription schedule was released. Measured in seconds since the Unix epoch.
released_subscriptionstringID of the subscription once managed by the subscription schedule (if it is released).
status requiredstringThe present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://docs.stripe.com/billing/subscriptions/subscription-schedules).
subscriptionone of multiple schemasID of the subscription managed by the subscription schedule.
test_clockone of multiple schemasID of the test clock this subscription schedule belongs to.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/subscription_schedules/{schedule}/release

Release a schedule

Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription’s ID to the released_subscription property.

Request parameters

ParameterLocationTypeDescription
schedulepathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
preserve_cancel_datebooleanKeep any cancellation on the subscription that the schedule has set

Responses

HTTP 200: Successful response.
FieldTypeDescription
applicationone of multiple schemasID of the Connect Application that created the schedule.
billing_mode requiredsubscriptions_resource_billing_mode
canceled_atintegerTime at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
completed_atintegerTime at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
current_phaseone of multiple schemasObject representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
customer requiredone of multiple schemasID of the customer who owns the subscription schedule.
customer_accountstringID of the account who owns the subscription schedule.
default_settings requiredsubscription_schedules_resource_default_settings
end_behavior requiredstringBehavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
phases requiredarray of subscription_schedule_phase_configurationConfiguration for the subscription schedule's phases.
released_atintegerTime at which the subscription schedule was released. Measured in seconds since the Unix epoch.
released_subscriptionstringID of the subscription once managed by the subscription schedule (if it is released).
status requiredstringThe present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://docs.stripe.com/billing/subscriptions/subscription-schedules).
subscriptionone of multiple schemasID of the subscription managed by the subscription schedule.
test_clockone of multiple schemasID of the test clock this subscription schedule belongs to.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors