# 淘宝店铺授权


接口地址: http://www.damaijia168.com/vv/external/getShopAuthorize


请求方式: POST


传参方式: JSON


返回格式: JSON


# 请求头参数

参数 类型 必选 示例
Authorization string 授权 access_token 1798c6aadec33d1bc2f5b707f1049aefexxxx

# 请求参数

参数 类型 必选 描述
shopId string 店铺 id
edition string 版本 默认:1(不传默认为1)
1:1.0,2:2.0

# 请求示例

{
  "shopId": "25*****61"
}

# 请求代码示例

cURL请求代码示例

curl --location --request POST 'http://www.damaijia168.com/vv/external/getShopAuthorize' \
--header 'Authorization: 1798c6aadec33d1bc2f5b707f1049aefexxxx' \
--header 'Cookie: __yjs_duid=1_dee3bfba5b90592372d209eda95c772a1616035269331' \
--form 'shopId="2*******1"'

PHP请求代码示例

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'http://www.damaijia168.com/vv/external/getShopAuthorize',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('shopId' => '2*******1'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: 1798c6aadec33d1bc2f5b707f1049aefexxxx',
    'Cookie: __yjs_duid=1_dee3bfba5b90592372d209eda95c772a1616035269331'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JAVA请求代码示例

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("shopId","2*******1")
  .build();
Request request = new Request.Builder()
  .url("http://www.damaijia168.com/vv/external/getShopAuthorize")
  .method("POST", body)
  .addHeader("Authorization", "1798c6aadec33d1bc2f5b707f1049aefexxxx")
  .addHeader("Cookie", "__yjs_duid=1_dee3bfba5b90592372d209eda95c772a1616035269331")
  .build();
Response response = client.newCall(request).execute();

Python请求代码示例

import requests
import json

url = "http://www.damaijia168.com/vv/external/getShopAuthorize"

payload = json.dumps({
  "shopId": "5********8"
})
headers = {
  'Authorization': 'd964d7b9c4365a538d9b12661f748977',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

# 响应参数

参数 类型 描述
data object 返回数据
---status string 授权状态(unAuthorize 未授权,subAuthorize 已授权)
----deduct_money int 消耗点券
status int 状态码,0为成功

# 返回数据

{
  "data": {
      "status":"subAuthorize",
        "deduct_money": 4
    },
  "status": 0
}

# 错误码

状态码(status) 错误信息 解决方案
132 请求格式必须为JSON 修改请求参数格式为json
422 参数列表不合法,在err中会给出提示 根据提示做相应修改
200 认证失败 请确保请求头里的Authorization存在或者未过期
422 参数:trade_id:P07 无效,格式不对、非法值、越界等 1. 在调用订单获取数据的时候,需要提前判断交易是否已经发货,对于没有发货的订单不要去取物流信
2011 店铺未授权 使用已授权店铺
2010 未知错误 请联系客服 联系客服