当使用guestCart应用编程接口端点的addToGuestCart方法时,selected_variations参数不起作用。我尝试以JSON格式发送post数据,并将selected_variations设置为包含从getInventory端点检索到的两个变体的数组。API请求给出了一个200HTTP响应,但没有返回任何数据,而且商品也不会出现在Etsy购物车中。在没有selected_variations集的情况下进行相同的API调用可以很好地工作。您能否建议在对addToGuestCart端点的调用中包含selected_variations的正确格式?
发布于 2020-07-16 17:17:10
这对我很有效:
const guestCart_data = {
url: "https://openapi.etsy.com/v2/guests/:guest_id/carts",
method: "POST",
data: {
guest_id: guestId,
listing_id: listingId,
quantity: 1,
selected_variations: `{"47626759898" : "55055453743", "513": "86877352060"}`
// selected_variations: `{"<property_id>" : "<value_ids>", "<property_id>": "<value_ids>"}`
},
};
https://stackoverflow.com/questions/60627516
复制相似问题