code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  stripe.checkout.Session.create(
    success_url="https://example.com/success",
    cancel_url="https://example.com/cancel",
    line_items=[
      {
        "price": "price_H5ggYwtDq4fbrJ",
        "quantity": 2,
      },
    ],
    mode="payment",
  )
  '''Response {
    "id": "cs_test_a15vFKPu138xjcETgEZfTyxnbkKfnzQK1lY1QsG5fRTht29TiQtRu6BG2I",
    "object": "checkout.session",
    "after_expiration": null,
    "allow_promotion_codes": null,
    "amount_subtotal": null,
    "amount_total": null,
    "automatic_tax": {
      "enabled": false,
      "status": null
    },
    "billing_address_collection": null,
    "cancel_url": "https://example.com/cancel",
    "client_reference_id": null,
    "consent": null,
    "consent_collection": null,
    "currency": null,
    "customer": null,
    "customer_creation": null,
    "customer_details": null,
    "customer_email": null,
    "expires_at": 1659518871,
    "livemode": false,
    "locale": null,
    "metadata": {},
    "mode": "payment",
    "payment_intent": "pi_1DrPsv2eZvKYlo2CEDzqXfPH",
    "payment_link": null,
    "payment_method_options": {},
    "payment_method_types": [
      "card"
    ],
    "payment_status": "unpaid",
    "phone_number_collection": {
      "enabled": false
    },
    "recovered_from": null,
    "redaction": null,
    "setup_intent": null,
    "shipping_address_collection": null,
    "shipping_cost": null,
    "shipping_details": null,
    "shipping_options": [],
    "status": "expired",
    "submit_type": null,
    "subscription": null,
    "success_url": "https://example.com/success",
    "total_details": null,
    "url": "https://checkout.stripe.com/pay/..."
  }'''
nl: Create a SessionCreates a Session object.Parameters cancel_url required The URL the customer will be directed to if they decide to cancel payment and return to your website. mode required conditionally The mode of the Checkout Session. Required when using prices or setup mode. Pass subscription if the Checkout Session includes at least one recurring item.Possible enum valuespayment Accept one-time payments for cards, iDEAL, and more.setup Save payment details to charge your customers later.subscription Use Stripe Billing to set up fixed-price subscriptions. success_url required The URL to which Stripe should send customers when payment or setup
  is complete.
  If you’d like to use information from the successful Checkout Session on your page,
  read the guide on customizing your success page. client_reference_id optional A 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. currency optional preview feature Three-letter ISO currency code, in lowercase. Must be a supported currency. customer optional ID of an existing Customer, if one exists. In payment mode, the customer’s most recent card
  payment method will be used to prefill the email, name, card details, and billing address
  on the Checkout page. In subscription mode, the customer’s default payment method
  will be used if it’s a card, and otherwise the most recent 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 valid email, Checkout will set the email entered during the session on the Customer.
  If blank for Checkout Sessions in payment or subscription mode, Checkout will create a new Customer object based on information provided during the payment flow.
  You can set payment_intent_data.setup_future_usage to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. customer_email optional If 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 customer field. line_items optional array of hashes A list of items the customer is purchasing. Use this parameter to pass one-time or recurring Prices.
  For payment mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen.
  For subscription mode, 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 in will be on the initial invoice only.Show child parameters metadata optional dictionary Set 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. payment_method_types optional enum A list of the types of payment methods (e.g., card) this Checkout Session can accept.
  Do not include this attribute if you prefer to manage your payment methods from the Stripe Dashboard.
  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.Possible enum valuescard acss_debit affirm afterpay_clearpay alipay au_becs_debit bacs_debit Show 19 moreMore parametersExpand all  after_expiration optional dictionary   allow_promotion_codes optional   automatic_tax optional dictionary   billing_address_collection optional enum   consent_collection optional dictionary   customer_creation optional enum   customer_update optional dictionary   discounts optional array of hashes   expires_at optional   locale optional enum   payment_intent_data optional dictionary   payment_method_options optional dictionary   phone_number_collection optional dictionary   setup_intent_data optional dictionary   shipping_address_collection optional dictionary   shipping_options optional array of hashes   submit_type optional enum   subscription_data optional dictionary   tax_id_collection optional dictionary ReturnsReturns a Session object