# iDEAL for Payment Setup API
To accept iDEAL payments, you must:
1. Create a payment setup.
2. Confirm the payment.
3. Redirect the customer to iDEAL.
---
## 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": 2000,
"currency": "EUR",
"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",
"reference": "ORD-5023-4E89",
"billing": {
"address": {
"address_line1": "Keizersgracht 451",
"city": "Amsterdam",
"country": "NL"
}
},
"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). Must be `EUR`.
**Required** |
| `processing_channel_id`
`string` | The [processing channel's](https://www.checkout.com/docs/business-operations/use-the-dashboard/manage-processing-channels.md) unique identifier.
**Required** |
| `settings`
`object` | Settings for the payment setup.
**Required** |
| `settings.failure_url`
`string` | The URL to redirect the customer to if the payment fails.
Max length: 1024
Format: URI
**Required** |
| `settings.success_url`
`string` | The URL to redirect the customer to after a successful payment.
Max length: 1024
Format: URI
**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 two-letter ISO 3166 country code of the billing address. Must be `NL`.
Required if `billing` is provided. |
| `billing.address.zip`
`string` | The zip or postal code of the billing address. |
| `description`
`string` | A description of the payment.
Max length: 100 |
| `payment_methods.ideal.description`
`string` | Max length: 35 |
| `reference`
`string` | A reference you can use to identify the payment. For example, an order number.
Max length: 80 |
### Response example
```json
{
"id": "set_rcmepwrchqab2wsergcafvijfy",
"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",
"amount": 2000,
"currency": "EUR",
"payment_type": "Regular",
"reference": "ORD-5023-4E89",
"description": "iDEAL payment",
"payment_methods": {
"ideal": {
"status": "ready",
"flags": []
}
},
"available_payment_methods": [
"ideal"
],
"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.
Providing all required fields sets the `payment_methods.ideal` object to 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.
- `ideal` as the `{payment_method_name}` path parameter.
### Request example
**Production**
`POST` `https://{prefix}.api.checkout.com/payments/setups/{id}/confirm/ideal`
**Sandbox**
`POST` `https://{prefix}.api.sandbox.checkout.com/payments/setups/{id}/confirm/ideal`
### Response example
If you receive a `202 Success` response with a payment `id` and a `status` field set to `Pending`, your request was successful.
```json
{
"id": "pay_yndlioum4gau3oizxihvzdgp4i",
"status": "Pending",
"customer": {
"id": "cus_xalxia5mzjau3fv5gkuylu3xla",
"email": "hannah.bret@example.com"
},
"_links": {
"self": {
"href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_yndlioum4gau3oizxihvzdgp4i"
},
"redirect": {
"href": "https://sandbox.ideal-acquiring.ing.nl/ideal/iDEALv3/issuer/simulation?transactionId=0051100036109376&random=1d2e57594bf6c948c84014856f869349ba131ba25cefe5cd57c99dd396f7a40c"
}
}
}
```
---
## Redirect the customer
Redirect the customer to the `redirect` link's `href` from the response. The customer completes the payment on the iDEAL page and is then redirected back to your `settings.success_url` or `settings.failure_url`.
> **Note**
>
> For security reasons, iDEAL forbids using custom-made in-app browsers for redirection. Checkout.com recommends that you open the device's default browser to display the redirect. If you do want to use an in-app web view, you must use [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) for iOS or [Chrome Custom Tabs](https://developer.chrome.com/multidevice/android/customtabs) for Android.
Confirmation of an iDEAL payment is communicated only through webhooks. When you receive a `payment_captured` webhook, the transaction has been completed successfully. Until the `payment_captured` webhook is received (response code `10000`), all payments are labeled as _Pending_.