Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
Parameters
No parameters.
More parameters
- client_
secretstring
Returns
Returns a source if a valid identifier was provided.
{ "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"}
Attaches a Source object to a Customer. The source must be in a chargeable or pending state.
Parameters
- sourcestringRequired
The identifier of the source to be attached.
- 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
.
Returns
Returns the attached Source object.
{ "id": "src_1NfRGv2eZvKYlo2Cv7NAImBL", "object": "source", "ach_credit_transfer": { "account_number": "test_52796e3294dc", "routing_number": "110000000", "fingerprint": "ecpwEzmBOSMOqQTL", "bank_name": "TEST BANK", "swift_code": "TSTEZ122" }, "amount": 1000, "client_secret": "src_client_secret_sBqfX18eq6GPfGxGvVfMByCp", "created": 1692121393, "currency": "usd", "customer": "cus_9s6XKzkNRiz8i3", "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": "121042882-38381234567890123", "amount_received": 1000, "amount_charged": 0, "amount_returned": 0, "refund_attributes_status": "missing", "refund_attributes_method": "email" }, "redaction": null, "statement_descriptor": null, "status": "chargeable", "type": "ach_credit_transfer", "usage": "reusable"}
Detaches a Source object from a Customer. The status of a source is changed to consumed
when it is detached and it can no longer be used to create a charge.
Parameters
No parameters.
Returns
Returns the detached Source object.
{ "id": "src_1Nlghd2eZvKYlo2C6RFLJcv4", "object": "source", "ach_credit_transfer": { "account_number": "test_52796e3294dc", "routing_number": "110000000", "fingerprint": "ecpwEzmBOSMOqQTL", "bank_name": "TEST BANK", "swift_code": "TSTEZ122" }, "amount": 0, "client_secret": "src_client_secret_smKYWLhbzxzgLfvhKt1QeQOn", "created": 1693610677, "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": "121042882-38381234567890123", "amount_received": 1000, "amount_charged": 1000, "amount_returned": 0, "refund_attributes_status": "missing", "refund_attributes_method": "email" }, "redaction": null, "statement_descriptor": null, "status": "consumed", "type": "ach_credit_transfer", "usage": "reusable", "customer": "cus_9s6XKzkNRiz8i3"}
Products describe the specific goods or services you offer to your customers. For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. They can be used in conjunction with Prices to configure pricing in Payment Links, Checkout, and Subscriptions.
Related guides: Set up a subscription, share a Payment Link, accept payments with Checkout, and more about Products and Prices
Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
For example, you might have a single “gold” product that has prices for $10/month, $100/year, and €9 once.
Related guides: Set up a subscription, create an invoice, and more about products and prices.