Class: Peddler::APIs::Transfers20240601

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/transfers_2024_06_01.rb,
lib/peddler/apis/transfers_2024_06_01/error.rb,
lib/peddler/apis/transfers_2024_06_01/payout.rb,
lib/peddler/apis/transfers_2024_06_01/period.rb,
lib/peddler/apis/transfers_2024_06_01/error_list.rb,
lib/peddler/apis/transfers_2024_06_01/expiry_date.rb,
lib/peddler/apis/transfers_2024_06_01/expected_payout.rb,
lib/peddler/apis/transfers_2024_06_01/partner_metadata.rb,
lib/peddler/apis/transfers_2024_06_01/related_identifier.rb,
lib/peddler/apis/transfers_2024_06_01/payment_method_list.rb,
lib/peddler/apis/transfers_2024_06_01/payout_status_entry.rb,
lib/peddler/apis/transfers_2024_06_01/related_identifiers.rb,
lib/peddler/apis/transfers_2024_06_01/list_payouts_response.rb,
lib/peddler/apis/transfers_2024_06_01/payment_method_details.rb,
lib/peddler/apis/transfers_2024_06_01/initiate_payout_request.rb,
lib/peddler/apis/transfers_2024_06_01/initiate_payout_response.rb,
lib/peddler/apis/transfers_2024_06_01/payment_method_type_list.rb,
lib/peddler/apis/transfers_2024_06_01/get_payment_methods_response.rb,
lib/peddler/apis/transfers_2024_06_01/list_expected_payouts_response.rb,
sig/peddler/apis/transfers_2024_06_01.rbs

Overview

The Selling Partner API for Transfers.

The Selling Partner API for Transfers enables selling partners to retrieve payment methods and initiate payouts for their seller accounts. This API supports the following marketplaces: DE, FR, IT, ES, SE, NL, PL, and BE.

Defined Under Namespace

Classes: Error, ErrorList, ExpectedPayout, ExpiryDate, GetPaymentMethodsResponse, InitiatePayoutRequest, InitiatePayoutResponse, ListExpectedPayoutsResponse, ListPayoutsResponse, PartnerMetadata, PaymentMethodDetails, PaymentMethodList, PaymentMethodTypeList, Payout, PayoutStatusEntry, Period, RelatedIdentifier, RelatedIdentifiers

Constant Summary

Constants inherited from Peddler::API

Peddler::API::TRANSIENT_STATUSES

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #base_url, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #host_header, #http, #initialize, #must_sandbox!, #parse_base_url, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#get_payment_methods(marketplace_id, payment_method_types: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns the list of payment methods for the seller, which can be filtered by method type.

Parameters:

  • marketplace_id (String)

    The identifier of the Amazon store from which you want to retrieve payment methods. For the list of store identifiers, refer to Store Identifiers.

  • payment_method_types (Array<String>) (defaults to: nil)

    A comma-separated list of the payment method types you want to include in the response.

  • rate_limit (Float) (defaults to: 0.5)

    Requests per second

  • (String)
  • payment_method_types: (Array[String], nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 0.5)

Returns:



78
79
80
81
82
83
84
85
86
# File 'lib/peddler/apis/transfers_2024_06_01.rb', line 78

def get_payment_methods(marketplace_id, payment_method_types: nil, rate_limit: 0.5)
  path = "/finances/transfers/2024-06-01/paymentMethods"
  params = {
    "marketplaceId" => marketplace_id,
    "paymentMethodTypes" => stringify_array(payment_method_types),
  }.compact
  parser = -> { GetPaymentMethodsResponse }
  get(path, params:, rate_limit:, parser:)
end

#initiate_payout(body, rate_limit: 0.017) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Initiates an on-demand payout to the seller's default deposit method in Seller Central for the given marketplaceId and accountType, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period.

Parameters:

  • body (Hash)

    The request body for the initiatePayout operation.

  • rate_limit (Float) (defaults to: 0.017)

    Requests per second

  • (Hash[untyped, untyped])
  • rate_limit: (Float) (defaults to: 0.017)

Returns:



22
23
24
25
26
# File 'lib/peddler/apis/transfers_2024_06_01.rb', line 22

