# Przelewy24 for Payment Setup API
To accept Przelewy24 payments, you must:
1. Create a payment setup.
2. Confirm the payment.
3. Redirect the customer to Przelewy24.
---
## 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": "PLN",
"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",
"customer": {
"country": "PL"
},
"payment_methods": {
"p24": {
"account_holder": {
"name": "Hannah Bret",
"email": "hannah.bret@example.com"
}
}
},
"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 values: `PLN`, `EUR`
**Required** |
| `customer.country`
`string` | The two-letter ISO country code of the customer.
Supported value: `PL`
**Required** |
| `payment_methods.p24.account_holder`
`object` | The account holder's details.
**Required** |
| `payment_methods.p24.account_holder.email`
`string` | The account holder's email address.
Format: email
Max length: 254
**Required** |
| `payment_methods.p24.account_holder.name`
`string` | The account holder's name.
Min length: 3
Max length: 100
**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.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** |
| `description`
`string` | A description of the payment.
Max length: 100 |
| `reference`
`string` | A unique reference for the payment.
Max length: 80 |
### Response example
```json
{
"id": "set_rcmepwrchqab2wsergcafvijfy",
"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",
"amount": 1000,
"currency": "PLN",
"payment_type": "Regular",
"reference": "ORDER_01234",
"description": "Przelewy24 payment",
"payment_methods": {
"p24": {
"status": "ready",
"flags": []
}
},
"available_payment_methods": [
"p24"
],
"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.p24` 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.
- `p24` as the `{payment_method_name}` path parameter.
### Request example
**Production**
`POST` `https://{prefix}.api.checkout.com/payments/setups/{id}/confirm/p24`
**Sandbox**
`POST` `https://{prefix}.api.sandbox.checkout.com/payments/setups/{id}/confirm/p24`
### Response example
```json
{
"id": "pay_yo7mr2qvrj5ubirhehlbjr4yda",
"status": "Pending",
"customer": {
"id": "cus_dd7efezan2xexdfhtrhoz6tvam"
},
"_links": {
"self": {
"href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_yo7mr2qvrj5ubirhehlbjr4yda"
},
"redirect": {
"href": "https://r.girogate.de/ti/simp24?tx=431811890&rs=6FlzR3BeW8SvfX4U0H7weTEkDPSWJBVb&cs=dfcf0cab1a0522652133e8dc0302cdcae683ac07f1317b3db6450893ce007831"
}
}
}
```
---
## Redirect the customer
Redirect the customer to the `redirect` link's `href` from the response. The customer completes the payment on the Przelewy24 page and is then redirected back to your `settings.success_url` or `settings.failure_url`.
Confirmation of a Przelewy24 payment is only communicated through webhooks. All payments are labeled as _Pending_ until you receive a `payment_captured` webhook (response code `10000`), indicating a successful transaction.