createchargeinvoice(merchantId, orderId, body=None)
Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders.
createrefundinvoice(merchantId, orderId, body=None)
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.
createchargeinvoice(merchantId, orderId, body=None)
Creates a charge invoice for a shipment group, and triggers a charge capture for orderinvoice enabled orders. Args: merchantId: string, The ID of the account that manages the order. This cannot be a multi-client account. (required) orderId: string, The ID of the order. (required) body: object, The request body. The object takes the form of: { "operationId": "A String", # [required] The ID of the operation, unique across all operations for a given order. "invoiceSummary": { # [required] Invoice summary. "productTotal": { # [required] Total price for the product. "priceAmount": { # [required] The pre-tax or post-tax price depending on the location of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxAmount": { # [required] Tax value. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "additionalChargeSummaries": [ # Summary of the total amounts of the additional charges. { "totalAmount": { # [required] Total additional charge for this type. "priceAmount": { # [required] The pre-tax or post-tax price depending on the location of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxAmount": { # [required] Tax value. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "type": "A String", # [required] Type of the additional charge. # # Acceptable values are: # - "`shipping`" }, ], }, "invoiceId": "A String", # [required] The ID of the invoice. "shipmentGroupId": "A 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": [ # [required] Invoice details per line item. { "unitInvoice": { # [required] Invoice details for a single unit. "unitPriceTaxes": [ # Tax amounts to apply to the unit price. { "taxType": "A String", # [required] Type of the tax. # # Acceptable values are: # - "`otherFee`" # - "`otherFeeTax`" # - "`sales`" "taxAmount": { # [required] Tax amount for the tax type. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxName": "A String", # Optional name of the tax type. This should only be provided if `taxType` is `otherFeeTax`. }, ], "additionalCharges": [ # Additional charges for a unit, e.g. shipping costs. { "additionalChargeAmount": { # [required] Amount of the additional charge. "priceAmount": { # [required] The pre-tax or post-tax price depending on the location of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxAmount": { # [required] Tax value. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "type": "A String", # [required] Type of the additional charge. # # Acceptable values are: # - "`shipping`" }, ], "unitPrice": { # [required] Pre-tax or post-tax price of the unit depending on the locality of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "shipmentUnitIds": [ # [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). "A String", ], "lineItemId": "A String", # ID of the line item. Either lineItemId or productId must be set. "productId": "A String", # ID of the product. This is the REST ID used in the products service. Either lineItemId or productId must be set. }, ], } Returns: An object of the form: { "kind": "content#orderinvoicesCreateChargeInvoiceResponse", # Identifies what kind of resource this is. Value: the fixed string "content#orderinvoicesCreateChargeInvoiceResponse". "executionStatus": "A String", # The status of the execution. # # Acceptable values are: # - "`duplicate`" # - "`executed`" }
createrefundinvoice(merchantId, orderId, body=None)
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. Args: merchantId: string, The ID of the account that manages the order. This cannot be a multi-client account. (required) orderId: string, The ID of the order. (required) body: object, The request body. The object takes the form of: { "shipmentInvoices": [ # Invoice details for different shipment groups. { "invoiceSummary": { # [required] Invoice summary. "productTotal": { # [required] Total price for the product. "priceAmount": { # [required] The pre-tax or post-tax price depending on the location of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxAmount": { # [required] Tax value. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "additionalChargeSummaries": [ # Summary of the total amounts of the additional charges. { "totalAmount": { # [required] Total additional charge for this type. "priceAmount": { # [required] The pre-tax or post-tax price depending on the location of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxAmount": { # [required] Tax value. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "type": "A String", # [required] Type of the additional charge. # # Acceptable values are: # - "`shipping`" }, ], }, "shipmentGroupId": "A 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": [ # [required] Invoice details per line item. { "unitInvoice": { # [required] Invoice details for a single unit. "unitPriceTaxes": [ # Tax amounts to apply to the unit price. { "taxType": "A String", # [required] Type of the tax. # # Acceptable values are: # - "`otherFee`" # - "`otherFeeTax`" # - "`sales`" "taxAmount": { # [required] Tax amount for the tax type. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxName": "A String", # Optional name of the tax type. This should only be provided if `taxType` is `otherFeeTax`. }, ], "additionalCharges": [ # Additional charges for a unit, e.g. shipping costs. { "additionalChargeAmount": { # [required] Amount of the additional charge. "priceAmount": { # [required] The pre-tax or post-tax price depending on the location of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, "taxAmount": { # [required] Tax value. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "type": "A String", # [required] Type of the additional charge. # # Acceptable values are: # - "`shipping`" }, ], "unitPrice": { # [required] Pre-tax or post-tax price of the unit depending on the locality of the order. "currency": "A String", # The currency of the price. "value": "A String", # The price represented as a number. }, }, "shipmentUnitIds": [ # [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). "A String", ], "lineItemId": "A String", # ID of the line item. Either lineItemId or productId must be set. "productId": "A String", # ID of the product. This is the REST ID used in the products service. Either lineItemId or productId must be set. }, ], }, ], "invoiceId": "A String", # [required] The ID of the invoice. "returnOption": { # 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. "reason": "A String", # [required] Reason for the return. # # Acceptable values are: # - "`customerDiscretionaryReturn`" # - "`customerInitiatedMerchantCancel`" # - "`deliveredTooLate`" # - "`expiredItem`" # - "`invalidCoupon`" # - "`malformedShippingAddress`" # - "`other`" # - "`productArrivedDamaged`" # - "`productNotAsDescribed`" # - "`qualityNotAsExpected`" # - "`undeliverableShippingAddress`" # - "`unsupportedPoBoxAddress`" # - "`wrongProductShipped`" "description": "A String", # Optional description of the return reason. }, "refundOnlyOption": { # Option to create a refund-only invoice. Exactly one of `refundOnlyOption` or `returnOption` must be provided. "reason": "A 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": "A String", # Optional description of the refund reason. }, "operationId": "A String", # [required] The ID of the operation, unique across all operations for a given order. } Returns: An object of the form: { "kind": "content#orderinvoicesCreateRefundInvoiceResponse", # Identifies what kind of resource this is. Value: the fixed string "content#orderinvoicesCreateRefundInvoiceResponse". "executionStatus": "A String", # The status of the execution. # # Acceptable values are: # - "`duplicate`" # - "`executed`" }