HTTP 方式调用有赞云接口(仅支持 POST 方式请求)

说明:

有赞云新网关仅支持 POST 方式请求接口

测试流程(以 postman 测试为例)

1. 工具型(无容器)获取 token

image.png

1)请求地址

https://open.youzanyun.com/auth/token

2)请求内容

{

    "authorize_type": "authorization_code",
    "client_id": "db9fe36d892719e921",
    "client_secret": "be58f76bbd80ee4af32c4f4655d20xxx",
    "code": "请填写您获取的code"
}  

3)响应参数

{
    "success": true,
    "code": 200,
    "data": {
        "expires": 1557551911243,
        "scope": "multi_store shop item trade logistics coupon_advanced user pay_qrcode trade_virtual reviews item_category storage retail_goods ",
        "access_token": "6351ae2368e7696bc216d9e8c446xxxx",
        "authority_id": "42833070",
        "refresh_token": "4183a2493280ab4c05c22b071bd5xxxx"
    },
    "message": null
}

2. 获取店铺信息

1)请求地址

image.png

https://open.youzanyun.com/api/youzan.shop.get/3.0.0?access_token=6351ae2368e7696bc216d9e8c446xxxx

2)请求参数

无需传值

3)响应参数

{
    "code": 200,
    "data": {
        "intro": "",
        "name": "yz测试-Od8Au190416",
        "logo": "https://img.yzcdn.cn/public_files/2016/05/13/8f9c442de8666f82abaf7dd71574e997.png",
        "id": 42833070
    },
    "success": true,
    "message": "successful"
}

3. 获取订单详情

1)请求地址

image.png

https://open.youzanyun.com/api/youzan.trade.get/4.0.0?access_token=6351ae2368e7696bc216d9e8c446xxxx

2)请求参数

{
	"tid":"E20190429104532080300037"
}

3)响应参数

{
    "code": 200,
    "data": {
        "order_promotion": {
            "order_discount_fee": null,
            "adjust_fee": "0.00",
            "item_discount_fee": null,
            "item": [],
            "order": []
        },
        "full_order_info": {
            "remark_info": {
                "buyer_message": "",
                "star": null,
                "trade_memo": null
            },
            "address_info": {
                "self_fetch_info": "",
                "delivery_address": "翠苑街道黄龙万科中心",
                "delivery_start_time": null,
                "delivery_end_time": null,
                "delivery_postal_code": "",
                "receiver_name": "导演",
                "delivery_province": "浙江省",
                "delivery_city": "杭州市",
                "delivery_district": "西湖区",
                "address_extra": "{\"areaCode\":\"330106\",\"lon\":120.13278497474886,\"lat\":30.281091071274545}",
                "receiver_tel": "1373589xxxx"
            },
            "pay_info": {
                "outer_transactions": [
                    "190429104535262199"
                ],
                "post_fee": "0.00",
                "total_fee": "0.01",
                "payment": "0.01",
                "transaction": [
                    "190429104535262199"
                ],
                "phase_payments": []
            },
            "buyer_info": {
                "outer_user_id": "oHIuujmVb-Rl-jrGsrSqSNPTAP-A",
                "buyer_phone": "1373589xxxx",
                "fans_type": 9,
                "buyer_id": 8651159xx,
                "fans_nickname": "导演-有赞",
                "fans_id": 33036565xx
            },
            "orders": [
                {
                    "is_cross_border": "null",
                    "outer_item_id": "",
                    "item_type": 0,
                    "discount_price": "0.01",
                    "num": 1,
                    "oid": "1513699470856439379",
                    "title": "测试消息推送1分钱",
                    "fenxiao_payment": "0.00",
                    "buyer_messages": "",
                    "is_present": false,
                    "cross_border_trade_mode": "null",
                    "price": "0.01",
                    "sub_order_no": "null",
                    "total_fee": "0.01",
                    "fenxiao_price": "0.00",
                    "alias": "2g1jdhilqnf5q",
                    "payment": "0.01",
                    "is_pre_sale": "null",
                    "outer_sku_id": "",
                    "sku_unique_code": "",
                    "goods_url": "https://h5.youzan.com/v2/showcase/goods?alias=2g1jdhilqnf5q",
                    "customs_code": "null",
                    "item_id": 464377811,
                    "sku_id": 0,
                    "sku_properties_name": "[]",
                    "pic_path": "http://img.yzcdn.cn/upload_files/2019/04/29/FoyaFm_nYNhl1VcmvZy4c-9FJJAf.jpg",
                    "pre_sale_type": "null",
                    "points_price": "0"
                }
            ],
            "source_info": {
                "is_offline_order": false,
                "book_key": "a054c400-e9f3-40d8-a8cf-1170dad224a9",
                "biz_source": "null",
                "source": {
                    "platform": "wx",
                    "wx_entrance": "direct_buy"
                },
                "order_mark": null
            },
            "order_info": {
                "consign_time": "",
                "order_extra": {
                    "tm_cash": null,
                    "t_cash": null,
                    "fx_inner_transaction_no": null,
                    "invoice_title": null,
                    "buyer_name": "导演-有赞",
                    "cashier_name": null,
                    "kdt_dimension_combine_id": null,
                    "fx_order_no": null,
                    "cash": null,
                    "create_device_id": null,
                    "promotion_combine_id": null,
                    "is_from_cart": "false",
                    "cashier_id": null,
                    "fx_kdt_id": null,
                    "orders_combine_id": null,
                    "id_card_name": null,
                    "is_member": "false",
                    "is_sub_order": null,
                    "is_points_order": "0",
                    "settle_time": null,
                    "fx_outer_transaction_no": null,
                    "is_parent_order": null,
                    "id_card_number": null,
                    "dept_id": null,
                    "parent_order_no": null,
                    "purchase_order_no": null
                },
                "created": "2019-04-29 10:45:32",
                "offline_id": null,
                "status_str": "待发货",
                "expired_time": "2019-04-29 11:45:32",
                "success_time": "",
                "type": 0,
                "tid": "E20190429104532080300037",
                "confirm_time": "",
                "pay_time": "2019-04-29 10:45:35",
                "update_time": "2019-04-29 10:45:36",
                "is_retail_order": false,
                "pay_type_str": "ECARD",
                "pay_type": 28,
                "team_type": 0,
                "refund_state": 0,
                "close_type": 0,
                "status": "WAIT_SELLER_SEND_GOODS",
                "express_type": 0,
                "order_tags": {
                    "is_virtual": null,
                    "is_purchase_order": null,
                    "is_member": null,
                    "is_preorder": null,
                    "is_offline_order": null,
                    "is_multi_store": null,
                    "is_settle": null,
                    "is_payed": true,
                    "is_secured_transactions": true,
                    "is_postage_free": null,
                    "is_down_payment_pre": null,
                    "is_fenxiao_order": null,
                    "is_feedback": null,
                    "is_refund": null
                }
            },
            "child_info": {
                "child_orders": []
            }
        },
        "delivery_order": [],
        "refund_order": []
    },
    "success": true,
    "message": "successful"
}

如果您对新网关 POST 方式测试流程有疑问欢迎在本帖下方追问