Server-side SDKs (Beta)
Learn how to install and use Airwallex's server-side SDKs
Airwallex currently provides server-side SDK support through its Node.js SDK (Beta).
@airwallex/node-sdk
is a TypeScript-first SDK designed for integrating with the Airwallex platform APIs using Node.js. It includes features such as strongly-typed request and response models, built-in error handling, automatic retries, token refresh, and support for custom requests across all Airwallex services — including payment acceptance, issuing, accounts, payouts, and more.
The SDK is currently in Beta and supports API versions from 2025-02-14
onwards. You don’t need to update to the latest SDK versions unless you are adopting a new major API version.
During the Beta phase, we plan to release updates alongside new Client API versions or to deliver patch fixes. We’ll continue refining the SDK during this period to improve stability, and will release a stable version once it’s ready.
Minimum requirements
- Node.js: 14.x
- TypeScript: 4.5x
Installation and setup
Install the package using npm, yarn or pnpm.
After completing the installation, you will need to initialize the SDK. The SDK can be configured with the following options:
Configuration Options
Option | Type | Required | Default | Description |
---|---|---|---|---|
clientId | string | Yes | - | Your Airwallex API client ID. |
apiKey | string | Yes | - | Your Airwallex API key. |
env | string | No | demo | API environment: demo or production |
apiVersion | string | No | 2025-02-14 | API version |
timeout | number | No | 30000 | Request timeout in milliseconds |
enableTelemetry | boolean | No | true | Enable usage analytics |
retry | number | No | 1 | Number of retry attempts for failed requests |
API requests
The following sample requests show how to manipulate Airwallex API resources using Node.js SDK.
Example: Creating a card
Example: Update a card
Example: Retrieving Cards
Example: Set custom headers and/or timeout for a request
Example: Pagination requests
Right now the SDK doesn’t provide native support for pagination requests. But we can pass the pagination parameters for the requests.
Example: Processing Payments
Custom API Requests
For API endpoints not explicitly covered by the SDK, you can use the generic request methods:
API responses
The SDK returns a response for every API request. When you create, retrieve, or update an object, the response contains the object itself, including all relevant fields.
Example: Retrieve cards
Error handling
The SDK uses specific error types to help you handle different error scenarios:
Error type | Description |
---|---|
ApiError | Base error class for all API-related errors. Properties include:
|
AuthenticationError | Thrown when authentication fails (extends ApiError). |
ValidationError | Thrown when request parameters fail validation(extends ApiError). |
RateLimitError | Thrown when API rate limits are exceeded (extends ApiError). |
NotFoundError | Thrown when a requested resource doesn't exist (extends ApiError). |
AuthorizationError | Thrown when the API client lacks permissions for an operation (extends ApiError). |
NetworkError | Thrown for network-related issues like connection failures (extends ApiError). |
TimeoutError | Thrown for timeout issues (extends ApiError). |
ServerError | Thrown when Airwallex servers return a 5xx error (extends ApiError). |
Retryable errors: Only ServerError, TimeoutError, NetworkError will be retried by the SDK if retry is enabled.
Example
Supported APIs
The SDK provides access to the following Airwallex API modules. Each module contains methods corresponding to the respective Airwallex API endpoints. Refer to the Airwallex API Documentation API for detailed information about specific endpoints and request/response formats.
Account Capability | |
---|---|
Account Capability API |
|
Authentication | |
Authentication API |
|
Authentication Embedded Components API |
|
Confirmation Letter | |
Confirmation Letter API |
|
Core Resources | |
Deposits API |
|
Linked Accounts API |
|
Finance | |
Finance Settlement API |
|
Issuing | |
Issuing Authorizations API |
|
Issuing Cardholders API |
|
Issuing Cards API |
|
Issuing Config API |
|
Issuing Digital Wallet Tokens API |
|
Issuing Transaction Disputes API |
|
Issuing Transactions API |
|
Payment Acceptance | |
Payment Acceptance Config API |
|
Payment Acceptance Customers API |
|
Payment Acceptance Customs Declarations API |
|
Payment Acceptance Funds Split Destinations API |
|
Payment Acceptance Funds Split Reversals API |
|
Payment Acceptance Funds Splits API |
|
Payment Acceptance Payment Attempts API |
|
Payment Acceptance Payment Consents API |
|
Payment Acceptance Payment Disputes API |
|
Payment Acceptance Payment Intents API |
|
Payment Acceptance Payment Methods API |
|
Payment Acceptance Refunds API |
|
Payouts | |
Payouts Beneficiaries API |
|
Payouts Batch Transfers API |
|
Payouts Transfers API |
|
Payouts Wallet Transfers API |
|
Risk | |
Risk Request For Information (RFI) API |
|
Scale | |
Accounts API |
|
Scale Invitation Links API |
|
Scale Settlements Reports API |
|
Simulation | |
Simulation Demo Only Accounts API |
|
Simulation Demo Only Cards API |
|
Simulation Demo Only Deposits API |
|
Simulation Demo Only Payment Acceptance API |
|
Simulation Demo Only Payouts API |
|
Simulation Demo Only Request For Information API |
|
Simulation Demo Only Transfers API |
|
Transactional FX | |
Transactional FX Conversion Amendments API |
|
Transactional FX Quotes API |
|
Transactional FX Rates API |
|
Versioning: Client API vs. SDK
Client APIs use a date-based versioning system, and new versions are only released when there are backward-incompatible changes. In contrast, SDKs manage implementation details and may receive version updates for various reasons — including backward-compatible changes, backward-incompatible changes, or internal updates like bug fixes, even if the API itself hasn't changed.
SDK semantic versioning format: <Major>.<Minor>.<Patch>-beta.<Beta version>. For example, 1.0.0-beta.1
.
- MajorBETA: Follows the existing Platform APIs versioning for backwards-incompatible changes.
- Minor: Follows the existing Platform APIs versioning for backwards-compatible changes.
- PatchBETA: Reserved for bug fixes and changes that do not introduce changes to the API.
- Beta version: Iteration number of the Beta release.