{"id":18488486,"url":"https://github.com/Adyen/adyen-node-api-library","last_synced_at":"2025-04-08T21:30:34.613Z","repository":{"id":37444393,"uuid":"195236953","full_name":"Adyen/adyen-node-api-library","owner":"Adyen","description":"Adyen API Library for Node.js","archived":false,"fork":false,"pushed_at":"2025-04-02T09:41:39.000Z","size":14965,"stargazers_count":110,"open_issues_count":27,"forks_count":72,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-02T22:54:51.586Z","etag":null,"topics":["adyen","api","api-client","api-library","hacktoberfest","node","node-js","nodejs","payment","payment-gateway","payment-integration"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Adyen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-04T12:24:22.000Z","updated_at":"2025-04-01T13:30:29.000Z","dependencies_parsed_at":"2023-09-22T20:55:54.231Z","dependency_job_id":"46e12e8e-5f77-4caa-99d7-4013575e5336","html_url":"https://github.com/Adyen/adyen-node-api-library","commit_stats":{"total_commits":974,"total_committers":35,"mean_commits":27.82857142857143,"dds":0.7381930184804928,"last_synced_commit":"9171d34821bfe39dd69f1835b4220ace82a3c031"},"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adyen%2Fadyen-node-api-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adyen%2Fadyen-node-api-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adyen%2Fadyen-node-api-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adyen%2Fadyen-node-api-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adyen","download_url":"https://codeload.github.com/Adyen/adyen-node-api-library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247930970,"owners_count":21020142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adyen","api","api-client","api-library","hacktoberfest","node","node-js","nodejs","payment","payment-gateway","payment-integration"],"created_at":"2024-11-06T12:51:48.262Z","updated_at":"2025-04-08T21:30:34.598Z","avatar_url":"https://github.com/Adyen.png","language":"TypeScript","readme":"\n![Node js](https://user-images.githubusercontent.com/62436079/207373079-9cf9377f-f530-4b02-a515-9b64ef7b06e7.png)\n\n# Adyen API library for Node.js \n[![Build Status](https://github.com/adyen/Adyen-node-api-library/actions/workflows/npmpublish.yml/badge.svg)](https://github.com/Adyen/adyen-node-api-library/actions/workflows/npmpublish.yml)\n[![Coverage Status](https://coveralls.io/repos/github/Adyen/adyen-node-api-library/badge.svg?branch=main)](https://coveralls.io/github/Adyen/adyen-node-api-library?branch=main)\n[![Downloads](https://img.shields.io/npm/dm/@adyen/api-library.svg)](https://www.npmjs.com/package/@adyen/api-library)\n![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@adyen/api-library.svg)\n[![Version](https://img.shields.io/npm/v/@adyen/api-library.svg)](https://www.npmjs.com/package/@adyen/api-library)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-node-api-library\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=Adyen_adyen-node-api-library)\n\nThis is the official Adyen API library for Node.js that we recommend for integrating with Adyen APIs.\n\n## Supported APIs\n\nThis library supports the following:\n\n| API name                                                                                                   | API version | Description                                                                                                                                                                                                                                                                                                                              | API object                                                                                                                                                                                                                       |\n|------------------------------------------------------------------------------------------------------------|:-----------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [BIN Lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview)                                |     v54     | The BIN Lookup API provides endpoints for retrieving information based on a given BIN.                                                                                                                                                                                                                                                   | [BinLookup](/src/services/binLookupApi.ts)                                                                                                                              |\n| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview)                                   |     v71     | Our latest integration for accepting online payments.                                                                                                                                                                                                                                                                                    | [CheckoutAPI](/src/services/checkout/index.ts)                                                                                                                          |\n| [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview)                        |     v2      | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts.                                                                                                                                                                    | [BalancePlatform](/src/services/balancePlatform/index.ts)                                                                                                               |\n| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api)                     |     v1      | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email)                        | [DataProtection](/src/services/dataProtectionApi.ts)                                                                                                                    |\n| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview)                  |     v3      | Manage legal entities that contain information required for verification.                                                                                                                                                                                                                                                                | [LegalEntityManagement](/src/services/legalEntityManagement/index.ts)                                                                                                   |\n| [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference)              |      -      | Our point-of-sale integration.                                                                                                                                                                                                                                                                                                           | [TerminalLocalAPI](/src/services/terminalLocalAPI.ts) or [TerminalCloudAPI](/src/services/terminalCloudAPI.ts) |\n| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview)                                |     v3      | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals.                                                                                                                                                                                                                                            | [Management](/src/services/management/index.ts)                                                                                                                         |\n| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview)                                    |     v68     | Our classic integration for online payments.                                                                                                                                                                                                                                                                                             | [ClassicIntegrationAPI](/src/services/paymentApi.ts)                                                                                                                    |\n| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview)                                      |     v68     | Endpoints for sending funds to your customers.                                                                                                                                                                                                                                                                                           | [Payout](/src/services/payout/index.ts)                                                                                                                                 |\n| [Platforms APIs](https://docs.adyen.com/platforms/api)                                                     |      -      | Set of APIs when using Adyen for Platforms. This API is used for the classic integration.                                                                                                                                                                                                                                                | [Platforms](/src/services/platforms.ts)                                                                                                                                 |\n| [Account API](https://docs.adyen.com/api-explorer/Account/6/overview)                                      |     v6      | Provides endpoints for managing account-related entities on your platform. These related entities include account holders, accounts, bank accounts, shareholders, and verification-related documents.                                                                                                                                    | [Account](/src/services/platforms.ts)                                                                                                                                   |\n| [Fund API](https://docs.adyen.com/api-explorer/Fund/6/overview)                                            |     v6      | Provides endpoints for managing the funds in the accounts on your platform. These management operations include, for example, the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account.                                                                  | [Fund](/src/services/platforms.ts)                                                                                                                                      |\n| [Hosted onboarding API](https://docs.adyen.com/api-explorer/Hop/6/overview)                                |     v6      | Provides endpoints that you can use to generate links to Adyen-hosted pages, such as an onboarding page or a PCI compliance questionnaire. You can provide these links to your account holders so that they can complete their onboarding.                                                                                               | [HostedOnboardingPage](/src/services/platforms.ts)                                                                                                                      |\n| [Notification Configuration API](https://docs.adyen.com/api-explorer/NotificationConfiguration/6/overview) |     v6      | Provides endpoints for setting up and testing notifications that inform you of events on your platform, for example when a verification check or a payout has been completed.                                                                                                                                                            | [NotificationConfiguration](/src/services/resource/platforms/notificationConfiguration.ts)                                                                              |\n| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview)                    |     ~~v1~~     | ~~Endpoints for managing your point-of-sale payment terminals.~~ ‼️ Deprecated: use instead the [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview) for the management of your terminal fleet.                                                                                                                                                                                                                                                                             | [~~TerminalManagement~~](/src/services/terminalManagementApi.ts)                                                                                                            |\n| [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview)                                 |     v68     | Endpoints for managing saved payment details.                                                                                                                                                                                                                                                                                            | [Recurring](/src/services/recurringApi.ts)                                                                                                                              |\n| [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api)                     |     v46     | Manage both online and point-of-sale gift cards and other stored-value cards.                                                                                                                                                                                                                                                            | [StoredValue](/src/services/storedValueApi.ts)                                                                                                                          |\n| [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview)                                  |     v4      | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument.                                                                                                                         | [Transfers](/src/services/transfers/index.ts)                                                                                                                           |\n| [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview)                                   |     v30     | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes.  | [Disputes](/src/services/disputesApi.ts)                                                                                                                                |\n| [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview)                                   |     v68     | The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform. The POS Mobile SDK for Android or iOS devices enables businesses to accept in-person payments using a commercial off-the-shelf (COTS) device like a phone. For example, Tap to Pay transactions, or transactions on a mobile device in combination with a card reader | [POS Mobile](/src/services/posMobileApi.ts)                                                                                                                                |\n| [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview)                                   |    v1     | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | [PaymentsAppApi](src/services/paymentsApp/paymentsAppApi.ts)\n\n## Supported Webhook versions\nThe library supports all webhooks under the following model directories:\n\n| Webhooks                                                                                          | Description                                                                                                                                                                                 | Model Name                                                     | Supported Version |\n|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------|\n| [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview)             | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires.                                               | [AcsWebhooks](src/typings/acsWebhooks)                         | **v1**            |\n| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/2/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed.                  | [ConfigurationNotification](src/typings/configurationWebhooks) | **v2**            |\n| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview)             | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds.            | [TransferNotification](src/typings/transferWebhooks)           | **v4**            |\n| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview)                 | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area                                                               | [ReportNotification](src/typings/reportWebhooks)               | **v1**            |\n| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview)      | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [ManagementWebhooks](src/typings/managementWebhooks)           | **v3**            |\n| [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview)                  | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation     | [Notification](src/typings/notification)                       | **v1**            |\n| [Transaction Webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/4/overview)                  | Adyen sends webhooks to inform your system about incoming and outgoing transfers in your platform. You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds.     | [TransactionWebhooks](src/typings/transactionWebhooks)                       | **v4**            |\n\nFor more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/).\n\n## Before you begin\n\nBefore you begin to integrate:\n\n- [Create an Adyen test account](https://docs.adyen.com/get-started-with-adyen#test-account).\n- [Set up your API credentials](https://docs.adyen.com/development-resources/api-credentials).\n- [Install Node.js](https://nodejs.org/en/download/) version 18 or later.\n\n## Installation\n\nInstall the [Node.JS package](https://www.npmjs.com/package/@adyen/api-library):\n\n``` bash\nnpm install --save @adyen/api-library\n```\n\nAlternatively, you can download the [release on GitHub](https://github.com/Adyen/adyen-node-api-library/releases).\n\n## Updating\n\nTo update the Node.JS package:\n\n``` bash\nnpm update @adyen/api-library\n```\n\nCheck for breaking changes on the [releases page](https://github.com/Adyen/adyen-node-api-library/releases/).\n\n## Usage\n\n``` javascript\n// Step 1: Require the parts of the module you want to use\nconst { Client, CheckoutAPI} = require('@adyen/api-library');\n\n// Step 2: Initialize the client object\nconst client = new Client({apiKey: \"YOUR_API_KEY\", environment: \"TEST\"}); \n\n// Step 3: Initialize the API object\nconst checkoutApi = new CheckoutAPI(client);\n\n// Step 4: Create the request object\n  const paymentRequest = {\n    amount: {\n      currency: \"USD\",\n      value: 1000 // value in minor units\n    },\n    reference: \"Your order number\",\n    paymentMethod: {\n      type: \"scheme\",\n      encryptedCardNumber: \"test_4111111111111111\",\n      encryptedExpiryMonth: \"test_03\",\n      encryptedExpiryYear: \"test_2030\",\n      encryptedSecurityCode: \"test_737\"\n    },\n    shopperReference: \"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\",\n    storePaymentMethod: true,\n    shopperInteraction: \"Ecommerce\",\n    recurringProcessingModel: \"CardOnFile\",\n    returnUrl: \"https://your-company.com/...\",\n    merchantAccount: \"YOUR_MERCHANT_ACCOUNT\"\n  };\n  \n// Step 5: Make the request\ncheckoutApi.PaymentsApi.payments(paymentRequest)\n  .then(paymentResponse =\u003e console.log(paymentResponse.pspReference))\n  .catch(error =\u003e console.log(error));\n```\nIf you want to pass query string parameters, you can use the `params` field from [IRequest](/src/typings/requestOptions.ts) (also used for idempotency-key and other header fields). \nThe method descriptions contain an example of the possible values you can send to the API for the query parameters, just as stated in the API explorer.\n```javascript\nconst requestOptions: IRequest.Options = {\n    params: {\n        limit: \"5\",\n        offset: \"10\"\n    }\n};\nawait balancePlatformService.AccountHoldersApi.getAllBalanceAccountsOfAccountHolder(\"AH32272223222B5CM4MWJ892H\", requestOptions);\n```\n\n### Step 1: Require the parts of the module you want to use\n\nUse the Node.js `require` function to load the `Client` and API objects from the Adyen module. For the name of the API objects, see [Supported APIs](#supported-apis).\n\nFor example, to use the [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview):\n\n``` javascript\nconst { Client, CheckoutAPI} = require('@adyen/api-library');\n```\n\n### Step 2: Initialize the client object\n\nInitialize the client object, passing the following:\n- `apiKey`: The API key you [generated from the Customer Area](https://docs.adyen.com/development-resources/api-credentials#generate-api-key).\n- `environment`: For the test environment, use **TEST**. For the live environment, use **LIVE**.\n\nFor example:\n\n``` javascript\nconst client = new Client({apiKey: \"YOUR_API_KEY\", environment: \"TEST\"}); \n```\n\n### Step 3: Initialize the API object\n\nInitialize the API object you want to use, passing the `client` object from the previous step. \n\nFor example, for the [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview):\n\n``` javascript\nconst checkoutApi = new CheckoutAPI(client);\n```\n\n### Step 4: Create the request object\n\nCreate a the request object. For example, for a request to the `/payments` endpoint:\n\n``` javascript\n  const paymentRequest = {\n    amount: {\n      currency: \"USD\",\n      value: 1000 // value in minor units\n    },\n    reference: \"Your order number\",\n    paymentMethod: {\n      type: \"scheme\",\n      encryptedCardNumber: \"test_4111111111111111\",\n      encryptedExpiryMonth: \"test_03\",\n      encryptedExpiryYear: \"test_2030\",\n      encryptedSecurityCode: \"test_737\"\n    },\n    shopperReference: \"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\",\n    storePaymentMethod: true,\n    shopperInteraction: \"Ecommerce\",\n    recurringProcessingModel: \"CardOnFile\",\n    returnUrl: \"https://your-company.com/...\",\n    merchantAccount: \"YOUR_MERCHANT_ACCOUNT\"\n  };\n```\n\n### Step 5: Make the request\n\nUse the API object's method to make the request. For example, to make a request to the `/payments` endpoint using the `CheckoutAPI` object:\n\n```\ncheckoutApi.PaymentsApi.payments(paymentRequest)\n  .then(paymentResponse =\u003e console.log(paymentResponse.pspReference))\n  .catch(error =\u003e console.log(error));\n```\n### Client setup when going live\n\nFor APIS that require your [Live URL Prefix](https://docs.adyen.com/development-resources/live-endpoints#live-url-prefix) (Binlookup, BalanceControl, Checkout, Payout and Recurring) the client is set up as follows in order to start processing live payments:\n``` typescript\nconst { Client } = require('@adyen/api-library');\n\nconst client = new Client({apiKey: \"YOUR_API_KEY\", environment: \"TEST\", liveEndpointUrlPrefix: \"YOUR_LIVE_URL_PREFIX\"}); \n```\n\n### Usage in TypeScript\n\nAlternatively, you can use the `Types` included in this module for Typescript and `async` syntax.\n\n``` typescript\n  const { Client, CheckoutAPI, Types } = require('@adyen/api-library');\n  const client = new Client({apiKey: \"YOUR_API_KEY\", environment: \"TEST\"});\n\n  const makePaymentsRequest = async () =\u003e {\n    const paymentsRequest : Types.checkout.PaymentRequest = {\n      amount: {\n        currency: \"USD\",\n        value: 1000 // Value in minor units.\n      },\n      reference: \"Your order number\",\n      paymentMethod: {\n        type: Types.checkout.CardDetails.TypeEnum.Scheme,\n        encryptedCardNumber: \"test_4111111111111111\",\n        encryptedExpiryMonth: \"test_03\",\n        encryptedExpiryYear: \"test_2030\",\n        encryptedSecurityCode: \"test_737\"\n      },\n      shopperReference: \"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j\",\n      storePaymentMethod: true,\n      shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.Ecommerce,\n      recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,\n      returnUrl: \"https://your-company.com/...\",\n      merchantAccount: \"YOUR_MERCHANT_ACCOUNT\"\n    };\n    const checkoutAPI = new CheckoutAPI(client);\n    const paymentResponse : Types.checkout.PaymentResponse = await checkoutAPI.PaymentsApi.payments(paymentsRequest);\n    console.log(paymentResponse.pspReference);\n  }\n\n  makePaymentsRequest();\n```\n\n#### Deserializing JSON Strings\nIn some setups you might need to deserialize JSON strings to request objects. For example, when using the libraries in combination with [Dropin/Components](https://github.com/Adyen/adyen-web). Please use the built-in deserialization functions:\n``` typescript\n// Import the required model class\nimport { checkout } from \"../typings\";\n\n// Deserialize using built-in ObjectSerializer class\nconst requestJson: JSON = JSON.parse(`YOUR_JSON_STRING`);\nconst paymentRequest: checkout.PaymentRequest = await checkout.ObjectSerializer.deserialize(requestJson,\"PaymentRequest\");\n```\n \n### Custom HTTP client configuration\n\nBy default, [Node.js https](https://nodejs.org/api/https.html) is used to make API requests. Alternatively, you can set a custom `HttpClient` for your `Client` object.\n\nFor example, to set `axios` as your HTTP client:\n\n``` javascript\nconst {Client, Config} = require('@adyen/api-library');\nconst axios = require(\"axios\");\n// ... more code\nconst config = new Config();\nconst client = new Client({\n  config,\n  httpClient: {\n    async request(endpoint, json, config, isApiKeyRequired, requestOptions) {\n        const response = await axios({\n            method: 'POST',\n            url: endpoint,\n            data: JSON.parse(json),\n            headers: {\n                \"X-API-Key\": config.apiKey,\n                \"Content-type\": \"application/json\"\n            },\n        });\n\n        return response.data;\n    }\n  }\n});\n// ... more code\n```\n\n### Parsing and Authenticating Banking Webhooks\nParse an AccountHolderNotificationRequest webhook;\n``` typescript\nlet bankingWebhookHandler = new BankingWebhookHandler(YOUR_BANKING_WEBHOOK);\nconst accountHolderNotificationRequest: AccountHolderNotificationRequest = bankingWebhookHandler.getAccountHolderNotificationRequest();\nconst genericWebhook = bankingWebhookHandler.getGenericWebhook();\n```\nYou can also parse the webhook with a generic type, in case you do not know the webhook type in advance. In this case you can check the instance of the webhook in order to parse it to the respective type (or just use it dynamically);\n``` typescript\nlet bankingWebhookHandler = new BankingWebhookHandler(YOUR_BANKING_WEBHOOK);\nconst genericWebhook = bankingWebhookHandler.getGenericWebhook();\n```\nVerify the authenticity (where you retrieve the hmac key from the CA and the signature from the webhook header);\n``` typescript\nconst isValid = hmacValidator.validateBankingHMAC(\"YOUR_HMAC_KEY\", \"YOUR_HMAC_SIGNATURE\", jsonString)\n```\n### Management Webhooks\nManagement webhooks are verified the exact same way as the banking webhooks. To parse them however, instead you use:\n``` typescript\nlet managementWebhookHandler = new ManagementWebhookHandler(YOUR_MANAGEMENT_WEBHOOK);\nconst genericWebhook = managementWebhookHandler.getGenericWebhook();\n```\n\n### Proxy configuration\n\nTo configure a proxy connection, set the `proxy` property of your `HttpURLConnectionClient` object.\n\nFor example:\n\n``` javascript\nconst {HttpURLConnectionClient, Client, Config} = require('@adyen/api-library');\n// ... more code\nconst config = new Config();\nconst client = new Client({ config });\nconst httpClient = new HttpURLConnectionClient();\nhttpClient.proxy = { host: \"http://google.com\", port: 8888,  };\n\nclient.setEnvironment('TEST');\nclient.httpClient = httpClient;\n\n// ... more code\n```\n\n### Using the Cloud Terminal API Integration\nIn order to submit In-Person requests with [Terminal API over Cloud](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud/) you need to initialize the client in a similar way as the steps listed above for Ecommerce transactions, but make sure to include `TerminalCloudAPI`:\n``` javascript\n// Step 1: Require the parts of the module you want to use\nconst {Client, TerminalCloudAPI} from \"@adyen/api-library\";\n\n// Step 2: Initialize the client object\nconst client = new Client({apiKey: \"YOUR_API_KEY\", environment: \"TEST\"});\n\n// Step 3: Initialize the API object\nconst terminalCloudAPI = new TerminalCloudAPI(client);\n\n// Step 4: Create the request object\nconst serviceID = \"123456789\";\nconst saleID = \"POS-SystemID12345\";\nconst POIID = \"Your Device Name(eg V400m-123456789)\";\n\n// Use a unique transaction for every transaction you perform\nconst transactionID = \"TransactionID\";\nconst paymentRequest: SaleToPOIRequest = {\n    MessageHeader: {\n        MessageClass: MessageClassType.Service,\n        MessageCategory: MessageCategoryType.Payment,\n        MessageType: MessageType.Request,\n        ProtocolVersion: \"3.0\",\n        ServiceID: serviceID,\n        SaleID: saleID,\n        POIID: POIID\n    },\n    PaymentRequest: {\n        SaleData: {\n            SaleTransactionID: {\n                TransactionID: transactionID,\n                TimeStamp: this.GetDate().toISOString()\n            },\n\n            SaleToAcquirerData: {\n                applicationInfo: {\n                    merchantApplication: {\n                        version: \"1\",\n                        name: \"test\",\n                    }\n                }\n            }\n        },\n        PaymentTransaction: {\n            AmountsReq: {\n                Currency: \"EUR\",\n                RequestedAmount: 1000\n            }\n        }\n    }\n};\n\n// Step 5: Make the request\nconst terminalAPIResponse: terminal.TerminalApiResponse = await terminalCloudAPI.sync(paymentRequest);\n```\n\n#### Optional: perform an abort request\n\nTo perform an [abort request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/cancel-a-transaction/) you can use the following example:\n``` javascript\nconst abortRequest: SaleToPOIRequest = {\n    MessageHeader: {\n        MessageClass: MessageClassType.Service,\n        MessageCategory: MessageCategoryType.Abort,\n        MessageType: MessageType.Request,\n        ProtocolVersion: \"3.0\",\n        // Different serviceID than the one you're aborting\n        ServiceID: \"Different service ID\",\n        SaleID: saleID,\n        POIID: POIID\n    },\n    AbortRequest: {\n        AbortReason: \"MerchantAbort\",\n        MessageReference: {\n            MessageCategory: MessageCategoryEnum.Payment,\n            SaleID: saleID,\n            // Service ID of the payment you're aborting\n            ServiceID: serviceID,\n            POIID: POIID\n        }\n\n    }\n};\nconst terminalAPIResponse: terminal.TerminalApiResponse = await terminalCloudAPI.sync(abortRequest);\n```\n\n#### Optional: perform a status request\n\nTo perform a [status request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/verify-transaction-status/) you can use the following example:\n``` javascript\nconst statusRequest: SaleToPOIRequest = {\n    MessageHeader: {\n        MessageClass: MessageClassType.Service,\n        MessageCategory: MessageCategoryType.TransactionStatus,\n        MessageType: MessageType.Request,\n        ProtocolVersion: \"3.0\",\n        ServiceID: \"Different service ID\",\n        SaleID: saleID,\n        POIID: POIID\n    },\n    TransactionStatusRequest: {\n        ReceiptReprintFlag: true,\n        DocumentQualifier: [DocumentQualifierEnum.CashierReceipt, DocumentQualifierEnum.CustomerReceipt],\n        MessageReference: {\n            SaleID: saleID,\n            // serviceID of the transaction you want the status update for\n            ServiceID: serviceID,\n            MessageCategory: MessageCategoryEnum.Payment\n        }\n    }\n};\nconst terminalAPIResponse: terminal.TerminalApiResponse = await terminalCloudAPI.sync(statusRequest);\n```\n\n### Using the Local Terminal API Integration\nThe procedure to send In-Person requests using [Terminal API over Local Connection](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/local/) is similar to the Cloud Terminal API one, however, additional encryption details are required to perform the requests. Make sure to [install the certificate as described here](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/local/#protect-communications)\n```javascript\n// Step 1: Require the parts of the module you want to use\nconst {Client, TerminalLocalAPI} from \"@adyen/api-library\";\n\n// Step 2: Add your Certificate Path and Local Endpoint to the config path. Install the certificate and save it in your project folder as \"cert.cer\"\nconst config: Config = new Config();\nconfig.certificatePath = \"./cert.cer\";\nconfig.terminalApiLocalEndpoint = \"The IP of your terminal (eg https://192.168.47.169)\";\nconfig.apiKey = \"YOUR_API_KEY_HERE\";\n\n// Step 3: Setup a security password for your terminal in CA, and import the security key object:\nconst securityKey: SecurityKey = {\n    AdyenCryptoVersion: 1,\n    KeyIdentifier: \"keyIdentifier\",\n    KeyVersion: 1,\n    Passphrase: \"passphrase\",\n};\n\n// Step 4 Initialize the client and the API objects\nclient = new Client({ config });\nconst terminalLocalAPI = new TerminalLocalAPI(client);\n\n// Step 5: Create the request object\nconst paymentRequest: SaleToPOIRequest = {\n// Similar to the saleToPOIRequest used for Cloud API\n}\n\n// Step 6: Make the request\nconst terminalApiResponse: terminal.TerminalApiResponse = await terminalLocalAPI.request(paymentRequest, securityKey);\n```\n## Using the Local Terminal API Integration without Encryption (Only on TEST)\nIf you wish to develop the Local Terminal API integration parallel to your encryption implementation, you can opt for the unencrypted version. Be sure to remove any encryption details from the CA terminal config page. \n```javascript\n// Step 1: Require the parts of the module you want to use\nconst {Client, TerminalLocalAPIUnencrypted} from \"@adyen/api-library\";\n\n// Step 2: Add your Certificate Path and Local Endpoint to the config path. Install the certificate and save it in your project folder as \"cert.cer\"\nconst config: Config = new Config();\nconfig.terminalApiLocalEndpoint = \"The IP of your terminal (eg https://192.168.47.169)\";\nconfig.apiKey = \"YOUR_API_KEY_HERE\";\n\n// Step 3 Initialize the client and the API objects\nclient = new Client({ config });\nconst terminalLocalAPI = new TerminalLocalAPIUnencrypted(client);\n\n// Step 4: Create the request object\nconst paymentRequest: SaleToPOIRequest = {\n// Similar to the saleToPOIRequest used for Cloud API\n}\n\n// Step 5: Make the request\nconst terminalApiResponse: terminal.TerminalApiResponse = await terminalLocalAPI.request(paymentRequest);\n```\n## Feedback\nWe value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas. \n\n## Example integration\n\nClone our [Node.js example integration](https://github.com/adyen-examples/adyen-node-online-payments) to see how the Adyen API library for Node.js can be used. The integration includes code comments that highlight key features and concepts.\n\n## Contributing \n\nWe strongly encourage you to contribute to this repository by:\n\n* Adding new features and functionality.\n* Fixing bugs and issues.\n* Making general improvements.\n\nTo learn how to create a pull request, read our [contribution guidelines](CONTRIBUTING.md).\n\n## Support\n\nTo request a feature, report a bug, or report a security vulnerability, [create a GitHub issue](https://github.com/Adyen/adyen-node-api-library/issues/new/choose). \n\nFor other questions, contact our [support team](https://www.adyen.help).\n\n## License\n\nThis repository is available under the [MIT license](LICENSE).\n\n## See also\n\n* [Example integration](https://github.com/adyen-examples/adyen-node-online-payments)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdyen%2Fadyen-node-api-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAdyen%2Fadyen-node-api-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdyen%2Fadyen-node-api-library/lists"}