How do I use the BigCommerce API to update a customer's customer_group_id using core PHP?

南笙酒味 提交于 2019-12-11 03:07:13

问题


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!


回答1:


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);

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




回答2:


I currently work at Bigcommerce. Unfortunately at this time, our API doesn't support the ability to update customer group ids. However, you are encouraged to add this as a feature request to our Ideas site. http://ideas.bigcommerce.com/.

For your convenience, I have also included a link to our Dev portal, which includes the full API documentation as well as how-tos/tools and a new @Mashery powered API playground. http://developer.bigcommerce.com/



来源:https://stackoverflow.com/questions/14420502/how-do-i-use-the-bigcommerce-api-to-update-a-customers-customer-group-id-using

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!