Requires authorization
Creates a refund invoice for one or more shipment groups, and triggers a refund for non-facilitated payment 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.
Try it now.
Request
HTTP request
POST https://www.googleapis.com/content/v2/merchantId/orderinvoices/orderId/createRefundInvoice
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
merchantId |
unsigned long |
The ID of the account that manages the order. This cannot be a multi-client account. |
orderId |
string |
The ID of the order. |
Authorization
This request requires authorization with the following scope (read more about authentication and authorization).
Scope |
---|
https://www.googleapis.com/auth/content |
Request body
In the request body, supply data with the following structure:
{ "invoiceId": string, "operationId": string, "refundOnlyOption": { "reason": string, "description": string }, "returnOption": { "reason": string, "description": string }, "shipmentInvoices": [ { "shipmentGroupId": string, "lineItemInvoices": [ { "lineItemId": string, "productId": string, "shipmentUnitIds": [ string ], "unitInvoice": { "unitPricePretax": { "value": string, "currency": string }, "unitPriceTaxes": [ { "taxType": string, "taxName": string, "taxAmount": { "value": string, "currency": string } } ], "promotions": [ { "promotionId": string, "promotionAmount": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } } } ], "additionalCharges": [ { "type": string, "additionalChargeAmount": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } }, "additionalChargePromotions": [ { "promotionId": string, "promotionAmount": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } } } ] } ] } } ], "invoiceSummary": { "productTotal": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } }, "additionalChargeSummaries": [ { "type": string, "totalAmount": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } } } ], "promotionSummaries": [ { "promotionId": string, "promotionAmount": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } } } ], "merchantBalance": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } }, "customerBalance": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } }, "googleBalance": { "pretax": { "value": string, "currency": string }, "tax": { "value": string, "currency": string } } } } ] }
Property name | Value | Description | Notes |
---|---|---|---|
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 |
nested object |
Option to create a refund-only invoice. Exactly one of refundOnlyOption or returnOption must be provided. |
|
refundOnlyOption.reason |
string |
[required] Reason for the refund.
Acceptable values are:
|
|
refundOnlyOption.description |
string |
Optional description of the refund reason. | |
returnOption |
nested object |
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. |
|
returnOption.reason |
string |
[required] Reason for the return.
Acceptable values are:
|
|
returnOption.description |
string |
Optional description of the return reason. | |
shipmentInvoices[] |
list |
Invoice details for different shipment groups. | |
shipmentInvoices[].shipmentGroupId |
string |
[required] ID of the shipment group. | |
shipmentInvoices[].lineItemInvoices[] |
list |
[required] Invoice details per line item. | |
shipmentInvoices[].lineItemInvoices[].lineItemId |
string |
ID of the line item. Either lineItemId or productId must be set. | |
shipmentInvoices[].lineItemInvoices[].productId |
string |
ID of the product. This is the REST ID used in the products service. Either lineItemId or productId must be set. | |
shipmentInvoices[].lineItemInvoices[].shipmentUnitIds[] |
list |
[required] Unit IDs to define specific units within the line item. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice |
nested object |
[required] Invoice details for a single unit. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPricePretax |
nested object |
[required] Price of the unit, before applying taxes. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPricePretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPricePretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPriceTaxes[] |
list |
Tax amounts to apply to the unit price. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxType |
string |
[required] Type of the tax.
Acceptable values are:
|
|
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxName |
string |
Optional name of the tax type. This should only be provided if taxType is otherFeeTax . |
|
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxAmount |
nested object |
[required] Tax amount for the tax type. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxAmount.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxAmount.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[] |
list |
Deprecated. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionId |
string |
[required] ID of the promotion. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionAmount |
nested object |
[required] Amount of the promotion. The values here are the promotion applied to the unit price pretax and to the total of the tax amounts. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionAmount.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionAmount.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionAmount.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionAmount.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionAmount.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.promotions[].promotionAmount.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[] |
list |
Additional charges for a unit, e.g. shipping costs. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].type |
string |
[required] Type of the additional charge.
Acceptable values are:
|
|
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount |
nested object |
[required] Amount of the additional charge. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[] |
list |
Deprecated. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionId |
string |
[required] ID of the promotion. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount |
nested object |
[required] Amount of the promotion. The values here are the promotion applied to the unit price pretax and to the total of the tax amounts. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary |
nested object |
[required] Invoice summary. | |
shipmentInvoices[].invoiceSummary.productTotal |
nested object |
[required] Total price for the product. | |
shipmentInvoices[].invoiceSummary.productTotal.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].invoiceSummary.productTotal.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.productTotal.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.productTotal.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.productTotal.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.productTotal.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[] |
list |
Summary of the total amounts of the additional charges. | |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].type |
string |
[required] Type of the additional charge.
Acceptable values are:
|
|
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount |
nested object |
[required] Total additional charge for this type. | |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.promotionSummaries[] |
list |
Deprecated. | |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionId |
string |
[required] ID of the promotion. | |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionAmount |
nested object |
[required] Amount of the promotion. The values here are the promotion applied to the unit price pretax and to the total of the tax amounts. | |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionAmount.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionAmount.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionAmount.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionAmount.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionAmount.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.promotionSummaries[].promotionAmount.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.merchantBalance |
nested object |
Deprecated. | |
shipmentInvoices[].invoiceSummary.merchantBalance.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].invoiceSummary.merchantBalance.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.merchantBalance.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.merchantBalance.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.merchantBalance.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.merchantBalance.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.customerBalance |
nested object |
Deprecated. | |
shipmentInvoices[].invoiceSummary.customerBalance.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].invoiceSummary.customerBalance.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.customerBalance.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.customerBalance.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.customerBalance.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.customerBalance.tax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.googleBalance |
nested object |
Deprecated. | |
shipmentInvoices[].invoiceSummary.googleBalance.pretax |
nested object |
[required] Value before taxes. | |
shipmentInvoices[].invoiceSummary.googleBalance.pretax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.googleBalance.pretax.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.googleBalance.tax |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.googleBalance.tax.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.googleBalance.tax.currency |
string |
The currency of the price. | writable |
Response
If successful, this method returns a response body with the following structure:
{ "kind": "content#orderinvoicesCreateRefundInvoiceResponse", "executionStatus": string }
Property name | Value | Description | Notes |
---|---|---|---|
kind |
string |
Identifies what kind of resource this is. Value: the fixed string "content#orderinvoicesCreateRefundInvoiceResponse" . |
|
executionStatus |
string |
The status of the execution.
Acceptable values are:
|