### cURL Example for Listing Conversions Source: https://www.airwallex.com/docs/api/transactional_fx/conversion/list This example demonstrates how to make a GET request to the /api/v1/fx/conversions endpoint using cURL. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```bash curl -X GET "https://api.airwallex.com/api/v1/fx/conversions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### cURL Example for Listing Products Source: https://www.airwallex.com/docs/api/billing/products/list Use this cURL command to make a GET request to the products endpoint. Ensure you replace YOUR_API_KEY with your actual API key. ```bash curl -X GET "https://api.airwallex.com/api/v1/products" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Enable the Module Source: https://www.airwallex.com/docs/payments/integration-options/web-checkout/plugins/magento/install-the-hyva-compatibility-module After installing the module, enable it by running the Magento setup upgrade command. ```shell bin/magento setup:upgrade ``` -------------------------------- ### cURL Example for Listing Subscriptions Source: https://www.airwallex.com/docs/api/billing/subscriptions/list Use this cURL command to make a GET request to the subscriptions endpoint. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```bash curl -X GET "https://api.airwallex.com/api/v1/subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Example cURL Request to Get Credit Note Line Items Source: https://www.airwallex.com/docs/api/billing/credit_notes/update_line_items_billing_credit_notes This example demonstrates how to make a GET request to the credit note line items endpoint using cURL. It includes authorization and pagination parameters. ```curl curl --request GET \ --url 'https://api-demo.airwallex.com/api/v1/billing/credit_notes/crn_hkpda1313adfadfa/line_items?page=eyJrIjpbeyJuIjoiY3JlYXRlZEF0IiwidiI6MTc1NjA4ODY1OS4xMDMxNzQwMDAsIm8iOiJkIiwidCI6ImphdmEudGltZS5JbnN0YW50In0seyJuIjoiaWQudmFsdWUiLCJ2IjoiaWl0X3Nmc3QyOTRzaGhhaGJ6cXJiaGciLCJvIjoiQSIsInQiOiJqYXZhLmxhbmcuU3RyaW5nIn1dLCJkIjoiYWZ0ZXIiLCJmIjoibiIsInYiOjF9&page_size=20' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNTI1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' ``` -------------------------------- ### Set up Airwallex AgentOS Source: https://www.airwallex.com/docs/developer-tools/ai Use this prompt with supported AI agents to automatically set up Airwallex AgentOS. It fetches the setup guide from the provided URL and follows the instructions. ```text Set up Airwallex AgentOS for me. Fetch https://www.airwallex.com/docs/developer-tools/ai/agentos.md and follow the setup guide. ``` -------------------------------- ### Verify PLP Setup with Get Program Source: https://www.airwallex.com/docs/issuing/get-started/set-up-platform-liquidity-program Call the Get a Program endpoint using your program_id to verify your PLP setup and check available limits. Review the response to confirm program details, status, and balances. ```shell curl -G https://api-demo.airwallex.com/api/v1/platform_liquidity_programs/{{PROGRAM_ID}} \ -H 'Authorization: Bearer {{ACCESS_TOKEN}}' ``` ```json { "id": "plp_1234567890", "name": "My PLP", "status": "ACTIVE", "limit_balances": { "USD": { "total_amount": 100000.00, "available_amount": 100000.00 } } } ``` -------------------------------- ### init(options?) Source: https://www.airwallex.com/docs/js Initializes Airwallex.js, allowing you to specify settings and fetch necessary resources. It's recommended to initialize Airwallex.js only once. ```APIDOC ## init(options?) ### Description Load Airwallex.js and specify the initialization settings and elements you want to fetch using the `init()` function. The modular approach of fetching only the resources specified in `init()` ensures optimized performance and customization tailored to your needs. The Airwallex package should only be initialized once in your application. ### Parameters #### options (optionalInitOptions) - **env** (optional'demo' | 'prod') - The Airwallex environment you want to integrate your application with. Default: `'prod'` - **locale** (optional'en' | 'zh' | 'ja' | 'ko' | 'ar' | 'fr' | 'es' | 'nl' | 'de' | 'it' | 'zh-HK' | 'pl' | 'fi' | 'ru' | 'da' | 'id' | 'ms' | 'sv' | 'ro' | 'pt') - The locale used to globally configure localization for Airwallex.js Elements. Supported locales vary by Elements type: * Payment Elements supports all locales. * Payouts Elements supports only `en`, `zh`, `de`, `es`, `fr`, `it`, `ja`, `ko`. * Onboarding Elements supports only `en`, `fr`, `zh`. * Risk Elements supports only `en`, `fr`, `zh`. * Compliance Support Elements supports only `en`. - **fonts** (optionalFontOptions[]) - Fonts options to customize the font styles of Payment Elements. * **family** (optionalstring) - The font-family property. * **src** (optionalstring) - The font-source property. * **weight** (optionalstring | number) - The font-weight property. - **enabledElements** (optional('payments' | 'payouts' | 'onboarding' | 'risk')[]) - An array of Element groups representing the Elements. - **authCode** (optionalstring) - Scoped auth code to exchange for scoped access token. Only applicable to Onboarding, Payout, Risk and Compliance Support Elements. - **clientId** (optionalstring) - The ID of platform application issued by Airwallex. - **codeVerifier** (optionalstring) - Serves as proof key for code exchange in authorization code flow. ### Returns Promise - **payments** (optionalPayments) - Object implementing the Payments interface. Present if `payments` is an enabled element. * **redirectToCheckout** (requiredFunction) - Function to redirect the shopper in a Hosted Payment Page (HPP) integration. - **sca** (optionalSCA) - Object implementing the SCA interface. Present if `risk` is an enabled element. * **getSCAToken** (required() => Promise) - Returns a short-lived SCA token if a refresh token was previously saved. ```javascript // Example 1: Initialize Airwallex.js for Payment Elements import { init } from '@airwallex/components-sdk'; const options = { locale: 'en', env: 'prod', enabledElements: ['payments'], }; await init(options); // Example 2: Initialize Airwallex.js for Onboarding, Payout, Risk, or Compliance Support Elements import { init } from '@airwallex/components-sdk'; const options = { locale: 'en', env: 'prod', enabledElements: ['onboarding', 'payouts', 'risk'], authCode: 'replace-with-your-auth-code', clientId: 'replace-with-your-client-id', codeVerifier: 'replace-with-your-code-verifier', }; await init(options); ``` ``` -------------------------------- ### Initialize and Mount Drop-in Element Source: https://www.airwallex.com/docs/js/payments/dropin Include the Airwallex SDK via CDN and initialize the Drop-in Element. Ensure the `env`, `enabledElements`, `intent_id`, `client_secret`, and `currency` are correctly configured. ```html
``` -------------------------------- ### MIT - Merchant Initiated Transaction (Installments) Source: https://www.airwallex.com/docs/payments/integration-options/web-checkout/native-api/registered-user-checkout Example of creating a PaymentIntent for a MIT, specifically for installment payments. ```APIDOC ## Create PaymentIntent for MIT (Installments) ### Description This endpoint is used to create a PaymentIntent for a Merchant-Initiated Transaction (MIT) for installment payments. ### Method POST ### Endpoint /v1/payments/payment_intents ### Request Body - **amount** (number) - Required - The non-zero amount for the subsequent payment. - **currency** (string) - Required - The currency of the payment. - **payment_method** (object) - Required - Contains the card details for the payment. - **number** (string) - Required - The card number. - **expiry_month** (string) - Required - The expiry month of the card. - **expiry_year** (string) - Required - The expiry year of the card. - **name** (string) - Required - The name of the cardholder. - **cvc** (string) - Required - The CVC of the card. - **payment_method_options** (object) - Optional - Options for the payment method. - **card** (object) - Optional - Card-specific options. - **authorization_type** (string) - Required - The type of authorization, e.g., "final_auth". - **auto_capture** (boolean) - Optional - Whether to auto-capture the payment. - **external_recurring_data** (object) - Required - Data for recurring payments. - **initial_payment** (boolean) - Set to `FALSE`. - **triggered_by** (string) - Set to `MERCHANT`. - **merchant_trigger_reason** (string) - Set to `installments`. - **original_transaction_id** (string) - Required - The `payment_method_transaction_id` from the initial payment. - **terms_of_use** (object) - Optional - Terms of use for installment payments. - **payment_amount_type** (string) - Required - Type of payment amount, e.g., "FIXED". - **fixed_payment_amount** (number) - Required if `payment_amount_type` is "FIXED". - **request_id** (string) - Required - A unique identifier for the request. - **return_url** (string) - Required - The URL to redirect the user to after payment. ### Request Example ```json { "external_recurring_data": { "initial_payment": "FALSE", "triggered_by": "MERCHANT", "merchant_trigger_reason": "installments", "original_transaction_id": "485224265480053", "terms_of_use": { "payment_amount_type": "FIXED", "fixed_payment_amount": 100 } }, "payment_method": { "number": "4035501000000008", "expiry_month": "03", "expiry_year": "2030", "name": "John Doe", "cvc": "737" }, "payment_method_options": { "card": { "authorization_type": "final_auth", "auto_capture": true } }, "request_id": "ee939540-3203-4a2c-9172-89a566485dd9", "return_url": "https://www.airwallex.com/" } ``` ``` -------------------------------- ### Initialize SDK and Create Apple Pay Element (npm) Source: https://www.airwallex.com/docs/payments/integration-options/web-checkout/embedded-elements/apple-pay-element/guest-user-checkout Import and initialize the Airwallex SDK, then create an Apple Pay element using module imports. Configure it with your PaymentIntent details and mount it to the designated DOM element. Event listeners for success and errors are also set up. ```javascript import { init, createElement } from '@airwallex/components-sdk'; await init({ env: 'demo', enabledElements: ['payments'], }); const element = createElement('applePayButton', { intent_id: 'replace-with-your-intent-id', client_secret: 'replace-with-your-client-secret', countryCode: 'US', amount: { value: '100', currency: 'USD', }, totalPriceLabel: 'Demo Store', buttonType: 'buy', buttonColor: 'black', }); element.mount('applePayButton'); element.on('success', (event) => { console.log('success', event); }); element.on('error', (event) => { console.error('error', event); }); ``` -------------------------------- ### Get Cards Example Source: https://www.airwallex.com/docs/developer-tools/sdks/server-side-sdks-%28beta%29 This example demonstrates how to retrieve a list of cards using the `getCards` method and how to handle potential API errors. ```APIDOC ## Get Cards ### Description Retrieves a list of cards based on their status. ### Method `client.issuing.cards.getCards(status: string)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript const result = await client.issuing.cards.getCards('ACTIVE'); console.log('Operation succeeded:', result); ``` ### Response #### Success Response (200) - **result** (object) - The list of cards matching the status. #### Response Example ```json { "example": "response body" } ``` ### Error Handling Handles `AuthenticationError`, `ValidationError`, and `ApiError`. ```javascript catch (error) { if (error instanceof AuthenticationError) { console.error('Authentication failed. Check your API credentials.'); } else if (error instanceof ValidationError) { console.error(`Validation error on field '${error.field}': ${error.message}`); } else if (error instanceof ApiError) { console.error(`API Error (${error.status}):`, error.data); } else { console.error('Unexpected error:', error); } } ``` ``` -------------------------------- ### Example Global Account Response Source: https://www.airwallex.com/docs/api/core_resources/global_accounts/generate_statement_letter This is an example JSON response for a GET global account request, illustrating the structure and types of data returned. ```JSON { "account_name": "string", "account_number": "88888888", "account_type": "Checking", "alternate_account_identifiers": { "email": "example@yourdomain.com" }, "close_reason": "Closed upon customer request.", "country_code": "GP", "deposit_conversion_currency": "USD", "failure_reason": "Your Airwallex account has been disabled. Please contact our support team.", "iban": "GB81LHVB04032900176471", "id": "7f687fe6-dcf4-4462-92fa-80335301d9d2", "institution": { "address": "Old Street Yard", "branch_name": "Wakatake ワカタケ", "city": "London", "name": "Saxo Payments A/S", "zip_code": "018982" }, "nick_name": "GBP in UK for Subsidiary Company ABC", "request_id": "8d411ad4-aed6-1261-92fa-51225212e2e1", "required_features": [ { "currency": "GBP", "transfer_method": "LOCAL" } ], "status": "CLOSED", "supported_features": [ ] } ``` -------------------------------- ### Initialize SDK, Create and Mount Split Card Elements (CDN) Source: https://www.airwallex.com/docs/payments/integration-options/web-checkout/embedded-elements/split-card-element/guest-user-checkout This HTML snippet demonstrates how to load the Airwallex SDK from a CDN, initialize it, create individual card elements (card number, expiry, CVC), mount them into specified HTML containers, and handle the payment submission. ```html Quickstart — Split card element

