Create a source 

Payment Methods
Sources
Create a source

Creates a new source object.

Parameters

  • typestringRequired

    The type of the source to create. Required unless customer and original_source are specified (see the Cloning card Sources guide)

  • amountinteger

    Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. Not supported for receiver type sources, where charge amount may not be specified until funds land.

  • currencyenum

    Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready.

  • metadataobject

    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.

  • ownerobject

    Information about the owner of the payment instrument that may be used or required by particular source types.

    • owner.addressobject

      Owner’s address.

      • owner.address.citystring

        City, district, suburb, town, or village.

      • owner.address.countrystring

        Two-letter country code (ISO 3166-1 alpha-2).

      • owner.address.line1string

        Address line 1 (e.g., street, PO Box, or company name).

      • owner.address.line2string

        Address line 2 (e.g., apartment, suite, unit, or building).

      • owner.address.postal_codestring

        ZIP or postal code.

      • owner.address.statestring

        State, county, province, or region.

    • owner.emailstring

      Owner’s email address.

    • owner.namestring

      Owner’s full name.

    • owner.phonestring

      Owner’s phone number.

  • redirectobject

    Parameters required for the redirect flow. Required if the source is authenticated by a redirect (flow is redirect).

    • redirect.return_urlstringRequired

      The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application.

  • statement_descriptorstring

    An arbitrary string to be displayed on your customer’s statement. As an example, if your website is RunClub and the item you’re charging for is a race ticket, you may want to specify a statement_descriptor of RunClub 5K race ticket. While many payment types will display this information, some may not display it at all.

More parameters

  • flowstring

    The authentication flow of the source to create. flow is one of redirect, receiver, code_verification, none. It is generally inferred unless a type supports multiple flows.

  • mandateobject

    Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.

    • mandate.acceptanceobject

      The parameters required to notify Stripe of a mandate acceptance or refusal by the customer.

      • mandate.acceptance.statusstringRequired

        The status of the mandate acceptance. Either accepted (the mandate was accepted) or refused (the mandate was refused).

      • mandate.acceptance.datetimestampRequired

        The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.

      • mandate.acceptance.ipstring

        The IP address from which the mandate was accepted or refused by the customer.

      • mandate.acceptance.offlineobject

        The parameters required to store a mandate accepted offline. Should only be set if mandate[type] is offline

        • mandate.acceptance.offline.contact_emailstringRequired

          An email to contact you with if a copy of the mandate is requested, required if type is offline.

      • mandate.acceptance.onlineobject

        The parameters required to store a mandate accepted online. Should only be set if mandate[type] is online

        • mandate.acceptance.online.datetimestampRequired

          The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.

        • mandate.acceptance.online.ipstringRequired

          The IP address from which the mandate was accepted or refused by the customer.

        • mandate.acceptance.online.user_agentstringRequired

          The user agent of the browser from which the mandate was accepted or refused by the customer.

      • mandate.acceptance.typestring

        The type of acceptance information included with the mandate. Either online or offline

      • mandate.acceptance.user_agentstring

        The user agent of the browser from which the mandate was accepted or refused by the customer.

    • mandate.amountinteger

      The amount specified by the mandate. (Leave null for a mandate covering all amounts)

    • mandate.currencyenum

      The currency specified by the mandate. (Must match currency of the source)

    • mandate.intervalstring

      The interval of debits permitted by the mandate. Either one_time (just permitting a single debit), scheduled (with debits on an agreed schedule or for clearly-defined events), or variable(for debits with any frequency)

    • mandate.notification_methodstring

      The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either email (an email is sent directly to the customer), manual (a source.mandate_notification event is sent to your webhooks endpoint and you should handle the notification) or none (the underlying debit network does not require any notification).

  • receiverobject

    Optional parameters for the receiver flow. Can be set only if the source is a receiver (flow is receiver).

    • receiver.refund_attributes_methodstring

      The method Stripe should use to request information needed to process a refund or mispayment. Either email (an email is sent directly to the customer) or manual (a source.refund_attributes_required event is sent to your webhooks endpoint). Refer to each payment method’s documentation to learn which refund attributes may be required.

  • source_orderobject

    Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.

    • source_order.itemsarray of objects

      List of items constituting the order.

      • source_order.items.parentstring

        The ID of the SKU being ordered.

      • source_order.items.quantityinteger

        The quantity of this order item. When type is sku, this is the number of instances of the SKU to be ordered.

    • source_order.shippingobject

      Shipping address for the order. Required if any of the SKUs are for products that have shippable set to true.

      • source_order.shipping.addressobjectRequired

        Shipping address.

        • source_order.shipping.address.line1stringRequired

          Address line 1 (e.g., street, PO Box, or company name).

        • source_order.shipping.address.citystring

          City, district, suburb, town, or village.

        • source_order.shipping.address.countrystring

          Two-letter country code (ISO 3166-1 alpha-2).

        • source_order.shipping.address.line2string

          Address line 2 (e.g., apartment, suite, unit, or building).

        • source_order.shipping.address.postal_codestring

          ZIP or postal code.

        • source_order.shipping.address.statestring

          State, county, province, or region.

      • source_order.shipping.carrierstring

        The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.

      • source_order.shipping.namestring

        Recipient name.

      • source_order.shipping.phonestring

        Recipient phone (including extension).

      • source_order.shipping.tracking_numberstring

        The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.

  • tokenstring

    An optional token used to create the source. When passed, token properties will override source parameters.

  • usagestring

    Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned.

Returns

Returns a newly created source.

POST /v1/sources
curl https://api.stripe.com/v1/sources \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d type=ach_credit_transfer \
-d currency=usd \
--data-urlencode "owner[email]"="jenny.rosen@example.com"
Response
{
"id": "src_1N3lxdLkdIwHu7ixPHXy8UcI",
"object": "source",
"ach_credit_transfer": {
"account_number": "test_eb829353ed79",
"bank_name": "TEST BANK",
"fingerprint": "kBQsBk9KtfCgjEYK",
"refund_account_holder_name": null,
"refund_account_holder_type": null,
"refund_routing_number": null,
"routing_number": "110000000",
"swift_code": "TSTEZ122"
},
"amount": null,
"client_secret": "src_client_secret_ZaOIRUD8a9uGmQobLxGvqKSr",
"created": 1683144457,
"currency": "usd",
"flow": "receiver",
"livemode": false,
"metadata": {},
"owner": {
"address": null,
"email": "jenny.rosen@example.com",
"name": null,
"phone": null,
"verified_address": null,
"verified_email": null,
"verified_name": null,
"verified_phone": null
},
"receiver": {
"address": "110000000-test_eb829353ed79",
"amount_charged": 0,
"amount_received": 0,
"amount_returned": 0,
"refund_attributes_method": "email",
"refund_attributes_status": "missing"
},
"statement_descriptor": null,
"status": "pending",
"type": "ach_credit_transfer",
"usage": "reusable"
}