class Orders extends Resource (View source)

The "orders" collection of methods.

Typical usage is:

 $contentService = new Google\Service\ShoppingContent(...);
 $orders = $contentService->orders;

Methods

acknowledge(string $merchantId, string $orderId, OrdersAcknowledgeRequest $postBody, array $optParams = [])

Marks an order as acknowledged. (orders.acknowledge)

advancetestorder(string $merchantId, string $orderId, array $optParams = [])

Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". (orders.advancetestorder)

cancel(string $merchantId, string $orderId, OrdersCancelRequest $postBody, array $optParams = [])

Cancels all line items in an order, making a full refund. (orders.cancel)

cancellineitem(string $merchantId, string $orderId, OrdersCancelLineItemRequest $postBody, array $optParams = [])

Cancels a line item, making a full refund. (orders.cancellineitem)

canceltestorderbycustomer(string $merchantId, string $orderId, OrdersCancelTestOrderByCustomerRequest $postBody, array $optParams = [])

Sandbox only. Cancels a test order for customer-initiated cancellation.

captureOrder(string $merchantId, string $orderId, CaptureOrderRequest $postBody, array $optParams = [])

Capture funds from the customer for the current order total. This method should be called after the merchant verifies that they are able and ready to start shipping the order. This method blocks until a response is received from the payment processsor. If this method succeeds, the merchant is guaranteed to receive funds for the order after shipment. If the request fails, it can be retried or the order may be cancelled. This method cannot be called after the entire order is already shipped. A rejected error code is returned when the payment service provider has declined the charge. This indicates a problem between the PSP and either the merchant's or customer's account. Sometimes this error will be resolved by the customer. We recommend retrying these errors once per day or cancelling the order with reason failedToCaptureFunds if the items cannot be held. (orders.captureOrder)

createtestorder(string $merchantId, OrdersCreateTestOrderRequest $postBody, array $optParams = [])

Sandbox only. Creates a test order. (orders.createtestorder)

createtestreturn(string $merchantId, string $orderId, OrdersCreateTestReturnRequest $postBody, array $optParams = [])

Sandbox only. Creates a test return. (orders.createtestreturn)

get(string $merchantId, string $orderId, array $optParams = [])

Retrieves an order from your Merchant Center account. (orders.get)

getbymerchantorderid(string $merchantId, string $merchantOrderId, array $optParams = [])

Retrieves an order using merchant order ID. (orders.getbymerchantorderid)

gettestordertemplate(string $merchantId, string $templateName, array $optParams = [])

Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. (orders.gettestordertemplate)

instorerefundlineitem(string $merchantId, string $orderId, OrdersInStoreRefundLineItemRequest $postBody, array $optParams = [])

Deprecated. Notifies that item return and refund was handled directly by merchant outside of Google payments processing (for example, cash refund done in store). Note: We recommend calling the returnrefundlineitem method to refund in-store returns. We will issue the refund directly to the customer.

listOrders(string $merchantId, array $optParams = [])

Lists the orders in your Merchant Center account. (orders.listOrders)

refunditem(string $merchantId, string $orderId, OrdersRefundItemRequest $postBody, array $optParams = [])

Issues a partial or total refund for items and shipment. (orders.refunditem)

refundorder(string $merchantId, string $orderId, OrdersRefundOrderRequest $postBody, array $optParams = [])

Issues a partial or total refund for an order. (orders.refundorder)

rejectreturnlineitem(string $merchantId, string $orderId, OrdersRejectReturnLineItemRequest $postBody, array $optParams = [])

Rejects return on an line item. (orders.rejectreturnlineitem)

returnrefundlineitem(string $merchantId, string $orderId, OrdersReturnRefundLineItemRequest $postBody, array $optParams = [])

Returns and refunds a line item. Note that this method can only be called on fully shipped orders. The Orderreturns API is the preferred way to handle returns after you receive a return from a customer. You can use Orderreturns.list or Orderreturns.get to search for the return, and then use Orderreturns.processreturn to issue the refund. If the return cannot be found, then we recommend using this API to issue a refund.

setlineitemmetadata(string $merchantId, string $orderId, OrdersSetLineItemMetadataRequest $postBody, array $optParams = [])

Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided through other methods. Submitted key-value pairs can be retrieved as part of the orders resource. (orders.setlineitemmetadata)

shiplineitems(string $merchantId, string $orderId, OrdersShipLineItemsRequest $postBody, array $optParams = [])

Marks line item(s) as shipped. (orders.shiplineitems)

updatelineitemshippingdetails(string $merchantId, string $orderId, OrdersUpdateLineItemShippingDetailsRequest $postBody, array $optParams = [])

Updates ship by and delivery by dates for a line item.

updatemerchantorderid(string $merchantId, string $orderId, OrdersUpdateMerchantOrderIdRequest $postBody, array $optParams = [])

Updates the merchant order ID for a given order.

updateshipment(string $merchantId, string $orderId, OrdersUpdateShipmentRequest $postBody, array $optParams = [])

Updates a shipment's status, carrier, and/or tracking ID.

Details

OrdersAcknowledgeResponse acknowledge(string $merchantId, string $orderId, OrdersAcknowledgeRequest $postBody, array $optParams = [])

Marks an order as acknowledged. (orders.acknowledge)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersAcknowledgeRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersAcknowledgeResponse

Exceptions

Exception

OrdersAdvanceTestOrderResponse advancetestorder(string $merchantId, string $orderId, array $optParams = [])

Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". (orders.advancetestorder)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the test order to modify.

array $optParams

Optional parameters.

Return Value

OrdersAdvanceTestOrderResponse

Exceptions

Exception

OrdersCancelResponse cancel(string $merchantId, string $orderId, OrdersCancelRequest $postBody, array $optParams = [])

Cancels all line items in an order, making a full refund. (orders.cancel)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order to cancel.

OrdersCancelRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersCancelResponse

Exceptions

Exception

OrdersCancelLineItemResponse cancellineitem(string $merchantId, string $orderId, OrdersCancelLineItemRequest $postBody, array $optParams = [])

Cancels a line item, making a full refund. (orders.cancellineitem)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersCancelLineItemRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersCancelLineItemResponse

Exceptions

Exception

OrdersCancelTestOrderByCustomerResponse canceltestorderbycustomer(string $merchantId, string $orderId, OrdersCancelTestOrderByCustomerRequest $postBody, array $optParams = [])

Sandbox only. Cancels a test order for customer-initiated cancellation.

(orders.canceltestorderbycustomer)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the test order to cancel.

OrdersCancelTestOrderByCustomerRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersCancelTestOrderByCustomerResponse

Exceptions

Exception

CaptureOrderResponse captureOrder(string $merchantId, string $orderId, CaptureOrderRequest $postBody, array $optParams = [])

Capture funds from the customer for the current order total. This method should be called after the merchant verifies that they are able and ready to start shipping the order. This method blocks until a response is received from the payment processsor. If this method succeeds, the merchant is guaranteed to receive funds for the order after shipment. If the request fails, it can be retried or the order may be cancelled. This method cannot be called after the entire order is already shipped. A rejected error code is returned when the payment service provider has declined the charge. This indicates a problem between the PSP and either the merchant's or customer's account. Sometimes this error will be resolved by the customer. We recommend retrying these errors once per day or cancelling the order with reason failedToCaptureFunds if the items cannot be held. (orders.captureOrder)

Parameters

string $merchantId

Required. The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

Required. The ID of the Order.

CaptureOrderRequest $postBody
array $optParams

Optional parameters.

Return Value

CaptureOrderResponse

Exceptions

Exception

OrdersCreateTestOrderResponse createtestorder(string $merchantId, OrdersCreateTestOrderRequest $postBody, array $optParams = [])

Sandbox only. Creates a test order. (orders.createtestorder)

Parameters

string $merchantId

The ID of the account that should manage the order. This cannot be a multi-client account.

OrdersCreateTestOrderRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersCreateTestOrderResponse

Exceptions

Exception

OrdersCreateTestReturnResponse createtestreturn(string $merchantId, string $orderId, OrdersCreateTestReturnRequest $postBody, array $optParams = [])

Sandbox only. Creates a test return. (orders.createtestreturn)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersCreateTestReturnRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersCreateTestReturnResponse

Exceptions

Exception

Order get(string $merchantId, string $orderId, array $optParams = [])

Retrieves an order from your Merchant Center account. (orders.get)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

array $optParams

Optional parameters.

Return Value

Order

Exceptions

Exception

OrdersGetByMerchantOrderIdResponse getbymerchantorderid(string $merchantId, string $merchantOrderId, array $optParams = [])

Retrieves an order using merchant order ID. (orders.getbymerchantorderid)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $merchantOrderId

The merchant order ID to be looked for.

array $optParams

Optional parameters.

Return Value

OrdersGetByMerchantOrderIdResponse

Exceptions

Exception

OrdersGetTestOrderTemplateResponse gettestordertemplate(string $merchantId, string $templateName, array $optParams = [])

Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. (orders.gettestordertemplate)

Parameters

string $merchantId

The ID of the account that should manage the order. This cannot be a multi-client account.

string $templateName

The name of the template to retrieve.

array $optParams

Optional parameters.

Return Value

OrdersGetTestOrderTemplateResponse

Exceptions

Exception

OrdersInStoreRefundLineItemResponse instorerefundlineitem(string $merchantId, string $orderId, OrdersInStoreRefundLineItemRequest $postBody, array $optParams = [])

Deprecated. Notifies that item return and refund was handled directly by merchant outside of Google payments processing (for example, cash refund done in store). Note: We recommend calling the returnrefundlineitem method to refund in-store returns. We will issue the refund directly to the customer.

This helps to prevent possible differences arising between merchant and Google transaction records. We also recommend having the point of sale system communicate with Google to ensure that customers do not receive a double refund by first refunding through Google then through an in-store return. (orders.instorerefundlineitem)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersInStoreRefundLineItemRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersInStoreRefundLineItemResponse

Exceptions

Exception

OrdersListResponse listOrders(string $merchantId, array $optParams = [])

Lists the orders in your Merchant Center account. (orders.listOrders)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

array $optParams

Optional parameters.

Return Value

OrdersListResponse

Exceptions

Exception

OrdersRefundItemResponse refunditem(string $merchantId, string $orderId, OrdersRefundItemRequest $postBody, array $optParams = [])

Issues a partial or total refund for items and shipment. (orders.refunditem)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order to refund.

OrdersRefundItemRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersRefundItemResponse

Exceptions

Exception

OrdersRefundOrderResponse refundorder(string $merchantId, string $orderId, OrdersRefundOrderRequest $postBody, array $optParams = [])

Issues a partial or total refund for an order. (orders.refundorder)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order to refund.

OrdersRefundOrderRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersRefundOrderResponse

Exceptions

Exception

OrdersRejectReturnLineItemResponse rejectreturnlineitem(string $merchantId, string $orderId, OrdersRejectReturnLineItemRequest $postBody, array $optParams = [])

Rejects return on an line item. (orders.rejectreturnlineitem)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersRejectReturnLineItemRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersRejectReturnLineItemResponse

Exceptions

Exception

OrdersReturnRefundLineItemResponse returnrefundlineitem(string $merchantId, string $orderId, OrdersReturnRefundLineItemRequest $postBody, array $optParams = [])

Returns and refunds a line item. Note that this method can only be called on fully shipped orders. The Orderreturns API is the preferred way to handle returns after you receive a return from a customer. You can use Orderreturns.list or Orderreturns.get to search for the return, and then use Orderreturns.processreturn to issue the refund. If the return cannot be found, then we recommend using this API to issue a refund.

(orders.returnrefundlineitem)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersReturnRefundLineItemRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersReturnRefundLineItemResponse

Exceptions

Exception

OrdersSetLineItemMetadataResponse setlineitemmetadata(string $merchantId, string $orderId, OrdersSetLineItemMetadataRequest $postBody, array $optParams = [])

Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided through other methods. Submitted key-value pairs can be retrieved as part of the orders resource. (orders.setlineitemmetadata)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersSetLineItemMetadataRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersSetLineItemMetadataResponse

Exceptions

Exception

OrdersShipLineItemsResponse shiplineitems(string $merchantId, string $orderId, OrdersShipLineItemsRequest $postBody, array $optParams = [])

Marks line item(s) as shipped. (orders.shiplineitems)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersShipLineItemsRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersShipLineItemsResponse

Exceptions

Exception

OrdersUpdateLineItemShippingDetailsResponse updatelineitemshippingdetails(string $merchantId, string $orderId, OrdersUpdateLineItemShippingDetailsRequest $postBody, array $optParams = [])

Updates ship by and delivery by dates for a line item.

(orders.updatelineitemshippingdetails)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersUpdateLineItemShippingDetailsRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersUpdateLineItemShippingDetailsResponse

Exceptions

Exception

OrdersUpdateMerchantOrderIdResponse updatemerchantorderid(string $merchantId, string $orderId, OrdersUpdateMerchantOrderIdRequest $postBody, array $optParams = [])

Updates the merchant order ID for a given order.

(orders.updatemerchantorderid)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersUpdateMerchantOrderIdRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersUpdateMerchantOrderIdResponse

Exceptions

Exception

OrdersUpdateShipmentResponse updateshipment(string $merchantId, string $orderId, OrdersUpdateShipmentRequest $postBody, array $optParams = [])

Updates a shipment's status, carrier, and/or tracking ID.

(orders.updateshipment)

Parameters

string $merchantId

The ID of the account that manages the order. This cannot be a multi-client account.

string $orderId

The ID of the order.

OrdersUpdateShipmentRequest $postBody
array $optParams

Optional parameters.

Return Value

OrdersUpdateShipmentResponse

Exceptions

Exception