Split card element integration

Enter card details, then click Pay to confirm the PaymentIntent.

Card number
Expiry
CVC
``` -------------------------------- ### Verify PLP Setup Source: https://www.airwallex.com/docs/issuing/get-started/set-up-platform-liquidity-program Call the Get a Program endpoint to verify your PLP setup and check available limits after it has been created by your Account Executive. ```APIDOC ## Get a Program ### Description Retrieves details of a specific Platform Liquidity Program. ### Method GET ### Endpoint /api/v1/platform_liquidity_programs/{{PROGRAM_ID}} ### Request Example ```shell curl -G https://api-demo.airwallex.com/api/v1/platform_liquidity_programs/{{PROGRAM_ID}} \ -H 'Authorization: Bearer {{ACCESS_TOKEN}}' ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the program. - **name** (string) - The name of the program. - **status** (string) - The current status of the program (e.g., ACTIVE). - **limit_balances** (object) - Contains information about the program's limits and balances. - **USD** (object) - Balance information for the USD currency. - **total_amount** (number) - The total amount available in the PLP Settlement Account for the currency. - **available_amount** (number) - The immediate spending capacity (PLP Limit) for all Connected Accounts in the currency. ``` -------------------------------- ### Example Request to Retrieve a Credit Note Source: https://www.airwallex.com/docs/api/billing/credit_notes/update_line_items_billing_credit_notes This example shows how to make a GET request to retrieve a credit note. It includes the necessary authorization header. ```Shell curl --request GET \ --url 'https://api-demo.airwallex.com/api/v1/billing/credit_notes/crn_hkpda1313adfadfa' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNTI1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' ``` -------------------------------- ### Install Airwallex CLI Source: https://www.airwallex.com/docs/developer-tools/cli Download and install the CLI script. It automatically detects your OS and architecture and installs to `~/.local/bin/airwallex`. ```shell curl -fsSL https://static.airwallex.com/developer-tools/airwallex-cli/install.sh | sh ``` -------------------------------- ### Custom API Requests (GET and POST) Source: https://www.airwallex.com/docs/developer-tools/sdks/server-side-sdks-%28beta%29 Provides examples for making generic GET and POST requests to API endpoints not explicitly covered by the SDK. ```APIDOC ## Custom API Requests ### Description Use these methods to interact with API endpoints that are not directly exposed by the SDK. You can specify parameters and headers as needed for your requests. ### GET Request #### Method `airwallex.get` #### Parameters - `url` (string) - Required - The endpoint URL. - `options` (object) - Optional - Request options. - `params` (object) - Query parameters for the request. - `headers` (object) - Custom headers for the request. ### POST Request #### Method `airwallex.post` #### Parameters - `url` (string) - Required - The endpoint URL. - `data` (object) - Required - The request body. - `options` (object) - Optional - Request options. - `headers` (object) - Custom headers for the request. ### Request Example (GET) ```javascript const response = await airwallex.get('/api/v1/custom/endpoint', { params: { param1: value1, … }, headers: { header1: value1, … } }); ``` ### Request Example (POST) ```javascript const createResponse = await airwallex.post('/api/v1/custom/endpoint', { name: 'Test Resource', amount: 1000, currency: 'USD' }, { headers: { header1: value1, … } }); ``` ``` -------------------------------- ### Example Account Creation Response Source: https://www.airwallex.com/docs/connected-accounts/onboarding/kyc-and-onboarding/native-api This response confirms account creation and provides the account `id`. The `status` is `CREATED`, and the `requirements` object indicates any pending information needed. ```json { "id": "acct_44ymLf86OR2pMWjCRLGWSw", // open id "status": "CREATED", "requirements":{ }, "account_details": { "legal_entity_type": "INDIVIDUAL", "individual_details": { "first_name": "Rob", "last_name": "Stark" } }, "customer_agreements": { "agreed_to_data_usage": true, "agreed_to_terms_and_conditions": true, "opt_in_for_marketing": false }, "primary_contact": { "email": "rob.stark@north.com", "mobile": "12345678901" } } ``` -------------------------------- ### Create SCA Setup Component Source: https://www.airwallex.com/docs/payments-for-platforms/compliance-support/strong-customer-authentication-%28sca%29/embedded-sca-component Use `createElement` with type 'scaSetup' to initialize the SCA setup flow. This guides users through configuring two-factor authentication. ```APIDOC ## Create SCA Setup Component ### Description Initializes the SCA setup flow, guiding users through configuring two-factor authentication. ### Method `createElement(type, options)` ### Parameters #### Type - `scaSetup` (string) - Specifies the SCA setup flow. #### Options - **userEmail** (string) - Required - The email address of the user. - **prefilledMobileInfo** (object) - Optional - Prefills mobile information. - **countryCode** (string) - Required - The country code (e.g., "61"). - **nationalNumber** (string) - Required - The national number (e.g., "04XXXXXXXX"). ### Request Example ```javascript const scaElement = await createElement('scaSetup', { userEmail: '', prefilledMobileInfo:{ countryCode: '', // e.g. "61" for country Australia nationalNumber: '' // e.g. "04XXXXXXXX" for country Australia } }); ``` ``` -------------------------------- ### Initialize and Mount Drop-in Element using npm Source: https://www.airwallex.com/docs/payments/integration-options/web-checkout/drop-in-element/guest-user-checkout This JavaScript code demonstrates how to initialize the Airwallex SDK and create/mount the Drop-in element when using npm for frontend bundling. It includes basic event listeners for payment status. ```javascript import { init, createElement } from '@airwallex/components-sdk'; await init({ env: 'demo', enabledElements: ['payments'], }); const element = createElement('dropIn', { intent_id: 'replace-with-your-intent-id', client_secret: 'replace-with-your-client-secret', currency: 'replace-with-your-currency', }); element.mount('dropIn'); element.on('ready', () => {}); element.on('success', () => {}); element.on('error', () => {}); ``` -------------------------------- ### Initialize SDK and Create Apple Pay Element (CDN) Source: https://www.airwallex.com/docs/payments/integration-options/web-checkout/embedded-elements/apple-pay-element/guest-user-checkout Load the Airwallex SDK from CDN, initialize it, create an Apple Pay element with payment details, mount it, and set up event listeners for success and errors. Ensure placeholders for intent ID and client secret are replaced. ```html Quickstart — Apple Pay element

