API reference
Test mode. Use your secret key on your server; live processing is currently disabled.
https://api.knoxapi.comSend 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.
List all payment links
Returns a list of your payment links.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
active | query | boolean | Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). |
ending_before | query | string | A 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. |
expand | query | array of string | Specifies which fields in the response should be expanded. |
limit | query | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
starting_after | query | string | A 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.
| Field | Type | Description |
|---|---|---|
data required | array of payment_link | |
has_more required | boolean | True if this list has another page of items after this one that can be fetched. |
object required | string | String representing the object's type. Objects of the same type share the same value. Always has the value `list`. |
url required | string | The URL where this list can be accessed. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Create a payment link
Creates a payment link.
Request parameters
| Field | Type | Description |
|---|---|---|
after_completion | object | Behavior after the purchase is complete. |
allow_promotion_codes | boolean | Enables user redeemable promotion codes. |
application_fee_amount | integer | The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. |
application_fee_percent | number | A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. |
automatic_tax | object | Configuration for automatic tax collection. |
billing_address_collection | string | Configuration for collecting the customer's billing address. Defaults to `auto`. |
consent_collection | object | Configure fields to gather active consent from customers. |
currency | string | Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies) and supported by each line item's price. |
custom_fields | array of object | Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. |
custom_text | object | Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. |
customer_creation | string | Configures whether [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link create a [Customer](https://docs.stripe.com/api/customers). |
expand | array of string | Specifies which fields in the response should be expanded. |
inactive_message | string | The custom message to be displayed to a customer when a payment link is no longer active. |
invoice_creation | object | Generate a post-purchase Invoice for one-time payments. |
line_items required | array of object | The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. |
managed_payments | object | Settings for Managed Payments for this Payment Link and resulting [CheckoutSessions](/api/checkout/sessions/object), [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object). |
metadata | object | Set 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`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. |
name_collection | object | Controls settings applied for collecting the customer's name. |
on_behalf_of | string | The account on behalf of which to charge. |
optional_items | array of object | A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](https://docs.stripe.com/api/prices). There is a maximum of 10 optional items allowed on a payment link, and the existing limits on the number of line items allowed on a payment link apply to the combined number of line items and optional items. There is a maximum of 20 combined line items and optional items. |
payment_intent_data | object | A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. |
payment_method_collection | string | Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://docs.stripe.com/payments/checkout/free-trials). |
payment_method_options | object | Payment-method-specific configuration. |
payment_method_types | array of string | The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://docs.stripe.com/payments/payment-methods/integration-options#payment-method-product-support)). |
phone_number_collection | object | Controls phone number collection settings during checkout. We recommend that you review your privacy policy and check with your legal contacts. |
restrictions | object | Settings that restrict the usage of a payment link. |
shipping_address_collection | object | Configuration for collecting the customer's shipping address. |
shipping_options | array of object | The shipping rate options to apply to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. |
submit_type | string | Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://docs.stripe.com/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). |
subscription_data | object | When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. |
tax_id_collection | object | Controls tax ID collection during checkout. |
transfer_data | object | The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
active required | boolean | Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. |
after_completion required | payment_links_resource_after_completion | |
allow_promotion_codes required | boolean | Whether user redeemable promotion codes are enabled. |
application | one of multiple schemas | The ID of the Connect application that created the Payment Link. |
application_fee_amount | integer | The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. |
application_fee_percent | number | This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. |
automatic_tax required | payment_links_resource_automatic_tax | |
billing_address_collection required | string | Configuration for collecting the customer's billing address. Defaults to `auto`. |
consent_collection | one of multiple schemas | When set, provides configuration to gather active consent from customers. |
currency required | string | Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). |
custom_fields required | array of payment_links_resource_custom_fields | Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. |
custom_text required | payment_links_resource_custom_text | |
customer_creation required | string | Configuration for Customer creation during checkout. |
id required | string | Unique identifier for the object. |
inactive_message | string | The custom message to be displayed to a customer when a payment link is no longer active. |
invoice_creation | one of multiple schemas | Configuration for creating invoice for payment mode payment links. |
line_items | object | The line items representing what is being sold. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | Settings for Managed Payments for this Payment Link and resulting [CheckoutSessions](/api/checkout/sessions/object), [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object). |
metadata required | object | Set 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. |
name_collection | payment_links_resource_name_collection | |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. |
optional_items | array of payment_links_resource_optional_item | The optional items presented to the customer at checkout. |
payment_intent_data | one of multiple schemas | Indicates the parameters to be passed to PaymentIntent creation during checkout. |
payment_method_collection required | string | Configuration for collecting a payment method during checkout. Defaults to `always`. |
payment_method_options | one of multiple schemas | Payment-method-specific configuration. |
payment_method_types | array of string | The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). |
phone_number_collection required | payment_links_resource_phone_number_collection | |
restrictions | one of multiple schemas | Settings that restrict the usage of a payment link. |
shipping_address_collection | one of multiple schemas | Configuration for collecting the customer's shipping address. |
shipping_options required | array of payment_links_resource_shipping_option | The shipping rate options applied to the session. |
submit_type required | string | Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. |
subscription_data | one of multiple schemas | When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. |
tax_id_collection required | payment_links_resource_tax_id_collection | |
transfer_data | one of multiple schemas | The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. |
url required | string | The public URL that can be shared with customers. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Retrieve payment link
Retrieve a payment link.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
expand | query | array of string | Specifies which fields in the response should be expanded. |
payment_link | path | string |
object. See the OpenAPI specification for the complete schema.
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
active required | boolean | Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. |
after_completion required | payment_links_resource_after_completion | |
allow_promotion_codes required | boolean | Whether user redeemable promotion codes are enabled. |
application | one of multiple schemas | The ID of the Connect application that created the Payment Link. |
application_fee_amount | integer | The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. |
application_fee_percent | number | This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. |
automatic_tax required | payment_links_resource_automatic_tax | |
billing_address_collection required | string | Configuration for collecting the customer's billing address. Defaults to `auto`. |
consent_collection | one of multiple schemas | When set, provides configuration to gather active consent from customers. |
currency required | string | Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). |
custom_fields required | array of payment_links_resource_custom_fields | Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. |
custom_text required | payment_links_resource_custom_text | |
customer_creation required | string | Configuration for Customer creation during checkout. |
id required | string | Unique identifier for the object. |
inactive_message | string | The custom message to be displayed to a customer when a payment link is no longer active. |
invoice_creation | one of multiple schemas | Configuration for creating invoice for payment mode payment links. |
line_items | object | The line items representing what is being sold. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | Settings for Managed Payments for this Payment Link and resulting [CheckoutSessions](/api/checkout/sessions/object), [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object). |
metadata required | object | Set 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. |
name_collection | payment_links_resource_name_collection | |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. |
optional_items | array of payment_links_resource_optional_item | The optional items presented to the customer at checkout. |
payment_intent_data | one of multiple schemas | Indicates the parameters to be passed to PaymentIntent creation during checkout. |
payment_method_collection required | string | Configuration for collecting a payment method during checkout. Defaults to `always`. |
payment_method_options | one of multiple schemas | Payment-method-specific configuration. |
payment_method_types | array of string | The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). |
phone_number_collection required | payment_links_resource_phone_number_collection | |
restrictions | one of multiple schemas | Settings that restrict the usage of a payment link. |
shipping_address_collection | one of multiple schemas | Configuration for collecting the customer's shipping address. |
shipping_options required | array of payment_links_resource_shipping_option | The shipping rate options applied to the session. |
submit_type required | string | Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. |
subscription_data | one of multiple schemas | When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. |
tax_id_collection required | payment_links_resource_tax_id_collection | |
transfer_data | one of multiple schemas | The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. |
url required | string | The public URL that can be shared with customers. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Update a payment link
Updates a payment link.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
payment_link | path | string |
| Field | Type | Description |
|---|---|---|
active | boolean | Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. |
after_completion | object | Behavior after the purchase is complete. |
allow_promotion_codes | boolean | Enables user redeemable promotion codes. |
application_fee_amount | one of multiple schemas | The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. |
application_fee_percent | one of multiple schemas | A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. |
automatic_tax | object | Configuration for automatic tax collection. |
billing_address_collection | string | Configuration for collecting the customer's billing address. Defaults to `auto`. |
consent_collection | object | Configure fields to gather active consent from customers. |
custom_fields | one of multiple schemas | Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. |
custom_text | object | Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. |
customer_creation | string | Configures whether [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link create a [Customer](https://docs.stripe.com/api/customers). |
expand | array of string | Specifies which fields in the response should be expanded. |
inactive_message | one of multiple schemas | The custom message to be displayed to a customer when a payment link is no longer active. |
invoice_creation | object | Generate a post-purchase Invoice for one-time payments. |
line_items | array of object | The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. |
metadata | object | Set 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`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. |
name_collection | one of multiple schemas | Controls settings applied for collecting the customer's name. |
on_behalf_of | one of multiple schemas | The account on behalf of which to charge. |
optional_items | one of multiple schemas | A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](https://docs.stripe.com/api/prices). There is a maximum of 10 optional items allowed on a payment link, and the existing limits on the number of line items allowed on a payment link apply to the combined number of line items and optional items. There is a maximum of 20 combined line items and optional items. |
payment_intent_data | object | A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. |
payment_method_collection | string | Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://docs.stripe.com/payments/checkout/free-trials). |
payment_method_options | one of multiple schemas | Payment-method-specific configuration. |
payment_method_types | one of multiple schemas | The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). |
phone_number_collection | object | Controls phone number collection settings during checkout. We recommend that you review your privacy policy and check with your legal contacts. |
restrictions | one of multiple schemas | Settings that restrict the usage of a payment link. |
shipping_address_collection | one of multiple schemas | Configuration for collecting the customer's shipping address. |
shipping_options | one of multiple schemas | The shipping rate options to apply to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. |
submit_type | string | Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://docs.stripe.com/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). |
subscription_data | object | When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. |
tax_id_collection | object | Controls tax ID collection during checkout. |
transfer_data | one of multiple schemas | The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
active required | boolean | Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. |
after_completion required | payment_links_resource_after_completion | |
allow_promotion_codes required | boolean | Whether user redeemable promotion codes are enabled. |
application | one of multiple schemas | The ID of the Connect application that created the Payment Link. |
application_fee_amount | integer | The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. |
application_fee_percent | number | This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. |
automatic_tax required | payment_links_resource_automatic_tax | |
billing_address_collection required | string | Configuration for collecting the customer's billing address. Defaults to `auto`. |
consent_collection | one of multiple schemas | When set, provides configuration to gather active consent from customers. |
currency required | string | Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). |
custom_fields required | array of payment_links_resource_custom_fields | Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. |
custom_text required | payment_links_resource_custom_text | |
customer_creation required | string | Configuration for Customer creation during checkout. |
id required | string | Unique identifier for the object. |
inactive_message | string | The custom message to be displayed to a customer when a payment link is no longer active. |
invoice_creation | one of multiple schemas | Configuration for creating invoice for payment mode payment links. |
line_items | object | The line items representing what is being sold. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
managed_payments | one of multiple schemas | Settings for Managed Payments for this Payment Link and resulting [CheckoutSessions](/api/checkout/sessions/object), [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object). |
metadata required | object | Set 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. |
name_collection | payment_links_resource_name_collection | |
object required | string | String representing the object's type. Objects of the same type share the same value. |
on_behalf_of | one of multiple schemas | The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. |
optional_items | array of payment_links_resource_optional_item | The optional items presented to the customer at checkout. |
payment_intent_data | one of multiple schemas | Indicates the parameters to be passed to PaymentIntent creation during checkout. |
payment_method_collection required | string | Configuration for collecting a payment method during checkout. Defaults to `always`. |
payment_method_options | one of multiple schemas | Payment-method-specific configuration. |
payment_method_types | array of string | The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). |
phone_number_collection required | payment_links_resource_phone_number_collection | |
restrictions | one of multiple schemas | Settings that restrict the usage of a payment link. |
shipping_address_collection | one of multiple schemas | Configuration for collecting the customer's shipping address. |
shipping_options required | array of payment_links_resource_shipping_option | The shipping rate options applied to the session. |
submit_type required | string | Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. |
subscription_data | one of multiple schemas | When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. |
tax_id_collection required | payment_links_resource_tax_id_collection | |
transfer_data | one of multiple schemas | The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. |
url required | string | The public URL that can be shared with customers. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
Retrieve a payment link's line items
When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
ending_before | query | string | A 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. |
expand | query | array of string | Specifies which fields in the response should be expanded. |
limit | query | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
payment_link | path | string | |
starting_after | query | string | A 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.
| Field | Type | Description |
|---|---|---|
data required | array of item | Details about each object. |
has_more required | boolean | True if this list has another page of items after this one that can be fetched. |
object required | string | String representing the object's type. Objects of the same type share the same value. Always has the value `list`. |
url required | string | The URL where this list can be accessed. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |