1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\ShoppingContent\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ShoppingContent\CaptureOrderRequest;
|
---|
21 | use Google\Service\ShoppingContent\CaptureOrderResponse;
|
---|
22 | use Google\Service\ShoppingContent\Order;
|
---|
23 | use Google\Service\ShoppingContent\OrdersAcknowledgeRequest;
|
---|
24 | use Google\Service\ShoppingContent\OrdersAcknowledgeResponse;
|
---|
25 | use Google\Service\ShoppingContent\OrdersAdvanceTestOrderResponse;
|
---|
26 | use Google\Service\ShoppingContent\OrdersCancelLineItemRequest;
|
---|
27 | use Google\Service\ShoppingContent\OrdersCancelLineItemResponse;
|
---|
28 | use Google\Service\ShoppingContent\OrdersCancelRequest;
|
---|
29 | use Google\Service\ShoppingContent\OrdersCancelResponse;
|
---|
30 | use Google\Service\ShoppingContent\OrdersCancelTestOrderByCustomerRequest;
|
---|
31 | use Google\Service\ShoppingContent\OrdersCancelTestOrderByCustomerResponse;
|
---|
32 | use Google\Service\ShoppingContent\OrdersCreateTestOrderRequest;
|
---|
33 | use Google\Service\ShoppingContent\OrdersCreateTestOrderResponse;
|
---|
34 | use Google\Service\ShoppingContent\OrdersCreateTestReturnRequest;
|
---|
35 | use Google\Service\ShoppingContent\OrdersCreateTestReturnResponse;
|
---|
36 | use Google\Service\ShoppingContent\OrdersGetByMerchantOrderIdResponse;
|
---|
37 | use Google\Service\ShoppingContent\OrdersGetTestOrderTemplateResponse;
|
---|
38 | use Google\Service\ShoppingContent\OrdersInStoreRefundLineItemRequest;
|
---|
39 | use Google\Service\ShoppingContent\OrdersInStoreRefundLineItemResponse;
|
---|
40 | use Google\Service\ShoppingContent\OrdersListResponse;
|
---|
41 | use Google\Service\ShoppingContent\OrdersRefundItemRequest;
|
---|
42 | use Google\Service\ShoppingContent\OrdersRefundItemResponse;
|
---|
43 | use Google\Service\ShoppingContent\OrdersRefundOrderRequest;
|
---|
44 | use Google\Service\ShoppingContent\OrdersRefundOrderResponse;
|
---|
45 | use Google\Service\ShoppingContent\OrdersRejectReturnLineItemRequest;
|
---|
46 | use Google\Service\ShoppingContent\OrdersRejectReturnLineItemResponse;
|
---|
47 | use Google\Service\ShoppingContent\OrdersReturnRefundLineItemRequest;
|
---|
48 | use Google\Service\ShoppingContent\OrdersReturnRefundLineItemResponse;
|
---|
49 | use Google\Service\ShoppingContent\OrdersSetLineItemMetadataRequest;
|
---|
50 | use Google\Service\ShoppingContent\OrdersSetLineItemMetadataResponse;
|
---|
51 | use Google\Service\ShoppingContent\OrdersShipLineItemsRequest;
|
---|
52 | use Google\Service\ShoppingContent\OrdersShipLineItemsResponse;
|
---|
53 | use Google\Service\ShoppingContent\OrdersUpdateLineItemShippingDetailsRequest;
|
---|
54 | use Google\Service\ShoppingContent\OrdersUpdateLineItemShippingDetailsResponse;
|
---|
55 | use Google\Service\ShoppingContent\OrdersUpdateMerchantOrderIdRequest;
|
---|
56 | use Google\Service\ShoppingContent\OrdersUpdateMerchantOrderIdResponse;
|
---|
57 | use Google\Service\ShoppingContent\OrdersUpdateShipmentRequest;
|
---|
58 | use Google\Service\ShoppingContent\OrdersUpdateShipmentResponse;
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * The "orders" collection of methods.
|
---|
62 | * Typical usage is:
|
---|
63 | * <code>
|
---|
64 | * $contentService = new Google\Service\ShoppingContent(...);
|
---|
65 | * $orders = $contentService->orders;
|
---|
66 | * </code>
|
---|
67 | */
|
---|
68 | class Orders extends \Google\Service\Resource
|
---|
69 | {
|
---|
70 | /**
|
---|
71 | * Marks an order as acknowledged. (orders.acknowledge)
|
---|
72 | *
|
---|
73 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
74 | * cannot be a multi-client account.
|
---|
75 | * @param string $orderId The ID of the order.
|
---|
76 | * @param OrdersAcknowledgeRequest $postBody
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | * @return OrdersAcknowledgeResponse
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function acknowledge($merchantId, $orderId, OrdersAcknowledgeRequest $postBody, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('acknowledge', [$params], OrdersAcknowledgeResponse::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Sandbox only. Moves a test order from state "`inProgress`" to state
|
---|
89 | * "`pendingShipment`". (orders.advancetestorder)
|
---|
90 | *
|
---|
91 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
92 | * cannot be a multi-client account.
|
---|
93 | * @param string $orderId The ID of the test order to modify.
|
---|
94 | * @param array $optParams Optional parameters.
|
---|
95 | * @return OrdersAdvanceTestOrderResponse
|
---|
96 | * @throws \Google\Service\Exception
|
---|
97 | */
|
---|
98 | public function advancetestorder($merchantId, $orderId, $optParams = [])
|
---|
99 | {
|
---|
100 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId];
|
---|
101 | $params = array_merge($params, $optParams);
|
---|
102 | return $this->call('advancetestorder', [$params], OrdersAdvanceTestOrderResponse::class);
|
---|
103 | }
|
---|
104 | /**
|
---|
105 | * Cancels all line items in an order, making a full refund. (orders.cancel)
|
---|
106 | *
|
---|
107 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
108 | * cannot be a multi-client account.
|
---|
109 | * @param string $orderId The ID of the order to cancel.
|
---|
110 | * @param OrdersCancelRequest $postBody
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | * @return OrdersCancelResponse
|
---|
113 | * @throws \Google\Service\Exception
|
---|
114 | */
|
---|
115 | public function cancel($merchantId, $orderId, OrdersCancelRequest $postBody, $optParams = [])
|
---|
116 | {
|
---|
117 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
118 | $params = array_merge($params, $optParams);
|
---|
119 | return $this->call('cancel', [$params], OrdersCancelResponse::class);
|
---|
120 | }
|
---|
121 | /**
|
---|
122 | * Cancels a line item, making a full refund. (orders.cancellineitem)
|
---|
123 | *
|
---|
124 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
125 | * cannot be a multi-client account.
|
---|
126 | * @param string $orderId The ID of the order.
|
---|
127 | * @param OrdersCancelLineItemRequest $postBody
|
---|
128 | * @param array $optParams Optional parameters.
|
---|
129 | * @return OrdersCancelLineItemResponse
|
---|
130 | * @throws \Google\Service\Exception
|
---|
131 | */
|
---|
132 | public function cancellineitem($merchantId, $orderId, OrdersCancelLineItemRequest $postBody, $optParams = [])
|
---|
133 | {
|
---|
134 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
135 | $params = array_merge($params, $optParams);
|
---|
136 | return $this->call('cancellineitem', [$params], OrdersCancelLineItemResponse::class);
|
---|
137 | }
|
---|
138 | /**
|
---|
139 | * Sandbox only. Cancels a test order for customer-initiated cancellation.
|
---|
140 | * (orders.canceltestorderbycustomer)
|
---|
141 | *
|
---|
142 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
143 | * cannot be a multi-client account.
|
---|
144 | * @param string $orderId The ID of the test order to cancel.
|
---|
145 | * @param OrdersCancelTestOrderByCustomerRequest $postBody
|
---|
146 | * @param array $optParams Optional parameters.
|
---|
147 | * @return OrdersCancelTestOrderByCustomerResponse
|
---|
148 | * @throws \Google\Service\Exception
|
---|
149 | */
|
---|
150 | public function canceltestorderbycustomer($merchantId, $orderId, OrdersCancelTestOrderByCustomerRequest $postBody, $optParams = [])
|
---|
151 | {
|
---|
152 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
153 | $params = array_merge($params, $optParams);
|
---|
154 | return $this->call('canceltestorderbycustomer', [$params], OrdersCancelTestOrderByCustomerResponse::class);
|
---|
155 | }
|
---|
156 | /**
|
---|
157 | * Capture funds from the customer for the current order total. This method
|
---|
158 | * should be called after the merchant verifies that they are able and ready to
|
---|
159 | * start shipping the order. This method blocks until a response is received
|
---|
160 | * from the payment processsor. If this method succeeds, the merchant is
|
---|
161 | * guaranteed to receive funds for the order after shipment. If the request
|
---|
162 | * fails, it can be retried or the order may be cancelled. This method cannot be
|
---|
163 | * called after the entire order is already shipped. A rejected error code is
|
---|
164 | * returned when the payment service provider has declined the charge. This
|
---|
165 | * indicates a problem between the PSP and either the merchant's or customer's
|
---|
166 | * account. Sometimes this error will be resolved by the customer. We recommend
|
---|
167 | * retrying these errors once per day or cancelling the order with reason
|
---|
168 | * `failedToCaptureFunds` if the items cannot be held. (orders.captureOrder)
|
---|
169 | *
|
---|
170 | * @param string $merchantId Required. The ID of the account that manages the
|
---|
171 | * order. This cannot be a multi-client account.
|
---|
172 | * @param string $orderId Required. The ID of the Order.
|
---|
173 | * @param CaptureOrderRequest $postBody
|
---|
174 | * @param array $optParams Optional parameters.
|
---|
175 | * @return CaptureOrderResponse
|
---|
176 | * @throws \Google\Service\Exception
|
---|
177 | */
|
---|
178 | public function captureOrder($merchantId, $orderId, CaptureOrderRequest $postBody, $optParams = [])
|
---|
179 | {
|
---|
180 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
181 | $params = array_merge($params, $optParams);
|
---|
182 | return $this->call('captureOrder', [$params], CaptureOrderResponse::class);
|
---|
183 | }
|
---|
184 | /**
|
---|
185 | * Sandbox only. Creates a test order. (orders.createtestorder)
|
---|
186 | *
|
---|
187 | * @param string $merchantId The ID of the account that should manage the order.
|
---|
188 | * This cannot be a multi-client account.
|
---|
189 | * @param OrdersCreateTestOrderRequest $postBody
|
---|
190 | * @param array $optParams Optional parameters.
|
---|
191 | * @return OrdersCreateTestOrderResponse
|
---|
192 | * @throws \Google\Service\Exception
|
---|
193 | */
|
---|
194 | public function createtestorder($merchantId, OrdersCreateTestOrderRequest $postBody, $optParams = [])
|
---|
195 | {
|
---|
196 | $params = ['merchantId' => $merchantId, 'postBody' => $postBody];
|
---|
197 | $params = array_merge($params, $optParams);
|
---|
198 | return $this->call('createtestorder', [$params], OrdersCreateTestOrderResponse::class);
|
---|
199 | }
|
---|
200 | /**
|
---|
201 | * Sandbox only. Creates a test return. (orders.createtestreturn)
|
---|
202 | *
|
---|
203 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
204 | * cannot be a multi-client account.
|
---|
205 | * @param string $orderId The ID of the order.
|
---|
206 | * @param OrdersCreateTestReturnRequest $postBody
|
---|
207 | * @param array $optParams Optional parameters.
|
---|
208 | * @return OrdersCreateTestReturnResponse
|
---|
209 | * @throws \Google\Service\Exception
|
---|
210 | */
|
---|
211 | public function createtestreturn($merchantId, $orderId, OrdersCreateTestReturnRequest $postBody, $optParams = [])
|
---|
212 | {
|
---|
213 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
214 | $params = array_merge($params, $optParams);
|
---|
215 | return $this->call('createtestreturn', [$params], OrdersCreateTestReturnResponse::class);
|
---|
216 | }
|
---|
217 | /**
|
---|
218 | * Retrieves an order from your Merchant Center account. (orders.get)
|
---|
219 | *
|
---|
220 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
221 | * cannot be a multi-client account.
|
---|
222 | * @param string $orderId The ID of the order.
|
---|
223 | * @param array $optParams Optional parameters.
|
---|
224 | * @return Order
|
---|
225 | * @throws \Google\Service\Exception
|
---|
226 | */
|
---|
227 | public function get($merchantId, $orderId, $optParams = [])
|
---|
228 | {
|
---|
229 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId];
|
---|
230 | $params = array_merge($params, $optParams);
|
---|
231 | return $this->call('get', [$params], Order::class);
|
---|
232 | }
|
---|
233 | /**
|
---|
234 | * Retrieves an order using merchant order ID. (orders.getbymerchantorderid)
|
---|
235 | *
|
---|
236 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
237 | * cannot be a multi-client account.
|
---|
238 | * @param string $merchantOrderId The merchant order ID to be looked for.
|
---|
239 | * @param array $optParams Optional parameters.
|
---|
240 | * @return OrdersGetByMerchantOrderIdResponse
|
---|
241 | * @throws \Google\Service\Exception
|
---|
242 | */
|
---|
243 | public function getbymerchantorderid($merchantId, $merchantOrderId, $optParams = [])
|
---|
244 | {
|
---|
245 | $params = ['merchantId' => $merchantId, 'merchantOrderId' => $merchantOrderId];
|
---|
246 | $params = array_merge($params, $optParams);
|
---|
247 | return $this->call('getbymerchantorderid', [$params], OrdersGetByMerchantOrderIdResponse::class);
|
---|
248 | }
|
---|
249 | /**
|
---|
250 | * Sandbox only. Retrieves an order template that can be used to quickly create
|
---|
251 | * a new order in sandbox. (orders.gettestordertemplate)
|
---|
252 | *
|
---|
253 | * @param string $merchantId The ID of the account that should manage the order.
|
---|
254 | * This cannot be a multi-client account.
|
---|
255 | * @param string $templateName The name of the template to retrieve.
|
---|
256 | * @param array $optParams Optional parameters.
|
---|
257 | *
|
---|
258 | * @opt_param string country The country of the template to retrieve. Defaults
|
---|
259 | * to "`US`".
|
---|
260 | * @return OrdersGetTestOrderTemplateResponse
|
---|
261 | * @throws \Google\Service\Exception
|
---|
262 | */
|
---|
263 | public function gettestordertemplate($merchantId, $templateName, $optParams = [])
|
---|
264 | {
|
---|
265 | $params = ['merchantId' => $merchantId, 'templateName' => $templateName];
|
---|
266 | $params = array_merge($params, $optParams);
|
---|
267 | return $this->call('gettestordertemplate', [$params], OrdersGetTestOrderTemplateResponse::class);
|
---|
268 | }
|
---|
269 | /**
|
---|
270 | * Deprecated. Notifies that item return and refund was handled directly by
|
---|
271 | * merchant outside of Google payments processing (for example, cash refund done
|
---|
272 | * in store). Note: We recommend calling the returnrefundlineitem method to
|
---|
273 | * refund in-store returns. We will issue the refund directly to the customer.
|
---|
274 | * This helps to prevent possible differences arising between merchant and
|
---|
275 | * Google transaction records. We also recommend having the point of sale system
|
---|
276 | * communicate with Google to ensure that customers do not receive a double
|
---|
277 | * refund by first refunding through Google then through an in-store return.
|
---|
278 | * (orders.instorerefundlineitem)
|
---|
279 | *
|
---|
280 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
281 | * cannot be a multi-client account.
|
---|
282 | * @param string $orderId The ID of the order.
|
---|
283 | * @param OrdersInStoreRefundLineItemRequest $postBody
|
---|
284 | * @param array $optParams Optional parameters.
|
---|
285 | * @return OrdersInStoreRefundLineItemResponse
|
---|
286 | * @throws \Google\Service\Exception
|
---|
287 | */
|
---|
288 | public function instorerefundlineitem($merchantId, $orderId, OrdersInStoreRefundLineItemRequest $postBody, $optParams = [])
|
---|
289 | {
|
---|
290 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
291 | $params = array_merge($params, $optParams);
|
---|
292 | return $this->call('instorerefundlineitem', [$params], OrdersInStoreRefundLineItemResponse::class);
|
---|
293 | }
|
---|
294 | /**
|
---|
295 | * Lists the orders in your Merchant Center account. (orders.listOrders)
|
---|
296 | *
|
---|
297 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
298 | * cannot be a multi-client account.
|
---|
299 | * @param array $optParams Optional parameters.
|
---|
300 | *
|
---|
301 | * @opt_param bool acknowledged Obtains orders that match the acknowledgement
|
---|
302 | * status. When set to true, obtains orders that have been acknowledged. When
|
---|
303 | * false, obtains orders that have not been acknowledged. We recommend using
|
---|
304 | * this filter set to `false`, in conjunction with the `acknowledge` call, such
|
---|
305 | * that only un-acknowledged orders are returned.
|
---|
306 | * @opt_param string maxResults The maximum number of orders to return in the
|
---|
307 | * response, used for paging. The default value is 25 orders per page, and the
|
---|
308 | * maximum allowed value is 250 orders per page.
|
---|
309 | * @opt_param string orderBy Order results by placement date in descending or
|
---|
310 | * ascending order. Acceptable values are: - placedDateAsc - placedDateDesc
|
---|
311 | * @opt_param string pageToken The token returned by the previous request.
|
---|
312 | * @opt_param string placedDateEnd Obtains orders placed before this date
|
---|
313 | * (exclusively), in ISO 8601 format.
|
---|
314 | * @opt_param string placedDateStart Obtains orders placed after this date
|
---|
315 | * (inclusively), in ISO 8601 format.
|
---|
316 | * @opt_param string statuses Obtains orders that match any of the specified
|
---|
317 | * statuses. Note that `active` is a shortcut for `pendingShipment` and
|
---|
318 | * `partiallyShipped`, and `completed` is a shortcut for `shipped`,
|
---|
319 | * `partiallyDelivered`, `delivered`, `partiallyReturned`, `returned`, and
|
---|
320 | * `canceled`.
|
---|
321 | * @return OrdersListResponse
|
---|
322 | * @throws \Google\Service\Exception
|
---|
323 | */
|
---|
324 | public function listOrders($merchantId, $optParams = [])
|
---|
325 | {
|
---|
326 | $params = ['merchantId' => $merchantId];
|
---|
327 | $params = array_merge($params, $optParams);
|
---|
328 | return $this->call('list', [$params], OrdersListResponse::class);
|
---|
329 | }
|
---|
330 | /**
|
---|
331 | * Issues a partial or total refund for items and shipment. (orders.refunditem)
|
---|
332 | *
|
---|
333 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
334 | * cannot be a multi-client account.
|
---|
335 | * @param string $orderId The ID of the order to refund.
|
---|
336 | * @param OrdersRefundItemRequest $postBody
|
---|
337 | * @param array $optParams Optional parameters.
|
---|
338 | * @return OrdersRefundItemResponse
|
---|
339 | * @throws \Google\Service\Exception
|
---|
340 | */
|
---|
341 | public function refunditem($merchantId, $orderId, OrdersRefundItemRequest $postBody, $optParams = [])
|
---|
342 | {
|
---|
343 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
344 | $params = array_merge($params, $optParams);
|
---|
345 | return $this->call('refunditem', [$params], OrdersRefundItemResponse::class);
|
---|
346 | }
|
---|
347 | /**
|
---|
348 | * Issues a partial or total refund for an order. (orders.refundorder)
|
---|
349 | *
|
---|
350 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
351 | * cannot be a multi-client account.
|
---|
352 | * @param string $orderId The ID of the order to refund.
|
---|
353 | * @param OrdersRefundOrderRequest $postBody
|
---|
354 | * @param array $optParams Optional parameters.
|
---|
355 | * @return OrdersRefundOrderResponse
|
---|
356 | * @throws \Google\Service\Exception
|
---|
357 | */
|
---|
358 | public function refundorder($merchantId, $orderId, OrdersRefundOrderRequest $postBody, $optParams = [])
|
---|
359 | {
|
---|
360 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
361 | $params = array_merge($params, $optParams);
|
---|
362 | return $this->call('refundorder', [$params], OrdersRefundOrderResponse::class);
|
---|
363 | }
|
---|
364 | /**
|
---|
365 | * Rejects return on an line item. (orders.rejectreturnlineitem)
|
---|
366 | *
|
---|
367 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
368 | * cannot be a multi-client account.
|
---|
369 | * @param string $orderId The ID of the order.
|
---|
370 | * @param OrdersRejectReturnLineItemRequest $postBody
|
---|
371 | * @param array $optParams Optional parameters.
|
---|
372 | * @return OrdersRejectReturnLineItemResponse
|
---|
373 | * @throws \Google\Service\Exception
|
---|
374 | */
|
---|
375 | public function rejectreturnlineitem($merchantId, $orderId, OrdersRejectReturnLineItemRequest $postBody, $optParams = [])
|
---|
376 | {
|
---|
377 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
378 | $params = array_merge($params, $optParams);
|
---|
379 | return $this->call('rejectreturnlineitem', [$params], OrdersRejectReturnLineItemResponse::class);
|
---|
380 | }
|
---|
381 | /**
|
---|
382 | * Returns and refunds a line item. Note that this method can only be called on
|
---|
383 | * fully shipped orders. The Orderreturns API is the preferred way to handle
|
---|
384 | * returns after you receive a return from a customer. You can use
|
---|
385 | * Orderreturns.list or Orderreturns.get to search for the return, and then use
|
---|
386 | * Orderreturns.processreturn to issue the refund. If the return cannot be
|
---|
387 | * found, then we recommend using this API to issue a refund.
|
---|
388 | * (orders.returnrefundlineitem)
|
---|
389 | *
|
---|
390 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
391 | * cannot be a multi-client account.
|
---|
392 | * @param string $orderId The ID of the order.
|
---|
393 | * @param OrdersReturnRefundLineItemRequest $postBody
|
---|
394 | * @param array $optParams Optional parameters.
|
---|
395 | * @return OrdersReturnRefundLineItemResponse
|
---|
396 | * @throws \Google\Service\Exception
|
---|
397 | */
|
---|
398 | public function returnrefundlineitem($merchantId, $orderId, OrdersReturnRefundLineItemRequest $postBody, $optParams = [])
|
---|
399 | {
|
---|
400 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
401 | $params = array_merge($params, $optParams);
|
---|
402 | return $this->call('returnrefundlineitem', [$params], OrdersReturnRefundLineItemResponse::class);
|
---|
403 | }
|
---|
404 | /**
|
---|
405 | * Sets (or overrides if it already exists) merchant provided annotations in the
|
---|
406 | * form of key-value pairs. A common use case would be to supply us with
|
---|
407 | * additional structured information about a line item that cannot be provided
|
---|
408 | * through other methods. Submitted key-value pairs can be retrieved as part of
|
---|
409 | * the orders resource. (orders.setlineitemmetadata)
|
---|
410 | *
|
---|
411 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
412 | * cannot be a multi-client account.
|
---|
413 | * @param string $orderId The ID of the order.
|
---|
414 | * @param OrdersSetLineItemMetadataRequest $postBody
|
---|
415 | * @param array $optParams Optional parameters.
|
---|
416 | * @return OrdersSetLineItemMetadataResponse
|
---|
417 | * @throws \Google\Service\Exception
|
---|
418 | */
|
---|
419 | public function setlineitemmetadata($merchantId, $orderId, OrdersSetLineItemMetadataRequest $postBody, $optParams = [])
|
---|
420 | {
|
---|
421 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
422 | $params = array_merge($params, $optParams);
|
---|
423 | return $this->call('setlineitemmetadata', [$params], OrdersSetLineItemMetadataResponse::class);
|
---|
424 | }
|
---|
425 | /**
|
---|
426 | * Marks line item(s) as shipped. (orders.shiplineitems)
|
---|
427 | *
|
---|
428 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
429 | * cannot be a multi-client account.
|
---|
430 | * @param string $orderId The ID of the order.
|
---|
431 | * @param OrdersShipLineItemsRequest $postBody
|
---|
432 | * @param array $optParams Optional parameters.
|
---|
433 | * @return OrdersShipLineItemsResponse
|
---|
434 | * @throws \Google\Service\Exception
|
---|
435 | */
|
---|
436 | public function shiplineitems($merchantId, $orderId, OrdersShipLineItemsRequest $postBody, $optParams = [])
|
---|
437 | {
|
---|
438 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
439 | $params = array_merge($params, $optParams);
|
---|
440 | return $this->call('shiplineitems', [$params], OrdersShipLineItemsResponse::class);
|
---|
441 | }
|
---|
442 | /**
|
---|
443 | * Updates ship by and delivery by dates for a line item.
|
---|
444 | * (orders.updatelineitemshippingdetails)
|
---|
445 | *
|
---|
446 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
447 | * cannot be a multi-client account.
|
---|
448 | * @param string $orderId The ID of the order.
|
---|
449 | * @param OrdersUpdateLineItemShippingDetailsRequest $postBody
|
---|
450 | * @param array $optParams Optional parameters.
|
---|
451 | * @return OrdersUpdateLineItemShippingDetailsResponse
|
---|
452 | * @throws \Google\Service\Exception
|
---|
453 | */
|
---|
454 | public function updatelineitemshippingdetails($merchantId, $orderId, OrdersUpdateLineItemShippingDetailsRequest $postBody, $optParams = [])
|
---|
455 | {
|
---|
456 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
457 | $params = array_merge($params, $optParams);
|
---|
458 | return $this->call('updatelineitemshippingdetails', [$params], OrdersUpdateLineItemShippingDetailsResponse::class);
|
---|
459 | }
|
---|
460 | /**
|
---|
461 | * Updates the merchant order ID for a given order.
|
---|
462 | * (orders.updatemerchantorderid)
|
---|
463 | *
|
---|
464 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
465 | * cannot be a multi-client account.
|
---|
466 | * @param string $orderId The ID of the order.
|
---|
467 | * @param OrdersUpdateMerchantOrderIdRequest $postBody
|
---|
468 | * @param array $optParams Optional parameters.
|
---|
469 | * @return OrdersUpdateMerchantOrderIdResponse
|
---|
470 | * @throws \Google\Service\Exception
|
---|
471 | */
|
---|
472 | public function updatemerchantorderid($merchantId, $orderId, OrdersUpdateMerchantOrderIdRequest $postBody, $optParams = [])
|
---|
473 | {
|
---|
474 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
475 | $params = array_merge($params, $optParams);
|
---|
476 | return $this->call('updatemerchantorderid', [$params], OrdersUpdateMerchantOrderIdResponse::class);
|
---|
477 | }
|
---|
478 | /**
|
---|
479 | * Updates a shipment's status, carrier, and/or tracking ID.
|
---|
480 | * (orders.updateshipment)
|
---|
481 | *
|
---|
482 | * @param string $merchantId The ID of the account that manages the order. This
|
---|
483 | * cannot be a multi-client account.
|
---|
484 | * @param string $orderId The ID of the order.
|
---|
485 | * @param OrdersUpdateShipmentRequest $postBody
|
---|
486 | * @param array $optParams Optional parameters.
|
---|
487 | * @return OrdersUpdateShipmentResponse
|
---|
488 | * @throws \Google\Service\Exception
|
---|
489 | */
|
---|
490 | public function updateshipment($merchantId, $orderId, OrdersUpdateShipmentRequest $postBody, $optParams = [])
|
---|
491 | {
|
---|
492 | $params = ['merchantId' => $merchantId, 'orderId' => $orderId, 'postBody' => $postBody];
|
---|
493 | $params = array_merge($params, $optParams);
|
---|
494 | return $this->call('updateshipment', [$params], OrdersUpdateShipmentResponse::class);
|
---|
495 | }
|
---|
496 | }
|
---|
497 |
|
---|
498 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
499 | class_alias(Orders::class, 'Google_Service_ShoppingContent_Resource_Orders');
|
---|