BigCommerce 更明确的回应

编程入门 行业动态 更新时间:2024-10-24 10:16:31
本文介绍了BigCommerce 更明确的回应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

当程序尝试发布已存在的货件时,BigCommerce 能否更改其 API 响应以使其更加清晰?

Can BigCommerce change their API response to be more clear when a program tries to post a shipment that already exists?

向 BigCommerce 发布货件时,如果货件已存在,您会收到以下错误消息.

When posting shipments to BigCommerce, if the shipment already exists, then you receive the following error message.

<?xml version="1.0"?>
<errors>
    <error>
        <status>400</status>
        <message>The field 'quantity' is invalid.</message>
        <details>
            <invalid_reason>The quantity specified is greater than the quantity of the product that is available to ship.</invalid_reason>
            <available_quantity>0</available_quantity>
            <order_product_id>628</order_product_id>
        </details>
    </error>
</errors>

我同意这是一个糟糕的要求,但这与物品的数量无关.我们可以对 messageinvalid_reason 执行以下操作吗?

I agree that it is a bad request, but it has nothing to do with the quantity of the item. Can we do something like the following for the message or invalid_reason instead?

The shipment [insert ID here] already exists and cannot be added.

这将使 API 更加有用.

This would make for a much more usable API.

推荐答案

当查询订单产品资源时,有一个可用的发货数量,当您创建一个或多个发货时,可用数量减少到 0.

When querying the order products resource there is an available quantity to ship, and as you create a shipment(s) the available quantity is reduced to 0.

最初发货 POST 是成功的,因为负载中指定的数量与订单的数量相匹配.如果您要向已发货的订单发送货物,则可用数量实际上为 0,并且当您在有效负载中为数量指定正整数时,它无效且大于可用数量,因此错误是准确的.

Initially a shipment POST is successful as the quantity specified in the payload matches that of the order. If you were to POST a shipment to an order that has already been shipped then the available quantity is actually 0, and when you specify a positive integer for quantity in the payload it is invalid and greater than the available quantity, so the error is accurate.

这篇关于BigCommerce 更明确的回应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 03:15:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/928409.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:BigCommerce

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!