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.
Try it now.
Request
HTTP request
POST https://www.googleapis.com/content/v2.1/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:
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": { "unitPrice": { "value": string, "currency": string }, "unitPriceTaxes": [ { "taxType": string, "taxName": string, "taxAmount": { "value": string, "currency": string } } ], "additionalCharges": [ { "type": string, "additionalChargeAmount": { "priceAmount": { "value": string, "currency": string }, "taxAmount": { "value": string, "currency": string } } } ] } } ], "invoiceSummary": { "productTotal": { "priceAmount": { "value": string, "currency": string }, "taxAmount": { "value": string, "currency": string } }, "additionalChargeSummaries": [ { "type": string, "totalAmount": { "priceAmount": { "value": string, "currency": string }, "taxAmount": { "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. 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. |
|
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] The shipment unit ID is assigned by the merchant and defines individual quantities within a line item. The same ID can be assigned to units that are the same while units that differ must be assigned a different ID (for example: free or promotional units). | |
shipmentInvoices[].lineItemInvoices[].unitInvoice |
nested object |
[required] Invoice details for a single unit. | |
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.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[].invoiceSummary |
nested object |
[required] Invoice summary. | |
shipmentInvoices[].invoiceSummary.productTotal |
nested object |
[required] Total price for the product. | |
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[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.priceAmount |
nested object |
[required] The pre-tax or post-tax price depending on the location of the order. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.priceAmount.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.priceAmount.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.taxAmount |
nested object |
[required] Tax value. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.taxAmount.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.taxAmount.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.productTotal.priceAmount |
nested object |
[required] The pre-tax or post-tax price depending on the location of the order. | |
shipmentInvoices[].invoiceSummary.productTotal.priceAmount.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.productTotal.priceAmount.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.productTotal.taxAmount |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.productTotal.taxAmount.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.productTotal.taxAmount.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.priceAmount |
nested object |
[required] The pre-tax or post-tax price depending on the location of the order. | |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.priceAmount.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.priceAmount.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.taxAmount |
nested object |
[required] Tax value. | |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.taxAmount.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].invoiceSummary.additionalChargeSummaries[].totalAmount.taxAmount.currency |
string |
The currency of the price. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPrice |
nested object |
[required] Pre-tax or post-tax price of the unit depending on the locality of the order. | |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPrice.value |
string |
The price represented as a number. | writable |
shipmentInvoices[].lineItemInvoices[].unitInvoice.unitPrice.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:
|