### Install Routex Client Source: https://docs.yaxi.tech/getting-started.html Install the Routex client library using npm. This is the first step to using YAXI's services. ```bash npm install routex-client --save ``` -------------------------------- ### Raw Transaction Data Example Source: https://docs.yaxi.tech/transactions.html This is an example of the raw transaction data as it might be received. ```json [ * { * "endToEndId": "785643", * "creditorId": "DE98ZZZ09999999999", * "amount": "-19.99", * "creditor": { * "name": "AwesomeShop", * "iban": "NL31YAXI1234567891", * "bic": "YAXIDE71XXX" }, * "debtor": { * "name": "YAXI GmbH", * "iban": "NL58YAXI1234567890", * "bic": "YAXIDE71XXX" }, * "remittanceInformation": [ * "AwesomeShop Your purchase", * "2024-05-01 Thank you" ], * "bookingDate": "2024-05-02", * "transactionDate": "2024-05-01" } ] ``` -------------------------------- ### Example Result JWT Source: https://docs.yaxi.tech/getting-started.html This is an example of a JWT token returned as a result. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6IjY1Yjc5MDZkLTc4OGQ tLTQ4MTMtODM4NS1hZWY5YmQ1YzI2OWYifQ.eyJkYXRhIjp7ImRhdGEiOlt7ImliY YW4iOiJOTDU4WUFYSTEyMzQ1Njc4OTAiLCJiaWMiOiJZQVhJREU3MVhYWCIsImN1 cnJlbmN5IjoiRVVSIiwib3duZXJOYW1lIjoiWUFYSSBHbWJIIn1dLCJ0aWNrZXR JZCI6ImQwNWExNDhmLTc0NmQtNDE3Ny04OGFmLTZhOTIzMWM4NDI0ZCIsInRpbW VzdGFtcCI6IjIwMjQtMTEtMjdUMTU6MzU6MDUuNDQ5OTQ5NzIwWiJ9fQ.0r3a6X If8_Kp_7SGnSLNU6GOabCYB6rne2NTYw4EiK0 ``` -------------------------------- ### Collect Payment Source: https://docs.yaxi.tech/getting-started.html Demonstrates how to initiate a payment collection using the client SDK. Examples are provided for JavaScript, Kotlin, Rust, Swift, C++, and Lua. ```APIDOC ## Collect Payment ### Description Initiates a payment collection process. ### Method `client.collectPayment` ### Parameters - `credentials`: Authentication credentials. - `ticket`: A unique ticket for the transaction. ### Request Example (JavaScript) ```javascript let response = await client.collectPayment({ credentials, ticket, }) ``` ### Request Example (Kotlin) ```kotlin var response = client.collectPayment(credentials, ticket = ticket) ``` ### Request Example (Rust) ```rust let response = client.collect_payment( credentials, ticket, None, ).send().await?; ``` ### Request Example (Swift) ```swift let response = client.collectPayment( credentials: credentials, session: nil, ticket: ticket ) ``` ### Request Example (C++) ```c++ auto response = std::get<0>(client.collectPayment( credentials, ticket )); ``` ### Request Example (Lua) ```lua response = client:collectPayment({ credentials = credentials, ticket = ticket }) ``` ``` -------------------------------- ### Initiate a SEPA Credit Transfer (Kotlin) Source: https://docs.yaxi.tech/transfer.html This Kotlin example shows how to initiate a SEPA credit transfer. Optional debtor account and name can be provided to streamline the payment process. ```kotlin client.transfer( credentials, ticket = ticket, product = PaymentProduct.DEFAULT_SEPA_CREDIT_TRANSFER, debtorAccount = AccountReference( __**(1)** AccountIdentifier.Iban("NL58YAXI1234567890"), currency = "EUR", ), debtorName = "Debtor", __**(2)** details = listOf( TransferDetails( amount = Amount(BigDecimal("100.00"), "EUR"), creditorAccount = AccountIdentifier.Iban("NL58YAXI1234567890"), creditorName = "John Doe", ), ), ) ``` -------------------------------- ### Call Accounts Service in Lua Source: https://docs.yaxi.tech/accounts.html This Lua example shows how to call the accounts service, specifying fields and filters for account retrieval. ```lua client:accounts({ credentials = credentials, ticket = ticket, fields = { AccountField.Iban, AccountField.Bic, AccountField.Name, AccountField.DisplayName, AccountField.OwnerName, AccountField.Currency, }, filter = { all = { { notEq = { AccountField.Iban, nil } }, { any = { { eq = { AccountField.Type, AccountType.Current } }, { eq = { AccountField.Type, nil } } } } } } }) ``` -------------------------------- ### Example Transaction Response Source: https://docs.yaxi.tech/transactions.html This example demonstrates the JSON structure of a typical transaction response, including details like end-to-end ID, creditor information, amount, and booking/transaction dates. ```APIDOC ## Example Transaction Response ```json [ { "endToEndId": "785643", "creditorId": "DE98ZZZ09999999999", "amount": "-19.99", "creditor": { "name": "AwesomeShop", "iban": "NL31YAXI1234567891", "bic": "YAXIDE71XXX" }, "debtor": { "name": "YAXI GmbH", "iban": "NL58YAXI1234567890", "bic": "YAXIDE71XXX" }, "remittanceInformation": [ "AwesomeShop Your purchase", "2024-05-01 Thank you" ], "bookingDate": "2024-05-02", "transactionDate": "2024-05-01" } ] ``` ``` -------------------------------- ### Example JWT Result Source: https://docs.yaxi.tech/balances.html This is an example of a JWT returned by the Balances Service, containing account balance information. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFwaS1rZXktMjE0YWQ 2MDEtZmFlNS00NWY4LTllNDItYTFiNTdkNTA0MTRjIn0.eyJkYXRhIjp7ImRhdG EiOlt7ImJhbGFuY2VzIjpbeyJhY2NvdW50Ijp7ImliYW4iOiJOTDU4WUFYSTEyM zQ1Njc4OTAifSwiYmFsYW5jZXMiOlt7ImFtb3VudCI6IjgwLjAwIiwiY3VycmVu Y3kiOiJFVVIiLCJiYWxhbmNlVHlwZSI6IkJvb2tlZCJ9LHsiYW1vdW50IjoiNzA uMDAiLCJjdXJyZW5jeSI6IkVVUiIsImJhbGFuY2VUeXBlIjoiRXhwZWN0ZWQifV 19XX1dLCJ0aWNrZXRJZCI6IjgxNDJkYTM4LTNjM2EtNGUzYi1hZDlhLTI5OWQ1N FmNjMyOSIsInRpbWVzdGFtcCI6IjIwMjUtMDYtMDFUMTE6MDE6MjYuNzcyNTk2 MjMxWiJ9LCJleHAiOjI1NDA4MDgwMDB9.mYgYNZYKrcKne5Bx0m63aC22Jv9emM G2pJDrRd8YLrk ``` -------------------------------- ### Call Accounts Service in Swift Source: https://docs.yaxi.tech/accounts.html This Swift example shows how to call the accounts service. It includes options for selecting fields and applying filters, such as IBAN, type, and service support. ```swift try await client.accounts( credentials: credentials, session: nil, ticket: ticket, fields: [ .iban, .bic, .name, .displayName, .ownerName, .currency ], filter: .all(filters: [ .ibanNotEq(value: nil), .any(filters: [.typeEq(value: .current), .typeEq(value: nil)]), .supports(service: .collectPayment) ]) ) ``` -------------------------------- ### Example JWT Payload Source: https://docs.yaxi.tech/accounts.html An example of a decoded JWT payload containing account data. ```APIDOC ## Decoded JWT Payload Example ### Description This is an example of the decoded JWT payload, illustrating the structure of the 'data' object which includes an array of account details, a ticket ID, and a timestamp. ### Response Example ```json { "data": { "data": [ { "bic": "YAXIDE71XXX", "currency": "EUR", "iban": "NL58YAXI1234567890", "ownerName": "YAXI GmbH" } ], "ticketId": "8142da38-3c3a-4e3b-ad9a-299d561f6329", "timestamp": "2025-06-01T11:01:26.772596231Z" }, "exp": 2540808000 } ``` ``` -------------------------------- ### Example Result JWT Source: https://docs.yaxi.tech/transfer.html This is an example of a JSON Web Token (JWT) returned as a result of a payment initiation. The JWT contains information about the transaction and its status. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFwaS1rZXktMjE0YWQ 2MDEtZmFlNS00NWY4LTllNDItYTFiNTdkNTA0MTRjIn0.eyJkYXRhIjp7ImRhdG EiOnt9LCJ0aWNrZXRJZCI6IjE5YzNjYmYxLWFjYWUtNGE3ZS1hMGU3LTc5OWJiY bmVmMzllYiIsInRpbWVzdGFtcCI6IjIwMjUtMDYtMDFUMTE6MTE6MzAuNDIwODA4 OTE2WiJ9LCJleHAiOjI1NDA4MDgwMDB9.yBf2tn-aFptMbvp-ZV-8faLtC8i785 uVpcTFMfpsHzQ ``` -------------------------------- ### Initiate a SEPA Credit Transfer (C++) Source: https://docs.yaxi.tech/transfer.html A C++ example for initiating a SEPA credit transfer. The snippet illustrates the inclusion of optional debtor account and name for potentially simplifying user interactions. ```c++ client.transfer( credentials, ticket, yaxi::PaymentProduct::DefaultSepaCreditTransfer, {{ .amount = "100.00", .currency = "EUR", .creditorIban = "NL58YAXI1234567890", .creditorName = "John Doe", }}, yaxi::AccountReference{ __**(1)** .iban = "NL58YAXI1234567890", .currency = "EUR", }, "Debtor" __**(2)** ); ``` -------------------------------- ### Result JWT Example Source: https://docs.yaxi.tech/transactions.html This is an example of the JWT containing the transaction data. It is typically sent via webhook. ```jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFwaS1rZXktMjE0YWQ 2MDEtZmFlNS00NWY4LTllNDItYTFiNTdkNTA0MTRjIn0.eyJkYXRhIjp7ImRhdG EiOlt7ImJvb2tpbmdEYXRlIjoiMjAyNC0wNS0wMiIsInZhbHVlRGF0ZSI6IjIwM jQtMDUtMDIiLCJ0cmFuc2FjdGlvbkRhdGEiOiIyMDI0LTA1LTAxIiwic3RhdHVz IjoiQm9va2VkIiwiZW5kVG9FbmRJZCI6Ijc4NTY0MyIsImFtb3VudCI6eyJjdXJ ZW5jeSI6IkVVUiIsImFtb3VudCI6Ii0xOS45OSJ9LCJjcmVkaXRvciI6eyJuYW 1lIjoiQXdlc29tZVNob3AiLCJpYmFuIjoiTkwzMVlBWEkxMjM0NTY3ODkxIn0sI mRlYnRvciI6eyJpYmFuIjoiTkw1OFlBWEkxMjM0NTY3ODkwIn0sInJlbWl0dGFu Y2VJbmZvcm1hdGlvbiI6WyJBd2Vzb21lU2hvcCBZb3VyIHB1cmNoYXNlIiwiMjA yNC0wNS0wMSBUaGFuayB5b3UiXX1dLCJ0aWNrZXRJZCI6IjgxNDJkYTM4LTNjM2 EtNGUzYi1hZDlhLTI5OWQ1NjFmNjMyOSIsInRpbWVzdGFtcCI6IjIwMjUtMDYtM DFUMTE6MDE6MjYuNzcyNTk2MjMxWiJ9LCJleHAiOjI1NDA4MDgwMDB9.rw0RSrD afctZlElyE ``` -------------------------------- ### Example JWT for Accounts Result Source: https://docs.yaxi.tech/accounts.html This is an example of a JSON Web Token (JWT) containing account data. It should be processed in the frontend or forwarded to a backend system for verification. ```jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFwaS1rZXktMjE0YWQ 2MDEtZmFlNS00NWY4LTllNDItYTFiNTdkNTA0MTRjIn0.eyJkYXRhIjp7ImRhdG EiOlt7ImliYW4iOiJOTDU4WUFYSTEyMzQ1Njc4OTAiLCJiaWMiOiJZQVhJREU3M VhYWCIsImN1cnJlbmN5IjoiRVVSIiwib3duZXJOYW1lIjoiWUFYSSBHbWJIIn1d LCJ0aWNrZXRJZCI6IjgxNDJkYTM4LTNjM2EtNGUzYi1hZDlhLTI5OWQ1NjFmNjMy OSIsInRpbWVzdGFtcCI6IjIwMjUtMDYtMDFUMTE6MDE6MjYuNzcyNTk2MjMxWiJ 9LCJleHAiOjI1NDA4MDgwMDB9.eF5tX3NOJkNwJIPy5j59TX8pb8enATlphWS-F сBYQ4U ``` -------------------------------- ### Example Open Banking Service Response Source: https://docs.yaxi.tech/getting-started.html This JSON structure represents a typical response from an Open Banking service. It includes account details, a ticket ID, and a timestamp. ```json { "accounts": [ { "bic": "YAXIDE71XXX", "currency": "EUR", "ownerName": "YAXI GmbH" } ], "ticketId": "d05a148f-746d-4177-88af-6a9231c8424d", "timestamp": "2024-11-27T15:35:05.449949720Z" } ``` -------------------------------- ### Confirm Accounts Dialog Source: https://docs.yaxi.tech/getting-started.html Handles the confirmation dialog for services like accounts, typically after an SCA interrupt. Examples are provided for JavaScript, Kotlin, Rust, Swift, C++, and Lua. ```APIDOC ## Confirm Accounts Dialog ### Description Confirms user authorization for account services after an SCA interrupt. ### Method `client.confirmAccounts` ### Parameters - `ticket`: The transaction ticket. - `context`: The context from the confirmation input. ### Request Example (JavaScript) ```javascript if (response.constructor === Dialog && response.input.constructor === Confirmation) { // Wait for user confirmation response = await client.confirmAccounts({ ticket, context: response.input.context }) } ``` ### Request Example (Kotlin) ```kotlin if (response is Response.Dialog && response.input is DialogInput.Confirmation) { // Wait for user confirmation response = client.confirmAccounts( ticket, (response.input as DialogInput.Confirmation).context, ) } ``` ### Request Example (Rust) ```rust if let OBResponse::Dialog({ input: DialogInput::Confirmation { context, .. }, ..}, ) = response { // Wait for user confirmation response = client.confirm_accounts(ticket, context).await?; } ``` ### Request Example (Swift) ```swift if case .dialog(_, _, _, input: .confirmation(let context)) = response { // Wait for user confirmation response = try await client.confirmAccounts( ticket: ticket, context: context ) } ``` ### Request Example (C++) ```c++ if (auto dialog = std::get_if(&response)) { if (auto confirmation = std::get_if(&dialog->input)) { // Wait for user confirmation response = std::get<0>( client.confirmAccounts(ticket, confirmation->context) ); } } ``` ### Request Example (Lua) ```lua if response:isInstanceOf(Dialog) and response.input:isInstanceOf(Confirmation) then response = client:confirmAccounts({ ticket = ticket, context = response.input.context }) end ``` ``` -------------------------------- ### Issue a Service Ticket in Node.js Source: https://docs.yaxi.tech/getting-started.html Generate a JWT service ticket using Node.js. This example uses the `jsonwebtoken` and `uuid` libraries. Ensure your secret key is kept secure. ```javascript import jwt from 'jsonwebtoken' import { v4 as uuidv4 } from 'uuid' const HMAC_KEY = Buffer.from('YOUR_SECRET_KEY', 'base64') const HMAC_KEY_ID = 'YOUR_KEY_ID' function issueTicket(ticketId, service, data) { return jwt.sign( { data: { service, id: ticketId, data } }, HMAC_KEY, { expiresIn: '10m', keyid: HMAC_KEY_ID } ) } ``` -------------------------------- ### Extract Result Source: https://docs.yaxi.tech/getting-started.html Demonstrates how to extract the final result from a service call, which can be data, a JWT, session information, or connection data. Examples are provided for JavaScript, Kotlin, Rust, Swift, C++, and Lua. ```APIDOC ## Extract Result ### Description Extracts the final result from a service operation. ### Method Accessing fields from the result object. ### Parameters - `response`: The result object from the service call. ### Request Example (JavaScript) ```javascript if (response.constructor === Result) { let result = response.jwt let session = response.session let connectionData = response.connectionData ... } ``` ### Request Example (Kotlin) ```kotlin if (response is Response.Result) { val result = response.result val session = response.session val connectionData = response.connectionData ... } ``` ### Request Example (Rust) ```rust if let OBResponse::Result(result, session, connection_data) = response { ... } ``` ### Request Example (Swift) ```swift if case .result(let result, let session, let connectionData) = response { ... } ``` ### Request Example (C++) ```c++ if (auto serviceResult = std::get_if(&response)) { auto result = serviceResult->jwt; auto session = serviceResult->session; auto connectionData = serviceResult->connectionData; ... } ``` ### Request Example (Lua) ```lua if response:isInstanceOf(Result) then local result = response.jwt local session = response.session local connectionData = response.connectionData ... end ``` ``` -------------------------------- ### Issue Collect Payment Service Ticket Source: https://docs.yaxi.tech/collect-payment.html Issue a service ticket for the CollectPayment service. This example demonstrates how to construct the ticket data, including amount, creditor details, and remittance. Ensure to use valid constants for COMPANY_IBAN, COMPANY_NAME, PRODUCT_NAME, and customer_id. ```python ticket_id = str(uuid.uuid4()) ticket = issue_ticket( ticket_id, "CollectPayment", { "amount": { "amount": "100", "currency": "EUR", }, "creditorAccount": { "iban": COMPANY_IBAN, }, "creditorName": COMPANY_NAME, "remittance": f"Sign-up fee {PRODUCT_NAME} {customer_id}", }, ) ``` ```java String ticketId = UUID.randomUUID().toString(); String ticket = issueTicket( ticketId, "CollectPayment", Map.of( "amount", Map.of( "amount", "100", "currency", "EUR" ), "creditorAccount", Map.of( "iban", COMPANY_IBAN ), "creditorName", COMPANY_NAME, "remittance", "Sign-up fee " + PRODUCT_NAME + " " + customer_id ) ); ``` ```javascript let ticketId = uuidv4() let ticket = issueTicket( ticketId, 'CollectPayment', { amount: { amount: '100', currency: 'EUR' }, creditorAccount: { iban: COMPANY_IBAN }, creditorName: COMPANY_NAME, remittance: `Sign-up fee ${PRODUCT_NAME} ${customerId}` } ) ``` ```rust let ticket_id = Uuid::new_v4().to_string(); let ticket = issue_ticket( &ticket_id, "CollectPayment", json!({ "amount": { "amount": "100", "currency": "EUR", }, "creditorAccount": { "iban": COMPANY_IBAN, }, "creditorName": COMPANY_NAME, "remittance": format!("Sign-up fee {PRODUCT_NAME} {customer_id}") }), )?; ``` ```php $ticketId = uniqid(); $ticket = issueTicket( $ticketId, "CollectPayment", json_encode([ 'amount' => [ 'amount' => '100', 'currency' => 'EUR', ], 'creditorAccount' => [ 'iban' => $COMPANY_IBAN, ], 'creditorName' => $COMPANY_NAME, 'remittance' => 'Sign-up fee '.$PRODUCT_NAME.' '.$customerId, ]) ); ``` -------------------------------- ### Collect Payment Ticket Data Example Source: https://docs.yaxi.tech/collect-payment.html This JSON object represents the data structure required for a Collect Payment ticket, including amount, currency, creditor account, creditor name, remittance, instant payment preference, and optional fields. ```json { "amount": { "amount": "80.00", "currency": "EUR" }, "creditorAccount": { "iban": "NL58YAXI1234567890" }, "creditorName": "YAXI GmbH", "remittance": "Sign-up fee routex 123456789", "instant": true, "fields": [ "debtorIban" ] } ``` -------------------------------- ### Example Decoded JWT Payload Source: https://docs.yaxi.tech/getting-started.html This is an example of a decoded JWT payload. ```json { "data": { "data": [ { "iban": "NL58YAXI1234567890", ``` -------------------------------- ### Initialize Routex Client (Integration Environment) Source: https://docs.yaxi.tech/getting-started.html Initialize the Routex client with a custom URL for the integration environment. This is useful for testing and development. ```javascript const client = new RoutexClient({ url: new URL("https://integration.yaxi.tech/") }) ``` ```kotlin val client = RoutexClient(java.net.URI("https://integration.yaxi.tech/")) ``` ```rust let client = RoutexClient::with_url( "https://integration.yaxi.tech/".parse().expect("valid URL") ); ``` ```swift let client = RoutexClient(url: Url(string: "https://integration.yaxi.tech/")!) ``` ```c++ yaxi::RoutexClient client("https://integration.yaxi.tech/"); ``` ```lua client = RoutexClient:new("https://integration.yaxi.tech/") ``` -------------------------------- ### Initialize Routex Client (Default) Source: https://docs.yaxi.tech/getting-started.html Initialize the Routex client with default settings. This establishes a secure channel to YAXI's production services. ```javascript const client = new RoutexClient() ``` ```kotlin val client = RoutexClient() ``` ```rust let client = RoutexClient::new(); ``` ```swift let client = RoutexClient() ``` ```c++ yaxi::RoutexClient client; ``` ```lua local client = RoutexClient:new() ``` -------------------------------- ### Example Encrypted Result JWT Source: https://docs.yaxi.tech/collect-payment.html This is an example of a JWT containing the result data, including an encrypted debtor IBAN if requested. ```jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFwaS1rZXktMjE0YWR NjAxLWY5ZWE1LTQ1ZjgtOWU0Mi1hMWI1N2Q1MDQxNGMifQ.eyJkYXRhIjp7ImRhdG EiOnt9LCJ0aWNrZXRJZCI6IjE5YzNjYmYxLWFjYWUtNGE3ZS1hMGU3LTc5OWJiY mVmMzllYiIsInRpbWVzdGFtcCI6IjIwMjUtMDYtMDFUMTE6MTE6MzAuNDIwODA4 OTE2WiJ9LCJleHAiOjI1NDA4MDgwMDB9.yBf2tn-aFptMbvp-ZV-8faLtC8i785 uVpcTFMfpsHzQ ``` -------------------------------- ### JWT Payload Example Source: https://docs.yaxi.tech/transactions.html An example of a decoded JWT payload containing transaction data, including booking details, amounts, and party information. This format is used when results are sent via webhook. ```APIDOC ## JWT Payload Example ```json { "data": { "data": [ { "bookingDate": "2024-05-02", "valueDate": "2024-05-02", "transactionData": "2024-05-01", "status": "Booked", "endToEndId": "785643", "amount": { "currency": "EUR", "amount": "-19.99" }, "creditor": { "name": "AwesomeShop", "iban": "NL31YAXI1234567891" }, "debtor": { "iban": "NL58YAXI1234567890" }, "remittanceInformation": [ "AwesomeShop Your purchase", "2024-05-01 Thank you" ] } ], "ticketId": "8142da38-3c3a-4e3b-ad9a-299d561f6329", "timestamp": "2025-06-01T11:01:26.772596231Z" }, "exp": 2540808000 } ``` ``` -------------------------------- ### Call Accounts Service in C++ Source: https://docs.yaxi.tech/accounts.html This C++ snippet demonstrates calling the accounts service. It allows for specifying account fields and applying filters like IBAN, type, and service support. ```c++ client.accounts( credentials, ticket, { yaxi::AccountField::Iban, yaxi::AccountField::Bic, yaxi::AccountField::Name, yaxi::AccountField::DisplayName, yaxi::AccountField::OwnerName, yaxi::AccountField::Currency, }, yaxi::AccountField::Iban != std::nullopt && (yaxi::AccountField::Type == yaxi::AccountType::Current || yaxi::AccountField::Type == std::nullopt) && yaxi::AccountFilter::supports( yaxi::SupportedService::CollectPayment ) ); ``` -------------------------------- ### Collect Credentials in C++ Source: https://docs.yaxi.tech/getting-started.html Initialize C++ credentials using designated initializers for connection ID, user ID, and password. ```c++ yaxi::Credentials credentials = { .connectionId = connectionId, .userId = userId, .password = password, }; ``` -------------------------------- ### Respond to Accounts Dialog with Kotlin Source: https://docs.yaxi.tech/interrupts.html Respond to any other dialog for the accounts service in Kotlin. Requires ticket, context, and the response. ```kotlin response = client.respondAccounts(ticket, context, response) ``` -------------------------------- ### Respond to Accounts Dialog with C++ Source: https://docs.yaxi.tech/interrupts.html Respond to any other dialog for the accounts service in C++. Requires ticket, context, and the response. ```c++ response = std::get<0>(client.respondAccounts(ticket, context, response)); ``` -------------------------------- ### Initiate a SEPA Credit Transfer (Rust) Source: https://docs.yaxi.tech/transfer.html A Rust implementation for initiating a SEPA credit transfer. The snippet demonstrates the use of optional debtor account and name for a potentially smoother transaction. ```rust client.transfer( credentials, ticket, PaymentProduct::DefaultSepaCreditTransfer, Some(AccountReference { id: AccountIdentifier::Iban("NL58YAXI1234567890".to_string()), currency: Some("EUR".to_string()), }), Some("Debtor".to_string()), __**(2)** None, __**(3)** [ TransferDetails::new( Amount::new(100, "EUR"), AccountIdentifier::Iban("NL58YAXI1234567890".to_string()), "John Doe", ), ], ).send().await?; ``` -------------------------------- ### Sample Account Data Structure Source: https://docs.yaxi.tech/accounts.html This is a sample JSON structure representing account data, typically found within an API response. ```json [ * { * "iban": "NL58YAXI1234567890", * "bic": "YAXIDE71XXX", * "currency": "EUR", * "name": "Hauptkonto", * "type": "Current" } ] ``` -------------------------------- ### Decoded JWT Payload Source: https://docs.yaxi.tech/accounts.html This is the decoded payload of the example JWT, containing the actual account data, ticket ID, and timestamp. The 'data' field holds an array of account objects. ```json { "data": { "data": [ { "bic": "YAXIDE71XXX", "currency": "EUR", "iban": "NL58YAXI1234567890", "ownerName": "YAXI GmbH" } ], "ticketId": "8142da38-3c3a-4e3b-ad9a-299d561f6329", "timestamp": "2025-06-01T11:01:26.772596231Z" }, "exp": 2540808000 } ``` -------------------------------- ### Respond to Accounts Dialog with Swift Source: https://docs.yaxi.tech/interrupts.html Respond to any other dialog for the accounts service in Swift. Requires ticket, context, and the response. ```swift let response = try await client.respondAccounts( ticket: ticket, context: context, response: response ) ``` -------------------------------- ### Result JWT and Decoded Components Source: https://docs.yaxi.tech/transfer.html The result may include a JWT, which contains encoded payment details. This section provides an example of the JWT, its decoded header, and its decoded payload. ```APIDOC ## Result JWT and Decoded Components ### Description The result may include a JWT, which contains encoded payment details. This section provides an example of the JWT, its decoded header, and its decoded payload. ### JWT Example ``` eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFwaS1rZXktMjE0YWQ2MDEtZmFlNS00NWY4LTllNDItYTFiNTdkNTA0MTRjIn0.eyJkYXRhIjp7ImRhdGEiOnt9LCJ0aWNrZXRJZCI6IjE5YzNjYmYxLWFjYWUtNGE3ZS1hMGU3LTc5OWJiZWZmMzllYiIsInRpbWVzdGFtcCI6IjIwMjUtMDYtMDFUMTE6MTE6MzAuNDIwODA4OTE2WiJ9LCJleHAiOjI1NDA4MDgwMDB9.yBf2tn-aFptMbvp-ZV-8faLtC8i785uVpcTFMfpsHzQ ``` ### Decoded JWT Header ```json { "typ": "JWT", "alg": "HS256", "kid": "api-key-214ad601-fae5-45f8-9e42-a1b57d50414c" } ``` ### Decoded JWT Payload ```json { "data": { "data": {}, "ticketId": "19c3cbf1-acae-4a7e-a0e7-799bbbef39eb", "timestamp": "2025-06-01T11:11:30.420808916Z" }, "exp": 2540808000 } ``` ### Note An empty `data` object within the payload indicates that the payment initiation was successful, even though no specific data is returned in that field. ``` -------------------------------- ### Collect Payment with Debtor Account (Lua) Source: https://docs.yaxi.tech/collect-payment.html Use this snippet to collect a payment when the debtor's account information (IBAN and currency) is known. This can streamline the user's confirmation process. ```lua client:collectPayment({ credentials = credentials, ticket = ticket, account = { iban = "NL58YAXI1234567890", currency = "EUR" } }) ``` -------------------------------- ### Call Accounts Service in Kotlin Source: https://docs.yaxi.tech/accounts.html This Kotlin snippet demonstrates how to fetch account details. It allows for selecting specific fields and filtering accounts based on various conditions. ```kotlin client.accounts( credentials, ticket = accountsTicket, fields = listOf( AccountField.IBAN, AccountField.BIC, AccountField.NAME, AccountField.DISPLAY_NAME, AccountField.OWNER_NAME, AccountField.CURRENCY, ), filter = AccountField.Iban.notEq(null) .and(AccountField.Type.eq(AccountType.CURRENT) .or(AccountField.Type.eq(null))) .and(Account.supports(SupportedService.COLLECT_PAYMENT)), ) ``` -------------------------------- ### Initiate a SEPA Credit Transfer (JavaScript) Source: https://docs.yaxi.tech/transfer.html Use this snippet to initiate a SEPA credit transfer. Providing debtor account and name is optional but recommended for a reduced user confirmation flow. ```javascript await client.transfer({ credentials, ticket, product: PaymentProduct.DefaultSepaCreditTransfer, debtorAccount: { __**(1)** iban: "NL58YAXI1234567890", currency: "EUR" }, debtorName: "Debtor", __**(2)** details: [ { amount: { amount: "100.00", currency: "EUR" }, creditorAccount: { iban: "NL58YAXI1234567890" }, creditorName: "John Doe", }, ], }) ``` -------------------------------- ### Respond to Accounts Dialog with Lua Source: https://docs.yaxi.tech/interrupts.html Respond to any other dialog for the accounts service in Lua. Requires ticket, context, and the response. ```lua local response = client:respondAccounts({ ticket = accountsTicket, context = context, response = response, }) ``` -------------------------------- ### Call the Accounts Service Source: https://docs.yaxi.tech/accounts.html This method allows you to retrieve account information. You can specify which fields to return and apply filters to narrow down the results. For example, you can request specific account properties like IBAN, BIC, and Name, and filter accounts based on their type or supported services. ```APIDOC ## Call the Accounts Service ### Description Retrieves account information, allowing specification of returned fields and filtering of results. ### Parameters - `credentials`: Authentication credentials. - `ticket`: A ticket for accessing account data. - `fields`: An array of `AccountField` enums specifying which properties to return for each account. - `filter`: An optional filter object to narrow down the accounts returned. This can include conditions like `notEq`, `eq`, `any`, and `supports`. ### Request Example (JavaScript) ```javascript await client.accounts({ credentials, ticket: accountsTicket, fields: [ AccountField.Iban, AccountField.Bic, AccountField.Name, AccountField.DisplayName, AccountField.OwnerName, AccountField.Currency ], filter: { all: [ { notEq: [AccountField.Iban, null] }, { any: [ { eq: [AccountField.Type, AccountType.Current] }, { eq: [AccountField.Type, null] } ] }, { supports: SupportedService.CollectPayment } ] } }) ``` ### Request Example (Kotlin) ```kotlin client.accounts( credentials, ticket = accountsTicket, fields = listOf( AccountField.IBAN, AccountField.BIC, AccountField.NAME, AccountField.DISPLAY_NAME, AccountField.OWNER_NAME, AccountField.CURRENCY, ), filter = AccountField.Iban.notEq(null) .and(AccountField.Type.eq(AccountType.CURRENT) .or(AccountField.Type.eq(null))) .and(Account.supports(SupportedService.COLLECT_PAYMENT)), ) ``` ### Request Example (Rust) ```rust client.accounts( credentials, accounts_ticket, [ AccountField::Iban, AccountField::Bic, AccountField::Name, AccountField::DisplayName, AccountField::OwnerName, AccountField::Currency, ], Some( AccountField::IBAN.not_eq(None) .and( AccountField::TYPE.eq(Some(AccountType::Current)) .or(AccountField::TYPE.eq(None)) ) .and( Account::supports(SupportedService::CollectPayment) ), ), ).send().await?; ``` ### Request Example (Swift) ```swift try await client.accounts( credentials: credentials, session: nil, ticket: ticket, fields: [ .iban, .bic, .name, .displayName, .ownerName, .currency ], filter: .all(filters: [ .ibanNotEq(value: nil), .any(filters: [.typeEq(value: .current), .typeEq(value: nil)]), .supports(service: .collectPayment) ]) ) ``` ### Request Example (C++) ```cpp client.accounts( credentials, ticket, { yaxi::AccountField::Iban, yaxi::AccountField::Bic, yaxi::AccountField::Name, yaxi::AccountField::DisplayName, yaxi::AccountField::OwnerName, yaxi::AccountField::Currency, }, yaxi::AccountField::Iban != std::nullopt && (yaxi::AccountField::Type == yaxi::AccountType::Current || yaxi::AccountField::Type == std::nullopt) && yaxi::AccountFilter::supports( yaxi::SupportedService::CollectPayment ) ); ``` ``` -------------------------------- ### Call the service Source: https://docs.yaxi.tech/balances.html Call the Balances service to gather balances for specified accounts. The client accepts credentials, a ticket, and an array of account references. ```APIDOC ## Call the service The client accepts the following arguments: * Accounts to gather balances for. This could be provided by the user, known from a previous transaction, or gathered from the accounts service. **Call the service:** ```javascript await client.balances({ credentials, ticket, accounts: [ { iban: "NL58YAXI1234567890", currency: "EUR" } ] }) ``` ```kotlin client.balances( credentials, ticket = ticket, accounts = listOf( AccountReference( AccountIdentifier.Iban("NL58YAXI1234567890"), currency = "EUR", ) ), ) ``` ```rust client.balances( credentials, ticket, [ AccountReference { id: AccountIdentifier::Iban("NL58YAXI1234567890".to_string()), currency: Some("EUR".to_string()), } ] ).send().await?; ``` ```c++ client.balances( credentials, ticket, { yaxi::AccountReference{ .iban = "NL58YAXI1234567890", .currency = "EUR", } } ); ``` ```lua client:balances({ credentials = credentials, ticket = ticket, accounts = { { iban = "NL58YAXI1234567890", currency = "EUR", } }, }) ``` ``` -------------------------------- ### Collect Credentials in Swift Source: https://docs.yaxi.tech/getting-started.html Define Swift credentials using named parameters for connection ID, user ID, and password. ```swift let credentials = Credentials( connectionId: connectionId, userId: userId, password: password ) ``` -------------------------------- ### Respond to Accounts Dialog with Rust Source: https://docs.yaxi.tech/interrupts.html Respond to any other dialog for the accounts service in Rust. Requires ticket, context, and the response. ```rust let response = client.respond_accounts({ticket, context, response}).await?; ``` -------------------------------- ### Collect Payment with Debtor Account (C++) Source: https://docs.yaxi.tech/collect-payment.html Use this snippet to collect a payment when the debtor's account information (IBAN and currency) is known. This can streamline the user's confirmation process. ```cpp client.collectPayment( credentials, ticket, yaxi::AccountReference{ .iban = "NL58YAXI1234567890", .currency = "EUR", } ); ``` -------------------------------- ### Confirm Accounts with C++ Source: https://docs.yaxi.tech/interrupts.html Call the confirmAccounts method to confirm actions for the accounts service in C++. Requires ticket and context. ```c++ response = std::get<0>(client.confirmAccounts(ticket, context)); ``` -------------------------------- ### Collect Credentials in Lua Source: https://docs.yaxi.tech/getting-started.html Structure Lua credentials as a table containing connection ID, user ID, and password. ```lua local credentials = { connectionId = connectionId, userId = userId, password = password } ``` -------------------------------- ### Respond to Accounts Dialog with JavaScript Source: https://docs.yaxi.tech/interrupts.html Respond to any other dialog for the accounts service in JavaScript. Requires ticket, context, and the response. ```javascript response = await client.respondAccounts({ ticket, context, response }) ``` -------------------------------- ### Call Transactions Service in Rust Source: https://docs.yaxi.tech/transactions.html Call the Transactions service using the client object in Rust. Requires credentials and a ticket. The .send().await? pattern indicates asynchronous execution. ```rust client.transactions( credentials, ticket, ).send().await?; ``` -------------------------------- ### Collect Payment with Debtor Account (Kotlin) Source: https://docs.yaxi.tech/collect-payment.html Use this snippet to collect a payment when the debtor's account information (IBAN and currency) is known. This can streamline the user's confirmation process. ```kotlin client.collectPayment( credentials, ticket = ticket, account = AccountReference( AccountIdentifier.Iban("NL58YAXI1234567890"), currency = "EUR", ) ) ``` -------------------------------- ### Collect Payment with Debtor Account (Rust) Source: https://docs.yaxi.tech/collect-payment.html Use this snippet to collect a payment when the debtor's account information (IBAN and currency) is known. This can streamline the user's confirmation process. ```rust client.collect_payment( credentials, ticket, Some(AccountReference { id: AccountIdentifier::Iban("NL58YAXI1234567890".to_string()), currency: Some("EUR".to_string()), }), ).send().await?; ``` -------------------------------- ### Collect Credentials in JavaScript Source: https://docs.yaxi.tech/getting-started.html Use this JavaScript snippet to structure user credentials, including connection ID, user ID, and password. ```javascript const credentials = { connectionId, userId, password } ```