We will sunset v2 of the Content API on March 29th, 2021. To avoid disruptions with your integration, please migrate to v2.1 as soon as possible. For more information, see Migrating to v2.1.

Method: orderinvoices.createrefundinvoice

Creates a refund invoice for one or more shipment groups, and triggers a refund for orderinvoice enabled orders. This can only be used for line items that have previously been charged using createChargeInvoice. All amounts (except for the summary) are incremental with respect to the previous invoice.

HTTP request

POST https://shoppingcontent.googleapis.com/content/v2/{merchantId}/orderinvoices/{orderId}/createRefundInvoice

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 OrderinvoicesCreateRefundInvoiceRequest.

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#orderinvoicesCreateRefundInvoiceResponse"

.

Authorization Scopes

Requires one of the following OAuth scopes:

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

For more information, see the OAuth 2.0 Overview.

OrderinvoicesCreateRefundInvoiceRequest

JSON representation
{
  "invoiceId": string,
  "operationId": string,
  "refundOnlyOption": {
    object (OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption)
  },
  "shipmentInvoices": [
    {
      object (ShipmentInvoice)
    }
  ],
  "returnOption": {
    object (OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption)
  }
}
Fields
invoiceId

string

[required] The ID of the invoice.

operationId

string

[required] The ID of the operation, unique across all operations for a given order.

refundOnlyOption

object (OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption)

Option to create a refund-only invoice. Exactly one of refundOnlyOption or returnOption must be provided.

shipmentInvoices[]

object (ShipmentInvoice)

Invoice details for different shipment groups.

returnOption

object (OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption)

Option to create an invoice for a refund and mark all items within the invoice as returned. Exactly one of refundOnlyOption or returnOption must be provided.

OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption

JSON representation
{
  "reason": string,
  "description": string
}
Fields
reason

string

[required] Reason for the refund.

Acceptable values are:

  • "adjustment"
  • "autoPostInternal"
  • "autoPostInvalidBillingAddress"
  • "autoPostNoInventory"
  • "autoPostPriceError"
  • "autoPostUndeliverableShippingAddress"
  • "couponAbuse"
  • "courtesyAdjustment"
  • "customerCanceled"
  • "customerDiscretionaryReturn"
  • "customerInitiatedMerchantCancel"
  • "customerSupportRequested"
  • "deliveredLateByCarrier"
  • "deliveredTooLate"
  • "expiredItem"
  • "failToPushOrderGoogleError"
  • "failToPushOrderMerchantError"
  • "failToPushOrderMerchantFulfillmentError"
  • "failToPushOrderToMerchant"
  • "failToPushOrderToMerchantOutOfStock"
  • "feeAdjustment"
  • "invalidCoupon"
  • "lateShipmentCredit"
  • "malformedShippingAddress"
  • "merchantDidNotShipOnTime"
  • "noInventory"
  • "orderTimeout"
  • "other"
  • "paymentAbuse"
  • "paymentDeclined"
  • "priceAdjustment"
  • "priceError"
  • "productArrivedDamaged"
  • "productNotAsDescribed"
  • "promoReallocation"
  • "qualityNotAsExpected"
  • "returnRefundAbuse"
  • "shippingCostAdjustment"
  • "shippingPriceError"
  • "taxAdjustment"
  • "taxError"
  • "undeliverableShippingAddress"
  • "unsupportedPoBoxAddress"
  • "wrongProductShipped"

description

string

Optional description of the refund reason.

ShipmentInvoice

JSON representation
{
  "shipmentGroupId": string,
  "lineItemInvoices": [
    {
      object (ShipmentInvoiceLineItemInvoice)
    }
  ],
  "invoiceSummary": {
    object (InvoiceSummary)
  }
}
Fields
shipmentGroupId

string

[required] ID of the shipment group. It is assigned by the merchant in the shipLineItems method and is used to group multiple line items that have the same kind of shipping charges.

lineItemInvoices[]

object (ShipmentInvoiceLineItemInvoice)

[required] Invoice details per line item.

invoiceSummary

object (InvoiceSummary)

[required] Invoice summary.

OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption

JSON representation
{
  "reason": string,
  "description": string
}
Fields
reason

string

[required] Reason for the return.

Acceptable values are:

  • "customerDiscretionaryReturn"
  • "customerInitiatedMerchantCancel"
  • "deliveredTooLate"
  • "expiredItem"
  • "invalidCoupon"
  • "malformedShippingAddress"
  • "other"
  • "productArrivedDamaged"
  • "productNotAsDescribed"
  • "qualityNotAsExpected"
  • "undeliverableShippingAddress"
  • "unsupportedPoBoxAddress"
  • "wrongProductShipped"

description

string

Optional description of the return reason.