Method: orders.cancellineitem

Cancels a line item, making a full refund.

HTTP request

POST https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/cancelLineItem

Path parameters

Parameters
merchantId

string

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

orderId

string

The ID of the order.

Request body

The request body contains an instance of OrdersCancelLineItemRequest.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "executionStatus": string,
  "kind": string
}
Fields
executionStatus

string

The status of the execution.

Acceptable values are:

  • "duplicate"
  • "executed"

kind

string

Identifies what kind of resource this is. Value: the fixed string

"content#ordersCancelLineItemResponse"

.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/content
  • https://www.googleapis.com/auth/structuredcontent

For more information, see the OAuth 2.0 Overview.

OrdersCancelLineItemRequest

JSON representation
{
  "operationId": string,
  "lineItemId": string,
  "quantity": integer,
  "reason": string,
  "reasonText": string,
  "amount": {
    object (Price)
  },
  "productId": string,
  "amountPretax": {
    object (Price)
  },
  "amountTax": {
    object (Price)
  }
}
Fields
operationId

string

The ID of the operation. Unique across all operations for a given order.

lineItemId

string

The ID of the line item to cancel. Either lineItemId or productId is required.

quantity

integer (uint32 format)

The quantity to cancel.

reason

string

The reason for the cancellation.

Acceptable values are:

  • "customerInitiatedCancel"
  • "invalidCoupon"
  • "malformedShippingAddress"
  • "noInventory"
  • "other"
  • "priceError"
  • "shippingPriceError"
  • "taxError"
  • "undeliverableShippingAddress"
  • "unsupportedPoBoxAddress"

reasonText

string

The explanation of the reason.

amount

object (Price)

Deprecated. Please use amountPretax and amountTax instead.

productId

string

The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required.

amountPretax

object (Price)

Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order.

amountTax

object (Price)

Tax amount that corresponds to cancellation amount in amountPretax. Optional, but if filled, then amountPretax must be set. Calculated automatically if not provided.