def initiate_payout(body, rate_limit: 0.017)
  path = "/finances/transfers/2024-06-01/payouts"
  parser = -> { InitiatePayoutResponse }
  post(path, body:, rate_limit:, parser:)
end

#list_expected_payouts(marketplace_ids: nil, account_type: nil, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns the upcoming expected payouts from Amazon associated with a partner's account for the specified parameters.

Parameters:

  • marketplace_ids (Array<String>) (defaults to: nil)

    The Amazon stores from which to retrieve payouts. The Amazon store ID is a globally unique identifier assigned to each Amazon store. If omitted, the response includes payouts from all applicable stores. To find the Amazon store ID for your region, refer to Store Identifiers.

  • account_type (String) (defaults to: nil)

    The response only includes the accounts of the specified account type.

  • next_token (String) (defaults to: nil)

    The response includes nextToken when the number of results exceeds the specified page size. 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 nextToken is null. Note that this operation can return empty pages.

  • rate_limit (Float) (defaults to: 0.5)

    Requests per second

  • marketplace_ids: (Array[String], nil) (defaults to: nil)
  • account_type: (String, nil) (defaults to: nil)
  • next_token: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 0.5)

Returns:



103
104
105
106
107
108
109
110
111
112
# File 'lib/peddler/apis/transfers_2024_06_01.rb', line 103

def list_expected_payouts(marketplace_ids: nil, account_type: nil, next_token: nil, rate_limit: 0.5)
  path = "/finances/transfers/2024-06-01/payouts/expected"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
    "accountType" => ,
    "nextToken" => next_token,
  }.compact
  parser = -> { ListExpectedPayoutsResponse }
  get(path, params:, rate_limit:, parser:)
end

#list_payouts(marketplace_ids: nil, created_after: nil, created_before: nil, payout_id: nil, account_type: nil, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Retrieve a list of payouts for the selling partner's account. You can filter results by marketplaceIds, accountType, date range (createdAfter and createdBefore), or a specific payoutId. By default, the response includes payouts for all available marketplaces and account types. Results are grouped by the seller's account groups. Within each account group results are sorted by their creation date, with the most recent appearing first.

Parameters:

  • marketplace_ids (Array<String>) (defaults to: nil)

    The Amazon stores from which to retrieve payouts. The Amazon store ID is a globally unique identifier assigned to each Amazon store. If omitted, the response includes payouts from all applicable stores. To find the Amazon store ID for your region, refer to Store Identifiers.

  • created_after (String) (defaults to: nil)

    The response only includes payouts created on or after this date-time. The value must be formatted in ISO 8601 date-time format. If omitted, no start date filter is applied.

  • created_before (String) (defaults to: nil)

    The response only includes payouts created before this date-time. The value must be formatted in ISO 8601 date-time format. If omitted, no end date filter is applied.

  • payout_id (String) (defaults to: nil)

    The response only includes the payout matching the specified identifier.

  • account_type (String) (defaults to: nil)

    The response only includes payouts associated with the specified account type.

  • next_token (String) (defaults to: nil)

    The response includes nextToken when the number of results exceeds the page size. 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 nextToken is null. Note that this operation can return empty pages.

  • rate_limit (Float) (defaults to: 0.5)

    Requests per second

  • marketplace_ids: (Array[String], nil) (defaults to: nil)
  • created_after: (String, nil) (defaults to: nil)
  • created_before: (String, nil) (defaults to: nil)
  • payout_id: (String, nil) (defaults to: nil)
  • account_type: (String, nil) (defaults to: nil)
  • next_token: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 0.5)

Returns:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/peddler/apis/transfers_2024_06_01.rb', line 53

def list_payouts(marketplace_ids: nil, created_after: nil, created_before: nil, payout_id: nil, account_type: nil,
  next_token: nil, rate_limit: 0.5)
  path = "/finances/transfers/2024-06-01/payouts"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
    "createdAfter" => created_after,
    "createdBefore" => created_before,
    "payoutId" => payout_id,
    "accountType" => ,
    "nextToken" => next_token,
  }.compact
  parser = -> { ListPayoutsResponse }
  get(path, params:, rate_limit:, parser:)
end