我将Google Express与Magento集成在一起,但是Create Charge Invoices API对我来说是失败的。我尝试从Google商家的"尝试此API"选项中创建发票,但它引发了以下错误:
{
"error": {
"errors": [
{
"domain": "content.ContentErrorDomain",
"reason": "invalid_transition",
"message": "The requested order is not supported by orderinvoices service"
}
],
"code": 400,
"message": "The requested order is not supported by orderinvoices service"
}
}
createchargeinvoice api doc:https://developers.google.com/shopping-content/v2/reference/v2/orderinvoices/createchargeinvoice
我的请求正文:
{
"invoiceId": "invoice1",
"operationId": "charge1",
"shipmentGroupId": "shipmentgroup1",
"lineItemInvoices": [
{
"productId": "online:en:US:d3k3245",
"shipmentUnitIds": [
"2"
],
"unitInvoice": {
"unitPricePretax": {
"value": "140",
"currency": "USD"
},
"unitPriceTaxes": [
{
"taxType": "sales",
"taxAmount": {
"value": "14",
"currency": "USD"
}
}
],
"promotions": [
{
"promotionId": "111",
"promotionAmount": {
"tax": {
"currency": "USD",
"value": "0"
},
"pretax": {
"currency": "USD",
"value": "0"
}
}
}
],
"additionalCharges": [
{
"additionalChargeAmount": {
"pretax": {
"currency": "USD",
"value": "0"
},
"tax": {
"currency": "USD",
"value": "0"
}
},
"additionalChargePromotions": [
{
"promotionAmount": {
"pretax": {
"currency": "USD",
"value": "0"
},
"tax": {
"currency": "USD",
"value": "0"
}
},
"promotionId": "111"
}
],
"type": "shipping"
}
]
}
}
],
"invoiceSummary": {
"productTotal": {
"pretax": {
"value": "561.20",
"currency": "USD"
},
"tax": {
"value": "55.98",
"currency": "USD"
}
},
"additionalChargeSummaries": [
{
"totalAmount": {
"pretax": {
"value": "561.20",
"currency": "USD"
},
"tax": {
"value": "55.98",
"currency": "USD"
}
},
"type": "shipping"
}
],
"promotionSummaries": [
{
"promotionAmount": {
"pretax": {
"value": "561.20",
"currency": "USD"
},
"tax": {
"value": "55.98",
"currency": "USD"
}
},
"promotionId": "111"
}
],
"merchantBalance": {
"pretax": {
"value": "561.20",
"currency": "USD"
},
"tax": {
"value": "55.98",
"currency": "USD"
}
},
"customerBalance": {
"pretax": {
"value": "561.20",
"currency": "USD"
},
"tax": {
"value": "55.98",
"currency": "USD"
}
}
}
}
有人面对这个问题吗?
根据Google文档(您已经共享),请求主体有大约40个"必需"字段。在当前共享请求主体中,您只有不到一半的必需字段。
必需字段:
- invoiceid
- aperationid
- 装运groupid
- lineIteminvoices []
- lineIteminvoices []。shipmentnitids []
- lineIteminvoices []。unitinvoice
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteMinvoices []。unitinvoice.promotions []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- lineIteminvoices []。
- Invoicesummary
- invoicesummary.producttal
- invoicesummary.producttotal.pretax
- invoicesummary.producttotal.tax
- Invoicesummary.AdditionAlchargeummaries []。类型
- Invoicesummary.AdditionAlchargeummaries []。总计
- invoicesummary.additionalchargeummaries []。
- Invoicesummary.AdditionalCharchummaries []。totalAmount.tax
- invoicesummary.promotionsummaries []。propertionId
- invoicesummary.promotionsummaries []。properionAmount
- invoicesummary.promotionsummaries []。properionAmount.pretax
- invoicesummary.promotionsummaries []。properionamount.tax
- invoicesummary.merchantlance.pretax
- invoicesummary.merchantlance.tax
- invoicesummary.customerbalance.pretax
- invoicesummary.customerbalance.tax
- invoicesummary.googlebalance.pretax
- invoicesummary.googlebalance.tax