# Banca abierta

## Create bank checkout session

> Starts a new bank checkout session for the payment.\
> \
> This endpoint is available only for customer-initiated payments.<br>

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"CreateBankCheckoutSessionRequest":{"type":"object","properties":{"bank":{"$ref":"#/components/schemas/CreateBankCheckoutSessionRequest.Bank"},"browserIp":{"type":"string","description":"User's browser IP address","maxLength":45,"minLength":0},"browserUserAgent":{"type":"string","description":"Exact content of the HTTP user-agent header","minLength":1},"preferredLocale":{"type":"string","description":"Preferred locale for the checkout page, defaults to the locale sent in payment initiation request","enum":["cz","da","nl","en","et","fi","fr","de","hu","it","lv","lt","no","pl","pt","ru","sk","es","sv","ua"]}},"required":["bank","browserIp","browserUserAgent"],"title":"Create bank checkout session request"},"CreateBankCheckoutSessionRequest.Bank":{"type":"object","properties":{"bankId":{"type":"string","description":"ID of the chosen bank","maxLength":255,"minLength":0}},"required":["bankId"]},"CreateBankCheckoutSessionResponse":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/RedirectToScaAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}}},"RedirectToScaAction":{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToScaAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SCA"]}}},"RedirectToScaAction.Links":{"type":"object","properties":{"scaRedirect":{"$ref":"#/components/schemas/Link","description":"Strong Customer Authentication redirect URL"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/bank":{"post":{"description":"Starts a new bank checkout session for the payment.\n\nThis endpoint is available only for customer-initiated payments.\n","operationId":"createBankCheckoutSession","parameters":[{"description":"ID of the request, unique to the call, as determined by the initiating party","in":"header","name":"X-Request-Id","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the request, unique to the call, as determined by the initiating party"}},{"description":"Unique ID of the payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankCheckoutSessionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBankCheckoutSessionResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"summary":"Create bank checkout session","tags":["Bank Session API"]}}}}
```

## Create consent

> Create consent for the payment, after completing pre-step SCA

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"CreateConsentRequest":{"type":"object","properties":{"preferredLocale":{"type":"string","description":"Preferred locale for the checkout page, defaults to the locale sent in payment initiation request","enum":["cz","da","nl","en","et","fi","fr","de","hu","it","lv","lt","no","pl","pt","ru","sk","es","sv","ua"]}},"title":"Create consent request"},"CreateConsentResponse":{"type":"object","description":"Response with Strong Customer Authentication redirect URL for creating a consent for the payment","properties":{"action":{"$ref":"#/components/schemas/RedirectToScaAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}},"title":"Create consent response"},"RedirectToScaAction":{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToScaAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SCA"]}}},"RedirectToScaAction.Links":{"type":"object","properties":{"scaRedirect":{"$ref":"#/components/schemas/Link","description":"Strong Customer Authentication redirect URL"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/{sessionId}/bank/consent":{"patch":{"description":"Create consent for the payment, after completing pre-step SCA","operationId":"createBankConsent","parameters":[{"description":"ID of the request, unique to the call, as determined by the initiating party","in":"header","name":"X-Request-Id","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the request, unique to the call, as determined by the initiating party"}},{"description":"Unique ID of the payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"description":"Unique ID of the checkout session","in":"path","name":"sessionId","required":true,"schema":{"type":"string","description":"Unique ID of the checkout session","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConsentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConsentResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"summary":"Create consent","tags":["Bank Session API"]}}}}
```

## Get bank accounts

> Get available bank accounts for the user

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"BankAccountsResponse":{"type":"object","description":"Response containing a list of available bank accounts","properties":{"action":{"$ref":"#/components/schemas/SelectAccountAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}},"title":"Bank accounts response"},"SelectAccountAction":{"type":"object","properties":{"accounts":{"type":"array","description":"List of available bank accounts","items":{"$ref":"#/components/schemas/BankAccountDetails"}},"type":{"type":"string","enum":["SELECT_ACCOUNT"]}}},"BankAccountDetails":{"type":"object","properties":{"balance":{"type":"string","description":"Available balance"},"currency":{"type":"string","description":"Bank account's currency"},"displayName":{"type":"string","description":"Display name"},"iban":{"type":"string","description":"International Bank Account Number"},"ownerName":{"type":"string","description":"Owner's name"}}},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/{sessionId}/bank/accounts":{"get":{"description":"Get available bank accounts for the user","operationId":"getBankAccounts","parameters":[{"description":"ID of the request, unique to the call, as determined by the initiating party","in":"header","name":"X-Request-Id","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the request, unique to the call, as determined by the initiating party"}},{"description":"Unique ID of the payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"description":"Unique ID of the checkout session","in":"path","name":"sessionId","required":true,"schema":{"type":"string","description":"Unique ID of the checkout session","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankAccountsResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"summary":"Get bank accounts","tags":["Bank Session API"]}}}}
```

## Confirm payment

> Confirm and initiate the payment

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"ConfirmPaymentRequest":{"type":"object","properties":{"iban":{"type":"string","description":"International Bank Account Number of the bank account to be used for the payment","maxLength":34,"minLength":0},"preferredLocale":{"type":"string","description":"Preferred language for the checkout page. Defaults to language sent in one-off or CIT request, if missing","enum":["cz","da","nl","en","et","fi","fr","de","hu","it","lv","lt","no","pl","pt","ru","sk","es","sv","ua"]}}},"ConfirmPaymentResponse":{"type":"object","description":"Response with Strong Customer Authentication redirect URL for confirming the payment","properties":{"action":{"$ref":"#/components/schemas/RedirectToScaAction"},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}},"title":"Confirm payment response"},"RedirectToScaAction":{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToScaAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SCA"]}}},"RedirectToScaAction.Links":{"type":"object","properties":{"scaRedirect":{"$ref":"#/components/schemas/Link","description":"Strong Customer Authentication redirect URL"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/{sessionId}/bank/confirm":{"patch":{"description":"Confirm and initiate the payment","operationId":"confirmBankPayment","parameters":[{"description":"ID of the request, unique to the call, as determined by the initiating party","in":"header","name":"X-Request-Id","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the request, unique to the call, as determined by the initiating party"}},{"description":"Unique ID of the payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"description":"Unique ID of the checkout session","in":"path","name":"sessionId","required":true,"schema":{"type":"string","description":"Unique ID of the checkout session","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPaymentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPaymentResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"summary":"Confirm payment","tags":["Bank Session API"]}}}}
```

## Complete payment

> Check the status of the payment and mark as completed

```json
{"openapi":"3.1.0","info":{"title":"E-commerce Gateway API","version":"1.0.0"},"servers":[{"url":"https://sandbox-api.ecomm.api.tietoevry.com"}],"security":[{"OAuth2ClientAuthentication":[]}],"components":{"securitySchemes":{"OAuth2ClientAuthentication":{"type":"openIdConnect","description":"This API uses OAuth 2 with the client credentials flow. [More info](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)","openIdConnectUrl":"https://ecomm.api.tietoevry.com/auth/realms/participants-tietoevry/protocol/openid-connect/token"}},"schemas":{"CompletePaymentResponse":{"type":"object","description":"Response containing the status of the payment","properties":{"action":{"$ref":"#/components/schemas/RedirectToShopAction"},"completionStatus":{"type":"string","description":"Status of the payment","enum":["SUCCESS","FAILED","PROCESSING"]},"sessionId":{"type":"string","description":"Unique ID of the checkout session","maxLength":64},"sessionStatus":{"type":"string","description":"Status of the checkout session","enum":["INITIALIZED","WAITING_AUTHENTICATION","WAITING_CHALLENGE","WAITING_PRE_SCA","WAITING_SCA","WAITING_CONFIRMATION","SENT_FOR_PROCESSING","FAILED","COMPLETED"],"title":"Checkout session status"}},"title":"Complete payment response"},"RedirectToShopAction":{"allOf":[{"$ref":"#/components/schemas/CardAction"},{"type":"object","properties":{"_links":{"$ref":"#/components/schemas/RedirectToShopAction.Links"},"type":{"type":"string","enum":["REDIRECT_TO_SHOP"]}}}]},"CardAction":{"discriminator":{"propertyName":"type"},"properties":{"type":{"type":"string"}},"required":["type"]},"RedirectToShopAction.Links":{"type":"object","properties":{"shopRedirect":{"$ref":"#/components/schemas/Link"}}},"Link":{"type":"object","properties":{"href":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"apiClientMessages":{"type":"array","items":{"$ref":"#/components/schemas/ApiClientMessage"}}}},"ApiClientMessage":{"type":"object","properties":{"category":{"type":"string","enum":["ERROR"]},"code":{"type":"string"},"text":{"type":"string"}}}}},"paths":{"/egw/{version}/payments/{paymentId}/sessions/{sessionId}/bank/complete":{"patch":{"description":"Check the status of the payment and mark as completed","operationId":"completeBankPayment","parameters":[{"description":"ID of the request, unique to the call, as determined by the initiating party","in":"header","name":"X-Request-Id","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the request, unique to the call, as determined by the initiating party"}},{"description":"Unique ID of the payment","in":"path","name":"paymentId","required":true,"schema":{"type":"string","description":"Unique ID of the payment","maxLength":64}},{"description":"Unique ID of the checkout session","in":"path","name":"sessionId","required":true,"schema":{"type":"string","description":"Unique ID of the checkout session","maxLength":64}},{"in":"path","name":"version","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletePaymentResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"summary":"Complete payment","tags":["Bank Session API"]}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.ecomm.api.tietoevry.com/documentation-es/referencias-de-la-api/api-para-comerciantes/pagos/sesiones/banca-abierta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
