Class: WalmartApIs::PayoutsApi
- Defined in:
- lib/walmart_ap_is/apis/payouts_api.rb
Overview
PayoutsApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#configure_auto_payout(body) ⇒ ApiResponse
Enables or disables automatic scheduled payouts for the authenticated seller.
-
#get_annual_statement_opts ⇒ ApiResponse
Returns whether the authenticated seller is opted in to annual statement generation and the current statement year.
-
#get_faster_payout_eligibility ⇒ ApiResponse
Returns whether the authenticated seller is eligible for an on-demand faster payout, along with the approved amount and any ineligibility reason.
-
#get_payment_status ⇒ ApiResponse
Returns the current payout status for the authenticated seller, including scheduled payout date, amount, and lifecycle state (Pending, Processing, Completed, Failed, OnHold).
-
#initiate_faster_payout ⇒ ApiResponse
Triggers an immediate on-demand payout for the authenticated seller, bypassing the standard settlement schedule.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from WalmartApIs::BaseApi
Instance Method Details
#configure_auto_payout(body) ⇒ ApiResponse
Enables or disables automatic scheduled payouts for the authenticated seller. When enabled, payouts are triggered automatically on the standard settlement cadence. Returns updated payout status. Requires "disbursements:write" scope. Delegates to GMPPaymentsPlatform (Phase 5). TODO: type description here
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/walmart_ap_is/apis/payouts_api.rb', line 106 def configure_auto_payout(body) @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/disbursements/v4/payment/autoPayout', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PayoutStatusResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('401', 'Unauthorized — missing, expired, or invalid OAuth2 token', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_annual_statement_opts ⇒ ApiResponse
Returns whether the authenticated seller is opted in to annual statement generation and the current statement year. Delegates to GMPPaymentsPlatform GET /annualStatementOpts/partnerId.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/walmart_ap_is/apis/payouts_api.rb', line 138 def get_annual_statement_opts @api_call .request(new_request_builder(HttpMethodEnum::GET, '/disbursements/v4/payment/annualStatementOpts', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(AnnualStatementOptsResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('401', 'Unauthorized — missing, expired, or invalid OAuth2 token', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_faster_payout_eligibility ⇒ ApiResponse
Returns whether the authenticated seller is eligible for an on-demand faster payout, along with the approved amount and any ineligibility reason. Delegates to GMPPaymentsPlatform GET /fasterPayout/eligibility/partnerId.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/walmart_ap_is/apis/payouts_api.rb', line 42 def get_faster_payout_eligibility @api_call .request(new_request_builder(HttpMethodEnum::GET, '/disbursements/v4/payment/fasterPayoutEligibility', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(FasterPayoutEligibilityResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('401', 'Unauthorized — missing, expired, or invalid OAuth2 token', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#get_payment_status ⇒ ApiResponse
Returns the current payout status for the authenticated seller, including scheduled payout date, amount, and lifecycle state (Pending, Processing, Completed, Failed, OnHold). Delegates to GMPPaymentsPlatform (Phase 5).
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/walmart_ap_is/apis/payouts_api.rb', line 13 def get_payment_status @api_call .request(new_request_builder(HttpMethodEnum::GET, '/disbursements/v4/payment/paymentstatus', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PayoutStatusResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('401', 'Unauthorized — missing, expired, or invalid OAuth2 token', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#initiate_faster_payout ⇒ ApiResponse
Triggers an immediate on-demand payout for the authenticated seller, bypassing the standard settlement schedule. Returns the payout ID and initial status. Requires "disbursements:write" scope. Delegates to GMPPaymentsPlatform (Phase 5).
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/walmart_ap_is/apis/payouts_api.rb', line 70 def initiate_faster_payout @api_call .request(new_request_builder(HttpMethodEnum::POST, '/disbursements/v4/payment/fasterPayout', Server::DEFAULT1) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(InitiatePayoutResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ErrorListErrorException) .local_error('401', 'Unauthorized — missing, expired, or invalid OAuth2 token', ErrorListErrorException) .local_error('409', 'Conflict — resource state prevents this operation', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |