# Table of Contents - [Documentation | Powens Documentation](#documentation-powens-documentation) - [Add a first user and connection | Powens Documentation](#add-a-first-user-and-connection-powens-documentation) - [Introduction to Transactions | Powens Documentation](#introduction-to-transactions-powens-documentation) - [Transactions | Powens Documentation](#transactions-powens-documentation) - [Quick Start | Powens Documentation](#quick-start-powens-documentation) - [API Overview | Powens Documentation](#api-overview-powens-documentation) - [Transactions integration guide | Powens Documentation](#transactions-integration-guide-powens-documentation) - [Initiating a recurring payment with the Webview | Powens Documentation](#initiating-a-recurring-payment-with-the-webview-powens-documentation) - [Cancelling a payment | Powens Documentation](#cancelling-a-payment-powens-documentation) - [Pay by Bank | Powens Documentation](#pay-by-bank-powens-documentation) - [Getting started with Pay by Bank | Powens Documentation](#getting-started-with-pay-by-bank-powens-documentation) - [Initiating a bulk payment with the Webview | Powens Documentation](#initiating-a-bulk-payment-with-the-webview-powens-documentation) - [Bank ID Check | Powens Documentation](#bank-id-check-powens-documentation) - [Wealth & Loans | Powens Documentation](#wealth-loans-powens-documentation) - [Initiating a one-time payment with the Webview | Powens Documentation](#initiating-a-one-time-payment-with-the-webview-powens-documentation) - [Validating your implementation with the test connector | Powens Documentation](#validating-your-implementation-with-the-test-connector-powens-documentation) - [Advanced | Powens Documentation](#advanced-powens-documentation) - [Listing connectors with Pay by Bank enabled programmatically | Powens Documentation](#listing-connectors-with-pay-by-bank-enabled-programmatically-powens-documentation) - [Proof & Certificates Retrieval | Powens Documentation](#proof-certificates-retrieval-powens-documentation) - [SCA & connection states | Powens Documentation](#sca-connection-states-powens-documentation) - [Legal notice | Powens Documentation](#legal-notice-powens-documentation) - [Advisory (obsolete) | Powens Documentation](#advisory-obsolete-powens-documentation) - [Indicators for Credit Check | Powens Documentation](#indicators-for-credit-check-powens-documentation) - [Connect SDK | Powens Documentation](#connect-sdk-powens-documentation) - [Advanced | Powens Documentation](#advanced-powens-documentation) - [Response signature | Powens Documentation](#response-signature-powens-documentation) - [End-to-end encryption | Powens Documentation](#end-to-end-encryption-powens-documentation) - [Powens Connect iOS | Powens Documentation](#powens-connect-ios-powens-documentation) - [Tools | Powens Documentation](#tools-powens-documentation) - [Webhooks | Powens Documentation](#webhooks-powens-documentation) - [Custom connection implementation | Powens Documentation](#custom-connection-implementation-powens-documentation) - [Glossary | Powens Documentation](#glossary-powens-documentation) - [Changing the maximum amounts for payments | Powens Documentation](#changing-the-maximum-amounts-for-payments-powens-documentation) - [Changing the manual expiration time | Powens Documentation](#changing-the-manual-expiration-time-powens-documentation) - [Confirming payments manually | Powens Documentation](#confirming-payments-manually-powens-documentation) - [Implementing your own payment validation webview | Powens Documentation](#implementing-your-own-payment-validation-webview-powens-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Welcome | Console & Webview](#welcome-console-webview) - [API design | API Reference](#api-design-api-reference) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Bank accounts | API Reference](#bank-accounts-api-reference) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Bank transactions | API Reference](#bank-transactions-api-reference) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Account ownership certificate | API Reference](#account-ownership-certificate-api-reference) - [Unknown](#unknown) - [Investments | API Reference](#investments-api-reference) - [Pockets | API Reference](#pockets-api-reference) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Market orders | API Reference](#market-orders-api-reference) - [Account Ownerships | API Reference](#account-ownerships-api-reference) - [Configuration | API Reference](#configuration-api-reference) - [Unknown](#unknown) - [Demonstration | Demo integration](#demonstration-demo-integration) - [Subscriptions | API Reference](#subscriptions-api-reference) - [Documents | API Reference](#documents-api-reference) - [Connectors | API Reference](#connectors-api-reference) - [Webview | API Reference](#webview-api-reference) - [Authentication | API Reference](#authentication-api-reference) - [Connections | API Reference](#connections-api-reference) - [Unknown](#unknown) - [Unknown](#unknown) - [Demo institution and test connectors | Console & Webview](#demo-institution-and-test-connectors-console-webview) - [Unknown](#unknown) - [Unknown](#unknown) - [Error message | Console & Webview](#error-message-console-webview) - [Set up your Webview | Console & Webview](#set-up-your-webview-console-webview) - [Reassure your users | Console & Webview](#reassure-your-users-console-webview) - [Link builder | Console & Webview](#link-builder-console-webview) - [SCARequired: best practices | Console & Webview](#scarequired-best-practices-console-webview) - [Connectors activation | Console & Webview](#connectors-activation-console-webview) - [Dashboard | Console & Webview](#dashboard-console-webview) - [Health Center | Console & Webview](#health-center-console-webview) - [Introduction | Console & Webview](#introduction-console-webview) - [Webview WYSIWYG | Console & Webview](#webview-wysiwyg-console-webview) - [Webview performance | Console & Webview](#webview-performance-console-webview) - [DOCUMENTS AGGREGATION | API Reference](#documents-aggregation-api-reference) - [Client applications | API Reference](#client-applications-api-reference) - [Errors | API Reference](#errors-api-reference) - [Users | API Reference](#users-api-reference) - [Fair usage policy | API Reference](#fair-usage-policy-api-reference) - [WEALTH AGGREGATION | API Reference](#wealth-aggregation-api-reference) - [PAYMENTS | API Reference](#payments-api-reference) - [DATA AGGREGATION | API Reference](#data-aggregation-api-reference) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Transactions attachments | API Reference](#transactions-attachments-api-reference) - [Unknown](#unknown) - [Currencies | API Reference](#currencies-api-reference) - [Unknown](#unknown) - [Bank account types | API Reference](#bank-account-types-api-reference) - [Unknown](#unknown) - [Balances | API Reference](#balances-api-reference) - [Unknown](#unknown) - [Unknown](#unknown) - [Account Ownerships | API Reference](#account-ownerships-api-reference) - [Unknown](#unknown) - [Credit notes | API Reference](#credit-notes-api-reference) --- # Documentation | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/documentation.md) . **First steps**[](https://docs.powens.com/documentation#first-steps) --------------------------------------------------------------------- [](https://docs.powens.com/documentation/integration-guides/quick-start) **Quick Start** Set up your environment and start testing [](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview) **API Overview** Understand the big picture [](https://docs.powens.com/documentation/ressources/glossary) **Glossary** Learn the most important concepts Product integration guides[](https://docs.powens.com/documentation#product-integration-guides) ----------------------------------------------------------------------------------------------- [](https://docs.powens.com/documentation/integration-guides/transactions) ![Cover](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FGLB93l2DYGVi8gKOtY9w%252FTransactions.png%3Falt%3Dmedia%26token%3D520f2640-7fd3-4195-a1c4-dbf33d5e1de5&width=490&dpr=3&quality=100&sign=dfe47a90b42713b50cab5eb4461aee22&sv=3) PSD2 **Accounts** & **transactions** [](https://docs.powens.com/documentation/integration-guides/wealth-and-loans) ![Cover](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FODwDZU8F72MHgwrhm0Sc%252FWealth%2520and%2520Loans.png%3Falt%3Dmedia%26token%3Da6697ac6-8030-4203-9975-027d1899e83f&width=490&dpr=3&quality=100&sign=49a14c3dbd5e6005b01cb061906f6e0e&sv=3) **Financial overview** of Investments, loans & crypto ![Cover](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FlEefG3et94UBM6S7GSgZ%252FPay%2520by%2520bank.png%3Falt%3Dmedia%26token%3Db625e583-2b46-48f2-b78f-15d95ab32b89&width=490&dpr=3&quality=100&sign=bad5b3e67cebcc99077d0c56711070d7&sv=3) PSD2 **Payments** [](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval) ![Cover](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252Fq2j4sn9OYGB2TICApohZ%252FProof%2520%2526%2520Certificates%2520Retrieval.png%3Falt%3Dmedia%26token%3Dde14e784-7dc6-47f5-8546-8dd3a11d7ce0&width=490&dpr=3&quality=100&sign=8c02f8e8cf8947424d5e638f9be53c93&sv=3) **Retrieve documents** Invoice, tax, payroll [](https://docs.powens.com/documentation/integration-guides/bank-id-check) ![Cover](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FHD7JZiZDuPoeTAYtOVlg%252FBank%2520ID%2520Check.png%3Falt%3Dmedia%26token%3D8c2d23c4-539b-41dc-b8ff-10efc48c19b3&width=490&dpr=3&quality=100&sign=d41f17735629dfd8a818abcbbe224b60&sv=3) **Account ownerships** from a bank account ### More information?[](https://docs.powens.com/documentation#more-information) [](https://budget-insight.notion.site/Changelog-public-edc79d1d9e0a4608928df68fafa811bb) [**Changelog**](https://budget-insight.notion.site/Changelog-public-edc79d1d9e0a4608928df68fafa811bb) Always be updated about our new realeases & features with our Changelog. **FAQ** _(coming soon)_ We put together an FAQ for you. Otherwise you could reach out to our client support for more help. [](https://www.powens.com/contact-us/) **Contact Us** Need more information? Come ask it to our API Expert Contact Us[](https://docs.powens.com/documentation#contact-us) --------------------------------------------------------------- 📧 **Email us** -> info@powens.com **📞 Support ->** [Open a ticket](https://powens.atlassian.net/servicedesk/customer/portal/14) 🐦. **Follow us** -> [Twitter](https://twitter.com/Powens_eu) / [Linkedin](https://fr.linkedin.com/company/powens) [NextQuick Start](https://docs.powens.com/documentation/integration-guides/quick-start) Last updated 13 days ago Was this helpful? --- # Add a first user and connection | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md) . Add a first user and connection[](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection#add-a-first-user-and-connection) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ If you want to initiate payments, you do not need to add user/connection, please refer to the Pay by Bank guide. ### Prerequisites[](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection#prerequisites) To start interacting with our API, make sure you have setup a domain and a client application in the administration console. ### Users and connections[](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection#users-and-connections) #### User scope[](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection#user-scope) Users of your application exist in our API. All data collected and exposed through our services is organized and scoped by _users_. We enforce isolated access to user data by issuing _user-scoped access tokens_, shared secrets that let you both authorize with our API and identify the relevant user you want to interact with. You are responsible for keeping these tokens safe, and maintain the association with your own user registry. #### Connections[](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection#connections) User data arise from _connections_. A connection materializes the link between a _user_ and one of the _connectors_ (banks or billing providers) we support. Creating a connection requires the end-user to authenticate with the connector. As long as the connection is active, we take care of synchronizing user data and expose it. You will need to let your users add a first connection before you can access its banking or billing data. ### Adding a new connection[](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection#adding-a-new-connection) You can use our [integration demo](https://integrate.powens.com/demos/connect) to experiment with the different steps described below. The simplest way to perform a connection setup is to use our [Connect webview](https://docs.powens.com/api-reference/overview/webview#add-connection-flow) , a set of web-based endpoints that complement your domain API. It will take care of letting the user choose his bank or provider, gather credentials for later sync and manage consent to the individual bank accounts or document subscriptions he wants to share with your service, enforcing GDPR requirements. The steps include: * generating a permanent user access token; * before opening the Webview, generating a temporary code from the permanent user access token; * redirecting the user to the Webview, providing the temporary code as parameter, to let him pick up a _connector_ and add a _connection_; * handling redirection after the web steps. You need to generate a permanent user access token for your new user which will create a new user on Powens side: Copy POST https://{domain}.biapi.pro/2.0/auth/init Copy { "client_id": "{clientId}", "client_secret": "{clientSecret}" } Copy { "auth_token": "{accessToken}", … } This step involves sending your client secret (a sensitive data), you must perform it from a secure environment. Then before redirecting to the Webview generate a temporary code that you will provide to the Webview URL. This is so you're not opening the Webview using the permanent access token directly. Copy GET https://{domain}.biapi.pro/2.0/auth/token/code Authenticate this request using the permanent access token you previously generated. Copy { "code": "{temporaryCode}", … } For the most simple configuration, present the following URL to your user (new lines are only added for clarity): Copy https://webview.powens.com/connect ?domain={domain} &client_id={clientId} &redirect_uri={yourCallbackUri} &code={temporaryCode} You will need to provide the `client_id` of the client application created in the administration console, and a `redirect_uri` to use as a callback that must match the white-list defined in the console. To optimize user experience, we encourage you to open the webview in a standalone fully-capable browser following [our best practices](https://docs.powens.com/api-reference/overview/webview#implementation-guidelines) . The webview appearance can be customized in the Administration console, and its behavior can be configured using [additionnal parameters](https://docs.powens.com/api-reference/overview/webview#endpoints-reference) . After the user has completed all steps in the webview, he will be redirected to your callback URL: Copy {yourCallbackUri}?connection_id={id} The connection flow can also lead to errors, reported with the `error` and `error_description` parameters, your implementation must [handle them gracefully](https://docs.powens.com/api-reference/overview/webview#implementation-guidelines) . If eligible, you can [build your custom connection implementation](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation) instead of using our webview. ### Use the access token[](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection#use-the-access-token) Congratulations, you have been provided an access token that you must save, and that you can use to interact with all our products! As soon as a connection is created, it gets synchronized (in background). If you have configured [webhooks](https://docs.powens.com/documentation/integration-guides/webhooks) , data will be pushed as soon as the synchronization complete. After creation, you should provide your users a way to manage their connections (add/delete, or manage consent to accounts). You can use our [Manage webview](https://docs.powens.com/api-reference/overview/webview#manage-connections) for this or create your own implementation. Also, you need to properly [handle the various connection states](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states) that may occur afterwards. [PreviousAPI Overview](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview) [NextTransactions](https://docs.powens.com/documentation/integration-guides/transactions) Last updated 6 months ago Was this helpful? --- # Introduction to Transactions | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions.md) . Leverage Open Banking data through a seamless integration of banking functionalities into your application, empowering your users to view their account balances, transaction history and more. Whether you are building a personal finance app, cash flow modeling or a risk analysis platform, the Transactions product offers reliable methods for accessing **checking and card accounts data.** ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252F6RLzELBimBINd00WexQo%252FFrame%25202.png%3Falt%3Dmedia%26token%3D99cfc230-4427-48ce-bd68-f34fcb461d57&width=768&dpr=3&quality=100&sign=b1e34b7a74fb36223894d958b865c2ec&sv=3) How it works[](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions#how-it-works) -------------------------------------------------------------------------------------------------------------------------------- After having the Powens API integrated, your end user will be able to connect its banks accounts. When this is done, you are allowed to access all transactions from accounts for which the end user has given their consent. Use Powens Console (from where you manage your apps and find your API credentials) to create a URL that is provided to the end user. When your user selects their URL, they go through a flow where they authenticate with their bank and connect to their bank accounts. #### End user flow[](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions#end-user-flow) ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FHgCkwTegX2XXBv2NhNfX%252FBank%2520-%2520Mobile%2520-%2520Integration%2520Guide%2520-%2520Connect%2520flow.png%3Falt%3Dmedia%26token%3Df77d9dbf-9ae1-49a8-b3de-17bb8bf0d375&width=768&dpr=3&quality=100&sign=b1e88acfb515729ce174fb4df7e32835&sv=3) Try it now with our demo tool [here](https://integrate.biapi.pro/2.0/auth/webview/connect?client_id=28105838&redirect_uri=https://docs.powens.com/demo-integration&max_connections=4) . Data-type availability[](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions#data-type-availability) ---------------------------------------------------------------------------------------------------------------------------------------------------- With Transactions, you get access to the following list of data: * Account types: checking accounts and card accounts * Account information data: Account number, label of the account, IBAN, balance, currency and usage (personal or business account) * Transaction information data: Amount, dates (book vs. value), original description, cleaned up description, type, counterparty **Note:** Transaction history depth varies from bank to bank. The minimum transaction history you can fetch is of 3 months. Endpoints[](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions#endpoints) -------------------------------------------------------------------------------------------------------------------------- * **/accounts** * Access the list of accounts and account data associated with the authenticated user. * **/transactions** * Access the list of transactions and transaction data associated with the authenticated user. Want more?[](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions#want-more) --------------------------------------------------------------------------------------------------------------------------- * For data from savings, loans and investment accounts, use Powens’ Wealth & Loans product. * For account ownership data, use Powens’ Bank ID Check product. * For transaction categorization, use Powens’ Lending Categorization product. * For statements, invoices and credit notes, use Powens’ Business Transactions product. [PreviousTransactions](https://docs.powens.com/documentation/integration-guides/transactions) [NextTransactions integration guide](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide) Last updated 6 months ago Was this helpful? --- # Transactions | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/transactions.md) . [](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions) ![Cover](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FGLB93l2DYGVi8gKOtY9w%252FTransactions.png%3Falt%3Dmedia%26token%3D520f2640-7fd3-4195-a1c4-dbf33d5e1de5&width=752&dpr=3&quality=100&sign=dfe47a90b42713b50cab5eb4461aee22&sv=3) **Introduction to** Transactions Access to structured account and transaction data from financial institutions across Europe. [](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide) ![Cover](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FebLAoupHNEwYVBcvLBx0%252FScreenshot%25202024-07-01%2520at%252010.33.30.png%3Falt%3Dmedia%26token%3D402b2250-8e1a-4db2-a866-9e9707faf385&width=752&dpr=3&quality=100&sign=2efdb1a864750a50164577ab1a234a84&sv=3) Transactions **integration guide** Follow this guide to interact with our API to access banking data of your users. [PreviousAdd a first user and connection](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) [NextIntroduction to Transactions](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions) Last updated 13 days ago Was this helpful? --- # Quick Start | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/quick-start.md) . Here you'll set up your environment to start playing with our API. If you don't know what our API is, you can refer to our [API overview](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview) . To smooth out the onboarding, along the way we notify how to be compliant with the PSD2. ### Create your account[](https://docs.powens.com/documentation/integration-guides/quick-start#create-your-account) [Sign up in our administration console](https://console.budget-insight.com/auth/register) . You can then check your inbox, confirm your account and log in. **Congratulations! Welcome to our Console.** ### Register an organization or join one[](https://docs.powens.com/documentation/integration-guides/quick-start#register-an-organization-or-join-one) Once logged in, you will have to fill a few information about your company to create your organization. Here is the information to be filled in: * company name, * company size, * country, * activity area. _Your company name will be used as organization name and also to create your first workspace._ ### Register your domain[](https://docs.powens.com/documentation/integration-guides/quick-start#register-your-domain) Once your organization and first workspace are created, click on the creation button (the large "**+**") and choose a domain name. The domain will be created as a "sandbox" configuration, and automatically suffixed with `-sandbox.biapi.pro`. Use your project name as your domain name to ease management. Avoid generic names like "test" to facilitate tickets management. In the following sections, we'll use the term "your API" to refer to calls made to your domain. ### Register a client application[](https://docs.powens.com/documentation/integration-guides/quick-start#register-a-client-application) A client application identifies a caller requesting your API. You need at least one client. The definition of a client application lets you configure the associated Webview, a ready-to-use web interface to add connections to your domain. You can configure multiple client applications if you wish to propose webviews with different settings. From the administration console: * select your domain and click on "Client Applications" on the left sidebar; * in the upper-right corner, click on "Add a client" and fill the form; * modify the logo, layout and primary colors; * configure a redirect URL that is used by the webview after the connection flow; * click on "Add a client". Your client should now appear in the list of client applications. You can define multiple redirect URLs for a single client application. You must use secure HTTPS protocol, or an app-specific scheme. The created "Client ID" and "Client secret", represent your base credentials when querying the API or requesting the webview. ### Register a webhook[](https://docs.powens.com/documentation/integration-guides/quick-start#register-a-webhook) In addition to a REST API, we provide you with a [webhook mechanism](https://docs.powens.com/documentation/integration-guides/webhooks) that is the recommanded approach to be notified when new data is available in your API. You can declare a subscription to a webhook in the console and we will push the data to your server when the appropriate event occurs. To add a webhook: * click on "Webhooks" on the left sidebar; * click on the button "Add a webhook" on the upper-righ corner; * select an event and type your server URL. ### Integrate the API[](https://docs.powens.com/documentation/integration-guides/quick-start#integrate-the-api) Well done! Now that your domain is properly configured, you can use the API starting by [adding users and connections](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) or initiating payments. For a trial or a quick demo you have the opportunity to easily test a connection with a fake connector "Connecteur de test", available in all domains. Use any username and the password "1234" to log in. [PreviousDocumentation](https://docs.powens.com/documentation) [NextAPI Overview](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview) Last updated 6 months ago Was this helpful? --- # API Overview | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview.md) . ### Overview[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#overview) Our API is a REST API which requires a communication through HTTPS to send and receive JSON documents. During your tests, we recommend to make calls to the API with curl or any other HTTP client of your choice. ### Hello world[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#hello-world) Let's start by calling the service /connectors which lists all available banks/providers. Copy curl https://{domain}.biapi.pro/2.0/connectors/ To log in to a bank/provider webpage, you'll need to know for a given connector, the fields your user should fill in the form. Let's call a specific connector and ask for an additional resource fields. Copy curl https://{domain}.biapi.pro/2.0/connectors/59?expand=fields The response here concerns only 1 connector (since we specified an id) and the resource `fields` is added to the response thanks to the query parameter `expand`. To get more interesting things done, you'll need to send authenticated requests. ### Authentication[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#authentication) The way to authenticate is by passing the `authorization: Bearer ` header in your request. At the setup several manage tokens have been generated with the different scopes (categorization, config, invoicing and user). You can use one of these tokens for now, when creating your user we'll see how to generate a user's token. Copy curl https://{domain}.biapi.pro/2.0/config \ -H 'authorization: Bearer ' This endpoint will list all the parameters you can change to adapt our API to your needs. We've covered the very first calls. Before diving deeper, let's see some general information about APIs. ### Abstract[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#abstract) #### API URL[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#api-url) Copy https://{domain}.biapi.pro/2.0 #### Requests format[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#requests-format) Data format: `application/x-www-form-urlencoded` or `application/json` (suggested) Additional headers: `authorization`: User's token (private) #### Responses format[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#responses-format) Data format: `application/json` ([http://www.json.org](http://www.json.org/) ) Charset: UTF-8 #### Resources[](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview#resources) Each call on an endpoint will return resources. The main resources are: Resources Description Accounts A bank account contained in a connection Connections A set of data used to authenticate on a website (usually a login and password). There is 1 connection for each website. Documents A document in a bank account or a provider subscription Investments An asset in a bank account Subscriptions A provider subscription contained in a connection (Trust only) Transactions An entry in a bank account Users Represent a user [PreviousQuick Start](https://docs.powens.com/documentation/integration-guides/quick-start) [NextAdd a first user and connection](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) Last updated 6 months ago Was this helpful? --- # Transactions integration guide | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide.md) . This section guides you on how to interact with our API to access banking data of your users. You must have followed the steps in “[Add a first user and connection](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) ” section. Our banking connectors are subject to the revised Payment Service Directive (PSD2) that requires a new user consent every 180 days to access the web banking platform or the bank's API. You must implement proper handling of SCA-related connection states (`SCARequired` and `webauthRequired`) [as explained in the dedicated guide](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states) . ### Banking data[](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide#banking-data) The Transactions product exposes bank accounts and transactions. ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FhTi9fIKHUa43HHpgNd4m%252FBank%2520-%2520Diagram.png%3Falt%3Dmedia%26token%3Dc755b610-79f7-40b6-b77c-bcfb509d8f07&width=768&dpr=3&quality=100&sign=57cf6b10ac0451645b84b8d7c59ff6e9&sv=3) #### Bank accounts[](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide#bank-accounts) We provide a view to the bank accounts of a user with [`/accounts` endpoints](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts) : Copy GET /users/me/accounts GET /users/me/connections/{connectionId}/accounts Copy { "accounts": [\ {\ "id": 12345,\ "name": "Compte de dépôt",\ "number": "0212366548",\ "iban": "FR1221954549412158521",\ "type": "checking",\ "balance": 1452.56,\ "coming": null,\ "currency": { "id": "EUR", … },\ …\ },\ …\ ] } Bank accounts are linked to a _connection_ (they are deleted with the connection). The accounts list reflect the set of accounts found when synchronizing with a bank, using a safe archiving rule: * when a new bank account is discovered, it is added; * when a bank account is no more found, it is marked with a [`deleted` flag](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#get-a-bank-account) and is not listed by default, but it can still be accessed by its ID or with the [`?all` parameter](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#list-bank-accounts) . GDPR enforcement requires an explicit end-user approval before fully synchronizing a bank account. By defaut, bank accounts are `disabled` when discovered and have a very limited set of values available (name), and no transactions. The webview takes care of activating them, or you can build your own user-consent interface and [update the flag](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#update-a-bank-account) . #### Transactions[](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide#transactions) We provide a view to the history of transactions of a user with [`/transactions` endpoints](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions) , which are [paginated](https://docs.powens.com/api-reference#lists-pagination) . Copy GET /users/me/transactions?limit={limit} GET /users/me/accounts/{accountId}/transactions?limit={limit} Copy { "transactions": [\ {\ "id": 56789,\ "wording": "Paiement facture Acme",\ "date": "2020-09-15",\ "rdate": "2020-09-16",\ "value": -56.78,\ "type": "card",\ …\ },\ …\ ], "first_date": "2017-02-14", "last_date": "2020-09-15", "result_min_date": "2020-08-30", "result_max_date": "2020-09-30" } Transactions are linked to a _bank account_ (they are deleted with the bank account). ### Advanced: Connection sources[](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide#advanced-connection-sources) Some banking connectors support connecting to the bank plateform both through their web interface and their PSD2-compliant API. While the _connection_ resource exposes an abstraction above these two _sources_ of data, we also support fine grained access to each source and expose the individual synchronization state of each source. Our Connect webview properly takes care of managing the sources, so handling them is optional when using it. * You can get the list of the supported sources of a connector: Copy GET /connectors?expand=sources Copy { "connectors": [\ {\ "id": 1,\ "name": "Bank name",\ "sources": [\ {\ "name": "openapi",\ "priority": 1,\ "account_types": [ … ],\ "disabled": null\ …\ },\ {\ "name": "directaccess",\ "priority": 2,\ "account_types": [ … ],\ "disabled": null\ …\ }\ ],\ …\ },\ …\ ] } Make sure the `disabled` property of a source is null before interacting with it. Also, you must honor the `priority` order of sources when adding them sequentially. * On a connection, you can access the specific `state` or `last_update` of a connection source: Copy GET /users/me/connections?expand=sources Copy { "connections": [\ {\ "id": 27,\ "last_update": "2019-09-07 16:09:40",\ "state": "SCARequired",\ "sources": [\ {\ "id": 45,\ "last_update": "2019-09-07 16:09:40",\ "state": "SCARequired",\ "source": {\ "name": "openapi",\ "priority": 1,\ …\ },\ …\ },\ {\ "id": 46,\ "state": null,\ "source": {\ "auth_mechanism": "credentials",\ "name": "directaccess",\ "priority": 2,\ …\ },\ …\ }\ ]\ }\ ] } [PreviousIntroduction to Transactions](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions) [NextBank ID Check](https://docs.powens.com/documentation/integration-guides/bank-id-check) Last updated 6 months ago Was this helpful? --- # Initiating a recurring payment with the Webview | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview.md) . This feature must be enabled by your commercial contact. Note that this guide assumes you have the following information on hand: * A Powens domain with Pay by Bank enabled. * A Powens domain client with client identifiers, thereafter named `clientId` and `clientSecret`. * A URL to redirect the end user to at the end of the process, registered with the client, thereafter named `redirectURL`. * An optional state that will be transmitted to your redirect URL, thereafter named `optionalRedirectState`. Recurring payments are payments executed periodically by the bank. Once initiated, the bank will create instances of the recurring payment according to the provided schedule, without the need for the end user to validate the execution. The basic initiation workflow is the same as in [Initiating a one-time payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview) , with the following notable differences: * The payment object only contains one instruction, with the execution date type being `"periodic"`, and additional properties representing the schedule to be set. * The payment status needs to be interpreted differently. The basic initiation workflow will be the following: ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FxBeWEuDGDgKYh9FNCtEe%252FPay-%2520Diagram-min2.png%3Falt%3Dmedia%26token%3Daa631c94-c111-4543-81b5-428bd14a518d&width=768&dpr=3&quality=100&sign=b91fb39ed8e535eba0d4043ae3bc8383&sv=3) Obtain a token suitable for creating recurring payments[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#obtain-a-token-suitable-for-creating-recurring-payments) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In order to create recurring payments, we need a special access token with the `payments:admin` scope, obtained using client credentials: Copy POST /auth/token Copy { "grant_type": "client_credentials", "client_id": "{clientId}", "client_secret": "{clientSecret}", "scope": "payments:admin", } Copy { "token": "{accessToken}", "scope": "payments:admin" } See [Service Tokens](https://docs.powens.com/api-reference/overview/authentication#service-tokens) for more information. Create a recurring payment[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#create-a-recurring-payment) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ You can now create a recurring payment request with the following request: Copy POST /payments Monthly recurring payment Daily recurring payment Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "ABC123 Monthly Rent",\ "amount": 1050,\ "currency": "EUR",\ "execution_date_type": "periodic",\ "frequency": "monthly",\ "start_date": "2023-09-04",\ "end_date": "2025-01-01",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ }\ ], "payer_identity": { "kind": "individual", "first_name": "Germaine", "last_name": "Michu", "birth_date": "1963-01-01", "birth_city": "Paris", "birth_country": "FR", "nationality": "French" } } Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "ABC123 Daily fixed server costs",\ "amount": 3.50,\ "currency": "EUR",\ "execution_date_type": "periodic",\ "frequency": "daily",\ "start_date": "2023-09-01",\ "end_date": "2024-09-01",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ }\ ], "payer_identity": { "kind": "individual", "first_name": "Germaine", "last_name": "Michu", "birth_date": "1963-01-01", "birth_city": "Paris", "birth_country": "FR", "nationality": "French" } } Copy { "id": {paymentId}, "state": "created", "error_code": null, "error_description": null, … } A `payer_identity` for the recurring payment request and a `beneficiary_identity` for every instruction are required and must contain information on either the payer (which you redirect to the webview) or the beneficiary (matching the routing information). For the definition of such objects, see the [Identity object](https://docs.powens.com/api-reference/products/payments/payments#identity-resource) definition. The following are examples of different identity kinds with Pay: Individual Company Copy { "kind": "individual", "external_ref": "MY-CUSTOMER-REFERENCE-012345678", "first_name": "Jean", "last_name": "Dupont", "nationality": "FR", "postal_address": "Appartement 25\nEntrée B Résidence Les Iris\n3 Boulevard du Levant\n95220 HERBLAY" } Copy { "kind": "corporate", "org_name": "Powens", "org_legal_status": "SAS", "org_hq_address": "84 RUE BEAUBOURG\n75003 PARIS 3\nFRANCE", "scheme_name": "siren", "identification": "749867206" } See the [`POST /payments` endpoint reference](https://docs.powens.com/api-reference/products/payments/payments#initiate-a-payment) and [the `PaymentInitRequest` object description](https://docs.powens.com/api-reference/products/payments/payments#paymentinitrequest-object) for more information on the payload or returned information. Obtain the recurring payment validation token[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#obtain-the-recurring-payment-validation-token) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In order for the payer to be able to validate the recurring payment request, you first need to create a token scoped to validate the created recurring payment specifically. You can do this using the token created in [Obtain a token suitable for creating payments](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#obtain-a-token-suitable-for-creating-payments) : Copy POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} Copy { "scope": ["payments:validate"] } Copy { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires_in": 604800, "id_payment": {paymentId} } See the [`POST /payments/{id}/scopedtoken` endpoint reference](https://docs.powens.com/api-reference/products/payments/payments#generate-a-payment-scoped-token) for more information. Build the recurring payment validation URL[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#build-the-recurring-payment-validation-url) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now that you have the recurring payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: * `domain`: your client domain. * `client_id`: the client identifier for your application (`clientId`). * `redirect_uri`: the same redirect URL you've used when creating the recurring payment (`redirectURL`). * `state`: the same state you've used when creating the recurring payment (`optionalRedirectState`). * `code`: The scoped token you've generated on your previous request to the API. * `payment_id`: the identifier of the recurring payment. This will make you obtain a URL of the form: Copy https://{domain}.biapi.pro/2.0/auth/webview/payment?client_id={clientId}&redirect_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment_id={paymentId} You can redirect your payer to this URL. Receive a callback from the payer[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#receive-a-callback-from-the-payer) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Once the payer has either completed the recurring payment validation flow, or has cancelled from either our Webview or the bank's interface, they will go on the callback URL you have configured on the payment with the following parameters: * `state`: the optional client state you have configured on the recurring payment, i.e. `{optionalClientState}`. * `id_payment`: the identifier of the recurring payment that the user comes from. * `error` (_optional_): set to "`cancelled`" if the payer has cancelled the recurring payment from our Webview. * `error_code` (_optional_): set to the recurring payment's error code, if the payment has been cancelled or rejected by the bank. * `bank_message` (_optional_): set to the bank message, if available. * `payment_state` (_optional_): the state of the recurring payment, if the payer has been redirected by the bank. For security reasons, following such a callback from the payer, it is recommended to check the recurring payment's state manually; see [Get the recurring payment status](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#get-the-recurring-payment-status) . Check on a recurring payment's state[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#check-on-a-recurring-payments-state) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- During and after the initiation of a recurring payment, you may want to check on the status of said recurring payment, or to get data back from the recurring payment initiation request. ### Receive recurring payment updated events using webhooks (recommended method)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#receive-recurring-payment-updated-events-using-webhooks-recommended-method) In order to receive updates when a recurring payment switches states, it is recommended to [set up the Payment Updated webhook](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank#configure-the-payment-state-updated-webhook) and wait for events regarding recurring payments. Webhook events will only be triggered during a background refresh / synchronization of the recurring payment's state. For more information, see [Webhooks](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. ### Get the recurring payment status[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#get-the-recurring-payment-status) This method is **not recommended for polling** the recurring payment's status regularly, it is recommended to wait for incoming webhook events to this end. However, it is recommended for when receiving a callback regarding a recurring payment from an end user, or for debugging purposes. In order to get a given recurring payment's status, you can call the `GET /payments/{id}` endpoint, with the identifier of the recurring payment. See [API endpoints](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. ### Process the recurring payment status[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview#process-the-recurring-payment-status) In the resulting recurring payment resource, you are to get the `state` property, and do the following: * If the status is `pending`, it is currently active and being executed periodically. * If the status is `expired`, it means that the recurring payment will not be updated anymore. * If the status is `accepted`, it means that the initiation was successful but the bank will not provide further updates; if you accept the risks, you can consider the recurring payment as active or done. * If the status is `done`, it means that all required executions have been done. * If the status is `rejected`, it means that the recurring payment has been rejected by the bank, or stopped by the end user through the bank. A recurring payment with the `accepted` status could still be rejected by the bank (e.g. for insufficient funds at execution time), however we can no longer poll the recurring payment's status on our side. If you want to avoid such cases, you can identify connectors with this behaviour by checking the `partial_status_tracking` property of connectors; see [Listing connectors with Pay by Bank enabled programmatically](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically) . See the [Payment object](https://docs.powens.com/api-reference/products/payments/payments#payment-object) definition for reference. [PreviousInitiating a bulk payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview) [NextCancelling a payment](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment) Last updated 6 months ago Was this helpful? --- # Cancelling a payment | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment.md) . Depending on the type of payment and whether the connector allows it or not, it may be possible to cancel a payment through our API once it has been validated and confirmed, before it has been executed. This guide assumes you are cancelling a payment respecting the following criteria: * The state of the payment is either `created` or `pending`. * If the state of the payment is `pending`, the execution date type of all instructions in the payment is not `instant`. Note that this guide assumes you have the following information on hand: * A Powens domain with Pay by Bank enabled. * A Powens domain client with client identifiers, thereafter named `clientId` and `clientSecret`. * A URL to redirect the end user to at the end of the process, registered with the client, thereafter named `redirectURL`. * An optional state that will be transmitted to your redirect URL, thereafter named `optionalRedirectState`. * A payment you wish to cancel, for which the identifier will be represented as `paymentId`. Initiate the cancellation[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment#initiate-the-cancellation) ------------------------------------------------------------------------------------------------------------------------------------------------- You first need to request the cancellation from our API, by doing the following request: Copy POST /payments/{paymentId} Copy { "cancel": true, "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}" } From here, you can obtain multiple responses corresponding to multiple scenarios: Cancellation successful End user validation required Cancellation is not supported If the cancellation could successfully be done without any validation by the end user, the response looks like the following: Copy { "id": {paymentId}, "state": "rejected", "error_code": "cancelledByUser", ... } Some cancellations require a validation by the end user. In this case, the response looks like the following: Copy { "id": {paymentId}, "state": "pending", "state_detail": "cancelling", ... } If the connector doesn't support cancelling the provided payment, the following response will be received: Copy { "code": "notSupported", "description": "Bad request, please check your request parameters.", ... } Validate a payment cancellation if necessary[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment#validate-a-payment-cancellation-if-necessary) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If the cancellation requires validation from the end user, the payment state will stays in `pending` , its `state_detail` will be `cancelling`, and the `validate_uri` field of the payment resource will be populated with a link to the PSU's bank. In this case, the PSU must be redirected to this URL. ### Receive a callback from the payer[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment#receive-a-callback-from-the-payer) If the payment cancellation needed an approval from the PSU, you will need to handle the callback at the end of the cancellation flow. Once the payer has either completed the payment cancellation flow, they will go on the callback URL you have configured on the payment with the following parameters: * `state`: the optional client state you have configured on the payment, i.e. `{optionalClientState}`. * `id_payment`: the identifier of the payment that the user comes from. * `error_code` (_optional_): set to the payment's error code, if the payment has been cancelled or rejected by the bank. * `bank_message` (_optional_): set to the bank message, if available. * `payment_state` (_optional_): the state of the payment, if the payer comes from the bank's interface. For security reasons, it is recommended to check the payment's state manually; see [Get the payment status](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#get-the-payment-status) . [PreviousInitiating a recurring payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview) [NextValidating your implementation with the test connector](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector) Last updated 6 months ago Was this helpful? --- # Pay by Bank | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank.md) . These sections will introduce you to enabling, configuring and using the Pay by Bank product to create, validate, and follow up on payment requests. [PreviousWealth & Loans](https://docs.powens.com/documentation/integration-guides/wealth-and-loans) [NextGetting started with Pay by Bank](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank) Last updated 6 months ago Was this helpful? --- # Getting started with Pay by Bank | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank.md) . The Pay by Bank product allows you to initiate and follow up on payments with banks complying with the revised Payment Service Directive (PSD2). It does not require bank account aggregation made beforehand: you may request payments from an emitter bank _without_ creating a connection in our API. If you do not have a domain yet, you can preview connectors supporting the Pay by Bank product by going on [Powens Institutions](https://institutions.powens.com/) , and selecting "Pay" on the left hand side. Enable Pay by Bank on your domain[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank#enable-pay-by-bank-on-your-domain) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Pay by Bank features can be activated by your commercial contact only. Enable Pay by Bank connectors[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank#enable-pay-by-bank-connectors) --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Going on the [console](https://console.budget-insight.com/) , selecting your domain then selecting "Pay" on the left. From there, you can enable connectors you want to use on your domain. Configure the Payment State Updated Webhook[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank#configure-the-payment-state-updated-webhook) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- It is highly recommended to configure the `PAYMENT_STATE_UPDATED` webhook; see [Webhooks](https://docs.powens.com/documentation/integration-guides/webhooks) for more information on how webhooks work. [PreviousPay by Bank](https://docs.powens.com/documentation/integration-guides/pay-by-bank) [NextInitiating a one-time payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview) Last updated 6 months ago Was this helpful? --- # Initiating a bulk payment with the Webview | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview.md) . Note that this guide assumes you have the following information on hand: * A Powens domain with Pay by Bank enabled. * A Powens domain client with client identifiers, thereafter named `clientId` and `clientSecret`. * A URL to redirect the end user to at the end of the process, registered with the client, thereafter named `redirectURL`. * An optional state that will be transmitted to your redirect URL, thereafter named `optionalRedirectState`. Bulk payments are payments with multiple instructions to be executed once by the bank. They are equivalent to initiating multiple one-time payments, except that there is only one connector and one validation for all of the instructions. Akin to one-time payments, the instructions of a bulk payment can have different types: * **"First open day" payments**: classic payments usually executed within a few business days (SEPA Credit Transfers, GB BACS, GB CHAPS, GB Faster Payments, ...). * **"Instant" payments**: payments usually executed within a few minutes (SEPA Instant Credit Transfers). * **"Deferred" payments**: classic payments only executed at a provided future date. Currently, all instructions of a given payment must have the same type, and for deferred bulk payments, all instructions must be executed on the same day. The basic initiation workflow is the same as in [Initiating a one-time payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview) , with the following notable differences: * The payment object contains two or more instructions. * The payment status needs to be interpreted differently. The basic initiation workflow will be the following: Obtain a token suitable for creating bulk payments[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#obtain-a-token-suitable-for-creating-bulk-payments) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In order to create bulk payments, we need a special access token with the `payments:admin` scope, obtained using client credentials: Copy POST /auth/token Copy { "grant_type": "client_credentials", "client_id": "{clientId}", "client_secret": "{clientSecret}", "scope": "payments:admin", } Copy { "token": "{accessToken}", "scope": "payments:admin" } See [Service Tokens](https://docs.powens.com/api-reference/overview/authentication#service-tokens) for more information. Create a bulk payment[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#create-a-bulk-payment) --------------------------------------------------------------------------------------------------------------------------------------------------------------- You can now create a bulk payment request with the following request: Copy POST /payments Classic bulk payment Instant bulk payment Deferred bulk payment Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "ABC123 ACME Corp Mar 2020 Charges",\ "amount": 550,\ "currency": "EUR",\ "execution_date_type": "first_open_day",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ },\ {\ "label": "DEF456 CMEA Corp Mar 2020 Charges",\ "amount": 300,\ "currency": "EUR",\ "execution_date_type": "first_open_day",\ "beneficiary": {\ "scheme_iban": "iban",\ "identification": "FR76YYYYYYYYYYYYYYY",\ "label": "CMEA Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "CMEA Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siret",\ "identification": "876543210000025",\ }\ }\ ], "payer_identity": { "kind": "corporate", "org_name": "Jean-Michel-Thierry Couverture", "org_legal_status": "EIRL", "scheme_name": "siren", "identification": "111222333" } } Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "ABC123 ACME Corp Mar 2020 Charges",\ "amount": 550,\ "currency": "EUR",\ "execution_date_type": "instant",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ },\ {\ "label": "DEF456 CMEA Corp Mar 2020 Charges",\ "amount": 300,\ "currency": "EUR",\ "execution_date_type": "instant",\ "beneficiary": {\ "scheme_iban": "iban",\ "identification": "FR76YYYYYYYYYYYYYYY",\ "label": "CMEA Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "CMEA Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siret",\ "identification": "876543210000025",\ }\ }\ ], "payer_identity": { "kind": "corporate", "org_name": "Jean-Michel-Thierry Couverture", "org_legal_status": "EIRL", "scheme_name": "siren", "identification": "111222333" } } Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "ABC123 ACME Corp Mar 2020 Charges",\ "amount": 550,\ "currency": "EUR",\ "execution_date_type": "deferred",\ "execution_date": "2024-01-05",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ },\ {\ "label": "DEF456 CMEA Corp Mar 2020 Charges",\ "amount": 300,\ "currency": "EUR",\ "execution_date_type": "deferred",\ "execution_date": "2024-01-05",\ "beneficiary": {\ "scheme_iban": "iban",\ "identification": "FR76YYYYYYYYYYYYYYY",\ "label": "CMEA Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "CMEA Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siret",\ "identification": "876543210000025",\ }\ }\ ], "payer_identity": { "kind": "corporate", "org_name": "Jean-Michel-Thierry Couverture", "org_legal_status": "EIRL", "scheme_name": "siren", "identification": "111222333" } } Copy { "id": {paymentId}, "state": "created", "error_code": null, "error_description": null, … } A `payer_identity` for the bulk payment request and a `beneficiary_identity` for every instruction is required and must contain information on either the payer (which you redirect to the webview) or the beneficiary (matching the routing information). For the definition of such objects, see the [Identity object](https://docs.powens.com/api-reference/products/payments/payments#identity-resource) definition. The following are examples of different identity kinds with Pay: Individual Company Copy { "kind": "individual", "external_ref": "MY-CUSTOMER-REFERENCE-012345678", "first_name": "Jean", "last_name": "Dupont", "nationality": "FR", "postal_address": "Appartement 25\nEntrée B Résidence Les Iris\n3 Boulevard du Levant\n95220 HERBLAY" } Copy { "kind": "corporate", "org_name": "Powens", "org_legal_status": "SAS", "org_hq_address": "84 RUE BEAUBOURG\n75003 PARIS 3\nFRANCE", "scheme_name": "siren", "identification": "749867206" } See the [`POST /payments` endpoint reference](https://docs.powens.com/api-reference/products/payments/payments#initiate-a-payment) and [the `PaymentInitRequest` object description](https://docs.powens.com/api-reference/products/payments/payments#paymentinitrequest-object) for more information on the payload or returned information. Obtain the bulk payment validation token[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#obtain-the-bulk-payment-validation-token) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In order for the payer to be able to validate the bulk payment request, you first need to create a token scoped to validate the created bulk payment specifically. You can do this using the token created in [Obtain a token suitable for creating payments](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#obtain-a-token-suitable-for-creating-payments) : Copy POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} Copy { "scope": ["payments:validate"] } Copy { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires_in": 604800, "id_payment": {paymentId} } See the [`POST /payments/{id}/scopedtoken` endpoint reference](https://docs.powens.com/api-reference/products/payments/payments#generate-a-payment-scoped-token) for more information. Build the bulk payment validation URL[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#build-the-bulk-payment-validation-url) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now that you have the bulk payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: * `domain`: your client domain. * `client_id`: the client identifier for your application (`clientId`). * `redirect_uri`: the same redirect URL you've used when creating the bulk payment (`redirectURL`). * `state`: the same state you've used when creating the bulk payment (`optionalRedirectState`). * `code`: The scoped token you've generated on your previous request to the API. * `payment_id`: the identifier of the bulk payment. This will make you obtain a URL of the form: Copy https://{domain}.biapi.pro/2.0/auth/webview/payment?client_id={clientId}&redirect_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment_id={paymentId} You can redirect your payer to this URL. Receive a callback from the payer[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#receive-a-callback-from-the-payer) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Once the payer has either completed the bulk payment validation flow, or has cancelled from either our Webview or the bank's interface, they will go on the callback URL you have configured on the payment with the following parameters: * `state`: the optional client state you have configured on the bulk payment, i.e. `{optionalClientState}`. * `id_payment`: the identifier of the bulk payment that the user comes from. * `error` (_optional_): set to "`cancelled`" if the payer has cancelled the bulk payment from our Webview. * `error_code` (_optional_): set to the bulk payment's error code, if the payment has been cancelled or rejected by the bank. * `bank_message` (_optional_): set to the bank message, if available. * `payment_state` (_optional_): the state of the bulk payment, if the payer has been redirected by the bank. For security reasons, following such a callback from the payer, it is recommended to check the bulk payment's state manually; see [Get the bulk payment status](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#get-the-bulk-payment-status) . Check on a bulk payment's state[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#check-on-a-bulk-payments-state) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- During and after the initiation of a bulk payment, you may want to check on the status of said bulk payment, or to get data back from the bulk payment initiation request. ### Receive bulk payment updated events using webhooks (recommended method)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#receive-bulk-payment-updated-events-using-webhooks-recommended-method) In order to receive updates when a bulk payment switches states, it is recommended to [set up the Payment Updated webhook](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank#configure-the-payment-state-updated-webhook) and wait for events regarding bulk payments. Webhook events will only be triggered during a background refresh/synchronization of the bulk payment's state. Webhook events will not be emitted if only an instruction changes states, only if the payment changes states, i.e. if all instructions reach a final state. For more information, see [Webhooks](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. ### Get the bulk payment status[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#get-the-bulk-payment-status) This method is **not recommended for polling** the bulk payment's status regularly, it is recommended to wait for incoming webhook events to this end. However, it is recommended for when receiving a callback regarding a bulk payment from an end user, or for debugging purposes. In order to get a given bulk payment's status, you can call the `GET /payments/{id}` endpoint, with the identifier of the bulk payment. See [API endpoints](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. ### Process the bulk payment statuses[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview#process-the-bulk-payment-statuses) In the resulting bulk payment resource, you are to get both the `state` property of the payment, and if it is available, the `state` property of every of its instructions. At instruction-level, if the status is not `null`, you can conclude the following: * If the status is `pending`, the instruction is still awaiting execution. * If the status is `rejected`, the instruction has been rejected by either the bank, or the end user through the bank. * If the status is `accepted`, the bank will not provide further updates past the initiation for this instruction; if you accept the risks, you can consider this instruction as executed. * If the status is `done`, the instruction has been executed by the bank. The bulk payment's state property signifies, at a higher level, of the status of its instructions: * If the bulk payment's state is `pending`, at least one instruction is still awaiting execution. You probably still want to check the instructions' statuses to find out if some instructions have changed state. * If the bulk payment's state is `rejected`, all instructions are considered to have the `rejected` status. * If the bulk payment's state is `accepted`, all instructions are considered to have the `accepted` status. * If the bulk payment's state is `done`, all instructions are considered to have the `done` status. * If the bulk payment's state is `partial`, at least one instruction is either `done` or `accepted`, and at least one instruction is considered to have the `rejected` status. In the case the bank reports a `partial` status with no detail regarding the state of the instructions, the payment will be reported having the `partial` status, and all of its instructions will have the `accepted` status. See the [Payment object](https://docs.powens.com/api-reference/products/payments/payments#payment-object) definition for reference. [PreviousInitiating a one-time payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview) [NextInitiating a recurring payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview) Last updated 6 months ago Was this helpful? --- # Bank ID Check | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/bank-id-check.md) . ### Bank ID Check data[](https://docs.powens.com/documentation/integration-guides/bank-id-check#banking-data) The Check product exposes account ownerships. ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FopimZ0Dm60m5m3J5rR3T%252FCheck%2520-%2520Diagram.png%3Falt%3Dmedia%26token%3Dc8e7e225-0cf8-476c-8ae6-1938ecd6a88d&width=768&dpr=3&quality=100&sign=02a55427d91cffbf18307853a80f1639&sv=3) #### Check account[](https://docs.powens.com/documentation/integration-guides/bank-id-check#bank-accounts) We provide a view of the bank account of a user with [/account\_ownerships endpoint](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships) : Copy GET /users/me/account_ownerships GET /users/me/connections/{connectionId}/account_ownerships Copy { "account_ownerships": [\ {\ "id_account": 12345,\ "id_connection": 1234,\ "id_user": 123,\ "id_connector_source": 1234,\ "name": "Compte de dépôt",\ "usage": "PRIV",\ "bank_name": "Bank",\ "multiple_holders": "null",\ "calculated": [],\ "parties": [\ {\ "role": "holder",\ "identity": {\ "is_user": true,\ "full_name": "DOE John"\ }\ },\ ...\ ],\ "identifications": [\ {\ "scheme_name": "iban",\ "identification": "FR1221954549412158521"\ },\ ...\ ]\ }\ ], "total": 1 } Check account is linked to a _connection_ (they are deleted with the connection). **Ownership certificate** The same ownership data can be delivered as a PDF certificate, intended to be handed to a third party as proof that the account data was legitimately obtained. It attests that the end user consented on a given date, and lists the accounts they hold. Copy GET /users/me/connections/{connectionId}/certificate See [Account ownership certificate](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate) for the configuration keys, the certificate content and the error cases. [PreviousTransactions integration guide](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide) [NextWealth & Loans](https://docs.powens.com/documentation/integration-guides/wealth-and-loans) Last updated 1 month ago Was this helpful? --- # Wealth & Loans | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/wealth-and-loans.md) . The Wealth & Loans product is an extension of the [Transactions product](https://docs.powens.com/documentation/integration-guides/transactions) . Beyond the collection of PSD2-compliant accounts, Wealth & Loans extends the scope to all other accounts (loans, savings accounts, market accounts, life insurances, retirement savings, company savings…). Wealth & Loans also enables the collection of additional information on these accounts, such as the valuation, the valuation differential and the previous differential. Finally, Wealth & Loans enables the retrieval of three additional resources of wealth accounts: * [Investments](https://docs.powens.com/api-reference/products/wealth-aggregation/investments) (financial assets of the account) * [Pockets](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets) (free shares, for company savings accounts only) * [Market orders](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders) (for market accounts & equity savings plans only) * [Loan amortizations](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#market-order-resource-1) (for loans accounts) ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FIOmQJCEQfz5Bwz1ua8FH%252FWealth-%2520Diagram.png%3Falt%3Dmedia%26token%3D73aca890-3994-4dcb-ad1a-2ae594b13dcf&width=768&dpr=3&quality=100&sign=31efaee1eb83c0e130cc45ebf774b2b8&sv=3) Wealth & Loans thus offers a complete view of the end-user's patrimonial assets. ### Account types[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#account-types) Type Description Market Share account to buy and sell market stocks and obligations, directly on financial markets (CAC40 companies, DAX, Nasdaq ...) as well as units of account on investment funds. It is not possible to invest on Euro funds with this type of account. PEA 'Plan Épargne Actions', a regulated account to buy and sell stocks in the EU. It allows you to acquire and manage a portfolio of European companies shares. It is exempt from taxes under certain conditions. Life insurance One of the most common investment accounts. It comes in two parts: first part invested in one or more Euro funds, and a second part invested in unit-linked contracts (investment funds, SICAV, UCITS, SCPI…). The respective proportion of these two parts depends on the investor's profile. Capitalization A French specific fiscal envelope very close to a life insurance contract, also made of two parts. Unlike life insurance, it is not based on any risk coverage: it does not depend on the subscriber's lifetime and it can be inherited. PER Company or individual retirement plan account. It is a contract available since October 1st, 2019, under the 'PACTE' law. The PER (Individual Retirement Savings Plan), is a long-term savings envelope for any person (individual or self-employed) wishing to build up savings for their retirement. PERP Private individual retirement plan account. PERP (popular retirement savings plan) is long-term savings. It allows you to save during your working life and to have an annuity at retirement and a capital option. PERP will no longer be offered after October 1st, 2020 (replaced by PER). PERCO The PERCO (collective retirement savings plan) is a company retirement plan account. As of October 1st, 2020, the Perco can no longer be implemented in companies. The Perco can be transformed into a collective enterprise PER. Madelin The Madelin contract is an individual retirement savings product for self-employed and liberal professions. Payments are supervised and have tax benefits. As of October 1st, 2020, it will no longer be possible to subscribe to a new Madelin contract. ### Features activation[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#features-activation) Wealth & Loans features can be activated by your Account Manager only. Basic activation includes: * the collection of **additional information on wealth accounts** (valuation, valuation differential, previous differential…); * the retrieval of **investments** on wealth accounts; * the retrieval of **pockets** (free shares), specifically for company savings accounts. As an optional feature, you can also enable the collection of [additional details](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#get-an-investment) for investments when available, mainly for connectors specialized in employee and company savings accounts (PER, PEE, PERP, PERCO, Madelin…). Finally, the collection of **market orders** can also be independently activated. ### Additional attributes for Wealth accounts[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#additional-attributes-for-wealth-accounts) As mentioned above, activating the API enables the collection of additional information for wealth accounts. Property Description `valuation` Sum of the valuations of the investments of this account. `diff` Difference between the amount invested on the account and the current balance of the account. `diff_percent` Ratio between the amount invested on the account and the current balance of the account. `prev_diff` `diff` value obtained during the previous synchronization of the account. `prev_diff_percent` `diff_percent` value obtained during the previous synchronization of the account. These attributes appear in the usual routes used to query accounts: Copy GET /users/me/accounts GET /users/me/connections/{connectionId}/accounts ### Investment resources[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#investment-resources) The [investments](https://docs.powens.com/api-reference/products/wealth-aggregation/investments) are the financial assets of a wealth account. They can be financial equities, actions, obligations, Euro funds, unit-linked contracts or even liquidities: Copy GET /users/me/investments GET /users/me/accounts/{accountId}/investments GET /users/me/connections/{connectionId}/investments Copy { "prev_diff_percent": 0.0, "calculated": [\ "diff",\ "diff_percent",\ "prev_diff",\ "pref_diff_percent",\ "valuation"\ ], "prev_diff": 0, "diff": 364.156, "total": 1, "valuation": 1055575.41, "investments": [\ {\ "code_type": "ISIN",\ "prev_vdate": null,\ "original_valuation": null,\ "portfolio_share": 0.7,\ "code": "FR1234567891",\ "diff": -14.659,\ "last_update": "2020-08-06 15:37:46",\ "unitvalue": 150959.777,\ "id": 30,\ "original_unitprice": null,\ "id_account": 1234,\ "deleted": null,\ "detail": {\ "last_update": "2020-08-06 15:37:46",\ "srri": 5,\ "recommended_period": "6 months",\ "performance_1_year": 0.5973,\ "performance_3_years": 0.9333,\ "performance_5_years": 0.7025,\ "asset_category": "US Actions"\ },\ "label": "Example Investment Label",\ "source": "website",\ "description": "",\ "original_unitvalue": null,\ "original_currency": null,\ "original_diff": null,\ "id_type": 1,\ "valuation": 1055575.41,\ "id_security": 224,\ "vdate": "2020-08-06",\ "calculated": [\ "portfolio_share"\ ],\ "prev_diff": null,\ "quantity": 3.094,\ "unitprice": 150964.515,\ "diff_percent": 0.0\ }\ ] } It contains a list of attributes that are related to the account, as well as an `investments` key containing a list of the investments for this account. If the account does not have any investment or if the investments are not implemented for this account type, the API will return an empty list. The `calculated` key indicates the list of attributes that are calculated and not directly obtained from the bank (for example, `valuation` is the sum of scraped investments valuations for a given account). #### Investment history[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#investment-history) Even though the investment attributes are updated at each synchronization, the history of all unit values, original unit values, original currencies and valuation dates is saved and can be accessed via the API: Copy GET /users/me/investments/{investmentId}/history Copy { "investmentvalues": [\ {\ "original_unitvalue": null,\ "original_currency": null,\ "vdate": "2020-08-04",\ "id_investment": 12345,\ "unitvalue": 148.13,\ "id": 50\ },\ {\ "original_unitvalue": null,\ "original_currency": null,\ "vdate": "2020-08-03",\ "id_investment": 12345,\ "unitvalue": 147.15,\ "id": 49\ }\ ], "total": 2 } This information can be used to build graphs of the value of each investment from the first time this investment was collected until the most recent synchronization. #### Unit value history[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#unit-value-history) The history depth depends of the investment: for most investments the history depth is one month (which includes daily values), but for some investments only today's unit value is available. In any case, the unit values and their corresponding dates are collected an exposed as `vdate` / `unitvalue` couples in the API. Copy GET /users/me/investments/{investmentId}/security/history Copy { "history": [\ {\ "unitvalue": 192.86,\ "vdate": "2020-08-05"\ },\ {\ "unitvalue": 192.21,\ "vdate": "2020-08-04"\ },\ {\ "unitvalue": 192.13,\ "vdate": "2020-08-03"\ },\ {\ "unitvalue": 191.94,\ "vdate": "2020-07-31"\ }\ ], "result_min_date": "2020-07-31", "result_max_date": "2020-08-06", "first_date": "2020-07-31", "last_date": "2020-08-05", } This history of investment values can be used to build graphs of the evolution of the unit value of each stock from the first time we collected this information until today. This service is partly redundant with the history of a single investment (`/investments/{investmentId}/history` route), both can be used and have their specificities and advantages. The security history route is common to all investments with the same ISIN, thus the history depth is usually bigger, however the data comes from the Boursorama website therefore there might be discrepancies between the unit values collected there and the actual unit values collected from the customer's website. In addition, the investment history route also contains the original unit values and currencies, when applicable. ### Pocket resource[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#pocket-resource) Major companies and corporations sometimes give a part of their own stocks to their employees without any financial requirement. These freely given stocks are called **Pockets** or **Free shares** and can be found on connectors specialized in employee savings accounts (for example BNP, Natixis and Amundi). On these employee savings accounts, Investments are often divided into several [Pockets](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets) that have different **availability dates and conditions**. The most common availability condition is the retirement of the employee, but it can also be at a specific date in the future (for example 5 years after the Pocket was issued), in which case the Pocket will have an **availability date**. If the availability date is in the past, the Pocket is already available, hence the displayed condition will be `available`. Copy GET /users/me/investments/{investmentId}/pockets GET /users/me/accounts/{accountId}/pockets GET /users/me/connections/{connectionId}/pockets Copy { "pockets": [\ {\ "deleted": null,\ "id_account": 1234,\ "id_investment": 12345,\ "value": 959.4602465,\ "label": "Unités de compte sous allocation libre",\ "availability_date": "2019-08-18",\ "last_update": "2020-08-18 16:13:36",\ "id": 61,\ "condition": "available",\ "quantity": 1.0705\ },\ {\ "deleted": null,\ "id_account": 1234,\ "id_investment": 12345,\ "value": 2576.0678566,\ "label": "Unités de compte sous allocation pilotée",\ "availability_date": "2022-08-18",\ "last_update": "2020-08-18 16:13:36",\ "id": 62,\ "condition": "retirement",\ "quantity": 2.8742\ },\ {\ "deleted": null,\ "id_account": 1234,\ "id_investment": 12345,\ "value": 1269.3914499,\ "label": "Actions Europe",\ "availability_date": "2023-08-18",\ "last_update": "2020-08-18 16:13:36",\ "id": 63,\ "condition": "date",\ "quantity": 1.4163\ }\ ] } ### Market Order resource[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#market-order-resource) **Market Orders** correspond to the purchases and sales of financial equities, actions and obligations on **Market accounts** and **Equity savings plans** (PEA). The collection of Market Orders provides an overview of the history of financial movements on these accounts. [Market Orders](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders) are currently implemented on most major bank connectors (Crédit Agricole, Caisse d'épargne, BNP Paribas, Société Générale, Boursorama, Fortuneo…), as well as websites specialized in stock exchange, such as online brokers (Binck, Degiro, Boursedirect...). Copy GET /users/me/accounts/{accountId}/marketorders GET /users/me/connections/{connectionId}/marketorders GET /users/me/marketorders Copy { "marketorders": [\ {\ "code": "FR0000031122",\ "order_type": {\ "id": 2,\ "name": "MARKET"\ },\ "created": "2020-08-06 15:37:47",\ "payment_method": "UNKNOWN",\ "id_account": 1234,\ "order_direction": {\ "id": 3,\ "name": "SALE"\ },\ "execution_date": null,\ "webid": "X12548786",\ "amount": null,\ "label": "AIR FRANCE-KLM",\ "stock_market": "Xetra",\ "state": "Pending",\ "deleted": null,\ "ordervalue": null,\ "date": "2020-08-15 00:00:00",\ "validity_date": "2020-11-15 00:00:00",\ "unitvalue": null,\ "last_update": "2020-08-18 16:13:36",\ "unitprice": null,\ "id": 1,\ "quantity": 400.0\ },\ {\ "code": "US0231351067",\ "order_type": {\ "id": 3,\ "name": "LIMIT"\ },\ "created": "2020-08-06 15:37:47",\ "payment_method": "DEFERRED",\ "id_account": 1234,\ "order_direction": {\ "id": 2,\ "name": "BUY"\ },\ "execution_date": "2020-08-15 00:00:00",\ "webid": "ER1218443",\ "amount": 45400.02,\ "label": "AMAZON",\ "stock_market": "NASDAQ",\ "state": "Executed",\ "deleted": null,\ "ordervalue": 43.12,\ "date": "2020-08-12 00:00:00",\ "validity_date": "2020-11-12 00:00:00",\ "unitvalue": 45.38,\ "last_update": "2020-08-18 16:13:36",\ "unitprice": 45.41,\ "id": 2,\ "quantity": 1000.0\ }\ ] } #### Market Order attributes and specificities[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#market-order-attributes-and-specificities) Market Orders have some attributes in common with Investments, for example `id`, `code`, `label`, `quantity`, `unitprice` and `unitvalue`. They also have specific attributes, such as the order direction and type of the Market Order, the current state of the Market Order and the Stock Market on which the order was placed. A Market Order can have up to 3 associated dates: the **creation date**, the **execution date** and the **validity date** (which is usually 3 months after the creation date). During every synchronization, all market orders are collected and matched with the previous market order list using a stable unique identifier. If there is no such identifer on a given website, the matching is done using static attributes: `date`, `label`, `code` and `direction` (most of the other attributes may vary between the market order creation and its execution or expiration). If a Market Order is matched with a previously collected item, its attributes will be updated, otherwise a new item will is created. The Market Order history depth depends on the website: on some websites, several years of Market Order history are displayed whereas on some others, only pending market orders are available and they disappear after execution. ### Loan Amortizations resource[](https://docs.powens.com/documentation/integration-guides/wealth-and-loans#market-order-resource-1) This feature is not activated by default. Please contact your Customer Success Manager to activate it. **Loan Amortizations** correspond to the amortization paid by a user for a loan. Most of the amortization tables available in the user's banking space are updated once a month, starting from the current month or year. We therefore update the information once a month, and the amortization will begin at the earliest on the date of the first synchronization. Copy GET /users/me/accounts/{accountId}/amortizations GET /users/me/connections/{connectionId}/amortizations GET /users/me/amortizations Copy "loanamortizations": [\ ...\ {\ "id_account": 1,\ "payment_date": "2024-02-29",\ "amortization_amount": {\ "currency": "EUR",\ "value": 108.0\ },\ "interest_amount": {\ "currency": "EUR",\ "value": 15.0\ },\ "insurance_amount": {\ "currency": "EUR",\ "value": 2.0\ },\ "total_payment_amount": {\ "currency": "EUR",\ "value": 125.0\ },\ "remaining_capital": {\ "currency": "EUR",\ "value": 1500.0\ },\ "last_update": "2024-02-29 14:32:05",\ "deleted": null,\ "period": "2024-02",\ "calculated": [\ "total_payment_amount"\ ]\ },\ ...\ ], "total": 42 } The `calculated` key indicates the list of attributes that are calculated and not directly obtained from the bank (for example, `total_payment_amount` is the sum of scraped amortization, interest and insurance amounts for a given amortization). [PreviousBank ID Check](https://docs.powens.com/documentation/integration-guides/bank-id-check) [NextPay by Bank](https://docs.powens.com/documentation/integration-guides/pay-by-bank) Last updated 6 months ago Was this helpful? --- # Initiating a one-time payment with the Webview | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md) . Note that this guide assumes you have the following information on hand: * A Powens domain with Pay by Bank enabled. * A Powens domain client with client identifiers, thereafter named `clientId` and `clientSecret`. * A URL to redirect the end user to at the end of the process, registered with the client, thereafter named `redirectURL`. * An optional state that will be transmitted to your redirect URL, thereafter named `optionalRedirectState`. One-time payments are payments executed once. They can be of different kinds: * **"First open day" payments**: classic payments usually executed within a few business days (SEPA Credit Transfers, GB BACS, GB CHAPS, GB Faster Payments, ...). * **"Instant" payments**: payments usually executed within a few minutes (SEPA Instant Credit Transfers). * **"Deferred" payments**: classic payments only executed at a provided future date. The basic workflow will be the following: ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252F13Jphcj9kULhPtBtgmFW%252FPay%2520diagram.png%3Falt%3Dmedia%26token%3D885802f7-fbee-4859-b691-f9354ee5a98c&width=768&dpr=3&quality=100&sign=fad2aec925582509a0eb17292d734f30&sv=3) Obtain a token suitable for creating payments[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#obtain-a-token-suitable-for-creating-payments) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In order to create payments, we need a special access token with the `payments:admin` scope, obtained using client credentials: Copy POST /auth/token Copy { "grant_type": "client_credentials", "client_id": "{clientId}", "client_secret": "{clientSecret}", "scope": "payments:admin", } Copy { "token": "{accessToken}", "scope": "payments:admin" } See [Service Tokens](https://docs.powens.com/api-reference/overview/authentication#service-tokens) for more information. Create a one-time payment[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#create-a-one-time-payment) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- You can now create a payment request with the following request: Copy POST /payments First open day Instant Deferred Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "Test",\ "amount": 50.90,\ "currency": "EUR",\ "execution_date_type": "first_open_day",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ }\ ], "payer_identity": { "kind": "individual", "first_name": "Germaine", "last_name": "Michu", "birth_date": "1963-01-01", "birth_city": "Paris", "birth_country": "FR", "nationality": "French" } } Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "Test",\ "amount": 50.90,\ "currency": "EUR",\ "execution_date_type": "instant",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ }\ ], "payer_identity": { "kind": "individual", "first_name": "Germaine", "last_name": "Michu", "birth_date": "1963-01-01", "birth_city": "Paris", "birth_country": "FR", "nationality": "French" } } Copy { "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "Test",\ "amount": 50.90,\ "currency": "EUR",\ "execution_date_type": "deferred",\ "execution_date": "2024-01-01",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ }\ }\ ], "payer_identity": { "kind": "individual", "first_name": "Germaine", "last_name": "Michu", "birth_date": "1963-01-01", "birth_city": "Paris", "birth_country": "FR", "nationality": "French" } } Copy { "id": {paymentId}, "state": "created", "error_code": null, "error_description": null, … } A `payer_identity` for the payment request and a `beneficiary_identity` for the instruction are required and must contain information on either the payer (which you redirect to the webview) or the beneficiary (matching the routing information). For the definition of such objects, see IdentityRequest. The following are examples of different identity kinds with Pay by Bank: Individual Company Copy { "kind": "individual", "external_ref": "MY-CUSTOMER-REFERENCE-012345678", "first_name": "Jean", "last_name": "Dupont", "nationality": "FR", "postal_address": "Appartement 25\nEntrée B Résidence Les Iris\n3 Boulevard du Levant\n95220 HERBLAY" } Copy { "kind": "corporate", "org_name": "Powens", "org_legal_status": "SAS", "org_hq_address": "84 RUE BEAUBOURG\n75003 PARIS 3\nFRANCE", "scheme_name": "siren", "identification": "749867206" } See the [`POST /payments` endpoint reference](https://docs.powens.com/api-reference/products/payments/payments#initiate-a-payment) and [the `PaymentInitRequest` object description](https://docs.powens.com/api-reference/products/payments/payments#paymentinitrequest-object) for more information on the payload or returned information. Obtain the payment validation token[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#obtain-the-payment-validation-token) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In order for the payer to be able to validate the payment request, you first need to create a token scoped to validate the created payment specifically. You can do this using the token created in [Obtain a token suitable for creating payments](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#obtain-a-token-suitable-for-creating-payments) : Copy POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} Copy { "scope": ["payments:validate"] } Copy { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires_in": 604800, "id_payment": {paymentId} } See the [`POST /payments/{id}/scopedtoken` endpoint reference](https://docs.powens.com/api-reference/products/payments/payments#generate-a-payment-scoped-token) for more information. Build the payment validation URL[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#build-the-payment-validation-url) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now that you have the payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: * `domain`: your client domain. * `client_id`: the client identifier for your application (`clientId`). * `redirect_uri`: the same redirect URL you've used when creating the payment (`redirectURL`). * `state`: the same state you've used when creating the payment (`optionalRedirectState`). * `code`: The scoped token you've generated on your previous request to the API. * `payment_id`: the identifier of the payment. This will make you obtain a URL of the form: Copy https://{domain}.biapi.pro/2.0/auth/webview/payment?client_id={clientId}&redirect_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment_id={paymentId} You can redirect your payer to this URL. Receive a callback from the payer[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#receive-a-callback-from-the-payer) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Once the payer has either completed the payment validation flow, or has cancelled from either our Webview or the bank's interface, they will go on the callback URL you have configured on the payment with the following parameters: * `state`: the optional client state you have configured on the payment, i.e. `{optionalClientState}`. * `id_payment`: the identifier of the payment that the user comes from. * `error` (_optional_): set to "`cancelled`" if the payer has cancelled the payment from our Webview. * `error_code` (_optional_): set to the payment's error code, if the payment has been cancelled or rejected by the bank. * `bank_message` (_optional_): set to the bank message, if available. * `payment_state` (_optional_): the state of the payment, if the payer has been redirected by the bank. For security reasons, following such a callback from the payer, it is recommended to check the payment's state manually; see [Polling the payment status](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#polling-the-payment-status) . Check on a one-time payment's state[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#check-on-a-one-time-payments-state) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- During and after the initiation of a payment, you may want to check on the status of a payment, or to get data back from the payment initiation request. ### Receive payment updated events using webhooks (recommended method)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#receive-payment-updated-events-using-webhooks-recommended-method) In order to receive updates when a payment switches states, it is recommended to [set up the Payment Updated webhook](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank#configure-the-payment-state-updated-webhook) and wait for events regarding payments. Webhook events will only be triggered during a background refresh / synchronization of the payment state. For more information, see [Webhooks](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. ### Get the payment status[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#get-the-payment-status) This method is **not recommended for polling** the payment status regularly, it is recommended to wait for incoming webhook events to this end. However, it is recommended for when receiving a callback regarding a payment from an end user, or for debugging purposes. In order to get a given payment's status, you can call the `GET /payments/{id}` endpoint, with the identifier of the payment. See [API endpoints](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. ### Process the payment status[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#process-the-payment-status) In the resulting payment resource, you are to get the `state` property, and do the following: * If the payment is `pending`, you should wait for the payment to be executed. * If the payment is `expired`, it means that the payment will not be updated anymore; you should consider the payment as rejected. * If the payment is `accepted`, it means that the initiation was successful but the bank will not provide further updates; if you accept the risks, you can consider the payment as done. * If the payment is `done`, it means that the payment has been executed by the payer's bank; you can consider the payment as done. * If the payment is `rejected`, it means that the payment has been rejected by the bank, or by the end user through the bank; you should request a new payment. A payment with the `accepted` status could still be rejected by the bank (e.g. for insufficient funds at execution time), however we can no longer poll the payment's status on our side. If you want to avoid such cases, you can identify connectors with this behaviour by checking the `partial_status_tracking` property of connectors; see [Listing connectors with Pay by Bank enabled programmatically](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically) . See the [Payment object](https://docs.powens.com/api-reference/products/payments/payments#payment-object) definition for reference. [PreviousGetting started with Pay by Bank](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank) [NextInitiating a bulk payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview) Last updated 6 months ago Was this helpful? --- # Validating your implementation with the test connector | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector.md) . In order to validate your implementation, you can use the test connector which you can enable on your sandbox domain, with the UUID `338178e6-3d01-564f-9a7b-52ca442459bf`. Formatting the label[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#formatting-the-label) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- With this institution, you can simulate various scenarios, depending on the label of the first instruction in the payment. The label resembles this: Copy pdng/done - My payment label The payment states are described on the left of the first found caret (`-`), separated from each other by slashes (`/`). In the provided example, assuming the payment is a single "first open day" payment, once validated, it will be `"pending"` for 15 minutes, then `"done"`. A scenario can have up to 3 different states, for which the possible values are the following: * `pdng`: pending. * `canc`: rejected (by the end user). * `rjct`: rejected (by the bank, generic). * `err`: rejected (by the bank, for an invalid amount). * `bug`: an error will have occurred during the payment initiation. * `done`: done. If no final state is provided, the final state will be `"done"`. Example scenarios are: * `pdng/pdng/done`: the payment will be pending execution during 30 minutes, before done. * `pdng/rjct`: the payment will be pending execution during 15 minutes, before being rejected for a generic reason. * `err`: the payment will be rejected by the bank for an invalid amount. Create a first open day payment with the test connector[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#create-a-first-open-day-payment-with-the-test-connector) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Here, we will create a first open day that will be `pending` then `done`. Note that this is a partial reprisal of [Initiating a one-time payment with the Webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview) . ### Obtain a token suitable for creating payments[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#obtain-a-token-suitable-for-creating-payments) In order to create payments, we need a special access token with the `payments:admin` scope, obtained using client credentials: Copy POST /auth/token Copy { "grant_type": "client_credentials", "client_id": "{clientId}", "client_secret": "{clientSecret}", "scope": "payments:admin", } Copy { "token": "{accessToken}", "scope": "payments:admin" } ### Create the first open day payment[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#create-the-first-open-day-payment) You can now create a payment request with the following request: Copy POST /payments Copy { "uuid": "338178e6-3d01-564f-9a7b-52ca442459bf", "use_case_pay": "legacy", "client_redirect_uri": "{redirectURL}", "client_state": "{optionalRedirectState}", "instructions": [\ {\ "label": "pdng/done - ABC001 ACME PURCHASE",\ "amount": 12.34,\ "currency": "EUR",\ "execution_date_type": "first_open_day",\ "beneficiary": {\ "scheme_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp.",\ },\ "beneficiary_identity": {\ "kind": "corporate",\ "org_name": "ACME Corp.",\ "org_legal_status": "SARL",\ "scheme_name": "siren",\ "identification": "012345678"\ },\ }\ ], "payer_identity": { "kind": "individual", "first_name": "Germaine", "last_name": "Michu", "birth_date": "1963-01-01", "birth_city": "Paris", "birth_country": "FR", "nationality": "French" }, … } Copy { "id": {paymentId}, "state": "created", "error_code": null, "error_description": null, … } Now we have the payment identifier, in order to validate it, we must create a webview URL and send our PSU on it. ### Obtain the payment validation token[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#obtain-the-payment-validation-token) As in the original guide, we get a token suitable for payment validation here: Copy POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} Copy { "scope": ["payments:validate"] } Copy { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires_in": 604800, "id_payment": {paymentId} } ### Build the payment validation URL[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#build-the-payment-validation-url) Now that you have the payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: * `client_id`: the client identifier for your application (`clientId`). * `redirect_uri`: the same redirect URL you've used when creating the payment (`redirectURL`). * `state`: the same state you've used when creating the payment (`optionalRedirectState`). * `code`: The scoped token you've generated on your previous request to the API. * `payment_id`: the identifier of the payment. This will make you obtain an URL of the form: Copy https://{domain}.biapi.pro/2.0/auth/webview/{lang}/payment?client_id={clientId}&redirect_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment_id={paymentId} You can redirect your payer to this URL. ### Receive the callback from the payer[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#receive-the-callback-from-the-payer) Once the payer has either completed the payment validation flow, they will arrive on the callback URL you have configured on the payment with the following parameters: * `state`: the optional client state you have configured on the payment, i.e. `{optionalClientState}`. * `id_payment`: the identifier of the payment that the user comes from. * `payment_state`: the state of the payment, set to `"pending"` here. If your implementation is correct, following this callback, you should directly use the `GET /payments/{id}` endpoint, with the identifier of the payment, to get the current state of the payment, which is indeed `"pending"`. See [API endpoints](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. For more details on these parameters, see [Receive the callback from the payer](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#receiving-a-callback-from-the-payer) in the original guide. ### Receive webhook events regarding the payment's state[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector#receive-webhook-events-regarding-the-payments-state) After approximately 15 minutes, you will receive a `"PAYMENT_STATE_UPDATED"` webhook event advertising that the payment is now "done", with the full data regarding the payment. You can test behaviours with shorter intervals using `"instant"` payments; every phase with such payments last 15 seconds instead of 15 minutes, so your payment will have reached its final state within about one minute. During and after the initiation of a payment, you may want to check on the status of a payment, or to get data back from the payment initiation request. For more information, see [Webhooks](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. [PreviousCancelling a payment](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment) [NextAdvanced](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced) Last updated 6 months ago Was this helpful? --- # Advanced | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced.md) . In this sub-section, you will find guides that may not be relevant to your use case, or to your authorizations. Required privileges and targeted needs are present at the top of each guide. [PreviousValidating your implementation with the test connector](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector) [NextListing connectors with Pay by Bank enabled programmatically](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically) Last updated 6 months ago Was this helpful? --- # Listing connectors with Pay by Bank enabled programmatically | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically.md) . You can list enabled connectors with support for the Pay by Bank product on your domain by making an API call, which is mostly useful when getting the available connector list programatically. See below on how to make such a call. In order to obtain such connectors programmatically from your domain, you can query the whole list and filter the results for connectors which `products` contains `"pay"`: Copy GET /connectors Copy { "connectors": [\ {\ "id": 40,\ "name": "Connecteur de test",\ "products": [\ "bank",\ "pay",\ "wealth"\ ],\ "payment_settings": {\ "available_validate_mechanisms": [\ "webauth"\ ],\ "beneficiary_types": [\ "iban"\ ],\ "execution_date_types": [\ "first_open_day",\ "instant",\ "deferred"\ ],\ "execution_frequencies": [\ "two-monthly",\ "semiannually",\ "weekly",\ "yearly",\ "four-monthly",\ "daily",\ "quarterly",\ "biannual",\ "bimonthly",\ "two-weekly",\ "monthly"\ ],\ "maximum_number_of_instructions": 10,\ "providing_payer_account": "optional"\ },\ …\ },\ …\ ] } Connectors supporting the Pay by Bank product will define a `payment_settings` object, which present Pay by Bank constraints and features for this specific connectors. For more information on the format of this object, e.g. if you only want connectors that support instant payments, see [PaymentSettings](https://docs.powens.com/api-reference/user-connections/connectors#paymentsettings-object) . [PreviousAdvanced](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced) [NextImplementing your own payment validation webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview) Last updated 6 months ago Was this helpful? --- # Proof & Certificates Retrieval | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval.md) . This section guides you on how to interact with our API to access bills and various documents of your users. You must have followed the steps in “[Add a first user and connection](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) ” section. ### Billing data[](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval#billing-data) The Proof & Certificates Retrieval product exposes subscriptions and documents. ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FARiaobHh1sAroqLeBruy%252FTrust%2520-%2520Diagram.png%3Falt%3Dmedia%26token%3D886cf7f3-dce8-45c1-9ce3-0a4192f8986f&width=768&dpr=3&quality=100&sign=34efc0f97abead4d3dfa99e8898d248b&sv=3) A "subscription" is a document container or group. The purpose may vary by connector, for example to isolate documents linked to a contract. When it is not relevant for a connector, we still simulate a single subscription matching the user account using profile information if available. For bank websites where we can return a RIB and statement documents, we create one subscription per bank account. #### Subscriptions[](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval#subscriptions) We provide a view to the subscriptions of a user with [`/subscriptions` endpoints](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions) : Copy GET /users/me/subscriptions GET /users/me/connections/{connectionId}/subscriptions Copy { "subscriptions": [\ {\ "id": 12345,\ "label": "Contrat EZ4225",\ "number": "EZ42250022314",\ "subscriber": "Mr John Doe",\ …\ },\ …\ ] } Subscriptions are linked to a _connection_ (they are deleted with the connection). The subscriptions list reflect the set of subscriptions found when synchronizing with a provider, using a safe archiving rule: * when a new subscription is discovered, it is added; * when a subscription is no more found, it is marked with a [`deleted` flag](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#get-a-subscription) and is not listed by default, but it can still be accessed by its ID or with the [`?all` parameter](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#list-subscriptions) . #### Documents[](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval#documents) We provide a view to the set of documents of a user with [`/documents` endpoints](https://docs.powens.com/api-reference/products/documents-aggregation/documents) : Copy GET /users/me/documents GET /users/me/subscriptions/{subscriptionId}/documents Copy { "documents": [\ {\ "id": 56789,\ "name": "Facture Acme 023315",\ "type": "bill",\ "rdate": "2020-08-27",\ "url": "https://…",\ "thumb_url": "https://…",\ …\ },\ …\ ], "first_date": "2017-02-14", "last_date": "2020-09-15", "result_min_date": "2020-08-30", "result_max_date": "2020-09-30" } Documents are linked to a _subscription_ (they are deleted with the subscription). We provide access to raw files of documents with the `url` property, when such files are available on the website. The file format depends on the connector: most websites provide PDF files, if they don't we expose HTML files. You can enable the `force_pdf` [configuration key](https://docs.powens.com/api-reference/api-setup/configuration) in your API to always generate a PDF version of files. Please note that this configuration takes effect on synchronization only and is not retroactive: any change will only apply to newly-discovered documents. ### Captcha[](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval#captcha) Some websites ask for a captcha, especially for bills. Our system is able to resolve them for you automatically, but this feature is disabled by default. You can enable it by setting the `captcha.enabled` [configuration key](https://docs.powens.com/api-reference/api-setup/configuration) to 1. `captcha.enabled` is set to 0 by default. If this key is disabled and the website requires captcha resolution, your connection will fall into the `websiteUnavailable` [state](https://docs.powens.com/api-reference/user-connections/connections#connectionstate-values) . Our resolution system may fail to resolve a captcha for various reasons. As a result the connection would also fall into the `websiteUnavailable` [state](https://docs.powens.com/api-reference/user-connections/connections#connectionstate-values) , but our background workers will automatically retry later. We don’t provide a list of websites asking for a captcha since it is subject to change frequently. [PreviousChanging the maximum amounts for payments](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-maximum-amounts-for-payments) [NextAdvisory (obsolete)](https://docs.powens.com/documentation/integration-guides/advisory-obsolete) Last updated 6 months ago Was this helpful? --- # SCA & connection states | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states.md) . ### Connection synchronization[](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#connection-sync) Retrieving user data from the connectors happens in an asynchronous way. Synchronization of a connection is performed: * right after the connection is created, or has its credentials updated; * automatically at regular intervals; * optionally on an explicit API request. In either case, the sync process will upgrade the available dataset of the user if everything goes smoothly. But the process can also fail in various situations: * the website or the API of the target connector is unavailable; * the user needs to renew his consent or grant a supplementary explicit access for the synchronization to proceed (e.g. strong customer authentication); * the provided credentials are invalid and need to be updated; * we encounter a temporary error, as interfacing with constantly-evolving APIs or websites can be tough ;-)... Synchronization statuses are available by connector in the Monitoring page of your domain, in the [administration console](https://console.budget-insight.com/) . #### Connection states[](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#connection-states) When synchronization fails, we update the [`state` property of the _connection_ resource](https://docs.powens.com/api-reference/user-connections/connections#get-a-connection) with an error code that reflects the situation. As an integrator, you should handle this state and guide the user into recovering from the situation. Connection state Actions to take (null) The synchronization was successful, no error. `SCARequired` `webauthRequired` `additionalInformationNeeded` `decoupled` `validating` (transcient) Synchronization is suspended because we need user consent or SCA to proceed. You should **present this error prominently** with [an option to resume the connection using the indications below](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#resumerecover-connection-sync) . `actionNeeded` Synchronization failed because the user needs to perform an action directly on the bank website or app (usually, accept new CGUs or similar one-time actions). You should **present this error prominently**, with the details in the `error_message` property. `passwordExpired` Synchronization failed because the user needs to renew its password on the bank website. You should **present this error prominently** and prompt the user for his new password afterwards. `wrongpass` Synchronization failed because the credentials we own are invalid or obsolete. You should **present this error prominently** with [an option to recover the connection using the indications below](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#resumerecover-connection-sync) . `rateLimiting` Synchronization failed because the target website or API is temporarily blocking synchronizations due to rate limiting. We will retry after a delay and connections in this state will be resumed automatically. `websiteUnavailable` Synchronization failed because the targeted API or website is temporarily unavailable. We will periodically retry to sync. `bug` Synchronization failed because of an error from our side. We monitor errors and do our best to fix them quickly. Connections in this state will be resumed automatically after the error is fixed. For multi-sources connections, we expose the error of any source as an error of the whole connection so the integration can be simplified to checking the connection status. You can also handle the `state` property of each source directly. ### Resume/recover connection sync[](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#resumerecover-connection-sync) Some connection states require an interaction with the user in order to restore synchronization: `additionalInformationNeeded`, `SCARequired`, `webauthRequired`, `wrongpass`, `decoupled`. You should present recovery options in your app or service to engage the user into completing the required steps. Since synchronization is suspended until the appropriate action is performed, we advise you to present such errors prominently in your service or app, using banners, indicators or notifications. You have 2 options to handle connection resuming/recovery : * use the Reconnect webview; * build a custom experience and handle the different cases manually. #### Use our Reconnect webview[](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#use-our-reconnect-webview) Our webview has a [dedicated endpoint](https://docs.powens.com/api-reference/overview/webview#re-auth--edit-connection-credentials-flow) for connection resuming. It will take care of guiding the user and prompting him the required information if needed. To present the webview, first [obtain a temporary code](https://docs.powens.com/api-reference/overview/authentication#generate-a-temporary-code) to secure the transaction: Copy GET /auth/token/code Copy { "code": "nc0EdV2MiVmSig1…", … } The provided temporary code is valid for a few minutes. Then, present the following URL to your user (new lines are only added for clarity): Copy https://{domain}.biapi.pro/2.0/auth/webview/reconnect ?client_id={clientId} &code={authorizationCode} &connection_id={connectionId} &redirect_uri={yourCallbackUri} After the webview flow is complete ([either successfully or with an error](https://docs.powens.com/api-reference/overview/webview#implementation-guidelines) ), the user will be redirected to your callback URL, and the connection `state` will be updated accordingly. #### Build a custom user experience[](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#build-a-custom-user-experience) As an integrator you can also decide to create your own user experience to handle connection resuming. However, the implementation of all steps and cases is a complex task. Custom implementations that include transmission of user credentials (login or password) require the Agent Status. The `wrongpass` state **cannot** be handled if you don't hold this status. ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2Fdocs.budget-insight.com%2Fassets%2Fimg%2Fsca-handling.png&width=768&dpr=3&quality=100&sign=47dcf1a0f012d78d8efee70961385ee7&sv=3) The steps to take and information to display/prompt depend on the `state` of the connection: * If the connection is in the `SCARequired` state, the synchronization has not been attempted because it requires an explicit user consent. [Force the connection](https://docs.powens.com/api-reference/user-connections/connections#sync-a-connection) (with no parameter) to trigger the approval demand: Copy POST /connections/{connectionId} The connection will be resumed or set to another error state that must be handled identically. * If the connection is in the `additionalInformationNeeded` or the `wrongpass` state, the user must be prompted for the required values that are described in the [`fields` property of the connection](https://docs.powens.com/api-reference/user-connections/connections#get-a-connection) . The provided values must be [posted on the connection](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection) , and the synchronization will resume. ### Example: GET /connections/{connectionId}[](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#example-get-connectionsconnectionid) Copy { "state": "additionalInformationNeeded", // or "wrongpass" "fields": [ { "name": "otp", "type": "text", "label": "Code d'autorisation", … } ], … } User-provided OTP is to be sent to the API to resume the synchronization: Copy POST /connections/{connectionId} Copy { "otp": "123456" } The connection will be resumed or set to another error state that must be handled identically. Make sure you also handle the `wrongpass` error code that can be raised on posting the credentials. * If the connection is in the `decoupled` state, an authorization is required using a third-party SCA mechanism (validation in an app or using a dedicated device). In this case you should display a waiting message and [send a resuming signal](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection) to our API: Copy POST /connections/{connectionId} Copy { "resume": true } The connection will be resumed or set to another error state that must be handled identically. By default, this call will be blocking until validation, so you should handle timeouts in a loop, or implement polling on the client side thanks to the query parameter `background=true`. The connection is in the `validating` state during this step. Copy POST /connections/{connectionId}?background=true Copy { "resume": true } * If the connection is in the `webauthRequired` state, the user has to complete authorization in a browser. You should [obtain a webauth recover URL](https://docs.powens.com/api-reference/user-connections/connections#webauthurl-object) for the connection, and let the user navigate to it: Copy https://{domain}.biapi.pro/2.0/webauth-url ?client_id={clientId} &id_connection={connectionId} &redirect_uri={yourCallbackUri} After the redirection, the connection will be resumed or set to another error state that must be handled identically. * If the connection is in another error state than above, recovering is not possible. API calls that raise a synchronization perform a synchronous check of the credentials with the connector, so these requests usually take a few seconds. Make sure you handle them in a user-friendly way. [PreviousIndicators for Credit Check](https://docs.powens.com/documentation/integration-guides/indicators-for-credit-check) [NextWebhooks](https://docs.powens.com/documentation/integration-guides/webhooks) Last updated 6 months ago Was this helpful? --- # Legal notice | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/legal-notice.md) . In accordance with the requirements of articles 6-Ⅲ and 19 of the French law of June 21, 2004 for confidence in the digital economy (Law 2004-669), Powens (Budget Insight) states that the current website [docs.powens.com](https://docs.powens.com/documentation/) is managed by Powens, a simplified joint-stock company with share capital of 33.151,60€ with registered office at 84 rue Beaubourg – 75003 Paris, France and registered in the Paris Trade and Companies Register under number 749 867 206. Powens (Budget Insight) is registered by the Prudential Supervision and Resolution Authority (ACPR) under number CIB 16948 on the official list [regafi.fr](https://www.regafi.fr/) as a payment institution. Publication director: Jean Guillaume (Powens CEO) Phone: 09 53 97 54 43 This website makes use of the [GitBoot](https://www.gitbook.com/) platform, including its [subprocessors](https://policies.gitbook.com/privacy-and-security/security/subprocessors) . Powens (Budget Insight) proceed in accordance to the GDPR, the Directive 2002/58/EC (Privacy Directive), and the French Data Protection and Freedom of Information Law (Loi Informatique et Liberté) of 6 January 1978. [PreviousGlossary](https://docs.powens.com/documentation/ressources/glossary) Last updated 11 months ago Was this helpful? --- # Advisory (obsolete) | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/advisory-obsolete.md) . ### User advisory[](https://docs.powens.com/documentation/integration-guides/advisory-obsolete#user-advisory) We provide a specific endpoint to allow you to access advisory metrics computed on end users’ banking data: Copy GET /users/me/advisory Copy { "id_user": 701, "last_update": "2023-03-30 11:27:21", "currency": "EUR", "periods": [\ {\ "period": "2022_12",\ "transactions_count": 65,\ "id_accounts": [\ 131,\ 133\ ],\ "min_date": "2022-12-04",\ "max_date": "2022-12-31",\ "disposable_income": {\ "currency": "EUR",\ "value": "2120.00"\ },\ "net_savings": {\ "currency": "EUR",\ "value": "4034.00"\ },\ "events": [\ {\ "count": 0,\ "event": "unauthorized-overdraft"\ }\ ],\ "transaction_types": [\ {\ "type": "card",\ "count": 3,\ "expenses_count": 3,\ "expenses_total": {\ "currency": "EUR",\ "value": "-1234.68"\ },\ "incomes_count": 0,\ "incomes_total": {\ "currency": "EUR",\ "value": "0.00"\ },\ "total": {\ "currency": "EUR",\ "value": "-1234.68"\ }\ },\ {\ "type": "withdrawal",\ "count": 0,\ "expenses_count": 0,\ "expenses_total": {\ "currency": "EUR",\ "value": "0.00"\ },\ "incomes_count": 0,\ "incomes_total": {\ "currency": "EUR",\ "value": "0.00"\ },\ "total": {\ "currency": "EUR",\ "value": "0.00"\ }\ },\ ...\ ],\ "transaction_categories": [\ {\ "category": "revenue",\ "count": 1,\ "total": {\ "currency": "EUR",\ "value": "2900.00"\ }\ },\ {\ "category": "loans",\ "count": 0,\ "total": {\ "currency": "EUR",\ "value": "0.00"\ }\ },\ {\ "category": "housing",\ "count": 1,\ "total": {\ "currency": "EUR",\ "value": "-780.00"\ }\ },\ {\ "category": "household",\ "count": 0,\ "total": {\ "currency": "EUR",\ "value": "0.00"\ }\ }\ ]\ }\ ] } ### Steps[](https://docs.powens.com/documentation/integration-guides/advisory-obsolete#steps) 1. Ask your Account Manager to activate the Advisory plugin. 2. [Add a first user and connection](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) or [synchronize an existing connection after Advisory plugin activation](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states) . 3. Call the endpoint. Synchronizations The Advisory metrics are computed asynchronously after every user synchronization. As such, the advisory metrics may not be available for a few seconds after a user first synchronization; if so the route will return the following output: Copy { "id_user": 701, "last_update": null, "currency": "EUR", "periods": [] } We would then suggest that you query it again after a few seconds, after which the complete JSON response should appear. [PreviousProof & Certificates Retrieval](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval) [NextIndicators for Credit Check](https://docs.powens.com/documentation/integration-guides/indicators-for-credit-check) Last updated 6 months ago Was this helpful? --- # Indicators for Credit Check | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/indicators-for-credit-check.md) . ### User indicator[](https://docs.powens.com/documentation/integration-guides/indicators-for-credit-check#user-indicator) We provide a specific endpoint to allow you to access indicators metrics computed on end users’ banking data: Copy GET /users/me/indicators Copy { "id_user":3, "indicators":{ "avg_current_month":{ "incoming":3573, "outgoing":-594, "net_cash_flow":2979, "leverage_ratio":null, "recurrent_income":{ "num_statements":0.0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0.0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.0, "outcome_total_amount":0 }, "loans":{ "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0.0, "total_amount":0 } }, "total_current_month":{ "incoming":3573, "outgoing":-594, "net_cash_flow":2979, "leverage_ratio":null, "recurrent_income":{ "num_statements":0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":0, "outcome_total_amount":0 }, "loans":{ "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0, "total_amount":0 } }, "avg_last_30days":{ "incoming":511, "outgoing":-480, "net_cash_flow":32, "leverage_ratio":null, "recurrent_income":{ "num_statements":0.0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0.0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.4, "outcome_total_amount":-31 }, "loans":{ "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0.0, "total_amount":0 } }, "total_last_30days":{ "incoming":15342, "outgoing":-14388, "net_cash_flow":954, "leverage_ratio":null, "recurrent_income":{ "num_statements":0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":12, "outcome_total_amount":-942 }, "loans":{ "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0, "total_amount":0 } }, "avg_last_60days":{ "incoming":256, "outgoing":-240, "net_cash_flow":16, "leverage_ratio":null, "recurrent_income":{ "num_statements":0.0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0.0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.2, "outcome_total_amount":-16 }, "loans":{ "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0.0, "total_amount":0 } }, "total_last_60days":{ "incoming":15342, "outgoing":-14409, "net_cash_flow":933, "leverage_ratio":null, "recurrent_income":{ "num_statements":0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":12, "outcome_total_amount":-942 }, "loans":{ "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0, "total_amount":0 } }, "avg_last_90days":{ "incoming":170, "outgoing":-160, "net_cash_flow":10, "leverage_ratio":null, "recurrent_income":{ "num_statements":0.0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0.0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.133, "outcome_total_amount":-10 }, "loans":{ "income_num_statements":0.0, "income_total_amount":0, "outcome_num_statements":0.0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0.0, "total_amount":0 } }, "total_last_90days":{ "incoming":15342, "outgoing":-14409, "net_cash_flow":933, "leverage_ratio":null, "recurrent_income":{ "num_statements":0, "total_amount":0, "details":null }, "recurrent_outcome":{ "num_statements":0, "total_amount":0, "details":null }, "gambling":{ "gambling_ratio":null, "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":12, "outcome_total_amount":-942 }, "loans":{ "income_num_statements":0, "income_total_amount":0, "outcome_num_statements":0, "outcome_total_amount":0, "details":null }, "return_debit":{ "num_statements":0, "total_amount":0 } } } } ### Steps[](https://docs.powens.com/documentation/integration-guides/indicators-for-credit-check#steps) 1. Ask your Account Manager to activate the Indicators plugin. 2. [Add a first user and connection](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) or [synchronize an existing connection after Indicators plugin activation](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states) . 3. Call the endpoint. Synchronizations The Indicators metrics are computed asynchronously after every user synchronization. As such, the indicators metrics may not be available for one minute after a user first synchronization; if so the route will return the following output: Copy { "id_user": 701, "indicators": None, } We would then suggest that you query it again after a few seconds, after which the complete JSON response should appear. [PreviousAdvisory (obsolete)](https://docs.powens.com/documentation/integration-guides/advisory-obsolete) [NextSCA & connection states](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states) Last updated 6 months ago Was this helpful? --- # Connect SDK | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/sdk/connect-sdk.md) . With **Connect SDK**, you can integrate directly into your applications to connect with all the financial data Powens is providing. Leveraging OAuth 2.0 authentication, our SDK ensures secure and transparent access to user data. Here's a high-level overview of how it works: 1. Send the end user to a product flow in our mobile SDK. 2. The user selects their bank, provides consent, and authenticates through the provided flow. 3. Once the process is complete, the user is redirected back to your application with the operation's result. Choose the appropriate implementation method based on your technology stack to start integrating our **Connect SDK** seamlessly into your applications. ### Mobile App[](https://docs.powens.com/documentation/sdk/connect-sdk#mobile-app) Powens UI SDK has been developed in Kotlin to ensure easy accessibility on both iOS and Android. [](https://docs.powens.com/documentation/sdk/powens-connect-ios) **iOS** Learn how to integrate our Connect iOS SDK into your app **Android (coming soon)** Learn how to integrate our Connect Android SDK into your app [PreviousResponse signature](https://docs.powens.com/documentation/integration-guides/advanced/response-signature) [NextPowens Connect iOS](https://docs.powens.com/documentation/sdk/powens-connect-ios) Last updated 6 months ago Was this helpful? --- # Advanced | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/advanced.md) . **Custom connection implementation** Make your own connection interface (available for integrators recognized by legal authorities) **End-to-end encryption** Ensure sensitive data confidentiality is guaranteed all the way **Response signature** Prove data integrity to a third party [PreviousWebhooks](https://docs.powens.com/documentation/integration-guides/webhooks) [NextCustom connection implementation](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation) Last updated 3 years ago Was this helpful? --- # Response signature | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/advanced/response-signature.md) . The API can generate [JWS](https://en.wikipedia.org/wiki/JSON_Web_Signature) tokens instead of JSON responses. This may be useful if you or one of your clients needs to assert * the data's origin, * which request was used exactly, * the timestamp the request was executed at. Signed responses need to be enabled. Contact us. Get signed responses[](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#get-signed-responses) ---------------------------------------------------------------------------------------------------------------------------------- To get a signed response, add the following query parameter to your request: Copy sign_response=true Token format[](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#token-format) ------------------------------------------------------------------------------------------------------------------ As any JWS, the structure is `header.payload.signature`, where * `header` is a base64-encoded JSON with information about the signature process (see [Verify token signature](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#verify-token-signature) ), * `payload` is a base64-encoded JSON with the following structure: Copy { "request_url": ..., "response_timestamp": ..., "response_payload": ..., } * `signature` is a base64-encoded bytes section. Verify token signature[](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#verify-token-signature) -------------------------------------------------------------------------------------------------------------------------------------- 1. Get the `key_url` in the header, 2. Fetch the key (see [Get a key](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#get-a-key) ), 3. Check if the `deprecated` field is `null`, 4. Use the `public_key` field to check the signature using your favorite JWS library. Keys resource[](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#keys-resource) -------------------------------------------------------------------------------------------------------------------- ### List keys[](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#list-keys) The list of past and present keys can be obtained at Copy /sign-keys ### Get a key[](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#get-a-key) Copy GET /sign-keys/{key_id} #### Keys format[](https://docs.powens.com/documentation/integration-guides/advanced/response-signature#keys-format) Property Type Description id Number ID of the key. public\_key String PEM of the public key. deprecated DateTime or null If set, this key is deprecated and any signature using it should not be trusted. [PreviousEnd-to-end encryption](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption) [NextConnect SDK](https://docs.powens.com/documentation/sdk/connect-sdk) Last updated 6 months ago Was this helpful? --- # End-to-end encryption | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption.md) . Banking credentials are very sensitive data. As an integrator of our services, you must ensure that confidentiality is guaranteed all the way from the user interface where they are entered, to our API endpoint where they are consumed. The whole transmission flow must be processed over a [secure transport protocol](https://en.wikipedia.org/wiki/HTTPS) , but it may still involve intermediate components such as third-party API servers or caches that are **not** legally authorized to handle cleartext credentials. Implementing end-to-end encryption is **mandatory** for both BI agents and partners when not using our Connect webview. Encryption is strongly advised for white-mark contracts. Our API allows you to secure user credentials transmission using [asymmetric key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography) , by encrypting values **before they are transmitted** to your intermediate architecture. The resulting payload can only be decrypted by our API. UserUser InterfaceIntermediate APIOur APIEncrypt credentialsDecrypt credentials🔓 Enter credentials🔒 Encrypted credentials🔒 Encrypted credentials ### Endpoints support[](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption#endpoints-support) End-to-end encryption apply to the following endpoints: * [Connection creation](https://docs.powens.com/api-reference/user-connections/connections) for initial values of a connector's fields (this endpoint is only accessible to agents and white-mark contracts); * [Connection update](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection) for values of transient additionnal fields; * Transfer update for values of transient additionnal fields; * [Payment update for static field values](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#prepare-the-expected-fields) , when implementing a validation webview. ### Encryption steps[](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption#encryption-steps) End-to-end encryption consists in substituting every cleartext sensitive values in HTTP requests with an encrypted [JSON Web Encryption (JWE) payload](https://tools.ietf.org/html/rfc7516) . The resulting HTTP request body is still a JSON object, with modified values. Copy POST /user/me/connections Copy { "id_connector": 33, "username": "john", "password": "cleartext" } Copy POST /user/me/connections Copy { "id_connector": 33, "username": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…", "password": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" } Before: Cleartext credentials as string value in request body After: Sensitive values are encrypted in request body We strongly advise relying on existing cryptography libraries to achieve proper JWE encryption. The choice of a library will likely vary with your specific environment and configuration. We suggest the following projects: * [js-jose](https://github.com/square/js-jose) , a JavaScript library with good browser compatibility, available as an [npm package](https://www.npmjs.com/package/jose-jwe-jws) ; * [Nimbus JOSE](https://connect2id.com/products/nimbus-jose-jwt) , a Java library usable in Android native apps; * [JOSESwift](https://github.com/airsidemobile/JOSESwift) , a framework written in Swift, usable in iOS native apps; * [jwcrypto](https://jwcrypto.readthedocs.io/) , a Python2/3 implementation. Implementation details vary with each library. They usually include the following steps: 1. Obtain the public end-to-end encryption key associated with your API domain by calling the following endpoint. The key is available as a [JSON Web Key (JWK)](https://tools.ietf.org/html/rfc7517) . 2. Copy GET /publickey 3. Import the key according to the library documentation. 4. If needed, convert text values of credentials to raw bytes (UTF-8 encoding). 5. Encrypt the payload according to the library documentation, with **RSA-OAEP-256** padding and **A256GCM** algorithm. We require the key ID (`kid`) to be included in the JWE header. 6. Serialize the JWE to its compact format (URL-safe Base64 parts delimited by period), ready to be sent to our API. Encryption keys are available in the [administration console](https://console.budget-insight.com/) , on your domain's settings page. ### Examples[](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption#examples) TypeScript integration using [js-jose](https://github.com/square/js-jose) library[](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption#typescript-integration-using-js-jose-library) Copy import { Jose } from 'jose-jwe-jws'; async encrypt(values: { [key: string]: any }): Promise<{ [key: string]: any }> { // Import your public key const jwkRsa = JSON.parse('') as JWKRSA; const key = await Jose.Utils.importRsaPublicKey(jwkRsa, 'RSA-OAEP'); // Prepare an encrypter const cryptographer = new Jose.WebCryptographer(); const encrypter = new Jose.JoseJWE.Encrypter(cryptographer, key); encrypter.addHeader('kid', jwkRsa.kid); // Encrypt cleartext values independently const encrypted: { [key: string]: string } = {}; for (const k of Object.keys(values)) { encrypted[k] = await encrypter.encrypt(values[k]); } return encrypted; } Kotlin integration using [Nimbus JOSE](https://connect2id.com/products/nimbus-jose-jwt) library[](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption#kotlin-integration-using-nimbus-jose-library) Copy import com.nimbusds.jose.* import com.nimbusds.jose.crypto.RSAEncrypter import com.nimbusds.jose.jwk.RSAKey fun encrypt(values: Map) : Map { // Import your public key val key = RSAKey.parse('') // Prepare an encrypter val header = JWEHeader.Builder(JWEAlgorithm.RSA_OAEP_256, EncryptionMethod.A256GCM) .keyID(key.keyID) .build() val encrypter = RSAEncrypter(key) // Encrypt cleartext values independently return values.mapValues { JWEObject(header, Payload(it.value.toString().toByteArray())) .also { it.encrypt(encrypter) } .serialize() } } Swift integration using [JOSESwift](https://github.com/airsidemobile/JOSESwift) library[](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption#swift-integration-using-joseswift-library) Copy import JOSESwift func encrypt(values: [String: String]) throws -> [String: String] { // Import your public key let keyJson = try JSONSerialization.jsonObject( with: "".data(using: .utf8)!, options: .allowFragments ) as? [String: String] guard let keyData = try? JSONSerialization.data(withJSONObject: keyJson) else { throw EncryptionError } let jwk = try? RSAPublicKey(data: keyData) let key = try? jwk?.converted(to: SecKey.self) // Prepare an encrypter var header = JWEHeader(algorithm: .RSAOAEP256, encryptionAlgorithm: .A256CBCHS512) header.kid = keyJson!["kid"] guard let encrypter = Encrypter( keyEncryptionAlgorithm: .RSAOAEP256, encryptionKey: key, contentEncyptionAlgorithm: .A256CBCHS512 ) else { throw EncryptionError } // Encrypt cleartext values independently var encrypted: [String: String] = [:] for key in values.keys { guard let data = values[key]?.data(using: .utf8) else { throw EncryptionError } let payload = Payload(data) guard let jwe = try? JWE(header: header, payload: payload, encrypter: encrypter) else { throw EncryptionError } encrypted[key] = jwe.compactSerializedString } return encrypted } [PreviousCustom connection implementation](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation) [NextResponse signature](https://docs.powens.com/documentation/integration-guides/advanced/response-signature) Last updated 6 months ago Was this helpful? --- # Powens Connect iOS | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/sdk/powens-connect-ios.md) . The Powens Connect SDK allows you to quickly and easily implement aggregation journeys and connect with Powens APIs in your iOS app. ### Installation[](https://docs.powens.com/documentation/sdk/powens-connect-ios#installation) #### From Cocoapods[](https://docs.powens.com/documentation/sdk/powens-connect-ios#from-cocoapods) 1. If you haven’t already, install the latest version of [Cocoapods](https://guides.cocoapods.org/using/getting-started.html#installation) . 2. If you don’t have an existing [Podfile](https://guides.cocoapods.org/syntax/podfile.html) , run the following command to create one at the root of your Xcode project: Copy pod init 1. Add this line to your Podfile: Copy pod 'PowensConnect', '1.0.0-beta' 1. Run the following command: Copy pod install 1. From now on you will use the `.xcworkspace` file to open your Xcode project instead of the `.xcodeproj` file. 2. To update to the latest version of the SDK in the future, run: Copy pod update PowensConnect #### Manually[](https://docs.powens.com/documentation/sdk/powens-connect-ios#manually) 1. Download and unzip this Github project. 2. Drag **PowensConnect.xcframework** to the **Frameworks, Libraries and Embedded Content** section of the General settings in your Xcode project. Make sure to select **Copy items if needed**. 3. Repeat the above steps in the future to update to the latest version of the SDK. ### Configuration[](https://docs.powens.com/documentation/sdk/powens-connect-ios#configuration) 1. Right-click your `Info.plist` file and choose **Open as > Source Code**. 2. Paste the following into the body of your file (within `…`) to configure your Powens domain. Copy PowensDomain YOUR_DOMAIN Replace _YOUR\_DOMAIN_ with your actual Powens domain, without the `.biapi.pro` extension. 1. Paste the following into the body of your file (within `…`) to configure the Powens Connect dedicated URL scheme. If you already have custom URL schemes, simply paste the additional `CFBundleURLSchemes` to your `CFBundleURLTypes` array. Copy CFBundleURLTypes CFBundleURLSchemes powens-CLIENT_ID Replace _CLIENT\_ID_ with your client application ID. You can find your client applications IDs in the [administration console](https://console.powens.com/) , under **Applications** within your domain. ### Usage[](https://docs.powens.com/documentation/sdk/powens-connect-ios#usage) 1. Register for Powens Webview callback notifications from the view controller you wish to present the Powens Webview from. Copy // Registering for Webview callback notifications // Allows the automatic dismissal of the presented Webview controller from the source controller Powens.shared.handler.registerWebviewCallback(sourceViewController: self) 1. Open the desired Webview flow among Connect, Manage & Reconnect. Visit our [documentation](https://docs.powens.com/api-reference/overview/webview) for more information about the Webview flows and their usage. Copy Task { do { // Building the Connect flow URL and generating a temporary auth code when provided with an access token let handle = try await Powens.shared.launcher.connectFlow(accessToken: token, state: nil, options: options) // Building the Manage flow URL and generating a temporary auth code let handle = try await Powens.shared.launcher.manageFlow(accessToken: token, connectionId: nil, state: nil, options: options) // Building the Reconnect flow URL and generating a temporary auth code let handle = try await Powens.shared.launcher.reconnectFlow(accessToken: token, connectionId: connectionId, resetCredentials: resetCredentials, state: nil) // Presenting the Webview controller from the current view controller handle.presentOn(sourceViewController: self) } catch { NSLog(error.localizedDescription) } } 1. Handle the data received from the app callback URL. Copy do { try Powens.shared.handler.handleConnectCallback(url: url) { result in switch onEnum(of: result) { case .webviewConnectCallbackSuccess(let result): self.onConnectSuccess(result: result) case .webviewCallbackError(let error): self.onError(error: error) } } try Powens.shared.handler.handleManageCallback(url: url) { result in switch onEnum(of: result) { case .webviewManageCallbackSuccess(let result): self.onManageSuccess(result: result) case .webviewCallbackError(let error): self.onError(error: error) } } try Powens.shared.handler.handleReconnectCallback(url: url) { result in switch onEnum(of: result) { case .webviewCallbackError(let error): self.onError(error: error) default: break } } } catch { NSLog(error.localizedDescription) } Please refer to the [example Xcode project](https://github.com/powenscompany/powens-connect-ios/tree/main/Example/connect-ios-demo) from this repository for a complete example of the PowensConnect SDK usage. ### License[](https://docs.powens.com/documentation/sdk/powens-connect-ios#license) The Powens Connect SDK is available under the LGPLv3 license. See the [LICENSE](https://github.com/powenscompany/powens-connect-ios/blob/main/LICENSE.md) file for more information. [PreviousConnect SDK](https://docs.powens.com/documentation/sdk/connect-sdk) [NextTools](https://docs.powens.com/documentation/ressources/tools) Last updated 6 months ago Was this helpful? --- # Tools | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/ressources/tools.md) . [Institutions & capabilities](https://institutions.powens.com/) [Demo integration](https://docs.powens.com/demo-integration/#get-a-look-to-our-api-integration-demos) [Demo product](https://docs.powens.com/demo-integration) [PreviousPowens Connect iOS](https://docs.powens.com/documentation/sdk/powens-connect-ios) [NextGlossary](https://docs.powens.com/documentation/ressources/glossary) Last updated 6 months ago Was this helpful? --- # Webhooks | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/webhooks.md) . Our API offers a way to obtain data of end-users using [webhooks](https://en.wikipedia.org/wiki/Webhook) . After [a user connection has been configured](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) using our API endpoints, these callbacks are the most efficient way to get up-to-date user data. We highly recommend using webhooks instead of implementing an API-polling mechanism. ### Registering webhooks[](https://docs.powens.com/documentation/integration-guides/webhooks#registering-webhooks) You can [register a webhook](https://docs.powens.com/documentation/integration-guides/quick-start#register-a-webhook) in the [administration console](https://console.budget-insight.com/) of your domain. As many webhooks as needed can be registered. The console also lets you test webhooks triggering and handling. For instance, after you have configured a webhook for the [`CONNECTION_SYNCED`](https://docs.budget-insight.com/reference/connections#connection-synced) event, you can test that the callback is properly triggered when a user creates a new connection to his bank accounts in the webview. Webhooks are only triggered for _permanent_ users: you must have [obtained a permanent access token](https://docs.powens.com/api-reference/overview/authentication) for the user before you can receive webhook data. ### Available webhook events[](https://docs.powens.com/documentation/integration-guides/webhooks#available-webhook-events) You can subscribe to the following events: Event Description [`USER_CREATED`](https://docs.powens.com/api-reference/user-connections/users#user-created) Emitted after a permanent user is created. [`USER_DELETED`](https://docs.powens.com/api-reference/user-connections/users#user-deleted) Emitted after a user is deleted. [`~USER_SYNCED~`](https://docs.powens.com/api-reference/user-connections/users#user-synced-deprecated) _Deprecated._ Emitted after multiple connections of a user have been synced. [`CONNECTION_SYNCED`](https://docs.powens.com/api-reference/user-connections/connections#connection-synced) Emitted after a connection has been synced. [`CONNECTION_DELETED`](https://docs.powens.com/api-reference/user-connections/connections#connection-deleted) Emitted after a connection has been deleted. [`CONNECTION_CERTIFICATE_AVAILABLE`](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#webhook) Emitted after a connection has been synced for the first time, when an account ownership certificate can be requested for it. [`ACCOUNTS_FETCHED`](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#accounts-fetched) Emitted during a sync after bank accounts have been synchronized, but before the transactions are processed. [`ACCOUNT_CATEGORIZED`](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-categorized) Emitted during a sync after bank accounts have been synchronized, and after the transactions are processed. [`ACCOUNT_SYNCED`](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#accounts-synced) Emitted during a sync after a bank account was processed, including new transactions. [`ACCOUNT_DISABLED`](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-disabled) Emitted after a bank account was disabled. [`ACCOUNT_ENABLED`](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-enabled) Emitted after a bank account was enabled. [`ACCOUNT_FOUND`](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-found) Emitted after a new bank account was discovered. [`ACCOUNT_OWNERSHIPS_FOUND`](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships#webhook) Emitted during a sync after a bank ownerships have been synchronized. [`TRANSACTION_ATTACHMENTS_FOUND`](https://docs.powens.com/api-reference/products/data-aggregation/transactions-attachments#webhook) Emitted during a sync after bank accounts have been synchronized, and after the transactions are processed. [`SUBSCRIPTION_SYNCED`](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-synced) Emitted during a sync after a subscription was processed, including new documents. [`SUBSCRIPTION_FOUND`](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-found) Emitted after a new subscription was discovered. [`PAYMENT_STATE_UPDATED`](https://docs.powens.com/api-reference/products/payments/payments#payment-state-updated) Emitted after a payment has been updated. If the user is still in a _temporary_ state when the webhook events should be triggered (`USER_CREATED` for instance), the callback will be sent as soon as you make the user permanent. Webhooks are triggered: * after you ask for a specific action through the API and * after a background synchronization (every 24h by default). ### Technical integration[](https://docs.powens.com/documentation/integration-guides/webhooks#technical-integration) #### Receiving the webhook data[](https://docs.powens.com/documentation/integration-guides/webhooks#receiving-the-webhook-data) By default, webhooks are performed using HTTP `POST` requests, with JSON body data. The `autosync.cfonb` config key is available to change the format of the `ACCOUNT_FOUND`, `CONNECTION_SYNCED` and `USER_SYNCED` callbacks to the CFONB format. See the [full reference](https://docs.powens.com/documentation/integration-guides/webhooks#available-webhook-events) above for the detailed format of each webhook. Alongside the event specific data in the request body, an additional `id_webhook_data` integer field is also included. It allows you to identify the webhook payload uniquely. #### Expected response[](https://docs.powens.com/documentation/integration-guides/webhooks#expected-response) Your server must respond with a 2XX (success) HTTP response code when a webhook is received on the provided URL, otherwise we consider that the webhook data has not been received. If a webhook push failed, we will retry pushing that data until it is properly accepted. #### Compression of webhook payload[](https://docs.powens.com/documentation/integration-guides/webhooks#compression-of-webhook-payload) During the first synchronization of a connection, your webhook will receive all the user's transactions and/or documents, which may produce a very large HTTP payload of _multiple MBs_. You can enable webhook compression to reduce the size of the exchanged content in the following cases: * Your web server is configured to limit the HTTP body to a size that is not sufficient. * You have more CPU resources than bandwidth. When compression is activated, the HTTP body sent to your webhook will be compressed in gzip format and the HTTP header `content-encoding` will be set to `gzip`. To activate webhook data compression, use the `webhooks.compression.enabled` [configuration key](https://docs.powens.com/api-reference/api-setup/configuration#get-configuration) . ### Authentication[](https://docs.powens.com/documentation/integration-guides/webhooks#authentication) We support three alternative mechanisms to secure webhooks sent to your servers: #### Authentication with user-scoped token[](https://docs.powens.com/documentation/integration-guides/webhooks#authentication-with-user-scoped-token) The default mechanism for webhooks authentication is perfomed by adding the user token in every callback request in the `Authorization` header: Copy Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX When receiving a webhook, you can check that the provided token matches the record you have for the user, and reject the call otherwise. This is only available for webhooks related to a specific user (e.g. not `PAYMENT_STATE_UPDATE`). #### Authentication with a HMAC signature header[](https://docs.powens.com/documentation/integration-guides/webhooks#authentication-with-a-hmac-signature-header) An additional authentication method is available, which uses a hash-based message authentication code (HMAC). The code is generated with a shared secret, and authentication is performed by the client by recalculating the HMAC signature. This asserts that the sender of the webhook data knows the secret. In order to enable it, you need to create a new `auth_provider` of type `hmac_signature`: Copy POST /webhooks/auth authorization: Bearer { "type": "hmac_signature", "name": "My HMAC provider", } Copy { "id": 2356, "type": "hmac_signature", "name": "My HMAC provider", "config": { "secret_key": } } The secret used to compute the HMAC signature can be found in the `config` object. You should preserve this secret key safely as you will not be able to access it anymore after this. See the "Association" section below for linking this newly created provider to your webhook(s). The provider will add two headers to each webhook data: * `BI-Signature-Date` containing a datetime in UTC ISO 8601 format generated during the request creation. * `BI-Signature` = `BASE_64(HMAC_SHA256( + "." + + "." + + "." + , secret_key))` where: * is the HTTP method used (POST), in capital letters; * is the listening URL endpoint of the client; * is the value contained in the `BI-Signature-Date` header; * is the webhook data payload. Example calculation of a signature: `BASE_64(HMAC_SHA256('POST./v1/webhook-listener.2022-06-27T11:08:52.577831Z.{"id": 1, "state": "done", ...}', secret_key))` You can then reject any webhook data where the signature does not match your computation. #### OAuth2 authentication[](https://docs.powens.com/documentation/integration-guides/webhooks#oauth2-authentication) We also support securing webhooks using [OAuth 2.0](https://oauth.net/2/) , the industry-standard protocol for authorization. When an OAuth 2.0 _provider configuration_ is defined and associated with your wehbooks, callbacks will be secured with access tokens obtained from the authorization server and added to the `authorization` header. The provided authorization server endpoint must fully support the [`client_credentials` grant type of the protocol](https://oauth.net/2/grant-types/client-credentials/) : * accept a standard payload with `client_id`, `client_secret` and `grant_type` (set to `client_credentials`); * respond with a JSON entity with `access_token`, `token_type` (must be `Bearer`), and optionnally `expires_in` and `refresh_token` to implement tokens expiration; * optionally, support a additional layer of security using a pair of certificates. **Registration** Configuration of auth providers will soon be available in the administration console. In the meantime, you can register them using the API. You can use an API endpoint available on your domain to register a new provider. The call must be authenticated using your _configuration token_, available in the administration console. All parameters are mandatory, except from `public_cert` and `private_cert`. Copy POST /webhooks/auth authorization: Bearer { "type": "oauth", "name": "ACME provider", "config": { "url": "https://auth.example.org/token", // The full token endpoint URL of the provider "client_id": "123456", // Replace with your client ID "client_secret": "aJnr28jmdnIDNY9x11auihIX", // Replace with your client secret "grant_type": "client_credentials", "public_cert": "", // Optional public certificate to use with the provider "private_cert": "" // Optional private certificate to use with the provider } } Copy { "id": 2356, "type": "oauth", "name": "ACME provider" } **Association** When a provider has been created, you can associate it with a webhook in the administration console. ### Technical notes[](https://docs.powens.com/documentation/integration-guides/webhooks#technical-notes) #### Webhook vs. webhook data[](https://docs.powens.com/documentation/integration-guides/webhooks#webhook-vs-webhook-data) It is important to distinguish a webhook from its data. A webhook is a "registration" to a webhook event (USER\_CREATED, CONNECTION\_SYNCED, ...) including an URL that will receive the webhook data at event time. A webhook request payload includes data associated with the webhook's event. For example, a webhook registered with the `USER_CREATED` event will include data with user information. #### Webhook data flusher[](https://docs.powens.com/documentation/integration-guides/webhooks#webhook-data-flusher) Webhook requests are emitted immediately at creation (when the related event occurs). In case of failure, our webhook system uses a "flusher" retrying to send webhook data regularly. The flusher stops after 10 consecutive failures (or 2 timeouts) per webhook. In such case, it will attempt to send unprocessed webhook data at next execution. An email can be sent when the flusher is failing. You must set the **biapi.manager.email** config key to receive it. In order to prevent email flooding, the config key **webhooks.alerts\_frequency** determines the minimum number of days between two emails per webhook (default: 1 = one day, can be 0.5 for twice a day). When the problem is solved, a flush recovery email is sent. See [configuration](https://docs.powens.com/api-reference/api-setup/configuration) reference to update configuration values. You can monitor your webhook's health (average sending duration and sending success rate) through its `health_data` property. A warning is also displayed in a `warning` property if at least one of these values reaches a critical threshold. [PreviousSCA & connection states](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states) [NextAdvanced](https://docs.powens.com/documentation/integration-guides/advanced) Last updated 1 month ago Was this helpful? --- # Custom connection implementation | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation.md) . Building a full custom implementation of the connection protocol is only available to integrators holding the Agent Status as defined in article [L523-1](https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000035430788&cidTexte=LEGITEXT000006072026&dateTexte=20200618) of Code Monétaire et Financier (CMF). Please validate the integration with your account manager before proceeding. This option requires a significant amount of work and testing. We advise to rely on our [Connect webview](https://docs.powens.com/api-reference/overview/webview#add-connection-flow) unless necessary. ### UX guidelines[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#ux-guidelines) The following diagram illustrates the general recommended UX for adding a connection, see below for the detail of the different steps: ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FjtAmKXKhVtF5sCHbYm83%252Fconnection-flow%25402x.png%3Falt%3Dmedia%26token%3D60833f5c-79b5-419c-bd46-0f0805af3347&width=768&dpr=3&quality=100&sign=e2ba7888061e2c8f66c5ea5f8272bd2e&sv=3) ### Transactions and Wealth & Loans implementation[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#bank-and-wealth-implementation) For technical and regulatory reasons, bank connectors require a richer UX with multiple authentication steps as soon as your use-case involves gathering multiple account types (payment and non-payment). We recommend to present these steps sequentially and to follow these best practices: #### Option 1: Present additional accounts as an option (recommended)[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#option-1-present-additional-accounts-as-an-option-recommended) If your use case can work with a partial list of the user accounts, we recommend to present the aggregation of additional account types as an option on the activation screen: ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252F7XNUoeGw1VHClGMAmTp6%252Fconnection-flow-sequential-optional%25402x.png%3Falt%3Dmedia%26token%3Dbc978f6d-78d9-4723-82f7-c01ec55c1ad0&width=768&dpr=3&quality=100&sign=87eb39def7e327d55ae38456de1233a5&sv=3) #### Option 2: Restrict aggregation to required accounts only[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#option-2-restrict-aggregation-to-required-accounts-only) If your use-case only requires either payment or non-payment accounts, you should limit the connection flow to only the required account types: ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252FETb7S37kzyntkfHv98Ao%252Fconnection-flow-single-source%25402x.png%3Falt%3Dmedia%26token%3D898865a4-bc70-4766-b0ec-d227297dc8da&width=768&dpr=3&quality=100&sign=f8d75de5a6d902a90ece4e67aabd1149&sv=3) #### Option 3: Force chaining of authentication flows[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#option-3-force-chaining-of-authentication-flows) If you always need to get **all** accounts for a given user (payment and non-payment accounts), chain the authentication steps: ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2F1347016399-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FIKL8k8xs9Sfm1SpZ2QE1%252Fuploads%252Fv22htnW81xXivd4QzRjG%252Fconnection-flow-sequential%25402x.png%3Falt%3Dmedia%26token%3Dd4094000-d70c-46d9-a240-8aa202ab921e&width=768&dpr=3&quality=100&sign=3af517e913ecf835c9c3fce09451e4f0&sv=3) ### Technical steps[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#technical-steps) The full protocol of connection addition involves the following steps: * obtain a user context by creating a temporary user resource, or using an existing token; * if applicable, let the user select the target connector, and optionally the specific connector source (bank connectors only); * follow the appropriate authentication mechanism for the selected connector or source, either redirecting the user to a third-party webview, or presenting to the user a form with a set of credentials fields; * handle connection creation with potential multiple steps (e.g. multifactor authentication); * get user consent and activate individual access to bank accounts and subscriptions; * for bank connections, repeat these steps for all available connector sources. ### User context[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#user-context) Connection addition is performed in the context of an authenticated user in our API. You must obtain a user-scoped access token to interact with our API. For a new user, you can create a new access token in the API using the dedicated [`/auth/init`](https://docs.budget-insight.com/reference/authentication#create-an-anonymous-user) endpoint: Copy POST https://{domain}.biapi.pro/2.0/auth/init Copy { "client_id": "{clientId}", "client_secret": "{clientSecret}" } Copy { "auth_token": "{accessToken}", … } Once obtained, this access token represents the newly created user. You have to store it and reuse it to subsequently add new connections to this user or query the associated data. ### Connector selection[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#connector-selection) ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2Fdocs.budget-insight.com%2Fassets%2Fimg%2Fconnection-flow-1.png&width=768&dpr=3&quality=100&sign=54fb3643ae9573f65fd5948cce0da146&sv=3) If applicable for your use case, you may present to the user a list of supported connectors to pick from. You can obtain the list from the [`/connectors`](https://docs.budget-insight.com/reference/connectors##list-connectors) endpoint: Copy GET https://{domain}.biapi.pro/2.0/connectors Copy { "connectors": [\ {\ "id": 40,\ "name": "Connecteur de test",\ "auth_mechanism": "credentials",\ "capabilities": [ "bank", "document", "profile", … ],\ …\ },\ …\ ] } As we may add or modify connectors frequently, we do not recommend using a static cache of connectors. Instead, always get the current available list when adding a new connection. You can manage the connectors available on your domain in the administration console. You can filter the connectors list according to your needs, e.g. rely on the supported `capabilities`. #### Source refinement[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#source-refinement) For bank connectors, we provide a mechanism to aggregate subsets of a user bank accounts through the addition of connector _sources_. Connectors providing both payment and non-payment accounts will usually present two or more _sources_. You can access the sources of a connector and their properties by expanding the previous call: Copy GET https://{domain}.biapi.pro/2.0/connectors?expand=sources Copy { "connectors": [\ {\ "id": 40,\ "name": "Connecteur de test",\ "sources": [\ { "name": "directaccess", "priority": 1, "auth_mechanism": "credentials", "capabilities": [ … ], … },\ { "name": "openapi", "priority": 2, "auth_mechanism": "webauth", "capabilities": [ … ], … }\ ]\ },\ …\ ] } Adding sources to a connection separately and sequentially is required when integrating banking connectors. Failing to specify a source when adding a connection to a connector will result in a single source being available, hence with partial access to the end-accounts. Depending on your use-case, you can filter the sources to add using the `account_types` and `capabilities` attribute. Make sure the `disabled` property of a source is null before interacting with it (sources can be (de)activated in your administration console). Also, the `priority` order of sources must be honored when adding them sequentially: add the source with the _lowest_ `priority` value first. Once a source has been added, you usually give the user the choice of selecting the accounts to synchronize or adding further accounts for the chosen connector. It is also possible to not let them add another source right away, or at all. For example, if you are only interested in payment accounts, we strongly recommend that you only offer to add the only source that provides these account types. ### Add the connection or source[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#add-the-connection-or-source) The required flow varies depending on the `auth_mechanism` of the selected connector or source. #### Credentials connector/source[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#credentials-connectorsource) The `credentials` mechanism involves presenting a form with a set of fields and posting the values to the API to create the connection. ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2Fdocs.budget-insight.com%2Fassets%2Fimg%2Fconnection-flow-2a.png&width=768&dpr=3&quality=100&sign=ed28f6045a30dae7143c2a4267a5f706&sv=3) First, [determine the fields](https://docs.powens.com/api-reference/user-connections/connectors#connectorfield-object) that you must present to the user. You can obtain them by expanding the list of connectors call above (`?expand=fields`), or perform a dedicated call: Copy GET https://{domain}.biapi.pro/2.0/connectors/{connectorId}/fields Copy { "fields": [\ {\ "name": "login",\ "label": "Identifiant",\ "type": "text",\ "required": true,\ "connector_sources": [ "directaccess" ]\ },\ {\ "name": "password",\ "label": "Mot de passe",\ "type": "password",\ "required": true,\ "connector_sources": [ "directaccess" ]\ },\ …\ ] } If you are adding a single source to the connector, you should filter out the fields that do not match the name of the source. When adding a secondary source in a sequential experience, you should also filter out fields that are associated with sources already added, as the value is not required. You should build and present a UI that handles all the possible configurations of form fields. We recommend that you present the `label` and `description` texts with the input control, and that you pre-validate the input using the `required` and `regex` properties. When the user validates the form, send the chosen connector ID (optionally with the source) and the field values to the [creation endpoint](https://docs.powens.com/api-reference/user-connections/connections) : Copy POST https://{domain}.biapi.pro/2.0/users/me/connections?source=openapi Copy { "id_connector": 4, "login": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…", "password": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" } Copy { "id": 123, "state": null, … } All the field values must be [end-to-end encrypted](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption) when sent to the API. The above call will result in the creation of a new connection, returned in the response. As credentials are _synchronously_ checked during this step, handle the HTTP connection appropriately to avoid timeouts. When adding additional sources to an existing connection, use the same request on the [update endpoint instead](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection) . Connections or sources created with invalid credentials (refused by the establishment) are deleted at once. A new connection has to be created in that case when re-validating the form. Make sure you also handle the `wrongpass` error code that can be raised on posting the credentials. #### Webauth connector/source[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#webauth-connectorsource) The `webauth` mechanism involves delegating the authorization to a webview that should be presented to the end-user in a browser. ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2Fdocs.budget-insight.com%2Fassets%2Fimg%2Fconnection-flow-2b-3b.png&width=768&dpr=3&quality=100&sign=d2ba079b70dccd9a9c5a651a868e3eb5&sv=3) First, as with the `credentials` mechanism, determine the fields that you must present for the chosen connector. Check for any field whose `auth_mechanisms` include `webauth`: Copy GET https://{domain}.biapi.pro/2.0/connectors/{connectorId}/fields Copy { "fields": [\ {\ "auth_mechanisms": [ "webauth" ],\ "name": "website",\ "label": "Type de compte",\ "type": "list",\ "values": [ … ]\ },\ …\ ] } When adding a secondary source in a sequential experience, you should filter out fields that are associated with sources already added, as the value is not required. Once the user validates the form if any, [obtain a temporary code](https://docs.powens.com/api-reference/overview/authentication#generate-a-temporary-code) linked to your token to secure the connection addition: Copy GET https://{domain}.biapi.pro/2.0/auth/token/code Copy { "code": "xxxxxx", … } Then, open the [webauth endpoint](https://docs.powens.com/api-reference/user-connections/connections#redirect-to-a-url-for-web-authorization) in a browser and specify the connector ID and source: Copy https://{domain}.biapi.pro/2.0/webauth ?client_id={clientId} &token={temporaryCode} &id_connector={connectorId} &source={optionalSource} &redirect_uri={yourCallbackUri} In the case there were presented fields, submit their values along with these parameters. The `redirect_uri` that you provide here is required to match the configuration set in the administration console. After authorization has been granted by the user in the webview, you will be redirected to the provided `redirect_uri`, with additional parameters added in the query: Copy {yourCallbackUri} ?id_connection=123 &state=null ### Resume connection state[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#resume-connection-state) Immediately after the connection or source is created, we may need additional information or an SCA to perform the first synchronization of the connection. According to the `state` of the connection or the source (either obtained in the API response or as a parameter of the redirect URI), you must take the steps described in [the guide dedicated to connection state handling](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states) . ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2Fdocs.budget-insight.com%2Fassets%2Fimg%2Fconnection-flow-3a.png&width=768&dpr=3&quality=100&sign=1f3cab7e333da4e902be2f8345edeec8&sv=3) ### Activate bank accounts and subscriptions[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#activate-bank-accounts-and-subscriptions) After a new connection or source is added and synced, new bank accounts and subscriptions are discovered and made available in the API. However, due to GDPR enforcement, full synchronization is not enabled on these resources as an explicit and dedicated end-user approval is required. By default, they are flagged with the `disabled` property. ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2Fdocs.budget-insight.com%2Fassets%2Fimg%2Fconnection-flow-4.png&width=768&dpr=3&quality=100&sign=b26db5d4147b939667b9364f3982113a&sv=3) You may [list the accounts](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#list-bank-accounts) /[subscriptions](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions) and prompt the end-user for activating them: Copy GET https://{domain}.biapi.pro/2.0/users/me/connections/{connectionId}/accounts?all Copy { "accounts": [\ { "id": 1234, "name": "Current account", "disabled": "2020-06-01 12:34:56", … },\ { "id": 4567, "name": "Saving account", "disabled": "2020-06-01 12:34:56", … },\ …\ ] } You can also use the `expand=all_accounts,all_subscriptions` feature on a connection to get the activable resources at once. Once desired sources have been added, and the user has selected the appropriate accounts/subscriptions, you can active the accounts/subscriptions to enable the synchronization of their transactions and documents: Copy PUT https://{domain}.biapi.pro/2.0/users/me/connections/{connectionId}/accounts/1234,4567?all Copy { "disabled": false } The UI to activate bank accounts or subscriptions is the recommended place to perform sequential addition of optional sources. First, let the user add the first source only using the above steps. Then, on listing the available accounts, you can propose an option to add more accounts by adding the next source if available (enabling accounts must be done in one call after the addition of the sources): ![](https://docs.powens.com/documentation/~gitbook/image?url=https%3A%2F%2Fdocs.budget-insight.com%2Fassets%2Fimg%2Fconnection-flow-4-alt.png&width=768&dpr=3&quality=100&sign=17134643d6349e71f1423ad83f2f514f&sv=3) ### Persist the created user[](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation#persist-the-created-user) If you created a temporary user on initializing the process, you must eventually [convert your temporary token](https://docs.powens.com/api-reference/overview/authentication#exchange-a-temporary-code-for-a-permanent-user-access-token) to a permanent access token. You may store this new token to access data of the user: Copy POST https://{domain}.biapi.pro/2.0/auth/token/access Copy { "grant_type": "authorization_code", "client_id": "{clientId}", "client_secret": "{clientSecret}", "code": "{temporaryAccessToken}" } Copy { "token": "{longLivedAccessToken}" } [PreviousAdvanced](https://docs.powens.com/documentation/integration-guides/advanced) [NextEnd-to-end encryption](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption) Last updated 6 months ago Was this helpful? --- # Glossary | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/ressources/glossary.md) . #### Client application[](https://docs.powens.com/documentation/ressources/glossary#client-application) A client application identifies a caller requesting your Powens API. One client application is required at least per API. The definition of a client application lets you configure the associated [Webview](https://docs.powens.com/api-reference/overview/webview) , a ready-to-use web interface to add connections to your domain. You can configure multiple client applications if you wish to propose webviews with different settings. #### Connection[](https://docs.powens.com/documentation/ressources/glossary#connection) A [connection](https://docs.powens.com/api-reference/user-connections/connections) materializes the link between an end user and one of the connector we support. Adding a connection requires the end user to authenticate on the connector. As long as the credentials stay valid, we take care of synchronizing user data. Product data are available through connections. #### Connector[](https://docs.powens.com/documentation/ressources/glossary#connector) In our system, the [connector](https://docs.powens.com/api-reference/user-connections/connectors) represents the institution with which we establish a connection to retrieve end user data (bank accounts, transactions, billing contracts, documents…). #### Credentials[](https://docs.powens.com/documentation/ressources/glossary#credentials) Credentials generally represents end user identifiers (login, password or other key fields). In the context of connections in Powens API, "credentials" is also the name we use for a specific authentication mechanism where the end user is filling a form with his identifiers in order to establish the connection with the institution. In this case, we store the credentials in an encrypted and secured device. #### Direct Access[](https://docs.powens.com/documentation/ressources/glossary#direct-access) `directaccess` is one of the [connector source types](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) representing the website of the institution from which we directly read the information. #### Fallback[](https://docs.powens.com/documentation/ressources/glossary#fallback) `fallback` is one of the [connector source types](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) representing the emergency gateway provided by banks regarding of the PSD2 when their API is down. #### Open API[](https://docs.powens.com/documentation/ressources/glossary#open-api) `openapi` is one of the [connector source types](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) representing an API provided by the institution to get data (i.e. PSD2 API for European banks). #### PSU[](https://docs.powens.com/documentation/ressources/glossary#psu) Payment Service User, the end-user of payment services. #### Source[](https://docs.powens.com/documentation/ressources/glossary#source) In order to access institution information (bank accounts, transactions, billing contracts, documents…), we can use various channels. The channel allows us to establish a connection with the institution, it is called a [connector source](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) . We currently handle three types of source: `openapi`, `fallback` and `directaccess`. #### Subscription[](https://docs.powens.com/documentation/ressources/glossary#subscription) A subscription is a representation of a bill contract or group of documents. It is a parallel representation of accounts on the bank system. #### Webauth[](https://docs.powens.com/documentation/ressources/glossary#webauth) "webauth" is the name we use for a specific authentication mechanism where the end user is redirected to the app or website owned by the institution on which he wants to connect. In this case, we do not store end user credentials, the login process is handled by the institution that just confirms or denies the authentication and calls us back. [PreviousTools](https://docs.powens.com/documentation/ressources/tools) [NextLegal notice](https://docs.powens.com/documentation/legal-notice) Last updated 6 months ago Was this helpful? --- # Changing the maximum amounts for payments | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-maximum-amounts-for-payments.md) . You can set the maximum amount for payments you create on the APIs, e.g. for security reasons. This information is stored in the configuration, and adopts the limitation of the environment by default, i.e. 10€ for sandboxes, and unlimited in production. In order to change it to e.g. 20€ in production, you can do the following call using a config or administration token: Copy POST /config Copy { "payment.max_amount": "20" } If you set a limit of 20€ on a sandbox domain through this configuration variable, the limitation to 10€ applied to all sandbox domains will still apply first, so it will be impossible to create 15€ payments for example. [PreviousChanging the manual expiration time](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-manual-expiration-time) [NextProof & Certificates Retrieval](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval) Last updated 6 months ago Was this helpful? --- # Changing the manual expiration time | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-manual-expiration-time.md) . Every Pay by Bank domain defines a number of days after which, if a payment is still `pending`, its state will be changed to `expired`. This information is stored in the configuration, and is set to 30 days by default. In order to change it to e.g. 7 days, you can do the following call using a config or administration token: Copy POST /config Copy { "payment.manual_expire_time_days": "7" } [PreviousConfirming payments manually](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually) [NextChanging the maximum amounts for payments](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-maximum-amounts-for-payments) Last updated 6 months ago Was this helpful? --- # Confirming payments manually | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually.md) . For some connectors, it may be possible to have control over the payment confirmation process. This is useful if you want to check that the user is the same at both the beginning and end of the payment validation process, or in some cases, if the updated payment object still corresponds to what you expect. Note that the confirmation phase of a payment's validation is typically very short, and in most cases, an answer is expected **within a minute**, or the payment validation is likely to expire. Disable automatic payment confirmation[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually#disable-automatic-payment-confirmation) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- By default, your domain automatically confirms payments if necessary. In order to disable this behaviour, you can set the `payment.auto_confirmation` setting to `"0"`, with the following request: Copy POST /config Copy { "payment.auto_confirmation": "0" } Detect if a payment validation requires confirmation[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually#detect-if-a-payment-validation-requires-confirmation) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ When receiving a callback from the payer (for example, [here](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview#receive-a-callback-from-the-payer) with one-time payments), you need to poll the payment status. A payment currently awaiting confirmation will have the `validating` status with the `confirm` action, as in the following example: Copy GET /payments/123 Copy { "id": 123, "state": "validating", "action": "confirm", ... } At this stage, you must run your checks and either confirm or deny the payment. Confirm a payment validation[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually#confirm-a-payment-validation) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ To confirm the payment, the following request can be made: Copy POST /payments/123 Copy { "confirm": true } Deny a payment validation[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually#deny-a-payment-validation) ------------------------------------------------------------------------------------------------------------------------------------------------------------------ To deny the payment, the following request can be made: Copy POST /payments/123 Copy { "confirm": false } This changes the payment `state` to `rejected`, and if no other error has occurred (such as the payment confirmation request being expired), the `error_code` will be set to `confirmationRefused`. [PreviousImplementing your own payment validation webview](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview) [NextChanging the manual expiration time](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-manual-expiration-time) Last updated 6 months ago Was this helpful? --- # Implementing your own payment validation webview | Powens Documentation For the complete documentation index, see [llms.txt](https://docs.powens.com/documentation/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview.md) . **This guide assumes you are authorized to implement your own webview**. If you don't know whether you are or not, ask your commercial contact about it. This guide assumes that you have the following elements: * A Powens domain with Pay by Bank enabled. * A payment, regardless of its type, with the `"created"` status. A payment validation webview must be isolated, with a defined role and behaviour whatever its design integration is. This role is described here, through specific steps and conditions the webview must traverse to validate the current operation on a payment. Get the payment's current state[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#get-the-payments-current-state) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- At startup, the webview must get the current state of the payment: * If the payment's state is `created`, then the webview can do the steps to [validate the payment](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#validate-the-payment) . * If the payment's state is `validating` and the current action is **not** `confirm`, then the webview can continue to [handle interactive steps](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#handle-interactive-steps) . * Otherwise, the payment is unsuitable for validation by the webview, and the end user should be redirected to the final redirect URL with a suitable state. Note that this request is also required to get other information regarding the payment, e.g. to determine the constraints applied to obtain eligible connectors. **The Pay by Bank API does not support changing webviews during a single payment validation flow.** If the payment is already in the `validating` state, this guide assumes that the initiation payment validation was done by the same webview, and either the end user has reloaded the page (e.g. resumed the flow due to a client-side crash), or came back from a redirect flow with the bank. Validate the payment[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#validate-the-payment) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This section is required if the payment is currently in the `created` state. Validating the payment is about placing it in a state where we have to answer interactive steps. In order to do this, we must prepare a few properties before validating the payment. ### Select a connector for the payment[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#select-a-connector-for-the-payment) If the connector isn't set yet on the payment, i.e. if `connector_uuid` is set to `null` on the current status of the payment, you need to pick a connector for the payment. In order to find available connectors for making payments, you need to make the following request: Copy GET /connectors Copy { "connectors": [\ {\ "id": 1234,\ "name": "Arkéa Banking Services",\ ...\ "payment_settings": {\ "available_validate_mechanisms": ["webauth"],\ ...\ }\ },\ ...\ ] } Connectors supporting the Pay by Bank product, identified by having `"pay"` in its `products` list, will define a `payment_settings` object, which present Pay by Bank constraints and features for this specific connectors. **You need to filter them on the client side, depending on the payment**: * The connector must have `"pay"` in its `products` list. * The payment's number of instructions must be less or equal to `maximum_number_of_instructions` from the connector's `payment_settings`. * For all instructions of the payment: * The instruction's `execution_date_type` value must be present in the `execution_date_types` within the connector's `payment_settings`. * The instruction's scheme\_name from beneficiary value must be present in the connector's `beneficiary_types` attribute in `payment_settings`. * If the instruction has an `execution_date_type` set to `periodic`, the `frequency` is present in `execution_frequencies` from the connector's `payment_settings`. Beyond these standard filters, you can also apply yours depending on your configuration: * If you want to avoid having to ask the end user for their IBAN, you can avoid connectors with the `providing_payer_account` set to `mandatory`. * If you want to avoid payments ending in the `accepted` state, you can ensure that every instruction has an execution date type that isn't included in the connector's `partial_status_tracking` list. If you want to get the top connectors for Pay by Bank in terms of number of payments in the last month, in case you want to display them on top, you can request such connectors with the following request: Copy GET /connectors?top=10&top_key=payments Note that this request may return less than the number of connectors specified in the `top` parameter, for example it may return 7 connectors if all payments created in the last month have been affected only 7 connectors out of all possible connectors. ### Select a validation mechanism[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#select-a-validation-mechanism) The connector you've chosen provides a given set of validation mechanisms, in the `available_validate_mechanisms` attribute of the `payment_settings` at connector level. It is recommended to check which validation mechanisms you want to use at this stage. If you're not a white label, you must either restrict the connector list to connectors bearing the `webauth` (or any mechanism starting with `webauth_`) validation mechanism, or set the connector to the payment and redirect to Powens' webview, as you are not allowed to handle non-`webauth` validation mechanisms in your webview. Note that the procedure stops here if you redirect to Powens' webview at this stage. You are not to validate terms for the payment; Powens' webview will take care of this. ### Validate terms for the payment[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#validate-terms-for-the-payment) If you are a white label, this section is optional. First, the terms of service must be accepted by the end user. In order to do so, you must do the following call: Copy GET /payments/{paymentId}/terms Terms of service have not been accepted yet Terms of service have been accepted If the `to_sign` attribute is **both present and set to** `**true**`, then the terms of service are to be accepted by the end user. Copy { "to_sign": "true", ... } If the `to_sign` attribute is **either absent or set to** `**false**`, then the terms of service have already been accepted. Copy { "id": 4, "version": "budgea-004", "created": "2019-08-02 16:57:16", "deleted": null, "id_file": 5 } If the terms of service have not been accepted yet, you can get the content to display to the end user by making the following request: Copy GET /terms Copy { "terms": { "id": {idTerms}, ... }, "content": "Conditions générales d'utilisation de Budgea Bank & Pay & Bill...", "language": "fr" } In order to signify the acceptance of the terms of service for the payment by the end user, you can make the following request: Copy POST /payments/{paymentId}/terms Copy { "id_terms": {idTerms} } Copy { "success": "ok" } ### Prepare the expected fields[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#prepare-the-expected-fields) In order to check if fields are to be sent to the connector, you need to get the connector fields by making the following request: Copy GET /connectors/{connectorUUID}?expand=payment_fields Copy { "id": 123, ... "payment_fields": [\ {\ "name": "website",\ "label": "Cas d'usage",\ "regex": null,\ "type": "list",\ "required": false,\ "auth_mechanisms": ["webauth"],\ "values": [\ {\ "label": "Particuliers",\ "value": "par",\ },\ ...\ ]\ },\ ...\ ], ... } The website field should be requested from the end user if [the validation mechanism chosen beforehand](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#select-a-validation-mechanism) is present in the `auth_mechanisms` array in the field definition. Regardless of whether you are a white label or not, **you MUST use front encryption on all fields** before transmitting them. See [End-to-end encryption](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption) for more information. ### Prepare the payer account[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#prepare-the-payer-account) If the connector's UUID was already provided in the payment by the webview's client, you need to request the connector's information here by calling `GET /connectors/{connectorUUID}`. If `providing_payer_account` in the connector's `payment_settings` is set as `mandatory`, then the payer's identification must be requested from them. ### Send the validation request[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#send-the-validation-request) From the previous sections, you now have obtained the following information for validating the payment from the end user: * The connector UUID (if it wasn't already set). * The validate mechanism. * The field values, passed through [end-to-end encryption](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption) (if at least one is set). * The payer account identification (if it is required). * The callback URL for `redirect` actions (as `webview_url`). You must prepare a `webview_url`, in order to redirect the end user back to your webview to continue the validation process for the payment after `redirect` actions. This URL can contain query parameters which will be included in the callback. In case of multiple redirect steps, the end user will always be redirected to the same webview URL as provided in the validation request. Please ensure that you don't have nonces in said URL. You can now validate the payment, in order to pass it from the `created` state to `validating`: Copy POST /payments/{paymentId} With all options Connector already selected, no additional parameters Copy { "connector_uuid": "{connectorUUID}", "validate_mechanism": "webauth", "fields": { "website": "eyJh..." }, "payer": { "scheme_name": "iban", "identification": "FR76...", "label": "M. Jean DUPONT" }, "webview_url": "https://example.org/payment-validation-webview?redirect_url=...&state=123&id_payment=456", "validated": true } Copy { "validate_mechanism": "webauth", "webview_url": "https://example.org/payment-validation-webview?redirect_url=...&state=123&id_payment=456", "validated": true } Copy { "id": {paymentId}, "state": "validating", ... } The payment is now initiated, and interactive steps need to be taken for the payment to be fully validated. Handle interactive steps[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#handle-interactive-steps) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Either after successfully validating a payment in the `created` state or resuming validation on a payment in the `validating` state, interactive steps need to be taken towards continuing the operation. The current validation step is represented by the `action` property of the payment. ### "redirect" action (redirect flow)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#redirect-action-redirect-flow) This means that a redirect flow is to be accomplished by the end user. In this case, you must redirect the end user to the URL present in the `validate_uri` attribute of the payment. The URL **MUST NOT** be used in an iframe, only in full redirect, as it might be app-to-app compatible on mobile devices. At the end of the redirect flow, the end user will be redirected back to the webview through the URL you've defined in the `webview_url` attribute of the validation request. ### "decoupled" action (validation on other channel)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#decoupled-action-validation-on-other-channel) This means that a validation has been requested through another channel, such as a notification in a mobile application, or a link sent by e-mail or SMS. In this case, you must inform the end user that the validation is taking place, then request a check on the decoupled validation status with a 10 second delay, using the following request: Copy POST /payments/123 Copy { "resume": true } The 10 second timer should start **after the response is received**. For efficiency, some connectors may internalize part of the polling, which means the request defined above could take more than 10 seconds. ### "additionalInformationNeeded" action (temporary values required)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#additionalinformationneeded-action-temporary-values-required) This means that an additional information is required from the end user, such as one-time passwords or the identifier of the account to select for the payment. In this case, you must get the list of fields to ask the end user. For example, the payment will resemble this: Copy { "id": 123, "state": "validating", "action": "additionalInformationNeeded", ..., "fields": [\ {\ "name": "account_id",\ "type": "list",\ "label": "Please choose your payment account",\ ...\ }\ ], ... } And, in order to submit the values picked by the end user back to the API, a request such as this one must be made: Copy POST /payments/123 Copy { "fields": { "account_id": "FR76..." } } ### "psuValidation" action (payment request summary suggested)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#psuvalidation-action-payment-request-summary-suggested) This means that presenting a summary of the payment to the end user and letting them choose whether or not they want to pursue the validation flow is recommended at this point. This is mostly used when no redirect flow is available to do this, but a webview may emulate end user consent on such actions. In order to communicate that the end user consents to pursuing the validation flow, the following request should be made: Copy POST /payments/123 Copy { "psu_validate": true } If however, the end user chooses not to pursue the validation flow, the following request should be made: Copy POST /payments/123 Copy { "psu_validate": false } ### "confirm" action (client confirmation required)[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#confirm-action-client-confirmation-required) This means that payment validation confirmation is expected from the client. This must be considered as a `"pending"` payment state by the webview, which should redirect the end user to the client redirect URL and state. Validate your implementation with the test connector use cases[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#validate-your-implementation-with-the-test-connector-use-cases) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Different use cases are provided with the test connector to trigger specific validation mechanisms during the validation process. This will allow you to verify that you have correctly implemented the different [interactive steps](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#handle-interactive-steps) . ### List all available use cases[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#list-all-available-use-cases) Copy GET /connectors/338178e6-3d01-564f-9a7b-52ca442459bf?expand=payment_fields Copy { "id": 59, "name": "Connecteur de test", ... "payment_fields": [\ ...\ {\ "name": "use_case_pay",\ "label": "Use case",\ "regex": null,\ "type": "list",\ "required": false,\ "auth_mechanisms": [\ "webauth"\ ],\ "connector_sources": [\ "openapi"\ ],\ "values": [\ {\ "label": "Legacy (custom behaviour)",\ "value": "legacy"\ },\ {\ "label": "Webauth redirection",\ "value": "redirect"\ },\ {\ "label": "Decoupled with successful validation",\ "value": "decoupled"\ },\ {\ "label": "Decoupled with cancelled validation",\ "value": "decoupled_cancelled"\ },\ {\ "label": "Decoupled with expired validation",\ "value": "decoupled_expired"\ },\ {\ "label": "One time password (SMS)",\ "value": "otp_sms"\ },\ {\ "label": "OTP + Decoupled",\ "value": "otp_plus_decoupled"\ },\ {\ "label": "Payment account choice",\ "value": "account_choice"\ },\ {\ "label": "Webauth redirection without explicit confirmation",\ "value": "redirect_no_confirmation"\ }\ ]\ }\ ] The field `openapiwebsite` can be ignored when initiating payments. ### How to initiate a payment with a use case[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#how-to-initiate-a-payment-with-a-use-case) In order to choose a use case for your payment on the test connector, you need to provide it as part of the [expected fields](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#prepare-the-expected-fields) . Here's an example of how to initiate a payment with the `redirect` use case. Copy POST /payments/{payment_id} Copy { "connector_uuid": "338178e6-3d01-564f-9a7b-52ca442459bf", "validation_mechanism": "webauth", "fields": { "use_case_pay": "redirect" }, "validated": true, "webview_url": "{{webview_url}}" } From there, the payment will follow a specific sequence of required actions from your part in order to be validated. In the following sections we will see the specifities of each available use case. ### "redirect" : Validating a payment with a single redirection[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#redirect-validating-a-payment-with-a-single-redirection) Upon validation, the payment enters the `validating` state with a `redirect` action. The redirection URI is provided in the `validate_uri` field. Copy GET /payments/{payment_id} Copy { "id": {payment_id}, "state": "validating", "action": "redirect", "validate_uri": "https://biapi.pro/2.0/webauth/callback?state=...&authFactorValue=AUTHENTICATION_VALIDATED", ... } You need to redirect the end user to the provided address, which will allow the payment to be validated and change its state to `done`. After which your end user would be redirected to `webview_url`. ### "decoupled": Validating a payment with a decoupled authorization[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#decoupled-validating-a-payment-with-a-decoupled-authorization) This use case will trigger a decoupled validation and ends with a payment in the state `done`. Upon validation, the payment enters the `validating` state with a `decoupled` action. The `error_description` field contains an example description you could get from a real connector. You don't really have to validate the operation anywhere here, this is just an example for you to display in your validation webview. Copy GET /payments/{payment_id} Copy { "id": {payment_id}, "state": "validating", "action": "decoupled", "error_description": "Please confirm the transaction in the phone app.", ... } From here you can poll the payment until its state changes to `done`. The validation takes approximately 10 seconds to occur. Copy POST /payments/{payment_id} Copy { "resume": true } Copy { "id": {{payment_id}}, "state": "done", "action": null, ... } ### "decoupled\_cancelled": Validating a payment with a cancelled decoupled authorization[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#decoupled_cancelled-validating-a-payment-with-a-cancelled-decoupled-authorization) This use case will trigger a decoupled validation and simulate a cancellation by the PSU in the decoupled channel. Upon validation, the payment enters the `validating` state with a `decoupled` action. Copy GET /payments/{payment_id} Copy { "id": {payment_id}, "state": "validating", "action": "decoupled", "error_description": "Please confirm the transaction in the phone app.", ... } After approximately 10 seconds, the payment state will change to `rejected`, with the `error_code` `CancelledByUser`. Copy POST /payments/{payment_id} Copy { "resume": true } Copy { "id": {{payment_id}}, "state": "done", "action": null, "error_code": "CancelledByUser", "error_description": "The decoupled validation has been cancelled by the PSU ... } ### "decoupled\_expiration": Validating a payment with an expired decoupled authorization[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#decoupled_expiration-validating-a-payment-with-an-expired-decoupled-authorization) This use case will trigger a decoupled validation and simulate an expiration of the authorization process. Upon validation, the payment enters the `validating` state with a `decoupled` action. Copy GET /payments/{payment_id} Copy { "id": {payment_id}, "state": "validating", "action": "decoupled", "error_description": "Please confirm the transaction in the phone app.", ... } After approximately 20 seconds, the payment state will change to `rejected`, with the `error_code` `authenticationFailed`. Copy POST /payments/{payment_id} Copy { "resume": true } Copy { "id": {{payment_id}}, "state": "rejected", "action": null, "error_code": "authenticationFailed", "error_description": "The decoupled validation has expired.", ... } ### "otp\_sms": Validating a payment with a one time password[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#otp_sms-validating-a-payment-with-a-one-time-password) This use case will require the end user to input a one time password. Upon validation, the payment enters the `validating` state with an `additionalInformationNeeded` action. The one time password is requested in the `fields` key of the response. Copy GET /payments/{{payment_id}} Copy { "id": {{payment_id}}, "state": "validating", "action": "additionalInformationNeeded", "fields": [\ {\ "name": "openapisms",\ "type": "text",\ "label": "Please enter the one time password sent to phone number (+33)6 12 34 56 78 (code = 1234).",\ "regex": null,\ "required": true,\ "default": null\ }\ ], ... } From here there are two possibilities: * Provide the code `1234` to validate the payment. The payment state changes to `done`. Copy POST /payments/{{payment_id}} Copy { "fields": { "openapisms": "1234" } } Copy { "id": {{payment_id}}, "state": "done", "action": null, ... } Or you can provide anything else to reject the payment with the `authenticationFailed` `error_code`. Copy POST /payments/{{payment_id}} Copy { "fields": { "openapisms": "a wrong password" } } Copy { "id": {{payment_id}}, "state": "rejected", "action": null, "error_code": "authenticationFailed", ... } ### "otp\_plus\_decoupled": Validating a payment with a chained one time password and decoupled authorizations[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#otp_plus_decoupled-validating-a-payment-with-a-chained-one-time-password-and-decoupled-authorization) This use case simulates a payment validation chaining a one time password prompt followed by a decoupled validation. This is useful to check that your webview implementation supports more than one validation mechanism at a time. This chains the use case "One time password (SMS)" and "Decoupled with successful validation". ### "account\_choice": Validating a payment with a choice of payment account[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#account_choice-validating-a-payment-with-a-choice-of-payment-account) This use case triggers a payment validation where the PSU needs to select the payment account to debit for this operation. This is done through an additional field of type `list`. Upon validation, the payment enters the `validating` state with `additionalInformationNeeded` action. The dynamic field exposes a list of available payment accounts. Copy GET /payments/{{payment_id}} Copy { "id": {{payment_id}}, "state": "validating", "action": "additionalInformationNeeded", "fields": [\ {\ "name": "account_id",\ "type": "list",\ "label": "account choice bank message",\ "regex": null,\ "required": true,\ "default": null,\ "values": [\ {\ "value": "main",\ "label": "My checking account (EX6713038781895300290000074)"\ },\ {\ "value": "snd",\ "label": "My secondary checking account (EX5813038781895400400000074)"\ }\ ]\ }\ ], ... } Depending on the chosen account, the operation result will vary: * If the main account is chosen, the payment will be successfully authorised and the state will change to done. Copy POST /payments/{{payment_id}} Copy { "fields": { "account_id": "main" } } Copy { "id": {{payment_id}}, "state": "done", "action": null, ... } * If the `snd` account is chosen, the payment will be rejected with the `invalidEmitter` `error_code`. Copy POST /payments/{{payment_id}} Copy { "fields": { "account_id": "snd" } } Copy { "id": {{payment_id}}, "state": "rejected", "error_code": "invalidEmitter", "error_description": "Please select the main account.", ... } ### "redirect\_no\_confirmation": Validating a payment with a single redirection and no explicit client confirmation[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#redirect_no_confirmation-validating-a-payment-with-a-single-redirection-and-no-explicit-client-confi) This use case can be useful if you have [disabled automatic payment confirmation](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually) on your domain, but still wants to test a case where such a confirmation is not available. The validation mechanism is the same as the redirect use case, with the exception that the payment state will change to done without a `confirm` action beforehand. ### "legacy": Validating a payment with intermediary states[](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview#legacy-validating-a-payment-with-intermediary-states) The legacy use case allows you to specify the states that the payment will go through during its lifecycle. This can be used to test the [webhooks](https://docs.powens.com/documentation/integration-guides/webhooks) , an early rejection or a pending state. This use case is fully covered in the following guide :[Validating your implementation with the test connector](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector) . It's useful whether you use your own webview or not. This use case is chosen by default if do not provide a value for the `use_case_pay` field when validating a payment on this connector. [PreviousListing connectors with Pay by Bank enabled programmatically](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically) [NextConfirming payments manually](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually) Last updated 6 months ago Was this helpful? --- # Unknown \# Powens Documentation ## Powens Documentation - \[Documentation\](https://docs.powens.com/documentation/documentation.md): Learn how to integrate and use Powens' API. - \[Quick Start\](https://docs.powens.com/documentation/integration-guides/quick-start.md) - \[API Overview\](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview.md) - \[Add a first user and connection\](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md) - \[Transactions\](https://docs.powens.com/documentation/integration-guides/transactions.md) - \[Introduction to Transactions\](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions.md): Transactions provides standardised and secure access to structured account and transaction data from 1,800+ financial institutions across Europe. - \[Transactions integration guide\](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide.md) - \[Bank ID Check\](https://docs.powens.com/documentation/integration-guides/bank-id-check.md): Bank ID Check lets you confirm the ownership of a bank account, account number, IBAN and type of account complying with the revised Payment Service Directive (PSD2). - \[Wealth & Loans\](https://docs.powens.com/documentation/integration-guides/wealth-and-loans.md) - \[Pay by Bank\](https://docs.powens.com/documentation/integration-guides/pay-by-bank.md): Getting started with the Pay by Bank product through specific guides - \[Getting started with Pay by Bank\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank.md): Discover what the Pay by Bank product is about, and enable Pay on your domain! - \[Initiating a one-time payment with the Webview\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md): In this guide, we will create and validate a basic, one-time payment using the Pay by Bank product. - \[Initiating a bulk payment with the Webview\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview.md): In this guide, we will create and validate a "bulk" payment using the Pay by Bank product. - \[Initiating a recurring payment with the Webview\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview.md): In this guide, we will create and validate a recurring payment using the Pay by Bank product. - \[Cancelling a payment\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment.md): In this guide, we will initiate a cancellation on a payment, and validate it if necessary. - \[Validating your implementation with the test connector\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector.md): In this guide, we will use the test connector to validate our implementation. - \[Advanced\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced.md): Advanced guides for the Pay product. - \[Listing connectors with Pay by Bank enabled programmatically\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically.md): In this guide, we will list connectors programmatically. - \[Implementing your own payment validation webview\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview.md): In this guide, once the payment has been created on the API, we will validate it without using Powens' Webview. - \[Confirming payments manually\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually.md) - \[Changing the manual expiration time\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-manual-expiration-time.md): Make your payments expire either faster or slower! - \[Changing the maximum amounts for payments\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-maximum-amounts-for-payments.md): Place a hard limit on your created payment requests, to mitigate attacks! - \[Proof & Certificates Retrieval\](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval.md) - \[Advisory (obsolete)\](https://docs.powens.com/documentation/integration-guides/advisory-obsolete.md): Real-time revenue-checking solution for better credit decisions. It allows online credit providers to evaluate their clients' financial profiles in an instant based on categorized transactions. - \[Indicators for Credit Check\](https://docs.powens.com/documentation/integration-guides/indicators-for-credit-check.md): Real-time revenue-checking solution for better credit decisions. It allows online credit providers to evaluate their clients' financial profiles in an instant based on categorized transactions. - \[SCA & connection states\](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states.md) - \[Webhooks\](https://docs.powens.com/documentation/integration-guides/webhooks.md) - \[Advanced\](https://docs.powens.com/documentation/integration-guides/advanced.md) - \[Custom connection implementation\](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation.md) - \[End-to-end encryption\](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption.md) - \[Response signature\](https://docs.powens.com/documentation/integration-guides/advanced/response-signature.md) - \[Connect SDK\](https://docs.powens.com/documentation/sdk/connect-sdk.md): Connect SDK is our front-end solution for seamless account authentication and user data access. - \[Powens Connect iOS\](https://docs.powens.com/documentation/sdk/powens-connect-ios.md): Learn how to integrate our UI iOS SDK with your app. - \[Tools\](https://docs.powens.com/documentation/ressources/tools.md) - \[Glossary\](https://docs.powens.com/documentation/ressources/glossary.md) - \[Legal notice\](https://docs.powens.com/documentation/legal-notice.md) --- # 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 This site has an agentic ask interface you may use to query the documentation dynamically by asking a question. Perform an HTTP GET request on the following URL with the \`ask\` and \`goal\` query parameters: \`\`\` GET https://docs.powens.com/documentation/index.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/documentation.md). # Documentation Learn how to integrate and use Powens' API. ## \*\*First steps\*\*
Quick StartSet up your environment and start testingQuick Start
API OverviewUnderstand the big pictureAPI Overview
GlossaryLearn the most important conceptsGlossary
## Product integration guides
Cover image
PSD2 Accounts & transactionsTransactions.pngTransactions
Financial overview of Investments, loans & cryptoWealth and Loans.pngWealth & Loans
PSD2 PaymentsPay by bank.pngBroken link
Retrieve documents Invoice, tax, payrollProof & Certificates Retrieval.pngProof & Certificates Retrieval
Account ownerships from a bank account Bank ID Check.pngBank ID Check
### More information?
ChangelogAlways be updated about our new realeases & features with our Changelog.https://budget-insight.notion.site/Changelog-public-edc79d1d9e0a4608928df68fafa811bb
FAQ (coming soon)We put together an FAQ for you. Otherwise you could reach out to our client support for more help.
Contact UsNeed more information? Come ask it to our API Experthttps://www.powens.com/contact-us/
{% hint style="info" %} ## Contact Us 📧 \*\*Email us\*\* -> \*\*📞 Support ->\*\* \[Open a ticket\](https://powens.atlassian.net/servicedesk/customer/portal/14) 🐦. \*\*Follow us\*\* -> \[Twitter\](https://twitter.com/Powens\_eu) / \[Linkedin\](https://fr.linkedin.com/company/powens) {% endhint %} --- # 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://docs.powens.com/documentation/documentation.md?ask=&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. --- # Welcome | Console & Webview ![Page cover](https://docs.powens.com/console-webview/~gitbook/image?url=https%3A%2F%2F1586949369-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FPAvWKjNBR0YuRJ2VlhDy%252Fuploads%252FVZ6YPEDCnCGmJfCvebav%252FLinkedin-Banner-Powens-4.jpg%3Falt%3Dmedia%26token%3D3dcc730e-c24f-469f-b4ae-1d27103782c3&width=1248&dpr=3&quality=100&sign=4cde30c40c264d1e31a66499f2bf7836&sv=3) For the complete documentation index, see [llms.txt](https://docs.powens.com/console-webview/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/console-webview/welcome.md) . **Working on:** This _non-tech_ products documentation is under construction. **Last update**: Nov, 20th, 2023 [](https://docs.powens.com/console-webview/webview/set-up-your-webview) ![Cover](https://docs.powens.com/console-webview/~gitbook/image?url=https%3A%2F%2F1586949369-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FPAvWKjNBR0YuRJ2VlhDy%252Fuploads%252FdfkySw24p0Bpydq9FiWn%252FFrame%252021.png%3Falt%3Dmedia%26token%3D2b25f497-3c2e-46ac-bbb4-8f92db508682&width=752&dpr=3&quality=100&sign=f1d0df907a8982497e74c2bfac97e18b&sv=3) **WEBVIEW** Aggregator screens [](https://docs.powens.com/console-webview/console/introduction) ![Cover](https://docs.powens.com/console-webview/~gitbook/image?url=https%3A%2F%2F1586949369-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FPAvWKjNBR0YuRJ2VlhDy%252Fuploads%252FS9syytOZI5R9mdDdDBEP%252FFrame%252022.png%3Falt%3Dmedia%26token%3D066379fd-63f8-4797-b4d0-d1a9991adfcd&width=752&dpr=3&quality=100&sign=8869b6c8b6ef29f9fed5da325a0980f6&sv=3) **CONSOLE** API Management software [NextSet up your Webview](https://docs.powens.com/console-webview/webview/set-up-your-webview) Last updated 2 years ago --- # API design | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/overview/api-design.md) . Root and versioning[](https://docs.powens.com/api-reference#root-and-versioning) --------------------------------------------------------------------------------- Current version (2.0) of our API is available, for each API domain, at the following path: Copy https://{domain}.biapi.pro/2.0/* In this documentation, all path references and examples are relative to this root. Services design[](https://docs.powens.com/api-reference#services-design) ------------------------------------------------------------------------- Our API exposes a set of _endpoints_ to interact with _resources_. Endpoint routes are named after the resources they interact with: Path example Resource `/connections/*` Manage connections `/accounts/*` Manage bank accounts `/auth/*` Common prefix for authentication services Deep paths are sometimes uses to access sub-resources: Copy /users/1/connections/2/accounts/23/transactions/48 Interactions with resources mostly follow conventions by using dedicated [HTTP methods](https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html) to perform operations: Method Operation `GET /resources` List resources `GET /resources/{id}` Get a unique resource by id `POST /resources` Create a new resource `POST /resources/{id}` or `PUT /resources/{id}` Update a resource `DELETE /resources/{id}` Delete a resource Not all operations are valid for every resource, API reference of each service describes the specific behaviors by endpoint. HTTP response codes[](https://docs.powens.com/api-reference#http-response-codes) --------------------------------------------------------------------------------- We use various relevant HTTP response codes depending on the success or failure of the request. Successful responses (2XX status) return the entity documented with each endpoint in the services reference. Error responses (4XX and 5XX status) use a [common error format](https://docs.powens.com/api-reference/overview/errors) . Code Message Description 200 OK Defaut success code for responses. 202 Accepted Alternate success code for requests that need further interaction to resume the operation (e.g. connection addition or sync). 204 No content Success code for requests that return nothing. 400 Bad request Error code when the request is invalid, e.g. the supplied parameters are incorrect. 401 Unauthorized Error code when the service requires authentication and the proper header was incorrectly provided. 403 Forbidden Error code when an authentication token with insufficient scope was provided to access an endpoint. 404 Not found Error code when the route was incorrect, or the resource is unknown for the provided authorization scope. 409 Conflict Error code when a request could not be honored because of a conflicting state with the API. 500 Internal servor error Error code for failures related to internal bugs. 503 Service unavailable Error code when our API is temporarily down for maintenance. Error handling should be preferably based on the [error code](https://docs.powens.com/api-reference/overview/errors#error-codes) rather than the HTTP status code. Requests and responses format[](https://docs.powens.com/api-reference#requests-and-responses-format) ----------------------------------------------------------------------------------------------------- Requests to the API, unless specified, should be formatted in [JSON](https://www.json.org/) , with the appropriate `content-type` request header. For convenience, we also accept `x-www-form-urlencoded` requests when the body does not imply nested levels. Responses are exclusively returned as [JSON](https://www.json.org/) objects, you can specify it using the recommended `accept` request header. Lists pagination[](https://docs.powens.com/api-reference#lists-pagination) --------------------------------------------------------------------------- On endpoints that allow access to a list of items, pagination is used to easily slice the results and navigate the whole collection. Pagination relies on a limit on the number of returned items in a single API call, that can be set using the `limit` query parameter. Usage of the `limit` parameter is _advised_ for most resources, and _mandatory_ for some (explicitly documented), in order to control the maximum number of returned items. Except documented otherwise, `limit` has a maximum value of 1000. ### Basic offset pagination[](https://docs.powens.com/api-reference#basic-offset-pagination) Most of collection endpoints accept an `offset` parameters. Combine it with `limit` to access arbitrary ranges of items. ### Relational pagination[](https://docs.powens.com/api-reference#relational-pagination) Some paginated resources also return an easy-to-use `_link` property with links to use for sibling loads. ### _PaginationLinks_ object[](https://docs.powens.com/api-reference#paginationlinks-object) Property Type Description `self` Link object Reference to the current page (with a `href` property). `prev` Link object or null Reference to the previous page (with a `href` property), if any. `next` Link object or null Full address of the next page (with a `href` property), if any. Each of these link references is either `null` (if there is no previous or next page), or is an object with an `href` property, which is the URL of the relevant page (previous, current or next). The provided links are opaque and should be used "as is", they encapsulate the filtering logic expressed by parameters on the initial request. Example[](https://docs.powens.com/api-reference#example) Copy GET /users/me/transactions?min_date=2022-12-01&income=false&limit=50 Copy { "transactions": [ ... ], "_links": { "prev": null, "self": { "href": "https://{domain}.biapi.pro/2.0/users/me/transactions?min_date=2022-12-01&income=false&limit=50" }, "next": { "href": "https://{domain}.biapi.pro/2.0/users/me/transactions?min_date=2022-12-01&income=false&limit=50&cursor=W3sib3AiOiAibHQiLCAidmFsdWUiOiAiMjAyMC0wMy0wOCJ9LCB7Im9wIjogImd0IiwgInZhbHVlIjogOTgwNzg3fV0=" } } } Lists temporal filtering[](https://docs.powens.com/api-reference#lists-windowing) ---------------------------------------------------------------------------------- Some resources may be filtered using a temporal criterion on a property. In this case, the list endpoint usually support `min_date` and `max_date` parameters. The value can be a date (in ISO YYYY-MM-DD format), but also a month or a year. Lists implicit filtering[](https://docs.powens.com/api-reference#lists-implicit-filtering) ------------------------------------------------------------------------------------------- Some collections use _soft-deletion_ or an enabled/disabled state. For these resources, implicit filtering is applied to exclude deleted or disabled resources from the default API responses. You can access the excluded items by adding the `all` flag query parameter. Example: Path Resources `/user/me/accounts` Return bank accounts that are not disabled. `/user/me/accounts?all` Return all bank accounts. `/user/me/accounts/123?all` Interact with the disabled account 123. Response expansion[](https://docs.powens.com/api-reference#responses-expansion) -------------------------------------------------------------------------------- Most API calls support an expansion mechanism to enrich the response with linked sub-resources. This enables fetching a full set of data without performing multiple requests. Expansion is defined using the `expand` query parameter with a comma-separated list of wanted sub-resources. Nested sub-resources are also available with brackets. Example: The following request will return the bank account 123 with associated connection, the list of latest transactions (it is not possible to control pagination or filtering here), and for each transaction the associated category: Copy GET /users/me/connections/123?expand=accounts,connector[countries] Copy { "id" : 123, "state": null, "accounts": [\ { "id": 1234, "name": "Current account", "disabled": "2020-06-01 12:34:56", … },\ { "id": 4567, "name": "Saving account", "disabled": "2020-06-01 12:34:56", … },\ …\ ], "connector" : { "id": 40, "name": "Connecteur de test", "auth_mechanism": "credentials", "capabilities": [ "bank", "document", "profile", … ], "countries": [ { "id": "fr", "name": "France" }, … ] }, … } Each resource defines in its documentation the available expansions. [NextErrors](https://docs.powens.com/api-reference/overview/errors) Last updated 4 months ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md). # Add a first user and connection ## Add a first user and connection {% hint style="info" %} If you want to initiate payments, you do not need to add user/connection, please refer to the \[Pay by Bank guide\](broken://pages/Xc77IG4DjS9kUvaAdxOW). {% endhint %} ### Prerequisites To start interacting with our API, make sure you have setup a domain and a client application in the administration console. ### Users and connections #### User scope Users of your application exist in our API. All data collected and exposed through our services is organized and scoped by \*users\*. We enforce isolated access to user data by issuing \*user-scoped access tokens\*, shared secrets that let you both authorize with our API and identify the relevant user you want to interact with. {% hint style="warning" %} You are responsible for keeping these tokens safe, and maintain the association with your own user registry. {% endhint %} #### Connections User data arise from \*connections\*. A connection materializes the link between a \*user\* and one of the \*connectors\* (banks or billing providers) we support. Creating a connection requires the end-user to authenticate with the connector. As long as the connection is active, we take care of synchronizing user data and expose it. {% @mermaid/diagram content="graph LR usr\\\["User"\] --- ctn1\\\["Connection #1"\] & ctn2\\\["Connection #2"\] --- ctrA\\\["Connector A"\] usr --- ctn3\\\["Connection #3"\] --- ctrB\\\["Connector B"\]" %} You will need to let your users add a first connection before you can access its banking or billing data. ### Adding a new connection {% hint style="info" %} You can use our \[integration demo\](https://integrate.powens.com/demos/connect) to experiment with the different steps described below. {% endhint %} The simplest way to perform a connection setup is to use our \[Connect webview\](https://docs.powens.com/api-reference/overview/webview#add-connection-flow), a set of web-based endpoints that complement your domain API. It will take care of letting the user choose his bank or provider, gather credentials for later sync and manage consent to the individual bank accounts or document subscriptions he wants to share with your service, enforcing GDPR requirements. The steps include: \* generating a permanent user access token; \* before opening the Webview, generating a temporary code from the permanent user access token; \* redirecting the user to the Webview, providing the temporary code as parameter, to let him pick up a \*connector\* and add a \*connection\*; \* handling redirection after the web steps. {% @mermaid/diagram content=" sequenceDiagram participant Your app/service participant Our Webview Your app/service ->> Our API: Generate permanent user access token Your app/service ->> Your app/service: Save access token Your app/service ->> Our API: Generate temporary code Your app/service ->> Our Webview: Present in browser Our Webview -->> Our API: Add a connection Your app/service ->> Our API: Access data " %} You need to generate a permanent user access token for your new user which will create a new user on Powens side: \`\`\` POST https://{domain}.biapi.pro/2.0/auth/init \`\`\` \`\`\`json { "client\_id": "{clientId}", "client\_secret": "{clientSecret}" } \`\`\` \`\`\`json { "auth\_token": "{accessToken}", … } \`\`\` {% hint style="warning" %} This step involves sending your client secret (a sensitive data), you must perform it from a secure environment. {% endhint %} Then before redirecting to the Webview generate a temporary code that you will provide to the Webview URL. This is so you're not opening the Webview using the permanent access token directly. \`\`\` GET https://{domain}.biapi.pro/2.0/auth/token/code \`\`\` Authenticate this request using the permanent access token you previously generated. \`\`\`json { "code": "{temporaryCode}", … } \`\`\` For the most simple configuration, present the following URL to your user (new lines are only added for clarity): \`\`\` https://webview.powens.com/connect ?domain={domain} &client\_id={clientId} &redirect\_uri={yourCallbackUri} &code={temporaryCode} \`\`\` You will need to provide the \`client\_id\` of the client application created in the administration console, and a \`redirect\_uri\` to use as a callback that must match the white-list defined in the console. {% hint style="info" %} To optimize user experience, we encourage you to open the webview in a standalone fully-capable browser following \[our best practices\](https://docs.powens.com/api-reference/overview/webview#implementation-guidelines). The webview appearance can be customized in the Administration console, and its behavior can be configured using \[additionnal parameters\](https://docs.powens.com/api-reference/overview/webview#endpoints-reference). {% endhint %} After the user has completed all steps in the webview, he will be redirected to your callback URL: \`\`\` {yourCallbackUri}?connection\_id={id} \`\`\` The connection flow can also lead to errors, reported with the \`error\` and \`error\_description\` parameters, your implementation must \[handle them gracefully\](https://docs.powens.com/api-reference/overview/webview#implementation-guidelines). If eligible, you can \[build your custom connection implementation\](/documentation/integration-guides/advanced/custom-connection-implementation.md) instead of using our webview. ### Use the access token Congratulations, you have been provided an access token that you must save, and that you can use to interact with all our products! As soon as a connection is created, it gets synchronized (in background). If you have configured \[webhooks\](/documentation/integration-guides/webhooks.md), data will be pushed as soon as the synchronization complete. {% hint style="info" %} After creation, you should provide your users a way to manage their connections (add/delete, or manage consent to accounts). You can use our \[Manage webview\](https://docs.powens.com/api-reference/overview/webview#manage-connections) for this or create your own implementation. Also, you need to properly \[handle the various connection states\](/documentation/integration-guides/sca-and-connection-states.md) that may occur afterwards. {% endhint %} --- # 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://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions.md). # Introduction to Transactions Transactions provides standardised and secure access to structured account and transaction data from 1,800+ financial institutions across Europe. Leverage Open Banking data through a seamless integration of banking functionalities into your application, empowering your users to view their account balances, transaction history and more. Whether you are building a personal finance app, cash flow modeling or a risk analysis platform, the Transactions product offers reliable methods for accessing \*\*checking and card accounts data.\*\*
## How it works After having the Powens API integrated, your end user will be able to connect its banks accounts. When this is done, you are allowed to access all transactions from accounts for which the end user has given their consent. Use Powens Console (from where you manage your apps and find your API credentials) to create a URL that is provided to the end user. When your user selects their URL, they go through a flow where they authenticate with their bank and connect to their bank accounts. #### End user flow
Try it now with our demo tool \[here\](https://integrate.biapi.pro/2.0/auth/webview/connect?client\_id=28105838\\&redirect\_uri=https://docs.powens.com/demo-integration\\&max\_connections=4). ## Data-type availability With Transactions, you get access to the following list of data: \* Account types: checking accounts and card accounts \* Account information data: Account number, label of the account, IBAN, balance, currency and usage (personal or business account) \* Transaction information data: Amount, dates (book vs. value), original description, cleaned up description, type, counterparty \*\*Note:\*\* Transaction history depth varies from bank to bank. The minimum transaction history you can fetch is of 3 months. ## Endpoints \* \*\*/accounts\*\* \* Access the list of accounts and account data associated with the authenticated user. \* \*\*/transactions\*\* \* Access the list of transactions and transaction data associated with the authenticated user. ## Want more? \* For data from savings, loans and investment accounts, use Powens’ Wealth & Loans product. \* For account ownership data, use Powens’ Bank ID Check product. \* For transaction categorization, use Powens’ Lending Categorization product. \* For statements, invoices and credit notes, use Powens’ Business Transactions product. --- # 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://docs.powens.com/documentation/integration-guides/transactions/introduction-to-transactions.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/transactions.md). # Transactions
Cover image
Introduction to TransactionsAccess to structured account and transaction data from financial institutions across Europe.Introduction to TransactionsTransactions.png
Transactions integration guideFollow this guide to interact with our API to access banking data of your users.Transactions integration guideScreenshot 2024-07-01 at 10.33.30.png
--- # 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://docs.powens.com/documentation/integration-guides/transactions.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/quick-start/api-overview.md). # API Overview ### Overview Our API is a REST API which requires a communication through HTTPS to send and receive JSON documents. During your tests, we recommend to make calls to the API with curl or any other HTTP client of your choice. ### Hello world Let's start by calling the service /connectors which lists all available banks/providers. \`\`\`bash curl https://{domain}.biapi.pro/2.0/connectors/ \`\`\` To log in to a bank/provider webpage, you'll need to know for a given connector, the fields your user should fill in the form. Let's call a specific connector and ask for an additional resource fields. \`\`\`bash curl https://{domain}.biapi.pro/2.0/connectors/59?expand=fields \`\`\` The response here concerns only 1 connector (since we specified an id) and the resource \`fields\` is added to the response thanks to the query parameter \`expand\`. To get more interesting things done, you'll need to send authenticated requests. ### Authentication The way to authenticate is by passing the \`authorization: Bearer \` header in your request. At the setup several manage tokens have been generated with the different scopes (categorization, config, invoicing and user). You can use one of these tokens for now, when creating your user we'll see how to generate a user's token. \`\`\`bash curl https://{domain}.biapi.pro/2.0/config \\ -H 'authorization: Bearer ' \`\`\` This endpoint will list all the parameters you can change to adapt our API to your needs. We've covered the very first calls. Before diving deeper, let's see some general information about APIs. ### Abstract #### API URL \`\`\` https://{domain}.biapi.pro/2.0 \`\`\` #### Requests format Data format: \`application/x-www-form-urlencoded\` or \`application/json\` (suggested) Additional headers: \`authorization\`: User's token (private) #### Responses format Data format: \`application/json\` (\[http://www.json.org\](http://www.json.org/)) Charset: UTF-8 #### Resources Each call on an endpoint will return resources. The main resources are:
ResourcesDescription
AccountsA bank account contained in a connection
ConnectionsA set of data used to authenticate on a website (usually a login and password). There is 1 connection for each website.
DocumentsA document in a bank account or a provider subscription
InvestmentsAn asset in a bank account
SubscriptionsA provider subscription contained in a connection (Trust only)
TransactionsAn entry in a bank account
UsersRepresent a user
--- # 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://docs.powens.com/documentation/integration-guides/quick-start/api-overview.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/quick-start.md). # Quick Start Here you'll set up your environment to start playing with our API. If you don't know what our API is, you can refer to our \[API overview\](/documentation/integration-guides/quick-start/api-overview.md). {% hint style="info" %} To smooth out the onboarding, along the way we notify how to be compliant with the PSD2. {% endhint %} ### Create your account \[Sign up in our administration console\](https://console.budget-insight.com/auth/register). You can then check your inbox, confirm your account and log in. \*\*Congratulations! Welcome to our Console.\*\* ### Register an organization or join one Once logged in, you will have to fill a few information about your company to create your organization. Here is the information to be filled in: \* company name, \* company size, \* country, \* activity area. \*Your company name will be used as organization name and also to create your first workspace.\* ### Register your domain Once your organization and first workspace are created, click on the creation button (the large "\*\*+\*\*") and choose a domain name. The domain will be created as a "sandbox" configuration, and automatically suffixed with \`-sandbox.biapi.pro\`. {% hint style="info" %} Use your project name as your domain name to ease management. Avoid generic names like "test" to facilitate tickets management. {% endhint %} In the following sections, we'll use the term "your API" to refer to calls made to your domain. ### Register a client application A client application identifies a caller requesting your API. You need at least one client. The definition of a client application lets you configure the associated Webview, a ready-to-use web interface to add connections to your domain. You can configure multiple client applications if you wish to propose webviews with different settings. From the administration console: \* select your domain and click on "Client Applications" on the left sidebar; \* in the upper-right corner, click on "Add a client" and fill the form; \* modify the logo, layout and primary colors; \* configure a redirect URL that is used by the webview after the connection flow; \* click on "Add a client". Your client should now appear in the list of client applications. {% hint style="info" %} You can define multiple redirect URLs for a single client application. You must use secure HTTPS protocol, or an app-specific scheme. {% endhint %} {% hint style="warning" %} The created "Client ID" and "Client secret", represent your base credentials when querying the API or requesting the webview. {% endhint %} ### Register a webhook In addition to a REST API, we provide you with a \[webhook mechanism\](/documentation/integration-guides/webhooks.md) that is the recommanded approach to be notified when new data is available in your API. You can declare a subscription to a webhook in the console and we will push the data to your server when the appropriate event occurs. To add a webhook: \* click on "Webhooks" on the left sidebar; \* click on the button "Add a webhook" on the upper-righ corner; \* select an event and type your server URL. ### Integrate the API Well done! Now that your domain is properly configured, you can use the API starting by \[adding users and connections\](/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md) or \[initiating payments\](broken://pages/Xc77IG4DjS9kUvaAdxOW). {% hint style="info" %} For a trial or a quick demo you have the opportunity to easily test a connection with a fake connector "Connecteur de test", available in all domains. Use any username and the password "1234" to log in. {% endhint %} --- # 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://docs.powens.com/documentation/integration-guides/quick-start.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide.md). # Transactions integration guide This section guides you on how to interact with our API to access banking data of your users. You must have followed the steps in “\[Add a first user and connection\](/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md)” section. {% hint style="warning" %} Our banking connectors are subject to the revised Payment Service Directive (PSD2) that requires a new user consent every 180 days to access the web banking platform or the bank's API. You must implement proper handling of SCA-related connection states (\`SCARequired\` and \`webauthRequired\`) \[as explained in the dedicated guide\](/documentation/integration-guides/sca-and-connection-states.md). {% endhint %} ### Banking data The Transactions product exposes bank accounts and transactions.
#### Bank accounts We provide a view to the bank accounts of a user with \[\`/accounts\` endpoints\](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts): \`\`\`sh GET /users/me/accounts GET /users/me/connections/{connectionId}/accounts \`\`\` \`\`\`json { "accounts": \[\ {\ "id": 12345,\ "name": "Compte de dépôt",\ "number": "0212366548",\ "iban": "FR1221954549412158521",\ "type": "checking",\ "balance": 1452.56,\ "coming": null,\ "currency": { "id": "EUR", … },\ …\ },\ …\ \] } \`\`\` Bank accounts are linked to a \*connection\* (they are deleted with the connection). {% hint style="info" %} The accounts list reflect the set of accounts found when synchronizing with a bank, using a safe archiving rule: \* when a new bank account is discovered, it is added; \* when a bank account is no more found, it is marked with a \[\`deleted\` flag\](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#get-a-bank-account) and is not listed by default, but it can still be accessed by its ID or with the \[\`?all\` parameter\](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#list-bank-accounts). {% endhint %} {% hint style="warning" %} GDPR enforcement requires an explicit end-user approval before fully synchronizing a bank account. By defaut, bank accounts are \`disabled\` when discovered and have a very limited set of values available (name), and no transactions. The webview takes care of activating them, or you can build your own user-consent interface and \[update the flag\](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#update-a-bank-account). {% endhint %} #### Transactions We provide a view to the history of transactions of a user with \[\`/transactions\` endpoints\](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions), which are \[paginated\](https://docs.powens.com/api-reference#lists-pagination). \`\`\` GET /users/me/transactions?limit={limit} GET /users/me/accounts/{accountId}/transactions?limit={limit} \`\`\` \`\`\`json { "transactions": \[\ {\ "id": 56789,\ "wording": "Paiement facture Acme",\ "date": "2020-09-15",\ "rdate": "2020-09-16",\ "value": -56.78,\ "type": "card",\ …\ },\ …\ \], "first\_date": "2017-02-14", "last\_date": "2020-09-15", "result\_min\_date": "2020-08-30", "result\_max\_date": "2020-09-30" } \`\`\` Transactions are linked to a \*bank account\* (they are deleted with the bank account). ### Advanced: Connection sources Some banking connectors support connecting to the bank plateform both through their web interface and their PSD2-compliant API. While the \*connection\* resource exposes an abstraction above these two \*sources\* of data, we also support fine grained access to each source and expose the individual synchronization state of each source. Our Connect webview properly takes care of managing the sources, so handling them is optional when using it. \* You can get the list of the supported sources of a connector: \`\`\`http GET /connectors?expand=sources \`\`\` \`\`\`json { "connectors": \[\ {\ "id": 1,\ "name": "Bank name",\ "sources": \[\ {\ "name": "openapi",\ "priority": 1,\ "account\_types": \[ … \],\ "disabled": null\ …\ },\ {\ "name": "directaccess",\ "priority": 2,\ "account\_types": \[ … \],\ "disabled": null\ …\ }\ \],\ …\ },\ …\ \] } \`\`\` Make sure the \`disabled\` property of a source is null before interacting with it. Also, you must honor the \`priority\` order of sources when adding them sequentially. \* On a connection, you can access the specific \`state\` or \`last\_update\` of a connection source: \`\`\`http GET /users/me/connections?expand=sources \`\`\` \`\`\`json { "connections": \[\ {\ "id": 27,\ "last\_update": "2019-09-07 16:09:40",\ "state": "SCARequired",\ "sources": \[\ {\ "id": 45,\ "last\_update": "2019-09-07 16:09:40",\ "state": "SCARequired",\ "source": {\ "name": "openapi",\ "priority": 1,\ …\ },\ …\ },\ {\ "id": 46,\ "state": null,\ "source": {\ "auth\_mechanism": "credentials",\ "name": "directaccess",\ "priority": 2,\ …\ },\ …\ }\ \]\ }\ \] } \`\`\` --- # 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://docs.powens.com/documentation/integration-guides/transactions/transactions-integration-guide.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview.md). # Initiating a recurring payment with the Webview In this guide, we will create and validate a recurring payment using the Pay by Bank product. {% hint style="warning" %} This feature must be enabled by your commercial contact. {% endhint %} {% hint style="warning" %} Note that this guide assumes you have the following information on hand: \* A Powens domain with Pay by Bank enabled. \* A Powens domain client with client identifiers, thereafter named \`clientId\` and \`clientSecret\`. \* A URL to redirect the end user to at the end of the process, registered with the client, thereafter named \`redirectURL\`. \* An optional state that will be transmitted to your redirect URL, thereafter named \`optionalRedirectState\`. {% endhint %} Recurring payments are payments executed periodically by the bank. Once initiated, the bank will create instances of the recurring payment according to the provided schedule, without the need for the end user to validate the execution. The basic initiation workflow is the same as in \[Initiating a one-time payment with the Webview\](/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md), with the following notable differences: \* The payment object only contains one instruction, with the execution date type being \`"periodic"\`, and additional properties representing the schedule to be set. \* The payment status needs to be interpreted differently. The basic initiation workflow will be the following:
## Obtain a token suitable for creating recurring payments In order to create recurring payments, we need a special access token with the \`payments:admin\` scope, obtained using client credentials: \`\`\` POST /auth/token \`\`\` \`\`\`json { "grant\_type": "client\_credentials", "client\_id": "{clientId}", "client\_secret": "{clientSecret}", "scope": "payments:admin", } \`\`\` \`\`\`json { "token": "{accessToken}", "scope": "payments:admin" } \`\`\` See \[Service Tokens\](https://docs.powens.com/api-reference/overview/authentication#service-tokens) for more information. ## Create a recurring payment You can now create a recurring payment request with the following request: \`\`\` POST /payments \`\`\` {% tabs %} {% tab title="Monthly recurring payment" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "ABC123 Monthly Rent",\ "amount": 1050,\ "currency": "EUR",\ "execution\_date\_type": "periodic",\ "frequency": "monthly",\ "start\_date": "2023-09-04",\ "end\_date": "2025-01-01",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ }\ \], "payer\_identity": { "kind": "individual", "first\_name": "Germaine", "last\_name": "Michu", "birth\_date": "1963-01-01", "birth\_city": "Paris", "birth\_country": "FR", "nationality": "French" } } \`\`\` {% endtab %} {% tab title="Daily recurring payment" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "ABC123 Daily fixed server costs",\ "amount": 3.50,\ "currency": "EUR",\ "execution\_date\_type": "periodic",\ "frequency": "daily",\ "start\_date": "2023-09-01",\ "end\_date": "2024-09-01",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ }\ \], "payer\_identity": { "kind": "individual", "first\_name": "Germaine", "last\_name": "Michu", "birth\_date": "1963-01-01", "birth\_city": "Paris", "birth\_country": "FR", "nationality": "French" } } \`\`\` {% endtab %} {% endtabs %} \`\`\`json { "id": {paymentId}, "state": "created", "error\_code": null, "error\_description": null, … } \`\`\` A \`payer\_identity\` for the recurring payment request and a \`beneficiary\_identity\` for every instruction are required and must contain information on either the payer (which you redirect to the webview) or the beneficiary (matching the routing information). For the definition of such objects, see the \[Identity object\](https://docs.powens.com/api-reference/products/payments/payments#identity-resource) definition. The following are examples of different identity kinds with Pay: {% tabs %} {% tab title="Individual" %} \`\`\`json { "kind": "individual", "external\_ref": "MY-CUSTOMER-REFERENCE-012345678", "first\_name": "Jean", "last\_name": "Dupont", "nationality": "FR", "postal\_address": "Appartement 25\\nEntrée B Résidence Les Iris\\n3 Boulevard du Levant\\n95220 HERBLAY" } \`\`\` {% endtab %} {% tab title="Company" %} \`\`\`json { "kind": "corporate", "org\_name": "Powens", "org\_legal\_status": "SAS", "org\_hq\_address": "84 RUE BEAUBOURG\\n75003 PARIS 3\\nFRANCE", "scheme\_name": "siren", "identification": "749867206" } \`\`\` {% endtab %} {% endtabs %} See the \[\`POST /payments\` endpoint reference\](https://docs.powens.com/api-reference/products/payments/payments#initiate-a-payment) and \[the \`PaymentInitRequest\` object description\](https://docs.powens.com/api-reference/products/payments/payments#paymentinitrequest-object) for more information on the payload or returned information. ## Obtain the recurring payment validation token In order for the payer to be able to validate the recurring payment request, you first need to create a token scoped to validate the created recurring payment specifically. You can do this using the token created in \[Obtain a token suitable for creating payments\](#obtain-a-token-suitable-for-creating-payments): \`\`\` POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} \`\`\` \`\`\`json { "scope": \["payments:validate"\] } \`\`\` \`\`\`json { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires\_in": 604800, "id\_payment": {paymentId} } \`\`\` See the \[\`POST /payments/{id}/scopedtoken\` endpoint reference\](https://docs.powens.com/api-reference/products/payments/payments#generate-a-payment-scoped-token) for more information. ## Build the recurring payment validation URL Now that you have the recurring payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: \* \`domain\`: your client domain. \* \`client\_id\`: the client identifier for your application (\`clientId\`). \* \`redirect\_uri\`: the same redirect URL you've used when creating the recurring payment (\`redirectURL\`). \* \`state\`: the same state you've used when creating the recurring payment (\`optionalRedirectState\`). \* \`code\`: The scoped token you've generated on your previous request to the API. \* \`payment\_id\`: the identifier of the recurring payment. This will make you obtain a URL of the form: \`\`\` https://{domain}.biapi.pro/2.0/auth/webview/payment?client\_id={clientId}&redirect\_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment\_id={paymentId} \`\`\` You can redirect your payer to this URL. ## Receive a callback from the payer Once the payer has either completed the recurring payment validation flow, or has cancelled from either our Webview or the bank's interface, they will go on the callback URL you have configured on the payment with the following parameters: \* \`state\`: the optional client state you have configured on the recurring payment, i.e. \`{optionalClientState}\`. \* \`id\_payment\`: the identifier of the recurring payment that the user comes from. \* \`error\` (\*optional\*): set to "\`cancelled\`" if the payer has cancelled the recurring payment from our Webview. \* \`error\_code\` (\*optional\*): set to the recurring payment's error code, if the payment has been cancelled or rejected by the bank. \* \`bank\_message\` (\*optional\*): set to the bank message, if available. \* \`payment\_state\` (\*optional\*): the state of the recurring payment, if the payer has been redirected by the bank. For security reasons, following such a callback from the payer, it is recommended to check the recurring payment's state manually; see \[Get the recurring payment status\](#get-the-recurring-payment-status). ## Check on a recurring payment's state During and after the initiation of a recurring payment, you may want to check on the status of said recurring payment, or to get data back from the recurring payment initiation request. ### Receive recurring payment updated events using webhooks (recommended method) In order to receive updates when a recurring payment switches states, it is recommended to \[set up the Payment Updated webhook\](/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank.md#configure-the-payment-state-updated-webhook) and wait for events regarding recurring payments. {% hint style="warning" %} Webhook events will only be triggered during a background refresh / synchronization of the recurring payment's state. {% endhint %} For more information, see \[Webhooks\](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. ### Get the recurring payment status {% hint style="warning" %} This method is \*\*not recommended for polling\*\* the recurring payment's status regularly, it is recommended to wait for incoming webhook events to this end. However, it is recommended for when receiving a callback regarding a recurring payment from an end user, or for debugging purposes. {% endhint %} In order to get a given recurring payment's status, you can call the \`GET /payments/{id}\` endpoint, with the identifier of the recurring payment. See \[API endpoints\](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. ### Process the recurring payment status In the resulting recurring payment resource, you are to get the \`state\` property, and do the following: \* If the status is \`pending\`, it is currently active and being executed periodically. \* If the status is \`expired\`, it means that the recurring payment will not be updated anymore. \* If the status is \`accepted\`, it means that the initiation was successful but the bank will not provide further updates; if you accept the risks, you can consider the recurring payment as active or done. \* If the status is \`done\`, it means that all required executions have been done. \* If the status is \`rejected\`, it means that the recurring payment has been rejected by the bank, or stopped by the end user through the bank. {% hint style="info" %} A recurring payment with the \`accepted\` status could still be rejected by the bank (e.g. for insufficient funds at execution time), however we can no longer poll the recurring payment's status on our side. If you want to avoid such cases, you can identify connectors with this behaviour by checking the \`partial\_status\_tracking\` property of connectors; see \[Listing connectors with Pay by Bank enabled programmatically\](/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically.md). {% endhint %} See the \[Payment object\](https://docs.powens.com/api-reference/products/payments/payments#payment-object) definition for reference. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-recurring-payment-with-the-webview.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment.md). # Cancelling a payment In this guide, we will initiate a cancellation on a payment, and validate it if necessary. Depending on the type of payment and whether the connector allows it or not, it may be possible to cancel a payment through our API once it has been validated and confirmed, before it has been executed. {% hint style="info" %} This guide assumes you are cancelling a payment respecting the following criteria: \* The state of the payment is either \`created\` or \`pending\`. \* If the state of the payment is \`pending\`, the execution date type of all instructions in the payment is not \`instant\`. {% endhint %} {% hint style="warning" %} Note that this guide assumes you have the following information on hand: \* A Powens domain with Pay by Bank enabled. \* A Powens domain client with client identifiers, thereafter named \`clientId\` and \`clientSecret\`. \* A URL to redirect the end user to at the end of the process, registered with the client, thereafter named \`redirectURL\`. \* An optional state that will be transmitted to your redirect URL, thereafter named \`optionalRedirectState\`. \* A payment you wish to cancel, for which the identifier will be represented as \`paymentId\`. {% endhint %} ## Initiate the cancellation You first need to request the cancellation from our API, by doing the following request: \`\`\` POST /payments/{paymentId} \`\`\` \`\`\`json { "cancel": true, "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}" } \`\`\` From here, you can obtain multiple responses corresponding to multiple scenarios: {% tabs %} {% tab title="Cancellation successful" %} If the cancellation could successfully be done without any validation by the end user, the response looks like the following: \`\`\`json { "id": {paymentId}, "state": "rejected", "error\_code": "cancelledByUser", ... } \`\`\` {% endtab %} {% tab title="End user validation required" %} Some cancellations require a validation by the end user. In this case, the response looks like the following: \`\`\`json { "id": {paymentId}, "state": "pending", "state\_detail": "cancelling", ... } \`\`\` {% endtab %} {% tab title="Cancellation is not supported" %} If the connector doesn't support cancelling the provided payment, the following response will be received: \`\`\`json { "code": "notSupported", "description": "Bad request, please check your request parameters.", ... } \`\`\` {% endtab %} {% endtabs %} ## Validate a payment cancellation if necessary If the cancellation requires validation from the end user, the payment state will stays in \`pending\` , its \`state\_detail\` will be \`cancelling\`, and the \`validate\_uri\` field of the payment resource will be populated with a link to the PSU's bank. In this case, the PSU must be redirected to this URL. ### Receive a callback from the payer If the payment cancellation needed an approval from the PSU, you will need to handle the callback at the end of the cancellation flow. Once the payer has either completed the payment cancellation flow, they will go on the callback URL you have configured on the payment with the following parameters: \* \`state\`: the optional client state you have configured on the payment, i.e. \`{optionalClientState}\`. \* \`id\_payment\`: the identifier of the payment that the user comes from. \* \`error\_code\` (\*optional\*): set to the payment's error code, if the payment has been cancelled or rejected by the bank. \* \`bank\_message\` (\*optional\*): set to the bank message, if available. \* \`payment\_state\` (\*optional\*): the state of the payment, if the payer comes from the bank's interface. For security reasons, it is recommended to check the payment's state manually; see \[Get the payment status\](/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md#get-the-payment-status). --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/cancelling-a-payment.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview.md). # Initiating a bulk payment with the Webview In this guide, we will create and validate a "bulk" payment using the Pay by Bank product. {% hint style="warning" %} Note that this guide assumes you have the following information on hand: \* A Powens domain with Pay by Bank enabled. \* A Powens domain client with client identifiers, thereafter named \`clientId\` and \`clientSecret\`. \* A URL to redirect the end user to at the end of the process, registered with the client, thereafter named \`redirectURL\`. \* An optional state that will be transmitted to your redirect URL, thereafter named \`optionalRedirectState\`. {% endhint %} Bulk payments are payments with multiple instructions to be executed once by the bank. They are equivalent to initiating multiple one-time payments, except that there is only one connector and one validation for all of the instructions. Akin to one-time payments, the instructions of a bulk payment can have different types: \* \*\*"First open day" payments\*\*: classic payments usually executed within a few business days (SEPA Credit Transfers, GB BACS, GB CHAPS, GB Faster Payments, ...). \* \*\*"Instant" payments\*\*: payments usually executed within a few minutes (SEPA Instant Credit Transfers). \* \*\*"Deferred" payments\*\*: classic payments only executed at a provided future date. {% hint style="warning" %} Currently, all instructions of a given payment must have the same type, and for deferred bulk payments, all instructions must be executed on the same day. {% endhint %} The basic initiation workflow is the same as in \[Initiating a one-time payment with the Webview\](/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md), with the following notable differences: \* The payment object contains two or more instructions. \* The payment status needs to be interpreted differently. The basic initiation workflow will be the following: {% @mermaid/diagram content="sequenceDiagram participant u as PSU (Payer) participant c as Your app/service participant w as Powens Webview participant a as Powens API participant b as Bank u->>c: Initiate a bulk payment c->>a: Create a bulk payment request a->>c: Bulk payment request c->>u: Webview URL for
the bulk payment request u->>w: Open webview URL in browser w->>b: Redirect PSU to the bank b->>w: Validation result w->>a: Validation result a->>c: Bulk payment status" %} ## Obtain a token suitable for creating bulk payments In order to create bulk payments, we need a special access token with the \`payments:admin\` scope, obtained using client credentials: \`\`\` POST /auth/token \`\`\` \`\`\`json { "grant\_type": "client\_credentials", "client\_id": "{clientId}", "client\_secret": "{clientSecret}", "scope": "payments:admin", } \`\`\` \`\`\`json { "token": "{accessToken}", "scope": "payments:admin" } \`\`\` See \[Service Tokens\](https://docs.powens.com/api-reference/overview/authentication#service-tokens) for more information. ## Create a bulk payment You can now create a bulk payment request with the following request: \`\`\` POST /payments \`\`\` {% tabs %} {% tab title="Classic bulk payment" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "ABC123 ACME Corp Mar 2020 Charges",\ "amount": 550,\ "currency": "EUR",\ "execution\_date\_type": "first\_open\_day",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ },\ {\ "label": "DEF456 CMEA Corp Mar 2020 Charges",\ "amount": 300,\ "currency": "EUR",\ "execution\_date\_type": "first\_open\_day",\ "beneficiary": {\ "scheme\_iban": "iban",\ "identification": "FR76YYYYYYYYYYYYYYY",\ "label": "CMEA Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "CMEA Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siret",\ "identification": "876543210000025",\ }\ }\ \], "payer\_identity": { "kind": "corporate", "org\_name": "Jean-Michel-Thierry Couverture", "org\_legal\_status": "EIRL", "scheme\_name": "siren", "identification": "111222333" } } \`\`\` {% endtab %} {% tab title="Instant bulk payment" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "ABC123 ACME Corp Mar 2020 Charges",\ "amount": 550,\ "currency": "EUR",\ "execution\_date\_type": "instant",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ },\ {\ "label": "DEF456 CMEA Corp Mar 2020 Charges",\ "amount": 300,\ "currency": "EUR",\ "execution\_date\_type": "instant",\ "beneficiary": {\ "scheme\_iban": "iban",\ "identification": "FR76YYYYYYYYYYYYYYY",\ "label": "CMEA Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "CMEA Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siret",\ "identification": "876543210000025",\ }\ }\ \], "payer\_identity": { "kind": "corporate", "org\_name": "Jean-Michel-Thierry Couverture", "org\_legal\_status": "EIRL", "scheme\_name": "siren", "identification": "111222333" } } \`\`\` {% endtab %} {% tab title="Deferred bulk payment" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "ABC123 ACME Corp Mar 2020 Charges",\ "amount": 550,\ "currency": "EUR",\ "execution\_date\_type": "deferred",\ "execution\_date": "2024-01-05",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ },\ {\ "label": "DEF456 CMEA Corp Mar 2020 Charges",\ "amount": 300,\ "currency": "EUR",\ "execution\_date\_type": "deferred",\ "execution\_date": "2024-01-05",\ "beneficiary": {\ "scheme\_iban": "iban",\ "identification": "FR76YYYYYYYYYYYYYYY",\ "label": "CMEA Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "CMEA Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siret",\ "identification": "876543210000025",\ }\ }\ \], "payer\_identity": { "kind": "corporate", "org\_name": "Jean-Michel-Thierry Couverture", "org\_legal\_status": "EIRL", "scheme\_name": "siren", "identification": "111222333" } } \`\`\` {% endtab %} {% endtabs %} \`\`\`json { "id": {paymentId}, "state": "created", "error\_code": null, "error\_description": null, … } \`\`\` A \`payer\_identity\` for the bulk payment request and a \`beneficiary\_identity\` for every instruction is required and must contain information on either the payer (which you redirect to the webview) or the beneficiary (matching the routing information). For the definition of such objects, see the \[Identity object\](https://docs.powens.com/api-reference/products/payments/payments#identity-resource) definition. The following are examples of different identity kinds with Pay: {% tabs %} {% tab title="Individual" %} \`\`\`json { "kind": "individual", "external\_ref": "MY-CUSTOMER-REFERENCE-012345678", "first\_name": "Jean", "last\_name": "Dupont", "nationality": "FR", "postal\_address": "Appartement 25\\nEntrée B Résidence Les Iris\\n3 Boulevard du Levant\\n95220 HERBLAY" } \`\`\` {% endtab %} {% tab title="Company" %} \`\`\`json { "kind": "corporate", "org\_name": "Powens", "org\_legal\_status": "SAS", "org\_hq\_address": "84 RUE BEAUBOURG\\n75003 PARIS 3\\nFRANCE", "scheme\_name": "siren", "identification": "749867206" } \`\`\` {% endtab %} {% endtabs %} See the \[\`POST /payments\` endpoint reference\](https://docs.powens.com/api-reference/products/payments/payments#initiate-a-payment) and \[the \`PaymentInitRequest\` object description\](https://docs.powens.com/api-reference/products/payments/payments#paymentinitrequest-object) for more information on the payload or returned information. ## Obtain the bulk payment validation token In order for the payer to be able to validate the bulk payment request, you first need to create a token scoped to validate the created bulk payment specifically. You can do this using the token created in \[Obtain a token suitable for creating payments\](#obtain-a-token-suitable-for-creating-payments): \`\`\` POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} \`\`\` \`\`\`json { "scope": \["payments:validate"\] } \`\`\` \`\`\`json { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires\_in": 604800, "id\_payment": {paymentId} } \`\`\` See the \[\`POST /payments/{id}/scopedtoken\` endpoint reference\](https://docs.powens.com/api-reference/products/payments/payments#generate-a-payment-scoped-token) for more information. ## Build the bulk payment validation URL Now that you have the bulk payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: \* \`domain\`: your client domain. \* \`client\_id\`: the client identifier for your application (\`clientId\`). \* \`redirect\_uri\`: the same redirect URL you've used when creating the bulk payment (\`redirectURL\`). \* \`state\`: the same state you've used when creating the bulk payment (\`optionalRedirectState\`). \* \`code\`: The scoped token you've generated on your previous request to the API. \* \`payment\_id\`: the identifier of the bulk payment. This will make you obtain a URL of the form: \`\`\` https://{domain}.biapi.pro/2.0/auth/webview/payment?client\_id={clientId}&redirect\_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment\_id={paymentId} \`\`\` You can redirect your payer to this URL. ## Receive a callback from the payer Once the payer has either completed the bulk payment validation flow, or has cancelled from either our Webview or the bank's interface, they will go on the callback URL you have configured on the payment with the following parameters: \* \`state\`: the optional client state you have configured on the bulk payment, i.e. \`{optionalClientState}\`. \* \`id\_payment\`: the identifier of the bulk payment that the user comes from. \* \`error\` (\*optional\*): set to "\`cancelled\`" if the payer has cancelled the bulk payment from our Webview. \* \`error\_code\` (\*optional\*): set to the bulk payment's error code, if the payment has been cancelled or rejected by the bank. \* \`bank\_message\` (\*optional\*): set to the bank message, if available. \* \`payment\_state\` (\*optional\*): the state of the bulk payment, if the payer has been redirected by the bank. For security reasons, following such a callback from the payer, it is recommended to check the bulk payment's state manually; see \[Get the bulk payment status\](#get-the-bulk-payment-status). ## Check on a bulk payment's state During and after the initiation of a bulk payment, you may want to check on the status of said bulk payment, or to get data back from the bulk payment initiation request. ### Receive bulk payment updated events using webhooks (recommended method) In order to receive updates when a bulk payment switches states, it is recommended to \[set up the Payment Updated webhook\](/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank.md#configure-the-payment-state-updated-webhook) and wait for events regarding bulk payments. {% hint style="warning" %} Webhook events will only be triggered during a background refresh/synchronization of the bulk payment's state. {% endhint %} {% hint style="warning" %} Webhook events will not be emitted if only an instruction changes states, only if the payment changes states, i.e. if all instructions reach a final state. {% endhint %} For more information, see \[Webhooks\](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. ### Get the bulk payment status {% hint style="warning" %} This method is \*\*not recommended for polling\*\* the bulk payment's status regularly, it is recommended to wait for incoming webhook events to this end. However, it is recommended for when receiving a callback regarding a bulk payment from an end user, or for debugging purposes. {% endhint %} In order to get a given bulk payment's status, you can call the \`GET /payments/{id}\` endpoint, with the identifier of the bulk payment. See \[API endpoints\](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. ### Process the bulk payment statuses In the resulting bulk payment resource, you are to get both the \`state\` property of the payment, and if it is available, the \`state\` property of every of its instructions. At instruction-level, if the status is not \`null\`, you can conclude the following: \* If the status is \`pending\`, the instruction is still awaiting execution. \* If the status is \`rejected\`, the instruction has been rejected by either the bank, or the end user through the bank. \* If the status is \`accepted\`, the bank will not provide further updates past the initiation for this instruction; if you accept the risks, you can consider this instruction as executed. \* If the status is \`done\`, the instruction has been executed by the bank. The bulk payment's state property signifies, at a higher level, of the status of its instructions: \* If the bulk payment's state is \`pending\`, at least one instruction is still awaiting execution. You probably still want to check the instructions' statuses to find out if some instructions have changed state. \* If the bulk payment's state is \`rejected\`, all instructions are considered to have the \`rejected\` status. \* If the bulk payment's state is \`accepted\`, all instructions are considered to have the \`accepted\` status. \* If the bulk payment's state is \`done\`, all instructions are considered to have the \`done\` status. \* If the bulk payment's state is \`partial\`, at least one instruction is either \`done\` or \`accepted\`, and at least one instruction is considered to have the \`rejected\` status. {% hint style="warning" %} In the case the bank reports a \`partial\` status with no detail regarding the state of the instructions, the payment will be reported having the \`partial\` status, and all of its instructions will have the \`accepted\` status. {% endhint %} See the \[Payment object\](https://docs.powens.com/api-reference/products/payments/payments#payment-object) definition for reference. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-bulk-payment-with-the-webview.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md). # Initiating a one-time payment with the Webview In this guide, we will create and validate a basic, one-time payment using the Pay by Bank product. {% hint style="warning" %} Note that this guide assumes you have the following information on hand: \* A Powens domain with Pay by Bank enabled. \* A Powens domain client with client identifiers, thereafter named \`clientId\` and \`clientSecret\`. \* A URL to redirect the end user to at the end of the process, registered with the client, thereafter named \`redirectURL\`. \* An optional state that will be transmitted to your redirect URL, thereafter named \`optionalRedirectState\`. {% endhint %} One-time payments are payments executed once. They can be of different kinds: \* \*\*"First open day" payments\*\*: classic payments usually executed within a few business days (SEPA Credit Transfers, GB BACS, GB CHAPS, GB Faster Payments, ...). \* \*\*"Instant" payments\*\*: payments usually executed within a few minutes (SEPA Instant Credit Transfers). \* \*\*"Deferred" payments\*\*: classic payments only executed at a provided future date. The basic workflow will be the following:
## Obtain a token suitable for creating payments In order to create payments, we need a special access token with the \`payments:admin\` scope, obtained using client credentials: \`\`\` POST /auth/token \`\`\` \`\`\`json { "grant\_type": "client\_credentials", "client\_id": "{clientId}", "client\_secret": "{clientSecret}", "scope": "payments:admin", } \`\`\` \`\`\`json { "token": "{accessToken}", "scope": "payments:admin" } \`\`\` See \[Service Tokens\](https://docs.powens.com/api-reference/overview/authentication#service-tokens) for more information. ## Create a one-time payment You can now create a payment request with the following request: \`\`\` POST /payments \`\`\` {% tabs %} {% tab title="First open day" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "Test",\ "amount": 50.90,\ "currency": "EUR",\ "execution\_date\_type": "first\_open\_day",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ }\ \], "payer\_identity": { "kind": "individual", "first\_name": "Germaine", "last\_name": "Michu", "birth\_date": "1963-01-01", "birth\_city": "Paris", "birth\_country": "FR", "nationality": "French" } } \`\`\` {% endtab %} {% tab title="Instant" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "Test",\ "amount": 50.90,\ "currency": "EUR",\ "execution\_date\_type": "instant",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ }\ \], "payer\_identity": { "kind": "individual", "first\_name": "Germaine", "last\_name": "Michu", "birth\_date": "1963-01-01", "birth\_city": "Paris", "birth\_country": "FR", "nationality": "French" } } \`\`\` {% endtab %} {% tab title="Deferred" %} \`\`\`json { "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "Test",\ "amount": 50.90,\ "currency": "EUR",\ "execution\_date\_type": "deferred",\ "execution\_date": "2024-01-01",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp."\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ }\ }\ \], "payer\_identity": { "kind": "individual", "first\_name": "Germaine", "last\_name": "Michu", "birth\_date": "1963-01-01", "birth\_city": "Paris", "birth\_country": "FR", "nationality": "French" } } \`\`\` {% endtab %} {% endtabs %} \`\`\`json { "id": {paymentId}, "state": "created", "error\_code": null, "error\_description": null, … } \`\`\` A \`payer\_identity\` for the payment request and a \`beneficiary\_identity\` for the instruction are required and must contain information on either the payer (which you redirect to the webview) or the beneficiary (matching the routing information). For the definition of such objects, see IdentityRequest. The following are examples of different identity kinds with Pay by Bank: {% tabs %} {% tab title="Individual" %} \`\`\`json { "kind": "individual", "external\_ref": "MY-CUSTOMER-REFERENCE-012345678", "first\_name": "Jean", "last\_name": "Dupont", "nationality": "FR", "postal\_address": "Appartement 25\\nEntrée B Résidence Les Iris\\n3 Boulevard du Levant\\n95220 HERBLAY" } \`\`\` {% endtab %} {% tab title="Company" %} \`\`\`json { "kind": "corporate", "org\_name": "Powens", "org\_legal\_status": "SAS", "org\_hq\_address": "84 RUE BEAUBOURG\\n75003 PARIS 3\\nFRANCE", "scheme\_name": "siren", "identification": "749867206" } \`\`\` {% endtab %} {% endtabs %} See the \[\`POST /payments\` endpoint reference\](https://docs.powens.com/api-reference/products/payments/payments#initiate-a-payment) and \[the \`PaymentInitRequest\` object description\](https://docs.powens.com/api-reference/products/payments/payments#paymentinitrequest-object) for more information on the payload or returned information. ## Obtain the payment validation token In order for the payer to be able to validate the payment request, you first need to create a token scoped to validate the created payment specifically. You can do this using the token created in \[Obtain a token suitable for creating payments\](#obtain-a-token-suitable-for-creating-payments): \`\`\` POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} \`\`\` \`\`\`json { "scope": \["payments:validate"\] } \`\`\` \`\`\`json { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires\_in": 604800, "id\_payment": {paymentId} } \`\`\` See the \[\`POST /payments/{id}/scopedtoken\` endpoint reference\](https://docs.powens.com/api-reference/products/payments/payments#generate-a-payment-scoped-token) for more information. ## Build the payment validation URL Now that you have the payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: \* \`domain\`: your client domain. \* \`client\_id\`: the client identifier for your application (\`clientId\`). \* \`redirect\_uri\`: the same redirect URL you've used when creating the payment (\`redirectURL\`). \* \`state\`: the same state you've used when creating the payment (\`optionalRedirectState\`). \* \`code\`: The scoped token you've generated on your previous request to the API. \* \`payment\_id\`: the identifier of the payment. This will make you obtain a URL of the form: \`\`\` https://{domain}.biapi.pro/2.0/auth/webview/payment?client\_id={clientId}&redirect\_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment\_id={paymentId} \`\`\` You can redirect your payer to this URL. ## Receive a callback from the payer Once the payer has either completed the payment validation flow, or has cancelled from either our Webview or the bank's interface, they will go on the callback URL you have configured on the payment with the following parameters: \* \`state\`: the optional client state you have configured on the payment, i.e. \`{optionalClientState}\`. \* \`id\_payment\`: the identifier of the payment that the user comes from. \* \`error\` (\*optional\*): set to "\`cancelled\`" if the payer has cancelled the payment from our Webview. \* \`error\_code\` (\*optional\*): set to the payment's error code, if the payment has been cancelled or rejected by the bank. \* \`bank\_message\` (\*optional\*): set to the bank message, if available. \* \`payment\_state\` (\*optional\*): the state of the payment, if the payer has been redirected by the bank. For security reasons, following such a callback from the payer, it is recommended to check the payment's state manually; see \[Polling the payment status\](#polling-the-payment-status). ## Check on a one-time payment's state During and after the initiation of a payment, you may want to check on the status of a payment, or to get data back from the payment initiation request. ### Receive payment updated events using webhooks (recommended method) In order to receive updates when a payment switches states, it is recommended to \[set up the Payment Updated webhook\](/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank.md#configure-the-payment-state-updated-webhook) and wait for events regarding payments. {% hint style="warning" %} Webhook events will only be triggered during a background refresh / synchronization of the payment state. {% endhint %} For more information, see \[Webhooks\](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. ### Get the payment status {% hint style="warning" %} This method is \*\*not recommended for polling\*\* the payment status regularly, it is recommended to wait for incoming webhook events to this end. However, it is recommended for when receiving a callback regarding a payment from an end user, or for debugging purposes. {% endhint %} In order to get a given payment's status, you can call the \`GET /payments/{id}\` endpoint, with the identifier of the payment. See \[API endpoints\](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. ### Process the payment status In the resulting payment resource, you are to get the \`state\` property, and do the following: \* If the payment is \`pending\`, you should wait for the payment to be executed. \* If the payment is \`expired\`, it means that the payment will not be updated anymore; you should consider the payment as rejected. \* If the payment is \`accepted\`, it means that the initiation was successful but the bank will not provide further updates; if you accept the risks, you can consider the payment as done. \* If the payment is \`done\`, it means that the payment has been executed by the payer's bank; you can consider the payment as done. \* If the payment is \`rejected\`, it means that the payment has been rejected by the bank, or by the end user through the bank; you should request a new payment. {% hint style="info" %} A payment with the \`accepted\` status could still be rejected by the bank (e.g. for insufficient funds at execution time), however we can no longer poll the payment's status on our side. If you want to avoid such cases, you can identify connectors with this behaviour by checking the \`partial\_status\_tracking\` property of connectors; see \[Listing connectors with Pay by Bank enabled programmatically\](/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically.md). {% endhint %} See the \[Payment object\](https://docs.powens.com/api-reference/products/payments/payments#payment-object) definition for reference. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/wealth-and-loans.md). # Wealth & Loans The Wealth & Loans product is an extension of the \[Transactions product\](/documentation/integration-guides/transactions.md). Beyond the collection of PSD2-compliant accounts, Wealth & Loans extends the scope to all other accounts (loans, savings accounts, market accounts, life insurances, retirement savings, company savings…). Wealth & Loans also enables the collection of additional information on these accounts, such as the valuation, the valuation differential and the previous differential. Finally, Wealth & Loans enables the retrieval of three additional resources of wealth accounts: \* \[Investments\](https://docs.powens.com/api-reference/products/wealth-aggregation/investments) (financial assets of the account) \* \[Pockets\](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets) (free shares, for company savings accounts only) \* \[Market orders\](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders) (for market accounts & equity savings plans only) \* \[Loan amortizations\](#market-order-resource-1) (for loans accounts)
Wealth & Loans thus offers a complete view of the end-user's patrimonial assets. ### Account types
TypeDescription
MarketShare account to buy and sell market stocks and obligations, directly on financial markets (CAC40 companies, DAX, Nasdaq ...) as well as units of account on investment funds. It is not possible to invest on Euro funds with this type of account.
PEA'Plan Épargne Actions', a regulated account to buy and sell stocks in the EU. It allows you to acquire and manage a portfolio of European companies shares. It is exempt from taxes under certain conditions.
Life insuranceOne of the most common investment accounts. It comes in two parts: first part invested in one or more Euro funds, and a second part invested in unit-linked contracts (investment funds, SICAV, UCITS, SCPI…). The respective proportion of these two parts depends on the investor's profile.
CapitalizationA French specific fiscal envelope very close to a life insurance contract, also made of two parts. Unlike life insurance, it is not based on any risk coverage: it does not depend on the subscriber's lifetime and it can be inherited.
PERCompany or individual retirement plan account. It is a contract available since October 1st, 2019, under the 'PACTE' law. The PER (Individual Retirement Savings Plan), is a long-term savings envelope for any person (individual or self-employed) wishing to build up savings for their retirement.
PERPPrivate individual retirement plan account. PERP (popular retirement savings plan) is long-term savings. It allows you to save during your working life and to have an annuity at retirement and a capital option. PERP will no longer be offered after October 1st, 2020 (replaced by PER).
PERCOThe PERCO (collective retirement savings plan) is a company retirement plan account. As of October 1st, 2020, the Perco can no longer be implemented in companies. The Perco can be transformed into a collective enterprise PER.
MadelinThe Madelin contract is an individual retirement savings product for self-employed and liberal professions. Payments are supervised and have tax benefits. As of October 1st, 2020, it will no longer be possible to subscribe to a new Madelin contract.
### Features activation Wealth & Loans features can be activated by your Account Manager only. Basic activation includes: \* the collection of \*\*additional information on wealth accounts\*\* (valuation, valuation differential, previous differential…); \* the retrieval of \*\*investments\*\* on wealth accounts; \* the retrieval of \*\*pockets\*\* (free shares), specifically for company savings accounts. As an optional feature, you can also enable the collection of \[additional details\](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#get-an-investment) for investments when available, mainly for connectors specialized in employee and company savings accounts (PER, PEE, PERP, PERCO, Madelin…). Finally, the collection of \*\*market orders\*\* can also be independently activated. ### Additional attributes for Wealth accounts As mentioned above, activating the API enables the collection of additional information for wealth accounts. | Property | Description | | ------------------- | --------------------------------------------------------------------------------------------- | | \`valuation\` | Sum of the valuations of the investments of this account. | | \`diff\` | Difference between the amount invested on the account and the current balance of the account. | | \`diff\_percent\` | Ratio between the amount invested on the account and the current balance of the account. | | \`prev\_diff\` | \`diff\` value obtained during the previous synchronization of the account. | | \`prev\_diff\_percent\` | \`diff\_percent\` value obtained during the previous synchronization of the account. | These attributes appear in the usual routes used to query accounts: \`\`\` GET /users/me/accounts GET /users/me/connections/{connectionId}/accounts \`\`\` ### Investment resources The \[investments\](https://docs.powens.com/api-reference/products/wealth-aggregation/investments) are the financial assets of a wealth account. They can be financial equities, actions, obligations, Euro funds, unit-linked contracts or even liquidities: \`\`\` GET /users/me/investments GET /users/me/accounts/{accountId}/investments GET /users/me/connections/{connectionId}/investments \`\`\` \`\`\`json { "prev\_diff\_percent": 0.0, "calculated": \[\ "diff",\ "diff\_percent",\ "prev\_diff",\ "pref\_diff\_percent",\ "valuation"\ \], "prev\_diff": 0, "diff": 364.156, "total": 1, "valuation": 1055575.41, "investments": \[\ {\ "code\_type": "ISIN",\ "prev\_vdate": null,\ "original\_valuation": null,\ "portfolio\_share": 0.7,\ "code": "FR1234567891",\ "diff": -14.659,\ "last\_update": "2020-08-06 15:37:46",\ "unitvalue": 150959.777,\ "id": 30,\ "original\_unitprice": null,\ "id\_account": 1234,\ "deleted": null,\ "detail": {\ "last\_update": "2020-08-06 15:37:46",\ "srri": 5,\ "recommended\_period": "6 months",\ "performance\_1\_year": 0.5973,\ "performance\_3\_years": 0.9333,\ "performance\_5\_years": 0.7025,\ "asset\_category": "US Actions"\ },\ "label": "Example Investment Label",\ "source": "website",\ "description": "",\ "original\_unitvalue": null,\ "original\_currency": null,\ "original\_diff": null,\ "id\_type": 1,\ "valuation": 1055575.41,\ "id\_security": 224,\ "vdate": "2020-08-06",\ "calculated": \[\ "portfolio\_share"\ \],\ "prev\_diff": null,\ "quantity": 3.094,\ "unitprice": 150964.515,\ "diff\_percent": 0.0\ }\ \] } \`\`\` It contains a list of attributes that are related to the account, as well as an \`investments\` key containing a list of the investments for this account. If the account does not have any investment or if the investments are not implemented for this account type, the API will return an empty list. {% hint style="info" %} The \`calculated\` key indicates the list of attributes that are calculated and not directly obtained from the bank (for example, \`valuation\` is the sum of scraped investments valuations for a given account). {% endhint %} #### Investment history Even though the investment attributes are updated at each synchronization, the history of all unit values, original unit values, original currencies and valuation dates is saved and can be accessed via the API: \`\`\` GET /users/me/investments/{investmentId}/history \`\`\` \`\`\`json { "investmentvalues": \[\ {\ "original\_unitvalue": null,\ "original\_currency": null,\ "vdate": "2020-08-04",\ "id\_investment": 12345,\ "unitvalue": 148.13,\ "id": 50\ },\ {\ "original\_unitvalue": null,\ "original\_currency": null,\ "vdate": "2020-08-03",\ "id\_investment": 12345,\ "unitvalue": 147.15,\ "id": 49\ }\ \], "total": 2 } \`\`\` This information can be used to build graphs of the value of each investment from the first time this investment was collected until the most recent synchronization. #### Unit value history The history depth depends of the investment: for most investments the history depth is one month (which includes daily values), but for some investments only today's unit value is available. In any case, the unit values and their corresponding dates are collected an exposed as \`vdate\` / \`unitvalue\` couples in the API. \`\`\` GET /users/me/investments/{investmentId}/security/history \`\`\` \`\`\`json { "history": \[\ {\ "unitvalue": 192.86,\ "vdate": "2020-08-05"\ },\ {\ "unitvalue": 192.21,\ "vdate": "2020-08-04"\ },\ {\ "unitvalue": 192.13,\ "vdate": "2020-08-03"\ },\ {\ "unitvalue": 191.94,\ "vdate": "2020-07-31"\ }\ \], "result\_min\_date": "2020-07-31", "result\_max\_date": "2020-08-06", "first\_date": "2020-07-31", "last\_date": "2020-08-05", } \`\`\` This history of investment values can be used to build graphs of the evolution of the unit value of each stock from the first time we collected this information until today. {% hint style="info" %} This service is partly redundant with the history of a single investment (\`/investments/{investmentId}/history\` route), both can be used and have their specificities and advantages. The security history route is common to all investments with the same ISIN, thus the history depth is usually bigger, however the data comes from the Boursorama website therefore there might be discrepancies between the unit values collected there and the actual unit values collected from the customer's website. In addition, the investment history route also contains the original unit values and currencies, when applicable. {% endhint %} ### Pocket resource Major companies and corporations sometimes give a part of their own stocks to their employees without any financial requirement. These freely given stocks are called \*\*Pockets\*\* or \*\*Free shares\*\* and can be found on connectors specialized in employee savings accounts (for example BNP, Natixis and Amundi). On these employee savings accounts, Investments are often divided into several \[Pockets\](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets) that have different \*\*availability dates and conditions\*\*. The most common availability condition is the retirement of the employee, but it can also be at a specific date in the future (for example 5 years after the Pocket was issued), in which case the Pocket will have an \*\*availability date\*\*. If the availability date is in the past, the Pocket is already available, hence the displayed condition will be \`available\`. \`\`\` GET /users/me/investments/{investmentId}/pockets GET /users/me/accounts/{accountId}/pockets GET /users/me/connections/{connectionId}/pockets \`\`\` \`\`\`json { "pockets": \[\ {\ "deleted": null,\ "id\_account": 1234,\ "id\_investment": 12345,\ "value": 959.4602465,\ "label": "Unités de compte sous allocation libre",\ "availability\_date": "2019-08-18",\ "last\_update": "2020-08-18 16:13:36",\ "id": 61,\ "condition": "available",\ "quantity": 1.0705\ },\ {\ "deleted": null,\ "id\_account": 1234,\ "id\_investment": 12345,\ "value": 2576.0678566,\ "label": "Unités de compte sous allocation pilotée",\ "availability\_date": "2022-08-18",\ "last\_update": "2020-08-18 16:13:36",\ "id": 62,\ "condition": "retirement",\ "quantity": 2.8742\ },\ {\ "deleted": null,\ "id\_account": 1234,\ "id\_investment": 12345,\ "value": 1269.3914499,\ "label": "Actions Europe",\ "availability\_date": "2023-08-18",\ "last\_update": "2020-08-18 16:13:36",\ "id": 63,\ "condition": "date",\ "quantity": 1.4163\ }\ \] } \`\`\` ### Market Order resource \*\*Market Orders\*\* correspond to the purchases and sales of financial equities, actions and obligations on \*\*Market accounts\*\* and \*\*Equity savings plans\*\* (PEA). The collection of Market Orders provides an overview of the history of financial movements on these accounts. \[Market Orders\](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders) are currently implemented on most major bank connectors (Crédit Agricole, Caisse d'épargne, BNP Paribas, Société Générale, Boursorama, Fortuneo…), as well as websites specialized in stock exchange, such as online brokers (Binck, Degiro, Boursedirect...). \`\`\` GET /users/me/accounts/{accountId}/marketorders GET /users/me/connections/{connectionId}/marketorders GET /users/me/marketorders \`\`\` \`\`\`json { "marketorders": \[\ {\ "code": "FR0000031122",\ "order\_type": {\ "id": 2,\ "name": "MARKET"\ },\ "created": "2020-08-06 15:37:47",\ "payment\_method": "UNKNOWN",\ "id\_account": 1234,\ "order\_direction": {\ "id": 3,\ "name": "SALE"\ },\ "execution\_date": null,\ "webid": "X12548786",\ "amount": null,\ "label": "AIR FRANCE-KLM",\ "stock\_market": "Xetra",\ "state": "Pending",\ "deleted": null,\ "ordervalue": null,\ "date": "2020-08-15 00:00:00",\ "validity\_date": "2020-11-15 00:00:00",\ "unitvalue": null,\ "last\_update": "2020-08-18 16:13:36",\ "unitprice": null,\ "id": 1,\ "quantity": 400.0\ },\ {\ "code": "US0231351067",\ "order\_type": {\ "id": 3,\ "name": "LIMIT"\ },\ "created": "2020-08-06 15:37:47",\ "payment\_method": "DEFERRED",\ "id\_account": 1234,\ "order\_direction": {\ "id": 2,\ "name": "BUY"\ },\ "execution\_date": "2020-08-15 00:00:00",\ "webid": "ER1218443",\ "amount": 45400.02,\ "label": "AMAZON",\ "stock\_market": "NASDAQ",\ "state": "Executed",\ "deleted": null,\ "ordervalue": 43.12,\ "date": "2020-08-12 00:00:00",\ "validity\_date": "2020-11-12 00:00:00",\ "unitvalue": 45.38,\ "last\_update": "2020-08-18 16:13:36",\ "unitprice": 45.41,\ "id": 2,\ "quantity": 1000.0\ }\ \] } \`\`\` #### Market Order attributes and specificities Market Orders have some attributes in common with Investments, for example \`id\`, \`code\`, \`label\`, \`quantity\`, \`unitprice\` and \`unitvalue\`. They also have specific attributes, such as the order direction and type of the Market Order, the current state of the Market Order and the Stock Market on which the order was placed. A Market Order can have up to 3 associated dates: the \*\*creation date\*\*, the \*\*execution date\*\* and the \*\*validity date\*\* (which is usually 3 months after the creation date). During every synchronization, all market orders are collected and matched with the previous market order list using a stable unique identifier. If there is no such identifer on a given website, the matching is done using static attributes: \`date\`, \`label\`, \`code\` and \`direction\` (most of the other attributes may vary between the market order creation and its execution or expiration). If a Market Order is matched with a previously collected item, its attributes will be updated, otherwise a new item will is created. The Market Order history depth depends on the website: on some websites, several years of Market Order history are displayed whereas on some others, only pending market orders are available and they disappear after execution. ### Loan Amortizations resource {% hint style="info" %} This feature is not activated by default. Please contact your Customer Success Manager to activate it. {% endhint %} \*\*Loan Amortizations\*\* correspond to the amortization paid by a user for a loan. Most of the amortization tables available in the user's banking space are updated once a month, starting from the current month or year. We therefore update the information once a month, and the amortization will begin at the earliest on the date of the first synchronization. \`\`\` GET /users/me/accounts/{accountId}/amortizations GET /users/me/connections/{connectionId}/amortizations GET /users/me/amortizations \`\`\` \`\`\` "loanamortizations": \[\ ...\ {\ "id\_account": 1,\ "payment\_date": "2024-02-29",\ "amortization\_amount": {\ "currency": "EUR",\ "value": 108.0\ },\ "interest\_amount": {\ "currency": "EUR",\ "value": 15.0\ },\ "insurance\_amount": {\ "currency": "EUR",\ "value": 2.0\ },\ "total\_payment\_amount": {\ "currency": "EUR",\ "value": 125.0\ },\ "remaining\_capital": {\ "currency": "EUR",\ "value": 1500.0\ },\ "last\_update": "2024-02-29 14:32:05",\ "deleted": null,\ "period": "2024-02",\ "calculated": \[\ "total\_payment\_amount"\ \]\ },\ ...\ \], "total": 42 } \`\`\` {% hint style="info" %} The \`calculated\` key indicates the list of attributes that are calculated and not directly obtained from the bank (for example, \`total\_payment\_amount\` is the sum of scraped amortization, interest and insurance amounts for a given amortization). {% endhint %} --- # 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://docs.powens.com/documentation/integration-guides/wealth-and-loans.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank.md). # Pay by Bank Getting started with the Pay by Bank product through specific guides These sections will introduce you to enabling, configuring and using the Pay by Bank product to create, validate, and follow up on payment requests. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank.md). # Getting started with Pay by Bank Discover what the Pay by Bank product is about, and enable Pay on your domain! The Pay by Bank product allows you to initiate and follow up on payments with banks complying with the revised Payment Service Directive (PSD2). It does not require bank account aggregation made beforehand: you may request payments from an emitter bank \*without\* creating a connection in our API. If you do not have a domain yet, you can preview connectors supporting the Pay by Bank product by going on \[Powens Institutions\](https://institutions.powens.com/), and selecting "Pay" on the left hand side. ## Enable Pay by Bank on your domain Pay by Bank features can be activated by your commercial contact only. ## Enable Pay by Bank connectors Going on the \[console\](https://console.budget-insight.com/), selecting your domain then selecting "Pay" on the left. From there, you can enable connectors you want to use on your domain. ## Configure the Payment State Updated Webhook It is highly recommended to configure the \`PAYMENT\_STATE\_UPDATED\` webhook; see \[Webhooks\](/documentation/integration-guides/webhooks.md) for more information on how webhooks work. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/getting-started-with-pay-by-bank.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/bank-id-check.md). # Bank ID Check Bank ID Check lets you confirm the ownership of a bank account, account number, IBAN and type of account complying with the revised Payment Service Directive (PSD2). ### Bank ID Check data The Check product exposes account ownerships.
#### Check account We provide a view of the bank account of a user with \[/account\\\_ownerships endpoint\](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships): \`\`\` GET /users/me/account\_ownerships GET /users/me/connections/{connectionId}/account\_ownerships \`\`\` \`\`\`json { "account\_ownerships": \[\ {\ "id\_account": 12345,\ "id\_connection": 1234,\ "id\_user": 123,\ "id\_connector\_source": 1234,\ "name": "Compte de dépôt",\ "usage": "PRIV",\ "bank\_name": "Bank",\ "multiple\_holders": "null",\ "calculated": \[\],\ "parties": \[\ {\ "role": "holder",\ "identity": {\ "is\_user": true,\ "full\_name": "DOE John"\ }\ },\ ...\ \],\ "identifications": \[\ {\ "scheme\_name": "iban",\ "identification": "FR1221954549412158521"\ },\ ...\ \]\ }\ \], "total": 1 } \`\`\` Check account is linked to a \*connection\* (they are deleted with the connection). \*\*Ownership certificate\*\* The same ownership data can be delivered as a PDF certificate, intended to be handed to a third party as proof that the account data was legitimately obtained. It attests that the end user consented on a given date, and lists the accounts they hold. \`\`\` GET /users/me/connections/{connectionId}/certificate \`\`\` See \[Account ownership certificate\](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate) for the configuration keys, the certificate content and the error cases. --- # 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://docs.powens.com/documentation/integration-guides/bank-id-check.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector.md). # Validating your implementation with the test connector In this guide, we will use the test connector to validate our implementation. In order to validate your implementation, you can use the test connector which you can enable on your sandbox domain, with the UUID \`338178e6-3d01-564f-9a7b-52ca442459bf\`. ## Formatting the label With this institution, you can simulate various scenarios, depending on the label of the first instruction in the payment. The label resembles this: \`\`\` pdng/done - My payment label \`\`\` The payment states are described on the left of the first found caret (\`-\`), separated from each other by slashes (\`/\`). In the provided example, assuming the payment is a single "first open day" payment, once validated, it will be \`"pending"\` for 15 minutes, then \`"done"\`. A scenario can have up to 3 different states, for which the possible values are the following: \* \`pdng\`: pending. \* \`canc\`: rejected (by the end user). \* \`rjct\`: rejected (by the bank, generic). \* \`err\`: rejected (by the bank, for an invalid amount). \* \`bug\`: an error will have occurred during the payment initiation. \* \`done\`: done. If no final state is provided, the final state will be \`"done"\`. Example scenarios are: \* \`pdng/pdng/done\`: the payment will be pending execution during 30 minutes, before done. \* \`pdng/rjct\`: the payment will be pending execution during 15 minutes, before being rejected for a generic reason. \* \`err\`: the payment will be rejected by the bank for an invalid amount. ## Create a first open day payment with the test connector Here, we will create a first open day that will be \`pending\` then \`done\`. Note that this is a partial reprisal of \[Initiating a one-time payment with the Webview\](/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md). ### Obtain a token suitable for creating payments In order to create payments, we need a special access token with the \`payments:admin\` scope, obtained using client credentials: \`\`\` POST /auth/token \`\`\` \`\`\`json { "grant\_type": "client\_credentials", "client\_id": "{clientId}", "client\_secret": "{clientSecret}", "scope": "payments:admin", } \`\`\` \`\`\`json { "token": "{accessToken}", "scope": "payments:admin" } \`\`\` ### Create the first open day payment You can now create a payment request with the following request: \`\`\` POST /payments \`\`\` \`\`\`json { "uuid": "338178e6-3d01-564f-9a7b-52ca442459bf", "use\_case\_pay": "legacy", "client\_redirect\_uri": "{redirectURL}", "client\_state": "{optionalRedirectState}", "instructions": \[\ {\ "label": "pdng/done - ABC001 ACME PURCHASE",\ "amount": 12.34,\ "currency": "EUR",\ "execution\_date\_type": "first\_open\_day",\ "beneficiary": {\ "scheme\_name": "iban",\ "identification": "FR76XXXXXXXXXXXXXXX",\ "label": "ACME Corp.",\ },\ "beneficiary\_identity": {\ "kind": "corporate",\ "org\_name": "ACME Corp.",\ "org\_legal\_status": "SARL",\ "scheme\_name": "siren",\ "identification": "012345678"\ },\ }\ \], "payer\_identity": { "kind": "individual", "first\_name": "Germaine", "last\_name": "Michu", "birth\_date": "1963-01-01", "birth\_city": "Paris", "birth\_country": "FR", "nationality": "French" }, … } \`\`\` \`\`\`json { "id": {paymentId}, "state": "created", "error\_code": null, "error\_description": null, … } \`\`\` Now we have the payment identifier, in order to validate it, we must create a webview URL and send our PSU on it. ### Obtain the payment validation token As in the original guide, we get a token suitable for payment validation here: \`\`\` POST /payments/{paymentId}/scopedtoken Authorization: Bearer {accessToken} \`\`\` \`\`\`json { "scope": \["payments:validate"\] } \`\`\` \`\`\`json { "token": "{scopedAccessToken}", "scope": "payments:validate", "expires\_in": 604800, "id\_payment": {paymentId} } \`\`\` ### Build the payment validation URL Now that you have the payment validation token, you can create the webview URL by taking the webview URL and adding the following parameters to it: \* \`client\_id\`: the client identifier for your application (\`clientId\`). \* \`redirect\_uri\`: the same redirect URL you've used when creating the payment (\`redirectURL\`). \* \`state\`: the same state you've used when creating the payment (\`optionalRedirectState\`). \* \`code\`: The scoped token you've generated on your previous request to the API. \* \`payment\_id\`: the identifier of the payment. This will make you obtain an URL of the form: \`\`\` https://{domain}.biapi.pro/2.0/auth/webview/{lang}/payment?client\_id={clientId}&redirect\_uri={redirectURL}&state={optionalRedirectState}&code={scopedAccessToken}&payment\_id={paymentId} \`\`\` You can redirect your payer to this URL. ### Receive the callback from the payer Once the payer has either completed the payment validation flow, they will arrive on the callback URL you have configured on the payment with the following parameters: \* \`state\`: the optional client state you have configured on the payment, i.e. \`{optionalClientState}\`. \* \`id\_payment\`: the identifier of the payment that the user comes from. \* \`payment\_state\`: the state of the payment, set to \`"pending"\` here. If your implementation is correct, following this callback, you should directly use the \`GET /payments/{id}\` endpoint, with the identifier of the payment, to get the current state of the payment, which is indeed \`"pending"\`. See \[API endpoints\](https://docs.powens.com/api-reference/products/payments/payments#api-endpoints) for more information. For more details on these parameters, see \[Receive the callback from the payer\](/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md#receiving-a-callback-from-the-payer) in the original guide. ### Receive webhook events regarding the payment's state After approximately 15 minutes, you will receive a \`"PAYMENT\_STATE\_UPDATED"\` webhook event advertising that the payment is now "done", with the full data regarding the payment. {% hint style="info" %} You can test behaviours with shorter intervals using \`"instant"\` payments; every phase with such payments last 15 seconds instead of 15 minutes, so your payment will have reached its final state within about one minute. {% endhint %} During and after the initiation of a payment, you may want to check on the status of a payment, or to get data back from the payment initiation request. For more information, see \[Webhooks\](https://docs.powens.com/api-reference/products/payments/payments#webhooks) in the Payments API reference. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector.md?ask=&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. --- # Bank accounts | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts.md) . API endpoints[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#api-endpoints) ------------------------------------------------------------------------------------------------------------- Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _user token_. List bank accounts[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#list-bank-accounts) ----------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/accounts` #### Path Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. #### Query Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#query-parameters) Name Type Description all Value-less Flag to access disabled accounts. 200: OK List of bank accounts Response body: [BankAccountsList object](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountslist-object) Filtering route alias: Copy /users/{userId}/connections/{connectionId}/accounts Get a bank account[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#get-a-bank-account) ----------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/accounts/{accountId}` Get a single bank account by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#path-parameters-1) Name Type Description accountId\* Integer ID of the bank account. userId\* Integer or "me" ID of the related user. 200: OK Bank account details Response body: [BankAccount object](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccount-object) Bank account ressources partially support an update operation to handle activation/deactivation, or to override some display-related properties of accounts: Update a bank account[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#update-a-bank-account) ----------------------------------------------------------------------------------------------------------------------------- `POST` `https://{domain}.biapi/pro/2.0/users/{userId}/accounts/{accountId}` Update a single bank account by ID. Request body: [BankAccountUpdateRequest object](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountupdaterequest-object) #### Path Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#path-parameters-2) Name Type Description accountId\* Integer ID of the bank account. userId\* Integer ID of the related user. #### Query Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#query-parameters-1) Name Type Description all Value-less Add this flag to access a disabled bank accounts. 200: OK Bank account updated Response body: [BankAccount object](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccount-object) Life cycle[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#disabled-accounts) -------------------------------------------------------------------------------------------------------------- ### Activation[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#activation) Bank accounts can be in a disabled or enabled state. For legal compliance, accounts are disabled by default. Also, disabling account will result in the deletion of account child resources (transactions, investments, market orders, balances). #### Querying[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#querying) Disabled accounts will only appear when passing the `all` parameter: Copy GET /users/{userId}/accounts/{id}?all GET /users/{userId}/connections/{connectionId}/accounts/{id}?all #### Enabling[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#enabling) To enable one such account, it is necessary to perform a `POST` request on that account, with the `all` parameter and `{ "disabled": false }`. Please note that this action represents the PSU's consent. Webhooks[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#webhooks) --------------------------------------------------------------------------------------------------- ### Accounts fetched[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#accounts-fetched) An `ACCOUNTS_FETCHED` webhook is emitted during a sync after bank accounts have been synchronized, but before the transactions are processed. Webhook request : Property Type Description `user` _User_ object The user related to the sync. `connection` _Connection_ object Connection. `connection .connector` _Connector_ object The connector associated with the connection. `connection .sources` Array of _ConnectionSource_ objects The activated connections sources that were synced. `connection .accounts` Array of [_BankAccount_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccount-object) objects The activated bank accounts sources that were synced. ### Accounts synced[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#accounts-synced) An `ACCOUNT_SYNCED` webhook is emitted during a sync after a bank account was processed, including new transactions. Webhook request: [_BankAccount_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccount-object) object with the following additional properties: Property Type Description `investments` Array of [_Investment_](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investment-object) objects The new investments that were found. `investments[] .pockets` Array of [_Pocket_](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocket-object) objects On each `investment` item, the new pockets that were found. `~recipients~` Array of _Recipient_ objects _(Deprecated)_ The new recipients that were found (for transfer usage). `transactions` Array of [_Transaction_](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transaction-object) objects The new transactions that were found. `~transfers~` Array of _Transfer_ objects _(Deprecated)_ The new transfers that were found. ### Account categorized[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-categorized) An `ACCOUNT_CATEGORIZED` webhook is emitted during a sync after bank accounts have been synchronized, and after the transactions are processed. Property Type Description `transactions` Array of [_Transaction_](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transaction-object) objects The new transactions that were found. ### Account disabled[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-disabled) An `ACCOUNT_DISABLED` webhook is emitted after a bank account was disabled. The `disabled` property in the request contains the deactivation date. Webhook request: _BankAccount_ object ### Account enabled[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-enabled) An `ACCOUNT_ENABLED` webhook is emitted after a bank account was enabled. The `disabled` property in the request will be `null`. Webhook request: _BankAccount_ object ### Account found[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#account-found) An `ACCOUNT_FOUND` webhook is emitted after a **new** bank account was discovered. The account is `disabled` by default. Webhook request: Property Type Description `id` Integer ID of the bank account. `id_user` Integer ID of the related user. `id_connection` Integer ID of the related connection. `disabled` DateTime New accounts are disabled by default, so the property is set to the discovery date. `type` [_AccountTypeName_](https://docs.powens.com/api-reference/products/data-aggregation/bank-account-types#accounttypename-values) _string_ Technical code of the account type. Data model[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#data-model) ------------------------------------------------------------------------------------------------------- ### _BankAccountsList_ object[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountslist-object) Property Type Description `accounts` Array of [_BankAccount_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccount-object) objects List of bank accounts. `balances` Object Associative map of ISO currency codes to the total balance (decimal number) of accounts in the given currency. `coming_balances` Object Associative map of coming balances. ### _**BankAccount**_ **object**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccount-object) Property Type Description `id` Integer ID of the bank account. `id_connection` Integer or null ID of the related connection. `id_user` Integer or null ID of the related user. `id_source` Integer or null ID of the related connection source. `id_parent` Integer or null ID of the parent account. `number` String or null Account number. `original_name` String Original name of the account, as seen on the bank. `balance` Decimal or null Balance of the account. `coming` Decimal or null Amount of coming operations not yet debited. `display` Boolean Whether the bank account should be presented. `last_update` DateTime or null Last successful update of the account. `deleted` DateTime or null If set, this account is not found on the website anymore. `disabled` DateTime or null If set, this account has been disabled by user and will not be synchronized anymore. `iban` String or null Account IBAN. `currency` [_Currency_](https://docs.powens.com/api-reference/products/data-aggregation/currencies#currency-object) object or null Account currency. `type` [_AccountType_](https://docs.powens.com/api-reference/products/data-aggregation/bank-account-types#accounttype-object) object Technical code of the account type. `id_type` Integer ID of the account type. `bookmarked` Integer This account has been bookmarked by user. `name` String The name of the account. `error` String or null If the last update has failed, the error code. `usage` [_BankAccountUsage_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountusage-values) string Account usage. If not overridden, the value of `original_usage` is returned. `~ownership~` [_BankAccountOwnership_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountownership-values) string or null _(Deprecated)_ Relationship between the credentials owner and the account. `company_name` String or null Name of the company holding the employee savings of the account. `loan` [_Loan_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#loan-object) object or null For `loan` accounts, the loan details. **Available expands** The following parameters can be used for response properties expansion: Property Type Description `connection` [_Connection_](https://docs.powens.com/api-reference/user-connections/connections#connection-object) object The connection associated with this bank account. ### _**BankAccountUsage**_ **values**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountusage-values) Value Description `PRIV` Private account. `ORGA` Professional account. `null` No usage detail. Forward compatibility requirement: additional usages may be added in the future. When implementing usage handling, always fallback to a generic case for unknown values. ### _**BankAccountOwnership**_ **values (deprecated)**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountownership-values-deprecated) Value Description `owner` Account holder. `co-owner` Holder on a joint account. `attorney` Account authorized agent. Forward compatibility requirement: additional ownership values may be added in the future. When implementing ownership handling, always fallback to a generic case for unknown values. ### _**Loan**_ **object**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#loan-object) Property Type Description `total_amount` Decimal or null Total amount of the loan. `available_amount` Decimal or null Amount of the loan not yet released and still available. `used_amount` Decimal or null Amount of the load already used. `subscription_date` Date or null Subscription date of the loan. `maturity_date` Date or null Estimated end date of the loan. `start_repayment_date` Date or null When starts the repayment of the loan. In case of deferred loans, some fees could be payed by the borrower before the first repayment term planned at this `start_repayment_date`. `deferred` Boolean or null (beta) True if loan repayment has not yet begun. `next_payment_amount` Decimal or null Amount of the next payment. `next_payment_date` Date or null Date of the next payment. `rate` Decimal or null Rate of the loan. `nb_payments_left` Integer or null Number of payments still due. `nb_payments_done` Integer or null Number of payments done. `nb_payments_total` Integer or null Total number of payments. `last_payment_amount` Decimal or null Amount of the last payment. `last_payment_date` Date or null Date of the last payment. `account_label` String or null Name of the debited account. `insurance_label` String or null Label of the insurance. `insurance_amount` Decimal or null Amount of the loan's insurance. `insurance_rate` Decimal or null Rate of the insurance (between 0 and 1). `duration` Integer or null Duration of the loan, in months. `type` String Type of the loan: `mortgage`, `consumercredit, revolvingcredit` or `loan` (by default). ### _BankAccountUpdateRequest_ object[](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountupdaterequest-object) Name Type Required Description `display` Boolean No Whether the bank account should be displayed and included in aggregated metrics. `name` String No Display name of the account. `disabled` Boolean No Whether the bank account should be synchronized. `bookmarked` Boolean No Whether the bank account is bookmarked. `usage` [_BankAccountUsage_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountusage-values) string No Account usage. [PreviousDATA AGGREGATION](https://docs.powens.com/api-reference/products/data-aggregation) [NextBank transactions](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions) Last updated 6 months ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced.md). # Advanced Advanced guides for the Pay product. In this sub-section, you will find guides that may not be relevant to your use case, or to your authorizations. Required privileges and targeted needs are present at the top of each guide. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically.md). # Listing connectors with Pay by Bank enabled programmatically In this guide, we will list connectors programmatically. You can list enabled connectors with support for the Pay by Bank product on your domain by making an API call, which is mostly useful when getting the available connector list programatically. See below on how to make such a call. In order to obtain such connectors programmatically from your domain, you can query the whole list and filter the results for connectors which \`products\` contains \`"pay"\`: \`\`\` GET /connectors \`\`\` \`\`\`json { "connectors": \[\ {\ "id": 40,\ "name": "Connecteur de test",\ "products": \[\ "bank",\ "pay",\ "wealth"\ \],\ "payment\_settings": {\ "available\_validate\_mechanisms": \[\ "webauth"\ \],\ "beneficiary\_types": \[\ "iban"\ \],\ "execution\_date\_types": \[\ "first\_open\_day",\ "instant",\ "deferred"\ \],\ "execution\_frequencies": \[\ "two-monthly",\ "semiannually",\ "weekly",\ "yearly",\ "four-monthly",\ "daily",\ "quarterly",\ "biannual",\ "bimonthly",\ "two-weekly",\ "monthly"\ \],\ "maximum\_number\_of\_instructions": 10,\ "providing\_payer\_account": "optional"\ },\ …\ },\ …\ \] } \`\`\` Connectors supporting the Pay by Bank product will define a \`payment\_settings\` object, which present Pay by Bank constraints and features for this specific connectors. For more information on the format of this object, e.g. if you only want connectors that support instant payments, see \[PaymentSettings\](https://docs.powens.com/api-reference/user-connections/connectors#paymentsettings-object). --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/listing-connectors-with-pay-by-bank-enabled-programmatically.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval.md). # Proof & Certificates Retrieval This section guides you on how to interact with our API to access bills and various documents of your users. You must have followed the steps in “\[Add a first user and connection\](/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md)” section. ### Billing data The Proof & Certificates Retrieval product exposes subscriptions and documents.
A "subscription" is a document container or group. The purpose may vary by connector, for example to isolate documents linked to a contract. When it is not relevant for a connector, we still simulate a single subscription matching the user account using profile information if available. For bank websites where we can return a RIB and statement documents, we create one subscription per bank account. #### Subscriptions We provide a view to the subscriptions of a user with \[\`/subscriptions\` endpoints\](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions): \`\`\` GET /users/me/subscriptions GET /users/me/connections/{connectionId}/subscriptions \`\`\` \`\`\`json { "subscriptions": \[\ {\ "id": 12345,\ "label": "Contrat EZ4225",\ "number": "EZ42250022314",\ "subscriber": "Mr John Doe",\ …\ },\ …\ \] } \`\`\` Subscriptions are linked to a \*connection\* (they are deleted with the connection). {% hint style="info" %} The subscriptions list reflect the set of subscriptions found when synchronizing with a provider, using a safe archiving rule: \* when a new subscription is discovered, it is added; \* when a subscription is no more found, it is marked with a \[\`deleted\` flag\](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#get-a-subscription) and is not listed by default, but it can still be accessed by its ID or with the \[\`?all\` parameter\](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#list-subscriptions). {% endhint %} #### Documents We provide a view to the set of documents of a user with \[\`/documents\` endpoints\](https://docs.powens.com/api-reference/products/documents-aggregation/documents): \`\`\` GET /users/me/documents GET /users/me/subscriptions/{subscriptionId}/documents \`\`\` \`\`\`json { "documents": \[\ {\ "id": 56789,\ "name": "Facture Acme 023315",\ "type": "bill",\ "rdate": "2020-08-27",\ "url": "https://…",\ "thumb\_url": "https://…",\ …\ },\ …\ \], "first\_date": "2017-02-14", "last\_date": "2020-09-15", "result\_min\_date": "2020-08-30", "result\_max\_date": "2020-09-30" } \`\`\` Documents are linked to a \*subscription\* (they are deleted with the subscription). We provide access to raw files of documents with the \`url\` property, when such files are available on the website.\\ The file format depends on the connector: most websites provide PDF files, if they don't we expose HTML files. {% hint style="info" %} You can enable the \`force\_pdf\` \[configuration key\](https://docs.powens.com/api-reference/api-setup/configuration) in your API to always generate a PDF version of files.\\ Please note that this configuration takes effect on synchronization only and is not retroactive: any change will only apply to newly-discovered documents. {% endhint %} ### Captcha Some websites ask for a captcha, especially for bills. Our system is able to resolve them for you automatically, but this feature is disabled by default. You can enable it by setting the \`captcha.enabled\` \[configuration key\](https://docs.powens.com/api-reference/api-setup/configuration) to 1. \`captcha.enabled\` is set to 0 by default. If this key is disabled and the website requires captcha resolution, your connection will fall into the \`websiteUnavailable\` \[state\](https://docs.powens.com/api-reference/user-connections/connections#connectionstate-values). Our resolution system may fail to resolve a captcha for various reasons. As a result the connection would also fall into the \`websiteUnavailable\` \[state\](https://docs.powens.com/api-reference/user-connections/connections#connectionstate-values), but our background workers will automatically retry later. We don’t provide a list of websites asking for a captcha since it is subject to change frequently. --- # 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://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval.md?ask=&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. --- # Bank transactions | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions.md) . API endpoints[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#list-transactions) --------------------------------------------------------------------------------------------------------------------- Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _user token_. List bank transactions[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#list-bank-transactions) ----------------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/transactions` List bank transactions of the authenticated user. By default, only active (not `deleted`) transactions are returned, use the `all` parameter to get the full list. #### Path Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. #### Query Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#query-parameters) Name Type Description all Value-less Flag to include deleted transactions. limit\* Integer Number of transactions to return. The maximum value is 1000. income Boolean Filter on incomes or expenditures. deleted Boolean Filter on deleted transactions. filter String Name of the field to use for explicit filtering: `application_date` (default) or `date`. min\_date Date or Month Minimum date of the filtering field. max\_date Date or Month Maximum date of the filtering field. wording String Filter transactions containing the given string. min\_value Decimal Minimal (inclusive) value. max\_value Decimal Maximum (inclusive) value. search String Search in wording, dates, values, categories. value Decimal or String Value of the transaction. "XX|-XX" and "±XX" format is also accepted. last\_update DateTime Filter transactions updated **after** the specified date. 200: OK List of transactions 409: Conflict No bank account is activated Response body: [TransactionsList object](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transactionslist-object) Response body: [Error object](https://docs.powens.com/api-reference/overview/errors#error-response) with `noAccount` code Listing bank transactions requires [explicit pagination](https://docs.powens.com/api-reference#lists-pagination) (i.e. the `limit` parameter is required). Also, this endpoint provides [relational pagination](https://docs.powens.com/api-reference#relational-pagination) . Route aliases Copy /users/{userId}/transactions /users/{userId}/accounts/{accountId}/transactions Get a bank transaction[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#get-a-bank-transaction) ----------------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/transactions/{transactionId}` Get a single bank transaction by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#path-parameters-1) Name Type Description userId\* Integer or "me" ID for the related user. transactionId\* Integer ID of the transaction. 200: OK Transaction Response body: [Transaction object](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transaction-object) Transactions partially support updates to override some display-related properties: Update a bank transaction[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#update-a-bank-transaction) ----------------------------------------------------------------------------------------------------------------------------------------- `POST` `https://{domain}.biapi.pro/2.0/users/{userId}/transactions/{transactionId}` Update metadata of a single bank transaction by ID. Request body: [TransactionUpdateRequest object](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transactionupdaterequest-object) #### Path Parameters[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#path-parameters-2) Name Type Description userId\* Integer or "me" ID for the related user. transactionId\* Integer ID of the transaction. 200: OK Updated transaction Response body: [Transaction object](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transaction-object) Data model[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#data-model) ----------------------------------------------------------------------------------------------------------- ### _**TransactionsList**_ **object**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transactionslist-object) Property Type Description `transactions` Array of [_Transaction_](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transaction-object) objects List of transactions. `first_date` Date Minimum available date for results. `last_date` Date Maximum available date for results. `result_min_date` Date Minimum date of results in the current response. `result_max_date` Date Maximum date of results in the current response. `_links` [_PaginationLinks_](https://docs.powens.com/api-reference#paginationlinks-object) object Opaque links to the current, previous and next pages in the collection. ### _**Transaction**_ **object**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transaction-object) Property Type Description `id` Integer ID of the transaction. `id_account` Integer ID of the related account. `application_date` Date or null Date considered by PFM services. This date can be edited. `date` Date Date when the transaction is posted to the account. `datetime` DateTime or null Date and time when the transaction is posted to the account, if available, in UTC. `vdate` Date or null Value date of the transaction. In most cases, equivalent to `date`. `vdatetime` DateTime or null Value date and time of the transaction, if available, in UTC. In most cases, equivalent to `datetime`. `rdate` Date Date when the transaction order has been given. `rdatetime` DateTime or null Date and time when the transaction order has been given, if available, in UTC. `~bdate~` Date or null _(Deprecated)_ Date displayed by the bank for the transaction. Use `date` instead. `~bdatetime~` DateTime or null _(Deprecated)_ Date and time displayed by the bank for the transaction, if available, in UTC. Use `datetime` instead. `value` Decimal or null Value of the transaction. `gross_value` Decimal or null Gross value of the transaction. `type` [_TransactionType_](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transactiontype-values) string Type of transaction. `original_wording` String Full label of the transaction, as seen on the bank. `simplified_wording` String Simplified label of the transaction. `wording` String or null Label of the transaction, can be edited. `categories` Array Array of category objects associated with the transaction. Each category object includes `code` and its `parent_code`. See [category object](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#category-object) . `date_scraped` DateTime Date and time when the transaction was seen. `coming` Boolean If true, this transaction has not yet been posted to the account. `active` Boolean If false, PFM services will ignore this transaction. `id_cluster` Integer or null If the transaction is part of a cluster. `comment` String or null User comment. `last_update` DateTime or null Last update of the transaction. `deleted` DateTime or null If set, this transaction has been removed from the bank. `original_value` Decimal or null Value in the original currency. `original_gross_value` Decimal or null Gross value in the original currency. `original_currency` [_Currency_](https://docs.powens.com/api-reference/products/data-aggregation/currencies#currency-object) or null Original currency. `commission` Decimal or null Commission taken on the transaction. `commission_currency` [_Currency_](https://docs.powens.com/api-reference/products/data-aggregation/currencies#currency-object) or null Commission currency. `~country~` String or null _(Deprecated)_ Original country. `card` String or null Card number associated with the transaction. `counterparty` [_Counterparty_](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#counterparty-object) or null The transaction counterparty, i.e. an optional business or individual entity associated with the transaction. #### **Available expands**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#available-expands) The following parameter can be used for [response properties expansion](https://docs.powens.com/api-reference#responses-expansion) : Property Type Description `attachments` Array of [Attachment objects](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#attachment-object) The attachments related to a transaction. `categories` An array of objects [The codes associated with the transaction.](https://docs.powens.com/api-reference/products/data-aggregation/categorization) ### _**TransactionType**_ **values**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transactiontype-values) Value Description `transfer` Transfer `order` Order `check` Check `deposit` Mandatory/voluntary deposits, contributions, money transfers `payback` Payback `withdrawal` Withdrawal `loan_repayment` Loan payment `bank` Bank fees `card` Card operation `deferred_card` Deferred card operation `summary_card` Monthly debit of a deferred card `unknown` Unknown transaction type `market_order` Market order `market_fee` Fees regarding a market order `arbitrage` Arbitrage `profit` Positive earnings from interests/coupons/dividends `refund` With opposition to a `payback`, a `refund` has a negative value `payout` Transfer from the e-commerce account (eg; Stripe) to the bank account `payment` Payment made with a payment method different from card `fee` Differs from `bank` type because it considers only tax/commission Forward compatibility requirement: additional types may be added in the future. When implementing type handling, always fallback to a generic case for unknown values. ### _**Category**_ **object**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#category-object) Property Type Description `code` String Label of the children category _(part of_ [Categories](https://docs.powens.com/api-reference/products/data-aggregation/categorization#categories) _)_ `parent_code` String or null Label of the parent category _(part of_ [Categories](https://docs.powens.com/api-reference/products/data-aggregation/categorization#categories) _)_ ### _**Counterparty**_ **object**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#counterparty-object) Property Type Description `label` String or null Label/name of the counterparty. `account_scheme_name` [_AccountSchemeName_](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#accountschemename-values) string or null Type of the counterparty account number. `account_identification` String or null Account number of the counterparty. `type` String or null Type of the counterparty: `creditor` or `debtor`. ### _**AccountSchemeName**_ **values**[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#accountschemename-values) Value Description `iban` International Bank Account Number. `bban` Basic Bank Account Number. `sort_code_account_number` United Kingdom local account number. `cpan` Card PAN. `tpan` Token which was provided by a Token Service Provider (TSP) in order to obfuscate a real card PAN. ### _TransactionUpdateRequest_ object[](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#transactionupdaterequest-object) Property Type Required Description `wording` String No New wording of the transaction. `application_date` Date No New application date of the transaction. `categories` Integer No Array of category objects associated with the transaction. Each category object includes `code` and its `parent_code`. See [category object](https://docs.powens.com/api-reference/products/data-aggregation/bank-transactions#category-object) . `comment` String No New comment of the transaction. `active` String No If false, the transaction is not considered in balance summaries and sums. [PreviousBank accounts](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts) [NextTransactions attachments](https://docs.powens.com/api-reference/products/data-aggregation/transactions-attachments) Last updated 6 months ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually.md). # Confirming payments manually For some connectors, it may be possible to have control over the payment confirmation process. This is useful if you want to check that the user is the same at both the beginning and end of the payment validation process, or in some cases, if the updated payment object still corresponds to what you expect. Note that the confirmation phase of a payment's validation is typically very short, and in most cases, an answer is expected \*\*within a minute\*\*, or the payment validation is likely to expire. ## Disable automatic payment confirmation By default, your domain automatically confirms payments if necessary. In order to disable this behaviour, you can set the \`payment.auto\_confirmation\` setting to \`"0"\`, with the following request: \`\`\` POST /config \`\`\` \`\`\`json { "payment.auto\_confirmation": "0" } \`\`\` ## Detect if a payment validation requires confirmation When receiving a callback from the payer (for example, \[here\](/documentation/integration-guides/pay-by-bank/initiating-a-one-time-payment-with-the-webview.md#receive-a-callback-from-the-payer) with one-time payments), you need to poll the payment status. A payment currently awaiting confirmation will have the \`validating\` status with the \`confirm\` action, as in the following example: \`\`\` GET /payments/123 \`\`\` \`\`\`json { "id": 123, "state": "validating", "action": "confirm", ... } \`\`\` At this stage, you must run your checks and either confirm or deny the payment. ## Confirm a payment validation To confirm the payment, the following request can be made: \`\`\` POST /payments/123 \`\`\` \`\`\`json { "confirm": true } \`\`\` ## Deny a payment validation To deny the payment, the following request can be made: \`\`\` POST /payments/123 \`\`\` \`\`\`json { "confirm": false } \`\`\` This changes the payment \`state\` to \`rejected\`, and if no other error has occurred (such as the payment confirmation request being expired), the \`error\_code\` will be set to \`confirmationRefused\`. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-manual-expiration-time.md). # Changing the manual expiration time Make your payments expire either faster or slower! Every Pay by Bank domain defines a number of days after which, if a payment is still \`pending\`, its state will be changed to \`expired\`. This information is stored in the configuration, and is set to 30 days by default. In order to change it to e.g. 7 days, you can do the following call using a config or administration token: \`\`\` POST /config \`\`\` \`\`\`json { "payment.manual\_expire\_time\_days": "7" } \`\`\` --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-manual-expiration-time.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-maximum-amounts-for-payments.md). # Changing the maximum amounts for payments Place a hard limit on your created payment requests, to mitigate attacks! You can set the maximum amount for payments you create on the APIs, e.g. for security reasons. This information is stored in the configuration, and adopts the limitation of the environment by default, i.e. 10€ for sandboxes, and unlimited in production. In order to change it to e.g. 20€ in production, you can do the following call using a config or administration token: \`\`\` POST /config \`\`\` \`\`\`json { "payment.max\_amount": "20" } \`\`\` {% hint style="warning" %} If you set a limit of 20€ on a sandbox domain through this configuration variable, the limitation to 10€ applied to all sandbox domains will still apply first, so it will be impossible to create 15€ payments for example. {% endhint %} --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/changing-the-maximum-amounts-for-payments.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview.md). # Implementing your own payment validation webview In this guide, once the payment has been created on the API, we will validate it without using Powens' Webview. {% hint style="danger" %} \*\*This guide assumes you are authorized to implement your own webview\*\*. If you don't know whether you are or not, ask your commercial contact about it. {% endhint %} {% hint style="info" %} This guide assumes that you have the following elements: \* A Powens domain with Pay by Bank enabled. \* A payment, regardless of its type, with the \`"created"\` status. {% endhint %} A payment validation webview must be isolated, with a defined role and behaviour whatever its design integration is. This role is described here, through specific steps and conditions the webview must traverse to validate the current operation on a payment. {% @mermaid/diagram content="sequenceDiagram participant u as End User participant w as Webview participant a as API \`\`\` w->>a: Get payment status a->>w: Provide the payment status alt Payment state is "created" alt Connector is unset on payment w->>a: Get eligible connectors a->>w: Provide eligible connectors w->>u: Display eligible connectors u->>w: Pick connector else w->>a: Get connector information a->>w: Provide connector information end w->>w: Pick a validation mechanism for the connector alt Validation mechanism is not webauth and not white label w->>a: Set the connector to the payment a->>w: Acknowledge connector setting break Validation on webview stops w->>u: Redirect to Powens' webview end end alt Not white label w->>a: Check payment terms a->>w: Provide the payment terms status alt Terms are not accepted w->>a: Get terms a->>w: Provide terms w->>u: Display terms u->>w: Accept terms w->>a: Accept terms a->>w: Signal successful acceptation of terms end end w->>a: Request payment fields for connector a->>w: Provide payment fields for connector alt Fields are required w->>u: Request values for fields u->>w: Provide values for fields end alt Payer is required w->>u: Request account identification for payer u->>w: Provide account identification for payer end w->>a: Validate the payment with additional fields a->>w: Signal successful validation for the payment end loop Interactive steps are required alt Current step is redirect w->>u: Redirect the end user to the redirect URL u->>w: Return from redirect URL w->>a: Request payment status a->>w: Provide payment status end alt Current step is decoupled w->>u: Warn the end user par u->>u: Validate the decoupled challenge and loop Current step is decoupled w->>w: Wait for 5 seconds w->>a: Request payment status a->>w: Provide payment status end end end alt Current step is additionalInformationNeeded w->>u: Request values for fields u->>w: Provide values for fields w->>a: Provide values for fields a->>w: Provide payment status end alt Current step is psuValidation w->>u: Request user validation alt User agrees u->>w: Provide validation w->>a: Provide user validation else u->>w: Provide denial w->>a: Provide user denial end a->>w: Provide payment status end end" %} \`\`\` ## Get the payment's current state At startup, the webview must get the current state of the payment: \* If the payment's state is \`created\`, then the webview can do the steps to \[validate the payment\](#validate-the-payment). \* If the payment's state is \`validating\` and the current action is \*\*not\*\* \`confirm\`, then the webview can continue to \[handle interactive steps\](#handle-interactive-steps). \* Otherwise, the payment is unsuitable for validation by the webview, and the end user should be redirected to the final redirect URL with a suitable state. Note that this request is also required to get other information regarding the payment, e.g. to determine the constraints applied to obtain eligible connectors. {% hint style="warning" %} \*\*The Pay by Bank API does not support changing webviews during a single payment validation flow.\*\* If the payment is already in the \`validating\` state, this guide assumes that the initiation payment validation was done by the same webview, and either the end user has reloaded the page (e.g. resumed the flow due to a client-side crash), or came back from a redirect flow with the bank. {% endhint %} ## Validate the payment This section is required if the payment is currently in the \`created\` state. Validating the payment is about placing it in a state where we have to answer interactive steps. In order to do this, we must prepare a few properties before validating the payment. ### Select a connector for the payment If the connector isn't set yet on the payment, i.e. if \`connector\_uuid\` is set to \`null\` on the current status of the payment, you need to pick a connector for the payment. In order to find available connectors for making payments, you need to make the following request: \`\`\` GET /connectors \`\`\` \`\`\`json { "connectors": \[\ {\ "id": 1234,\ "name": "Arkéa Banking Services",\ ...\ "payment\_settings": {\ "available\_validate\_mechanisms": \["webauth"\],\ ...\ }\ },\ ...\ \] } \`\`\` Connectors supporting the Pay by Bank product, identified by having \`"pay"\` in its \`products\` list, will define a \`payment\_settings\` object, which present Pay by Bank constraints and features for this specific connectors. \*\*You need to filter them on the client side, depending on the payment\*\*: \* The connector must have \`"pay"\` in its \`products\` list. \* The payment's number of instructions must be less or equal to \`maximum\_number\_of\_instructions\` from the connector's \`payment\_settings\`. \* For all instructions of the payment: \* The instruction's \`execution\_date\_type\` value must be present in the \`execution\_date\_types\` within the connector's \`payment\_settings\`. \* The instruction's scheme\\\_name from beneficiary value must be present in the connector's \`beneficiary\_types\` attribute in \`payment\_settings\`. \* If the instruction has an \`execution\_date\_type\` set to \`periodic\`, the \`frequency\` is present in \`execution\_frequencies\` from the connector's \`payment\_settings\`. Beyond these standard filters, you can also apply yours depending on your configuration: \* If you want to avoid having to ask the end user for their IBAN, you can avoid connectors with the \`providing\_payer\_account\` set to \`mandatory\`. \* If you want to avoid payments ending in the \`accepted\` state, you can ensure that every instruction has an execution date type that isn't included in the connector's \`partial\_status\_tracking\` list. {% hint style="info" %} If you want to get the top connectors for Pay by Bank in terms of number of payments in the last month, in case you want to display them on top, you can request such connectors with the following request: \`\`\` GET /connectors?top=10&top\_key=payments \`\`\` Note that this request may return less than the number of connectors specified in the \`top\` parameter, for example it may return 7 connectors if all payments created in the last month have been affected only 7 connectors out of all possible connectors. {% endhint %} ### Select a validation mechanism The connector you've chosen provides a given set of validation mechanisms, in the \`available\_validate\_mechanisms\` attribute of the \`payment\_settings\` at connector level. It is recommended to check which validation mechanisms you want to use at this stage. {% hint style="warning" %} If you're not a white label, you must either restrict the connector list to connectors bearing the \`webauth\` (or any mechanism starting with \`webauth\_\`) validation mechanism, or set the connector to the payment and redirect to Powens' webview, as you are not allowed to handle non-\`webauth\` validation mechanisms in your webview.\\ \\ Note that the procedure stops here if you redirect to Powens' webview at this stage. You are not to validate terms for the payment; Powens' webview will take care of this. {% endhint %} ### Validate terms for the payment {% hint style="warning" %} If you are a white label, this section is optional. {% endhint %} First, the terms of service must be accepted by the end user. In order to do so, you must do the following call: \`\`\` GET /payments/{paymentId}/terms \`\`\` {% tabs %} {% tab title="Terms of service have not been accepted yet" %} If the \`to\_sign\` attribute is \*\*both present and set to \`true\`\*\*, then the terms of service are to be accepted by the end user. \`\`\`json { "to\_sign": "true", ... } \`\`\` {% endtab %} {% tab title="Terms of service have been accepted" %} If the \`to\_sign\` attribute is \*\*either absent or set to \`false\`\*\*, then the terms of service have already been accepted. \`\`\`json { "id": 4, "version": "budgea-004", "created": "2019-08-02 16:57:16", "deleted": null, "id\_file": 5 } \`\`\` {% endtab %} {% endtabs %} If the terms of service have not been accepted yet, you can get the content to display to the end user by making the following request: \`\`\` GET /terms \`\`\` \`\`\`json { "terms": { "id": {idTerms}, ... }, "content": "Conditions générales d'utilisation de Budgea Bank & Pay & Bill...", "language": "fr" } \`\`\` In order to signify the acceptance of the terms of service for the payment by the end user, you can make the following request: \`\`\` POST /payments/{paymentId}/terms \`\`\` \`\`\`json { "id\_terms": {idTerms} } \`\`\` \`\`\`json { "success": "ok" } \`\`\` ### Prepare the expected fields In order to check if fields are to be sent to the connector, you need to get the connector fields by making the following request: \`\`\` GET /connectors/{connectorUUID}?expand=payment\_fields \`\`\` \`\`\`json { "id": 123, ... "payment\_fields": \[\ {\ "name": "website",\ "label": "Cas d'usage",\ "regex": null,\ "type": "list",\ "required": false,\ "auth\_mechanisms": \["webauth"\],\ "values": \[\ {\ "label": "Particuliers",\ "value": "par",\ },\ ...\ \]\ },\ ...\ \], ... } \`\`\` The website field should be requested from the end user if \[the validation mechanism chosen beforehand\](#select-a-validation-mechanism) is present in the \`auth\_mechanisms\` array in the field definition. {% hint style="danger" %} Regardless of whether you are a white label or not, \*\*you MUST use front encryption on all fields\*\* before transmitting them. See \[End-to-end encryption\](/documentation/integration-guides/advanced/end-to-end-encryption.md) for more information. {% endhint %} ### Prepare the payer account {% hint style="info" %} If the connector's UUID was already provided in the payment by the webview's client, you need to request the connector's information here by calling \`GET /connectors/{connectorUUID}\`. {% endhint %} If \`providing\_payer\_account\` in the connector's \`payment\_settings\` is set as \`mandatory\`, then the payer's identification must be requested from them. ### Send the validation request From the previous sections, you now have obtained the following information for validating the payment from the end user: \* The connector UUID (if it wasn't already set). \* The validate mechanism. \* The field values, passed through \[end-to-end encryption\](/documentation/integration-guides/advanced/end-to-end-encryption.md) (if at least one is set). \* The payer account identification (if it is required). \* The callback URL for \`redirect\` actions (as \`webview\_url\`). You must prepare a \`webview\_url\`, in order to redirect the end user back to your webview to continue the validation process for the payment after \`redirect\` actions. This URL can contain query parameters which will be included in the callback. {% hint style="warning" %} In case of multiple redirect steps, the end user will always be redirected to the same webview URL as provided in the validation request. Please ensure that you don't have nonces in said URL. {% endhint %} You can now validate the payment, in order to pass it from the \`created\` state to \`validating\`: \`\`\` POST /payments/{paymentId} \`\`\` {% tabs %} {% tab title="With all options" %} \`\`\`json { "connector\_uuid": "{connectorUUID}", "validate\_mechanism": "webauth", "fields": { "website": "eyJh..." }, "payer": { "scheme\_name": "iban", "identification": "FR76...", "label": "M. Jean DUPONT" }, "webview\_url": "https://example.org/payment-validation-webview?redirect\_url=...&state=123&id\_payment=456", "validated": true } \`\`\` {% endtab %} {% tab title="Connector already selected, no additional parameters" %} \`\`\`json { "validate\_mechanism": "webauth", "webview\_url": "https://example.org/payment-validation-webview?redirect\_url=...&state=123&id\_payment=456", "validated": true } \`\`\` {% endtab %} {% endtabs %} \`\`\`json { "id": {paymentId}, "state": "validating", ... } \`\`\` The payment is now initiated, and interactive steps need to be taken for the payment to be fully validated. ## Handle interactive steps Either after successfully validating a payment in the \`created\` state or resuming validation on a payment in the \`validating\` state, interactive steps need to be taken towards continuing the operation. The current validation step is represented by the \`action\` property of the payment. ### "redirect" action (redirect flow) This means that a redirect flow is to be accomplished by the end user. In this case, you must redirect the end user to the URL present in the \`validate\_uri\` attribute of the payment. {% hint style="warning" %} The URL \*\*MUST NOT\*\* be used in an iframe, only in full redirect, as it might be app-to-app compatible on mobile devices. {% endhint %} At the end of the redirect flow, the end user will be redirected back to the webview through the URL you've defined in the \`webview\_url\` attribute of the validation request. ### "decoupled" action (validation on other channel) This means that a validation has been requested through another channel, such as a notification in a mobile application, or a link sent by e-mail or SMS. In this case, you must inform the end user that the validation is taking place, then request a check on the decoupled validation status with a 10 second delay, using the following request: \`\`\` POST /payments/123 \`\`\` \`\`\`json { "resume": true } \`\`\` {% hint style="info" %} The 10 second timer should start \*\*after the response is received\*\*. For efficiency, some connectors may internalize part of the polling, which means the request defined above could take more than 10 seconds. {% endhint %} ### "additionalInformationNeeded" action (temporary values required) This means that an additional information is required from the end user, such as one-time passwords or the identifier of the account to select for the payment. In this case, you must get the list of fields to ask the end user. For example, the payment will resemble this: \`\`\`json { "id": 123, "state": "validating", "action": "additionalInformationNeeded", ..., "fields": \[\ {\ "name": "account\_id",\ "type": "list",\ "label": "Please choose your payment account",\ ...\ }\ \], ... } \`\`\` And, in order to submit the values picked by the end user back to the API, a request such as this one must be made: \`\`\` POST /payments/123 \`\`\` \`\`\`json { "fields": { "account\_id": "FR76..." } } \`\`\` ### "psuValidation" action (payment request summary suggested) This means that presenting a summary of the payment to the end user and letting them choose whether or not they want to pursue the validation flow is recommended at this point. This is mostly used when no redirect flow is available to do this, but a webview may emulate end user consent on such actions. In order to communicate that the end user consents to pursuing the validation flow, the following request should be made: \`\`\` POST /payments/123 \`\`\` \`\`\`json { "psu\_validate": true } \`\`\` If however, the end user chooses not to pursue the validation flow, the following request should be made: \`\`\` POST /payments/123 \`\`\` \`\`\`json { "psu\_validate": false } \`\`\` ### "confirm" action (client confirmation required) This means that payment validation confirmation is expected from the client. This must be considered as a \`"pending"\` payment state by the webview, which should redirect the end user to the client redirect URL and state. ## Validate your implementation with the test connector use cases Different use cases are provided with the test connector to trigger specific validation mechanisms during the validation process. This will allow you to verify that you have correctly implemented the different \[interactive steps\](#handle-interactive-steps). ### List all available use cases \`\`\` GET /connectors/338178e6-3d01-564f-9a7b-52ca442459bf?expand=payment\_fields \`\`\` \`\`\`json { "id": 59, "name": "Connecteur de test", ... "payment\_fields": \[\ ...\ {\ "name": "use\_case\_pay",\ "label": "Use case",\ "regex": null,\ "type": "list",\ "required": false,\ "auth\_mechanisms": \[\ "webauth"\ \],\ "connector\_sources": \[\ "openapi"\ \],\ "values": \[\ {\ "label": "Legacy (custom behaviour)",\ "value": "legacy"\ },\ {\ "label": "Webauth redirection",\ "value": "redirect"\ },\ {\ "label": "Decoupled with successful validation",\ "value": "decoupled"\ },\ {\ "label": "Decoupled with cancelled validation",\ "value": "decoupled\_cancelled"\ },\ {\ "label": "Decoupled with expired validation",\ "value": "decoupled\_expired"\ },\ {\ "label": "One time password (SMS)",\ "value": "otp\_sms"\ },\ {\ "label": "OTP + Decoupled",\ "value": "otp\_plus\_decoupled"\ },\ {\ "label": "Payment account choice",\ "value": "account\_choice"\ },\ {\ "label": "Webauth redirection without explicit confirmation",\ "value": "redirect\_no\_confirmation"\ }\ \]\ }\ \] \`\`\` {% hint style="info" %} The field \`openapiwebsite\` can be ignored when initiating payments. {% endhint %} ### How to initiate a payment with a use case In order to choose a use case for your payment on the test connector, you need to provide it as part of the \[expected fields\](#prepare-the-expected-fields). Here's an example of how to initiate a payment with the \`redirect\` use case. \`\`\` POST /payments/{payment\_id} \`\`\` \`\`\`json { "connector\_uuid": "338178e6-3d01-564f-9a7b-52ca442459bf", "validation\_mechanism": "webauth", "fields": { "use\_case\_pay": "redirect" }, "validated": true, "webview\_url": "{{webview\_url}}" } \`\`\` From there, the payment will follow a specific sequence of required actions from your part in order to be validated. In the following sections we will see the specifities of each available use case. ### "redirect" : Validating a payment with a single redirection Upon validation, the payment enters the \`validating\` state with a \`redirect\` action. The redirection URI is provided in the \`validate\_uri\` field. \`\`\` GET /payments/{payment\_id} \`\`\` \`\`\` { "id": {payment\_id}, "state": "validating", "action": "redirect", "validate\_uri": "https://biapi.pro/2.0/webauth/callback?state=...&authFactorValue=AUTHENTICATION\_VALIDATED", ... } \`\`\` You need to redirect the end user to the provided address, which will allow the payment to be validated and change its state to \`done\`. After which your end user would be redirected to \`webview\_url\`. ### "decoupled": Validating a payment with a decoupled authorization This use case will trigger a decoupled validation and ends with a payment in the state \`done\`. Upon validation, the payment enters the \`validating\` state with a \`decoupled\` action. The \`error\_description\` field contains an example description you could get from a real connector. You don't really have to validate the operation anywhere here, this is just an example for you to display in your validation webview. \`\`\` GET /payments/{payment\_id} \`\`\` \`\`\` { "id": {payment\_id}, "state": "validating", "action": "decoupled", "error\_description": "Please confirm the transaction in the phone app.", ... } \`\`\` From here you can poll the payment until its state changes to \`done\`. The validation takes approximately 10 seconds to occur. \`\`\` POST /payments/{payment\_id} \`\`\` \`\`\`json { "resume": true } \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "done", "action": null, ... } \`\`\` ### "decoupled\\\_cancelled": Validating a payment with a cancelled decoupled authorization This use case will trigger a decoupled validation and simulate a cancellation by the PSU in the decoupled channel. Upon validation, the payment enters the \`validating\` state with a \`decoupled\` action. \`\`\` GET /payments/{payment\_id} \`\`\` \`\`\` { "id": {payment\_id}, "state": "validating", "action": "decoupled", "error\_description": "Please confirm the transaction in the phone app.", ... } \`\`\` After approximately 10 seconds, the payment state will change to \`rejected\`, with the \`error\_code\` \`CancelledByUser\`. \`\`\` POST /payments/{payment\_id} \`\`\` \`\`\`json { "resume": true } \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "done", "action": null, "error\_code": "CancelledByUser", "error\_description": "The decoupled validation has been cancelled by the PSU ... } \`\`\` ### "decoupled\\\_expiration": Validating a payment with an expired decoupled authorization This use case will trigger a decoupled validation and simulate an expiration of the authorization process. Upon validation, the payment enters the \`validating\` state with a \`decoupled\` action. \`\`\` GET /payments/{payment\_id} \`\`\` \`\`\` { "id": {payment\_id}, "state": "validating", "action": "decoupled", "error\_description": "Please confirm the transaction in the phone app.", ... } \`\`\` After approximately 20 seconds, the payment state will change to \`rejected\`, with the \`error\_code\` \`authenticationFailed\`. \`\`\` POST /payments/{payment\_id} \`\`\` \`\`\`json { "resume": true } \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "rejected", "action": null, "error\_code": "authenticationFailed", "error\_description": "The decoupled validation has expired.", ... } \`\`\` ### "otp\\\_sms": Validating a payment with a one time password This use case will require the end user to input a one time password. Upon validation, the payment enters the \`validating\` state with an \`additionalInformationNeeded\` action. The one time password is requested in the \`fields\` key of the response. \`\`\` GET /payments/{{payment\_id}} \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "validating", "action": "additionalInformationNeeded", "fields": \[\ {\ "name": "openapisms",\ "type": "text",\ "label": "Please enter the one time password sent to phone number (+33)6 12 34 56 78 (code = 1234).",\ "regex": null,\ "required": true,\ "default": null\ }\ \], ... } \`\`\` From here there are two possibilities: \* Provide the code \`1234\` to validate the payment. The payment state changes to \`done\`. \`\`\` POST /payments/{{payment\_id}} \`\`\` \`\`\`json { "fields": { "openapisms": "1234" } } \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "done", "action": null, ... } \`\`\` Or you can provide anything else to reject the payment with the \`authenticationFailed\` \`error\_code\`. \`\`\` POST /payments/{{payment\_id}} \`\`\` \`\`\`json { "fields": { "openapisms": "a wrong password" } } \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "rejected", "action": null, "error\_code": "authenticationFailed", ... } \`\`\` ### "otp\\\_plus\\\_decoupled": Validating a payment with a chained one time password and decoupled authorizations This use case simulates a payment validation chaining a one time password prompt followed by a decoupled validation. This is useful to check that your webview implementation supports more than one validation mechanism at a time. This chains the use case "One time password (SMS)" and "Decoupled with successful validation". ### "account\\\_choice": Validating a payment with a choice of payment account This use case triggers a payment validation where the PSU needs to select the payment account to debit for this operation. This is done through an additional field of type \`list\`. Upon validation, the payment enters the \`validating\` state with \`additionalInformationNeeded\` action. The dynamic field exposes a list of available payment accounts. \`\`\` GET /payments/{{payment\_id}} \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "validating", "action": "additionalInformationNeeded", "fields": \[\ {\ "name": "account\_id",\ "type": "list",\ "label": "account choice bank message",\ "regex": null,\ "required": true,\ "default": null,\ "values": \[\ {\ "value": "main",\ "label": "My checking account (EX6713038781895300290000074)"\ },\ {\ "value": "snd",\ "label": "My secondary checking account (EX5813038781895400400000074)"\ }\ \]\ }\ \], ... } \`\`\` Depending on the chosen account, the operation result will vary: \* If the main account is chosen, the payment will be successfully authorised and the state will change to done. \`\`\` POST /payments/{{payment\_id}} \`\`\` \`\`\`json { "fields": { "account\_id": "main" } } \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "done", "action": null, ... } \`\`\` \* If the \`snd\` account is chosen, the payment will be rejected with the \`invalidEmitter\` \`error\_code\`. \`\`\` POST /payments/{{payment\_id}} \`\`\` \`\`\`json { "fields": { "account\_id": "snd" } } \`\`\` \`\`\`json { "id": {{payment\_id}}, "state": "rejected", "error\_code": "invalidEmitter", "error\_description": "Please select the main account.", ... } \`\`\` ### "redirect\\\_no\\\_confirmation": Validating a payment with a single redirection and no explicit client confirmation This use case can be useful if you have \[disabled automatic payment confirmation\](/documentation/integration-guides/pay-by-bank/advanced/confirming-payments-manually.md) on your domain, but still wants to test a case where such a confirmation is not available. The validation mechanism is the same as the redirect use case, with the exception that the payment state will change to done without a \`confirm\` action beforehand. ### "legacy": Validating a payment with intermediary states The legacy use case allows you to specify the states that the payment will go through during its lifecycle. This can be used to test the \[webhooks\](/documentation/integration-guides/webhooks.md), an early rejection or a pending state. This use case is fully covered in the following guide :\[Validating your implementation with the test connector\](/documentation/integration-guides/pay-by-bank/validating-your-implementation-with-the-test-connector.md). It's useful whether you use your own webview or not. This use case is chosen by default if do not provide a value for the \`use\_case\_pay\` field when validating a payment on this connector. --- # 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://docs.powens.com/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/indicators-for-credit-check.md). # Indicators for Credit Check Real-time revenue-checking solution for better credit decisions. It allows online credit providers to evaluate their clients' financial profiles in an instant based on categorized transactions. ### User indicator We provide a specific endpoint to allow you to access indicators metrics computed on end users’ banking data: \`\`\` GET /users/me/indicators \`\`\`
{
   "id\_user":3,
   "indicators":{
      "avg\_current\_month":{
         "incoming":3573,
         "outgoing":-594,
         "net\_cash\_flow":2979,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.0,
            "outcome\_total\_amount":0
         },
         "loans":{
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0.0,
            "total\_amount":0
         }
      },
      "total\_current\_month":{
         "incoming":3573,
         "outgoing":-594,
         "net\_cash\_flow":2979,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0,
            "outcome\_total\_amount":0
         },
         "loans":{
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0,
            "total\_amount":0
         }
      },
      "avg\_last\_30days":{
         "incoming":511,
         "outgoing":-480,
         "net\_cash\_flow":32,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.4,
            "outcome\_total\_amount":-31
         },
         "loans":{
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0.0,
            "total\_amount":0
         }
      },
      "total\_last\_30days":{
         "incoming":15342,
         "outgoing":-14388,
         "net\_cash\_flow":954,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":12,
            "outcome\_total\_amount":-942
         },
         "loans":{
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0,
            "total\_amount":0
         }
      },
      "avg\_last\_60days":{
         "incoming":256,
         "outgoing":-240,
         "net\_cash\_flow":16,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.2,
            "outcome\_total\_amount":-16
         },
         "loans":{
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0.0,
            "total\_amount":0
         }
      },
      "total\_last\_60days":{
         "incoming":15342,
         "outgoing":-14409,
         "net\_cash\_flow":933,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":12,
            "outcome\_total\_amount":-942
         },
         "loans":{
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0,
            "total\_amount":0
         }
      },
      "avg\_last\_90days":{
         "incoming":170,
         "outgoing":-160,
         "net\_cash\_flow":10,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0.0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.133,
            "outcome\_total\_amount":-10
         },
         "loans":{
            "income\_num\_statements":0.0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0.0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0.0,
            "total\_amount":0
         }
      },
      "total\_last\_90days":{
         "incoming":15342,
         "outgoing":-14409,
         "net\_cash\_flow":933,
         "leverage\_ratio":null,
         "recurrent\_income":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "recurrent\_outcome":{
            "num\_statements":0,
            "total\_amount":0,
            "details":null
         },
         "gambling":{
            "gambling\_ratio":null,
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":12,
            "outcome\_total\_amount":-942
         },
         "loans":{
            "income\_num\_statements":0,
            "income\_total\_amount":0,
            "outcome\_num\_statements":0,
            "outcome\_total\_amount":0,
            "details":null
         },
         "return\_debit":{
            "num\_statements":0,
            "total\_amount":0
         }
      }
   }
}
### Steps 1. Ask your Account Manager to activate the Indicators plugin. 2. \[Add a first user and connection\](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) or \[synchronize an existing connection after Indicators plugin activation\](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states). 3. Call the endpoint. {% hint style="info" %} Synchronizations The Indicators metrics are computed asynchronously after every user synchronization. As such, the indicators metrics may not be available for one minute after a user first synchronization; if so the route will return the following output: \`\`\`json { "id\_user": 701, "indicators": None, } \`\`\` We would then suggest that you query it again after a few seconds, after which the complete JSON response should appear. {% endhint %} --- # 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://docs.powens.com/documentation/integration-guides/indicators-for-credit-check.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/advisory-obsolete.md). # Advisory (obsolete) Real-time revenue-checking solution for better credit decisions. It allows online credit providers to evaluate their clients' financial profiles in an instant based on categorized transactions. ### User advisory We provide a specific endpoint to allow you to access advisory metrics computed on end users’ banking data: \`\`\` GET /users/me/advisory \`\`\` \`\`\`json5 { "id\_user": 701, "last\_update": "2023-03-30 11:27:21", "currency": "EUR", "periods": \[\ {\ "period": "2022\_12",\ "transactions\_count": 65,\ "id\_accounts": \[\ 131,\ 133\ \],\ "min\_date": "2022-12-04",\ "max\_date": "2022-12-31",\ "disposable\_income": {\ "currency": "EUR",\ "value": "2120.00"\ },\ "net\_savings": {\ "currency": "EUR",\ "value": "4034.00"\ },\ "events": \[\ {\ "count": 0,\ "event": "unauthorized-overdraft"\ }\ \],\ "transaction\_types": \[\ {\ "type": "card",\ "count": 3,\ "expenses\_count": 3,\ "expenses\_total": {\ "currency": "EUR",\ "value": "-1234.68"\ },\ "incomes\_count": 0,\ "incomes\_total": {\ "currency": "EUR",\ "value": "0.00"\ },\ "total": {\ "currency": "EUR",\ "value": "-1234.68"\ }\ },\ {\ "type": "withdrawal",\ "count": 0,\ "expenses\_count": 0,\ "expenses\_total": {\ "currency": "EUR",\ "value": "0.00"\ },\ "incomes\_count": 0,\ "incomes\_total": {\ "currency": "EUR",\ "value": "0.00"\ },\ "total": {\ "currency": "EUR",\ "value": "0.00"\ }\ },\ ...\ \],\ "transaction\_categories": \[\ {\ "category": "revenue",\ "count": 1,\ "total": {\ "currency": "EUR",\ "value": "2900.00"\ }\ },\ {\ "category": "loans",\ "count": 0,\ "total": {\ "currency": "EUR",\ "value": "0.00"\ }\ },\ {\ "category": "housing",\ "count": 1,\ "total": {\ "currency": "EUR",\ "value": "-780.00"\ }\ },\ {\ "category": "household",\ "count": 0,\ "total": {\ "currency": "EUR",\ "value": "0.00"\ }\ }\ \]\ }\ \] } \`\`\` ### Steps 1. Ask your Account Manager to activate the Advisory plugin. 2. \[Add a first user and connection\](https://docs.powens.com/documentation/integration-guides/quick-start/add-a-first-user-and-connection) or \[synchronize an existing connection after Advisory plugin activation\](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states). 3. Call the endpoint. {% hint style="info" %} Synchronizations The Advisory metrics are computed asynchronously after every user synchronization. As such, the advisory metrics may not be available for a few seconds after a user first synchronization; if so the route will return the following output: \`\`\`json { "id\_user": 701, "last\_update": null, "currency": "EUR", "periods": \[\] } \`\`\` We would then suggest that you query it again after a few seconds, after which the complete JSON response should appear. {% endhint %} --- # 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://docs.powens.com/documentation/integration-guides/advisory-obsolete.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states.md). # SCA & connection states ### Connection synchronization Retrieving user data from the connectors happens in an asynchronous way. Synchronization of a connection is performed: \* right after the connection is created, or has its credentials updated; \* automatically at regular intervals; \* optionally on an explicit API request. In either case, the sync process will upgrade the available dataset of the user if everything goes smoothly. But the process can also fail in various situations: \* the website or the API of the target connector is unavailable; \* the user needs to renew his consent or grant a supplementary explicit access for the synchronization to proceed (e.g. strong customer authentication); \* the provided credentials are invalid and need to be updated; \* we encounter a temporary error, as interfacing with constantly-evolving APIs or websites can be tough ;-)... {% hint style="info" %} Synchronization statuses are available by connector in the Monitoring page of your domain, in the \[administration console\](https://console.budget-insight.com/). {% endhint %} #### Connection states When synchronization fails, we update the \[\`state\` property of the \*connection\* resource\](https://docs.powens.com/api-reference/user-connections/connections#get-a-connection) with an error code that reflects the situation. As an integrator, you should handle this state and guide the user into recovering from the situation.
Connection stateActions to take
(null)The synchronization was successful, no error.
SCARequired
webauthRequired
additionalInformationNeeded
decoupled
validating (transcient)
Synchronization is suspended because we need user consent or SCA to proceed. You should present this error prominently with an option to resume the connection using the indications below.
actionNeededSynchronization failed because the user needs to perform an action directly on the bank website or app (usually, accept new CGUs or similar one-time actions). You should present this error prominently, with the details in the error\_message property.
passwordExpiredSynchronization failed because the user needs to renew its password on the bank website. You should present this error prominently and prompt the user for his new password afterwards.
wrongpassSynchronization failed because the credentials we own are invalid or obsolete. You should present this error prominently with an option to recover the connection using the indications below.
rateLimitingSynchronization failed because the target website or API is temporarily blocking synchronizations due to rate limiting. We will retry after a delay and connections in this state will be resumed automatically.
websiteUnavailableSynchronization failed because the targeted API or website is temporarily unavailable. We will periodically retry to sync.
bugSynchronization failed because of an error from our side. We monitor errors and do our best to fix them quickly. Connections in this state will be resumed automatically after the error is fixed.
For multi-sources connections, we expose the error of any source as an error of the whole connection so the integration can be simplified to checking the connection status. You can also handle the \`state\` property of each source directly. ### Resume/recover connection sync Some connection states require an interaction with the user in order to restore synchronization: \`additionalInformationNeeded\`, \`SCARequired\`, \`webauthRequired\`, \`wrongpass\`, \`decoupled\`. You should present recovery options in your app or service to engage the user into completing the required steps. {% hint style="info" %} Since synchronization is suspended until the appropriate action is performed, we advise you to present such errors prominently in your service or app, using banners, indicators or notifications. {% endhint %} You have 2 options to handle connection resuming/recovery : \* use the Reconnect webview; \* build a custom experience and handle the different cases manually. #### Use our Reconnect webview Our webview has a \[dedicated endpoint\](https://docs.powens.com/api-reference/overview/webview#re-auth--edit-connection-credentials-flow) for connection resuming. It will take care of guiding the user and prompting him the required information if needed. To present the webview, first \[obtain a temporary code\](https://docs.powens.com/api-reference/overview/authentication#generate-a-temporary-code) to secure the transaction: \`\`\` GET /auth/token/code \`\`\` \`\`\`json { "code": "nc0EdV2MiVmSig1…", … } \`\`\` The provided temporary code is valid for a few minutes.\\ Then, present the following URL to your user (new lines are only added for clarity): \`\`\` https://{domain}.biapi.pro/2.0/auth/webview/reconnect ?client\_id={clientId} &code={authorizationCode} &connection\_id={connectionId} &redirect\_uri={yourCallbackUri} \`\`\` After the webview flow is complete (\[either successfully or with an error\](https://docs.powens.com/api-reference/overview/webview#implementation-guidelines)), the user will be redirected to your callback URL, and the connection \`state\` will be updated accordingly. #### Build a custom user experience As an integrator you can also decide to create your own user experience to handle connection resuming. However, the implementation of all steps and cases is a complex task. {% hint style="warning" %} Custom implementations that include transmission of user credentials (login or password) require the Agent Status. The \`wrongpass\` state \*\*cannot\*\* be handled if you don't hold this status. {% endhint %}
The steps to take and information to display/prompt depend on the \`state\` of the connection: \* If the connection is in the \`SCARequired\` state, the synchronization has not been attempted because it requires an explicit user consent. \[Force the connection\](https://docs.powens.com/api-reference/user-connections/connections#sync-a-connection) (with no parameter) to trigger the approval demand: \`\`\` POST /connections/{connectionId} \`\`\` The connection will be resumed or set to another error state that must be handled identically. \* If the connection is in the \`additionalInformationNeeded\` or the \`wrongpass\` state, the user must be prompted for the required values that are described in the \[\`fields\` property of the connection\](https://docs.powens.com/api-reference/user-connections/connections#get-a-connection). The provided values must be \[posted on the connection\](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection), and the synchronization will resume. ### Example: GET /connections/{connectionId} \`\`\`json { "state": "additionalInformationNeeded", // or "wrongpass" "fields": \[ { "name": "otp", "type": "text", "label": "Code d'autorisation", … } \], … } \`\`\` User-provided OTP is to be sent to the API to resume the synchronization: \`\`\` POST /connections/{connectionId} \`\`\` \`\`\`json { "otp": "123456" } \`\`\` The connection will be resumed or set to another error state that must be handled identically. Make sure you also handle the \`wrongpass\` error code that can be raised on posting the credentials. \* If the connection is in the \`decoupled\` state, an authorization is required using a third-party SCA mechanism (validation in an app or using a dedicated device). In this case you should display a waiting message and \[send a resuming signal\](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection) to our API: \`\`\` POST /connections/{connectionId} \`\`\` \`\`\`json { "resume": true } \`\`\` The connection will be resumed or set to another error state that must be handled identically. {% hint style="info" %} By default, this call will be blocking until validation, so you should handle timeouts in a loop, or implement polling on the client side thanks to the query parameter \`background=true\`. The connection is in the \`validating\` state during this step. {% endhint %} \`\`\` POST /connections/{connectionId}?background=true \`\`\` \`\`\`json { "resume": true } \`\`\` \* If the connection is in the \`webauthRequired\` state, the user has to complete authorization in a browser. You should \[obtain a webauth recover URL\](https://docs.powens.com/api-reference/user-connections/connections#webauthurl-object) for the connection, and let the user navigate to it: \`\`\` https://{domain}.biapi.pro/2.0/webauth-url ?client\_id={clientId} &id\_connection={connectionId} &redirect\_uri={yourCallbackUri} \`\`\` After the redirection, the connection will be resumed or set to another error state that must be handled identically. \* If the connection is in another error state than above, recovering is not possible. {% @mermaid/diagram content="graph TB state1{"Connection
state
?"} state2{"Connection
state
?"} state1 -->|" #quot;SCARequired#quot; "| forceSync("POST
/connections/{id}
{ }") --> state2 state1 -->|" #quot;additional
Information
Needed#quot; or
#quot;wrongpass#quot; "| showFields("Prompt user for fields ") --> postFields(" POST
/connections/{id}
Field values") --> state2 state1 -->|" #quot;decoupled#quot; "| showDecoupled("Show decoupled
message") --> postResume(" POST
/connections/{id}
{ resume: true } ") --> state2 state1 -->|" #quot;webauthRequired#quot; "| webauth("Get auth code
Open browser:
/webauth?#hellip; ") --> webauthRedirect("Redirection to
callback\\\_uri "
with state param) --> state2 state2 -->| null | success("Connection is OK!") state2 -->|"Recoverable error"| loop\\\[\\Loop to first step/\] state2 -->|"Other error"| unrecoverable("Unrecoverable error state")" %} {% hint style="info" %} API calls that raise a synchronization perform a synchronous check of the credentials with the connector, so these requests usually take a few seconds. Make sure you handle them in a user-friendly way. {% endhint %} --- # 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://docs.powens.com/documentation/integration-guides/sca-and-connection-states.md?ask=&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. --- # Account ownership certificate | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate.md) . > **This feature is not activated by default on your domain. Please contact us to request access.** The account ownership certificate is a PDF document, generated on demand, that attests to two facts about a single connection: * the end user gave express consent, on a specific date and time, for their account information to be accessed; * according to the information retrieved, that end user is linked to a given list of payment accounts. It is intended to be handed to a third party — a bank, a credit institution, a public administration or an auditor — as proof that the account data was legitimately obtained. The certificate is issued by Powens as the regulated entity, not by the account-servicing institution. The document is built from the same data exposed by the [Account Ownerships](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships) endpoint of the Bank ID Check product, and is generated when the request is made. It is not stored: each call produces a fresh document bearing the current issue date. > **Note:** not to be confused with [`GET /certificate/{type}`](https://docs.powens.com/api-reference/api-setup/configuration) > , which returns a technical certificate belonging to your domain. ### Prerequisites[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#prerequisites) The certificate names the account holder, and that information is recorded by the Bank ID Check product **at synchronization time**. A connection therefore needs to have been synchronized while Bank ID Check was enabled on your domain, by a connector that supports it. Otherwise no holder is on record and the request fails with `no account holder found`. Enabling Bank ID Check afterwards is not enough on its own: the connection has to be synchronized again for the holder to be recorded. Three configuration keys control the content of the document. They are set through the [Configuration](https://docs.powens.com/api-reference/api-setup/configuration) endpoint and apply to the whole domain. Configuration key Type Default Description `connection_certificate.language` String `fr` Language of the certificate, which also determines the issuing entity and the legal template used. Accepted values are `es` and `fr`. `root.client_name` String Empty string Your company name, as it should appear on the certificate as the requesting party. Required. `root.cif` String Empty string Your company tax identification number. Required when the language is `es`, ignored otherwise. Example configuration for a Spanish domain: Copy { "connection_certificate.language": "es", "root.client_name": "YOUR COMPANY SL", "root.cif": "B00000000" } ### API endpoints[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#api-endpoints) ### Get the certificate[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#get-the-certificate) **GET** `https://{domain}.biapi.pro/2.0/users/{user_id}/connections/{connection_id}/certificate` Generate and download the account ownership certificate for a connection. **Path Parameters** Name Type Required Description user\_id Integer or "me" Yes ID of the related user. connection\_id Integer Yes ID of the related connection. This endpoint takes no query parameter and no request body. The language cannot be selected per request: it is read from your domain configuration. **Response** **200 OK** — the response body is the PDF document itself, with `Content-Type: application/pdf`. No `Content-Disposition` header is returned, so you are free to name the file as you wish when storing or serving it. **400 Bad Request** — the certificate could not be produced. See the Errors section below for the list of possible reasons. **Example** Copy curl -sS "https://$DOMAIN.biapi.pro/2.0/users/me/connections/$CONNECTION_ID/certificate" \ -H "Authorization: Bearer $USER_TOKEN" \ -o certificate.pdf The endpoint accepts a user token, a manager token, or a signed request. ### Certificate content[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#certificate-content) Most of the document is a fixed legal template. The following elements vary: Element Source Requesting party's name The `root.client_name` configuration key. Requesting party's tax ID The `root.cif` configuration key. Spanish certificate only. End user's name The account holder, as returned in `parties[].identity.full_name` by the Account Ownerships endpoint. Consent date and time The `created` date of the connection, to the second. List of accounts The IBAN of every enabled checking account on the connection. Card numbers The PAN associated with those accounts. Spanish certificate only. Issue date The date on which the request is made. Only **checking accounts** that are enabled and carry an IBAN are listed. Savings, securities and other account types are not included. #### Languages[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#languages) The two versions are not translations of one another: the certifying entity differs, and so does the regulatory framing. Language Issuing entity Accounts listed `es` Unnax Regulatory Services, EDE, S.L. — electronic money institution registered with the Bank of Spain under code 6719. IBAN and card PAN `fr` Powens, SAS — registered with the Paris Trade and Companies Register under number 749 867 206. IBAN only ### Webhook[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#webhook) The `CONNECTION_CERTIFICATE_AVAILABLE` event is emitted after a connection has been synchronized for the first time, when a certificate can be requested for it. You do not need to poll the endpoint. Register it like any other event, as described in the [Webhooks](https://docs.powens.com/documentation/integration-guides/webhooks) guide. Copy { "id_connection": 123, "method": "GET", "url": "/users/456/connections/123/certificate"} > **Note:** the event indicates that the connection is eligible for a certificate, not that generation is guaranteed to succeed. A connection whose accounts turn out to be jointly held will emit the event and then return an error on download. Handle the error cases below. ### Errors[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#errors) All failures are returned as `400` with the `badRequest` code and a `description` field explaining the cause. Description Cause and resolution `unsupported language: …, languages are: es, fr` The `connection_certificate.language` key holds a value other than `es` or `fr`. Correct the key; there is no fallback. `config: root.client_name is empty, provide your client's name` The `root.client_name` key has no value. Set it to your company name. `config: root.cif is empty, provide your cif` The language is `es` and the `root.cif` key has no value. Set your tax identification number. `no checking account enabled on this connection` The connection has no enabled checking account. Either the connector returned none, or the end user did not select any during consent. `one or many accounts have multiple owners` At least one account is jointly held. A certificate cannot name a single holder for a joint account, so none is issued. `no account holder found` No holder could be determined for any account. Usually means Bank ID Check is not enabled on your domain, or the connector does not support it. `no iban found` A holder was identified, but none of the checking accounts carries an IBAN. The three configuration errors are evaluated before any account data is read, so a misconfigured domain always reports the missing key rather than a data problem behind it. ### Notes and limitations[](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate#notes-and-limitations) * **One language per domain.** The language is a domain-wide setting, so a single domain cannot issue both Spanish and French certificates. * **Nothing is stored.** Two requests made on different days produce documents bearing different issue dates. If you need to keep a copy for audit purposes, store the PDF on your side when you download it. * **No electronic signature.** The document is not digitally signed or time-stamped; it carries the issuing entity's letterhead and footer. * **Joint accounts are not certified.** This is deliberate rather than a degraded mode, and it affects a meaningful share of real connections. Make sure your integration handles the error gracefully. [PreviousAccount Ownerships](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships) [NextInvoices](https://docs.powens.com/api-reference/products/data-aggregation/invoices) Last updated 1 month ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/webhooks.md). # Webhooks Our API offers a way to obtain data of end-users using \[webhooks\](https://en.wikipedia.org/wiki/Webhook). After \[a user connection has been configured\](/documentation/integration-guides/quick-start/add-a-first-user-and-connection.md) using our API endpoints, these callbacks are the most efficient way to get up-to-date user data. {% hint style="warning" %} We highly recommend using webhooks instead of implementing an API-polling mechanism. {% endhint %} ### Registering webhooks You can \[register a webhook\](/documentation/integration-guides/quick-start.md#register-a-webhook) in the \[administration console\](https://console.budget-insight.com/) of your domain. As many webhooks as needed can be registered. The console also lets you test webhooks triggering and handling. For instance, after you have configured a webhook for the \[\`CONNECTION\_SYNCED\`\](https://docs.budget-insight.com/reference/connections#connection-synced) event, you can test that the callback is properly triggered when a user creates a new connection to his bank accounts in the webview. {% hint style="info" %} Webhooks are only triggered for \*permanent\* users: you must have \[obtained a permanent access token\](https://docs.powens.com/api-reference/overview/authentication) for the user before you can receive webhook data. {% endhint %} ### Available webhook events You can subscribe to the following events:
EventDescription
USER\_CREATEDEmitted after a permanent user is created.
USER\_DELETEDEmitted after a user is deleted.
USER\_SYNCEDDeprecated. Emitted after multiple connections of a user have been synced.
CONNECTION\_SYNCEDEmitted after a connection has been synced.
CONNECTION\_DELETEDEmitted after a connection has been deleted.
CONNECTION\_CERTIFICATE\_AVAILABLEEmitted after a connection has been synced for the first time, when an account ownership certificate can be requested for it.
ACCOUNTS\_FETCHEDEmitted during a sync after bank accounts have been synchronized, but before the transactions are processed.
ACCOUNT\_CATEGORIZEDEmitted during a sync after bank accounts have been synchronized, and after the transactions are processed.
ACCOUNT\_SYNCEDEmitted during a sync after a bank account was processed, including new transactions.
ACCOUNT\_DISABLEDEmitted after a bank account was disabled.
ACCOUNT\_ENABLEDEmitted after a bank account was enabled.
ACCOUNT\_FOUNDEmitted after a new bank account was discovered.
ACCOUNT\_OWNERSHIPS\_FOUNDEmitted during a sync after a bank ownerships have been synchronized.
TRANSACTION\_ATTACHMENTS\_FOUNDEmitted during a sync after bank accounts have been synchronized, and after the transactions are processed.
SUBSCRIPTION\_SYNCEDEmitted during a sync after a subscription was processed, including new documents.
SUBSCRIPTION\_FOUNDEmitted after a new subscription was discovered.
PAYMENT\_STATE\_UPDATEDEmitted after a payment has been updated.
If the user is still in a \*temporary\* state when the webhook events should be triggered (\`USER\_CREATED\` for instance), the callback will be sent as soon as you make the user permanent. Webhooks are triggered: \* after you ask for a specific action through the API and \* after a background synchronization (every 24h by default). ### Technical integration #### Receiving the webhook data By default, webhooks are performed using HTTP \`POST\` requests, with JSON body data.\\ The \`autosync.cfonb\` config key is available to change the format of the \`ACCOUNT\_FOUND\`, \`CONNECTION\_SYNCED\` and \`USER\_SYNCED\` callbacks to the CFONB format. See the \[full reference\](/documentation/integration-guides/webhooks.md#available-webhook-events) above for the detailed format of each webhook. Alongside the event specific data in the request body, an additional \`id\_webhook\_data\` integer field is also included. It allows you to identify the webhook payload uniquely. #### Expected response Your server must respond with a 2XX (success) HTTP response code when a webhook is received on the provided URL, otherwise we consider that the webhook data has not been received. If a webhook push failed, we will retry pushing that data until it is properly accepted. #### Compression of webhook payload During the first synchronization of a connection, your webhook will receive all the user's transactions and/or documents, which may produce a very large HTTP payload of \*multiple MBs\*. You can enable webhook compression to reduce the size of the exchanged content in the following cases: \* Your web server is configured to limit the HTTP body to a size that is not sufficient. \* You have more CPU resources than bandwidth. When compression is activated, the HTTP body sent to your webhook will be compressed in gzip format and the HTTP header \`content-encoding\` will be set to \`gzip\`. To activate webhook data compression, use the \`webhooks.compression.enabled\` \[configuration key\](https://docs.powens.com/api-reference/api-setup/configuration#get-configuration). ### Authentication We support three alternative mechanisms to secure webhooks sent to your servers: #### Authentication with user-scoped token The default mechanism for webhooks authentication is perfomed by adding the user token in every callback request in the \`Authorization\` header: \`\`\` Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \`\`\` When receiving a webhook, you can check that the provided token matches the record you have for the user, and reject the call otherwise. {% hint style="warning" %} This is only available for webhooks related to a specific user (e.g. not \`PAYMENT\_STATE\_UPDATE\`). {% endhint %} #### Authentication with a HMAC signature header An additional authentication method is available, which uses a hash-based message authentication code (HMAC). The code is generated with a shared secret, and authentication is performed by the client by recalculating the HMAC signature. This asserts that the sender of the webhook data knows the secret. In order to enable it, you need to create a new \`auth\_provider\` of type \`hmac\_signature\`: \`\`\`json POST /webhooks/auth authorization: Bearer { "type": "hmac\_signature", "name": "My HMAC provider", } \`\`\` \`\`\`json { "id": 2356, "type": "hmac\_signature", "name": "My HMAC provider", "config": { "secret\_key": } } \`\`\` The secret used to compute the HMAC signature can be found in the \`config\` object. {% hint style="warning" %} You should preserve this secret key safely as you will not be able to access it anymore after this. {% endhint %} See the "Association" section below for linking this newly created provider to your webhook(s). The provider will add two headers to each webhook data: \* \`BI-Signature-Date\` containing a datetime in UTC ISO 8601 format generated during the request creation. \* \`BI-Signature\` = \`BASE\_64(HMAC\_SHA256( + "." + + "." + + "." + , secret\_key))\` where: \* is the HTTP method used (POST), in capital letters; \* is the listening URL endpoint of the client; \* is the value contained in the \`BI-Signature-Date\` header; \* is the webhook data payload. Example calculation of a signature: \`BASE\_64(HMAC\_SHA256('POST./v1/webhook-listener.2022-06-27T11:08:52.577831Z.{"id": 1, "state": "done", ...}', secret\_key))\` You can then reject any webhook data where the signature does not match your computation. #### OAuth2 authentication We also support securing webhooks using \[OAuth 2.0\](https://oauth.net/2/), the industry-standard protocol for authorization. When an OAuth 2.0 \*provider configuration\* is defined and associated with your wehbooks, callbacks will be secured with access tokens obtained from the authorization server and added to the \`authorization\` header. The provided authorization server endpoint must fully support the \[\`client\_credentials\` grant type of the protocol\](https://oauth.net/2/grant-types/client-credentials/): \* accept a standard payload with \`client\_id\`, \`client\_secret\` and \`grant\_type\` (set to \`client\_credentials\`); \* respond with a JSON entity with \`access\_token\`, \`token\_type\` (must be \`Bearer\`), and optionnally \`expires\_in\` and \`refresh\_token\` to implement tokens expiration; \* optionally, support a additional layer of security using a pair of certificates. \*\*Registration\*\* Configuration of auth providers will soon be available in the administration console. In the meantime, you can register them using the API. You can use an API endpoint available on your domain to register a new provider. The call must be authenticated using your \*configuration token\*, available in the administration console. All parameters are mandatory, except from \`public\_cert\` and \`private\_cert\`. \`\`\`json POST /webhooks/auth authorization: Bearer { "type": "oauth", "name": "ACME provider", "config": { "url": "https://auth.example.org/token", // The full token endpoint URL of the provider "client\_id": "123456", // Replace with your client ID "client\_secret": "aJnr28jmdnIDNY9x11auihIX", // Replace with your client secret "grant\_type": "client\_credentials", "public\_cert": "", // Optional public certificate to use with the provider "private\_cert": "" // Optional private certificate to use with the provider } } \`\`\` \`\`\`json { "id": 2356, "type": "oauth", "name": "ACME provider" } \`\`\` \*\*Association\*\* When a provider has been created, you can associate it with a webhook in the administration console. ### Technical notes #### Webhook vs. webhook data It is important to distinguish a webhook from its data. A webhook is a "registration" to a webhook event (USER\\\_CREATED, CONNECTION\\\_SYNCED, ...) including an URL that will receive the webhook data at event time. A webhook request payload includes data associated with the webhook's event. For example, a webhook registered with the \`USER\_CREATED\` event will include data with user information. #### Webhook data flusher Webhook requests are emitted immediately at creation (when the related event occurs). In case of failure, our webhook system uses a "flusher" retrying to send webhook data regularly. The flusher stops after 10 consecutive failures (or 2 timeouts) per webhook. In such case, it will attempt to send unprocessed webhook data at next execution. An email can be sent when the flusher is failing. You must set the \*\*biapi.manager.email\*\* config key to receive it. In order to prevent email flooding, the config key \*\*webhooks.alerts\\\_frequency\*\* determines the minimum number of days between two emails per webhook (default: 1 = one day, can be 0.5 for twice a day). When the problem is solved, a flush recovery email is sent. See \[configuration\](https://docs.powens.com/api-reference/api-setup/configuration) reference to update configuration values. You can monitor your webhook's health (average sending duration and sending success rate) through its \`health\_data\` property. A warning is also displayed in a \`warning\` property if at least one of these values reaches a critical threshold. --- # 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://docs.powens.com/documentation/integration-guides/webhooks.md?ask=&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. --- # Investments | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/wealth-aggregation/investments.md) . API endpoints[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#list-investments) ---------------------------------------------------------------------------------------------------------------- Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _user token_. List investments[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#list-investments-1) --------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/investments` List investments related to a user. #### Path Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. #### Query Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#query-parameters) Name Type Description label String Filter investments using keywords in labels. code String Filter investments by ISIN code. 200: OK List of investments Response body: [InvestmentsList object](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmentslist-object) Filtering route aliases: Copy /users/{userId}/accounts/{accountId}/investments /users/{userId}/connections/{connectionId}/investments Get an investment[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#get-an-investment) --------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/investments/{investmentId}` Get a single investment by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#path-parameters-1) Name Type Description investmentId\* Integer ID of the investment. 200: OK Investment details Response body: [Investment object](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investment-object) Get history of an investment[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#get-history-of-an-investment) ------------------------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/investments/{investmentId}/history` Get history of a single investment by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#path-parameters-2) Name Type Description investmentId\* Integer ID of the investment. 200: OK Investment history values Response body: [InvestmentHistoryValuesList object](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmenthistoryvalueslist-object) Data model[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#data-model) ------------------------------------------------------------------------------------------------------- ### _InvestmentsList_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmentslist-object) Property Type Description `valuation` Decimal Total valuation of all investments. `diff` Decimal Total absolute capital gain or loss. `diff_percent` Decimal Total relative capital gain or loss. `prev_diff` Decimal Total absolute capital gain or loss since the previous value. `prev_diff_percent` Decimal Total relative capital gain or loss since the previous value (in ratio, 1 meaning 100%). `calculated` Array of strings List of properties of this response that has been calculated rather than directly obtained from the source. `investments` Array of [_Investment_](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investment-object) objects List of investments. ### _Investment_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investment-object) Property Type Description `id` Integer ID of the investment. `id_account` Integer ID of the related account. `label` String Display name of the investment. `code` String or null Technical code of the investment. `code_type` String Code type: `ISIN` or `AMF`. `stock_symbol` String or null Stock ticker symbol of the investment in the associated stock market. `source` String Source of the ISIN code: `website` or `notFound`. `description` String or null Description of the investment. `quantity` Decimal Quantity of stocks of this investment. `unitprice` Decimal Buy price of one stock. `unitvalue` Decimal Current value of one stock. `valuation` Decimal Total current value of the investment. `diff` Decimal Absolute capital gain or loss. `diff_percent` Decimal Relative capital gain or loss (in ratio, 1 meaning 100%). `prev_diff` Decimal or null Absolute capital gain or loss since the previous value. `prev_diff_percent` Decimal or null Relative capital gain or loss since the previous value (in ratio, 1 meaning 100%). `vdate` Date Value date of the investment. `prev_vdate` Date or null Value date of the investment when the previous synchronization occurred. `portfolio_share` Decimal Allocation ratio of the investment in the portfolio (1 meaning 100%). `calculated` Array of strings List of properties of this response that has been calculated rather than directly obtained from the source. `deleted` Date or null Deletion date for investments that no longer exist (`null` if still present). `last_update` DateTime Date of the last synchronization of the investment. `original_currency` [_Currency_](https://docs.powens.com/api-reference/products/data-aggregation/currencies#currency-object) object or null For international investments, currency of the investment (if different from the bank account). `original_valuation` Decimal or null For international investments, valuation of the inverstment in the original currency. `original_unitvalue` Decimal or null For international investments, current value of one stock in the original currency. `original_unitprice` Decimal or null For international investments, buy price of the investment in the original currency. `original_diff` Decimal or null For international investments, difference between the buy price and the current valuation in the original currency. `details` [_InvestmentDetails_](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmentdetails-object) object or null Additional information for the investment (if available and activated). ### _InvestmentDetails_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmentdetails-object) Property Type Description `performance_1_year` Decimal or null Performance of the stock between one year ago and today (in ratio, 1 meaning 100%). `performance_3_years` Decimal or null Performance of the stock between three years ago and today (in ratio, 1 meaning 100%). `performance_5_years` Decimal or null Performance of the stock between five years ago and today (in ratio, 1 meaning 100%). `srri` Decimal or null Synthetic Risk and Reward Indicator of the stock (from 1 to 7). `asset_category` String or null Asset category of the stock (Actions, Obligations…). `recommended_period` String or null Minimum recommended period of investment. `last_update` DateTime or null Date of the last synchronization of the additional information. ### _InvestmentHistoryValuesList_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmenthistoryvalueslist-object) Property Type Description `investmentvalues` Array of [_InvestmentHistory_](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmenthistory-object) objects List of investment history values. ### _InvestmentHistoryValue_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/investments#investmenthistoryvalue-object) Property Type Description `id` Integer ID of the investment history. `id_investment` Integer ID of the related investment. `vdate` Date Date of the investment history. `unitvalue` Decimal Value of one stock at the date indicated in `vdate`. `original_currency` [_Currency_](https://docs.budget-insight.com/reference/bank-accounts#currency-object) or null Original currency of the investment history (if different from the account currency). `original_unitvalue` Decimal or null Value of one stock in the original currency at the date indicated in `vdate`. [PreviousWEALTH AGGREGATION](https://docs.powens.com/api-reference/products/wealth-aggregation) [NextMarket orders](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders) Last updated 6 months ago --- # Pockets | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets.md) . API endpoints[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#list-investments) ------------------------------------------------------------------------------------------------------------ Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _user token_. List pockets[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#list-pockets) ------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/pockets` List pockets related to a user. #### Path Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. 200: OK List of pockets Response body: [PocketsList object](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocketslist-object) Filtering route aliases: Copy /users/{userId}/investments/{investmentId}/pockets /users/{userId}/accounts/{accountId}/pockets /users/{userId}/connections/{connectionId}/pockets Get a pocket[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#get-a-pocket) ------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/pockets/{pocketId}` Get a single pocket by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#path-parameters-1) Name Type Description pocketId\* Integer ID of the pocket. 200: OK Pocket details Response body: [Pocket object](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocket-object) Data model[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#data-model) --------------------------------------------------------------------------------------------------- ### _PocketsList_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocketslist-object) Property Type Description `pockets` Array of [_Pocket_](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocket-object) objects List of pockets. ### _Pocket_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocket-object) Property Type Description `id` Integer ID of the pocket. `id_investment` Integer ID of the related investment. `id_account` Integer ID of the related account. `label` String Display name of the pocket. `quantity` Decimal Quantity of stocks in the pocket. `value` Decimal Total current value of the pocket. `condition` [_PocketCondition_](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocketcondition-object) string Condition for the availability of the pocket. `availability_date` Date or null Date of availability, if applicable. `deleted` Date or null Deletion date for pockets that no longer exist (`null` if still present). `last_update` DateTime Date of the last synchronization of the pocket. ### _PocketCondition_ values[](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets#pocketcondition-values) Value Description `unknown` There is no available information on the condition. `date` The pocket will become available at a specific date. `acquired` The pocket is acquired (the underlying shares are acquired but cannot be transferred). `available` The pocket is available and the underlying shares are transferable (the condition was fulfilled or the availability date is in the past). `retirement` The pocket will be available when the employee retires (precise date is not always indicated). Forward compatibility requirement: additional values may be added in the future. When implementing value matching, always fallback to a generic case for unknown values. [PreviousMarket orders](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders) [NextLoan amortizations](https://docs.powens.com/api-reference/products/wealth-aggregation/loan-amortizations) Last updated 6 months ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/legal-notice.md). # Legal notice In accordance with the requirements of articles 6-Ⅲ and 19 of the French law of June 21, 2004 for confidence in the digital economy (Law 2004-669), Powens (Budget Insight) states that the current website \[docs.powens.com\](https://docs.powens.com/documentation/) is managed by Powens, a simplified joint-stock company with share capital of 33.151,60€ with registered office at 84 rue Beaubourg – 75003 Paris, France and registered in the Paris Trade and Companies Register under number 749 867 206. Powens (Budget Insight) is registered by the Prudential Supervision and Resolution Authority (ACPR) under number CIB 16948 on the official list \[regafi.fr\](https://www.regafi.fr/) as a payment institution. Publication director: Jean Guillaume (Powens CEO) Phone: 09 53 97 54 43 This website makes use of the \[GitBoot\](https://www.gitbook.com/) platform, including its \[subprocessors\](https://policies.gitbook.com/privacy-and-security/security/subprocessors). Powens (Budget Insight) proceed in accordance to the GDPR, the Directive 2002/58/EC (Privacy Directive), and the French Data Protection and Freedom of Information Law (Loi Informatique et Liberté) of 6 January 1978. --- # 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://docs.powens.com/documentation/legal-notice.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/ressources/glossary.md). # Glossary #### Client application A client application identifies a caller requesting your Powens API. One client application is required at least per API. The definition of a client application lets you configure the associated \[Webview\](https://docs.powens.com/api-reference/overview/webview), a ready-to-use web interface to add connections to your domain. You can configure multiple client applications if you wish to propose webviews with different settings. #### Connection A \[connection\](https://docs.powens.com/api-reference/user-connections/connections) materializes the link between an end user and one of the connector we support. Adding a connection requires the end user to authenticate on the connector. As long as the credentials stay valid, we take care of synchronizing user data. Product data are available through connections. #### Connector In our system, the \[connector\](https://docs.powens.com/api-reference/user-connections/connectors) represents the institution with which we establish a connection to retrieve end user data (bank accounts, transactions, billing contracts, documents…). #### Credentials Credentials generally represents end user identifiers (login, password or other key fields). In the context of connections in Powens API, "credentials" is also the name we use for a specific authentication mechanism where the end user is filling a form with his identifiers in order to establish the connection with the institution. In this case, we store the credentials in an encrypted and secured device. #### Direct Access \`directaccess\` is one of the \[connector source types\](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) representing the website of the institution from which we directly read the information. #### Fallback \`fallback\` is one of the \[connector source types\](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) representing the emergency gateway provided by banks regarding of the PSD2 when their API is down. #### Open API \`openapi\` is one of the \[connector source types\](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) representing an API provided by the institution to get data (i.e. PSD2 API for European banks). #### PSU Payment Service User, the end-user of payment services. #### Source In order to access institution information (bank accounts, transactions, billing contracts, documents…), we can use various channels. The channel allows us to establish a connection with the institution, it is called a \[connector source\](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors). We currently handle three types of source: \`openapi\`, \`fallback\` and \`directaccess\`. #### Subscription A subscription is a representation of a bill contract or group of documents. It is a parallel representation of accounts on the bank system. #### Webauth "webauth" is the name we use for a specific authentication mechanism where the end user is redirected to the app or website owned by the institution on which he wants to connect. In this case, we do not store end user credentials, the login process is handled by the institution that just confirms or denies the authentication and calls us back. --- # 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://docs.powens.com/documentation/ressources/glossary.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/advanced.md). # Advanced
Custom connection implementationMake your own connection interface (available for integrators recognized by legal authorities)
End-to-end encryptionEnsure sensitive data confidentiality is guaranteed all the way
Response signatureProve data integrity to a third party
--- # 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://docs.powens.com/documentation/integration-guides/advanced.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/advanced/response-signature.md). # Response signature The API can generate \[JWS\](https://en.wikipedia.org/wiki/JSON\_Web\_Signature) tokens instead of JSON responses. This may be useful if you or one of your clients needs to assert \* the data's origin, \* which request was used exactly, \* the timestamp the request was executed at. {% hint style="info" %} Signed responses need to be enabled. Contact us. {% endhint %} ## Get signed responses To get a signed response, add the following query parameter to your request: \`\`\` sign\_response=true \`\`\` ## Token format As any JWS, the structure is \`header.payload.signature\`, where \* \`header\` is a base64-encoded JSON with information about the signature process (see \[Verify token signature\](/documentation/integration-guides/advanced/response-signature.md#verify-token-signature)), \* \`payload\` is a base64-encoded JSON with the following structure: \`\`\`json { "request\_url": ..., "response\_timestamp": ..., "response\_payload": ..., } \`\`\` \* \`signature\` is a base64-encoded bytes section. ## Verify token signature 1. Get the \`key\_url\` in the header, 2. Fetch the key (see \[Get a key\](/documentation/integration-guides/advanced/response-signature.md#get-a-key)), 3. Check if the \`deprecated\` field is \`null\`, 4. Use the \`public\_key\` field to check the signature using your favorite JWS library. ## Keys resource ### List keys The list of past and present keys can be obtained at \`\`\` /sign-keys \`\`\` ### Get a key \`\`\` GET /sign-keys/{key\_id} \`\`\` #### Keys format | Property | Type | Description | | ----------- | ---------------- | -------------------------------------------------------------------------------- | | id | Number | ID of the key. | | public\\\_key | String | PEM of the public key. | | deprecated | DateTime or null | If set, this key is deprecated and any signature using it should not be trusted. | --- # 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://docs.powens.com/documentation/integration-guides/advanced/response-signature.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/sdk/powens-connect-ios.md). # Powens Connect iOS Learn how to integrate our UI iOS SDK with your app. The Powens Connect SDK allows you to quickly and easily implement aggregation journeys and connect with Powens APIs in your iOS app. ### Installation #### From Cocoapods 1. If you haven’t already, install the latest version of \[Cocoapods\](https://guides.cocoapods.org/using/getting-started.html#installation). 2. If you don’t have an existing \[Podfile\](https://guides.cocoapods.org/syntax/podfile.html), run the following command to create one at the root of your Xcode project: \`\`\`typescript pod init \`\`\` 3. Add this line to your Podfile: \`\`\`typescript pod 'PowensConnect', '1.0.0-beta' \`\`\` 4. Run the following command: \`\`\`typescript pod install \`\`\` 5. From now on you will use the \`.xcworkspace\` file to open your Xcode project instead of the \`.xcodeproj\` file. 6. To update to the latest version of the SDK in the future, run: \`\`\`typescript pod update PowensConnect \`\`\` #### Manually 1. Download and unzip this Github project. 2. Drag \*\*PowensConnect.xcframework\*\* to the \*\*Frameworks, Libraries and Embedded Content\*\* section of the General settings in your Xcode project. Make sure to select \*\*Copy items if needed\*\*. 3. Repeat the above steps in the future to update to the latest version of the SDK. ### Configuration 1. Right-click your \`Info.plist\` file and choose \*\*Open as > Source Code\*\*. 2. Paste the following into the body of your file (within \`…\`) to configure your Powens domain. \`\`\`xml PowensDomain YOUR\_DOMAIN \`\`\` Replace \*YOUR\\\_DOMAIN\* with your actual Powens domain, without the \`.biapi.pro\` extension. 3. Paste the following into the body of your file (within \`…\`) to configure the Powens Connect dedicated URL scheme.\\ If you already have custom URL schemes, simply paste the additional \`CFBundleURLSchemes\` to your \`CFBundleURLTypes\` array. \`\`\`xml CFBundleURLTypes CFBundleURLSchemes powens-CLIENT\_ID \`\`\` Replace \*CLIENT\\\_ID\* with your client application ID. You can find your client applications IDs in the \[administration console\](https://console.powens.com/), under \*\*Applications\*\* within your domain. ### Usage 1. Register for Powens Webview callback notifications from the view controller you wish to present the Powens Webview from. \`\`\`objectivec // Registering for Webview callback notifications // Allows the automatic dismissal of the presented Webview controller from the source controller Powens.shared.handler.registerWebviewCallback(sourceViewController: self) \`\`\` 2. Open the desired Webview flow among Connect, Manage & Reconnect.\\ Visit our \[documentation\](https://docs.powens.com/api-reference/overview/webview) for more information about the Webview flows and their usage. \`\`\`swift Task { do { // Building the Connect flow URL and generating a temporary auth code when provided with an access token let handle = try await Powens.shared.launcher.connectFlow(accessToken: token, state: nil, options: options) // Building the Manage flow URL and generating a temporary auth code let handle = try await Powens.shared.launcher.manageFlow(accessToken: token, connectionId: nil, state: nil, options: options) // Building the Reconnect flow URL and generating a temporary auth code let handle = try await Powens.shared.launcher.reconnectFlow(accessToken: token, connectionId: connectionId, resetCredentials: resetCredentials, state: nil) // Presenting the Webview controller from the current view controller handle.presentOn(sourceViewController: self) } catch { NSLog(error.localizedDescription) } } \`\`\` 3. Handle the data received from the app callback URL. \`\`\`swift do { try Powens.shared.handler.handleConnectCallback(url: url) { result in switch onEnum(of: result) { case .webviewConnectCallbackSuccess(let result): self.onConnectSuccess(result: result) case .webviewCallbackError(let error): self.onError(error: error) } } try Powens.shared.handler.handleManageCallback(url: url) { result in switch onEnum(of: result) { case .webviewManageCallbackSuccess(let result): self.onManageSuccess(result: result) case .webviewCallbackError(let error): self.onError(error: error) } } try Powens.shared.handler.handleReconnectCallback(url: url) { result in switch onEnum(of: result) { case .webviewCallbackError(let error): self.onError(error: error) default: break } } } catch { NSLog(error.localizedDescription) } \`\`\` Please refer to the \[example Xcode project\](https://github.com/powenscompany/powens-connect-ios/tree/main/Example/connect-ios-demo) from this repository for a complete example of the PowensConnect SDK usage. ### License The Powens Connect SDK is available under the LGPLv3 license. See the \[LICENSE\](https://github.com/powenscompany/powens-connect-ios/blob/main/LICENSE.md) file for more information. --- # 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://docs.powens.com/documentation/sdk/powens-connect-ios.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/sdk/connect-sdk.md). # Connect SDK Connect SDK is our front-end solution for seamless account authentication and user data access. With \*\*Connect SDK\*\*, you can integrate directly into your applications to connect with all the financial data Powens is providing. Leveraging OAuth 2.0 authentication, our SDK ensures secure and transparent access to user data. Here's a high-level overview of how it works: 1. Send the end user to a product flow in our mobile SDK. 2. The user selects their bank, provides consent, and authenticates through the provided flow. 3. Once the process is complete, the user is redirected back to your application with the operation's result. Choose the appropriate implementation method based on your technology stack to start integrating our \*\*Connect SDK\*\* seamlessly into your applications. ### Mobile App Powens UI SDK has been developed in Kotlin to ensure easy accessibility on both iOS and Android.
iOSLearn how to integrate our Connect iOS SDK into your appPowens Connect iOS
Android (coming soon)Learn how to integrate our Connect Android SDK into your app
--- # 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://docs.powens.com/documentation/sdk/connect-sdk.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation.md). # Custom connection implementation {% hint style="warning" %} Building a full custom implementation of the connection protocol is only available to integrators holding the Agent Status as defined in article \[L523-1\](https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000035430788\\&cidTexte=LEGITEXT000006072026\\&dateTexte=20200618) of Code Monétaire et Financier (CMF). Please validate the integration with your account manager before proceeding. This option requires a significant amount of work and testing. We advise to rely on our \[Connect webview\](https://docs.powens.com/api-reference/overview/webview#add-connection-flow) unless necessary. {% endhint %} ### UX guidelines The following diagram illustrates the general recommended UX for adding a connection, see below for the detail of the different steps:
### Transactions and Wealth & Loans implementation For technical and regulatory reasons, bank connectors require a richer UX with multiple authentication steps as soon as your use-case involves gathering multiple account types (payment and non-payment). We recommend to present these steps sequentially and to follow these best practices: #### Option 1: Present additional accounts as an option (recommended) If your use case can work with a partial list of the user accounts, we recommend to present the aggregation of additional account types as an option on the activation screen:
#### Option 2: Restrict aggregation to required accounts only If your use-case only requires either payment or non-payment accounts, you should limit the connection flow to only the required account types:
#### Option 3: Force chaining of authentication flows If you always need to get \*\*all\*\* accounts for a given user (payment and non-payment accounts), chain the authentication steps:
### Technical steps The full protocol of connection addition involves the following steps: \* obtain a user context by creating a temporary user resource, or using an existing token; \* if applicable, let the user select the target connector, and optionally the specific connector source (bank connectors only); \* follow the appropriate authentication mechanism for the selected connector or source, either redirecting the user to a third-party webview, or presenting to the user a form with a set of credentials fields; \* handle connection creation with potential multiple steps (e.g. multifactor authentication); \* get user consent and activate individual access to bank accounts and subscriptions; \* for bank connections, repeat these steps for all available connector sources. {% @mermaid/diagram content="graph TB newUser("Create a user
\`POST /auth/init\`") --> getConnectors reuseToken("Use an existing token") --> getConnectors getConnectors("List connectors
\`GET /connectors\`") --> presentConnectors("User chooses a connector") --> connectorMechanism{"Connector
\`auth\_mechanism\`
?"} connectorMechanism -->|"\`webauth\`"| getWebauthFields("Show \`webauth\` fields if any
\`GET /fields\`") --> webauthCode("Get auth code
\`GET /auth/token/code\`") --> webauthOpen("Open browser
\`/webauth?#hellip;\`") --> webauthRedirect("Redirection to
\`callback\_uri\`"
with \`state\` param) --> handleState connectorMechanism -->|"\`credentials\`"| getFields("Show fields
\`GET /fields\`") --> fieldsForm("User completes form") --> fieldsPost("Submit values
\`POST /connections\`") --> handleState handleState("\[Handle connection state\](https://docs.powens.com/documentation/integration-guides/advanced/guides/handle-scas-connection-states)") " %} ### User context Connection addition is performed in the context of an authenticated user in our API. You must obtain a user-scoped access token to interact with our API. For a new user, you can create a new access token in the API using the dedicated \[\`/auth/init\`\](https://docs.budget-insight.com/reference/authentication#create-an-anonymous-user) endpoint: \`\`\` POST https://{domain}.biapi.pro/2.0/auth/init \`\`\` \`\`\`json { "client\_id": "{clientId}", "client\_secret": "{clientSecret}" } \`\`\` \`\`\`json { "auth\_token": "{accessToken}", … } \`\`\` Once obtained, this access token represents the newly created user. You have to store it and reuse it to subsequently add new connections to this user or query the associated data. ### Connector selection
If applicable for your use case, you may present to the user a list of supported connectors to pick from. You can obtain the list from the \[\`/connectors\`\](https://docs.budget-insight.com/reference/connectors##list-connectors) endpoint: \`\`\` GET https://{domain}.biapi.pro/2.0/connectors \`\`\` \`\`\`json { "connectors": \[\ {\ "id": 40,\ "name": "Connecteur de test",\ "auth\_mechanism": "credentials",\ "capabilities": \[ "bank", "document", "profile", … \],\ …\ },\ …\ \] } \`\`\` {% hint style="info" %} As we may add or modify connectors frequently, we do not recommend using a static cache of connectors. Instead, always get the current available list when adding a new connection.\\ You can manage the connectors available on your domain in the administration console. {% endhint %} You can filter the connectors list according to your needs, e.g. rely on the supported \`capabilities\`. #### Source refinement For bank connectors, we provide a mechanism to aggregate subsets of a user bank accounts through the addition of connector \*sources\*. Connectors providing both payment and non-payment accounts will usually present two or more \*sources\*. You can access the sources of a connector and their properties by expanding the previous call: \`\`\` GET https://{domain}.biapi.pro/2.0/connectors?expand=sources \`\`\` \`\`\`json { "connectors": \[\ {\ "id": 40,\ "name": "Connecteur de test",\ "sources": \[\ { "name": "directaccess", "priority": 1, "auth\_mechanism": "credentials", "capabilities": \[ … \], … },\ { "name": "openapi", "priority": 2, "auth\_mechanism": "webauth", "capabilities": \[ … \], … }\ \]\ },\ …\ \] } \`\`\` {% hint style="warning" %} Adding sources to a connection separately and sequentially is required when integrating banking connectors. Failing to specify a source when adding a connection to a connector will result in a single source being available, hence with partial access to the end-accounts. Depending on your use-case, you can filter the sources to add using the \`account\_types\` and \`capabilities\` attribute. {% endhint %} Make sure the \`disabled\` property of a source is null before interacting with it (sources can be (de)activated in your administration console). Also, the \`priority\` order of sources must be honored when adding them sequentially: add the source with the \*lowest\* \`priority\` value first. Once a source has been added, you usually give the user the choice of selecting the accounts to synchronize or adding further accounts for the chosen connector. It is also possible to not let them add another source right away, or at all. For example, if you are only interested in payment accounts, we strongly recommend that you only offer to add the only source that provides these account types. ### Add the connection or source The required flow varies depending on the \`auth\_mechanism\` of the selected connector or source. #### Credentials connector/source The \`credentials\` mechanism involves presenting a form with a set of fields and posting the values to the API to create the connection.
First, \[determine the fields\](https://docs.powens.com/api-reference/user-connections/connectors#connectorfield-object) that you must present to the user. You can obtain them by expanding the list of connectors call above (\`?expand=fields\`), or perform a dedicated call: \`\`\` GET https://{domain}.biapi.pro/2.0/connectors/{connectorId}/fields \`\`\` \`\`\`json { "fields": \[\ {\ "name": "login",\ "label": "Identifiant",\ "type": "text",\ "required": true,\ "connector\_sources": \[ "directaccess" \]\ },\ {\ "name": "password",\ "label": "Mot de passe",\ "type": "password",\ "required": true,\ "connector\_sources": \[ "directaccess" \]\ },\ …\ \] } \`\`\` If you are adding a single source to the connector, you should filter out the fields that do not match the name of the source. When adding a secondary source in a sequential experience, you should also filter out fields that are associated with sources already added, as the value is not required. You should build and present a UI that handles all the possible configurations of form fields. We recommend that you present the \`label\` and \`description\` texts with the input control, and that you pre-validate the input using the \`required\` and \`regex\` properties. When the user validates the form, send the chosen connector ID (optionally with the source) and the field values to the \[creation endpoint\](https://docs.powens.com/api-reference/user-connections/connections): \`\`\` POST https://{domain}.biapi.pro/2.0/users/me/connections?source=openapi \`\`\` \`\`\`json { "id\_connector": 4, "login": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…", "password": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" } \`\`\` \`\`\`json { "id": 123, "state": null, … } \`\`\` {% hint style="warning" %} All the field values must be \[end-to-end encrypted\](/documentation/integration-guides/advanced/end-to-end-encryption.md) when sent to the API. {% endhint %} The above call will result in the creation of a new connection, returned in the response. As credentials are \*synchronously\* checked during this step, handle the HTTP connection appropriately to avoid timeouts. When adding additional sources to an existing connection, use the same request on the \[update endpoint instead\](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection). {% hint style="info" %} Connections or sources created with invalid credentials (refused by the establishment) are deleted at once. A new connection has to be created in that case when re-validating the form. Make sure you also handle the \`wrongpass\` error code that can be raised on posting the credentials. {% endhint %} #### Webauth connector/source The \`webauth\` mechanism involves delegating the authorization to a webview that should be presented to the end-user in a browser.
First, as with the \`credentials\` mechanism, determine the fields that you must present for the chosen connector. Check for any field whose \`auth\_mechanisms\` include \`webauth\`: \`\`\` GET https://{domain}.biapi.pro/2.0/connectors/{connectorId}/fields \`\`\` \`\`\`json { "fields": \[\ {\ "auth\_mechanisms": \[ "webauth" \],\ "name": "website",\ "label": "Type de compte",\ "type": "list",\ "values": \[ … \]\ },\ …\ \] } \`\`\` When adding a secondary source in a sequential experience, you should filter out fields that are associated with sources already added, as the value is not required. Once the user validates the form if any, \[obtain a temporary code\](https://docs.powens.com/api-reference/overview/authentication#generate-a-temporary-code) linked to your token to secure the connection addition: \`\`\` GET https://{domain}.biapi.pro/2.0/auth/token/code \`\`\` \`\`\`json { "code": "xxxxxx", … } \`\`\` Then, open the \[webauth endpoint\](https://docs.powens.com/api-reference/user-connections/connections#redirect-to-a-url-for-web-authorization) in a browser and specify the connector ID and source: \`\`\` https://{domain}.biapi.pro/2.0/webauth ?client\_id={clientId} &token={temporaryCode} &id\_connector={connectorId} &source={optionalSource} &redirect\_uri={yourCallbackUri} \`\`\` In the case there were presented fields, submit their values along with these parameters. The \`redirect\_uri\` that you provide here is required to match the configuration set in the administration console. After authorization has been granted by the user in the webview, you will be redirected to the provided \`redirect\_uri\`, with additional parameters added in the query: \`\`\` {yourCallbackUri} ?id\_connection=123 &state=null \`\`\` ### Resume connection state Immediately after the connection or source is created, we may need additional information or an SCA to perform the first synchronization of the connection. According to the \`state\` of the connection or the source (either obtained in the API response or as a parameter of the redirect URI), you must take the steps described in \[the guide dedicated to connection state handling\](/documentation/integration-guides/sca-and-connection-states.md).
### Activate bank accounts and subscriptions After a new connection or source is added and synced, new bank accounts and subscriptions are discovered and made available in the API.\\ However, due to GDPR enforcement, full synchronization is not enabled on these resources as an explicit and dedicated end-user approval is required. By default, they are flagged with the \`disabled\` property.
You may \[list the accounts\](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#list-bank-accounts)/\[subscriptions\](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions) and prompt the end-user for activating them: \`\`\` GET https://{domain}.biapi.pro/2.0/users/me/connections/{connectionId}/accounts?all \`\`\` \`\`\`json { "accounts": \[\ { "id": 1234, "name": "Current account", "disabled": "2020-06-01 12:34:56", … },\ { "id": 4567, "name": "Saving account", "disabled": "2020-06-01 12:34:56", … },\ …\ \] } \`\`\` {% hint style="info" %} You can also use the \`expand=all\_accounts,all\_subscriptions\` feature on a connection to get the activable resources at once. {% endhint %} Once desired sources have been added, and the user has selected the appropriate accounts/subscriptions, you can active the accounts/subscriptions to enable the synchronization of their transactions and documents: \`\`\` PUT https://{domain}.biapi.pro/2.0/users/me/connections/{connectionId}/accounts/1234,4567?all \`\`\` \`\`\`json { "disabled": false } \`\`\` {% hint style="info" %} The UI to activate bank accounts or subscriptions is the recommended place to perform sequential addition of optional sources. First, let the user add the first source only using the above steps. Then, on listing the available accounts, you can propose an option to add more accounts by adding the next source if available (enabling accounts must be done in one call after the addition of the sources): {% endhint %}
### Persist the created user If you created a temporary user on initializing the process, you must eventually \[convert your temporary token\](https://docs.powens.com/api-reference/overview/authentication#exchange-a-temporary-code-for-a-permanent-user-access-token) to a permanent access token. You may store this new token to access data of the user: \`\`\` POST https://{domain}.biapi.pro/2.0/auth/token/access \`\`\` \`\`\`json { "grant\_type": "authorization\_code", "client\_id": "{clientId}", "client\_secret": "{clientSecret}", "code": "{temporaryAccessToken}" } \`\`\` \`\`\`json { "token": "{longLivedAccessToken}" } \`\`\` --- # 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://docs.powens.com/documentation/integration-guides/advanced/custom-connection-implementation.md?ask=&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. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption.md). # End-to-end encryption Banking credentials are very sensitive data. As an integrator of our services, you must ensure that confidentiality is guaranteed all the way from the user interface where they are entered, to our API endpoint where they are consumed. The whole transmission flow must be processed over a \[secure transport protocol\](https://en.wikipedia.org/wiki/HTTPS), but it may still involve intermediate components such as third-party API servers or caches that are \*\*not\*\* legally authorized to handle cleartext credentials. {% hint style="info" %} Implementing end-to-end encryption is \*\*mandatory\*\* for both BI agents and partners when not using our Connect webview. Encryption is strongly advised for white-mark contracts. {% endhint %} Our API allows you to secure user credentials transmission using \[asymmetric key cryptography\](https://en.wikipedia.org/wiki/Public-key\_cryptography), by encrypting values \*\*before they are transmitted\*\* to your intermediate architecture. The resulting payload can only be decrypted by our API. UserUser InterfaceIntermediate APIOur APIEncrypt credentialsDecrypt credentials🔓 Enter credentials🔒 Encrypted credentials🔒 Encrypted credentials ### Endpoints support End-to-end encryption apply to the following endpoints: \* \[Connection creation\](https://docs.powens.com/api-reference/user-connections/connections) for initial values of a connector's fields (this endpoint is only accessible to agents and white-mark contracts); \* \[Connection update\](https://docs.powens.com/api-reference/user-connections/connections#update-a-connection) for values of transient additionnal fields; \* Transfer update for values of transient additionnal fields; \* \[Payment update for static field values\](/documentation/integration-guides/pay-by-bank/advanced/implementing-your-own-payment-validation-webview.md#prepare-the-expected-fields), when implementing a validation webview. ### Encryption steps End-to-end encryption consists in substituting every cleartext sensitive values in HTTP requests with an encrypted \[JSON Web Encryption (JWE) payload\](https://tools.ietf.org/html/rfc7516). The resulting HTTP request body is still a JSON object, with modified values.
POST /user/me/connections
{
  "id\_connector": 33,
  "username": "john",
  "password": "cleartext"
}
POST /user/me/connections
{
  "id\_connector": 33,
  "username": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",
  "password": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…"
}
Before: Cleartext credentials as string value in request bodyAfter: Sensitive values are encrypted in request body
{% hint style="info" %} We strongly advise relying on existing cryptography libraries to achieve proper JWE encryption. The choice of a library will likely vary with your specific environment and configuration. We suggest the following projects: \* \[js-jose\](https://github.com/square/js-jose), a JavaScript library with good browser compatibility, available as an \[npm package\](https://www.npmjs.com/package/jose-jwe-jws); \* \[Nimbus JOSE\](https://connect2id.com/products/nimbus-jose-jwt), a Java library usable in Android native apps; \* \[JOSESwift\](https://github.com/airsidemobile/JOSESwift), a framework written in Swift, usable in iOS native apps; \* \[jwcrypto\](https://jwcrypto.readthedocs.io/), a Python2/3 implementation. {% endhint %} Implementation details vary with each library. They usually include the following steps: 1. Obtain the public end-to-end encryption key associated with your API domain by calling the following endpoint. The key is available as a \[JSON Web Key (JWK)\](https://tools.ietf.org/html/rfc7517). 2. \`\`\`http GET /publickey \`\`\` 3. Import the key according to the library documentation. 4. If needed, convert text values of credentials to raw bytes (UTF-8 encoding). 5. Encrypt the payload according to the library documentation, with \*\*RSA-OAEP-256\*\* padding and \*\*A256GCM\*\* algorithm. We require the key ID (\`kid\`) to be included in the JWE header. 6. Serialize the JWE to its compact format (URL-safe Base64 parts delimited by period), ready to be sent to our API. {% hint style="info" %} Encryption keys are available in the \[administration console\](https://console.budget-insight.com/), on your domain's settings page. {% endhint %} ### Examples
TypeScript integration using js-jose library \`\`\`js import { Jose } from 'jose-jwe-jws'; async encrypt(values: { \[key: string\]: any }): Promise<{ \[key: string\]: any }> { // Import your public key const jwkRsa = JSON.parse('') as JWKRSA; const key = await Jose.Utils.importRsaPublicKey(jwkRsa, 'RSA-OAEP'); // Prepare an encrypter const cryptographer = new Jose.WebCryptographer(); const encrypter = new Jose.JoseJWE.Encrypter(cryptographer, key); encrypter.addHeader('kid', jwkRsa.kid); // Encrypt cleartext values independently const encrypted: { \[key: string\]: string } = {}; for (const k of Object.keys(values)) { encrypted\[k\] = await encrypter.encrypt(values\[k\]); } return encrypted; } \`\`\`
Kotlin integration using Nimbus JOSE library \`\`\`kotlin import com.nimbusds.jose.\* import com.nimbusds.jose.crypto.RSAEncrypter import com.nimbusds.jose.jwk.RSAKey fun encrypt(values: Map) : Map { // Import your public key val key = RSAKey.parse('') // Prepare an encrypter val header = JWEHeader.Builder(JWEAlgorithm.RSA\_OAEP\_256, EncryptionMethod.A256GCM) .keyID(key.keyID) .build() val encrypter = RSAEncrypter(key) // Encrypt cleartext values independently return values.mapValues { JWEObject(header, Payload(it.value.toString().toByteArray())) .also { it.encrypt(encrypter) } .serialize() } } \`\`\`
Swift integration using JOSESwift library \`\`\`swift import JOSESwift func encrypt(values: \[String: String\]) throws -> \[String: String\] { // Import your public key let keyJson = try JSONSerialization.jsonObject( with: "".data(using: .utf8)!, options: .allowFragments ) as? \[String: String\] guard let keyData = try? JSONSerialization.data(withJSONObject: keyJson) else { throw EncryptionError } let jwk = try? RSAPublicKey(data: keyData) let key = try? jwk?.converted(to: SecKey.self) // Prepare an encrypter var header = JWEHeader(algorithm: .RSAOAEP256, encryptionAlgorithm: .A256CBCHS512) header.kid = keyJson!\["kid"\] guard let encrypter = Encrypter( keyEncryptionAlgorithm: .RSAOAEP256, encryptionKey: key, contentEncyptionAlgorithm: .A256CBCHS512 ) else { throw EncryptionError } // Encrypt cleartext values independently var encrypted: \[String: String\] = \[:\] for key in values.keys { guard let data = values\[key\]?.data(using: .utf8) else { throw EncryptionError } let payload = Payload(data) guard let jwe = try? JWE(header: header, payload: payload, encrypter: encrypter) else { throw EncryptionError } encrypted\[key\] = jwe.compactSerializedString } return encrypted } \`\`\`
--- # 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://docs.powens.com/documentation/integration-guides/advanced/end-to-end-encryption.md?ask=&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. --- # Market orders | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders.md) . API endpoints[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#list-investments) ------------------------------------------------------------------------------------------------------------------ Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _user token_. List market orders[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#list-market-orders) ------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/marketorders` List market orders related to a user. #### Path Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. 200: OK List of market orders Response body: [MarketOrdersList object](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketorderslist-object) Filtering route aliases: Copy /users/{userId}/accounts/{accountId}/marketorders /users/{userId}/connections/{connectionId}/marketorders Get a market order[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#get-a-market-order) ------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/marketorders/{marketOrderId}` Get a single market order by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#path-parameters-1) Name Type Description marketOrderId\* Integer ID of the market order. 200: OK Market order details Response body: [MarketOrder object](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketorder-object) Data model[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#data-model) --------------------------------------------------------------------------------------------------------- ### _MarketOrdersList_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketorderslist-object) Property Type Description `marketorders` Array of [_MarketOrder_](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketorder-object) objects List of market orders. ### _MarketOrder_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketorder-object) Property Type Description `id` Integer ID of the market order. `id_account` Integer ID of the related account. `number` String Number of the market order. `label` String Display name of the market order. `code` String or null Technical code (ISIN) of the market order. `stock_symbol` String or null Stock ticker symbol of the investment in the associated stock market. `order_direction` [_MarkerOrderDirection_](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketorderdirection-object) object Market order direction. `order_type` [_MarkerOrderType_](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketordertype-object) object Market order type. `stock_market` String or null Stock market on which the order was executed (examples: "NASDAQ", "Xetra"…). `state` String Current state of the market order (examples: "Executed", "Pending"…). `payment_method` String Payment method ("CASH", "DEFERRED", "UNKNOWN"). `date` DateTime or null Creation date of the market order. `execution_date` DateTime or null Execution date of the market order. `validity_date` DateTime or null Validity date of the market order. `quantity` Decimal or null Quantity of stocks purchased or sold. `amount` Decimal or null Total amount that was purchased or sold. `ordervalue` Decimal or null Limit or Trigger value (only applicable for "Limit" or "Trigger" types). `unitprice` Decimal or null Value of one stock when the order was executed. `unitvalue` Decimal or null Current value of the related stock. `deleted` DateTime or null Deletion date for market orders that no longer exist (`null` if still present). `last_update` DateTime Date of the last synchronization of the investment. ### _MarketOrderDirection_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketorderdirection-object) Property Type Description `id` Integer ID of the the market order direction. `name` String Market order direction: `BUY` or `SALE`. ### _MarketOrderType_ object[](https://docs.powens.com/api-reference/products/wealth-aggregation/market-orders#marketordertype-object) Property Type Description `id` Integer ID of the the market order type. `name` String Market order type: `MARKET`, `LIMIT`, `TRIGGER or UNKNOWN`. [PreviousInvestments](https://docs.powens.com/api-reference/products/wealth-aggregation/investments) [NextPockets](https://docs.powens.com/api-reference/products/wealth-aggregation/pockets) Last updated 6 months ago --- # Account Ownerships | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships.md) . This feature is not activated by default on your domain. Please contact us to request access. API endpoints[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#api-endpoints) --------------------------------------------------------------------------------------------------------------------- List account ownerships[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#list-account-ownerships) ----------------------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{user_id}/account_ownerships` List all account ownerships available in the API. #### Path Parameters[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. 200: OK List of account ownerships Response body: [AccountOwnership object](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships#accountownership-object) **Data model**[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#data-model) ------------------------------------------------------------------------------------------------------------------- ### _AccountOwnership_ object[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#accountownership-object) Property Type Description `id_account` Integer ID of the related bank account. `id_connection` Integer ID of the related connection. `id_user` Integer ID of the related user. `id_connector_source` Integer Id of the related connector source. `name` String or null The name of the bank account. `bank_name` String or null The name of the bank. `multiple_holders` Boolean or null Whether this account has multiple holders. It is null if it is not possible to determine it. `calculated` Array List the properties of account ownerships which are calculated. The array is either empty or with the `multiple_holders` value when this property is calculated. `usage` [BankAccountUsage values](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountusage-values) Usage of the bank account. `parties` Array of [AccountParty object](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships#accountparty-object) List of account parties. `identifications` Array of [AccountIdentifications object](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships#accountidentifications-object) List of account identifications. ### _**AccountParty**_ **object**[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#accountparty-object) Property Type Description `role` [AccountPartyRole values](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships#accountpartyrole-values) Role of the party. `identity` [IdentityParty object](https://docs.powens.com/api-reference/products/data-aggregation/account-ownerships#identityparty-object) Identity of the party. ### _**IdentityParty**_ **object**[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#identityparty-object) Value Type Description `is_user` Boolean or null Whether this account party represents the PSU, holder of the connection. It is null when it is not possible to verify this relation. `full_name` String Full name of the account party. ### _**AccountIdentifications object**_[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#accountidentifications-object) Property Type Description `scheme_name` [AccountSchemeName](https://docs.powens.com/api-reference/products/banking-aggregation/bank-transactions#accountschemename-values) Name of the account scheme type. `identification` String Identification number of the account. ### _**AccountPartyRole values**_[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#accountpartyrole-values) Value Description `holder` Entity which is the holder of the account. `co_holder` Entity which shares with others the holding of the account. `attorney` Generic case of a person having a mandate to access the account data. `custodian_for_minor` Entity that holds shares/units on behalf of a legal minor. `legal_guardian` Entity that was appointed by a legal authority to act on behalf of a person judged to be incapacitated. `nominee` Entity named by the beneficial owner to act on its behalf. `successor_on_death` Deceased's estate, or successor. `trustee` Legal owner of the property. `unknown` Unknown party. Webhook[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#webhook) --------------------------------------------------------------------------------------------------------- ### Account Ownerships found[](https://docs.powens.com/api-reference/products/banking-aggregation/account-ownerships#account-ownerships-found) An `ACCOUNT_OWNERSHIPS_FOUND` webhook is emitted during a sync after a bank ownerships have been synchronized. Webhook request: Property Type Description `account_ownerships` _AccountOwnership_ object The account ownerships related to the sync. [PreviousCurrencies](https://docs.powens.com/api-reference/products/data-aggregation/currencies) [NextAccount ownership certificate](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate) Last updated 6 months ago --- # Configuration | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/api-setup/configuration.md) . API endpoints[](https://docs.powens.com/api-reference/api-setup/configuration#api-endpoints) --------------------------------------------------------------------------------------------- Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _config token_. The _config token_ is only available in the _Settings_ section of the [console](https://console.budget-insight.com/) . ### Configuration management[](https://docs.powens.com/api-reference/api-setup/configuration#configuration-management) Get the domain configuration[](https://docs.powens.com/api-reference/api-setup/configuration#get-the-domain-configuration) --------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/config` #### Query Parameters[](https://docs.powens.com/api-reference/api-setup/configuration#query-parameters) Name Type Description search String Limit the results to keys matching the given value. 200: OK Domain configuration Response body: Key-value object Update the domain configuration[](https://docs.powens.com/api-reference/api-setup/configuration#update-the-domain-configuration) --------------------------------------------------------------------------------------------------------------------------------- `POST` `https://{domain}.biapi.pro/2.0/config` Request body: Key-value object #### Query Parameters[](https://docs.powens.com/api-reference/api-setup/configuration#query-parameters-1) Name Type Description search String Limit the results to keys matching the given value. 200: OK Domain configuration updated Response body: Key-value object ### Configuration logs[](https://docs.powens.com/api-reference/api-setup/configuration#configuration-logs) Get the logs of configuration updates[](https://docs.powens.com/api-reference/api-setup/configuration#get-the-logs-of-configuration-updates) --------------------------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/config/logs` #### Query Parameters[](https://docs.powens.com/api-reference/api-setup/configuration#query-parameters-2) Name Type Description search String Limit the results to keys matching the given value. type String Type of change done on the configuration. min\_date Date Minimal date of the change. max\_date Date Maximal date of the change. 200: OK Domain configuration Response body: Key-value object ### Certificates management[](https://docs.powens.com/api-reference/api-setup/configuration#certificates-management) Get a certificate[](https://docs.powens.com/api-reference/api-setup/configuration#get-a-certificate) ----------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi/pro.2.0/certificate/{type}` Get a certificate by type. #### Path Parameters[](https://docs.powens.com/api-reference/api-setup/configuration#path-parameters) Name Type Description type\* String Type of the certificate. 200: OK Certificate Response body: [Certificate object](https://docs.powens.com/api-reference/api-setup/configuration#certificate-object) Configuration keys[](https://docs.powens.com/api-reference/api-setup/configuration#get-configuration) ------------------------------------------------------------------------------------------------------ Configuration key Type Default Description `autosync.retry_wrongpass` Boolean 1 Allows to retry automatic synchronizations for connections in "wrongpass" error state. Second attempt occurs 12 hours later. Next attempts will then occur every 7 days. `biapi.allowed_origins` String Empty string Specifies authorized website domains when [cross-origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is needed (when using iframe on webpages for instance). Multiple origins can be defined, comma separated. `biapi.manager.email` String Empty string Sets the recipient email address of the webhook error emails. `connection_certificate.language` String fr Language of the [account ownership certificate](https://docs.powens.com/api-reference/products/data-aggregation/account-ownership-certificate) , which also determines the issuing entity and the legal template used. Accepted values are `es` and `fr`. `connectors.default_auth_mechanism` String Empty string Defines the auth\_mechanism to be used if not already defined for the source or its related connector. Accepted values are `webauth` and `credentials`. `connectors.enable_new` Boolean 0 Enables new connectors by default as soon as they are deployed. `connectors.sources.enable_new` Boolean 1 Enables new sources on connectors. If not, new sources are disabled by default. `oauth2.enabled` Boolean 1 Enables [OAuth2 protocol](https://en.wikipedia.org/wiki/OAuth) . `webhooks.alerts_frequency` Decimal 1 Defines the frequency of webhooks alerts, in days. `webhooks.compressions.enabled` Boolean 0 Enables the compression of the HTTP body of your webhook into gzip format. `payment.max_amount` Decimal 0 Defines a maximum authorized amount for pay transactions. 0 is considered as if the value was not set. There is no maximum. **Data model**[](https://docs.powens.com/api-reference/api-setup/configuration#data-model) ------------------------------------------------------------------------------------------- ### _**Certificate**_ **object**[](https://docs.powens.com/api-reference/api-setup/configuration#certificate-object) Property Type Description `id` Integer ID of the certificate. `type` String The type of certificate. `id_public_key_file` Integer `id_private_key_file` Integer `created` DateTime [PreviousTransfers (obsolete)](https://docs.powens.com/api-reference/products/payments/transfers-obsolete) [NextClient applications](https://docs.powens.com/api-reference/api-setup/client-applications) Last updated 1 month ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.powens.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.powens.com/documentation/ressources/tools.md). # Tools --- # 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://docs.powens.com/documentation/ressources/tools.md?ask=&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. --- # Demonstration | Demo integration For the complete documentation index, see [llms.txt](https://docs.powens.com/demo-integration/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/demo-integration/demonstration.md) . Try out our D**emo webview** ---------------------------- [](https://demo.powens.com/) ![Cover](https://docs.powens.com/demo-integration/~gitbook/image?url=https%3A%2F%2F491826142-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdgDZQlFrYI3G3Ovf9fyB%252Fuploads%252FmzN25AmgREzgvY7ZicQQ%252FFrame%252018829.png%3Falt%3Dmedia%26token%3D5fa47cfc-c9c8-41af-aa91-612663c6292e&width=752&dpr=3&quality=100&sign=ab87bbe84a18089625b07d1af8e213a8&sv=3) Add a bank connection to share banking data [**\-> Related documentation**](https://docs.powens.com/documentation/integration-guides/transactions) [](https://integrate.biapi.pro/2.0/auth/webview/connect?client_id=28105838&redirect_uri=https://integrate.budget-insight.com/&connector_capabilities=document) ![Cover](https://docs.powens.com/demo-integration/~gitbook/image?url=https%3A%2F%2F491826142-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdgDZQlFrYI3G3Ovf9fyB%252Fuploads%252FWI2clAsRPFkyLVHKYHH5%252FFrame%252018830.png%3Falt%3Dmedia%26token%3D774650af-45f4-4451-8b44-8f037f935fae&width=752&dpr=3&quality=100&sign=f4b92f7219ddc850d1e39276d3a23a28&sv=3) Add a provider connection to verify customer identity [**\-> Related documentation**](https://docs.powens.com/documentation/integration-guides/proof-and-certificates-retrieval) ![](https://docs.powens.com/demo-integration/~gitbook/image?url=https%3A%2F%2F491826142-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdgDZQlFrYI3G3Ovf9fyB%252Fuploads%252FNPqK5xZugLjfUB2NJaP3%252FGroup%252033611.png%3Falt%3Dmedia%26token%3D0db75209-e58a-4122-999b-4983f58735ff&width=768&dpr=3&quality=100&sign=d2a1056d95b2c18a0d9dde572a9c8169&sv=3) Get a look to our API integration demos --------------------------------------- Please select one of the following cards to access an integration flow example [](https://integrate.powens.com/demos/connect) ![Cover](https://docs.powens.com/demo-integration/~gitbook/image?url=https%3A%2F%2F491826142-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdgDZQlFrYI3G3Ovf9fyB%252Fuploads%252FAwcf1bgWYDUNYxp4VWBv%252FConnect.png%3Falt%3Dmedia%26token%3D4246b040-73c2-49a6-bcc9-41884deb2539&width=490&dpr=3&quality=100&sign=447eb7d43d70770db759cafaca2b8dae&sv=3) **\->** [**Related documentation**](https://docs.powens.com/api-reference/user-connections/connections) [](https://integrate.powens.com/demos/manage) ![Cover](https://docs.powens.com/demo-integration/~gitbook/image?url=https%3A%2F%2F491826142-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdgDZQlFrYI3G3Ovf9fyB%252Fuploads%252FQgoy4fLH7utaa5nwSGOf%252FManage.png%3Falt%3Dmedia%26token%3D07c7518a-562a-453e-a89f-bb106b47d09e&width=490&dpr=3&quality=100&sign=9de20c84f2d74520435920999bd91d97&sv=3) **\->** [**Related documentation**](https://docs.powens.com/api-reference/overview/webview#manage-connections) [](https://integrate.powens.com/demos/reconnect) ![Cover](https://docs.powens.com/demo-integration/~gitbook/image?url=https%3A%2F%2F491826142-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdgDZQlFrYI3G3Ovf9fyB%252Fuploads%252FSzzNLqSEYb6FGcdMFQFk%252FReconnect.png%3Falt%3Dmedia%26token%3Dace19fe4-1be5-4315-b2cf-8d1ef7cb02df&width=490&dpr=3&quality=100&sign=2ea2a006655150c59cc49eedd5f9eb48&sv=3) **\->** [**Related documentation**](https://docs.powens.com/documentation/integration-guides/sca-and-connection-states#use-our-reconnect-webview) [](https://integrate.powens.com/demos/payment) ![Cover](https://docs.powens.com/demo-integration/~gitbook/image?url=https%3A%2F%2F491826142-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FdgDZQlFrYI3G3Ovf9fyB%252Fuploads%252FbiBebZPUW958HqzR1Q1d%252FPayment.png%3Falt%3Dmedia%26token%3Dbdfb05b4-0df7-43e9-b655-c4f2043aa913&width=490&dpr=3&quality=100&sign=10653163243ecb90bc55dcdc45452d67&sv=3) **\->** [**Related documentation**](https://docs.powens.com/api-reference/product/pay/payments) [](https://integrate.budget-insight.com/demos/connect) [Powens](https://www.powens.com/) @2023. Legal Notice - [Privacy Policy](https://www.powens.com/privacy-policy/) --- # Subscriptions | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions.md) . API endpoints[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#api-endpoints) ------------------------------------------------------------------------------------------------------------------ Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _user token_. List subscriptions[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#list-subscriptions) ---------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/subscriptions` #### Path Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. #### Query Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#query-parameters) Name Type Description all Value-less Flag to access disabled subscriptions. 200: OK List of subscriptions Response body: [SubscriptionsList object](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscriptionslist-object) Filtering route alias: Copy /users/{userId}/connections/{connectionId}/subscriptions Get a subscription[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#get-a-subscription) ---------------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/users/{userId}/subscriptions/{subscriptionId}` Get a single subscription by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#path-parameters-1) Name Type Description subscriptionId\* Integer ID of the subscription. userId\* Integer or "me" ID of the related user. 200: OK Subscription details Response body: [Subscription object](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-object) Subscription resources partially support an update operation to handle activation/deactivation: Update a subscription[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#update-a-subscription) ---------------------------------------------------------------------------------------------------------------------------------- `POST` `https://{domain}.biapi.pro/2.0/users/{userId}/subscriptions/{subscriptionId}` Update a single subscription by ID. Request body: [SubscriptionUpdateRequest object](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscriptionupdaterequest-object) #### Path Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#path-parameters-2) Name Type Description subscriptionId\* Integer ID of the subscription. userId\* Integer ID of the related user. #### Query Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#query-parameters-1) Name Type Description all Value-less Add this flag to access a disabled subscription. 200: OK Subscription updated Response body: [Subscription object](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-object) Life cycle[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#disabled-accounts) ------------------------------------------------------------------------------------------------------------------- Subscriptions can be in a disabled or enabled state. For legal compliance, subscriptions are disabled by default. Also, disabling subscription will result in the deletion of subscription child resources (documents). #### Querying[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#querying) Disabled subscriptions will only appear when passing the `all` parameter: Copy GET /users/{userId}/subscriptions/{id}?all GET /users/{userId}/connections/{connectionId}/subscriptions/{id}?all #### Enabling[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#enabling) To enable one such subscription, it is necessary to perform a `POST` request on that subscription, with the `all` parameter and `{ "disabled": false }`. Please note that this action represents the PSU's consent. Webhooks[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-webhooks) --------------------------------------------------------------------------------------------------------------------- ### Subscription synced[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-synced) A `SUBSCRIPTION_SYNCED` webhook is emitted during a sync after a subscription was processed, including new documents. Webhook request: [_Subscription_](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-object) object with the following additional properties: Property Type Description `documents` Array of _Document_ objects The new documents that were found. ### Subscription found[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-found) A `SUBSCRIPTION_FOUND` webhook is emitted after a **new** subscription was discovered. Webhook request: Property Type Description `id` Integer ID of the bank account. `id_user` Integer ID of the related user. `id_connection` Integer ID of the related connection. Data model[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#data-model) ------------------------------------------------------------------------------------------------------------ ### _**SubscriptionsList**_ **object**[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscriptionslist-object) Property Type Description `subscriptions` Array of [_Subscription_](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-object) objects List of subscriptions. ### _**Subscription**_ **object**[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscription-object) Property Type Description `id` Integer ID of the subscription. `id_connection` Integer or null ID of the related connection. `id_user` Integer or null ID of the related user. `id_source` Integer or null ID of the related connection source. `number` String or null Subscription number. `label` String Label of the subscription. `subscriber` String or null Name of the subscriber. `validity` Date or null The subscription is valid until this date, if any. `renewdate` Date or null Next renew date, is any. `last_update` DateTime or null Last successful update of the subscription. `deleted` DateTime or null If set, this subscription is not found on the website anymore. `disabled` DateTime or null If set, this subscription has been disabled by user and will not be synchronized anymore. `error` String or null If the last update has failed, the error code. **Available expands** The following parameters can be used for [response properties expansion](https://docs.powens.com/api-reference#responses-expansion) : Property Type Description `connection` [_Connection_](https://docs.powens.com/api-reference/user-connections/connections#connection-object) object The connection associated with this subscription. ### _SubscriptionUpdateRequest_ object[](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions#subscriptionupdaterequest-object) Property Type Required Description `disabled` Boolean No Whether the subscription must be disabled or enabled. [PreviousDOCUMENTS AGGREGATION](https://docs.powens.com/api-reference/products/documents-aggregation) [NextDocuments](https://docs.powens.com/api-reference/products/documents-aggregation/documents) Last updated 6 months ago --- # Documents | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/products/documents-aggregation/documents.md) . API endpoints[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#api-endpoints) -------------------------------------------------------------------------------------------------------------- Authentication: endpoints listed in this page _require_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _user token_. List documents[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#list-documents) ---------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi/pro/2.0/users/{userId}/documents` List documents associated with a user. #### Path Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#path-parameters) Name Type Description userId\* Integer or "me" ID of the related user. #### Query Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#query-parameters) Name Type Description id\_type Integer Filter with a document type. min\_amount Decimal Minimal (inclusive) amount. max\_amount Decimal Maximum (inclusive) amount. limit\* Integer Number of documents to return. The maximum value is 1000. 200: OK List of documents Response body: [DocumentsList object](https://docs.powens.com/api-reference/products/documents-aggregation/documents#documentslist-object) FIltering route aliases: Copy /users/{userId}/subscriptions/{subscriptionId}/documents /users/{userId}/connections/{connectionId}/documents /users/{userId}/transactions/{transactionId}/documents Get a document[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#get-a-document) ---------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi/pro/2.0/documents/{documentId}` Get a single document by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#path-parameters-1) Name Type Description documentId\* Integer or "me" ID of the document. 200: OK Document details Response body: [Document object](https://docs.powens.com/api-reference/products/documents-aggregation/documents#document-object) Document resources support update operations to edit metadata: Update a document[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#update-a-document) ---------------------------------------------------------------------------------------------------------------------- `POST` `https://{domain}.biapi/pro/2.0/documents/{documentId}` Update a single document by ID. #### Path Parameters[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#path-parameters-2) Name Type Description documentId\* Integer ID of the document. #### Request Body[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#request-body) Name Type Description id\_type Integer New type of the document. date Date New date of the document. duedate Date New due date of the document. total\_amount Decimal New total amount of the document. untaxed\_amount Decimal New untaxed amount of the document. vat Decimal New VAT amount of the document. income Boolean Is an income or an outcome. name String New name of the document. 200: OK Document updated Response body: [Document object](https://docs.powens.com/api-reference/products/documents-aggregation/documents#document-object) Data model[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#data-model) -------------------------------------------------------------------------------------------------------- ### _**DocumentsList**_ **object**[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#documentslist-object) Property Type Description `documents` Array of [_Document_](https://docs.powens.com/api-reference/products/documents-aggregation/documents#document-object) objects List of documents. `first_date` Date Minimum available date for results. `last_date` Date Maximum available date for results. `result_min_date` Date Minimum date of results in the current response. `result_max_date` Date Maximum date of results in the current response. ### _Document_ object[](https://docs.powens.com/api-reference/products/documents-aggregation/documents#document-object) Property Type Description `id` Integer ID of the document. `id_user` Integer ID of the related user. `id_subscription` Integer or null ID of the related subscription. `id_type` Integer or null ID of the related document type. `id_file` Integer or null ID of the related file. `id_thumbnail` Integer or null ID of the related thumbnail. `name` String or null `date` DateTime or null `timestamp` DateTime The moment when this document has been created. `thumb_url` String or null `url` String or null `duedate` Date or null `total_amount` Decimal or null `untaxed_amount` Decimal or null `vat` Decimal or null `income` Boolean or null `readonly` Boolean `number` String or null `issuer` String or null `last_update` DateTime or null `has_file_on_website` Boolean Whether the file is available on website. `currency` [_Currency_](https://docs.budget-insight.com/reference/bank-accounts#currency-object) or null Document currency. [PreviousSubscriptions](https://docs.powens.com/api-reference/products/documents-aggregation/subscriptions) [NextDocument types](https://docs.powens.com/api-reference/products/documents-aggregation/document-types) Last updated 6 months ago --- # Connectors | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/user-connections/connectors.md) . API endpoints[](https://docs.powens.com/api-reference/user-connections/connectors#api-endpoints) ------------------------------------------------------------------------------------------------- Authentication: endpoints listed in this page do not require authentication. ### Connectors[](https://docs.powens.com/api-reference/user-connections/connectors#connectors) List connectors[](https://docs.powens.com/api-reference/user-connections/connectors#list-connectors) ----------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/connectors` List all connectors available on the domain. This endpoint _does not require_ authentication. #### Query Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#query-parameters) Name Type Description country\_codes String Filter on countries, using comma-separated [ISO 3166-1 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) . id\_payment String Filter on a payment id to get only the connectors compatible with this payment. 200: OK List of connectors Response body: [ConnectorsList object](https://docs.powens.com/api-reference/user-connections/connectors#connectorslist-object) Deprecated route aliases: Copy /banks /providers Get a connector[](https://docs.powens.com/api-reference/user-connections/connectors#get-a-connector) ----------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/connectors/{connectorUuid}` Get a single connector by UUID. This endpoint _does not require_ authentication. #### Path Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#path-parameters) Name Type Description connectorUuid\* String UUID of the connector. IDs are also accepted (deprecated). 200: OK Connector Response body: [Connector object](https://docs.powens.com/api-reference/user-connections/connectors#connector-object) Update a connector[](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector) ----------------------------------------------------------------------------------------------------------- `PUT` `https://{domain}.biapi.pro/2.0/connectors/{connectorUuid}` This endpoint _requires_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _config token_. Request body: [ConnectorUpdateRequest object](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector-1) #### Path Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#path-parameters-1) Name Type Description connectorUuid\* String UUID of the connector. IDs are also accepted (deprecated). 200: OK Connector updated Response body: [Connector object](https://docs.powens.com/api-reference/user-connections/connectors#connector-object) Batch enable/disable connectors[](https://docs.powens.com/api-reference/user-connections/connectors#batch-enable-disable-connectors) ------------------------------------------------------------------------------------------------------------------------------------- `PATCH` `https://{domain}.biapi.pro/2.0/connectors` This endpoint _requires_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _config token_. Request body: A key-value object with connector UUIDs as keys, and [ConnectorUpdateRequest object](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector-1) as value. 200: OK Connectors updated Batch enable/disable connectors (deprecated)[](https://docs.powens.com/api-reference/user-connections/connectors#batch-enable-disable-connectors-deprecated) ------------------------------------------------------------------------------------------------------------------------------------------------------------- `PUT` `https://{domain}.biapi.pro/2.0/connectors/{connectorIds}` This endpoint _requires_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _config token_. Request body: [ConnectorUpdateRequest object](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector-1) #### Path Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#path-parameters-2) Name Type Description connectorIds\* String Comma-separated list of connector IDs to update. 200: OK Connectors updated Response body: [Connector object](https://docs.powens.com/api-reference/user-connections/connectors#connector-object) ### Connector sources[](https://docs.powens.com/api-reference/user-connections/connectors#connector-sources) List connector sources[](https://docs.powens.com/api-reference/user-connections/connectors#list-connector-sources) ------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/connectors/{connectorUuid}/sources` This endpoint _does not require_ authentication. #### Path Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#path-parameters-3) Name Type Description connectorUuid\* String UUID or the related connector. #### Query Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#query-parameters-1) Name Type Description country\_codes String Filter on countries, using comma-separated [ISO 3166-1 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) . 200: OK List of connector sources Response body: [ConnectorSourcesList object](https://docs.powens.com/api-reference/user-connections/connectors#connectorsourceslist-object) Get a connector source[](https://docs.powens.com/api-reference/user-connections/connectors#get-a-connector-source) ------------------------------------------------------------------------------------------------------------------- `GET` `https://{domain}.biapi.pro/2.0/connectors/{connectorUuid}/sources/{sourceId}` This endpoint _does not require_ authentication. #### Path Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#path-parameters-4) Name Type Description connectorUuid\* String UUID or the related connector. sourceId\* Integer ID of the connector source. 200: OK Connector source details Response body: [ConnectorSource object](https://docs.powens.com/api-reference/user-connections/connectors#connectorsource-object) Update a connector source[](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector-source) ------------------------------------------------------------------------------------------------------------------------- `PUT` `https://{domain}.biapi.pro/2.0/connectors/{connectorUuid}/sources/{sourceId}` This endpoint _requires_ [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a _config token_. Request body: [ConnectorSourceUpdateRequest object](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector-source-1) #### Path Parameters[](https://docs.powens.com/api-reference/user-connections/connectors#path-parameters-5) Name Type Description connectorUuid\* String UUID or the related connector. sourceId\* Integer ID of the connector source. 200: OK Connector source updated Response body: [ConnectorSource object](https://docs.powens.com/api-reference/user-connections/connectors#connectorsource-object) Data model[](https://docs.powens.com/api-reference/user-connections/connectors#data-model) ------------------------------------------------------------------------------------------- ### _**ConnectorsList**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#connectorslist-object) Property Type Description `connectors` Array of [_Connector_](https://docs.powens.com/api-reference/user-connections/connectors#connector-object) objects The list of connectors. The key is absent on deprecated endpoint routes. `~banks~` Array of [_Connector_](https://docs.powens.com/api-reference/user-connections/connectors#connector-object) objects (_Deprecated_) The list of connectors. The key is only present on deprecated endpoint routes. ### _**Connector**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#connector-object) Property Type Description `id` Integer ID of the connector, _not_ stable across API domains. `uuid` String Unique connector identifier, stable across API domains. `name` String Name of the bank or provider. `hidden` Boolean or null Whether this connector is hidden from users. `charged` Boolean Usage of this connector is charged. `code` String or null Bank code. `beta` Boolean If true, this connector is likely unstable. `color` String or null Branding color of the bank or provider. `slug` String or null A short letter code to identify the connector. Slugs are _not_ unique. `~sync_frequency~` Decimal or null _(Deprecated)_ How many days to wait between syncs. `months_to_fetch` Integer or null Number of months of history to fetch when synchronizing a connection. `auth_mechanism` [_AuthMechanism_](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) string or null Authentication mechanism to use to add a connection. `available_auth_mechanisms` Array of [_AuthMechanism_](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) strings The list of available mechanisms to add a connection (internal use only). `transfer_mechanism` [_AuthMechanism_](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) or null Authentication mechanism to use to validate a transfer. `siret` String SIRET code, for providers. `restricted` Boolean If true, new connections cannot be added with this connector. `capabilities` Array of strings The list of capabilities implemented on the connector. E.g. `profile` means that the connector is able to return [identity information](https://docs.powens.com/api-reference/products/data-aggregation/identities-obsolete) . `account_usages` Array of [_BankAccountUsage_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountusage-values) strings The list of account usages returned by the sources of the connector. `payment_settings` [_PaymentSettings_](https://docs.powens.com/api-reference/user-connections/connectors#paymentsettings-object) object An object providing information about payment feature on this connector. Only present if _Pay_ product is enabled on the connector. `products` Array of [_Product_](https://docs.powens.com/api-reference/user-connections/connectors#product-values) strings The list of products implemented on the connector. (e.g. `pay` means that the connector has Pay product). #### **Available expands**[](https://docs.powens.com/api-reference/user-connections/connectors#available-expands) The following parameters can be used for [response properties expansion](https://docs.powens.com/api-reference#responses-expansion) : Property Type Description `sources` Array of [_ConnectorSource_](https://docs.powens.com/api-reference/user-connections/connectors#connectorsource-object) objects The details of the sources available for the connector. `fields` Array of [_ConnectorField_](https://docs.powens.com/api-reference/user-connections/connectors#connectorfield-object) objects The list of initial form fields associated with the connector. Only relevant when building a custom connection integration. `payment _fields` Array of [_ConnectorPaymentField_](https://docs.powens.com/api-reference/user-connections/connectors#connectorpaymentfield-object) objects The list of initial form fields to use when validating a payment. Only relevant when [implementing your own payment validation webview](https://docs.powens.com/documentation/integration-guides/pay/advanced/implementing-your-own-payment-validation-webview) . `countries` Array of [_ConnectorCountry_](https://docs.powens.com/api-reference/user-connections/connectors#connectorcountry-object) objects Countries where users can open or have accounts/subscriptions with the given institution. `urls` Array of strings List of connector's URLs from which we get the data. ### _**AuthMechanism**_ **values**[](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) Value Description `credentials` Connections will use a set of fields to save user credentials. `webauth` Connections will use a web-based flow to obtain access. Forward compatibility requirement: additional mechanisms may be added in the future. When implementing mechanism handling, always safely handle unsupported values. ### _**ConnectorField**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#connectorfield-object) Name Type Description `name` String The technical name of the field, used as a key when sending the values for the field. `connector_sources` Array of strings The list of [connector source names](https://docs.powens.com/api-reference/user-connections/connectors#connectorsource-object) for which the field is relevant. Fields should be presented sequentially according to the source being added. The value can differ with the `auth_mechanism` preferentially used. `auth_mechanisms` Array of [_AuthMechanism_](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) strings The list of mechanisms for which the field is relevant. Fields should be presented sequentially according to the source being added. `type` [_ConnectorFieldType_](https://docs.powens.com/api-reference/user-connections/connectors#connectorfieldtype-values) string Type of the field, to be used to present an appropriate UI form field to the end-user. Implementations should ignore unsupported types and fallback to a text field. `label` String A short display label for the field. `required` Boolean If true, the parameter is required, with a non-empty value, when creating a connection. `regex` String or null An optional regular expression (PCRE-compatible) that the field value must validate. `values` Array of objects For `list` fields, a closed list of fixed values to chose from. Entries are composed of `label` (string, display value of the field) and `value` (string, the actual value to send for the field). ### _**ConnectorPaymentField**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#connectorpaymentfield-object) Name Type Description `name` String The technical name of the field, used as a key when sending the values for the field. `auth_mechanisms` Array of strings The list of validation mechanisms for which the field is relevant. Fields should be presented sequentially according to the source being added. `type` [_ConnectorFieldType_](https://docs.powens.com/api-reference/user-connections/connectors#connectorfieldtype-values) string Type of the field, to be used to present an appropriate UI form field to the end-user. Implementations should ignore unsupported types and fallback to a text field. `label` String A short display label for the field. `required` Boolean If true, the parameter is required, with a non-empty value, when creating a connection. `regex` String or null An optional regular expression (PCRE-compatible) that the field value must validate. `values` Array of objects For `list` fields, a closed list of fixed values to chose from. Entries are composed of `label` (string, display value of the field) and `value` (string, the actual value to send for the field). ### _**ConnectorFieldType**_ **values**[](https://docs.powens.com/api-reference/user-connections/connectors#connectorfieldtype-values) Value Description `text` A simple text field. `password` A simple text field for a sensitive value. Implementations should provide secure typing for such fields. `date` A date field. Input should be proposed in a user-friendly manner with a picker or a localized text input, but the value must be submitted as an ISO 8601 date string (yyyy-mm-dd). `list` A field whose value must be chosen in a closed list of `values`. The field can be presented with a dropdown or a similar control. ### _**ConnectorCountry**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#connectorcountry-object) Name Type Description `id` String The country ISO 3166‑1 alpha‑2 code. `name` String The country name. ### _**PaymentSettings**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#paymentsettings-object) Name Type Description `available_validate_mechanisms` Array of strings The list of payment validation mechanisms supported by this connector. As of Sept. 2023, the only supported mechanism is `webauth`. `beneficiary_types` Array of [_PaymentAccountSchemeName_](https://docs.powens.com/api-reference/products/payments/payments#paymentaccountschemename-values) The list of supported payment beneficiary types for this connector. `execution_date_types` Array of [_ExecutionDate_](https://docs.powens.com/api-reference/products/payments/payments#executiondate-values) The list of supported payment types. `execution_frequencies` Array of [_ExecutionFrequency_](https://docs.powens.com/api-reference/products/payments/payments#executionfrequency-values) The list of supported periodic payment frequencies. `maximum_number_of_instructions` Integer The maximum number of individual instructions for one payment. If `1`, the connector does not support Bulk payments. `providing_payer_account` [_ProvidingPayerAccount_](https://docs.powens.com/api-reference/user-connections/connectors#providingpayeraccount-values) Indicates if the connector needs the payer account identification in order to initiate a payment with their bank. `partial_status_tracking` Array of [_ExecutionDate_](https://docs.powens.com/api-reference/products/payments/payments#executiondate-values) Indicates for which payment date types a payment can reach the final state `accepted` for this connector, meaning the bank does not provide us with the full tracking of the payment status. See [PaymentState values](https://docs.powens.com/api-reference/products/payments/payments#paymentstate-values) for more information. An empty list indicates that payments will never get the state `accepted` on this connector. `is_app_to_app_used` [_PaymentAppToAppUsed_](https://docs.powens.com/api-reference/user-connections/connectors#paymentapptoappused-object) Whether redirects can be caught by native applications on mobile platforms. `bank_provides_payer_account` Boolean or null Whether the bank provides the payer account or not. `null` means this information is not yet available. `bank_provides_payer_label` Boolean or null Whether the bank provides the payer account label or not. `null` means this information is not yet available. `transfer_date_types_where_` `trusted_beneficiary_required` Array of [_ExecutionDate_](https://docs.powens.com/api-reference/products/payments/payments#executiondate-values) List of execution date types for which the beneficiary must be trusted beforehand by the payer. `cancellation _available` Boolean Whether [cancellation](https://docs.powens.com/documentation/integration-guides/pay/cancelling-a-payment) is available for this connector. `minimum_amount` PaymentAmount The minimum amount for a payment on this connector. The amount can differ between payment types. `maximum_amount` PaymentAmount The maximum amount for a payment on this connector. The amount can differ between payment types. Note that this amount is not necessarily a hard limit and a PSU payment account could have a specific transfer limit (whether higher or lower). `minimum_date_delta_days` Decimal The minimum number of days in the future for a deferred or periodic payment. `maximum_date_delta_days` Decimal or null The maximum number of days in the future for a deferred or periodic payment. An example `payment_settings` object is the following: Copy { "available_validate_mechanisms": ["webauth"], "beneficiary_types": ["iban"], "execution_date_types": ["first_open_day", "deferred", "periodic"], "execution_frequencies": ["monthly", ...], "maximum_number_of_instructions": 10, "partial_status_tracking": ["first_open_day"], "is_app_to_app_used": { "android": false, "ios": null }, "bank_provides_payer_account": true, "bank_provides_payer_label": null, "transfer_date_types_where_trusted_beneficiary_required": ["periodic"], "cancellation_available": true, "minimum_amount": { "first_open_day": 0., "deferred": 0., "instant": 0. }, "maximum_amount": { "first_open_day": 4000., "deferred": 4000., "instant": 1000. }, "minimum_date_delta_days": 1, "maximum_date_delta_days": 30, } ### _**ProvidingPayerAccount**_ **values**[](https://docs.powens.com/api-reference/user-connections/connectors#providingpayeraccount-values) Value Description `not_used` The payer account is not necessary and must not be given. `optional` The payer account is optional. Providing the account may have an impact on the bank's webview (e.g. the payment account may be preselected for the user, or the user may not have the possibility to change it for another one). `mandatory` The payer account must be provided. The bank does not allow a payment initiation without this information. ### _**PaymentAppToAppUsed**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#paymentapptoappused-object) Name Type Description `android` Boolean or Null Whether redirections can be caught by a native application or not on Android. `ios` Boolean or Null Whether redirections can be caught by a native application or not on Apple iOS. For all platforms, `null` means that the information is not available yet. Note that `true` does not mean the redirections are necessarily caught by a native application, since the end user may not have installed the appropriate application for this to happen. An example `PaymentAppToAppUsed` object is the following: Copy { "android": false, "ios": null } ### _**PaymentAmount**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#paymentamount-object) Value Type Required Description first\_open\_day Decimal No The amount limit for first open day payments. instant Decimal No The amount limit for instant payments. deferred Decimal No The amount limit for deferred payments. periodic Decimal No The amount limit for periodic payments. ### _**Product**_ **values**[](https://docs.powens.com/api-reference/user-connections/connectors#product-values) Value Description `bank` Bank product. `wealth` Wealth product. `bill` Bill product. `pay` Pay product. ### _ConnectorUpdateRequest_ object[](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector-1) Name Type Required Description `hidden` Boolean No Whether the connector is hidden from users. `~sync_periodicity~` Decimal No _(Deprecated)_ Number of days between two automatic synchronizations. Overload global `sync_periodicity` parameter. ### _**ConnectorSourcesList**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#connectorsourceslist-object) Property Type Description `sources` Array of [_ConnectorSource_](https://docs.powens.com/api-reference/user-connections/connectors#connectorsource-object) objects List of connector sources. ### _**ConnectorSource**_ **object**[](https://docs.powens.com/api-reference/user-connections/connectors#connectorsource-object) Property Type Description `id` Integer ID of the connector source. `id_connector` Integer ID of the related connector. `name` String Name of the connector source. `auth_mechanism` [_AuthMechanism_](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) string or null Authentication mechanism to use to add a connection source. `available_auth_mechanisms` Array of [_AuthMechanism_](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) strings The list of available mechanisms to add a connection source. `disabled` DateTime or null If set, this source is ignored on synchronizing the connection. `priority` Integer The source priority order for the synchronization. Sources must be added following priority order. `account_usages` Array of [_BankAccountUsage_](https://docs.powens.com/api-reference/products/data-aggregation/bank-accounts#bankaccountusage-values) strings The list of account usages returned by the source. ### _ConnectorSourceUpdateRequest_ object[](https://docs.powens.com/api-reference/user-connections/connectors#update-a-connector-source-1) Property Type Required Description `auth_mechanism` [_AuthMechanism_](https://docs.powens.com/api-reference/user-connections/connectors#authmechanism-values) string No The authentication mechanism to use for this connector source. `disabled` DateTime or null No If set, this source is ignored on synchronizing the connection. [PreviousUsers](https://docs.powens.com/api-reference/user-connections/users) [NextConnections](https://docs.powens.com/api-reference/user-connections/connections) Last updated 6 months ago --- # Webview | API Reference For the complete documentation index, see [llms.txt](https://docs.powens.com/api-reference/llms.txt) . This page is also available as [Markdown](https://docs.powens.com/api-reference/overview/webview.md) . Our webview complements REST API endpoints with web-based services to handle sensitive or complex operations: * add a connection (to a bank or a provider), or edit/repare access to a connection; * manage connections (add/remove/edit); * edit and validate bank transfers. Usage of the webview is mandatory if you don't hold an Agent status, since you are not allowed to use API endpoints carrying user credentials, and optional otherwise. You can use our [integration demos](https://integrate.powens.com/) to experiment with the different Webview flows described below. Webview protocol[](https://docs.powens.com/api-reference/overview/webview#implementation-guidelines) ----------------------------------------------------------------------------------------------------- Services available as part of the webview are designed as parameterized URLs intended to be opened in a web browser. A callback URI must be specified by callers to be notified at the end of the operation flow, similar to OAuth 2 specification. ### Base URL[](https://docs.powens.com/api-reference/overview/webview#base-url) The base URL of all services must be customized: `https://webview.powens.com/{lang}/{flow}?domain={domain}.biapi.pro&{parameters}` * `{domain}`: substitute with your API domain in the `domain` query parameter * `{lang}`: optionally specify the language of the webview (possible values: `en`, `fr`, `de`, `nl`, `pt`, `it`, `es`; if not specified, an automatic redirection will be performed following the language of the browser). * `{flow}`: See [endpoints reference](https://docs.powens.com/api-reference/overview/webview#endpoints-reference) below for details about each flow * `{parameters}`: See [endpoints reference](https://docs.powens.com/api-reference/overview/webview#endpoints-reference) below for details about query parameters ### Callback handling[](https://docs.powens.com/api-reference/overview/webview#callback-handling) Most flows redirect to a callback URI at the end of the process. Query parameters are added to the URI to identify successful or failed operations. Successful parameters are specific to each flow. In case of an error, the following parameters are added: Parameter Description `error` An lowercase string error code identifying the kind of error that occurred. When the parameter is not present, the response is successful. `error_description` A longer string description of the error (not intended for user display). Common error codes include: Code Description `access_denied` The user explicitly cancelled the flow. `server_error` Oops, a technical failure occurred during the process. _Forward compatibility requirement: additional error codes may be added in the future to describe specific cases. When implementing error codes handling, always fallback to a generic case for unknown codes._ #### Browser compatibility[](https://docs.powens.com/api-reference/overview/webview#browser-compatibility) The webview is designed and tested to work with browsers supported by the Angular framework: [https://angular.io/guide/browser-support](https://angular.io/guide/browser-support) #### Privacy / GDPR status[](https://docs.powens.com/api-reference/overview/webview#privacy--gdpr-status) The webview itself does not use any kind of long-term data persistence mechanism such as cookies or local storage, but some authentication or authorization steps may delegate to third-party web services that may implement them. Analytics performed on the webview use anonymous data only. Integration guidelines[](https://docs.powens.com/api-reference/overview/webview#browser-integration) ----------------------------------------------------------------------------------------------------- Presenting the webview URL in a browser requires special care about the technical components involved, in order to optimize UX and conversion rate by allowing app-to-app experiences. The recommended components vary by platform: ### Web[](https://docs.powens.com/api-reference/overview/webview#web) In a web environment (i.e. when your own app is already running in a browser, as a standard HTML/JS app, PWA, etc.), you should present the webview either using a [full-page redirect](https://developer.mozilla.org/en-US/docs/Web/API/Location/replace) (recommended), or optionally using a [popup window](https://developer.mozilla.org/fr/docs/Web/API/Window/open) . The later requires special care on mobile as popups are usually presented as new tabs, and can be subject to blocking policies. Such integrations also require proper [cross-window communication](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to [dismiss the extra window](https://developer.mozilla.org/fr/docs/Web/API/Window/close) after the flow has ended. Integration of our webview in an `