Class: Peddler::APIs::SellerWallet20240301

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/seller_wallet_2024_03_01.rb

Overview

The Selling Partner API for Amazon Seller Wallet Open Banking API

The Selling Partner API for Seller Wallet (Seller Wallet API) provides financial information that is relevant to a seller's Seller Wallet account. You can obtain financial events, balances, and transfer schedules for Seller Wallet accounts. You can also schedule and initiate transactions.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #parser, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#create_transaction(body, dest_account_digital_signature, amount_digital_signature) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Create a transaction request from a Seller Wallet account to another customer-provided account.

Parameters:

  • body (Hash)

    Defines the actual payload of the request

  • dest_account_digital_signature (String)

    Digital signature for the destination bank account details.

  • amount_digital_signature (String)

    Digital signature for the source currency transaction amount.

Returns:



106
107
108
109
110
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 106

def create_transaction(body, , amount_digital_signature)
  path = "/finances/transfers/wallet/2024-03-01/transactions"

  post(path, body:)
end

#create_transfer_schedule(body, dest_account_digital_signature, amount_digital_signature) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Create a transfer schedule request from a Seller Wallet account to another customer-provided account.

Parameters:

  • body (Hash)

    Defines the actual payload of the request

  • dest_account_digital_signature (String)

    Digital signature for the destination bank account details.

  • amount_digital_signature (String)

    Digital signature for the source currency transaction amount.

Returns:



146
147
148
149
150
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 146

def create_transfer_schedule(body, , amount_digital_signature)
  path = "/finances/transfers/wallet/2024-03-01/transferSchedules"

  post(path, body:)
end

#delete_schedule_transaction(transfer_schedule_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Delete a transaction request that is scheduled from a Seller Wallet account to another customer-provided account.

Parameters:

  • transfer_schedule_id (String)

    A unique reference id for a scheduled transfer

Returns:



171
172
173
174
175
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 171

def delete_schedule_transaction(transfer_schedule_id)
  path = "/finances/transfers/wallet/2024-03-01/transferSchedules"

  delete(path)
end

#get_account(account_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve a Seller Wallet bank account by Amazon account identifier.

Parameters:

  • account_id (String)

    ID of the Amazon SW account

Returns:



38
39
40
41
42
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 38

def ()
  path = "/finances/transfers/wallet/2024-03-01/accounts/#{percent_encode()}"

  get(path)
end

#get_transaction(transaction_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a transaction

Parameters:

  • transaction_id (String)

    ID of the Amazon SW transaction

Returns:



117
118
119
120
121
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 117

def get_transaction(transaction_id)
  path = "/finances/transfers/wallet/2024-03-01/transactions/#{percent_encode(transaction_id)}"

  get(path)
end

#get_transfer_preview(source_country_code, source_currency_code, destination_country_code, destination_currency_code, base_amount) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns list of potential fees on a transaction based on the source and destination country currency code

Parameters:

  • source_country_code (String)

    Represents 2 character country code of source transaction account in ISO 3166 standard format.

  • source_currency_code (String)

    Represents 3 letter currency code in ISO 4217 standard format of the source transaction country.

  • destination_country_code (String)

    Represents 2 character country code of destination transaction account in ISO 3166 standard format.

  • destination_currency_code (String)

    Represents 3 letter currency code in ISO 4217 standard format of the destination transaction country.

  • base_amount (Number)

    Represents the base transaction amount without any markup fees, rates that will be used to get the transfer preview.

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 69

def get_transfer_preview(source_country_code, source_currency_code, destination_country_code,
  destination_currency_code, base_amount)
  path = "/finances/transfers/wallet/2024-03-01/transferPreview"
  params = {
    "sourceCountryCode" => source_country_code,
    "sourceCurrencyCode" => source_currency_code,
    "destinationCountryCode" => destination_country_code,
    "destinationCurrencyCode" => destination_currency_code,
    "baseAmount" => base_amount,
  }.compact

  get(path, params:)
end

#get_transfer_schedule(transfer_schedule_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Find a particular Seller Wallet account transfer schedule.

Parameters:

  • transfer_schedule_id (String)

    Schedule ID of the Amazon SW transfer

Returns:



182
183
184
185
186
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 182

def get_transfer_schedule(transfer_schedule_id)
  path = "/finances/transfers/wallet/2024-03-01/transferSchedules/#{percent_encode(transfer_schedule_id)}"

  get(path)
end

#list_account_balances(account_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve the balance in a given Seller Wallet bank account.

Parameters:

  • account_id (String)

    ID of the Amazon SW account

Returns:



49
50
51
52
53
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 49

def ()
  path = "/finances/transfers/wallet/2024-03-01/accounts/#{percent_encode()}/balance"

  get(path)
end

#list_account_transactions(account_id, next_page_token: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve a list of transactions for a given Seller Wallet bank account.

Parameters:

  • account_id (String)

    ID of the Amazon SW account

  • next_page_token (String) (defaults to: nil)

    Pagination token to retrieve a specific page of results.

Returns:



89
90
91
92
93
94
95
96
97
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 89

def (, next_page_token: nil)
  path = "/finances/transfers/wallet/2024-03-01/transactions"
  params = {
    "accountId" => ,
    "nextPageToken" => next_page_token,
  }.compact

  get(path, params:)
end

#list_accounts(marketplace_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Get Seller Wallet accounts for a seller.

Parameters:

  • marketplace_id (String)

    A marketplace identifier. Specifies the marketplace for which items are returned.

Returns:



24
25
26
27
28
29
30
31
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 24

def list_accounts(marketplace_id)
  path = "/finances/transfers/wallet/2024-03-01/accounts"
  params = {
    "marketplaceId" => marketplace_id,
  }.compact

  get(path, params:)
end

#list_transfer_schedules(account_id, next_page_token: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve transfer schedules of a Seller Wallet bank account.

Parameters:

  • account_id (String)

    ID of the Amazon SW account

  • next_page_token (String) (defaults to: nil)

    Pagination token to retrieve a specific page of results.

Returns:



129
130
131
132
133
134
135
136
137
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 129

def list_transfer_schedules(, next_page_token: nil)
  path = "/finances/transfers/wallet/2024-03-01/transferSchedules"
  params = {
    "accountId" => ,
    "nextPageToken" => next_page_token,
  }.compact

  get(path, params:)
end

#update_transfer_schedule(body, dest_account_digital_signature, amount_digital_signature) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a transfer belonging to the updated scheduled transfer request

Parameters:

  • body (Hash)

    Defines the actual payload of the scheduled transfer request that is to be updated.

  • dest_account_digital_signature (String)

    Digital signature for the destination bank account details.

  • amount_digital_signature (String)

    Digital signature for the source currency transaction amount.

Returns:



159
160
161
162
163
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 159

def update_transfer_schedule(body, , amount_digital_signature)
  path = "/finances/transfers/wallet/2024-03-01/transferSchedules"

  put(path, body:)
end