Create a Checkout Session
POST/v1/checkout/sessions
Creates a Checkout Session object.
Body parameters
adaptive_pricingobjectSettings for price localization with Adaptive Pricing.
Show 1 child parameter
enabledboolean
after_expirationobjectConfigure actions after a Checkout Session has expired. You can't set this parameter if
ui_modeiselements.Show 1 child parameter
recoveryobjectShow 2 child parameters
enabledbooleanRequiredallow_promotion_codesboolean
allow_promotion_codesbooleanEnables user redeemable promotion codes.
automatic_taxobjectSettings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.
Show 2 child parameters
enabledbooleanRequiredliabilityobjectShow 2 child parameters
typestringRequiredPossible valuesaccountself
accountstring
billing_address_collectionstringSpecify whether Checkout should collect the customer's billing address. Defaults to
auto.Possible valuesautorequired
branding_settingsobjectThe branding settings for the Checkout Session. This parameter is not allowed if ui_mode is
elements.Show 7 child parameters
background_colorstringborder_stylestringPossible valuespillrectangularrounded
button_colorstringdisplay_namestringfont_familystringPossible valuesbe_vietnam_probitterchakra_petchdefaulthahmletinconsolatainterlatoloram_plus_1_codemontserratnoto_sansnoto_sans_jpnoto_serifnunitoopen_sans- and 10 more
iconobjectShow 3 child parameters
typestringRequiredPossible valuesfileurl
filestringurlstring
logoobjectShow 3 child parameters
typestringRequiredPossible valuesfileurl
filestringurlstring
cancel_urlstringIf set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is
embedded_pageorelements.client_reference_idstringA unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems.
consent_collectionobjectConfigure fields for the Checkout Session 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. Required in
setupmode whenpayment_method_typesis not set.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
customerstringID of an existing Customer, if one exists. In
paymentmode, the customer’s most recently saved card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. Insubscriptionmode, the customer’s default payment method will be used if it’s a card, otherwise the most recently saved card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid email set, the email will be prefilled and not editable in Checkout. If the Customer does not have a validemail, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions insubscriptionmode or withcustomer_creationset asalwaysinpaymentmode, Checkout will create a new Customer object based on information provided during the payment flow. You can setpayment_intent_data.setup_future_usageto have Checkout automatically attach the payment method to the Customer you pass in for future reuse.customer_accountstringID of an existing Account, if one exists. Has the same behavior as
customer.customer_creationstringConfigure whether a Checkout Session creates a Customer during Session confirmation. When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout with customer_details. Sessions that don't create Customers instead are grouped by guest customers in the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions. Can only be set in
paymentandsetupmode.Possible valuesalwaysif_required
customer_emailstringIf provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use the
customerfield.customer_updateobjectControls what fields on Customer can be updated by the Checkout Session. Can only be provided when
customeris provided.Show 3 child parameters
addressstringPossible valuesautonever
namestringPossible valuesautonever
shippingstringPossible valuesautonever
discountsarray of objectsThe coupon or promotion code to apply to this Session. Currently, only up to one may be specified.
Show 2 child parameters
couponstringpromotion_codestring
excluded_payment_method_typesarray of stringsA list of the types of payment methods (e.g.,
card) that should be excluded from this Checkout Session. This should only be used when payment methods for this Checkout Session are managed through the Stripe Dashboard.expandarray of stringsSpecifies which fields in the response should be expanded.
expires_atintegerThe Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation.
integration_identifierstringThe integration identifier for this Checkout Session. Multiple Checkout Sessions can have the same integration identifier.
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 objectsA list of items the customer is purchasing. Use this parameter to pass one-time or recurring Prices. The parameter is required for
paymentandsubscriptionmode. Forpaymentmode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. Forsubscriptionmode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only.Show 6 child parameters
adjustable_quantityobjectShow 3 child parameters
enabledbooleanRequiredmaximumintegerminimuminteger
metadataobjectpricestringprice_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
quantityintegertax_ratesarray of strings
localestringThe IETF language tag of the locale Checkout is displayed in. If blank or
auto, the browser's locale is used.Possible valuesautobgcsdadeelenen-GBeses-419etfifilfrfr-CAhr- and 25 more
managed_paymentsobjectSettings for Managed Payments for this Checkout Session and resulting 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.modestringThe mode of the Checkout Session. Pass
subscriptionif the Checkout Session includes at least one recurring item.Possible valuespaymentsetupsubscription
name_collectionobjectControls name collection settings for the session. You can configure Checkout to collect your customers' business names, individual names, or both. Each name field can be either required or optional. If a Customer is created or provided, the names can be saved to the Customer object as well.
Show 2 child parameters
businessobjectShow 2 child parameters
enabledbooleanRequiredoptionalboolean
individualobjectShow 2 child parameters
enabledbooleanRequiredoptionalboolean
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 Checkout Session, and the existing limits on the number of line items allowed on a Checkout Session apply to the combined number of line items and optional items. For
paymentmode, there is a maximum of 100 combined line items and optional items, however it is recommended to consolidate items if there are more than a few dozen. Forsubscriptionmode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices. You can't set this parameter ifui_modeiscustom.Show 3 child parameters
pricestringRequiredquantityintegerRequiredadjustable_quantityobjectShow 3 child parameters
enabledbooleanRequiredmaximumintegerminimuminteger
origin_contextstringWhere the user is coming from. This informs the optimizations that are applied to the session. You can't set this parameter if
ui_modeiselements.Possible valuesmobile_appweb
payment_intent_dataobjectA subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in
paymentmode.Show 12 child parameters
application_fee_amountintegercapture_methodstringPossible valuesautomaticautomatic_asyncmanual
descriptionstringmetadataobjecton_behalf_ofstringreceipt_emailstringsetup_future_usagestringPossible valuesoff_sessionon_session
shippingobjectShow 5 child parameters
addressobjectRequiredChild parameters are listed in the OpenAPI document.
namestringRequiredcarrierstringphonestringtracking_numberstring
statement_descriptorstringstatement_descriptor_suffixstringtransfer_dataobjectShow 2 child parameters
destinationstringRequiredamountinteger
transfer_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_configurationstringThe ID of the payment method configuration to use with this Checkout session.
payment_method_dataobjectThis parameter allows you to set some attributes on the payment method created during a Checkout session.
Show 1 child parameter
allow_redisplaystringPossible valuesalwayslimitedunspecified
payment_method_optionsobjectPayment-method-specific configuration.
Show 49 child parameters
acss_debitobjectShow 5 child parameters
currencystringPossible valuescadusd
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
target_datestringverification_methodstringPossible valuesautomaticinstantmicrodeposits
affirmobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnone
afterpay_clearpayobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnone
alipayobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
almaobjectShow 1 child parameter
capture_methodstringPossible valuesmanual
amazon_payobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnoneoff_session
au_becs_debitobjectShow 2 child parameters
setup_future_usagestringPossible valuesnone
target_datestring
bacs_debitobjectShow 3 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
target_datestring
bancontactobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
billieobjectShow 1 child parameter
capture_methodstringPossible valuesmanual
boletoobjectShow 2 child parameters
expires_after_daysintegersetup_future_usagestringPossible valuesnoneoff_sessionon_session
cardobjectShow 11 child parameters
capture_methodstringPossible valuesmanual
installmentsobjectChild parameters are listed in the OpenAPI document.
request_extended_authorizationstringPossible valuesif_availablenever
request_incremental_authorizationstringPossible valuesif_availablenever
request_multicapturestringPossible valuesif_availablenever
request_overcapturestringPossible valuesif_availablenever
request_three_d_securestringPossible valuesanyautomaticchallenge
restrictionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesoff_sessionon_session
statement_descriptor_suffix_kanastringstatement_descriptor_suffix_kanjistring
cashappobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnoneoff_sessionon_session
cryptoobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
customer_balanceobjectShow 3 child parameters
bank_transferobjectChild parameters are listed in the OpenAPI document.
funding_typestringPossible valuesbank_transfer
setup_future_usagestringPossible valuesnone
demo_payobjectShow 1 child parameter
setup_future_usagestringPossible valuesnoneoff_session
epsobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
fpxobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
giropayobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
grabpayobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
idealobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
kakao_payobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnoneoff_session
klarnaobjectShow 3 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnone
subscriptionsarray of objectsChild parameters are listed in the OpenAPI document.
konbiniobjectShow 2 child parameters
expires_after_daysintegersetup_future_usagestringPossible valuesnone
kr_cardobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnoneoff_session
linkobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnoneoff_session
mobilepayobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnone
multibancoobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
naver_payobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnoneoff_session
oxxoobjectShow 2 child parameters
expires_after_daysintegersetup_future_usagestringPossible valuesnone
p24objectShow 2 child parameters
setup_future_usagestringPossible valuesnone
tos_shown_and_acceptedboolean
pay_by_bankobjectpaycoobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnone
paynowobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
paypalobjectShow 5 child parameters
capture_methodstringPossible valuesmanual
preferred_localestringPossible valuescs-CZda-DKde-ATde-DEde-LUel-GRen-GBen-USes-ESfi-FIfr-BEfr-FRfr-LUhu-HUit-ITnl-BE- and 5 more
referencestringrisk_correlation_idstringsetup_future_usagestringPossible valuesnoneoff_session
paytoobjectShow 2 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_session
pixobjectShow 4 child parameters
amount_includes_iofstringPossible valuesalwaysnever
expires_after_secondsintegermandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_session
revolut_payobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnoneoff_session
samsung_payobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnone
satispayobjectShow 1 child parameter
capture_methodstringPossible valuesmanual
scalapayobjectShow 1 child parameter
capture_methodstringPossible valuesmanual
sepa_debitobjectShow 3 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
target_datestring
sofortobjectShow 1 child parameter
setup_future_usagestringPossible valuesnone
sunbitobjectShow 2 child parameters
capture_methodstringPossible valuesmanual
setup_future_usagestringPossible valuesnone
swishobjectShow 1 child parameter
referencestring
twintobjectShow 1 child parameter
setup_future_usagestringPossible valuesnoneoff_session
upiobjectShow 2 child parameters
mandate_optionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
us_bank_accountobjectShow 4 child parameters
financial_connectionsobjectChild parameters are listed in the OpenAPI document.
setup_future_usagestringPossible valuesnoneoff_sessionon_session
target_datestringverification_methodstringPossible valuesautomaticinstant
wechat_payobjectShow 3 child parameters
clientstringRequiredPossible valuesandroidiosweb
app_idstringsetup_future_usagestringPossible valuesnone
payment_method_typesarray of stringsA list of the types of payment methods (e.g.,
card) this Checkout Session can accept. You can omit this attribute to manage your payment methods from the Stripe Dashboard. See Dynamic Payment Methods for more details. Read more about the supported payment methods and their requirements in our payment method details guide. If multiple payment methods are passed, Checkout will dynamically reorder them to prioritize the most relevant payment methods based on the customer's location and other characteristics.permissionsobjectThis property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. Can only be set when creating
embeddedorcustomsessions. For specific permissions, please refer to their dedicated subsections, such aspermissions.update_shipping_details.Show 1 child parameter
update_shipping_detailsstringPossible valuesclient_onlyserver_only
phone_number_collectionobjectControls phone number collection settings for the session. We recommend that you review your privacy policy and check with your legal contacts before using this feature. Learn more about collecting phone numbers with Checkout.
Show 1 child parameter
enabledbooleanRequired
redirect_on_completionstringThis parameter applies to
ui_mode: embedded_page. Learn more about the redirect behavior of embedded sessions. Defaults toalways.Possible valuesalwaysif_requirednever
return_urlstringThe URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. This parameter is required if
ui_modeisembedded_pageorelementsand redirect-based payment methods are enabled on the session.saved_payment_method_optionsobjectControls saved payment method settings for the session. Only available in
paymentandsubscriptionmode.Show 3 child parameters
allow_redisplay_filtersarray of stringspayment_method_removestringPossible valuesdisabledenabled
payment_method_savestringPossible valuesdisabledenabled
setup_intent_dataobjectA subset of parameters to be passed to SetupIntent creation for Checkout Sessions in
setupmode.Show 3 child parameters
descriptionstringmetadataobjecton_behalf_ofstring
shipping_address_collectionobjectWhen set, provides configuration for Checkout to collect a shipping address from a customer.
Show 1 child parameter
allowed_countriesarray of stringsRequired
shipping_optionsarray of objectsThe shipping rate options to apply to this Session. Up to a maximum of 5.
Show 2 child parameters
shipping_ratestringshipping_rate_dataobjectShow 7 child parameters
display_namestringRequireddelivery_estimateobjectChild parameters are listed in the OpenAPI document.
fixed_amountobjectChild parameters are listed in the OpenAPI document.
metadataobjecttax_behaviorstringPossible valuesexclusiveinclusiveunspecified
tax_codestringtypestringPossible valuesfixed_amount
submit_typestringDescribes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button.
submit_typecan only be specified on Checkout Sessions inpaymentorsubscriptionmode. If blank orauto,payis used. You can't set this parameter ifui_modeiselements.Possible valuesautobookdonatepaysubscribe
subscription_dataobjectA subset of parameters to be passed to subscription creation for Checkout Sessions in
subscriptionmode.Show 15 child parameters
application_fee_percentnumberbilling_cycle_anchorintegerbilling_cycle_anchor_configobjectShow 5 child parameters
day_of_monthintegerRequiredhourintegerminuteintegermonthintegersecondinteger
billing_modeobjectShow 2 child parameters
typestringRequiredPossible valuesclassicflexible
flexibleobjectChild parameters are listed in the OpenAPI document.
default_tax_ratesarray of stringsdescriptionstringinvoice_settingsobjectShow 1 child parameter
issuerobjectChild parameters are listed in the OpenAPI document.
metadataobjecton_behalf_ofstringpending_invoice_item_intervalobjectShow 2 child parameters
intervalstringRequiredPossible valuesdaymonthweekyear
interval_countinteger
proration_behaviorstringPossible valuescreate_prorationsnone
transfer_dataobjectShow 2 child parameters
destinationstringRequiredamount_percentnumber
trial_endintegertrial_period_daysintegertrial_settingsobjectShow 1 child parameter
end_behaviorobjectRequiredChild parameters are listed in the OpenAPI document.
success_urlstringThe URL to which Stripe should send customers when payment or setup is complete. This parameter is not allowed if ui_mode is
embedded_pageorelements. If you'd like to use information from the successful Checkout Session on your page, read the guide on customizing your success page.tax_id_collectionobjectControls tax ID collection during checkout.
Show 2 child parameters
enabledbooleanRequiredrequiredstringPossible valuesif_supportednever
ui_modestringThe UI mode of the Session. Defaults to
hosted_page.Possible valueselementsembedded_pagehosted_page
wallet_optionsobjectWallet-specific configuration.
Show 1 child parameter
linkobjectShow 1 child parameter
displaystringPossible valuesautonever
Returns
The checkout.session object.
curl -X POST https://api.knoxapi.com/v1/checkout/sessions \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/checkout/sessions');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/checkout/sessions")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/checkout/sessions'){
"after_expiration": {
"recovery": {
"allow_promotion_codes": true,
"enabled": true,
"expires_at": null,
"url": null
}
},
"allow_promotion_codes": null,
"amount_subtotal": null,
"amount_total": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"billing_address_collection": null,
"cancel_url": "https://example.com/cancel",
"client_reference_id": null,
"client_secret": null,
"consent": {
"promotions": null,
"terms_of_service": null
},
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"created": 1234567890,
"currency": null,
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer": null,
"customer_creation": null,
"customer_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "[email protected]",
"name": null,
"phone": null,
"tax_exempt": "none",
"tax_ids": null,
"business_name": null,
"individual_name": null
},
"customer_email": null,
"expires_at": 1234567890,
"id": "cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"invoice": 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,
"locale": null,
"metadata": {},
"mode": "payment",
"object": "checkout.session",
"payment_intent": "pi_1PgafyB7WZ01zgkWSjxsAJo3",
"payment_link": null,
"payment_method_collection": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"payment_status": "unpaid",
"phone_number_collection": {
"enabled": false
},
"recovered_from": null,
"saved_payment_method_options": {
"allow_redisplay_filters": null,
"payment_method_remove": null,
"payment_method_save": null
},
"setup_intent": null,
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"shipping_options": [],
"status": "open",
"submit_type": null,
"subscription": null,
"success_url": "https://example.com/success",
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
},
"ui_mode": null,
"url": "https://checkout.stripe.com/pay/c/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"adaptive_pricing": {
"enabled": true
},
"discounts": null,
"collected_information": {
"shipping_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"name": "name"
},
"business_name": null,
"individual_name": null
},
"permissions": {
"update_shipping_details": null
},
"wallet_options": {},
"origin_context": null,
"currency_conversion": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"fx_rate": "291452898",
"source_currency": "usd"
},
"customer_account": null,
"integration_identifier": null,
"managed_payments": {
"enabled": true
}
}List all Checkout Sessions
GET/v1/checkout/sessions
Returns a list of Checkout Sessions.
Query parameters
createdobject | integerOnly return Checkout Sessions that were created during the given date interval.
Show 4 child parameters
gtintegergteintegerltintegerlteinteger
customerstringOnly return the Checkout Sessions for the Customer specified.
customer_accountstringOnly return the Checkout Sessions for the Account specified.
customer_detailsobjectOnly return the Checkout Sessions for the Customer details specified.
Show 1 child parameter
emailstringRequired
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.
payment_intentstringOnly return the Checkout Session for the PaymentIntent specified.
payment_linkstringOnly return the Checkout Sessions for the Payment Link specified.
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.statusstringOnly return the Checkout Sessions matching the given status.
Possible valuescompleteexpiredopen
subscriptionstringOnly return the Checkout Session for the subscription specified.
Returns
A list of checkout.session objects.
curl -G https://api.knoxapi.com/v1/checkout/sessions \
-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/checkout/sessions', {
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/checkout/sessions", limit=3)require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/checkout/sessions', {
limit: 3,
}){
"object": "list",
"url": "/v1/checkout/sessions",
"has_more": false,
"data": [
{
"after_expiration": {
"recovery": {
"allow_promotion_codes": true,
"enabled": true,
"expires_at": null,
"url": null
}
},
"allow_promotion_codes": null,
"amount_subtotal": null,
"amount_total": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"billing_address_collection": null,
"cancel_url": "https://example.com/cancel",
"client_reference_id": null,
"client_secret": null,
"consent": {
"promotions": null,
"terms_of_service": null
},
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"created": 1234567890,
"currency": null,
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer": null,
"customer_creation": null,
"customer_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "[email protected]",
"name": null,
"phone": null,
"tax_exempt": "none",
"tax_ids": null,
"business_name": null,
"individual_name": null
},
"customer_email": null,
"expires_at": 1234567890,
"id": "cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"invoice": 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,
"locale": null,
"metadata": {},
"mode": "payment",
"object": "checkout.session",
"payment_intent": "pi_1PgafyB7WZ01zgkWSjxsAJo3",
"payment_link": null,
"payment_method_collection": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"payment_status": "unpaid",
"phone_number_collection": {
"enabled": false
},
"recovered_from": null,
"saved_payment_method_options": {
"allow_redisplay_filters": null,
"payment_method_remove": null,
"payment_method_save": null
},
"setup_intent": null,
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"shipping_options": [],
"status": "open",
"submit_type": null,
"subscription": null,
"success_url": "https://example.com/success",
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
},
"ui_mode": null,
"url": "https://checkout.stripe.com/pay/c/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"adaptive_pricing": {
"enabled": true
},
"discounts": null,
"collected_information": {
"shipping_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"name": "name"
},
"business_name": null,
"individual_name": null
},
"permissions": {
"update_shipping_details": null
},
"wallet_options": {},
"origin_context": null,
"currency_conversion": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"fx_rate": "291452898",
"source_currency": "usd"
},
"customer_account": null,
"integration_identifier": null,
"managed_payments": {
"enabled": true
}
}
]
}Update a Checkout Session
POST/v1/checkout/sessions/{session}
Updates a Checkout Session object. Related guide: Dynamically update a Checkout Session
Path parameters
sessionstringRequired
Body parameters
collected_informationobjectInformation about the customer collected within the Checkout Session. Can only be set when updating
embeddedorcustomsessions.Show 1 child parameter
shipping_detailsobjectShow 2 child parameters
addressobjectRequiredChild parameters are listed in the OpenAPI document.
namestringRequired
expandarray of stringsSpecifies which fields in the response should be expanded.
line_itemsarray of objectsA list of items the customer is purchasing. When updating line items, you must retransmit the entire array of line items. To retain an existing line item, specify its
id. To update an existing line item, specify itsidalong with the new values of the fields to update. To add a new line item, specify one ofpriceorprice_dataandquantity. To remove an existing line item, omit the line item's ID from the retransmitted array. To reorder a line item, specify it at the desired position in the retransmitted array.Show 7 child parameters
adjustable_quantityobjectShow 3 child parameters
enabledbooleanRequiredmaximumintegerminimuminteger
idstringmetadataobjectpricestringprice_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
quantityintegertax_ratesarray of strings
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.shipping_optionsarray of objectsThe shipping rate options to apply to this Session. Up to a maximum of 5.
Show 2 child parameters
shipping_ratestringshipping_rate_dataobjectShow 7 child parameters
display_namestringRequireddelivery_estimateobjectChild parameters are listed in the OpenAPI document.
fixed_amountobjectChild parameters are listed in the OpenAPI document.
metadataobjecttax_behaviorstringPossible valuesexclusiveinclusiveunspecified
tax_codestringtypestringPossible valuesfixed_amount
Returns
The checkout.session object.
curl https://api.knoxapi.com/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY \
-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 response = await stripe.rawRequest('POST', '/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY', {
metadata: {
order_id: '6735',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY", metadata={
"order_id": "6735",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY', {
metadata: {
order_id: '6735',
},
}){
"after_expiration": {
"recovery": {
"allow_promotion_codes": true,
"enabled": true,
"expires_at": null,
"url": null
}
},
"allow_promotion_codes": null,
"amount_subtotal": null,
"amount_total": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"billing_address_collection": null,
"cancel_url": "https://example.com/cancel",
"client_reference_id": null,
"client_secret": null,
"consent": {
"promotions": null,
"terms_of_service": null
},
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"created": 1234567890,
"currency": null,
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer": null,
"customer_creation": null,
"customer_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "[email protected]",
"name": null,
"phone": null,
"tax_exempt": "none",
"tax_ids": null,
"business_name": null,
"individual_name": null
},
"customer_email": null,
"expires_at": 1234567890,
"id": "cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"invoice": 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,
"locale": null,
"metadata": {},
"mode": "payment",
"object": "checkout.session",
"payment_intent": "pi_1PgafyB7WZ01zgkWSjxsAJo3",
"payment_link": null,
"payment_method_collection": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"payment_status": "unpaid",
"phone_number_collection": {
"enabled": false
},
"recovered_from": null,
"saved_payment_method_options": {
"allow_redisplay_filters": null,
"payment_method_remove": null,
"payment_method_save": null
},
"setup_intent": null,
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"shipping_options": [],
"status": "open",
"submit_type": null,
"subscription": null,
"success_url": "https://example.com/success",
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
},
"ui_mode": null,
"url": "https://checkout.stripe.com/pay/c/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"adaptive_pricing": {
"enabled": true
},
"discounts": null,
"collected_information": {
"shipping_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"name": "name"
},
"business_name": null,
"individual_name": null
},
"permissions": {
"update_shipping_details": null
},
"wallet_options": {},
"origin_context": null,
"currency_conversion": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"fx_rate": "291452898",
"source_currency": "usd"
},
"customer_account": null,
"integration_identifier": null,
"managed_payments": {
"enabled": true
}
}Retrieve a Checkout Session
GET/v1/checkout/sessions/{session}
Retrieves a Checkout Session object.
Path parameters
sessionstringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The checkout.session object.
curl https://api.knoxapi.com/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY');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/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY'){
"after_expiration": {
"recovery": {
"allow_promotion_codes": true,
"enabled": true,
"expires_at": null,
"url": null
}
},
"allow_promotion_codes": null,
"amount_subtotal": null,
"amount_total": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"billing_address_collection": null,
"cancel_url": "https://example.com/cancel",
"client_reference_id": null,
"client_secret": null,
"consent": {
"promotions": null,
"terms_of_service": null
},
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"created": 1234567890,
"currency": null,
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer": null,
"customer_creation": null,
"customer_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "[email protected]",
"name": null,
"phone": null,
"tax_exempt": "none",
"tax_ids": null,
"business_name": null,
"individual_name": null
},
"customer_email": null,
"expires_at": 1234567890,
"id": "cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"invoice": 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,
"locale": null,
"metadata": {},
"mode": "payment",
"object": "checkout.session",
"payment_intent": "pi_1PgafyB7WZ01zgkWSjxsAJo3",
"payment_link": null,
"payment_method_collection": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"payment_status": "unpaid",
"phone_number_collection": {
"enabled": false
},
"recovered_from": null,
"saved_payment_method_options": {
"allow_redisplay_filters": null,
"payment_method_remove": null,
"payment_method_save": null
},
"setup_intent": null,
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"shipping_options": [],
"status": "open",
"submit_type": null,
"subscription": null,
"success_url": "https://example.com/success",
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
},
"ui_mode": null,
"url": "https://checkout.stripe.com/pay/c/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"adaptive_pricing": {
"enabled": true
},
"discounts": null,
"collected_information": {
"shipping_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"name": "name"
},
"business_name": null,
"individual_name": null
},
"permissions": {
"update_shipping_details": null
},
"wallet_options": {},
"origin_context": null,
"currency_conversion": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"fx_rate": "291452898",
"source_currency": "usd"
},
"customer_account": null,
"integration_identifier": null,
"managed_payments": {
"enabled": true
}
}Expire a Checkout Session
POST/v1/checkout/sessions/{session}/expire
A Checkout Session can be expired when it is in one of these statuses: open After it expires, a customer can’t complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
Path parameters
sessionstringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The checkout.session object.
curl -X POST https://api.knoxapi.com/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY/expire \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY/expire');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY/expire")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/checkout/sessions/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY/expire'){
"after_expiration": {
"recovery": {
"allow_promotion_codes": true,
"enabled": true,
"expires_at": null,
"url": null
}
},
"allow_promotion_codes": null,
"amount_subtotal": null,
"amount_total": null,
"automatic_tax": {
"enabled": false,
"liability": {
"type": "account"
},
"status": null,
"provider": null
},
"billing_address_collection": null,
"cancel_url": "https://example.com/cancel",
"client_reference_id": null,
"client_secret": null,
"consent": {
"promotions": null,
"terms_of_service": null
},
"consent_collection": {
"payment_method_reuse_agreement": {
"position": "hidden"
},
"promotions": null,
"terms_of_service": null
},
"created": 1234567890,
"currency": null,
"custom_fields": [],
"custom_text": {
"after_submit": {
"message": "message"
},
"shipping_address": {
"message": "message"
},
"submit": {
"message": "message"
},
"terms_of_service_acceptance": {
"message": "message"
}
},
"customer": null,
"customer_creation": null,
"customer_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": "[email protected]",
"name": null,
"phone": null,
"tax_exempt": "none",
"tax_ids": null,
"business_name": null,
"individual_name": null
},
"customer_email": null,
"expires_at": 1234567890,
"id": "cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"invoice": 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,
"locale": null,
"metadata": {},
"mode": "payment",
"object": "checkout.session",
"payment_intent": "pi_1PgafyB7WZ01zgkWSjxsAJo3",
"payment_link": null,
"payment_method_collection": null,
"payment_method_configuration_details": {
"id": "obj_123",
"parent": null
},
"payment_method_options": {},
"payment_method_types": [
"card"
],
"payment_status": "unpaid",
"phone_number_collection": {
"enabled": false
},
"recovered_from": null,
"saved_payment_method_options": {
"allow_redisplay_filters": null,
"payment_method_remove": null,
"payment_method_save": null
},
"setup_intent": null,
"shipping_address_collection": {
"allowed_countries": [
"SC"
]
},
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"shipping_options": [],
"status": "open",
"submit_type": null,
"subscription": null,
"success_url": "https://example.com/success",
"total_details": {
"amount_discount": 406046392,
"amount_shipping": null,
"amount_tax": 1424534716
},
"ui_mode": null,
"url": "https://checkout.stripe.com/pay/c/cs_test_a1YS1URlnyQCN5fUUduORoQ7Pw41PJqDWkIVQCpJPqkfIhd6tVY8XB1OLY",
"adaptive_pricing": {
"enabled": true
},
"discounts": null,
"collected_information": {
"shipping_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"name": "name"
},
"business_name": null,
"individual_name": null
},
"permissions": {
"update_shipping_details": null
},
"wallet_options": {},
"origin_context": null,
"currency_conversion": {
"amount_subtotal": 1555417355,
"amount_total": 1117121693,
"fx_rate": "291452898",
"source_currency": "usd"
},
"customer_account": null,
"integration_identifier": null,
"managed_payments": {
"enabled": true
}
}Retrieve a Checkout Session's line items
GET/v1/checkout/sessions/{session}/line_items
When retrieving a Checkout Session, 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
sessionstringRequired
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/checkout/sessions/session_123/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/checkout/sessions/session_123/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/checkout/sessions/session_123/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/checkout/sessions/session_123/line_items', {
limit: 3,
}){
"object": "list",
"url": "/v1/checkout/sessions",
"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.