# SEPA Credit Transfer payments with Sources Use Sources to accept SEPA payments sent directly from your customers. > We deprecated the Sources API and plan to remove support for local payment methods. If you currently integrate with SEPA Credit Transfer payments using the Sources API, you must [migrate to the Payment Methods API](https://docs.stripe.com/payments/payment-methods/transitioning.md). > > For information about integrating SEPA Credit Transfer payments with the current APIs, see [Migrating from Sources-based Credit transfers](https://docs.stripe.com/payments/customer-balance/migrating-from-sepa-credit-transfer.md). Stripe users in Europe can receive SEPA Credit Transfers directly from customers using [Sources](https://docs.stripe.com/sources.md)—a single integration path for creating payments using any supported method. During the payment process, a [Source](https://docs.stripe.com/api.md#sources) object is created and your customer is provided with an IBAN. Your customer uses this IBAN to make a transfer from their bank account using the SEPA system. After the transfer is received, your integration uses the source to make a charge request and complete the payment. SEPA Credit Transfers is a [push](https://docs.stripe.com/sources.md#pull-or-push-of-funds)-based and [reusable](https://docs.stripe.com/sources.md#single-use-or-reusable) method of payment. This means your customer must take action to send funds to you, which can take a few days to arrive. Once the funds have arrived, there is [synchronous confirmation](https://docs.stripe.com/sources.md#synchronous-or-asynchronous-confirmation) of any charge request made. ## Create a Source object A `Source` object is created server-side using the [Source creation endpoint](https://docs.stripe.com/api.md#create_source) with the following parameters: | Parameter | Value | | -------------- | ------------------------------------------------------ | | `type` | **sepa\_credit\_transfer** | | `currency` | **eur** (SEPA Credit Transfer payments must be in EUR) | | `owner[email]` | the full email address of the customer | ```curl curl https://api.stripe.com/v1/sources \ -u "<>:" \ -d type=sepa_credit_transfer \ -d currency=eur \ -d "owner[name]"="Jenny Rosen" \ --data-urlencode "owner[email]"="jenny.rosen@example.com" ``` Stripe returns a `Source` object containing the relevant details for the method of payment used. Information specific to SEPA is provided within the `sepa_credit_transfer` subhash. ```json { "id": "src_18cPLvAHEMiOZZp1YBngt7Yv", "object": "source", "currency": "eur", "flow": "receiver", "livemode": false, "receiver": { "address": "DE89370400440532013000", "amount_received": 0, "amount_charged": 0, "amount_returned": 0, "refund_attributes_status": "missing", "refund_attributes_method": "email" }, "sepa_credit_transfer": { "iban": "DE89370400440532013000", "bank_name": "TEST BANK", "bic": "TESTDE00", }, "owner": { "address": null, "email": "jenny.rosen@example.com", "name": null, "phone": null, "verified_address": null, "verified_email": null, "verified_name": null, "verified_phone": null }, "status": "pending", "type": "sepa_credit_transfer", "usage": "reusable" } ``` ### Error codes Source creation for SEPA Credit Transfer payments may return any of the following errors: | Error | Description | | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | | `payment_method_not_available` | The payment method is currently not available. You should invite your customer to fallback to another payment method to proceed. | | `processing_error` | An unexpected error occurred preventing us from creating the source. The source creation should be retried. | ## Have the customer push funds When creating a source, its status is initially set to `pending` and can’t yet be used to make a charge request. In addition, `receiver[amount_received]` is set to zero since no funds have yet been transferred. Your customer must transfer the amount you request so that the necessary funds are available. After creating a source, you should provide your customer the `sepa_credit_transfer[iban]`, the `sepa_credit_transfer[bic]`, and the amount you need the customer to send. *Customers* (Customer objects represent customers of your business. They let you reuse payment methods and give you the ability to track multiple payments) create a transfer with their bank, using the information you provide. Bank transfers can take up to 2 days to complete, but typically complete within 1 day from when the customer sends the funds. SEPA Credit Transfer sources are reusable and can be used for recurring payments. The information provided to the customer can be reused whenever they need to send additional funds. ## Charge the Source Once the customer makes a transfer, `receiver[amount_received]` is updated to reflect the total amount of all received transfers, and the status of the source transitions to `chargeable` (if it was already `chargeable` it won’t change). Your customer can transfer any amount across multiple transfers. Each transfer they make is represented by a [source transaction](https://docs.stripe.com/sources/sepa-credit-transfer.md#source-transactions). Since these transfers happen asynchronously (and can take days), it’s essential that your integration rely on *webhooks* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests) to determine when the source becomes chargeable to create a charge. The following webhook events are sent to notify you about changes to the status of a SEPA Credit Transfer source: | Event | Description | | ---------------------------- | -------------------------------------------------------------------------------- | | `source.chargeable` | A `Source` object becomes `chargeable` once it has received funds. | | `source.transaction.created` | Your customer has sent a transfer and a new source transaction has been created. | After the Source becomes chargeable, and before creating a charge request to complete the payment, attach it to a [Customer](https://docs.stripe.com/api.md#customers) for later reuse. ### Attaching the Source to a Customer Attaching the Source to a Customer is required for you to reuse it for future payments. The following snippet attaches the Source to a new Customer: ```curl curl https://api.stripe.com/v1/customers \ -u "<>:" \ --data-urlencode email="paying.user@example.com" \ -d source=src_18eYalAHEMiOZZp1l9ZTjSU0 ``` ### Making a charge request to finalize the payment Once attached, you can use the `Source` object’s ID along with the `Customer` object’s ID to perform a charge request and finalize the payment. #### curl ```bash curl https://api.stripe.com/v1/charges \ -u <>: \ -d amount="1000" \ -d currency="eur" \ -d customer=cus_AFGbOSiITuJVDs \ -d source=src_18eYalAHEMiOZZp1l9ZTjSU0 ``` When a charge request is made, the source’s `receiver[amount_charged]` is updated with the amount that has been used. The `receiver[amount_received]` doesn’t change. The available amount left to charge is the difference between these two values. For instance, if the value for `receiver[amount_received]` is initially `2500` (€25) and two charges of `1100` (€11) and `900` (€9) are created at separate times, the value for `receiver[amount_charged]` is `2000` (€20). The remaining amount available for charges is `500` (€5). Once all the funds have been used, the two amounts are the same. When this occurs, the status of the source transitions back to `pending`. Should the customer make any additional transfers, the source again transitions to `chargeable`. ## Confirm that the charge has succeeded Since the customer has already pushed the funds at the time the Source becomes chargeable, unless there is an unexpected error, the [Charge](https://docs.stripe.com/api.md#charge_object) will immediately succeed. You’ll also receive the following webhook event as the charge is created: | Event | Description | | ------------------ | ------------------------------------------------- | | `charge.succeeded` | The charge succeeded and the payment is complete. | We recommend that you rely on the `charge.succeeded` webhook event to notify your customer that the payment process has been completed and their order is confirmed. ## Refunds Payments made with SEPA Credit Transfer can only be submitted for refund within 180 days from the date of the original charge. After 180 days, it’s no longer possible to process the refund. SEPA Credit Transfer payments can be refunded either through the [Dashboard](https://dashboard.stripe.com/test/payments) or [API](https://docs.stripe.com/api.md#create_refund). To complete a refund, your customer must provide account information where funds should be returned to. There are two ways to collect this information. By default, Stripe automatically contacts the customer at the email address provided during source creation in the `owner[email]` field. When a refund is created, the customer is requested to fill in this information through email, after which the refund is processed automatically. Alternatively, you can obtain the customer’s account information during payment, eliminating the need for Stripe to email your customers. To do this, set the [receiver[refund_attributes_method]](https://docs.stripe.com/api/sources/object.md#source_object-receiver-refund_attributes_method) to `manual` during source creation. Listen for the [source.transaction.created](https://docs.stripe.com/api.md#event_types-source.transaction.created) webhook event whenever a payment is made to obtain the customer’s IBAN and account holder name, as values provided under `sepa_credit_transfer[sender_iban]` and `sepa_credit_transfer[sender_name]`, respectively. After you obtain the source, update it to provide the refund information using the IBAN and account holder name, along with any additional refund parameters you want to provide. | Parameter | Value | | ----------------------------------------------------------------- | ---------------------------------- | | `sepa_credit_transfer[refund_iban]` | The IBAN of the customer’s account | | `sepa_credit_transfer[refund_account_holder_name]` | The account holder’s name | | `sepa_credit_transfer[refund_account_holder_address_line1]` | The account holder’s address | | `sepa_credit_transfer[refund_account_holder_address_line2]` | | | `sepa_credit_transfer[refund_account_holder_address_city]` | | | `sepa_credit_transfer[refund_account_holder_address_state]` | | | `sepa_credit_transfer[refund_account_holder_address_postal_code]` | | | `sepa_credit_transfer[refund_account_holder_address_country]` | | ```curl curl https://api.stripe.com/v1/sources/src_1ElMI7Ld2eMUwVekm20Hfg6V \ -u "<>:" \ -d "sepa_credit_transfer[refund_iban]"=DE89370400440532013000 \ -d "sepa_credit_transfer[refund_account_holder_name]"="Jenny Rosen" ``` > Refund attributes can only be added to a source once. Any future refunds associated with this source will only be sent to the refund account information provided first. If you set the `refund_attributes_method` on a source to `manual` but didn’t provide any refund account information, you’ll receive a [source.refund_attributes_required](https://docs.stripe.com/api/events/types.md#event_types-source.refund_attributes_required) event when you attempt to create a refund. You’ll need to provide refund details through the API prior to a refund being issued. A refund’s initial status is `pending`. If the refund fails, ​​you receive the `refund.failed` event, and the status of the refund transitions to `failed`. This means that ​​we couldn’t process the refund, and you must return the funds to your customer outside of Stripe. This is rare, but might happen if the refunded account is frozen. Completed refunds have a `succeeded` status. ## Disputed payments Unlike traditional SEPA debit transactions, SEPA Credit Transfer payments can’t be reversed. A customer may request for their funds back, at which point Stripe reviews each request and can take action if it’s deemed necessary. ## Testing SEPA Credit Transfer payments When creating a `Source` object using your test API keys, a transaction is automatically created on the source. A `source.chargeable` and a `source.transaction.created` webhook event are sent immediately. The amount included in the test transaction defaults to €10.00. You can customize this amount by providing an email address of `amount_[custom_amount]@example.com` as the value for `owner[email]`. For instance, to create a test transaction of the amount €42.42, use `amount_4242@example.com`. By default, there will be no `reference` on the `SourceTransaction`. You can specify a reference much like an amount, by providing an email address of `reference_[custom_reference]@example.com` as the value for the `owner[email]`. If you would like to customize both the amount and reference, you would provide an email address of `amount_[custom_amount]-reference_[custom_reference]@example.com`. For instance, to create a test transaction of the amount €25.00 with a reference of **TESTORDER**, use `amount_2500-reference_TESTORDER@example.com`. You can also test multiple pushes to a given source by updating the `owner[email]` property using the API in a similar way. ```curl curl https://api.stripe.com/v1/sources/src_18cPLvAHEMiOZZp1YBngt6En \ -u "<>:" \ --data-urlencode "owner[email]"="amount_4242@example.com" ``` This example creates a testmode `SourceTransaction` for the specified source, with the `amount` property set to `4242`. ## Source transactions Support for retrieving source transactions in our [SDKs](https://docs.stripe.com/sdks.md) is forthcoming. In the meantime, you can make equivalent curl requests or extend our libraries yourself to add your own support. Unlike other push-based payment methods, a SEPA Credit Transfer source has no required amount that your customer must send. You can instruct your customer to send any amount, and it can be made up of multiple transfers. Your customers can also send additional amounts when necessary (for example, recurring payments). As such, sources can have multiple associated transactions. After receiving a transfer from the customer of any amount, the source becomes chargeable and is ready to use. For instance, if you request your customer to send 100 EUR, they can send the full amount in a single transfer or multiple transfers of smaller amounts (for example, four transfers of 25 EUR). In the case of recurring payments, your customer could create a recurring transfer with their bank for a specified amount, ensuring that the source always has the correct amount of funds for you to create the necessary charge requests. If the recurring amount varies, your customer can send the correct amount whenever necessary. When a transfer has been received, the source’s `receiver[amount_received]` value represents the total that has been received. `receiver[amount_received]` - `receiver[amount_charged]` gives the amount available for creating a charge with. Further transfers result in additional transactions being created, and the amount is added to the available value for `receiver[amount_received]`. For the purposes of a [refund](https://docs.stripe.com/sources/sepa-credit-transfer.md#refunding-payments), the `receiver[refund_attributes_status]` attribute is set to `available` once there are available funds and the customer has provided the necessary account information. ```json ... "receiver": { "address": "DE89370400440532013000", "amount_received": 1000, "amount_charged": 0, "amount_returned": 0, "refund_attributes_status": "available", "refund_attributes_method": "auto" }, ... ``` ### Retrieving transaction history You can retrieve a list of all transactions associated with a specific source using the following API request: #### curl ```bash curl https://api.stripe.com/v1/sources/src_1ElMI7Ld2eMUwVekm20Hfg6V/source_transactions \ -u <>: ``` Each transaction is listed with the amount that the customer transferred, along with additional information about the transfer. ```json { "object": "list", "url": "/v1/sources/src_1ElMI7Ld2eMUwVekm20Hfg6V/source_transactions", "has_more": false, "data": [ { "id": "srctxn_ldfj129843jhs09u09", "object": "source_transaction", "amount": 1000, "created": 1472746608, "currency": "eur", "type": "sepa_credit_transfer", "sepa_credit_transfer": { "sender_name": "Jenny Rosen", "sender_iban": "DE89370400440532013000", "reference": "Order 12345", }, } ], } ``` ## See also - [Other supported payment methods](https://docs.stripe.com/sources.md) - [Sources API reference](https://docs.stripe.com/api.md#sources)