code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  stripe.PaymentMethod.create(
    type="card",
    card={
      "number": "4242424242424242",
      "exp_month": 8,
      "exp_year": 2023,
      "cvc": "314",
    },
  )
  '''Response {
    "id": "pm_1LSYy32eZvKYlo2CoClVP3wb",
    "object": "payment_method",
    "billing_details": {
      "address": {
        "city": null,
        "country": null,
        "line1": null,
        "line2": null,
        "postal_code": null,
        "state": null
      },
      "email": null,
      "name": null,
      "phone": null
    },
    "card": {
      "brand": "visa",
      "checks": {
        "address_line1_check": null,
        "address_postal_code_check": null,
        "cvc_check": "unchecked"
      },
      "country": "US",
      "exp_month": 8,
      "exp_year": 2023,
      "fingerprint": "Xt5EWLLDS7FJjR1c",
      "funding": "credit",
      "generated_from": null,
      "last4": "4242",
      "networks": {
        "available": [
          "visa"
        ],
        "preferred": null
      },
      "three_d_secure_usage": {
        "supported": true
      },
      "wallet": null
    },
    "created": 1659500040,
    "customer": null,
    "livemode": false,
    "metadata": {},
    "redaction": null,
    "type": "card"
  }'''
nl: Create a PaymentMethodCreates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.
  Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.Parameters type required The type of the PaymentMethod.
  An additional hash is included on the PaymentMethod with a name matching this value.
  It contains additional information specific to the PaymentMethod type.
  Required unless payment_method is specified (see the Cloning PaymentMethods guide).Possible enum valuesacss_debit Pre-authorized debit payments are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).affirm Affirm is a buy now, pay later payment method in the US.afterpay_clearpay Afterpay / Clearpay is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.alipay Alipay is a digital wallet payment method used in China.au_becs_debit BECS Direct Debit is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).bacs_debit Bacs Direct Debit is used to debit UK bank accounts.bancontact Bancontact is a bank redirect payment method used in Belgium.Show 20 more billing_details optional dictionary Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.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.More parametersExpand all  acss_debit optional dictionary   affirm optional dictionary   afterpay_clearpay optional dictionary   alipay optional dictionary   au_becs_debit optional dictionary   bacs_debit optional dictionary   bancontact optional dictionary   blik optional dictionary   boleto optional dictionary   card optional dictionary   customer_balance optional dictionary preview feature   eps optional dictionary   fpx optional dictionary   giropay optional dictionary   grabpay optional dictionary   ideal optional dictionary   interac_present optional dictionary preview feature   klarna optional dictionary   konbini optional dictionary   link optional dictionary   oxxo optional dictionary   p24 optional dictionary   paynow optional dictionary   promptpay optional dictionary   radar_options optional dictionary   sepa_debit optional dictionary   sofort optional dictionary   us_bank_account optional dictionary   wechat_pay optional dictionary ReturnsReturns a PaymentMethod object