0

目前,在资源“/coupon.json”尝试优惠券(POST)时,我们得到以下返回 JSON:

响应代码:

{"status":400,"message":"The field 'id' cannot be written to. Please remove it from your request before trying again."}

“ID”字段显然不在我们的代码中,但我们仍然收到此错误。

在这个添加中,我们认为它可能来自“applies_to”,因为该对象资源包含一个“ids”元素,但我们禁用了它并且仍然收到相同的效果。

目前,我们最好的猜测是,这是服务器端的一个错误,它正在为带有“ID”点的优惠券资源注册传入的 JSON。

问题:目前可以创建优惠券吗?

4

1 回答 1

1

可以创建优惠券。我通过 php 脚本和使用https://developer.bigcommerce.com/console的开发者游乐场让它工作

    $coupon = array('name' => 'FJKDJFKD', 'type' => 'percentage_discount', 'amount' => 50.0, 'code' => 'JFKDFE', 'enabled' => true, 'applies_to' => array('entity' => 'products', 'ids' => array(32)), 'shipping_methods' => array());
print_r($coupon);

操场截图——

张贴优惠券发布回复

于 2013-05-06T21:29:17.013 回答