# Bancontact for Payment Setup API
To accept Bancontact payments, you must:
1. Create a payment setup.
2. Confirm the payment.
3. Redirect the customer to Bancontact.
---
## Create a payment setup
Call the [Create a payment setup](https://api-reference.checkout.com/tag/Payment-Setups/#operation/createAPaymentSetup) endpoint.
> **Information**
>
> Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md).
**Production**
`POST` `https://{prefix}.api.checkout.com/payments/setups`
**Sandbox**
`POST` `https://{prefix}.api.sandbox.checkout.com/payments/setups`
### Request example
```json
{
"amount": 1000,
"currency": "EUR",
"customer": {
"country": "BE"
},
"payment_methods": {
"bancontact": {
"account_holder_name": "Hannah Bret"
}
},
"settings": {
"success_url": "https://example.com/payments/success",
"failure_url": "https://example.com/payments/failure"
}
}
```
In the request body, provide the following:
| Field | Description |
| --- | --- |
| `amount`
`number` | The payment amount, in the [minor currency unit](https://www.checkout.com/docs/payments/accept-payments/format-the-amount-value).
Minimum: 1
**Required** |
| `currency`
`string` | Three-letter ISO 4217 [currency code](https://www.checkout.com/docs/developer-resources/codes/currency-codes.md).
Supported value: `EUR`
**Required** |
| `customer.country`
`string` | The customer's country.
Supported value: `BE`
**Required** |
| `payment_methods.bancontact.account_holder_name`
`string` | Min length: 3
Max length: 100
**Required** |
| `settings.failure_url`
`string` | The URL to redirect the customer to if the payment fails.
Format: URI
Max length: 1024
**Required** |
| `settings.success_url`
`string` | The URL to redirect the customer to if the payment is successful.
Format: URI
Max length: 1024
**Required** |
| `billing`
`object` | The customer's billing details. |
| `billing.address`
`object` | The customer's billing address.
Required if `billing` is provided. |
| `billing.address.address_line1`
`string` | The first line of the billing address.
Required if `billing` is provided. |
| `billing.address.city`
`string` | The city of the billing address.
Required if `billing` is provided. |
| `billing.address.country`
`string` | The country of the billing address.
Required if `billing` is provided. |
| `description`
`string` | A description of the payment.
Max length: 100 |
| `reference`
`string` | A reference you can use to identify the payment.
Max length: 80 |
### Response example
```json
{
"id": "set_rcmepwrchqab2wsergcafvijfy",
"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",
"amount": 1000,
"currency": "EUR",
"payment_type": "Regular",
"reference": "ORDER_01234",
"description": "Bancontact payment",
"payment_methods": {
"bancontact": {
"status": "ready",
"flags": []
}
},
"available_payment_methods": [
"bancontact"
],
"settings": {
"success_url": "https://example.com/payments/success",
"failure_url": "https://example.com/payments/failure"
}
}
```
The response returns a `payment_methods` object, which contains the payment methods enabled on your account.
When all required fields are present, the `payment_methods.bancontact` object shows a `ready` [status](https://www.checkout.com/docs/payments/accept-payments/accept-a-payment-using-the-payment-setup-api.md#Payment_method_status).
---
## Confirm the payment
Confirm the payment by calling the [Confirm a payment setup](https://api-reference.checkout.com/tag/Payment-Setups/#operation/confirmAPaymentSetup) endpoint and provide:
- The payment setup `id` as the `{id}` path parameter.
- `bancontact` as the `{payment_method_name}` path parameter.
### Request example
**Production**
`POST` `https://{prefix}.api.checkout.com/payments/setups/{id}/confirm/bancontact`
**Sandbox**
`POST` `https://{prefix}.api.sandbox.checkout.com/payments/setups/{id}/confirm/bancontact`
### Response example
```json
{
"id": "pay_scoqartlkpzerp45c5ujmj6uue",
"status": "Pending",
"customer": {
"id": "cus_wqzgcjuiwucudpmfu7kn5mukh4"
},
"_links": {
"self": {
"href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_scoqartlkpzerp45c5ujmj6uue"
},
"redirect": {
"href": "https://trusted.girogate.de/ti/dumbdummy?tx=455332564&rs=O34Tn460YM76zZzI7yfXXPIsVnnWAhaV&cs=bb716499d072a5adfb314437c5965e1150b15550aac7a298b5d9d317653427a1"
},
"bancontact:mobile": {
"href": "BEPGenApp://DoTx?TransId=1BC.GIROGATE.DE/BCMC/123456789$ICAE3BUIH5P9U53Y5HKA9CRT"
}
}
}
```
---
## Redirect the customer
Redirect the customer to the `redirect.href` URL from the response. The customer completes the payment on the Bancontact page and is then redirected back to your `settings.success_url` or `settings.failure_url`.
Alternatively, use the `bancontact:mobile` link in the response to redirect the customer to the Bancontact mobile app. This link is only available in the production environment when the `amount` is `50000` or less (500 EUR).