Sources | Stripe API Reference

Sources v1Deprecated

Source objects allow you to accept a variety of payment methods. They represent a customer’s payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

This API is deprecated. Use the PaymentMethods API instead.

Related guides: Sources API and Sources & Customers.

Was this section helpful?YesNo
Create a source
POST/v1/sources
Update a source
POST/v1/sources/:id
Retrieve a source
GET/v1/sources/:id
Attach a source
POST/v1/customers/:id/sources
Detach a source
DELETE/v1/customers/:id/sources/:id

The Source object v1Deprecated

Attributes

  • idstring

    Unique identifier for the object.

  • amountnullable integer

    A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources.

  • currencynullable enum

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

  • customernullable string

    The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer.

  • metadatanullable map

    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.

  • ownernullable object

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

  • redirectnullable object

    Information related to the redirect flow. Present if the source is authenticated by a redirect (flow is redirect).

  • statement_descriptornullable string

    Extra information about a source. This will appear on your customer’s statement every time you charge the source.

  • statusstring

    The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge.

  • typeenum

    The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used.

    Possible enum values

More attributes

  • objectstring, value is "source"

  • allow_redisplaynullable enum

  • client_secretstring

  • code_verificationnullable object

  • createdtimestamp

  • flowstring

  • livemodeboolean

  • receivernullable object

  • source_ordernullable object

  • usagenullable string

The Source object
{
"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"
}

Create a source v1

POST /v1/sources

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.

  • metadatamap

    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.

  • redirectobject

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

  • 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

  • mandateobject

  • receiverobject

  • source_orderobject

  • tokenstring

  • usagestring

Returns

Returns a newly created source.

curl https://api.stripe.com/v1/sources \
-u "sk_test_...sk_test_...:" \
-d type=ach_credit_transfer \
-d currency=usd \
--data-urlencode "owner[email]=jenny.rosen@example.com"
Response
{
"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"
}