Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Api 如何创建具有地址和获取状态消息的Bigcommerce客户_Api_Bigcommerce - Fatal编程技术网

Api 如何创建具有地址和获取状态消息的Bigcommerce客户

Api 如何创建具有地址和获取状态消息的Bigcommerce客户,api,bigcommerce,Api,Bigcommerce,我正在尝试创建具有配送地址的新客户,然后希望他们重定向到显示“谢谢”或“错误”消息的页面。我使用了: $createFields = array( 'first_name'=>$first_name, 'last_name'=>$last_name, 'email'=>$email, 'company'=>$company, 'phone'=>$phone,

我正在尝试创建具有配送地址的新客户,然后希望他们重定向到显示“谢谢”或“错误”消息的页面。我使用了:

$createFields = array( 'first_name'=>$first_name, 'last_name'=>$last_name, 'email'=>$email, 'company'=>$company, 'phone'=>$phone, 'addresses'=>array( 'first_name'=>$first_name, 'last_name'=>$last_name, 'phone'=>$phone, 'street_1'=>$street_1, 'city'=>'', 'state'=>'', 'zip'=>'', 'country'=>'' ) ); $customers = Bigcommerce::createCustomer($createFields); $createFields=array( “first\u name”=>$first\u name, “姓氏”=>$last\u name, “email”=>$email, “公司”=>$company, 'phone'=>$phone, '地址'=>数组( “first\u name”=>$first\u name, “姓氏”=>$last\u name, 'phone'=>$phone, “street_1”=>$street_1, “城市”=>“, '状态'=>'', 'zip'=>'', “国家”=>“ ) ); $customers=Bigcommerce::createCustomer($createFields); 创建客户,但根本不起作用。一旦我删除“地址”字段,就会创建新客户

有人能帮我告诉我如何添加客户地址吗?另外,我如何检查客户是否已正确创建? 客户可能尝试重新注册自己-系统应显示错误“电子邮件已存在”

我是新的BigCommerceAPI-任何帮助将不胜感激


感谢

在Bigcommerce类Client.php中,您可以找到一个名为createCustomerAddress的方法。您只需将要添加的客户id和地址传递给它。 例如:

$address = array(
   'country'=>'United States',
   'first_name'=>'First',
   'last_name'=>'Last',
   'street_1'=>'5543 Ave34',
   'city'=>'Miami',
   'state'=>'Florida',
   'zip'=>'54023',
   'phone'=>'783 000 0000'
);
Bigcommerce::createCustomerAddress($customer_id, $address);