API reference
Payment Links
A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times. When a customer opens a payment link it will open a new checkout session to render the payment page. You can use checkout session events to track payments through payment links. Related guide: Payment Links API
https://api.knoxapi.comCreate a payment link
POST/v1/payment_links
Creates a payment link.
Body parameters
line_itemsarray of objectsRequiredThe line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
Show 4 child parameters
quantityintegerRequiredadjustable_quantityobjectShow 3 child parameters
enabledbooleanRequiredmaximumintegerminimuminteger
pricestringprice_dataobjectShow 7 child parameters
currencystringRequiredproductstringproduct_dataobjectChild parameters are listed in the OpenAPI document.
recurringobjectChild parameters are listed in the OpenAPI document.
tax_behaviorstringPossible valuesexclusiveinclusiveunspecified
unit_amountintegerunit_amount_decimalstring
after_completionobjectBehavior after the purchase is complete.
Show 3 child parameters
typestringRequiredPossible valueshosted_confirmationredirect
hosted_confirmationobjectShow 1 child parameter
custom_messagestring
redirectobjectShow 1 child parameter
urlstringRequired
allow_promotion_codesbooleanEnables user redeemable promotion codes.
application_fee_amountintegerThe 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_percentnumberA 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_taxobjectConfiguration for automatic tax collection.
Show 2 child parameters
enabledbooleanRequiredliabilityobjectShow 2 child parameters
typestringRequiredPossible valuesaccountself
accountstring
billing_address_collectionstringConfiguration for collecting the customer's billing address. Defaults to
auto.Possible valuesautorequired
consent_collectionobjectConfigure fields to gather active consent from customers.
Show 3 child parameters
payment_method_reuse_agreementobjectShow 1 child parameter
positionstringRequiredPossible valuesautohidden
promotionsstringPossible valuesautonone
terms_of_servicestringPossible valuesnonerequired
currencystringThree-letter ISO currency code, in lowercase. Must be a supported currency and supported by each line item's price.
custom_fieldsarray of objectsCollect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if
ui_modeiscustom.Show 7 child parameters
keystringRequiredlabelobjectRequiredShow 2 child parameters
customstringRequiredtypestringRequiredPossible valuescustom
typestringRequiredPossible valuesdropdownnumerictext
dropdownobjectShow 2 child parameters
optionsarray of objectsRequiredChild parameters are listed in the OpenAPI document.
default_valuestring
numericobjectShow 3 child parameters
default_valuestringmaximum_lengthintegerminimum_lengthinteger
optionalbooleantextobjectShow 3 child parameters
default_valuestringmaximum_lengthintegerminimum_lengthinteger
custom_textobjectDisplay additional text for your customers using custom text. You can't set this parameter if
ui_modeiscustom.Show 4 child parameters
after_submitobjectShow 1 child parameter
messagestringRequired
shipping_addressobjectShow 1 child parameter
messagestringRequired
submitobjectShow 1 child parameter
messagestringRequired
terms_of_service_acceptanceobjectShow 1 child parameter
messagestringRequired
customer_creationstringConfigures whether checkout sessions created by this payment link create a Customer.
Possible valuesalwaysif_required
expandarray of stringsSpecifies which fields in the response should be expanded.
inactive_messagestringThe custom message to be displayed to a customer when a payment link is no longer active.
invoice_creationobjectGenerate a post-purchase Invoice for one-time payments.
Show 2 child parameters
enabledbooleanRequiredinvoice_dataobjectShow 7 child parameters
account_tax_idsarray of stringscustom_fieldsarray of objectsChild parameters are listed in the OpenAPI document.
descriptionstringfooterstringissuerobjectChild parameters are listed in the OpenAPI document.
metadataobjectrendering_optionsobjectChild parameters are listed in the OpenAPI document.
managed_paymentsobjectSettings for Managed Payments for this Payment Link and resulting CheckoutSessions, PaymentIntents, Invoices, and Subscriptions.
Show 1 child parameter
enabledboolean
metadataobjectSet of key-value pairs 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 created by this payment link.name_collectionobjectControls settings applied for collecting the customer's name.
Show 2 child parameters
businessobjectShow 2 child parameters
enabledbooleanRequiredoptionalboolean
individualobjectShow 2 child parameters
enabledbooleanRequiredoptionalboolean
on_behalf_ofstringThe account on behalf of which to charge.
optional_itemsarray of objectsA list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring 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.
Show 3 child parameters
pricestringRequiredquantityintegerRequiredadjustable_quantityobjectShow 3 child parameters
enabledbooleanRequiredmaximumintegerminimuminteger
payment_intent_dataobjectA subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in
paymentmode.Show 7 child parameters
capture_methodstringPossible valuesautomaticautomatic_asyncmanual
descriptionstringmetadataobjectsetup_future_usagestringPossible valuesoff_sessionon_session
statement_descriptorstringstatement_descriptor_suffixstringtransfer_groupstring
payment_method_collectionstringSpecify 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 insubscriptionmode. Defaults toalways. 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.Possible valuesalwaysif_required
payment_method_optionsobjectPayment-method-specific configuration.
Show 1 child parameter
cardobjectShow 1 child parameter
restrictionsobjectChild parameters are listed in the OpenAPI document.
payment_method_typesarray of stringsThe 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 (20+ payment methods supported).
phone_number_collectionobjectControls phone number collection settings during checkout. We recommend that you review your privacy policy and check with your legal contacts.
Show 1 child parameter
enabledbooleanRequired
restrictionsobjectSettings that restrict the usage of a payment link.
Show 1 child parameter
completed_sessionsobjectRequiredShow 1 child parameter
limitintegerRequired
shipping_address_collectionobjectConfiguration for collecting the customer's shipping address.
Show 1 child parameter
allowed_countriesarray of stringsRequired
shipping_optionsarray of objectsThe shipping rate options to apply to checkout sessions created by this payment link.
Show 1 child parameter
shipping_ratestring
submit_typestringDescribes 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 property (example:
donate.stripe.com).Possible valuesautobookdonatepaysubscribe
subscription_dataobjectWhen 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.Show 5 child parameters
descriptionstringinvoice_settingsobjectShow 1 child parameter
issuerobjectChild parameters are listed in the OpenAPI document.
metadataobjecttrial_period_daysintegertrial_settingsobjectShow 1 child parameter
end_behaviorobjectRequiredChild parameters are listed in the OpenAPI document.
tax_id_collectionobjectControls tax ID collection during checkout.
Show 2 child parameters
enabledbooleanRequiredrequiredstringPossible valuesif_supportednever
transfer_dataobjectThe account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
Show 2 child parameters
destinationstringRequiredamountinteger
Returns
The payment_link object.
curl https://api.knoxapi.com/v1/payment_links \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d "line_items[0][quantity]=1"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const paymentLink = await stripe.paymentLinks.create({
line_items: [{
quantity: 1,
}],
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
payment_link = client.v1.payment_links.create(params={
"line_items": [{
"quantity": 1,
}],
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
payment_link = Stripe::PaymentLink.create({
line_items: [{
quantity: 1,
}],
}){
"active": true,
"after_completion": {
"hosted_confirmation": {
"custom_message": null
},
"type": "hosted_confirmation"
},
"allow_promotion_codes": false,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
}
},
"billing_address_collection": "auto",
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"currency": "usd",
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer_creation": "if_required",
"id": "plink_1Pgc78B7WZ01zgkWC75kX0jg",
"inactive_message": null,
"invoice_creation": {
"enabled": true,
"invoice_data": {
"account_tax_ids": null,
"custom_fields": null,
"description": null,
"footer": null,
"issuer": {
"type": "account"
},
"metadata": null,
"rendering_options": {
"amount_tax_display": null,
"template": null
}
}
},
"livemode": false,
"metadata": {},
"object": "payment_link",
"on_behalf_of": null,
"payment_intent_data": {
"capture_method": null,
"description": null,
"metadata": {
"undefined": "metadata"
},
"setup_future_usage": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_group": null
},
"payment_method_collection": "if_required",
"payment_method_types": null,
"phone_number_collection": {
"enabled": false
},
"restrictions": {
"completed_sessions": {
"count": 94851343,
"limit": 102976443
}
},
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_options": [],
"submit_type": "auto",
"subscription_data": {
"description": null,
"invoice_settings": {
"issuer": {
"type": "account"
}
},
"metadata": {
"undefined": "metadata"
},
"trial_period_days": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "cancel"
}
}
},
"tax_id_collection": {
"enabled": false,
"required": "never"
},
"transfer_data": {
"amount": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"url": "https://sangeekp-15t6ai--payment_links_ingress-mydev.dev.stripe.me/test_eVa16Q1Vd7yU1Ne8ww",
"managed_payments": {
"enabled": true
},
"payment_method_options": {
"card": {
"restrictions": {
"brands_blocked": [
"discover_global_network"
]
}
}
}
}List all payment links
GET/v1/payment_links
Returns a list of your payment links.
Query parameters
activebooleanOnly return payment links that are active or inactive (e.g., pass
falseto list all inactive payment links).ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of payment_link objects.
curl -G https://api.knoxapi.com/v1/payment_links \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const page = await stripe.paymentLinks.list({
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
page = client.v1.payment_links.list(params={
"limit": 3,
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
page = Stripe::PaymentLink.list({
limit: 3,
}){
"object": "list",
"url": "/v1/payment_links",
"has_more": false,
"data": [
{
"active": true,
"after_completion": {
"hosted_confirmation": {
"custom_message": null
},
"type": "hosted_confirmation"
},
"allow_promotion_codes": false,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
}
},
"billing_address_collection": "auto",
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"currency": "usd",
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer_creation": "if_required",
"id": "plink_1Pgc78B7WZ01zgkWC75kX0jg",
"inactive_message": null,
"invoice_creation": {
"enabled": true,
"invoice_data": {
"account_tax_ids": null,
"custom_fields": null,
"description": null,
"footer": null,
"issuer": {
"type": "account"
},
"metadata": null,
"rendering_options": {
"amount_tax_display": null,
"template": null
}
}
},
"livemode": false,
"metadata": {},
"object": "payment_link",
"on_behalf_of": null,
"payment_intent_data": {
"capture_method": null,
"description": null,
"metadata": {
"undefined": "metadata"
},
"setup_future_usage": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_group": null
},
"payment_method_collection": "if_required",
"payment_method_types": null,
"phone_number_collection": {
"enabled": false
},
"restrictions": {
"completed_sessions": {
"count": 94851343,
"limit": 102976443
}
},
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_options": [],
"submit_type": "auto",
"subscription_data": {
"description": null,
"invoice_settings": {
"issuer": {
"type": "account"
}
},
"metadata": {
"undefined": "metadata"
},
"trial_period_days": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "cancel"
}
}
},
"tax_id_collection": {
"enabled": false,
"required": "never"
},
"transfer_data": {
"amount": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"url": "https://sangeekp-15t6ai--payment_links_ingress-mydev.dev.stripe.me/test_eVa16Q1Vd7yU1Ne8ww",
"managed_payments": {
"enabled": true
},
"payment_method_options": {
"card": {
"restrictions": {
"brands_blocked": [
"discover_global_network"
]
}
}
}
}
]
}Update a payment link
POST/v1/payment_links/{payment_link}
Updates a payment link.
Path parameters
payment_linkstringRequired
Body parameters
activebooleanWhether the payment link's
urlis active. Iffalse, customers visiting the URL will be shown a page saying that the link has been deactivated.after_completionobjectBehavior after the purchase is complete.
Show 3 child parameters
typestringRequiredPossible valueshosted_confirmationredirect
hosted_confirmationobjectShow 1 child parameter
custom_messagestring
redirectobjectShow 1 child parameter
urlstringRequired
allow_promotion_codesbooleanEnables user redeemable promotion codes.
application_fee_amountintegerThe 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_percentnumberA 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_taxobjectConfiguration for automatic tax collection.
Show 2 child parameters
enabledbooleanRequiredliabilityobjectShow 2 child parameters
typestringRequiredPossible valuesaccountself
accountstring
billing_address_collectionstringConfiguration for collecting the customer's billing address. Defaults to
auto.Possible valuesautorequired
consent_collectionobjectConfigure fields to gather active consent from customers.
Show 3 child parameters
payment_method_reuse_agreementobjectShow 1 child parameter
positionstringRequiredPossible valuesautohidden
promotionsstringPossible valuesautonone
terms_of_servicestringPossible valuesnonerequired
custom_fieldsarray of objectsCollect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if
ui_modeiscustom.Show 7 child parameters
keystringRequiredlabelobjectRequiredShow 2 child parameters
customstringRequiredtypestringRequiredPossible valuescustom
typestringRequiredPossible valuesdropdownnumerictext
dropdownobjectShow 2 child parameters
optionsarray of objectsRequiredChild parameters are listed in the OpenAPI document.
default_valuestring
numericobjectShow 3 child parameters
default_valuestringmaximum_lengthintegerminimum_lengthinteger
optionalbooleantextobjectShow 3 child parameters
default_valuestringmaximum_lengthintegerminimum_lengthinteger
custom_textobjectDisplay additional text for your customers using custom text. You can't set this parameter if
ui_modeiscustom.Show 4 child parameters
after_submitobjectShow 1 child parameter
messagestringRequired
shipping_addressobjectShow 1 child parameter
messagestringRequired
submitobjectShow 1 child parameter
messagestringRequired
terms_of_service_acceptanceobjectShow 1 child parameter
messagestringRequired
customer_creationstringConfigures whether checkout sessions created by this payment link create a Customer.
Possible valuesalwaysif_required
expandarray of stringsSpecifies which fields in the response should be expanded.
inactive_messagestringThe custom message to be displayed to a customer when a payment link is no longer active.
invoice_creationobjectGenerate a post-purchase Invoice for one-time payments.
Show 2 child parameters
enabledbooleanRequiredinvoice_dataobjectShow 7 child parameters
account_tax_idsarray of stringscustom_fieldsarray of objectsChild parameters are listed in the OpenAPI document.
descriptionstringfooterstringissuerobjectChild parameters are listed in the OpenAPI document.
metadataobjectrendering_optionsobjectChild parameters are listed in the OpenAPI document.
line_itemsarray of objectsThe line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
Show 3 child parameters
idstringRequiredadjustable_quantityobjectShow 3 child parameters
enabledbooleanRequiredmaximumintegerminimuminteger
quantityinteger
metadataobjectSet of key-value pairs 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 created by this payment link.name_collectionobjectControls settings applied for collecting the customer's name.
Show 2 child parameters
businessobjectShow 2 child parameters
enabledbooleanRequiredoptionalboolean
individualobjectShow 2 child parameters
enabledbooleanRequiredoptionalboolean
on_behalf_ofstringThe account on behalf of which to charge.
optional_itemsarray of objectsA list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring 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.
Show 3 child parameters
pricestringRequiredquantityintegerRequiredadjustable_quantityobjectShow 3 child parameters
enabledbooleanRequiredmaximumintegerminimuminteger
payment_intent_dataobjectA subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in
paymentmode.Show 6 child parameters
descriptionstringmetadataobjectsetup_future_usagestringPossible valuesoff_sessionon_session
statement_descriptorstringstatement_descriptor_suffixstringtransfer_groupstring
payment_method_collectionstringSpecify 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 insubscriptionmode. Defaults toalways. 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.Possible valuesalwaysif_required
payment_method_optionsobjectPayment-method-specific configuration.
Show 1 child parameter
cardobjectShow 1 child parameter
restrictionsobjectChild parameters are listed in the OpenAPI document.
payment_method_typesarray of stringsThe list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your payment method settings.
phone_number_collectionobjectControls phone number collection settings during checkout. We recommend that you review your privacy policy and check with your legal contacts.
Show 1 child parameter
enabledbooleanRequired
restrictionsobjectSettings that restrict the usage of a payment link.
Show 1 child parameter
completed_sessionsobjectRequiredShow 1 child parameter
limitintegerRequired
shipping_address_collectionobjectConfiguration for collecting the customer's shipping address.
Show 1 child parameter
allowed_countriesarray of stringsRequired
shipping_optionsarray of objectsThe shipping rate options to apply to checkout sessions created by this payment link.
Show 1 child parameter
shipping_ratestring
submit_typestringDescribes 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 property (example:
donate.stripe.com).Possible valuesautobookdonatepaysubscribe
subscription_dataobjectWhen 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.Show 4 child parameters
invoice_settingsobjectShow 1 child parameter
issuerobjectChild parameters are listed in the OpenAPI document.
metadataobjecttrial_period_daysintegertrial_settingsobjectShow 1 child parameter
end_behaviorobjectRequiredChild parameters are listed in the OpenAPI document.
tax_id_collectionobjectControls tax ID collection during checkout.
Show 2 child parameters
enabledbooleanRequiredrequiredstringPossible valuesif_supportednever
transfer_dataobjectThe account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
Show 2 child parameters
destinationstringRequiredamountinteger
Returns
The payment_link object.
curl https://api.knoxapi.com/v1/payment_links/plink_1Pgc78B7WZ01zgkWC75kX0jg \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d "metadata[order_id]=6735"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const paymentLink = await stripe.paymentLinks.update('plink_1Pgc78B7WZ01zgkWC75kX0jg', {
metadata: {
order_id: '6735',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
payment_link = client.v1.payment_links.update("plink_1Pgc78B7WZ01zgkWC75kX0jg", params={
"metadata": {
"order_id": "6735",
},
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
payment_link = Stripe::PaymentLink.update('plink_1Pgc78B7WZ01zgkWC75kX0jg', {
metadata: {
order_id: '6735',
},
}){
"active": true,
"after_completion": {
"hosted_confirmation": {
"custom_message": null
},
"type": "hosted_confirmation"
},
"allow_promotion_codes": false,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
}
},
"billing_address_collection": "auto",
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"currency": "usd",
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer_creation": "if_required",
"id": "plink_1Pgc78B7WZ01zgkWC75kX0jg",
"inactive_message": null,
"invoice_creation": {
"enabled": true,
"invoice_data": {
"account_tax_ids": null,
"custom_fields": null,
"description": null,
"footer": null,
"issuer": {
"type": "account"
},
"metadata": null,
"rendering_options": {
"amount_tax_display": null,
"template": null
}
}
},
"livemode": false,
"metadata": {},
"object": "payment_link",
"on_behalf_of": null,
"payment_intent_data": {
"capture_method": null,
"description": null,
"metadata": {
"undefined": "metadata"
},
"setup_future_usage": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_group": null
},
"payment_method_collection": "if_required",
"payment_method_types": null,
"phone_number_collection": {
"enabled": false
},
"restrictions": {
"completed_sessions": {
"count": 94851343,
"limit": 102976443
}
},
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_options": [],
"submit_type": "auto",
"subscription_data": {
"description": null,
"invoice_settings": {
"issuer": {
"type": "account"
}
},
"metadata": {
"undefined": "metadata"
},
"trial_period_days": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "cancel"
}
}
},
"tax_id_collection": {
"enabled": false,
"required": "never"
},
"transfer_data": {
"amount": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"url": "https://sangeekp-15t6ai--payment_links_ingress-mydev.dev.stripe.me/test_eVa16Q1Vd7yU1Ne8ww",
"managed_payments": {
"enabled": true
},
"payment_method_options": {
"card": {
"restrictions": {
"brands_blocked": [
"discover_global_network"
]
}
}
}
}Retrieve payment link
GET/v1/payment_links/{payment_link}
Retrieve a payment link.
Path parameters
payment_linkstringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The payment_link object.
curl https://api.knoxapi.com/v1/payment_links/plink_1Pgc78B7WZ01zgkWC75kX0jg \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const paymentLink = await stripe.paymentLinks.retrieve('plink_1Pgc78B7WZ01zgkWC75kX0jg');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
payment_link = client.v1.payment_links.retrieve("plink_1Pgc78B7WZ01zgkWC75kX0jg")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
payment_link = Stripe::PaymentLink.retrieve('plink_1Pgc78B7WZ01zgkWC75kX0jg'){
"active": true,
"after_completion": {
"hosted_confirmation": {
"custom_message": null
},
"type": "hosted_confirmation"
},
"allow_promotion_codes": false,
"application": null,
"application_fee_amount": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
}
},
"billing_address_collection": "auto",
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"currency": "usd",
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer_creation": "if_required",
"id": "plink_1Pgc78B7WZ01zgkWC75kX0jg",
"inactive_message": null,
"invoice_creation": {
"enabled": true,
"invoice_data": {
"account_tax_ids": null,
"custom_fields": null,
"description": null,
"footer": null,
"issuer": {
"type": "account"
},
"metadata": null,
"rendering_options": {
"amount_tax_display": null,
"template": null
}
}
},
"livemode": false,
"metadata": {},
"object": "payment_link",
"on_behalf_of": null,
"payment_intent_data": {
"capture_method": null,
"description": null,
"metadata": {
"undefined": "metadata"
},
"setup_future_usage": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_group": null
},
"payment_method_collection": "if_required",
"payment_method_types": null,
"phone_number_collection": {
"enabled": false
},
"restrictions": {
"completed_sessions": {
"count": 94851343,
"limit": 102976443
}
},
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_options": [],
"submit_type": "auto",
"subscription_data": {
"description": null,
"invoice_settings": {
"issuer": {
"type": "account"
}
},
"metadata": {
"undefined": "metadata"
},
"trial_period_days": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "cancel"
}
}
},
"tax_id_collection": {
"enabled": false,
"required": "never"
},
"transfer_data": {
"amount": null,
"destination": {
"id": "obj_123",
"object": "account"
}
},
"url": "https://sangeekp-15t6ai--payment_links_ingress-mydev.dev.stripe.me/test_eVa16Q1Vd7yU1Ne8ww",
"managed_payments": {
"enabled": true
},
"payment_method_options": {
"card": {
"restrictions": {
"brands_blocked": [
"discover_global_network"
]
}
}
}
}Retrieve a payment link's line items
GET/v1/payment_links/{payment_link}/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.
Path parameters
payment_linkstringRequired
Query parameters
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of item objects.
curl -G https://api.knoxapi.com/v1/payment_links/plink_1Pgc78B7WZ01zgkWC75kX0jg/line_items \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/payment_links/plink_1Pgc78B7WZ01zgkWC75kX0jg/line_items', {
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/payment_links/plink_1Pgc78B7WZ01zgkWC75kX0jg/line_items", limit=3)require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/payment_links/plink_1Pgc78B7WZ01zgkWC75kX0jg/line_items', {
limit: 3,
}){
"object": "list",
"url": "/v1/payment_links",
"has_more": false,
"data": [
{
"amount_discount": 0,
"amount_subtotal": 0,
"amount_tax": 0,
"amount_total": 0,
"currency": "usd",
"description": "T-shirt",
"id": "li_1Pgc73B7WZ01zgkWx8kcmZPK",
"object": "item",
"price": {
"active": true,
"billing_scheme": "per_unit",
"created": 1721948530,
"currency": "usd",
"custom_unit_amount": {
"maximum": null,
"minimum": null,
"preset": null
},
"id": "price_1PgafmB7WZ01zgkW02Hf9z6c",
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"object": "price",
"product": "prod_QXg1hqf4jFNsqG",
"recurring": {
"interval": "month",
"interval_count": 797691627,
"meter": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": {
"divide_by": 1592560163,
"round": "down"
},
"type": "one_time",
"unit_amount": 1000,
"unit_amount_decimal": "1000"
},
"quantity": 1,
"metadata": null,
"adjustable_quantity": {
"enabled": true,
"maximum": null,
"minimum": null
}
}
]
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.