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 an Amazon Seller Wallet account to another customer-provided account.

Parameters:

  • body (Hash)

    The 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:



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

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 an Amazon Seller Wallet account to another customer-provided account.

Parameters:

  • body (Hash)

    The 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:



152
153
154
155
156
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 152

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 Amazon Seller Wallet account to another customer-provided account.

Parameters:

  • transfer_schedule_id (String)

    A unique reference ID for a scheduled transfer.

Returns:



188
189
190
191
192
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 188

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

  delete(path)
end

#get_account(account_id) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve an Amazon Seller Wallet bank account by Amazon account identifier.

Parameters:

  • account_id (String)

    The ID of the Amazon Seller Wallet account.

Returns:



40
41
42
43
44
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 40

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.

Find a transaction by the Amazon transaction identifier.

Parameters:

  • transaction_id (String)

    The ID of the Amazon Seller Wallet transaction.

Returns:



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

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.

Retrieve a list of potential fees on a transaction.

Parameters:

  • source_country_code (String)

    Country code of the source transaction account in ISO 3166 format.

  • source_currency_code (String)

    Currency code of the source transaction country in ISO 4217 format.

  • destination_country_code (String)

    Country code of the destination transaction account in ISO 3166 format.

  • destination_currency_code (String)

    Currency code of the destination transaction country in ISO 4217 format.

  • base_amount (Number)

    The base transaction amount without any markup fees.

Returns:



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

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 Amazon Seller Wallet account transfer schedule.

Parameters:

  • transfer_schedule_id (String)

    The schedule ID of the Amazon Seller Wallet transfer.

Returns:



176
177
178
179
180
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 176

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 Amazon Seller Wallet bank account.

Parameters:

  • account_id (String)

    The ID of the Amazon Seller Wallet account.

Returns:



51
52
53
54
55
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 51

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 Amazon Seller Wallet bank account.

Parameters:

  • account_id (String)

    The ID of the Amazon Seller Wallet account.

  • next_page_token (String) (defaults to: nil)

    A token that you use to retrieve the next page of results. The response includes nextPageToken when the number of results exceeds 100. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until nextPageToken is null. Note that this operation can return empty pages.

Returns:



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

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 all Seller Wallet accounts for a given seller.

Parameters:

  • marketplace_id (String)

    The marketplace for which items are returned. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to Marketplace IDs.

Returns:



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

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.

Returns all transfer schedules of a given Amazon Seller Wallet bank account with the schedule ID in response if present.

Parameters:

  • account_id (String)

    The ID of the Amazon Seller Wallet account.

  • next_page_token (String) (defaults to: nil)

    A token that you use to retrieve the next page of results. The response includes nextPageToken when the number of results exceeds the specified pageSize value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until nextPageToken is null. Note that this operation can return empty pages.

Returns:



135
136
137
138
139
140
141
142
143
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 135

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.

Update transfer schedule information. Returns a transfer belonging to the updated scheduled transfer request.

Parameters:

  • body (Hash)

    The 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:



165
166
167
168
169
# File 'lib/peddler/apis/seller_wallet_2024_03_01.rb', line 165

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

  put(path, body:)
end