Orderinvoices: createchargeinvoice

Requires authorization

Creates a charge invoice for a shipment group, and triggers a charge capture for non-facilitated payment orders. Try it now.

Request

HTTP request

POST https://www.googleapis.com/content/v2/merchantId/orderinvoices/orderId/createChargeInvoice

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,
  "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.
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[] list [required] Invoice details per line item.
lineItemInvoices[].lineItemId string ID of the line item. Either lineItemId or productId must be set.
lineItemInvoices[].productId string ID of the product. This is the REST ID used in the products service. Either lineItemId or productId must be set.
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).
lineItemInvoices[].unitInvoice nested object [required] Invoice details for a single unit.
lineItemInvoices[].unitInvoice.unitPricePretax nested object [required] Price of the unit, before applying taxes.
lineItemInvoices[].unitInvoice.unitPricePretax.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.unitPricePretax.currency string The currency of the price. writable
lineItemInvoices[].unitInvoice.unitPriceTaxes[] list Tax amounts to apply to the unit price.
lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxType string [required] Type of the tax.

Acceptable values are:
  • "otherFee"
  • "otherFeeTax"
  • "sales"
lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxName string Optional name of the tax type. This should only be provided if taxType is otherFeeTax.
lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxAmount nested object [required] Tax amount for the tax type.
lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxAmount.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.unitPriceTaxes[].taxAmount.currency string The currency of the price. writable
lineItemInvoices[].unitInvoice.promotions[] list Deprecated.
lineItemInvoices[].unitInvoice.promotions[].promotionId string [required] ID of the promotion.
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.
lineItemInvoices[].unitInvoice.promotions[].promotionAmount.pretax nested object [required] Value before taxes.
lineItemInvoices[].unitInvoice.promotions[].promotionAmount.pretax.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.promotions[].promotionAmount.pretax.currency string The currency of the price. writable
lineItemInvoices[].unitInvoice.promotions[].promotionAmount.tax nested object [required] Tax value.
lineItemInvoices[].unitInvoice.promotions[].promotionAmount.tax.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.promotions[].promotionAmount.tax.currency string The currency of the price. writable
lineItemInvoices[].unitInvoice.additionalCharges[] list Additional charges for a unit, e.g. shipping costs.
lineItemInvoices[].unitInvoice.additionalCharges[].type string [required] Type of the additional charge.

Acceptable values are:
  • "shipping"
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount nested object [required] Amount of the additional charge.
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.pretax nested object [required] Value before taxes.
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.pretax.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.pretax.currency string The currency of the price. writable
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.tax nested object [required] Tax value.
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.tax.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargeAmount.tax.currency string The currency of the price. writable
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[] list Deprecated.
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionId string [required] ID of the promotion.
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.
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.pretax nested object [required] Value before taxes.
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.pretax.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.pretax.currency string The currency of the price. writable
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.tax nested object [required] Tax value.
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.tax.value string The price represented as a number. writable
lineItemInvoices[].unitInvoice.additionalCharges[].additionalChargePromotions[].promotionAmount.tax.currency string The currency of the price. writable
invoiceSummary nested object [required] Invoice summary.
invoiceSummary.productTotal nested object [required] Total price for the product.
invoiceSummary.productTotal.pretax nested object [required] Value before taxes.
invoiceSummary.productTotal.pretax.value string The price represented as a number. writable
invoiceSummary.productTotal.pretax.currency string The currency of the price. writable
invoiceSummary.productTotal.tax nested object [required] Tax value.
invoiceSummary.productTotal.tax.value string The price represented as a number. writable
invoiceSummary.productTotal.tax.currency string The currency of the price. writable
invoiceSummary.additionalChargeSummaries[] list Summary of the total amounts of the additional charges.
invoiceSummary.additionalChargeSummaries[].type string [required] Type of the additional charge.

Acceptable values are:
  • "shipping"
invoiceSummary.additionalChargeSummaries[].totalAmount nested object [required] Total additional charge for this type.
invoiceSummary.additionalChargeSummaries[].totalAmount.pretax nested object [required] Value before taxes.
invoiceSummary.additionalChargeSummaries[].totalAmount.pretax.value string The price represented as a number. writable
invoiceSummary.additionalChargeSummaries[].totalAmount.pretax.currency string The currency of the price. writable
invoiceSummary.additionalChargeSummaries[].totalAmount.tax nested object [required] Tax value.
invoiceSummary.additionalChargeSummaries[].totalAmount.tax.value string The price represented as a number. writable
invoiceSummary.additionalChargeSummaries[].totalAmount.tax.currency string The currency of the price. writable
invoiceSummary.promotionSummaries[] list Deprecated.
invoiceSummary.promotionSummaries[].promotionId string [required] ID of the promotion.
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.
invoiceSummary.promotionSummaries[].promotionAmount.pretax nested object [required] Value before taxes.
invoiceSummary.promotionSummaries[].promotionAmount.pretax.value string The price represented as a number. writable
invoiceSummary.promotionSummaries[].promotionAmount.pretax.currency string The currency of the price. writable
invoiceSummary.promotionSummaries[].promotionAmount.tax nested object [required] Tax value.
invoiceSummary.promotionSummaries[].promotionAmount.tax.value string The price represented as a number. writable
invoiceSummary.promotionSummaries[].promotionAmount.tax.currency string The currency of the price. writable
invoiceSummary.merchantBalance nested object Deprecated.
invoiceSummary.merchantBalance.pretax nested object [required] Value before taxes.
invoiceSummary.merchantBalance.pretax.value string The price represented as a number. writable
invoiceSummary.merchantBalance.pretax.currency string The currency of the price. writable
invoiceSummary.merchantBalance.tax nested object [required] Tax value.
invoiceSummary.merchantBalance.tax.value string The price represented as a number. writable
invoiceSummary.merchantBalance.tax.currency string The currency of the price. writable
invoiceSummary.customerBalance nested object Deprecated.
invoiceSummary.customerBalance.pretax nested object [required] Value before taxes.
invoiceSummary.customerBalance.pretax.value string The price represented as a number. writable
invoiceSummary.customerBalance.pretax.currency string The currency of the price. writable
invoiceSummary.customerBalance.tax nested object [required] Tax value.
invoiceSummary.customerBalance.tax.value string The price represented as a number. writable
invoiceSummary.customerBalance.tax.currency string The currency of the price. writable
invoiceSummary.googleBalance nested object Deprecated.
invoiceSummary.googleBalance.pretax nested object [required] Value before taxes.
invoiceSummary.googleBalance.pretax.value string The price represented as a number. writable
invoiceSummary.googleBalance.pretax.currency string The currency of the price. writable
invoiceSummary.googleBalance.tax nested object [required] Tax value.
invoiceSummary.googleBalance.tax.value string The price represented as a number. writable
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#orderinvoicesCreateChargeInvoiceResponse",
  "executionStatus": string
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#orderinvoicesCreateChargeInvoiceResponse".
executionStatus string The status of the execution.

Acceptable values are:
  • "duplicate"
  • "executed"

Send feedback about...

Content API for Shopping