code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  # `source` is obtained with Stripe.js; see https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token
  stripe.Charge.create(
    amount=2000,
    currency="usd",
    source="tok_mastercard",
    description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)",
  )
  '''Response {
    "id": "ch_3LSdsa2eZvKYlo2C1pk5D2K6",
    "object": "charge",
    "amount": 2000,
    "amount_captured": 0,
    "amount_refunded": 0,
    "application": null,
    "application_fee": null,
    "application_fee_amount": null,
    "balance_transaction": "txn_1032HU2eZvKYlo2CEPtcnUvl",
    "billing_details": {
      "address": {
        "city": null,
        "country": null,
        "line1": null,
        "line2": null,
        "postal_code": null,
        "state": null
      },
      "email": null,
      "name": null,
      "phone": null
    },
    "calculated_statement_descriptor": null,
    "captured": false,
    "created": 1659518920,
    "currency": "usd",
    "customer": null,
    "description": "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)",
    "disputed": false,
    "failure_balance_transaction": null,
    "failure_code": null,
    "failure_message": null,
    "fraud_details": {},
    "invoice": null,
    "livemode": false,
    "metadata": {},
    "on_behalf_of": null,
    "outcome": null,
    "paid": true,
    "payment_intent": null,
    "payment_method": "card_1LSdsU2eZvKYlo2C1BKhCSWF",
    "payment_method_details": {
      "card": {
        "brand": "visa",
        "checks": {
          "address_line1_check": null,
          "address_postal_code_check": null,
          "cvc_check": "pass"
        },
        "country": "US",
        "exp_month": 8,
        "exp_year": 2023,
        "fingerprint": "Xt5EWLLDS7FJjR1c",
        "funding": "credit",
        "installments": null,
        "last4": "4242",
        "mandate": null,
        "moto": null,
        "network": "visa",
        "three_d_secure": null,
        "wallet": null
      },
      "type": "card"
    },
    "receipt_email": null,
    "receipt_number": null,
    "receipt_url": "https://pay.stripe.com/receipts/acct_1032D82eZvKYlo2C/ch_3LSdsa2eZvKYlo2C1pk5D2K6/rcpt_MAzsX8H9XHu2XoHLHOqQ1d3gDS78hzU",
    "redaction": null,
    "refunded": false,
    "refunds": {
      "object": "list",
      "data": [],
      "has_more": false,
      "url": "/v1/charges/ch_3LSdsa2eZvKYlo2C1pk5D2K6/refunds"
    },
    "review": null,
    "shipping": null,
    "source_transfer": null,
    "statement_descriptor": null,
    "statement_descriptor_suffix": null,
    "status": "succeeded",
    "transfer_data": null,
    "transfer_group": null,
    "source": "tok_amex"
  }'''
nl: Create a chargeTo charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).Parameters amount required Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). currency required Three-letter ISO currency code, in lowercase. Must be a supported currency. customer optional The ID of an existing customer that will be charged in this request. description optional An arbitrary string which you can attach to a Charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the description of the charge(s) that they are describing. 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. receipt_email optional The email address to which this charge’s receipt will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a Customer, the email address specified here will override the customer’s email address. If receipt_email is specified for a charge in live mode, a receipt will be sent regardless of your email settings. shipping optional dictionary Shipping information for the charge. Helps prevent fraud on charges for physical goods.Show child parameters source optional A payment source to be charged. This can be the ID of a card (i.e., credit or debit card), a bank account, a source, a token, or a connected account. For certain sources—namely, cards, bank accounts, and attached sources—you must also pass the ID of the associated customer. statement_descriptor optional For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. statement_descriptor_suffix optional Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.More parametersExpand all  application_fee_amount optional Connect only   capture optional   on_behalf_of optional Connect only   radar_options optional dictionary   transfer_data optional dictionary Connect only   transfer_group optional Connect only ReturnsReturns the charge object if the charge succeeded.
  This call will raise an error if something goes wrong.
  A common source of error is an invalid or expired card,
  or a valid card with insufficient available balance.Verification responsesIf the cvc parameter is provided, Stripe will attempt to check the correctness of the CVC,
  and will return this check's result. Similarly, if address_line1 or address_zip are provided,
  Stripe will try to check the validity of those parameters.Some card issuers do not support checking one or more of these parameters,
  in which case Stripe will return an unavailable result.Also note that, depending on the card issuer,
  charges can succeed even when passed incorrect CVC and address information.
      CVC payment_method_details.card.checks.cvc_checkpassThe CVC provided is correct.failThe CVC provided is incorrect.unavailableThe customer's card issuer did not check the CVC provided.uncheckedThe CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge.Address line payment_method_details.card.checks.address_line1_checkpassThe first address line provided is correct.failThe first address line provided is incorrect.unavailableThe customer's card issuer did not check the first address line provided.uncheckedThe first address line was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge.Address ZIP payment_method_details.card.checks.address_zip_checkpassThe ZIP code provided is correct.failThe ZIP code provided is incorrect.unavailableThe customer's card issuer did not check the ZIP code.uncheckedThe ZIP code was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge