Class: WalmartApIs::SettlementApi
- Defined in:
- lib/walmart_ap_is/apis/settlement_api.rb
Overview
SettlementApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#list_settlement_details(partner_id, report_date, page_size: 10, next_token: nil) ⇒ ApiResponse
Returns paginated settlement transaction detail for the given partner and report date.
-
#list_settlement_periods(page_size: 10, next_token: nil) ⇒ ApiResponse
Returns available settlement period dates for the authenticated seller.
-
#search_transactions(page_size: 10, next_token: nil, posted_after: nil, posted_before: nil) ⇒ ApiResponse
Returns a paginated list of payment transactions for the authenticated seller filtered by optional date range.
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
#list_settlement_details(partner_id, report_date, page_size: 10, next_token: nil) ⇒ ApiResponse
Returns paginated settlement transaction detail for the given partner and report date. Contains PII (purchase order IDs). Delegates to mp-payment-reporting GET /v3/report/reconreport/v1/getJson with offset-based pagination. nextToken is a Base64-encoded offset into the report file. format (e.g. 06172026) response; omit for first page
60 61 62 63 64 65 66 67 68 69 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 95 96 |
# File 'lib/walmart_ap_is/apis/settlement_api.rb', line 60 def list_settlement_details(partner_id, report_date, page_size: 10, next_token: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/disbursements/v4/payment/settlementDetails', Server::DEFAULT1) .query_param(new_parameter(partner_id, key: 'partnerId') .is_required(true)) .query_param(new_parameter(report_date, key: 'reportDate') .is_required(true)) .query_param(new_parameter(page_size, key: 'pageSize')) .query_param(new_parameter(next_token, key: 'nextToken')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(SettlementDetailsResponse.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('403', 'Forbidden', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#list_settlement_periods(page_size: 10, next_token: nil) ⇒ ApiResponse
Returns available settlement period dates for the authenticated seller. Delegates to mp-payment-reporting GET /v3/report/reconreport/v1/availableReconFiles. response; omit for first page
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/walmart_ap_is/apis/settlement_api.rb', line 16 def list_settlement_periods(page_size: 10, next_token: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/disbursements/v4/payment/settlementPeriods', Server::DEFAULT1) .query_param(new_parameter(page_size, key: 'pageSize')) .query_param(new_parameter(next_token, key: 'nextToken')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(SettlementPeriodsResponse.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('403', 'Forbidden', ErrorListErrorException) .local_error('429', 'Rate limit exceeded', ErrorListErrorException) .local_error('500', 'Internal Server Error', ErrorListErrorException)) .execute end |
#search_transactions(page_size: 10, next_token: nil, posted_after: nil, posted_before: nil) ⇒ ApiResponse
Returns a paginated list of payment transactions for the authenticated seller filtered by optional date range. Contains PII (purchase order IDs). Delegates to GMPPaymentsPlatform (Phase 5). response; omit for first page here here
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/walmart_ap_is/apis/settlement_api.rb', line 110 def search_transactions(page_size: 10, next_token: nil, posted_after: nil, posted_before: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/disbursements/v4/payment/search/transactions', Server::DEFAULT1) .query_param(new_parameter(page_size, key: 'pageSize')) .query_param(new_parameter(next_token, key: 'nextToken')) .query_param(new_parameter(posted_after, key: 'postedAfter')) .query_param(new_parameter(posted_before, key: 'postedBefore')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('walletAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TransactionSearchResponse.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 |