# Direct Payments (directChannel)

The direct channel mechanism (`directChannel`) allows you to bypass the standard payment method selection screen on
the SimPay gateway. Using this feature, you can implement your own bank, wallet, or payment method selection view (
so-called white-label checkout) directly in your store, and then redirect the customer straight to their bank login
or application.

## Payment Flow

The following diagram shows the steps that occur from the moment the buyer selects a payment method until the
payment confirmation.


```mermaid
sequenceDiagram
    autonumber
    actor K as Buyer
    participant S as Your Store
    participant SP as SimPay
    participant B as Bank / Operator
    K ->> S: Selects a method (e.g. BLIK) on the store page
    S ->> SP: POST /transactions (with directChannel and customer data)
    SP -->> S: Response with redirect address (redirectUrl)
    S ->> K: Browser redirect to redirectUrl
    K ->> B: Bank login and payment authorization
    B -->> SP: Internal confirmation of funds received
    SP ->> S: Asynchronous Webhook (IPN): transaction_paid
    B ->> K: Return redirect of customer to the store
    S ->> K: Display thank you page and deliver goods
```

**Brief overview of the most important steps:**

* **Steps 2-3:** Your system queries our API for a new transaction, providing the channel identifier. SimPay immediately
generates a dedicated payment link (`redirectUrl`).
* **Step 4:** Your task is to redirect the customer to the received link. At this point, the customer leaves your website.
* **Step 7:** This is where the most important business logic happens. After a successful payment, SimPay sends a Webhook. At that point,
you should update the order status in your database.


## Preview of a Generated Transaction with directChannel for directChannel = `blik`

video
source

  Your browser does not support the video player.

Thanks to `directChannel`, the SimPay gateway screen appears for only a fraction of a second. The customer stays within your
store's ecosystem, which guarantees full consistency of the purchasing process. This smooth flow (so-called seamless experience) eliminates
distractions and noticeably increases the conversion rate of completed payments.

## Technical Requirements

To correctly initiate a transaction using a direct channel, the standard request sent to the endpoint
`POST /payment/{serviceId}/transactions` must be extended with additional buyer data. These are necessary for proper payment processing
and correct operation of security (anti-fraud) systems.

When creating such a transaction, you **must** pass the following objects and fields in the request body:

* **`directChannel`** – identifier of the selected payment method (e.g., `blik`, `mbank`, `paypo`).
* **`customer.countryCode`** – two-letter country code of the customer. Make sure it is appropriate for the set transaction
currency (e.g., for PLN it will be `PL`).
* **`customer.ip`** – IP address of the buyer initiating the transaction.
* **`customer.email`** – buyer's email address.
* **`antifraud.useragent`** – exact value of the `User-Agent` header from the customer's browser.


## Example Request (API)

Below is a complete example payload in JSON format for creating a direct transaction using
the BLIK channel.


```json
{
  "amount": 100.00,
  "currency": "PLN",
  "directChannel": "blik",
  "control": "Order no. 12345",
  "customer": {
    "email": "jan.kowalski@example.com",
    "countryCode": "PL",
    "ip": "192.168.1.1"
  },
  "antifraud": {
    "useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
  }
}
```

> **Important:** Passing incorrect data (e.g., your server's static IP address instead of the customer's IP) or missing
the `User-Agent` header in the `antifraud` object may result in the transaction being rejected by payment provider
security systems.


## Where to Find Values for `directChannel`?

The full list of supported channel identifiers along with allowed currencies and refund support can be found in
the payment methods overview:

👉 **[Go to: List of Payment Methods](/payment/methods)**