Class: WalmartApIs::ReconciliationApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/walmart_ap_is/apis/reconciliation_api.rb

Overview

ReconciliationApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

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

#check_download_report_by_period(partner_id, date) ⇒ ApiResponse

Checks which reconciliation report versions (legacy, v1/WFS) are available for a given partner and date. Delegates to mp-payment-reporting GET /v3/report/reconreport/reconReportAvailability. Note: the upstream date param is named date (not reportDate).

Parameters:

  • partner_id (String)

    Required parameter: Numeric partner/seller ID

  • date (Date)

    Required parameter: Report date in yyyy-MM-dd format

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/walmart_ap_is/apis/reconciliation_api.rb', line 81

def check_download_report_by_period(partner_id,
                                    date)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/disbursements/v4/payment/checkDownloadReportByPeriod',
                                 Server::DEFAULT1)
               .query_param(new_parameter(partner_id, key: 'partnerId')
                             .is_required(true))
               .query_param(new_parameter(date, key: 'date')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ReportAvailabilityResponse.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

#download_reconciliation_report(partner_id, report_date) ⇒ ApiResponse

Downloads a reconciliation report ZIP for the given partner and date. Delegates to mp-payment-reporting GET /v1/mt/report/reconreport/reconFile (Azure MT storage). format (e.g. 06172026)

Parameters:

  • partner_id (String)

    Required parameter: Numeric partner/seller ID

  • report_date (String)

    Required parameter: Report date in MMddyyyy

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
# File 'lib/walmart_ap_is/apis/reconciliation_api.rb', line 16

def download_reconciliation_report(partner_id,
                                   report_date)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/disbursements/v4/payment/reconciliation/download',
                                 Server::DEFAULT1)
               .query_param(new_parameter(partner_id, key: 'partnerId')
                             .is_required(true))
               .query_param(new_parameter(report_date, key: 'reportDate')
                             .is_required(true))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('401',
                             'Unauthorized — missing, expired, or invalid OAuth2 token',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#list_reconciliation_dates(partner_id) ⇒ ApiResponse

Returns the set of available reconciliation report dates for a partner. Delegates to mp-payment-reporting GET /v3/report/reconreport/availableReconFiles.

Parameters:

  • partner_id (String)

    Required parameter: Numeric partner/seller ID

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/walmart_ap_is/apis/reconciliation_api.rb', line 49

def list_reconciliation_dates(partner_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/disbursements/v4/payment/reconciliation/dateList',
                                 Server::DEFAULT1)
               .query_param(new_parameter(partner_id, key: 'partnerId')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ReportAvailabilityResponse.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