【问题标题】:What is input.customer in Shopify-api-node?Shopify-api-node 中的 input.customer 是什么?
【发布时间】:2018-09-19 06:09:48
【问题描述】:

我正在使用 MONEI/Shopify-api-node 在 Shopify 中创建应用程序。我已经完成了创建客户Shopify-api-node/test/customer.test.js我只想要创建客户的格式参数的测试用例。当用户使用电子邮件和联系电话注册时,我希望在我的商店管理员处使用电子邮件和号码创建客户。我只想格式参数如Format of params for webhook.create

如果有人曾经创建过客户,请将所需的参数放在这里。 另外请检查我的代码是否是创建客户的正确方法,谢谢。

const createCustomer = function(shopDomain, accessToken, customer) {
  const shopName=shopDomain.replace('.myshopify.com','');
  const shopify = new ShopifyAPIClient({ shopName: shopName, accessToken: accessToken });

shopify.customer.create(customer).then(
   response => console.log(`customer ${customer.url}  created`),
   err => console.log(`Error creating customer ${customer.url} ${JSON.stringify(err.response.body)}`)
);

}

函数调用

afterAuth(request, response) {
    const { session: { accessToken, shop } } = request;

      createCustomer(shop,accessToken,{
        topic: 'admin/customers',
        address: `${SHOPIFY_APP_HOST}/admin/customers`,
      });

    return response.redirect('/');
  }

【问题讨论】:

    标签: node.js api shopify shopify-app


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-02
      • 2021-08-15
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多