1. Home
  2. /
  3. mformula電子カタログ
  4. /
  5. API
  6. /
  7. 顧客
  8. /
  9. APIを介して顧客を追加する方法は?

APIを介して顧客を追加する方法は?

投稿:http://www.namedoseusite.com.br/api_customers.php?action=add_customers

パラメーター フォーマット 説明
customers_firstname json

customers firstName
テキストのみが必要です
フォーマット:varchar(32)
*フィールドが必要< /p>

customers_lastname json customers lastname
テキストのみが必要です
形式:varchar(32)
* field < /td>
customers_email_address json メールアドレス
例:name@site.com.br
フォーマット:varchar(96)
* field < /td>
customers_password json パスワード
最小:8文字
フォーマット:varchar(40)
*必須< /td>
customers_telephone json 電話
例:(11)3230-6255
フォーマット:varchar(32)
* field execly < /td>
customers_telephone_commercial json コマーシャル電話
例:(11)3230-6255
フォーマット:varchar(32)< /td>
customers_telephone_mobile json 電話モバイル
例:(11)3230-6255
フォーマット:varchar(32)< /td>
skype json skype name
形式:varchar(32)< /td>
msn json msn name
形式:varchar(32)< /td>
customers_fax json fax電話
例:(11)3230-6255
フォーマット:varchar(32)< /td>
customers_newsletter json 1をyesまたは0からno
のみを使用します
形式:int(1)
* field < /td>を使用します< /td>
customers_groups_id json APIをチェックして顧客グループのリストを取得します
番号のみが必要です
形式:int(11)
*必須< /td>
customers_language json

英語、スペイン語、日本、またはポルトガル語
*必要< /p>

customers_gender json mまたはf
*フィールドが必要< /td>
customers_dob json dd/mm/yyyy
*必要
entry_street_address json Streetアドレス
フォーマット:varchar(64)
*フィールドが必要< /td>
entry_number json number Streetアドレス
番号のみが必要です
*フィールドが必要< /td>
entry_completion json 完成通りの住所
entry_suburb json 郊外
entry_postcode json post Code
番号のみが必要です
*必要< /td>
entry_city json city
テキストのみが必要です
*必須< /td>
entry_state json APIをチェックして状態のリストを取得
*必要なフィールド< /td>
entry_country_id json APIをチェックして国のリストを取得
番号のみが必要です
*フィールドが必要< /td>
entry_rg json rg
entry_cpf json cpf
entry_company json 会社名
entry_cnpj json cnpj
entry_ie json ie
person_kind json pjまたはpf
フォーマット:varchar(2)
* field execly < /td>

phpサンプル

//サンプル追加顧客を追加

$ url = $ tabain_url。 &#39; /api_customers.php?action = add_customers&#39 ;;

$ data = array( “customs_firstname” =&gt; “customers firstName”、// customers firstName *フィールドが必須
「customs_lastname」=&gt; 「LastName Customers」、//顧客LastName *フィールドが必要
「customers_email_address」=&gt; 「email@mformula.com.br」、//電子メールアドレス *フィールドが必須
「customers_password」=&gt; 「テスト」、//パスワード *フィールドが必要です
「customers_telephone」=&gt; “(11)3230-6255″、//電話例:(11)3230-6255 *フィールドが必要
“customers_telephone_commercial” =&gt; “(11)3230-6255″、//コマーシャル電話例:(11)3230-6255
“customers_telephone_mobile” =&gt; “(11)3230-6255″、//電話モバイル例:(11)3230-6255
「Skype」=&gt; “”、 // スカイプネーム
「msn」=&gt; “”、// msn
「customers_fax」=&gt; “”、//ファックス電話の例:(11)3230-6255
「customers_newsletter」=&gt; “1”、// 1を使用してはいまたは0から(数のみが必要です) *フィールドが必要です
“customers_groups_id” =&gt; “”、// APIをチェックして、顧客グループのリストを取得します
「customers_language」=&gt; 「ポルトガル語」、//英語、スペイン語、日本、ポルトガル語 *フィールドが必要
「customers_gender」=&gt; 「M」、// mまたはf *フィールドが必要
「customers_dob」=&gt; “01/02/1980″、// dd/mm/yyyy *フィールドが必要
“entry_street_address” =&gt; 「av paulista」、//通りの住所 *フィールドが必要
「entry_number」=&gt; 「1500」、//番号通りアドレス *フィールドが必要
“entry_completion” =&gt; “”、//完成通りの住所
“entry_suburb” =&gt; 「庭」、//郊外
“entry_postcode” =&gt; 「04206000」、//投稿コード
“entry_city” =&gt; 「サンパウロ」、//都市 *フィールドが必要
“entry_state” =&gt; 「Sao Paulo」、// APIをチェックして、必要な状態 *フィールドのリストを取得する
“entry_country_id” =&gt; 「30」、// APIをチェックして国のリストを取得します
“entry_rg” =&gt; “”、// rg
“entry_cpf” =&gt; “28240621856”、// cpf
「entry_company」=&gt; “”、 // 会社名
“entry_cnpj” =&gt; “”、// cnpj
“entry_ie” =&gt; “”、// ie
“person_kind” =&gt; 「PF」// PJまたはPF *フィールドが必要
);

$ data_string = json_encode($ date);

$ ch = curl_init($ url);
curl_setopt($ ch、curlopt_customrequest、 “post”);
curl_setopt($ ch、curlopt_postfields、$ data_string);
curl_setopt($ ch、curlopt_returntransfer、true);
curl_setopt($ ch、curlopt_ssl_verifypeer、false);
curl_setopt($ ch、curlopt_httpheader、array(
&#39; content-type:application/json&#39;、
「キャッシュコントロール:キャッシュなし」、
&#39; usuario1:&#39; 。 base64_encode($ usuario1)、
&#39; Password1:&#39; 。 base64_encode($ password1)、
&#39;コンテンツレングス:&#39; 。 strlen($ data_string)))
);

$ result = curl_exec($ ch);
curl_close($ ch);

print_r($ result);

//サンプル顧客EOF を追加します

戻りエラー:

code
メッセージ< /p>

戻り成功:

code
id
メッセージ< /p>

コメントを残す 0