Apple Pay element

Use the Apple Pay button to pay with Wallet.

``` -------------------------------- ### Create SCA Setup Element Source: https://www.airwallex.com/docs/global-treasury/compliance-support/strong-customer-authentication-%28sca%29/embedded-sca-component Use this to guide users through initial SCA setup, recommended after connected account onboarding. Specify 'scaSetup' type. ```javascript const scaElement = await createElement('scaSetup', { userEmail: '', prefilledMobileInfo:{ countryCode: '', // e.g. "61" for country Australia nationalNumber: '' // e.g. "04XXXXXXXX" for country Australia } }); ``` -------------------------------- ### Launch Full Payment Sheet with Custom Configuration Source: https://www.airwallex.com/docs/payments/integration-options/mobile-app-checkout/ios-airwallex-sdk/hosted-payment-page-integration Use this recommended approach to present a complete payment flow, allowing users to select payment methods. Configure layout and launch style. ```swift let configuration = AWXUIContext.Configuration() configuration.layout = .tab // or .accordion configuration.launchStyle = .push // or .present AWXUIContext.launchPayment( from: "hosting view controller which also handles AWXPaymentResultDelegate", session: "The session created above", configuration: configuration ) ``` -------------------------------- ### Install Airwallex.js with npm Source: https://www.airwallex.com/docs/js Install the Airwallex.js SDK using npm. This is the recommended method for most modern JavaScript projects. ```bash npm install @airwallex/components-sdk ``` -------------------------------- ### cURL Example for Getting Settlement Records Source: https://www.airwallex.com/docs/api/payments/settlement_records/list Use this cURL command to make a GET request to the settlement records endpoint. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```bash curl -X GET "https://api.airwallex.com/api/v1/pa/settlement_records" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Get Webhooks List cURL Example Source: https://www.airwallex.com/docs/api/oauth_apps/partner_webhooks/webhooks Use this cURL command to make a GET request to the webhooks endpoint. Ensure you replace 'YOUR_API_KEY' with your actual Airwallex API key. ```bash curl -X GET "https://api.airwallex.com/partner-api/v1/webhooks" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Initialize the SDK Source: https://www.airwallex.com/docs/developer-tools/sdks/server-side-sdks-%28beta%29 Initialize the Airwallex Node.js SDK with your credentials and configuration options. ```APIDOC ## Initialize the SDK ```javascript import { Airwallex } from '@airwallex/node-sdk'; const client = new Airwallex({ // Required fields clientId: 'your_client_id', // Your Airwallex API client ID apiKey: 'your_api_key', // Your Airwallex API key // Optional fields with defaults env: 'demo', // API environment: 'demo','prod' apiVersion: '2025-02-14', // API version (default: '2025-02-14') timeout: 30000, // Request timeout in milliseconds (default: 30000) retry: 3, // Number of retry attempts for failed requests (default: 3) }); ``` ### 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 | ``` -------------------------------- ### Get Balance History cURL Example Source: https://www.airwallex.com/docs/api/core_resources/balances/history Use this cURL command to make a GET request to the balance history endpoint. Ensure you replace 'YOUR_API_KEY' with your actual JWT token. ```bash curl -X GET "https://api.airwallex.com/api/v1/balances/history" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Install Node.js SDK Source: https://www.airwallex.com/docs/developer-tools/sdks/server-side-sdks-%28beta%29 Install the Airwallex Node.js SDK using npm, yarn, or pnpm. The '@airwallex/node-sdk@beta' package is required. ```shell # npm npm install @airwallex/node-sdk@beta # yarn yarn add @airwallex/node-sdk@beta # pnpm pnpm install @airwallex/node-sdk@beta ``` -------------------------------- ### Install airwallex-payment-elements using Yarn or NPM Source: https://www.airwallex.com/docs/payments/integration-options/web-checkout/embedded-elements/legacy-embedded-elements/wechat-pay-element Install the Airwallex payment elements library using your preferred package manager. ```bash yarn add airwallex-payment-elements ``` ```bash npm install airwallex-payment-elements ``` -------------------------------- ### Usage Summary Response Example Source: https://www.airwallex.com/docs/billing/usage-based-billing/sample-integration This JSON object shows an example of the aggregated usage results returned by the Get summaries of a Meter API, including event count and total value. ```json { "items": [ { "billing_customer_id": "bcus_sgstb4rgrhek7w7o0vd", "event_count": 4, "from_happened_at": "2026-01-04T08:23:00+0000", "meter_id": "mtr_sgsthrwz6hek3uhzk12", "to_happened_at": "2026-01-05T12:23:00+0000", "value": 800.0 } ] } ``` -------------------------------- ### Create Product cURL Example Source: https://www.airwallex.com/docs/api/billing/products/create Use this cURL command to send a POST request to create a new product. Ensure you replace the placeholder with your actual request body and API key. ```bash curl -X POST "https://api.airwallex.com/api/v1/products/create" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "_placeholder": "Replace this with your request body. See Request Parameters section above for the schema." }' ``` -------------------------------- ### cURL Example for Retrieving a Reimbursement Source: https://www.airwallex.com/docs/api/spend/reimbursements/retrieve_reimbursement This example demonstrates how to make a GET request to the reimbursement retrieval endpoint using cURL. Ensure you replace the placeholder IDs with actual values and include your authentication token. ```Shell curl --request GET \ --url 'https://api-demo.airwallex.com/api/v1/spend/reimbursement_reports/126ff4d1-737c-4a62-a862-f76b3f103357/reimbursements/1ae9f098-c845-4c31-a7b2-2fc65eb3bbbb' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNTI1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' ``` -------------------------------- ### Example Request to Get Single Digital Wallet Token Source: https://www.airwallex.com/docs/api/issuing/digital_wallet_tokens Demonstrates how to make a GET request to retrieve a specific digital wallet token using cURL. Ensure you include the correct Authorization header. ```Shell curl --request GET \ --url 'https://api-demo.airwallex.com/api/v1/issuing/digital_wallet_tokens/6c2dc266-09ad-4235-b61a-767c7cd6d6ea' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNTI1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' ```