检索指定订单的所有配送订单

问题描述 投票:0回答:1

我想在 NestJS 应用程序中使用 Rest api 获取订单的所有履行订单,如下所示:

async getFulfillmentOrders(orderId: string) {
    const res = await this.shopify.rest.FulfillmentOrder.all({
      session: this.getSession(),
      order_id: orderId,
    });

    return res?.fulfillment_orders;
  }

响应包含一个对象,该对象具有一个名为 data 的字段,该字段具有空数组值,并且具有 headers 字段。 当我使用 /fulfillment_orders.json 将订单的 url 粘贴到路线中时,它会返回预期的履行订单。但是调用rest api会返回提到的数据。

当我访问以下网址时,它会给出响应: https://.shopify.com/store//orders/orderId/fulfillment_orders.json

所有密钥和与 Shopify 连接的所有其他内容均已设置,没有任何问题。 我使用@shopify/shopify-api包来调用shopify Rest api

shopify shopify-app shopify-api shopify-api-node
1个回答
0
投票

在与上述问题作斗争之后。为了获取fulfillmentOrders,我们应该将“write_merchant_driven_fulfillment_orders”和“read_merchant_driven_fulfillment_orders”添加到api的范围中。

© www.soinside.com 2019 - 2024. All rights reserved.