Class: Airwallex::BatchTransfer

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List, APIOperations::Retrieve
Defined in:
lib/airwallex/resources/batch_transfer.rb

Overview

BatchTransfer resource for bulk payout operations

Batch transfers allow creating multiple transfers in a single API call, improving efficiency for bulk payout scenarios like marketplace payouts or payroll.

Examples:

Create a batch transfer

batch = Airwallex::BatchTransfer.create(
  request_id: "batch_#{Time.now.to_i}",
  source_currency: "USD",
  transfers: [
    { beneficiary_id: "ben_001", amount: 100.00, reason: "Payout 1" },
    { beneficiary_id: "ben_002", amount: 200.00, reason: "Payout 2" }
  ]
)

Retrieve a batch transfer

batch = Airwallex::BatchTransfer.retrieve("batch_123")
batch.transfers.each { |t| puts "#{t.id}: #{t.status}" }

Instance Attribute Summary

Attributes inherited from APIResource

#attributes, #id

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::Retrieve

retrieve

Methods included from APIOperations::List

list

Methods inherited from APIResource

#changed_attributes, #dirty?, #initialize, #inspect, #method_missing, #refresh, #refresh_from, resource_name, #respond_to_missing?, #to_hash, #to_json, #to_s

Constructor Details

This class inherits a constructor from Airwallex::APIResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Airwallex::APIResource

Class Method Details

.resource_pathObject



28
29
30
# File 'lib/airwallex/resources/batch_transfer.rb', line 28

def self.resource_path
  "/api/v1/batch_transfers"
end