> For the complete documentation index, see [llms.txt](https://doc.ob.ukrgasbank.com/lK1gBsaUtPKuTrcrSKw3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ob.ukrgasbank.com/lK1gBsaUtPKuTrcrSKw3/api-servisi/komplayens-api/servis-iniciyuvannya-platezhiv.md).

# Сервіс ініціювання платежів

Сервіс ініціювання платежу (PIS) дозволяє стороннім постачальникам послуг (TPP) ініціювати платежі. Для ініціювання платежу TPP потрібна авторизація (consent approval) від користувача платіжних послуг (PSU). PSU надає свою згоду під час SCA-сесії. Нижче наведено візуалізації процесу ініціювання платежу для Decoupled та Redirect SCA.

{% hint style="warning" %}
Наведені схеми зосереджуються на комунікації між TPP та XS2A-інтерфейсом Open Banking Platform (OBP), спрощуючи деталі взаємодії OBP з Банком.
{% endhint %}

## Decoupled

<div data-full-width="true"><figure><img src="https://3925264737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWOo2kMPxtN9uTnz5Xi3J%2Fuploads%2FgjYrAPncsOLnPbM8yEu5%2FUntitled%20diagram%20_%20Mermaid%20Chart-2025-09-17-075114.png?alt=media&amp;token=821390dd-b33a-4fec-bd9e-7aa0b8395e54" alt=""><figcaption></figcaption></figure></div>

1. Користувач платіжних послуг (PSU) розпочинає процес платежу через інтерфейс TPP.
2. TPP викликає `POST /payments/{payment-product}`, щоб ініціювати платіж.

```json
POST /pis/v2/payments/instant-credit-transfers
X-Request-Id: dc7b16a5-4ac8-4fdc-9c4e-9f9d0387dc07
Content-Type: application/json
Client-Redirect-Uri: https://test1.api.tieto.com
Client-Nok-Redirect-Uri: https://test1.api.tieto.com
PSU-ID: 446456475755
PSU-IP-Address: 123.321.123.321
{
  "paymentIdentification": {
    "endToEndId": "123321"
  },
  "debtorAccount": {
    "iban": "XX80BANK0000435195001",
    "currency": "UAH"
  },
  "instructedAmount": {
    "currency": "UAH",
    "amount": "12.21"
  },
  "creditor": {
    "name": "Oleksandr Shevchenko",
    "creditorId": "ME842540",
    "creditorIdType": "PSPT"
    
  },
  "creditorAccount": {
    "iban": "XX80BANK0000435195002",
    "currency": "UAH"
  },
  "remittanceInformationUnstructured": [
    "Some details"
  ]
}
```

3. OBP повертає унікальний ідентифікатор транзакції для платежу:

```json
{
  "paymentId": "e521cf62-a45f-49c5-8372-94853fffeb55",
  "transactionStatus": "RCVD",
  "_links": {
    "startAuthorisation": {
      "href": "/payments/credit-transfer/e521cf62-a45f-49c5-8372-94853fffeb55/authorisations"
    }
  }
}
```

4. TPP викликає `POST /payments/{payment-product}/{payment-id}/authorisations` (з заголовками Client-Redirect-URI та Client-Redirect-Nok-URI), щоб явно розпочати авторизацію (SCA).
5. OBP повертає повідомлення (`$.psuMessage`) для PSU, наприклад: «Авторизуйте платіж у мобільному додатку Банку»:

```json
{
    "scaStatus": "received",
    "authorisationId": "d3f9c3f2-7a8f-4c7f-9b7e-b02e6fdc9420",
    "psuMessage": "Authorize payment in Bank's mobile application",
    "_links": {
        "self": {
            "href": "/pis/v2/payments/instant-credit-transfers/e521cf62-a45f-49c5-8372-94853fffeb55/authorisations/d3f9c3f2-7a8f-4c7f-9b7e-b02e6fdc9420"
        }
    }
}
```

6. TPP відображає повідомлення від банку для PSU.
7. Банк сповіщає PSU про необхідність авторизації, наприклад, за допомогою push-сповіщення.
8. PSU використовує мобільний додаток банку, щоб авторизувати платіж.
9. Банк обробляє платіж внутрішньо після отримання авторизації.
10. TPP викликає `GET /payments/{payment-product}/{payment-id}/status`, щоб перевірити поточний статус платежу.
11. OBP надсилає запит до банку для отримання останнього статусу платежу.
12. Банк надає OBP поточний статус платежу.
13. OBP надсилає статус платежу назад до TPP (`$.consentStatus`):

```json
{
  "transactionStatus": "ACCC"
}
```

14. PSU отримує інформацію про результат платежу через інтерфейс TPP.

## Redirect

<div data-full-width="true"><figure><img src="https://3925264737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWOo2kMPxtN9uTnz5Xi3J%2Fuploads%2FqcJO9hOkSvvR4KgSGVnO%2FPayment%20Redirect%20_%20Mermaid%20Chart-2025-09-17-082742.png?alt=media&amp;token=6f75508c-834e-4b41-97d6-b177ccafe02a" alt=""><figcaption></figcaption></figure></div>

1. Користувач платіжних послуг (PSU) розпочинає процес платежу через інтерфейс TPP.
2. TPP викликає `POST /payments/{payment-product}`, щоб ініціювати платіж.

```json
POST /pis/v2/payments/instant-credit-transfers
X-Request-Id: dc7b16a5-4ac8-4fdc-9c4e-9f9d0387dc07
Content-Type: application/json
Client-Redirect-Uri: https://test1.api.tieto.com
Client-Nok-Redirect-Uri: https://test1.api.tieto.com
PSU-ID: 446456475755
PSU-IP-Address: 123.321.123.321
{
  "paymentIdentification": {
    "endToEndId": "123321"
  },
  "debtorAccount": {
    "iban": "XX80BANK0000435195001",
    "currency": "UAH"
  },
  "instructedAmount": {
    "currency": "UAH",
    "amount": "12.21"
  },
  "creditor": {
    "name": "Oleksandr Shevchenko",
    "creditorId": "ME842540",
    "creditorIdType": "PSPT"
    
  },
  "creditorAccount": {
    "iban": "XX80BANK0000435195002",
    "currency": "UAH"
  },
  "remittanceInformationUnstructured": [
    "Some details"
  ]
}
```

3. OBP повертає унікальний ідентифікатор транзакції для платежу:

```json
{
  "paymentId": "e521cf62-a45f-49c5-8372-94853fffeb55",
  "transactionStatus": "RCVD",
  "_links": {
    "startAuthorisation": {
      "href": "/payments/credit-transfer/e521cf62-a45f-49c5-8372-94853fffeb55/authorisations"
    }
  }
}
```

4. TPP викликає `POST /payments/{payment-product}/{payment-id}/authorisations` (з заголовками Client-Redirect-URI та Client-Redirect-Nok-URI), щоб явно розпочати авторизацію (SCA).
5. OBP повертає URL-адресу для SCA (`$.links.scaRedirect.href`), за якою PSU має виконати сильну автентифікацію клієнта (SCA).

```json
{
    "scaStatus": "received",
    "authorisationId": "d3f9c3f2-7a8f-4c7f-9b7e-b02e6fdc9420",
    "_links": {
        "self": {
            "href": "/pis/v2/payments/instant-credit-transfers/e521cf62-a45f-49c5-8372-94853fffeb55/authorisations/d3f9c3f2-7a8f-4c7f-9b7e-b02e6fdc9420"
        },
        "scaRedirect": {
             "href": "https://bankscaserver.com/auth/d3f9c3f2-7a8f-4c7f-9b7e-b02e6fdc9420"
        }
    }
}
```

6. TPP перенаправляє PSU на SCA Redirect URL Банку. Це вебсторінка банку, де PSU має пройти автентифікацію та авторизувати транзакцію.
7. PSU завершує авторизацію в інтерфейсі банку (веб чи мобільний застосунок).
8. Банк внутрішньо обробляє платіж.

9-10. Банк перенаправляє PSU назад до TPP, використовуючи Client-Redirect-URI, наданий TPP.

11. TPP викликає `GET /payments/{payment-product}/{payment-id}/status`, щоб перевірити поточний статус платежу.
12. OBP надсилає запит до банку для отримання останнього статусу платежу.
13. Банк надає OBP статус платежу.
14. OBP надсилає статус платежу назад до TPP:

```json
{
  "transactionStatus": "ACCC"
}
```

15. PSU отримує інформацію про результат платежу через інтерфейс TPP.

## Специфічні для PIS коди помилок (PIS-specific error codes)

<table><thead><tr><th width="387">Сценарій </th><th>HTTP статус код - Код помилки</th></tr></thead><tbody><tr><td>Зазначений платіжний продукт не підтримується ASPSP.</td><td>404 - PRODUCT_UNKNOWN</td></tr><tr><td>Запит POST на ініціювання платежу не вдався на початковому етапі процесу. Додаткова інформація може бути надана ASPSP.</td><td>400 - PAYMENT_FAILED</td></tr><tr><td>Цей сервіс недоступний для зазначеного користувача (PSU) через блокування, накладене постачальником платіжних послуг (ASPSP), незалежно від каналу доступу.</td><td>403 - SERVICE BLOCKED</td></tr></tbody></table>

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.ob.ukrgasbank.com/lK1gBsaUtPKuTrcrSKw3/api-servisi/komplayens-api/servis-iniciyuvannya-platezhiv.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
