【问题标题】:Using the Rest API, get all Woocommerce orders for the current day使用 Rest API,获取当天所有 Woocommerce 订单
【发布时间】:2022-01-08 03:23:07
【问题描述】:

我正在使用 Woocommerce Rest API 通过以下方式获取订单:

https://example.com/wp-json/wc/v3/orders?consumer_key=ck_xxx&consumer_secret=cs_xxx

如何获取当天已完成订单?

【问题讨论】:

    标签: woocommerce wordpress-rest-api


    【解决方案1】:

    根据documentation,您可以将“before”、“after”和“status”等GET参数添加到检索订单GET端点。
    我会把这些结合起来,看看你会得到什么回应。
    我目前无法测试,但我假设对于 2021-12-01 的已完成订单,您的 URL 将如下所示:

    https://example.com/wp-json/wc/v3/orders?consumer_key=ck_xxx&consumer_secret=cs_xxx&status=completed&after=2021-11-30&before=2021-12-02

    【讨论】:

      猜你喜欢
      • 2021-07-31
      • 2017-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多