我正在将Google Express与Magento集成,但创建费用发票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"
}
}
}
}
有人遇到过这个问题吗?
根据谷歌文档(您已共享),请求正文大约有40个“必填”字段。在当前的共享请求正文中,您只需不到一半的必填字段。