沃尔玛的文档写的太好了,简单易懂,甩亚马逊几条街
文档地址:Authentication – Marketplace – US – API Doc – Walmart Developer Portal
step:1 得到access_token
$header=array( 'Authorization:Basic '.base64_encode($ClientId.':'.$ClientSecret), 'WM_QOS.CORRELATION_ID:'.$this->getCORRELATION_ID(),//随机生成的 'WM_SVC.NAME:marketplace', //'GMP_GATEWAY_API:Token API', 'content-type:application/x-www-form-urlencoded', 'Accept: application/json', ); $url="https://marketplace.walmartapis.com/v3/token?grant_type=client_credentials"; $result=$this->curlPost($url,$params,$header);//返回access_token
public function curlPost($url,$data,$HEADER){ $ch = curl_init(); curl_setopt($ch, CU