Google Express - Orderinvoices: createchargeinvoice



我将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个"必需"字段。在当前共享请求主体中,您只有不到一半的必需字段。

必需字段:

  1. invoiceid
  2. aperationid
  3. 装运groupid
  4. lineIteminvoices []
  5. lineIteminvoices []。shipmentnitids []
  6. lineIteminvoices []。unitinvoice
  7. lineIteminvoices []。
  8. lineIteminvoices []。
  9. lineIteminvoices []。
  10. lineIteminvoices []。
  11. lineIteminvoices []。
  12. lineIteminvoices []。
  13. lineIteMinvoices []。unitinvoice.promotions []。
  14. lineIteminvoices []。
  15. lineIteminvoices []。
  16. lineIteminvoices []。
  17. lineIteminvoices []。
  18. lineIteminvoices []。
  19. lineIteminvoices []。
  20. lineIteminvoices []。
  21. lineIteminvoices []。
  22. Invoicesummary
  23. invoicesummary.producttal
  24. invoicesummary.producttotal.pretax
  25. invoicesummary.producttotal.tax
  26. Invoicesummary.AdditionAlchargeummaries []。类型
  27. Invoicesummary.AdditionAlchargeummaries []。总计
  28. invoicesummary.additionalchargeummaries []。
  29. Invoicesummary.AdditionalCharchummaries []。totalAmount.tax
  30. invoicesummary.promotionsummaries []。propertionId
  31. invoicesummary.promotionsummaries []。properionAmount
  32. invoicesummary.promotionsummaries []。properionAmount.pretax
  33. invoicesummary.promotionsummaries []。properionamount.tax
  34. invoicesummary.merchantlance.pretax
  35. invoicesummary.merchantlance.tax
  36. invoicesummary.customerbalance.pretax
  37. invoicesummary.customerbalance.tax
  38. invoicesummary.googlebalance.pretax
  39. invoicesummary.googlebalance.tax

相关内容

  • 没有找到相关文章

最新更新