首页 > 解决方案 > "body":"[API] 此操作需要商家批准 read_customers 范围。"

问题描述

我是 Shopify 开发的新手,在尝试让客户使用代码时遇到该错误:

$id = '5207879811243';
    $shop = Auth::user();
    $request = $shop->api()->rest('GET', '/admin/api/customers/search.json', ['customers' => "id:{$id}"]);
    return $request;

标签: phplaravelshopify

解决方案


在进行任何 API 调用之前,您必须执行以下操作:

  • 对于私有应用程序,请确保您已勾选 read_customers范围
  • 对于公共应用程序,请确保您的 oAuth 范围包括read_customers范围

Shopify 提供的大量文档向您展示了 App Scopes。


推荐阅读