pub struct JDClient<T: SessionStore> { /* private fields */ }

Implementations

JDClient

Example

async fn main() {
    use labrador::JDClient;
let client = JDClient::new("appKey", "secret");
    // Do Some Thing You Want
    // ...
}
Available on crate feature jd only.
Available on crate feature jd only.
Available on crate feature jd only.

京粉精选商品查询

京东联盟精选优质商品,每日更新,可通过频道ID查询各个频道下的精选商品。 用获取的优惠券链接调用转链接口时,需传入搜索接口link字段返回的原始优惠券链接 切勿对链接进行任何encode、decode操作,否则将导致转链二合一推广链接时校验失败。

示例
 
    use labrador::JDClient;
    use labrador::{JdJFGoodsParam};
 
    async fn main() {
        let param = JdJFGoodsParam {
        elite_id: 22,
        page_index: 1.into(),
        page_size: 1.into(),
        sort_name: None,
        sort: None,
        pid: "1001969763_4100247890_3003271490".to_owned().into(),
        fields: None,
        forbid_types: None,
    };
        let client = JDClient::new("appKey", "secret");
        match client.get_jf_select(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Available on crate feature jd only.

根据skuid查询商品信息

通过SKUID查询推广商品的名称、主图、类目、价格、物流、是否自营、30天引单数量等详细信息,支持批量获取。 通常用于在媒体侧展示商品详情。

示例
 
    use labrador::JDClient;
    use labrador::{JdGoodsInfoQueryRequest};
 
    async fn main() {
        let param = JdGoodsInfoQueryRequest {
            sku_ids: "60566006897".to_string().into(),
        };
        let client = JDClient::new("appKey", "secret");
        match client.get_goods_detail(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Available on crate feature jd only.

网站/APP获取推广链接接口

网站/APP来获取的推广链接,功能同宙斯接口的自定义链接转换、 APP领取代码接口通过商品链接、活动链接获取普通推广链接 支持传入subunionid参数,可用于区分媒体自身的用户ID,该参数可在订单查询接口返回,需向cps-qxsq@jd.com申请权限。

示例

    use labrador::JDClient;
    use labrador::{JdPromotionUrlGenerateParam};

    async fn main() {
        let param = JdPromotionUrlGenerateParam {
            material_id: "".to_owned(),
            site_id: "".to_owned(),
            position_id: None,
            sub_union_id: None,
            ext1: None,
            pid: None,
            coupon_url: None,
            gift_coupon_key: None,
        };
        let client = JDClient::new("appKey", "secret");
        match client.generate_promotion_url(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
👎 Deprecated
Available on crate feature jd only.

订单查询

查询推广订单及佣金信息,可查询最近90天内下单的订单,会随着订单状态变化同步更新数据。支持按下单时间、完成时间或更新时间查询。建议按更新时间每分钟调用一次,查询最近一分钟的订单更新数据。 支持查询subunionid、推广位、PID参数,支持普通推客及工具商推客订单查询。 该接口即将下线,请使用订单行查询接口https://union.jd.com/openplatform/api/12707

示例

    use labrador::JDClient;
    use labrador::{JdOrderRecentQueryParam};

    async fn main() {
        let param = JdOrderRecentQueryParam {
            page_no: 1.into(),
            page_size: 1.into(),
            bill_type: 1,
            time: "".to_owned(),
            child_union_id: None,
            key: None,
        };
        let client = JDClient::new("appKey", "secret");
        match client.query_recent_order(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
Available on crate feature jd only.

订单行查询

查询推广订单及佣金信息,可查询最近90天内下单的订单,会随着订单状态变化同步更新数据。 支持按下单时间、完成时间或更新时间查询。建议按更新时间每分钟调用一次,查询最近一分钟的订单更新数据。 支持查询subunionid、推广位、PID参数,支持普通推客及工具商推客订单查询。

如需要通过SDK调用此接口,请接入JOS SDK

示例

    use labrador::JDClient;
    use labrador::{JdOrderRawQueryParam};

    async fn main() {
        let param = JdOrderRawQueryParam {
            page_index: 1.into(),
            page_size: 1.into(),
            bill_type: 1,
            start_time: "".to_string(),
            end_time: "".to_string(),
            child_union_id: None,
            key: None,
            fields: None,
        };
        let client = JDClient::new("appKey", "secret");
        match client.query_raw_order(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more