如何使用 BigCommerce API 使用核心 PHP 更新客户的 customer_group_id? [英] How do I use the BigCommerce API to update a customer's customer_group_id using core PHP?

查看:21
本文介绍了如何使用 BigCommerce API 使用核心 PHP 更新客户的 customer_group_id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的 BigCommerce 站点编写一个 PHP 脚本,该脚本每晚运行并根据特定条件将客户置于特定的客户组中.除了实际更新 customer_group_id 之外,我可以做任何我需要的other.BigCommerce 文档 仅显示可供客户使用的 GET 方法.请帮忙.谢谢!

I'm trying to write a PHP script for my BigCommerce site that runs nightly and places customers into specific Customer Groups based on certain criteria. I can do everything else I need other than actually update the the customer_group_id. BigCommerce documentation only shows GET methods available for customers. Please help. Thanks!

推荐答案

可以更新客户的客户组 ID.这可能已经存在一年或更长时间了.您可以 PUT 到客户资源,customer_group_id 就是您想要更改的内容.

记录在这里:https://developer.bigcommerce.com/api/objects/v2/customer

如果您使用的是 PHP API 库,那么您可以使用以下代码更新客户的客户组 ID:

The customer group ID on a customer can be updated. This has been around for maybe a year or more now. You can PUT to the customer resource and the customer_group_id is what you would want to change.

Documented here: https://developer.bigcommerce.com/api/objects/v2/customer

If you are using the PHP API Library then you could update a customer group ID on a customer with this kind of code:

$request_body = array("customer_group_id" => 10);
Bigcommerce:updateCustomer(50, $request_body);

以上代码会将 ID 为 50 的客户更新为新的客户组 ID 为 10.

The above would update the customer with ID 50 to have a new customer group ID of 10.

这篇关于如何使用 BigCommerce API 使用核心 PHP 更新客户的 customer_group_id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