繁体   English   中英

与其他资源(产品,订单等)不同,Shopify API客户的排序不正确

[英]Shopify API Customer sort incorrectly unlike other resources(Product, Order, etc)

我正在使用Shopify API构建shopify应用,但遇到了麻烦。

当我使用'/admin/customers.json'发出GET请求时,与其他资源(产品,订单等)不同,Shopify API响应的结果排序不正确

我做了一些截图以使事情变得清晰。

在此处输入图片说明

在此处输入图片说明

不是order_by Updated_at desc

订单和产品都响应了正确的收款结果(“ updated_at desc”),但客户没有。

是bug还是我错过了什么?

我认为您需要对参数进行编码。 Shopify文档为了清晰起见没有显示编码的参数,但是您需要:

'?fields='+encodeURIComponent('id,updated_at')+
'&updated_at_min='+encodeURIComponent('2015-11-25 20:01:00')+
'&order='+ encodeURIComponent('updated_at DESC');

您可以在客户上使用搜索端点。

/admin/customers/search.json
/admin/customers/search.json?order=updated_at DESC&fields=id

与客户在同一API页面上查看文档,再下一层

https://docs.shopify.com/api/customer

搜索时,请使用“ sorty_by”属性: https ://shopify.github.io/js-buy-sdk/api/classes/ShopClient.html#method-fetchQueryCollections

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM