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/error_list.rb,
lib/peddler/apis/transfers_2024_06_01/expiry_date.rb,
lib/peddler/apis/transfers_2024_06_01/payment_method_list.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,
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, ExpiryDate, GetPaymentMethodsResponse, InitiatePayoutRequest, InitiatePayoutResponse, PaymentMethodDetails, PaymentMethodList, PaymentMethodTypeList

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #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 marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to Marketplace IDs.

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



38
39
40
41
42
43
44
45
46
# File 'lib/peddler/apis/transfers_2024_06_01.rb', line 38

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