### Start Authorisation Response Example (Redirect) Source: https://developers.tbcbank.ge/reference/aisstartconsentauthorization Example of a response when starting an SCA authorisation process that requires a redirect. It includes the initial SCA status and other relevant details. ```json { "scaStatus": "scaMethodSelected" } ``` -------------------------------- ### Get Consent Response Example Source: https://developers.tbcbank.ge/reference/get_v2-consents-account-access-consentid An example JSON response for a successful Get Consent request. It demonstrates the structure of account access rights, recurring indicators, and consent status. ```json { "access": { "loans": [ { "account": { "iban": "GE78TB1121245063622479" }, "rights": ["accountDetails", "balances", "transactions", "ownerName"] } ] }, "consentType": "V2Consent", "recurringIndicator": true, "validTo": "2023-07-01", "frequencyPerDay": 4, "consentStatus": "valid" } ``` -------------------------------- ### Get PSD2 Account Details Response Example (JSON) Source: https://developers.tbcbank.ge/reference/aisreadaccountdetails This JSON object is an example response for the 'get account details' PSD2 endpoint. It includes comprehensive information about a user's account, such as resource ID, IBAN, currency, owner details, and balances, along with links to related resources. ```json { "account": { "resourceId": "c5503035-7f59-4f66-ff96-08dd6cfe8f7c", "iban": "GE01TB2123003210034512", "msisdn": "558112233", "currency": "USD", "ownerName": "მოქი მოქიაშვილი", "ownerIdentification": { "privateId": { "others": [ { "identification": "PNOGE-00000000001" } ] } }, "name": "მოქი მოქიაშვილი", "displayName": "ჩემი ბარათი", "cashAccountType": "CARD", "status": "enabled", "bic": "TBCBGE22", "usage": "PRIV", "balances": [], "_links": { "balances": { "href": "/0.8/v1/accounts/c5503035-7f59-4f66-ff96-08dd6cfe8f7c/balances" }, "transactions": { "href": "/0.8/v1/accounts/c5503035-7f59-4f66-ff96-08dd6cfe8f7c/transactions" }, "aggregationAccount": { "href": "/0.8/v1/accounts/dfd0efe6-5e7a-4d1c-ff94-08dd6cfe8f7c" }, "account": { "href": "/0.8/v1/accounts/c5503035-7f59-4f66-ff96-08dd6cfe8f7c" } } } } ``` -------------------------------- ### Get Account Balances Response Example (JSON) Source: https://developers.tbcbank.ge/reference/aisreadaccountbalance This JSON object demonstrates the structure of a response when requesting account balances. It includes details about the account, such as IBAN and currency, and a list of balances with their types, amounts, and other relevant information. ```json { "account": { "iban": "GE01TB0203040506070809", "currency": "XXX" }, "balances": [ { "balanceType": "interimAvailable", "balanceAmount": { "currency": "GEL", "amount": "30.00" }, "creditLimitIncluded": false }, { "balanceType": "interimBooked", "balanceAmount": { "currency": "GEL", "amount": "30.00" }, "creditLimitIncluded": false, "referenceDate": "2025-03-26", "lastChangeDateTime": "2025-03-26T00:00:00" }, { "balanceType": "closingBooked", "balanceAmount": { "currency": "GEL", "amount": "-30.00" } }, { "balanceType": "interimAvailable", "balanceAmount": { "currency": "USD", "amount": "0.00" }, "creditLimitIncluded": false }, { "balanceType": "interimBooked", "balanceAmount": { "currency": "USD", "amount": "0.00" }, "creditLimitIncluded": false, "referenceDate": "2024-12-24", "lastChangeDateTime": "2024-12-24T00:00:00" }, { "balanceType": "closingBooked", "balanceAmount": { "currency": "USD", "amount": "0.00" } }, { "balanceType": "interimAvailable", "balanceAmount": { "currency": "EUR", "amount": "0.00" }, "creditLimitIncluded": false }, { "balanceType": "interimBooked", "balanceAmount": { "currency": "EUR", "amount": "0.33" }, "creditLimitIncluded": false, "referenceDate": "2025-02-23", "lastChangeDateTime": "2025-02-23T00:00:00" }, { "balanceType": "closingBooked", "balanceAmount": { "currency": "EUR", "amount": "-0.33" } } ] } ``` -------------------------------- ### Get Accounts Response Structure Source: https://developers.tbcbank.ge/reference/aisreadaccountlist Example response for retrieving a list of accounts, containing account details, owner identification, and associated balances in multiple currencies. ```json { "accounts": [ { "resourceId": "761a7d98-3251-4e98-50fe-08dd818830c7", "iban": "GE01TB0203040506070809", "balances": [ { "balanceType": "interimBooked", "balanceAmount": { "currency": "GEL", "amount": "30.00" } } ], "_links": { "balances": { "href": "/0.8/v1/accounts/761a7d98-3251-4e98-50fe-08dd818830c7/balances" } } } ] } ``` -------------------------------- ### Payment Initiation Response Examples (JSON) Source: https://developers.tbcbank.ge/reference/post_v2-recurring-payments-payment-product-1 These examples demonstrate the structure of a successful payment initiation response. They include details like payment ID, transaction status, and links for further actions such as OAuth authorization and status checks. One example also shows currency conversion details. ```json { "paymentId": "7cd2d0e2-60a6-4cc6-1b33-08dae1b181a1", "transactionStatus": "ACTC", "_links": { "scaOAuth": { "href": "https://dev-openbanking.tbcbank.ge/openbanking/oauth/.well-known/oauth-authorization-server" }, "self": { "href": "/0.8/v1/payments/domestic/7cd2d0e2-60a6-4cc6-1b33-08dae1b181a1" }, "status": { "href": "/0.8/v1/payments/domestic/7cd2d0e2-60a6-4cc6-1b33-08dae1b181a1/status" }, "scaStatus": { "href": "/0.8/v1/payments/domestic/7cd2d0e2-60a6-4cc6-1b33-08dae1b181a1/authorisations/df93472a-a86c-47f8-6d64-08dae1b187de" } } } ``` ```json { "paymentId": "1c76b997-3028-4929-1b34-08dae1b181a1", "transactionStatus": "ACTC", "estimatedTotalAmount": { "currency": "GEL", "amount": "41.25" }, "estimatedInterbankSettlementAmount": { "currency": "USD", "amount": "15.00" }, "_links": { "scaOAuth": { "href": "https://dev-openbanking.tbcbank.ge/openbanking/oauth/.well-known/oauth-authorization-server" }, "self": { "href": "/0.8/v1/payments/aspsp/1c76b997-3028-4929-1b34-08dae1b181a1" }, "status": { "href": "/0.8/v1/payments/aspsp/1c76b997-3028-4929-1b34-08dae1b181a1/status" }, "scaStatus": { "href": "/0.8/v1/payments/aspsp/1c76b997-3028-4929-1b34-08dae1b181a1/authorisations/b3b12e5e-4ed8-4140-6d65-08dae1b187de" } } } ``` -------------------------------- ### Payment Initiation Response Example Source: https://developers.tbcbank.ge/reference/get_v1-bulk-payments-payment-product-paymentid Demonstrates a successful payment initiation response, including debtor and creditor account details, instructed amount, and transaction status. This is a standard JSON response for successful payment operations. ```json { "debtorAccount": { "iban": "GE83TB7438345061622218", "currency": "GEL" }, "instructedAmount": { "currency": "USD", "amount": "15" }, "creditorAccount": { "iban": "GE83TB7438345061655577", "currency": "GEL" }, "creditorAgent": "TRESGE22", "creditorName": "Wolfgang Amadeus Mozart", "remittanceInformationUnstructured": "Ref Number Merchant", "transactionStatus": "ACTC", "debtorIdentification": { "privateId": { "others": [ { "identification": "PNOGE-01019013212" } ] } } } ``` -------------------------------- ### GET /v1/online-installments/merchant/applications/status-changes Source: https://developers.tbcbank.ge/reference/online-installments-merchant-application-statuses-api Retrieves a list of status changes for online installment applications associated with a specific merchant. ```APIDOC ## GET /v1/online-installments/merchant/applications/status-changes ### Description Retrieves status changes for merchant applications. This endpoint requires authorization and specific merchant identification. ### Method GET ### Endpoint https://test-api.tbcbank.ge/v1/online-installments/merchant/applications/status-changes ### Request Body - **merchantKey** (string) - Required - The unique identifier for the merchant. - **take** (integer) - Required - The number of records to retrieve. ### Request Example { "merchantKey": "000000000-ce21da5e-da92-48f3-8009-4d438cbcc137", "take": 10 } ### Response #### Error Response (404) - **type** (string) - URI reference for the error type. - **title** (string) - Short summary of the error. - **status** (integer) - HTTP status code. - **detail** (string) - Detailed explanation of the error. - **systemCode** (string) - Internal system error code. - **code** (string) - Application specific error code. #### Response Example { "type": "https://developers.tbcbank.ge/error-reference#type-404", "title": "Merchant was not found", "status": 404, "detail": "Merchant was not found", "systemCode": "System code for problem is Online-Installment-Merchant-API.404.001", "code": "001" } ``` -------------------------------- ### POST /v1/online-installments/applications Source: https://developers.tbcbank.ge/reference/online-installments-initiate-application Initiates an online installment application. This endpoint is used to start the process of applying for an online installment plan, providing details about the purchase and the merchant. ```APIDOC ## POST /v1/online-installments/applications ### Description Initiates an online installment application. This endpoint is used to start the process of applying for an online installment plan, providing details about the purchase and the merchant. ### Method POST ### Endpoint https://test-api.tbcbank.ge/v1/online-installments/applications ### Parameters #### Query Parameters None #### Request Body - **merchantKey** (string) - Required - merchant unique identifier in online installments module - **priceTotal** (number) - Required - total price of purchase in GEL 0.00. should be equal to sum of all product prices. - **products** (array) - Required - array of installment products - **campaignId** (string) - Optional - online installments campaign id - **invoiceId** (string) - Optional - invoice id #### Product Object within `products` array: - **name** (string) - Optional - product description - **price** (number) - Optional - product price in lari 0.00 - **quantity** (integer) - Optional - number of purchased units ### Request Example ```json { "merchantKey": "000000000-ce21da5e-da92-48f3-8009-4d438cbcc137", "campaignId": "204", "invoiceId": "INV-12345", "priceTotal": 1500.50, "products": [ { "name": "Laptop", "price": 1200.00, "quantity": 1 }, { "name": "Mouse", "price": 50.50, "quantity": 1 } ] } ``` ### Response #### Success Response (201) - **sessionId** (string) - Unique identifier for the installment session. #### Response Example ```json { "sessionId": "289838bb-f41f-40c2-b9c9-151407acbbbf" } ``` #### Error Response (400) - **type** (string) - Error type identifier. - **title** (string) - A short, human-readable summary of the error. - **status** (integer) - The HTTP status code. - **detail** (string) - A more specific description of the error. - **systemCode** (string) - Internal system code for the error. - **code** (string) - Application-specific error code. #### Error Response Example ```json { "type": "https://developers.tbcbank.ge/error-reference#type-400", "title": "'Amount' must not be empty.'Amount' must be greater than '0'.", "status": 400, "detail": "'Amount' must not be empty.'Amount' must be greater than '0'.", "systemCode": "System code for problem is exchange-rates.400.001", "code": "" } ``` ``` -------------------------------- ### Security Configuration Example Source: https://developers.tbcbank.ge/reference/aisreadaccounttransactionlist This snippet shows a basic structure for security configurations within the API. It is an empty array, indicating that specific security details are not provided in this context. ```json { "security": [ {} ] } ``` -------------------------------- ### GET /v1/online-installments/applications/{sessionId}/status Source: https://developers.tbcbank.ge/reference/online-installments-get-application-status-api Retrieves the current status and details of an online installment application by its session ID. ```APIDOC ## GET /v1/online-installments/applications/{sessionId}/status ### Description Retrieves the status of an initiated installment application. Requires the merchant key in the request body. ### Method GET ### Endpoint /v1/online-installments/applications/{sessionId}/status ### Parameters #### Path Parameters - **sessionId** (string) - Required - Unique session ID of the initiated application. #### Request Body - **merchantKey** (string) - Required - Merchant unique identifier in the online installments module. ### Request Example { "merchantKey": "000000000-ce21da5e-da92-48f3-8009-4d438cbcc137" } ### Response #### Success Response (200) - **amount** (number) - Total installment amount. - **contributionAmount** (object) - Contribution amount (if applicable). - **statusId** (integer) - Numerical status identifier. - **description** (string) - Human-readable status description. #### Response Example { "amount": 150.33, "contributionAmount": null, "statusId": 9, "description": "Installment pending Disbursed (Confirmed from both side)" } ``` -------------------------------- ### Payment Initiation JSON Request Examples Source: https://developers.tbcbank.ge/reference/post_v1-payments-payment-product A collection of JSON request bodies for the Payment Initiation API. These examples demonstrate various scenarios including standard transfers, transfers without debtor accounts, and budget-specific payments. ```json { "debtorAccount": { "iban": "GE83TB7438345061622218", "currency": "GEL" }, "instructedAmount": { "currency": "USD", "amount": "15" }, "creditorAccount": { "iban": "GE83TB7438345061655577", "currency": "GEL" }, "creditorName": "Wolfgang Amadeus Mozart", "remittanceInformationUnstructured": "Test Payment Noa9f5ca22-628b-4cc3-b239-78170db9ac88" } ``` ```json { "instructedAmount": { "currency": "USD", "amount": "15" }, "creditorAccount": { "iban": "GE83TB7438345061655577", "currency": "GEL" }, "remittanceInformationUnstructured": "Test Payment Noa9f5ca22-628b-4cc3-b239-78170db9ac88" } ``` ```json { "debtorAccount": { "iban": "GE83TB7438345061655577", "currency": "1.2" }, "ultimateDebtorIdentification": { "privateId": { "others": [ { "identification": "PNOGE-01019013212" } ] } }, "ultimateDebtor": "Ludwig van Beethoven", "instructedAmount": { "currency": "GEL", "amount": "1.2" }, "creditorAccount": { "other": { "identification": "101001000" } }, "creditorAgent": "TRESGE22", "creditorName": "Ludwig van Beethoven", "remittanceInformationUnstructured": "Ref Number Merchant" } ``` -------------------------------- ### Initiate Payment Request via cURL Source: https://developers.tbcbank.ge/reference/payments-1 This snippet demonstrates how to perform a POST request to the payment initiation endpoint. It requires setting the appropriate headers for JSON content and targeting the specific payment product URL. ```Shell curl --request POST \ --url https://test-openbanking.tbcbank.ge/0.8/v1/payments/aspsp \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### GET /online-installments/applications/{session-id}/status Source: https://developers.tbcbank.ge/reference/online-installments-api-reference Retrieves the current status of an initiated installment loan application. ```APIDOC ## GET /online-installments/applications/{session-id}/status ### Description Returns the current status of the specified installment loan application. ### Method GET ### Endpoint /v1/online-installments/applications/{session-id}/status ### Parameters #### Path Parameters - **session-id** (string) - Required - The unique session identifier ### Response #### Success Response (200) - **status** (string) - Current status of the application #### Response Example { "status": "APPROVED" } ``` -------------------------------- ### Retrieve OAuth Authorization Server Configuration Source: https://developers.tbcbank.ge/reference/aisopenidconfiguration This example demonstrates the response structure for the OAuth authorization server details. It provides essential endpoints for authorization, token exchange, and registration, along with supported scopes and grant types. ```json { "issuer": "https://test-api.tbcbank.ge", "authorization_endpoint": "https://test-api.tbcbank.ge/psd2/openbanking/oauth/authorize", "token_endpoint": "https://test-openbanking.tbcbank.ge/openbanking/oauth/token", "token_endpoint_auth_methods_supported": ["tls_client_auth"], "tls_client_certificate_bound_access_tokens": true, "registration_endpoint": "https://test-openbanking.tbcbank.ge/openbanking/oauth/register", "scopes_supported": ["openid", "profile", "AIS:", "PIS:"], "response_types_supported": ["code"], "grant_types_supported": ["authorization_code", "refresh_token"], "revocation_endpoint_auth_methods_supported": ["tls_client_auth"], "revocation_endpoint": "https://test-openbanking.tbcbank.ge/openbanking/oauth/token", "ui_locales_supported": ["en", "ka"] } ``` -------------------------------- ### Get User Info using PHP Source: https://developers.tbcbank.ge/reference/userinfo PHP code example for calling the TBC Bank User Info API. It shows how to send a GET request with an Authorization header and an Accept header. ```php // PHP example (using cURL) // $ch = curl_init(); // // curl_setopt($ch, CURLOPT_URL, 'https://test-api.tbcbank.ge/userinfo'); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); // // $headers = array(); // $headers[] = 'Authorization: Bearer YOUR_ACCESS_TOKEN'; // $headers[] = 'Accept: application/jwt'; // curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // // $response = curl_exec($ch); // if (curl_errno($ch)) { // echo 'Error:' . curl_error($ch); // } else { // echo $response; // } // // curl_close($ch); ``` -------------------------------- ### Get User Info using Python Source: https://developers.tbcbank.ge/reference/userinfo Python script to fetch user information from TBC Bank's API. This example utilizes the 'requests' library to perform a GET request with necessary headers. ```python # Python example (using requests library) # import requests # # url = "https://test-api.tbcbank.ge/userinfo" # headers = { # "Authorization": "Bearer YOUR_ACCESS_TOKEN", # "Accept": "application/jwt" # } # # try: # response = requests.get(url, headers=headers) # response.raise_for_status() # Raise an exception for bad status codes # print(response.text) # except requests.exceptions.RequestException as e: # print(f"Error fetching user info: {e}") ``` -------------------------------- ### POST /v2/{deferred-payment-service}/{payment-product} Source: https://developers.tbcbank.ge/reference/deferredpayments-1 Initiates a deferred payment request using the specified service and payment product path parameters. ```APIDOC ## POST /v2/{deferred-payment-service}/{payment-product} ### Description Initiates a deferred payment transaction within the TBC Bank Open Banking framework. ### Method POST ### Endpoint https://test-openbanking.tbcbank.ge/v2/{deferred-payment-service}/{payment-product} ### Parameters #### Path Parameters - **deferred-payment-service** (string) - Required - The specific service identifier for deferred payments. - **payment-product** (string) - Required - The specific payment product identifier. ### Request Example { "amount": 100.00, "currency": "GEL", "debtorAccount": "GE00TB0000000000000000", "creditorAccount": "GE00TB0000000000000001" } ### Response #### Success Response (200) - **paymentId** (string) - The unique identifier for the initiated payment. - **status** (string) - The current status of the payment initiation. #### Response Example { "paymentId": "PAY-123456789", "status": "Initiated" } ``` -------------------------------- ### Create Consent Response Examples (JSON) Source: https://developers.tbcbank.ge/reference/aiscreateconsent Examples of responses when creating a consent, illustrating different authorization flows. These responses include consent status, ID, and relevant links for proceeding with the authorization process. ```json { "CreateConsentResponse_Redirect_Example": { "description": "Response example in case of a redirect with a dedicated start of the authorisation process", "value": { "consentStatus": "received", "consentId": "ab60aab2-4598-4f9b-be47-c52ff7f1973e", "_links": { "startAuthorisation": { "href": "/0.8/v1/consents/ab60aab2-4598-4f9b-be47-c52ff7f1973e/authorisations" } } } }, "CreateConsentResponse_OAuth2_Example": { "description": "Response example in case of the OAuth2 approach with an implicit generated authorisation resource", "value": { "consentStatus": "received", "consentId": "c79ad1fb-8d01-44fc-b602-9ce471033952", "_links": { "scaOAuth": { "href": "https://test-api.tbcbank.ge/.well-known/oauth-authorization-server" }, "self": { "href": "/0.8/v1/consents/c79ad1fb-8d01-44fc-b602-9ce471033952" }, "status": { "href": "/0.8/v1/consents/c79ad1fb-8d01-44fc-b602-9ce471033952/status" }, "scaStatus": { "href": "/0.8/v1/consents/c79ad1fb-8d01-44fc-b602-9ce471033952/authorisations/9647ca44-d5ce-4831-f0d7-08dd78f81e43" } } } }, "CreateConsentResponse_Decoupled_Example": { "description": "Response example in case of the decoupled approach", "value": { "consentStatus": "received", "consentId": "d87251a0-17a1-411c-b2d3-fc42eb9c87af", "_links": { "startAuthorisationWithPsuIdentification": { "href": "/0.8/v1/consents/d87251a0-17a1-411c-b2d3-fc42eb9c87af/authorisations" } } } } } ``` -------------------------------- ### Get User Info using Node.js Source: https://developers.tbcbank.ge/reference/userinfo Example of fetching user information from TBC Bank API using Node.js. This code makes a GET request and handles the response, typically expecting a JWT. ```javascript // Node.js example (requires a library like 'axios' or 'node-fetch') // const axios = require('axios'); // // async function getUserInfo() { // try { // const response = await axios.get('https://test-api.tbcbank.ge/userinfo', { // headers: { // 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', // 'Accept': 'application/jwt' // } // }); // console.log(response.data); // return response.data; // } catch (error) { // console.error('Error fetching user info:', error); // throw error; // } // } ``` -------------------------------- ### GetPaymentResponse Example (JSON) Source: https://developers.tbcbank.ge/reference/get_v1-tpay-payments-payid An example of a successful payment response, detailing transaction status, amounts, currency, and associated payment method information. Includes fields like `payId`, `status`, `amount`, and recurring card details. ```json { "payId": "vel8b76o5t881126014", "status": "PartialReturned", "currency": "GEL", "amount": 3000, "confirmedAmount": 0.1, "returnedAmount": 0, "links": null, "transactionId": "qZXG0HqGDINvXG/P9jNU0HqGDJn3LMPVjE=", "paymentMethod": 5, "preAuth": true, "recurringCard": { "recId": "8715aBbB4314e7dC4f91482283988365a3c30822", "cardMask": "415479******8365", "expiryDate": "0230" }, "paymentCardNumber": null, "rrn": null, "extra": "GE50TB7809945000000000", "extra2": "0.10", "httpStatusCode": 200, "developerMessage": null, "userMessage": null } ``` -------------------------------- ### GET /v1/online-installments/merchant/applications/status-changes Source: https://developers.tbcbank.ge/reference/online-installments-merchant-application-statuses-api Retrieves the status changes for merchant applications within the online installments module. You can specify the merchant key and the number of status changes to retrieve. ```APIDOC ## GET /v1/online-installments/merchant/applications/status-changes ### Description Retrieves the status changes for merchant applications within the online installments module. You can specify the merchant key and the number of status changes to retrieve. ### Method GET ### Endpoint https://test-api.tbcbank.ge/v1/online-installments/merchant/applications/status-changes ### Parameters #### Query Parameters - **merchantKey** (string) - Required - merchant unique identifier in online installments module - **take** (integer) - Optional - maximum number of changed statuses to be returned with one request ### Request Example ```json { "merchantKey": "000000000-ce21da5e-da92-48f3-8009-4d438cbcc137", "take": 10 } ``` ### Response #### Success Response (200) - **synchronizationRequestId** (string) - The ID of the synchronization request. - **totalCount** (integer) - The total number of status changes available. - **statusChanges** (array) - An array of status change objects. - **sessionId** (string) - The session ID for the status change. - **statusId** (integer) - The ID of the status. - **statusDescription** (string) - A description of the status. - **changeDate** (string) - The date and time when the status changed. #### Response Example ```json { "synchronizationRequestId": "9e05332c-b8c2-4807-a353-dffc1a7d1060", "totalCount": 4, "statusChanges": [ { "sessionId": "9e543941-5a90-480c-9ed1-2d251fb62d6b", "statusId": 0, "statusDescription": "Installment pending for client authentication in TBC Bank", "changeDate": "2021-01-13T16:45:23.1872462" }, { "sessionId": "f7aa5d42-d8d7-4c84-8e3b-6f92b0f6c476", "statusId": 1, "statusDescription": "Installment is In Progress", "changeDate": "2021-01-13T18:26:46.0138611" }, { "sessionId": "5ec8d6ff-9b88-48d8-8cf5-5df35c1feff0", "statusId": 1, "statusDescription": "Installment is In Progress", "changeDate": "2021-01-13T18:27:08.1384225" }, { "sessionId": "fa2a986c-da09-49be-b4bd-fa1e58914012", "statusId": 0, "statusDescription": "Installment pending for client authentication in TBC Bank", "changeDate": "2021-01-13T23:54:01.4387056" } ] } ``` ``` -------------------------------- ### OAuth Token Response Examples Source: https://developers.tbcbank.ge/reference/post_openbanking-oauth-token-3 Illustrates the structure of responses received when generating or refreshing OAuth tokens. These examples show the fields returned, including access tokens, token types, refresh tokens, and their associated expiry and scope information. ```json { "access_token": "ffODwEVU5sD9RADdEWEYUQNijrcE", "token_type": "Bearer", "refresh_token": "qjfHpGMyOZGv7gZVRxGPGoPfbgHNwIHs", "refresh_token_issued_at": "1682595156807", "refresh_token_expires_in": "7775999", "refresh_count": 0, "scope": "PIS:45f90ecc-3879-4574-de8e-08db40b82e17", "issued_at": "1682595156807", "expires_in": 3599 } ``` ```json { "access_token": "olFXJEkx4pA8OEFu2IHoLSsh8fFZ", "token_type": "Bearer", "refresh_token": "qjfHpGMyOZGv7gZVRxGPGoPfbgHNwIHs", "refresh_token_issued_at": "1682595156807", "refresh_token_expires_in": "7775593", "refresh_count": 1, "scope": "PIS:45f90ecc-3879-4574-de8e-08db40b82e17", "issued_at": "1682595563649", "expires_in": 3599 } ``` -------------------------------- ### Get Access Token using Node.js Source: https://developers.tbcbank.ge/reference/access-token This Node.js example shows how to make a POST request to the TBC Bank API to get an access token. It utilizes the 'axios' library for making HTTP requests and includes the required headers and form data. ```JavaScript const axios = require('axios'); const clientId = 'YOUR_CLIENT_ID'; const clientSecret = 'YOUR_CLIENT_SECRET'; const apiKey = 'YOUR_API_KEY'; axios.post('https://api.tbcbank.ge/v1/tpay/access-token', null, { headers: { 'accept': 'application/json', 'content-type': 'application/x-www-form-urlencoded', 'apikey': apiKey }, data: `client_id=${clientId}&client_secret=${clientSecret}` }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error getting access token:', error); }); ``` -------------------------------- ### Get Commercial Rates (C#) Source: https://developers.tbcbank.ge/reference/exchangerates-commercial-rates Provides a C# example for fetching commercial exchange rates from TBC Bank. This snippet illustrates setting up an HTTP GET request, including the endpoint URL with optional currency parameters and the required API key in the headers. ```csharp using System; using System.Net.Http; using System.Threading.Tasks; public class TbcBankApi { public static async Task GetCommercialRatesAsync() { using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add("apikey", "I3Rz8QXBVPofKtucsenkW7g2n7aDwqBg"); var response = await client.GetAsync("https://test-api.tbcbank.ge/v1/exchange-rates/commercial?currency=usd,eur"); response.EnsureSuccessStatusCode(); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } } } ``` -------------------------------- ### POST /v1/bulk-payments/{payment-product} Source: https://developers.tbcbank.ge/reference/post_v1-bulk-payments-payment-product Initiates a bulk payment request. This endpoint requires specific headers for PSU identification and security, and supports different payment products. ```APIDOC ## POST /v1/bulk-payments/{payment-product} ### Description Initiates a bulk payment request for a specified payment product. The endpoint requires various headers to identify the Payment Service User (PSU) and ensure secure transaction processing. ### Method POST ### Endpoint /v1/bulk-payments/{payment-product} ### Parameters #### Path Parameters - **payment-product** (string) - Required - The type of payment product (aspsp, domestic, or foreign). #### Header Parameters - **X-Request-ID** (string) - Required - Unique ID for the request (UUID). - **PSU-ID** (string) - Optional - Client ID of the PSU. - **PSU-IP-Address** (string) - Optional - IP address of the PSU. - **TPP-Redirect-URI** (string) - Optional - Redirect URI for the transaction flow. ### Request Example { "paymentInformation": "bulk-payment-details" } ### Response #### Success Response (200) - **paymentId** (string) - The unique identifier for the initiated bulk payment. #### Response Example { "paymentId": "b123456789", "status": "Initiated" } ``` -------------------------------- ### Get Access Token using Python Source: https://developers.tbcbank.ge/reference/access-token This Python example demonstrates how to retrieve an access token using the 'requests' library. It constructs a POST request with the required form data and headers for the TBC Bank API. ```Python import requests client_id = 'YOUR_CLIENT_ID' client_secret = 'YOUR_CLIENT_SECRET' api_key = 'YOUR_API_KEY' url = 'https://api.tbcbank.ge/v1/tpay/access-token' headers = { 'accept': 'application/json', 'content-type': 'application/x-www-form-urlencoded', 'apikey': api_key } data = { 'client_id': client_id, 'client_secret': client_secret } response = requests.post(url, headers=headers, data=data) print(response.json()) ``` -------------------------------- ### JWKS Response Example Source: https://developers.tbcbank.ge/reference/get_well-known-keys Provides an example of a JWKS (JSON Web Key Set) response, detailing the structure of the 'keys' array. Each key object includes algorithm, key type, usage, certificate chain, modulus, exponent, key ID, and thumbprint. ```json { "keys": [ { "alg": "RS256", "kty": "RSA", "use": "sig", "x5c": [ "MIIC+DCCAeCgAwIBAgIJBIGjYW6hFpn2MA0GCSqGSIb3DQEBBQUAMCMxITAfBgNVBAMTGGN1c3RvbWVyLWRlbW9zLmF1dGgwLmNvbTAeFw0xNjExMjIyMjIyMDVaFw0zMDA4MDEyMjIyMDVaMCMxITAfBgNVBAMTGGN1c3RvbWVyLWRlbW9zLmF1dGgwLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMnjZc5bm/eGIHq09N9HKHahM7Y31P0ul+A2wwP4lSpIwFrWHzxw88/7Dwk9QMc+orGXX95R6av4GF+Es/nG3uK45ooMVMa/hYCh0Mtx3gnSuoTavQEkLzCvSwTqVwzZ+5noukWVqJuMKNwjL77GNcPLY7Xy2/skMCT5bR8UoWaufooQvYq6SyPcRAU4BtdquZRiBT4U5f+4pwNTxSvey7ki50yc1tG49Per/0zA4O6Tlpv8x7Red6m1bCNHt7+Z5nSl3RX/QYyAEUX1a28VcYmR41Osy+o2OUCXYdUAphDaHo4/8rbKTJhlu8jEcc1KoMXAKjgaVZtG/v5ltx6AXY0CAwEAAaMvMC0wDAYDVR0TBAUwAwEB/zAdBgNVHQ4EFgQUQxFG602h1cG+pnyvJoy9pGJJoCswDQYJKoZIhvcNAQEFBQADggEBAGvtCbzGNBUJPLICth3mLsX0Z4z8T8iu4tyoiuAshP/Ry/ZBnFnXmhD8vwgMZ2lTgUWwlrvlgN+fAtYKnwFO2G3BOCFw96Nm8So9sjTda9CCZ3dhoH57F/hVMBB0K6xhklAc0b5ZxUpCIN92v/w+xZoz1XQBHe8ZbRHaP1HpRM4M7DJk2G5cgUCyu3UBvYS41sHvzrxQ3z7vIePRA4WF4bEkfX12gvny0RsPkrbVMXX1Rj9t6V7QXrbPYBAO+43JvDGYawxYVvLhz+BJ45x50GFQmHszfY3BR9TPK8xmMmQwtIvLu1PMttNCs7niCYkSiUv2sc2mlq1i3IashGkkgmo=" ], "n": "yeNlzlub94YgerT030codqEztjfU_S6X4DbDA_iVKkjAWtYfPHDzz_sPCT1Axz6isZdf3lHpq_gYX4Sz-cbe4rjmigxUxr-FgKHQy3HeCdK6hNq9ASQvMK9LBOpXDNn7mei6RZWom4wo3CMvvsY1w8tjtfLb-yQwJPltHxShZq5-ihC9irpLI9xEBTgG12q5lGIFPhTl_7inA1PFK97LuSLnTJzW0bj096v_TMDg7pOWm_zHtF53qbVsI0e3v5nmdKXdFf9BjIARRfVrbxVxiZHjU6zL6jY5QJdh1QCmENoejj_ytspMmGW7yMRxzUqgxcAqOBpVm0b-_mW3HoBdjQ", "e": "AQAB", "kid": "NjVBRjY5MDlCMUIwNzU4RTA2QzZFMDQ4QzQ2MDAyQjVDNjk1RTM2Qg", "x5t": "NjVBRjY5MDlCMUIwNzU4RTA2QzZFMDQ4QzQ2MDAyQjVDNjk1RTM2Qg" } ] } ``` -------------------------------- ### Standard Redirect-Based Login Python Example Source: https://developers.tbcbank.ge/reference/authorization-code-flow This Python example shows how to send a GET request to the TBC Bank authorization endpoint for the redirect-based login. It uses the 'requests' library to handle the HTTP request and response. ```python import requests url = 'https://test-api.tbcbank.ge/psd2/openbanking/oauth/authorize' params = { 'claims': 'userinfo=[object Object]' } response = requests.get(url, params=params) print(f"Status Code: {response.status_code}") print(f"Headers: {response.headers}") print(f"Body: {response.text}") ``` -------------------------------- ### 404 Not Found Example (JSON) Source: https://developers.tbcbank.ge/reference/aisreadaccountdetails This example shows a 404 Not Found error, indicating that the requested resource could not be located. The 'detail' field specifies the identifier of the missing consent, such as 'c9161b2e-46d0-4891-8114-2767253d4510'. ```json { "code": "CONSENT_UNKNOWN", "traceId": "00-88e0f2509e1d5ad73d99dee283010f18-bdcf39859de601a7-01", "type": "https://developers.tbcbank.ge/docs/error-type-404", "title": "Consent not found", "status": 404, "detail": "Consent not found with this Id: c9161b2e-46d0-4891-8114-2767253d4510", "instance": "/v1/accounts" } ``` -------------------------------- ### Standard Redirect-Based Login Ruby Example Source: https://developers.tbcbank.ge/reference/authorization-code-flow This Ruby example illustrates how to perform a GET request to the TBC Bank authorization endpoint for the redirect-based login. It utilizes the Net::HTTP library to construct and send the request. ```ruby require 'net/http' require 'uri' uri = URI.parse('https://test-api.tbcbank.ge/psd2/openbanking/oauth/authorize?claims=userinfo=[object Object]') response = Net::HTTP.get_response(uri) puts "Status Code: #{response.code}" puts "Headers: #{response.each_header.to_h}" puts "Body: #{response.body}" ```