Class: WalmartApIs::OrdersApi

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

Overview

OrdersApi

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

#acknowledge_order(purchase_order_id, body) ⇒ ApiResponse

TODO: type endpoint description here description here description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

  • body (AcknowledgeOrderRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 162

def acknowledge_order(purchase_order_id,
                      body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/orders/v4/orders/{purchaseOrderId}/acknowledge',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(AcknowledgeOrderResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#cancel_order_lines(purchase_order_id, body) ⇒ ApiResponse

TODO: type endpoint description here description here description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

  • body (CancelOrderLinesRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 266

def cancel_order_lines(purchase_order_id,
                       body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/orders/v4/orders/{purchaseOrderId}/cancel',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(CancelOrderLinesResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#deliver_order_lines(purchase_order_id, body) ⇒ ApiResponse

Records the terminal Delivered event for one or more order lines, optionally with package-level proof-of-delivery (tracking number, package number, delivery timestamp). This is separated from /shipment-status because delivery is a terminal state and carries different downstream semantics (invoicing windows open, return windows start). Walmart parity from gmp-orders-mono deliverOrder. description here description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

  • body (DeliverOrderLinesRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 795

def deliver_order_lines(purchase_order_id,
                        body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/orders/v4/orders/{purchaseOrderId}/deliver',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(DeliverOrderLinesResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#get_order(purchase_order_id) ⇒ ApiResponse

TODO: type endpoint description here Order ID

Parameters:

  • purchase_order_id (String)

    Required parameter: Walmart Purchase

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 115

def get_order(purchase_order_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/orders/v4/orders/{purchaseOrderId}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(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(GetOrderResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#get_order_address(purchase_order_id) ⇒ ApiResponse

Returns the ship-to postal address for a single purchase order. Mirrors Amazon SP-API getOrderAddress. PII-restricted endpoint: handlers are marked @RestrictedData server-side and the response body must NOT be logged. description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 676

def get_order_address(purchase_order_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/orders/v4/orders/{purchaseOrderId}/address',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(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(GetOrderAddressResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#get_order_buyer_info(purchase_order_id) ⇒ ApiResponse

Returns the buyer's display name, email address, and an anonymized phone (last 4 digits only). Mirrors Amazon SP-API getOrderBuyerInfo. PII-restricted endpoint: handlers are marked @RestrictedData server-side and request/response bodies must NOT be logged. description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 623

def get_order_buyer_info(purchase_order_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/orders/v4/orders/{purchaseOrderId}/buyerInfo',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(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(GetOrderBuyerInfoResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#get_order_items(purchase_order_id) ⇒ ApiResponse

Returns the SKU / quantity / item-price projection of a single purchase order. Mirrors Amazon SP-API getOrderItems. Not PII-restricted: only product, quantity, and price are returned. description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 569

def get_order_items(purchase_order_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/orders/v4/orders/{purchaseOrderId}/items',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(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(GetFulfillmentOrderShipmentsResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#get_order_regulated_info(purchase_order_id) ⇒ ApiResponse

Parity with Amazon SP-API Orders v0 getOrderRegulatedInfo. Returns the verification requirements that apply to an order containing regulated items (alcohol, tobacco, age-restricted goods): the required ID-verification method, the minimum buyer age, the regulated category, and any value-added services the order ships with. Walmart OMS coverage gap (RCTPAPI-20844). The Teflon Order Lookup response does not currently surface regulated-item metadata. Until upstream support lands (tracked separately as a follow-up to this PR), every order returns the safe default regulatedCategory=NOT_REGULATED with requiredVerificationMethod=NONE. The endpoint shape and contract are stable; only the projected values will become richer once OMS exposes the fields. Order ID

Parameters:

  • purchase_order_id (String)

    Required parameter: Walmart Purchase

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 458

def get_order_regulated_info(purchase_order_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/orders/v4/orders/{purchaseOrderId}/regulatedInfo',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(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(GetOrderRegulatedInfoResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#get_orders(created_after: nil, created_before: nil, last_updated_after: nil, order_statuses: nil, fulfillment_types: nil, page_size: 100, next_token: nil) ⇒ ApiResponse

Returns orders matching the given filters. Orders are fulfilled by sellers (WFS or seller-fulfilled). Maps to Walmart OMS order queries.

Current limitations (Phase-2 backlog)

The underlying Teflon Order Lookup backend does not yet support every filter declared below. Calls using any of the following will return 400 Bad Request with code=FILTER_NOT_SUPPORTED and a human-readable message explaining the specific rejection. Phase 2 (tracked by RCTPAPI-20960) will lift these one-by-one as Teflon adds capability.

Filter Status today Reason
createdAfter, createdBefore Rejected (400) Teflon Order Lookup
does not accept date-range filters at the order level.
lastUpdatedAfter Rejected (400) Teflon has no order-level
update-date index.
orderStatuses with >1 value Rejected (400) Teflon accepts one
status per call; pass a single value or omit to match all.
fulfillmentTypes Rejected (400) Teflon accepts one shipNodeType
per call; multi-type fan-out is Phase 2.

These parameters remain in the contract (rather than being removed) so that SDKs generated today stay forward-compatible with the Phase-2 surface — your code keeps compiling, only the runtime behaviour changes when Phase 2 ships. Until then, omit them or handle the documented 400 gracefully. The tools/loadgen-orders.sh --contract smoke sweep exercises the rejection contract on every run. after this date-time (ISO 8601). Phase-2 — not yet supported. Sending this parameter today returns 400 FILTER_NOT_SUPPORTED; Teflon Order Lookup does not accept date-range filters at the order level. Tracked by RCTPAPI-20960. Retained in the contract so SDKs generated today stay forward-compatible. before this date-time (ISO 8601). Phase-2 — not yet supported. See createdAfter for the rationale and the tracking ticket. updated after this date-time (ISO 8601). Phase-2 — not yet supported. Sending this parameter today returns 400 FILTER_NOT_SUPPORTED; Teflon Order Lookup has no order-level update-date index. Tracked by RCTPAPI-20960. order status. Phase-2 limitation: Teflon Order Lookup accepts AT MOST ONE status per call. Passing multiple values today returns 400 FILTER_NOT_SUPPORTED; pass a single value or omit to match all. Multi-status fan-out tracked by RCTPAPI-20960. Filter by fulfillment type. Phase-2 — not yet supported. Sending this parameter today returns 400 FILTER_NOT_SUPPORTED; Teflon accepts one shipNodeType per call and multi-type fan-out is Phase 2. Tracked by RCTPAPI-20960. here

Parameters:

  • created_after (DateTime) (defaults to: nil)

    Optional parameter: Filter orders created

  • created_before (DateTime) (defaults to: nil)

    Optional parameter: Filter orders created

  • last_updated_after (DateTime) (defaults to: nil)

    Optional parameter: Filter orders

  • order_statuses (Array[OrderStatus]) (defaults to: nil)

    Optional parameter: Filter by

  • fulfillment_types (Array[FulfillmentType]) (defaults to: nil)

    Optional parameter:

  • page_size (Integer) (defaults to: 100)

    Optional parameter: Example:100

  • next_token (String) (defaults to: nil)

    Optional parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 63

def get_orders(created_after: nil,
               created_before: nil,
               last_updated_after: nil,
               order_statuses: nil,
               fulfillment_types: nil,
               page_size: 100,
               next_token: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/orders/v4/orders',
                                 Server::DEFAULT1)
               .query_param(new_parameter(created_after, key: 'createdAfter'))
               .query_param(new_parameter(created_before, key: 'createdBefore'))
               .query_param(new_parameter(last_updated_after, key: 'lastUpdatedAfter'))
               .query_param(new_parameter(order_statuses, key: 'orderStatuses'))
               .query_param(new_parameter(fulfillment_types, key: 'fulfillmentTypes'))
               .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(GetFulfillmentOrderResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#refund_order_lines(purchase_order_id, body) ⇒ ApiResponse

Walmart-specific write — no Amazon SP-API Orders v0 equivalent (Amazon refunds live in the Finance API). Mirrors gmp-orders-mono's legacy /partner-api/{market}/v3/orders/{po}/refund contract, simplified for the v4 surface: a flat orderLines[] with per-line refund amount + reason instead of the legacy three-level nesting (orderLines → refunds → refundCharges). description here description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

  • body (RefundOrderLinesRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 328

def refund_order_lines(purchase_order_id,
                       body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/orders/v4/orders/{purchaseOrderId}/refund',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(RefundOrderLinesResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#ship_order_lines(purchase_order_id, body) ⇒ ApiResponse

TODO: type endpoint description here description here description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

  • body (ShipOrderLinesRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 214

def ship_order_lines(purchase_order_id,
                     body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/orders/v4/orders/{purchaseOrderId}/shipping',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(ShipOrderLinesResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#ship_order_multi_package(purchase_order_id, body) ⇒ ApiResponse

Walmart-specific extension of /shipping. Each package carries its own tracking number, carrier, dimensions, and the order lines it covers. Maps onto FMS's existing shipments[] envelope (one FMS shipment per v4 package). Inspired by gmp-orders-mono's shipOrderV2 (multiPackageShipping) operation; we hoist packages[] to the top level rather than nesting it under each line so the request stays self-evidently package-oriented. description here description here

Parameters:

  • purchase_order_id (String)

    Required parameter: TODO: type

  • body (MultiPackageShipRequest)

    Required parameter: TODO: type

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 391

def ship_order_multi_package(purchase_order_id,
                             body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/orders/v4/orders/{purchaseOrderId}/multi-package-shipping',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(MultiPackageShipResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#update_shipment_status(purchase_order_id, body) ⇒ ApiResponse

Records a non-terminal shipment-lifecycle event for an order (ready for pickup, picked up, in transit, out for delivery). Use the dedicated /deliver endpoint for terminal delivery — it carries proof-of-delivery semantics this endpoint does not. Amazon SP-API Orders v0 updateShipmentStatus parity. description here description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 732

def update_shipment_status(purchase_order_id,
                           body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/orders/v4/orders/{purchaseOrderId}/shipment-status',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(UpdateShipmentStatusResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end

#update_verification_status(purchase_order_id, body) ⇒ ApiResponse

Parity with Amazon SP-API Orders v0 updateVerificationStatus. The seller calls this after delivering a regulated-item order to record whether the buyer's identity / age was verified at the doorstep. An APPROVED status releases the order for settlement; REJECTED requires a rejectionReason and triggers downstream return-processing. Gated by the CCM-managed orders.features.regulatedInfoEnabled kill-switch (live-refreshable, parity with the cancel kill-switch). Order ID type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/walmart_ap_is/apis/orders_api.rb', line 512

def update_verification_status(purchase_order_id,
                               body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PATCH,
                                 '/orders/v4/orders/{purchaseOrderId}/regulatedInfo',
                                 Server::DEFAULT1)
               .template_param(new_parameter(purchase_order_id, key: 'purchaseOrderId')
                                .is_required(true)
                                .should_encode(true))
               .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(UpdateVerificationStatusResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             "Bad Request.\n\nThe Phase-2 limitations described on `GET '\
                              '/orders/v4/orders`\nsurface here with `code'\
                              '=FILTER_NOT_SUPPORTED` and a human-readable\n`message` naming'\
                              ' the specific rejected filter. Other validation\nfailures'\
                              ' (malformed body, missing required field, unknown enum,\netc.)'\
                              ' reuse this response with their own `code` value. The `code`'\
                              '\nfield is intentionally an open string — new error codes can'\
                              ' be\nadded without a breaking spec change — but the example'\
                              ' below is\nthe canonical shape SDK consumers should be prepared'\
                              ' to handle.\n",
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException)
                .local_error('503',
                             'Service temporarily unavailable — the capability is'\
                              ' momentarily disabled (e.g. an operational kill-switch) or a'\
                              ' dependency is in maintenance. Retryable.',
                             ErrorListErrorException))
    .execute
end