type AE_API_NAMES = DS_API_NAMES | AFFILIATE_API_NAMES | SYSTEM_API_NAMES;
type DS_API_NAMES = "aliexpress.logistics.buyer.freight.get" | "aliexpress.logistics.buyer.freight.calculate" | "aliexpress.logistics.ds.trackinginfo.query" | "aliexpress.ds.add.info" | "aliexpress.ds.image.search" | "aliexpress.ds.recommend.feed.get" | "aliexpress.ds.order.create" | "aliexpress.trade.ds.order.get" | "aliexpress.ds.feedname.get" | "aliexpress.ds.category.get" | "aliexpress.ds.commissionorder.listbyindex" | "aliexpress.ds.member.orderdata.submit" | "aliexpress.ds.product.get";
type AFFILIATE_API_NAMES = "aliexpress.affiliate.link.generate" | "aliexpress.affiliate.category.get" | "aliexpress.affiliate.featuredpromo.get" | "aliexpress.affiliate.featuredpromo.products.get" | "aliexpress.affiliate.hotproduct.download" | "aliexpress.affiliate.hotproduct.query" | "aliexpress.affiliate.order.get" | "aliexpress.affiliate.order.list" | "aliexpress.affiliate.order.listbyindex" | "aliexpress.affiliate.productdetail.get" | "aliexpress.affiliate.product.query" | "aliexpress.affiliate.product.smartmatch";
type SYSTEM_API_NAMES = "/auth/token/security/create" | "/auth/token/create" | "/auth/token/security/refresh" | "/auth/token/refresh";
/**
 * Public parameters
 * @description Public parameters need to be set for every Aliexpress API
 * @param {String} method Indicates the API name.
 * @param {String | undefined} app_key Indicates the AppKey allocated by the TOP to an application. An ISV can choose Open Platform Console > Application Management > Overview to check the AppKey and AppSecret of the formal environment.
 * @param {String} session Indicates the authorization granted by the TOP to an application after a user logs in and grants authorization successfully.
 * @param {String} timestamp Indicates the time stamp in the format of yyyy-MM-dd HH:mm:ss and in the time zone of GMT+8. For example, 2016-01-01 12:00:00. The Taobao API server allows a maximum time error of 10 minutes for a request from a client.
 * @param {Boolean} simplify Indicates whether the simplified JSON return format is used. This parameter is valid only if format is set to json. The default value is false.
 * @param {String} sign_method Indicates the signature digest algorithm. The value can be set to hmac or md5.
 * @param {String} sign Indicates the obtained signature of API input parameters.
 */
interface PublicParams {
    app_key: string;
    session: string;
    timestamp: number;
    sign_method: "hmac" | "md5" | "sha256";
    method: AE_API_NAMES;
    sign?: string;
    simplify?: boolean;
}
interface AE_Base_Client {
    /**
     * @param {String} app_key Indicates the AppKey allocated by Open.Aliexpress to an application. An ISV can choose Open Platform Console > Application Management > Overview to check the AppKey and AppSecret of the formal environment.
     * @link https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=732
     */
    app_key: string;
    /**
     * @param {String} app_key Indicates the AppSecret allocated by Open.Aliexpress to an application. An ISV can choose Open Platform Console > Application Management > Overview to check the AppKey and AppSecret of the formal environment.
     * @link https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=732
     */
    app_secret: string;
    /**
     * @param {String} session Indicates the authorization granted by the TOP to an application after a user logs in and grants authorization successfully.
     * @link https://open.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=730
     */
    session: string;
}
type AliexpressMethod<T extends AE_API_NAMES> = T extends "/auth/token/security/create" ? {
    method: T;
    params: AES_Generate_Security_Token_Params;
    result: AES_Generate_Security_Token_Result;
} : T extends "/auth/token/create" ? {
    method: T;
    params: AES_Generate_Token_Params;
    result: AES_Generate_Token_Result;
} : T extends "/auth/token/security/refresh" ? {
    method: T;
    params: AES_Refresh_Security_Token_Params;
    result: AES_Refresh_Security_Token_Result;
} : T extends "/auth/token/refresh" ? {
    method: "/auth/token/refresh";
    params: AES_Refresh_Token_Params;
    result: AES_Refresh_Token_Result;
} : T extends "aliexpress.logistics.buyer.freight.get" ? {
    method: T;
    params: DS_Freight_Calculation_Params;
    result: DS_Freight_Calculation_Result;
} : T extends "aliexpress.logistics.buyer.freight.calculate" ? {
    method: T;
    params: DS_Shipping_Info_Params;
    result: DS_Shipping_Info_Result;
} : T extends "aliexpress.logistics.ds.trackinginfo.query" ? {
    method: T;
    params: DS_Tracking_Info_Params;
    result: DS_Tracking_Info_Result;
} : T extends "aliexpress.ds.add.info" ? {
    method: T;
    params: DS_Add_Info_Params;
    result: DS_Add_Info_Result;
} : T extends "aliexpress.ds.image.search" ? {
    method: T;
    params: DS_Image_Search_Params;
    result: DS_Image_Search_Result;
} : T extends "aliexpress.ds.recommend.feed.get" ? {
    method: T;
    params: DS_Recommended_Products_Params;
    result: DS_Recommended_Products_Result;
} : T extends "aliexpress.ds.order.create" ? {
    method: T;
    params: DS_Place_Order_Params;
    result: DS_Place_Order_Result;
} : T extends "aliexpress.trade.ds.order.get" ? {
    method: T;
    params: DS_Get_Order_Params;
    result: DS_Get_Order_Result;
} : T extends "aliexpress.ds.feedname.get" ? {
    method: T;
    params: DS_Feedname_Params;
    result: DS_Feedname_Result;
} : T extends "aliexpress.ds.category.get" ? {
    method: T;
    params: Affiliate_Categories_Params;
    result: DS_Categories_Result;
} : T extends "aliexpress.ds.commissionorder.listbyindex" ? {
    method: T;
    params: DS_Orders_ByIdx_Params;
    result: DS_Orders_ByIdx_Result;
} : T extends "aliexpress.ds.member.orderdata.submit" ? {
    method: T;
    params: DS_Order_Submit_Params;
    result: DS_Order_Submit_Result;
} : T extends "aliexpress.ds.product.get" ? {
    method: T;
    params: DS_Product_Params;
    result: DS_Product_Result;
} : T extends "aliexpress.affiliate.link.generate" ? {
    method: T;
    params: Affiliate_Generate_Affiliate_Links_Params;
    result: Affiliate_Generate_Affiliate_Links_Result;
} : T extends "aliexpress.affiliate.category.get" ? {
    method: T;
    params: Affiliate_Categories_Params;
    result: Affiliate_Categories_Result;
} : T extends "aliexpress.affiliate.featuredpromo.get" ? {
    method: T;
    params: Affiliate_Featuredpromo_Info_Params;
    result: Affiliate_Featuredpromo_Info_Result;
} : T extends "aliexpress.affiliate.featuredpromo.products.get" ? {
    method: T;
    params: Affiliate_Featured_Promo_Products_Params;
    result: Affiliate_Featured_Promo_Products_Result;
} : T extends "aliexpress.affiliate.hotproduct.download" ? {
    method: T;
    params: Affiliate_Hotproducts_Download_Params;
    result: Affiliate_Hotproducts_Download_Result;
} : T extends "aliexpress.affiliate.hotproduct.query" ? {
    method: T;
    params: Affiliate_Hotproducts_Params;
    result: Affiliate_Hotproducts_Result;
} : T extends "aliexpress.affiliate.order.get" ? {
    method: T;
    params: Affiliate_Order_Info_Params;
    result: Affiliate_Order_Info_Result;
} : T extends "aliexpress.affiliate.order.list" ? {
    method: T;
    params: Affiliate_Order_List_Params;
    result: Affiliate_Order_List_Result;
} : T extends "aliexpress.affiliate.order.listbyindex" ? {
    method: T;
    params: Affiliate_Order_List_ByIdx_Params;
    result: Affiliate_Order_List_ByIdx_Result;
} : T extends "aliexpress.affiliate.productdetail.get" ? {
    method: T;
    params: Affiliate_Product_Details_Params;
    result: Affiliate_Product_Details_Result;
} : T extends "aliexpress.affiliate.product.query" ? {
    method: T;
    params: Affiliate_Products_Params;
    result: Affiliate_Products_Result;
} : T extends "aliexpress.affiliate.product.smartmatch" ? {
    method: T;
    params: Affiliate_Smart_Match_Products_Params;
    result: Affiliate_Smart_Match_Products_Result;
} : {
    method: T;
    params: Record<string, string | number | boolean>;
    result: unknown;
};
type AE_Platform_Type = "TMALL" | "ALL" | "PLAZA";
type AE_Language = "EN" | "RU" | "PT" | "ES" | "FR" | "ID" | "IT" | "TH" | "JA" | "AR" | "VI" | "TR" | "DE" | "HE" | "KO" | "NL" | "PL" | "MX" | "CL" | "IW" | "IN";
type AE_Currency = "USD" | "GBP" | "CAD" | "EUR" | "CNY" | "UAH" | "MXN" | "TRY" | "RUB" | "BRL" | "AUD" | "INR" | "JPY" | "IDR" | "SEK" | "KRW";
type AE_Locale_Site = "global" | "it_site" | "es_site" | "ru_site";
type AE_Sort_Filter = "SALE_PRICE_ASC" | "SALE_PRICE_DESC" | "LAST_VOLUME_ASC" | "LAST_VOLUME_DESC";
type AE_Sort_Promo_Filter = "commissionAsc" | "commissionDesc" | "priceAsc" | "priceDesc" | "volumeAsc" | "volumeDesc" | "discountAsc" | "discountDesc" | "ratingAsc" | "ratingDesc" | "promotionTimeAsc" | "promotionTimeDesc";
type AE_Order_Status = "PLACE_ORDER_SUCCESS" | "WAIT_BUYER_ACCEPT_GOODS" | "FUND_PROCESSING" | "FINISH";
type AE_Logistics_Status = "NO_LOGISTICS" | "WAIT_SELLER_SEND_GOODS" | "SELLER_SEND_GOODS" | "BUYER_ACCEPT_GOODS";
type YES_NO = "Y" | "N";

/**
 * AFFILIATE API
 * PRODUCT DETAILS
 */
interface Affiliate_Product_Promo_Code_Info {
    promo_code?: string;
    code_campaigntype?: string;
    code_value?: string;
    code_availabletime_start?: string;
    code_availabletime_end?: string;
    code_mini_spend?: string;
    code_quantity?: string;
    code_promotionurl?: string;
}
interface Affiliate_Base_Product_Params {
    app_signature?: string;
    /** Respond parameter list. eg: commission_rate,sale_price */
    fields?: string;
    target_currency?: AE_Currency;
    target_language?: AE_Language;
    tracking_id?: string;
}
interface Affiliate_Base_Product_Details {
    app_sale_price?: string;
    app_sale_price_currency?: AE_Currency;
    commission_rate?: string;
    discount?: string;
    evaluate_rate?: string;
    first_level_category_id?: number;
    first_level_category_name?: string;
    hot_product_commission_rate?: string;
    lastest_volume?: number;
    original_price?: string;
    original_price_currency?: AE_Currency;
    platform_product_type?: AE_Platform_Type;
    product_detail_url?: string;
    product_id?: number;
    product_main_image_url?: string;
    product_small_image_urls?: string[];
    product_title?: string;
    product_video_url?: string;
    promotion_link?: string;
    promo_code_info?: Affiliate_Product_Promo_Code_Info;
    relevant_market_commission_rate?: string;
    sale_price: string;
    sale_price_currency: AE_Currency;
    second_level_category_id: number;
    second_level_category_name: string;
    shop_id: number;
    shop_url: string;
    target_app_sale_price: string;
    target_original_price: string;
    target_sale_price: string;
    target_original_price_currency: AE_Currency;
    target_sale_price_currency: AE_Currency;
    target_app_sale_price_currency: AE_Currency;
    ship_to_days?: string;
}
interface Affiliate_Base_Products_Cursor {
    products?: Affiliate_Base_Product_Details[];
    current_record_count?: number;
    current_page_no?: number;
    total_page_no?: number;
    total_record_count?: number;
    is_finished?: boolean;
}
interface Affiliate_Base_Products_Cursor_Response {
    resp_result: {
        result: Affiliate_Base_Products_Cursor;
        resp_code?: number;
        resp_msg?: string;
    };
}
/**
 * AFFILIATE API
 * PRODUCT DETAILS
 */
interface Affiliate_Product_Details_Params extends Affiliate_Base_Product_Params {
    product_ids: string;
    country?: string;
}
interface Affiliate_Product_Details_Result {
    aliexpress_affiliate_productdetail_get_response: Affiliate_Base_Products_Cursor_Response;
}
/**
 * AFFILIATE API
 * QUERY PRODUCTS
 */
interface Affiliate_Products_Params extends Affiliate_Base_Product_Params {
    /** List of category ID, you can get category ID via "get category" API https://developers.aliexpress.com/en/doc.htm?docId=45801&docType=2 */
    category_ids?: string;
    keywords?: string;
    /** Filter products by highest price, unit cent */
    max_sale_price?: string;
    /** Filter products by lowest price, unit cent */
    min_sale_price?: string;
    page_no?: string;
    /** record count of each page, 1 - 50 */
    page_size?: string;
    platform_product_type?: AE_Platform_Type;
    sort?: AE_Sort_Filter;
    /** Estimated delivery days. 3：in 3 days，5：in 5 days，7：in 7 days，10：in 10 days */
    delivery_days?: string;
    /** The Ship to country. Filter products that can be sent to that country; Returns the price according to the country’s tax rate policy. */
    ship_to_country?: string;
}
interface Affiliate_Products_Result {
    aliexpress_affiliate_product_query_response: Affiliate_Base_Products_Cursor_Response;
}
/**
 * AFFILIATE API
 * HOTPRODUCTS
 */
interface Affiliate_Hotproducts_Params extends Affiliate_Products_Params {
}
interface Affiliate_Hotproducts_Result {
    aliexpress_affiliate_hotproduct_query_response: Affiliate_Base_Products_Cursor_Response;
}
/**
 * AFFILIATE API
 * FEATURED PROMO PRODUCTS
 */
interface Affiliate_Featured_Promo_Products_Params extends Affiliate_Base_Product_Params {
    category_id?: string;
    page_no?: string;
    page_size?: string;
    promotion_end_time?: string;
    promotion_name?: string;
    promotion_start_time?: string;
    sort?: AE_Sort_Promo_Filter;
    country?: string;
}
interface Affiliate_Featured_Promo_Products_Result {
    aliexpress_affiliate_featuredpromo_products_get_response: Affiliate_Base_Products_Cursor_Response;
}
/**
 * AFFILIATE API
 * GET HOTPRODUCT DOWNLOAD
 */
interface Affiliate_Hotproducts_Download_Params {
    /** API signature */
    app_signature?: string;
    /** Category ID, you can get category ID via "get category" API https://developers.aliexpress.com/en/doc.htm?docId=45801&docType=2 */
    category_id: string;
    /** Respond parameter list. eg: commission_rate,sale_price */
    fields?: string;
    /** Local site：global, it_site, es_site, ru_site */
    locale_site?: AE_Locale_Site;
    page_no?: number;
    page_size?: number;
    /** Target Currency:USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW,ILS,THB,CLP,VND */
    target_currency?: AE_Currency;
    /** Target Language:EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN */
    target_language?: AE_Language;
    /** Your trackingID */
    tracking_id?: string;
    /**  The Ship to country. Filter products that can be sent to that country; Returns the price according to the country’s tax rate policy.*/
    country?: string;
}
interface Affiliate_Hotproducts_Download_Result {
    aliexpress_affiliate_hotproduct_download_response: Affiliate_Base_Products_Cursor_Response;
}
/**
 * AFFILIATE API
 * SMART MATCH PRODUCTS
 */
interface Affiliate_Smart_Match_Products_Params {
    /** App information */
    app?: string;
    /** API signature */
    app_signature?: string;
    /** Device infomation */
    device?: string;
    /** adid or idfa, for more information please refer to https://support.google.com/admanager/answer/6238701 Can be null, if it is null, it can be recommended based on keywords or product ID */
    device_id: string;
    /** Respond parameter list, eg: commission_rate,sale_price */
    fields?: string;
    /** Recommend products by keywords. eg: mp3 */
    keywords?: string;
    /** Request page number */
    page_no?: number;
    /** Product ID, matching related products product ID */
    product_id?: string;
    /** site information */
    site?: string;
    /** Target Currency: USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW,ILS,THB,CLP,VND */
    target_currency?: AE_Currency;
    /** Target Languages: EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN */
    target_language?: AE_Language;
    tracking_id?: string;
    /** user id */
    user?: string;
    /** The Ship to country. Filter products that can be sent to that country; Returns the price according to the country’s tax rate policy. */
    country?: string;
}
interface Affiliate_Smart_Match_Products_Result {
    aliexpress_affiliate_product_smartmatch_response: Affiliate_Base_Products_Cursor_Response;
}
/**
 * AFFILIATE API
 * GENERATE AFFILIATE LINKS
 */
interface Affiliate_Generate_Affiliate_Links_Params {
    /** Promotion link type: 0 for normal link which has standard commission , and 2 for hot link which has hot product commission */
    promotion_link_type: number;
    source_values: string;
    tracking_id: string;
    app_signature?: string;
}
interface Affiliate_Promo_Link {
    promotion_link: string;
    source_value: string;
}
interface Affiliate_Generate_Affiliate_Links {
    total_result_count: number;
    tracking_id: string;
    promotion_links: Affiliate_Promo_Link[];
}
interface Affiliate_Generate_Affiliate_Links_Result {
    aliexpress_affiliate_link_generate_response: {
        resp_result: {
            resp_code?: number;
            resp_msg?: string;
            result: Affiliate_Generate_Affiliate_Links;
        };
    };
}
/**
 * AFFILIATE API
 * CATEGORIES
 */
interface Affiliate_Categories_Params {
    app_signature?: string;
}
interface Affiliate_Category_Details {
    category_id: number;
    category_name: string;
    parent_category_id: number;
}
interface Affiliate_Categories {
    categories: Affiliate_Category_Details[];
    total_result_count: number;
}
interface Affiliate_Categories_Result {
    aliexpress_affiliate_category_get_response: {
        resp_result: {
            resp_code: number;
            resp_msg: string;
            result: Affiliate_Categories;
        };
    };
}
/**
 * AFFILIATE API
 * FEATURED PROMO INFO
 */
interface Affiliate_Featuredpromo_Info_Params extends Affiliate_Categories_Params {
}
interface Affiliate_Featuredpromo_Details {
    promo_desc: string;
    promo_name: string;
    product_num: number;
}
interface Affiliate_Featuredpromo_Info {
    current_record_count: number;
    promos: Affiliate_Featuredpromo_Details[];
}
interface Affiliate_Featuredpromo_Info_Response {
    resp_code?: number;
    resp_msg?: string;
    result: Affiliate_Featuredpromo_Info;
}
interface Affiliate_Featuredpromo_Info_Result {
    aliexpress_affiliate_featuredpromo_get_response: {
        resp_result: Affiliate_Featuredpromo_Info_Response;
    };
}
/**
 * AFFILIATE API
 * GET ORDER INFO
 */
interface Affiliate_Order_Info_Params {
    app_signature?: string;
    fields?: string;
    order_ids?: string;
}
interface Affiliate_Order_Details {
    estimated_finished_commission: number;
    product_detail_url: string;
    estimated_paid_commission: number;
    product_count: number;
    order_number: number;
    is_hot_product: YES_NO;
    parent_order_number: number;
    product_main_image_url: string;
    order_status: string;
    settled_currency: AE_Currency;
    category_id: number;
    product_id: number;
    order_type: string;
    tracking_id: string;
    created_time: string;
    finished_time: string;
    completed_settlement_time: string;
    paid_time: string;
    customer_parameters: string;
    is_new_buyer: YES_NO;
    ship_to_country: string;
    sub_order_id: number;
    product_title: string;
    incentive_commission_rate: string;
    new_buyer_bonus_commission: number;
    estimated_incentive_paid_commission: number;
    is_affiliate_product: YES_NO;
    paid_amount: number;
    effect_detail_status: string;
    estimated_incentive_finished_commission: number;
    commission_rate: string;
    finished_amount: number;
    order_id: number;
}
interface Affiliate_Order_Info {
    current_record_count: number;
    orders: Affiliate_Order_Details[];
}
interface Affiliate_Order_Info_Result {
    aliexpress_affiliate_order_get_response: {
        resp_result: {
            result: Affiliate_Order_Info;
            resp_code?: number;
            resp_msg?: string;
        };
    };
}
/**
 * AFFILIATE API
 * GET ORDER LIST
 */
interface Affiliate_Order_List_Params {
    /** The type of time you are querying: Payment Completed Time(The time of payment for the order), Buyer Confirmed Receipt Time(The time when the buyer confirms receipt) Completed Settlement Time(The time when commission is paid into Account Balance) */
    time_type?: string;
    /** API signature */
    app_signature?: string;
    /** End time, PST time */
    end_time: string;
    /** Respond parameter list. eg: commission_rate,sale_price */
    fields?: string;
    locale_site?: AE_Locale_Site;
    page_no?: number;
    page_size?: number;
    /** Start time, PST time */
    start_time: string;
    /** Order status: Payment Completed(Buyer paid successfully), Buyer Confirmed Receipt(This status only change when:Buyer confirms receipt and settlement task begins which is manually executed by our operation team), Completed Settlement(Orders have been verified and commission has been paid), Invalid(Orders will not be settled including buyer refunds, order risks, antispam/penalty appeal failed, antispam/penalty appeal overdue, order not settled being over 180 days apart from the Completed Payment Time (such as in abnormal state like dispute), etc.) */
    status: string;
}
interface Affiliate_Order_List {
    total_page_no: number;
    total_record_count: number;
    current_page_no: number;
    current_record_count: number;
    orders: Affiliate_Order_Details[];
}
interface Affiliate_Order_List_Result {
    aliexpress_affiliate_order_list_response: {
        resp_result: {
            result: Affiliate_Order_List;
            resp_code?: number;
            resp_msg?: string;
        };
    };
}
/**
 * AFFILIATE API
 * GET ORDER LIST BY INDEX
 */
interface Affiliate_Order_List_ByIdx_Params {
    /** The type of time you are querying: Payment Completed Time(The time of payment for the order), Buyer Confirmed Receipt Time(The time when the buyer confirms receipt) Completed Settlement Time(The time when commission is paid into Account Balance) */
    time_type?: string;
    /** API signature */
    app_signature?: string;
    /** End time, PST time */
    end_time: string;
    /** Respond parameter list. eg: commission_rate,sale_price */
    fields?: string;
    page_size?: number;
    /** Start time, PST time */
    start_time: string;
    /** Order status: Payment Completed(Buyer paid successfully), Buyer Confirmed Receipt(This status only change when:Buyer confirms receipt and settlement task begins which is manually executed by our operation team), Completed Settlement(Orders have been verified and commission has been paid), Invalid(Orders will not be settled including buyer refunds, order risks, antispam/penalty appeal failed, antispam/penalty appeal overdue, order not settled being over 180 days apart from the Completed Payment Time (such as in abnormal state like dispute), etc.) */
    status: string;
    /** Query index start value: if not passed, You can only check the first page */
    start_query_index_id?: string;
}
interface Affiliate_Order_List_ByIdx {
    min_query_index_id: string;
    max_query_index_id: string;
    current_record_count: number;
    orders: Affiliate_Order_Details[];
}
interface Affiliate_Order_List_ByIdx_Result {
    aliexpress_affiliate_order_listbyindex_response: {
        resp_result: {
            result: Affiliate_Order_List_ByIdx;
            resp_code?: number;
            resp_msg?: string;
        };
    };
}

/**
 *
 * DROPSHIPPER API
 * RECOMMENDED PRODUCTS
 *
 */
interface DS_Recommended_Products_Params {
    country?: string;
    /**
     * @description target currency:USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY,
     */
    target_currency?: AE_Currency;
    /**
     * @description target language:EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN
     */
    target_language?: AE_Language;
    /**
     * @description record count of each page, 1 - 50
     */
    page_size?: string;
    page_no?: string;
    sort?: AE_Sort_Promo_Filter;
    category_id?: string;
    feed_name: string;
}
interface DS_Recommended_Products_Result {
    aliexpress_ds_recommend_feed_get_response: Affiliate_Base_Products_Cursor_Response;
}
/**
 * DROPSHIPPER API
 * FEEDNAMES
 */
interface DS_Feedname_Params extends Affiliate_Categories_Params {
}
interface DS_Feedname_Result {
    aliexpress_ds_feedname_get_response: Affiliate_Featuredpromo_Info_Response;
}
/**
 * DROPSHIPPER API
 * IMAGE SEARCH
 */
interface DS_Image_Search_Params {
    /** @description EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IW,IN */
    target_language?: AE_Language;
    /** @description USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW */
    target_currency?: AE_Currency;
    /** @description count of products， max 150. */
    product_cnt?: number;
    /** @description SALE_PRICE_ASC, SALE_PRICE_DESC, LAST_VOLUME_ASC, LAST_VOLUME_DESC */
    sort?: AE_Sort_Filter;
    /** @description Ship to Country */
    shpt_to?: string;
    /** @description image name in fileserver，max size 100 KB */
    image_file_bytes: string;
}
interface DS_Image_Search_Result {
    aliexpress_ds_image_search_response: {
        data: Affiliate_Base_Products_Cursor;
        rsp_code: string;
        rsp_msg: string;
    };
}
/**
 * DROPSHIPPER API
 * DROPSHIPPER PRODUCT DETAILS
 */
interface DS_Product_Params {
    product_id: number;
    ship_to_country?: string;
    target_currency?: AE_Currency;
    target_language?: AE_Language;
}
interface DS_Product_Base_Info {
    product_id: number;
    category_id: number;
    subject: string;
    currency_code: AE_Currency;
    product_status_type: string;
    ws_display: string;
    ws_offline_date: string;
    gmt_create: string;
    gmt_modified: string;
    owner_member_seq_long: number;
    evaluation_count: string;
    avg_evaluation_rating: string;
    detail: string;
    mobile_detail: string;
}
interface DS_Product_Shipping_Info {
    delivery_time: number;
    ship_to_country: string;
}
interface DS_Product_Package_Info {
    package_type: boolean;
    package_length: number;
    package_height: number;
    package_width: number;
    gross_weight: string;
    base_unit?: number;
    product_unit?: number;
}
interface DS_Product_Store_Info {
    store_id: number;
    store_name: string;
    item_as_described_rating: string;
    communication_rating: string;
    shipping_speed_rating: string;
}
interface DS_Product_Id_Converter {
    main_product_id: number;
    sub_product_id: string;
}
interface DS_Product_Multimedia_Videos {
    ali_member_id: number;
    media_id: number;
    media_status: string;
    media_type: string;
    poster_url: string;
}
interface DS_Product_Multimedia {
    ae_video_dtos: DS_Product_Multimedia_Videos[];
    image_urls: string;
}
interface DS_Product_SKU_Variation {
    sku_stock: boolean;
    sku_price: string;
    sku_code: string;
    ipm_sku_stock: number;
    id: string;
    currency_code: AE_Currency;
    aeop_s_k_u_propertys: DS_Product_SKU_Properties[];
    barcode: string;
    offer_sale_price: string;
    offer_bulk_sale_price: string;
    sku_bulk_order: number;
    sku_available_stock?: number;
    s_k_u_available_stock?: number;
}
interface DS_Product_SKU_Properties {
    sku_property_id: number;
    sku_property_value: string;
    sku_property_name: string;
    property_value_id: number;
    property_value_id_long: number;
    property_value_definition_name?: string;
    sku_image?: string;
}
interface DS_Product_Attributes {
    attr_name_id: number;
    attr_name: string;
    attr_value_id: number;
    attr_value: string;
    attr_value_unit?: string;
    attr_value_start?: string;
    attr_value_end?: string;
}
interface DS_Product {
    ae_item_sku_info_dtos: DS_Product_SKU_Variation[];
    ae_item_properties: DS_Product_Attributes[];
    ae_item_base_info_dto: DS_Product_Base_Info;
    ae_multimedia_info_dto: DS_Product_Multimedia;
    package_info_dto: DS_Product_Package_Info;
    logistics_info_dto: DS_Product_Shipping_Info;
    ae_store_info: DS_Product_Store_Info;
    product_id_converter_result: DS_Product_Id_Converter;
}
interface DS_Product_Result {
    aliexpress_ds_product_get_response: {
        result: DS_Product;
        rsp_msg: string;
        rsp_code: string;
    };
}
/**
 *
 * ORDER API
 * NEW ORDER
 *
 */
/**
 * Place order params
 * @link https://developers.aliexpress.com/en/doc.htm?docId=35446&docType=2
 *
 */
interface DS_Place_Order_Params {
    ds_extend_request?: string;
    /**
     * logistics_address
     * @description Logistics address information
     * @param {String} address Address information
     * @param {String} address2 Address extension information
     * @param {String} city
     * @param {String} contact_person 	Contact
     * @param {String} country
     * @param {String} cpf taxpayer identification number
     * @param {String} full_name Receiver's full name
     * @param {String} locale internationalization locale
     * @param {String} mobile_no telephone number
     * @param {String} passport_no passport number
     * @param {String} passport_no_date passport expiry date
     * @param {String} passport_organization passport issuing agency
     * @param {String} phone_country Country code where the phone is located
     * @param {String} province
     * @param {String} tax_number
     * @param {String} zip 	Postal code
     * @param {String} foreigner_passport_no foreign tax number (registration card number or passport number is required for Korean foreigners)
     * @param {String} is_foreigner whether it is a foreigner
     * @param {String} vat_no vat tax number
     * @param {String} tax_company company name
     * @param {String} location_tree_address_idlocation tree address id
     *
     * product_items
     * @description Product attribute
     * @param {Number} product_count Number of Products
     * @param {Number} product_id Product id
     * @param {String} sku_attr Product sku
     * @param {String} logistics_service_name   Logistics service name
     * @param {String} order_memo   User Comments
     *
     * JSON.stringify the whole thing
     */
    param_place_order_request4_open_api_d_t_o: string;
}
interface AE_Product_Item {
    logistics_service_name?: string;
    order_memo?: string;
    product_count: number;
    product_id: number;
    sku_attr?: string;
}
interface AE_Place_Order_Payment_Params {
    promotion?: {
        promotion_code?: string;
        promotion_channel_info: string;
    };
    payment?: {
        pay_currency?: AE_Currency;
        try_to_pay?: "true" | "false";
    };
    trade_extra_param?: {
        business_model?: "retail" | "wholesale";
    };
}
interface AE_Logistics_Address {
    address: string;
    address2?: string;
    city?: string;
    contact_person?: string;
    country?: string;
    cpf?: string;
    full_name?: string;
    locale?: string;
    mobile_no?: string;
    passport_no?: string;
    passport_no_date?: string;
    passport_organization?: string;
    phone_country?: string;
    province?: string;
    zip?: string;
    tax_number?: string;
    foreigner_passport_no?: string;
    is_foreigner?: string;
    vat_no?: string;
    tax_company?: string;
    location_tree_address_idlocation?: string;
}
type DS_Place_Order_Error_Message = "B_DROPSHIPPER_DELIVERY_ADDRESS_VALIDATE_FAIL" | "BLACKLIST_BUYER_IN_LIST" | "USER_ACCOUNT_DISABLED" | "PRICE_PAY_CURRENCY_ERROR" | "DELIVERY_METHOD_NOT_EXIST" | "INVENTORY_HOLD_ERROR" | "REPEATED_ORDER_ERROR" | "ERROR_WHEN_BUILD_FOR_PLACE_ORDER" | "A001_ORDER_CANNOT_BE_PLACED" | "A002_INVALID_ZONE" | "A003_SUSPICIOUS_BUYER" | "A004_CANNOT_USER_COUPON" | "A005_INVALID_COUNTRIES" | "A006_INVALID_ACCOUNT_INFO";
interface DS_Place_Order_Result {
    aliexpress_trade_buy_placeorder_response: {
        result: {
            error_code: DS_Place_Order_Error_Message;
            error_msg?: string;
            is_success: false;
        } | {
            order_list: number[];
            is_success: true;
        };
    };
}
/**
 *
 * ORDER API
 * GET ORDER
 *
 */
interface DS_Get_Order_Params {
    order_id: number;
}
interface DS_Price {
    amount: string;
    currency_code: AE_Currency;
}
interface DS_Product_Info {
    product_id: number;
    product_price: DS_Price;
    product_name: string;
    product_count: number;
}
interface DS_Logistics_Info {
    logistics_no: string;
    logistics_service: string;
}
interface DS_Store_Info {
    store_id: number;
    store_name: string;
    store_url: string;
}
interface DS_Get_Order {
    gmt_create: string;
    order_status: AE_Order_Status;
    logistics_status: AE_Logistics_Status;
    order_amount: DS_Price;
    child_order_list: DS_Product_Info[];
    logistics_info_list: DS_Logistics_Info[];
    store_info: DS_Store_Info;
}
interface DS_Get_Order_Result {
    aliexpress_trade_ds_order_get_response: {
        result: DS_Get_Order;
        rsp_msg: string;
        rsp_code: string;
    };
}
/**
 * DROPSHIPPER API - ORDER
 * ORDER QUERY BY INDEX
 */
interface DS_Orders_ByIdx_Params {
    /** End time, PST time */
    end_time: string;
    /** Start time, PST time */
    start_time: string;
    /** Order status: Payment Completed(Buyer paid successfully), Buyer Confirmed Receipt(This status only change when:Buyer confirms receipt and settlement task begins which is manually executed by our operation team), Completed Settlement(Orders have been verified and commission has been paid), Invalid(Orders will not be settled including buyer refunds, order risks, antispam/penalty appeal failed, antispam/penalty appeal overdue, order not settled being over 180 days apart from the Completed Payment Time (such as in abnormal state like dispute), etc.) */
    status: string;
    /** Query index start value: if not passed, You can only check the first page */
    start_query_index_id?: string;
    page_size?: number;
    page_no?: number;
}
interface DS_Orders_ByIdx_Order_Details {
    publisher_id: number;
    estimated_finished_commission: string;
    estimated_paid_commission: number;
    order_number: number;
    is_hot_product: YES_NO;
    parent_order_number: number;
    publisher_settled_currency: AE_Currency;
    category_id: number;
    item_title: string;
    item_detail_url: string;
    item_main_image_url: string;
    item_count: number;
    created_time: string;
    finished_time: string;
    item_id: number;
    paid_time: string;
    is_new_buyer: YES_NO;
    ship_to_country: string;
    sub_order_id: number;
    effect_status: string;
    incentive_commission_rate: string;
    estimated_incentive_paid_commission: string;
    is_affiliate_product: YES_NO;
    paid_amount: number;
    effect_detail_status: string;
    estimated_incentive_finished_commission: string;
    commission_rate: string;
    finished_amount: string;
    order_id: number;
}
interface DS_Orders_ByIdx {
    current_record_count: number;
    min_query_index_id: string;
    max_query_index_id: string;
    orders: DS_Orders_ByIdx_Order_Details[];
    current_page_no: number;
}
interface DS_Orders_ByIdx_Result {
    aliexpress_ds_commissionorder_listbyindex_response: {
        result: DS_Orders_ByIdx;
        rsp_code: number;
        rsp_msg: string;
    };
}
/**
 * DROPSHIPPING API
 * ORDER SUBMIT
 */
interface DS_Order_Submit_Params {
    /** AE product ID */
    ae_product_id: string;
    /** Off-site payment time, GMT time, format YYYYMMDD:HHMMSS */
    paytime: string;
    /** AE order id */
    ae_orderid: string;
    /** SKU sales amount outside the station, to 2 decimal places */
    product_amount: string;
    /** Order sales amount outside the station, keep 2 decimal places */
    order_amount: string;
    /** AE product SKU information, SKU key-value pair: "200000182:193;200007763:201336100" */
    ae_sku_info: string;
    /** Commodity site url */
    product_url: string;
}
interface DS_Order_Submit_Result {
    aliexpress_ds_member_orderdata_submit_response: {
        result: boolean;
        rsp_msg: string;
        rsp_code: number;
    };
}
/**
 * DROPSHIPPING API
 * ADD DROPSHIPPING INFO
 */
interface DS_Add_Info_Arguments {
    /** Extended Information */
    extend_info?: Record<string, string | number | boolean>;
    /** shop address */
    store_url?: string;
    /** user signature */
    app_signature?: string;
}
interface DS_Add_Info_Params {
    param0: string;
}
interface DS_Add_Info_Result {
    aliexpress_ds_add_info_response: {
        result: boolean;
        result_msg: string;
        result_code: number;
    };
}
/**
 *
 * SHIPPING API
 * SHIPPING INFO
 *
 */
interface DS_Shipping_Info_Arguments {
    sku_id?: string;
    city_code?: string;
    country_code: string;
    product_id: number;
    product_num: number;
    province_code?: string;
    send_goods_country_code: string;
    price?: string;
    price_currency?: AE_Currency;
}
interface DS_Shipping_Info_Params {
    /**
     * Get the support logistics info of a product, provide for dropshipping develeopers.
     *
     * @param {String} product_id Product ID
     * @param {String} city_code City code
     * @param {String} country_code National code
     * @param {String} product_num Number of Products
     * @param {String} province_code Province code
     * @param {String} send_goods_country_code Shipping country code
     * @param {String} price price
     * @param {String} price_currency Commodity price currency
     *
     * Apply JSON.stringify to pass params
     */
    param_aeop_freight_calculate_for_buyer_d_t_o: string;
}
interface DS_Freight_Info {
    amount: number;
    cent: number;
    currency_code: AE_Currency;
}
interface DS_Shipping_Details {
    error_code: number;
    estimated_delivery_time: string;
    freight: DS_Freight_Info;
    service_name: string;
    tracking_available: "true" | "false";
}
type DS_Shipping_Info_Response = {
    success: true;
    aeop_freight_calculate_result_for_buyer_d_t_o_list: DS_Shipping_Details[];
} | {
    success: false;
    error_desc: string;
};
interface DS_Shipping_Info_Result {
    aliexpress_logistics_buyer_freight_calculate_response: {
        result: DS_Shipping_Info_Response;
    };
}
/**
 *
 * SHIPPING API
 * TRACKING INFO
 *
 */
/**
 * Dropshipper query logistics tracking information
 *
 * @param {String} logistics_no Logistics tracking number
 * @param {String} origin Order origin to be queried. The origin of the AE order is “ESCROW”.
 * @param {String} out_ref 	Order ID to be queried by the user
 * @param {String} service_name Logistics service KEY
 * @param {String} to_area Countries for receiving goods, DZ
 */
interface DS_Tracking_Info_Params {
    logistics_no: string;
    origin: string;
    out_ref: string;
    service_name: string;
    to_area: string;
}
interface DS_Tracking_Event {
    event_desc: string;
    signed_name: string;
    status: string;
    address: string;
    event_date: string;
}
type DS_Tracking_Info_Response = {
    result_success: true;
    details: DS_Tracking_Event[];
    official_website: string;
} | {
    result_success: false;
    error_desc: string;
};
interface DS_Tracking_Info_Result {
    aliexpress_logistics_ds_trackinginfo_query_response: DS_Tracking_Info_Response;
}
/**
 * DROPSHIPPER API
 * FREIGHT CALCULATION
 */
interface DS_Freight_Calculation_Arguments {
    product_id: number;
    product_num: number;
    sku_id: string;
    country_code: string;
    province_code?: string;
    city_code?: string;
    send_goods_country_code?: string;
    price?: string;
    price_currency?: AE_Currency;
}
interface DS_Freight_Calculation_Params {
    aeopFreightCalculateForBuyerDTO: string;
}
interface DS_Freight_Calculation_Info {
    cent: string;
    currency: Record<string, string>;
    currency_code: AE_Currency;
}
interface DS_Freight_Calculation {
    shipping_method: string;
    service_name: string;
    estimated_delivery_time: string;
    freight: DS_Freight_Calculation_Info;
    tracking_available: "true" | "false";
}
type DS_Freight_Calculation_Response = {
    aeop_freight_calculate_result_for_buyer_dtolist: DS_Freight_Calculation[];
    success: true;
} | {
    success: false;
    error_desc: string;
};
interface DS_Freight_Calculation_Result {
    aliexpress_logistics_buyer_freight_get_response: {
        result: DS_Freight_Calculation_Response;
        request_id: string;
    };
}
/**
 * DROPSHIPPER API
 * CATEGORIES
 */
interface DS_Categories_Result {
    aliexpress_ds_category_get_response: {
        resp_result: {
            resp_code: number;
            resp_msg: string;
            result: Affiliate_Categories;
        };
    };
}

interface AES_Base_Access_Token_Result {
    account_id: string;
    seller_id: string;
    user_id: string;
    sp: string;
    access_token: string;
    refresh_token: string;
    expires_in: number;
    expire_time: number;
    refresh_token_valid_time: number;
    refresh_expires_in: number;
    locale: string;
}
interface AES_Access_Token_Result extends AES_Base_Access_Token_Result {
    havana_id: string;
    user_nick: string;
    account: string;
    account_platform: string;
}
/**
 * SYSTEM SERVICES
 * GENERATE SECURITY TOKEN
 */
interface AES_Generate_Security_Token_Params {
    code: string;
    uuid?: string;
}
interface AES_Generate_Security_Token_Result extends AES_Base_Access_Token_Result {
}
/**
 * SYSTEM SERVICES
 * GENERATE ACCESS TOKEN
 */
interface AES_Generate_Token_Params extends AES_Generate_Security_Token_Params {
}
interface AES_Generate_Token_Result extends AES_Access_Token_Result {
}
/**
 * SYSTEM SERVICES
 * REFRESH SECURITY TOKEN
 */
interface AES_Refresh_Security_Token_Params extends AES_Refresh_Token_Params {
}
interface AES_Refresh_Security_Token_Result extends AES_Access_Token_Result {
}
/**
 * SYSTEM SERVICES
 * REFRESH ACCESS TOKEN
 */
interface AES_Refresh_Token_Params {
    refresh_token: string;
}
interface AES_Refresh_Token_Result extends AES_Access_Token_Result {
}

/**
 * Represents the result of an asynchronous operation that can either succeed or fail.
 * @template T The type of data returned on success
 */
type Result<T> = Promise<SuccessResult<T> | ErrorResult>;
/**
 * Represents a successful operation result
 * @template T The type of data returned
 */
type SuccessResult<T> = {
    /** Indicates the operation was successful */
    ok: true;
    /** The successful operation's returned data */
    data: T;
};
/**
 * Represents a failed operation result
 */
type ErrorResult = {
    /** Indicates the operation failed */
    ok: false;
    /** Human-readable error message */
    message: string;
    /** Unique identifier for the request, useful for debugging */
    request_id?: string;
    /** Detailed API error response, if available */
    error_response?: ErrorResponse;
    /** JavaScript Error object, if available */
    error?: Error;
};
type ErrorType = 'ISV' | 'SYSTEM' | 'ISP';
interface ErrorResponse {
    /**
     * Represents the type of error that occurred from AliExpress Open Platform
     * - SYSTEM: API platform error
     * - ISV: Business data error
     * - ISP: Backend service error
     * @see {@link https://openservice.aliexpress.com/doc/doc.htm?nodeId=27493&docId=118729#/?docId=1372 AliExpress Error Codes Documentation}
     */
    type?: ErrorType;
    code?: string;
    sub_code?: string;
    msg?: string;
    sub_msg?: string;
    request_id?: string;
    [key: string]: string | undefined;
}

/**
 * Base client for AliExpress API interactions.
 *
 * This class provides the core functionality for authenticating, signing, and sending
 * requests to AliExpress API endpoints. It handles the complexities of the AliExpress
 * authentication protocol, including request signing, parameter formatting, and
 * response parsing.
 *
 * The class supports both older "TOP" API endpoints and newer "OP" API routes,
 * automatically determining the correct URL format and parameter handling based on
 * the method name.
 */
declare class AEBaseClient implements AE_Base_Client {
    readonly app_key: string;
    readonly app_secret: string;
    readonly session: string;
    protected readonly format = "json";
    protected readonly migrated_apis_url = "https://api-sg.aliexpress.com/sync";
    protected readonly new_apis_url = "https://api-sg.aliexpress.com/rest";
    protected readonly sign_method = "sha256";
    constructor(init: AE_Base_Client);
    /**
     * Generates a signature for the API request based on AliExpress API requirements.
     *
     * Creates an HMAC signature using the app secret and a sorted concatenation of
     * all request parameters. The signature is used to authenticate the request
     * and verify the integrity of the parameters.
     *
     * Handles both TOP API and OP API signature formats, which differ slightly
     * in how the method parameter is handled.
     *
     * @param params - Request parameters to be signed
     * @returns The generated HMAC signature as an uppercase hexadecimal string
     */
    protected sign(params: any): string;
    /**
     * Constructs the complete URL for an API request with all parameters.
     *
     * Builds a properly formatted URL with query parameters for an AliExpress API request.
     * Handles the differences between TOP API and OP API URL formats automatically
     * based on the method name format.
     *
     * Parameters are sorted alphabetically and encoded properly for URL inclusion.
     *
     * @param params - Request parameters including the API method name
     * @returns A complete URL string ready for the API request
     */
    protected assemble<T extends PublicParams>(params: T): string;
    /**
     * Sends a request to the AliExpress API and processes the response.
     *
     * Makes an HTTP POST request to the AliExpress API using the assembled URL
     * and handles various error conditions including network errors, HTTP errors,
     * and JSON parsing errors. Provides a standardized response format for both
     * successful and failed requests.
     *
     * @param params - Complete set of parameters for the API request
     * @returns A Result object containing either the parsed response data or error information
     */
    protected call<T extends PublicParams, K>(params: T): Result<K>;
    /**
     * Executes a typed API method with the appropriate parameters.
     *
     * This method prepares and sends a strongly-typed request to the AliExpress API.
     * It automatically adds required authentication parameters, generates the signature,
     * and formats the request properly for the specified API method.
     *
     * The strong typing ensures that the correct parameter types are used for each API method
     * and that the response is correctly typed according to the expected result.
     *
     * @param method - The AliExpress API method name to execute
     * @param params - Method-specific parameters for the API call
     * @returns A Result object with the strongly-typed response data or error information
     */
    protected execute<K extends AE_API_NAMES>(method: K, params: AliexpressMethod<K>["params"]): Result<AliexpressMethod<K>["result"]>;
    /**
     * Executes an API call directly with a custom method name and parameters.
     *
     * This method allows for calling API endpoints that may not be covered by the
     * strongly-typed methods, or for experimental or newly released API methods.
     * It provides the same authentication, signing, and error handling but with
     * less type safety.
     *
     * This is useful for testing new APIs or handling edge cases without needing to
     * update the type definitions.
     *
     * @param method - The AliExpress API method name as a string
     * @param params - Custom parameters for the API call
     * @returns A Result object with the response data or error information
     */
    callAPIDirectly<TData extends Record<string, string | number | boolean>, TResponse>(method: string, params: TData): Result<TResponse>;
}

/**
 * Client for AliExpress System API operations.
 *
 * This client provides methods for token management and authentication with
 * the AliExpress API system. It extends the base client with specialized
 * methods for generating and refreshing access tokens, which are required
 * for authenticated access to other API endpoints.
 *
 * The client serves as a foundation for other specialized clients and can
 * be used directly for authentication operations.
 *
 * @extends AEBaseClient Base client with core API interaction capabilities
 */
declare class AESystemClient extends AEBaseClient {
    constructor(init: AE_Base_Client);
    /**
     * Generates a new security token for enhanced API security.
     *
     * Creates a security token that provides an additional layer of authentication
     * for sensitive API operations. Security tokens typically have stricter validation
     * and shorter expiration times compared to standard tokens.
     *
     * @param args - Parameters required for security token generation
     * @returns API response with the generated security token and related information
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/create&methodType=GET/POST
     */
    generateSecurityToken(args: AES_Generate_Security_Token_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: AES_Generate_Security_Token_Result;
    }>;
    /**
     * Generates a standard authentication token for API access.
     *
     * Creates a regular access token that can be used for most API operations.
     * This is typically the first step in establishing an authenticated session
     * with the AliExpress API system.
     *
     * @param args - Parameters required for token generation, including auth code
     * @returns API response with the generated token and related information like expiration time
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/create&methodType=GET/POST
     */
    generateToken(args: AES_Generate_Token_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: AES_Generate_Token_Result;
    }>;
    /**
     * Refreshes an existing security token before it expires.
     *
     * Updates a security token to extend its validity period without requiring
     * the user to go through the full authentication flow again. This should be
     * called before the current security token expires to maintain uninterrupted
     * access to secured API endpoints.
     *
     * @param args - Parameters required for security token refresh, including the refresh token
     * @returns API response with the refreshed security token and updated expiration information
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/security/refresh&methodType=GET/POST
     */
    refreshSecurityToken(args: AES_Refresh_Security_Token_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: AES_Refresh_Security_Token_Result;
    }>;
    /**
     * Refreshes a standard authentication token before it expires.
     *
     * Updates a regular access token to extend its validity period without requiring
     * the user to go through the full authentication flow again. This should be called
     * before the current token expires to maintain uninterrupted API access.
     *
     * Token refresh is an essential part of maintaining long-running applications
     * that interact with the AliExpress API.
     *
     * @param args - Parameters required for token refresh, including the refresh token
     * @returns API response with the refreshed token and updated expiration information
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=3&path=/auth/token/refresh&methodType=GET/POST
     */
    refreshToken(args: AES_Refresh_Token_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: AES_Refresh_Token_Result;
    }>;
}

/**
 * Client for interacting with AliExpress Affiliate API endpoints.
 *
 * This class provides methods to access AliExpress Affiliate API features including
 * product discovery, affiliate link generation, commission information,
 * and other affiliate marketing operations. It handles authentication and normalizes
 * API responses to provide consistent data structures.
 *
 * The Affiliate API is designed for affiliate marketers who promote AliExpress products
 * and earn commissions, rather than for dropshippers or direct sellers.
 *
 * @extends AESystemClient Base client with authentication and request execution capabilities
 */
declare class AffiliateClient extends AESystemClient {
    constructor(init: AE_Base_Client);
    /**
     * Generates affiliate tracking links for products
     *
     * Creates trackable affiliate links that can be used in marketing campaigns,
     * websites, or social media to earn commissions on referred sales.
     *
     * @param args Parameters including product IDs, tracking ID, and promotion types
     * @returns API response with generated affiliate links
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.link.generate&methodType=GET/POST
     */
    generateAffiliateLinks(args: Affiliate_Generate_Affiliate_Links_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Generate_Affiliate_Links_Result;
    }>;
    /**
     * Retrieves AliExpress category information for affiliate products
     *
     * Gets hierarchical category data that can be used for product browsing,
     * filtering, or creating category-specific affiliate campaigns.
     *
     * @param args Parameters for retrieving category information
     * @returns API response with category data
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.category.get&methodType=GET/POST
     */
    getCategories(args: Affiliate_Categories_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Categories_Result;
    }>;
    /**
     * Retrieves information about current featured promotions
     *
     * Gets details about ongoing promotional campaigns, sales events, and
     * special offers that affiliates can promote to earn higher commissions.
     *
     * @param args Parameters for filtering and pagination of promotion information
     * @returns API response with promotion details
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.featuredpromo.get&methodType=GET/POST
     */
    featuredPromoInfo(args: Affiliate_Featuredpromo_Info_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Featuredpromo_Info_Result;
    }>;
    /**
     * Retrieves products from a specific featured promotion
     *
     * Gets a list of products included in a particular promotional campaign or sale event,
     * which can be used to create targeted affiliate marketing campaigns.
     *
     * @param args Parameters for specifying the promotion and filtering products
     * @returns API response with products in the specified promotion
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.featuredpromo.products.get&methodType=GET/POST
     */
    featuredPromoProducts(args: Affiliate_Featured_Promo_Products_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Featured_Promo_Products_Result;
    }>;
    /**
     * Gets information about trending products for affiliate marketing
     *
     * @param args Parameters for filtering hot products by category, commission rate, etc.
     * @returns API response with hot product download information
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.hotproduct.download&methodType=GET/POST
     */
    getHotProductsDownload(args: Affiliate_Hotproducts_Download_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Hotproducts_Download_Result;
    }>;
    /**
     * Retrieves a list of trending products for affiliate marketing
     *
     * Gets products that are currently popular on AliExpress with high sales volume
     * and conversion rates, making them good candidates for affiliate promotion.
     *
     * @param args Parameters for filtering and pagination of hot products
     * @returns API response with list of hot products
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.hotproduct.query&methodType=GET/POST
     */
    getHotProducts(args: Affiliate_Products_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Hotproducts_Result;
    }>;
    /**
     * Retrieves detailed information about a specific affiliate order
     *
     * Gets comprehensive details about an order placed through an affiliate link,
     * including commission information, order status, and product details.
     *
     * @param args Parameters for order retrieval, including order ID
     * @returns API response with complete order details
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.order.get&methodType=GET/POST
     */
    orderInfo(args: Affiliate_Order_Info_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Order_Info_Result;
    }>;
    /**
     * Retrieves a list of affiliate orders based on specified criteria
     *
     * Gets information about multiple orders placed through affiliate links,
     * filtered by date range, status, or other parameters.
     *
     * @param args Parameters for filtering and pagination of orders
     * @returns API response with list of orders
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.order.list&methodType=GET/POST
     */
    ordersList(args: Affiliate_Order_List_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Order_List_Result;
    }>;
    /**
     * Retrieves a paginated list of affiliate orders by index
     *
     * Gets a paginated list of orders for easier navigation through large sets of order data,
     * using index-based pagination instead of time-based filtering.
     *
     * @param args Parameters for index-based pagination of orders
     * @returns API response with paginated list of orders
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.order.listbyindex&methodType=GET/POST
     */
    ordersListByIndex(args: Affiliate_Order_List_ByIdx_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Order_List_ByIdx_Result;
    }>;
    /**
     * Retrieves detailed information about a specific product for affiliate marketing
     *
     * Gets comprehensive product details including pricing, commission rates,
     * images, descriptions, and other information needed for effective affiliate promotion.
     *
     * @param args Parameters for product retrieval, including product ID
     * @returns API response with complete product details formatted for affiliate use
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.productdetail.get&methodType=GET/POST
     */
    productDetails(args: Affiliate_Product_Details_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Product_Details_Result;
    }>;
    /**
     * Searches for products available for affiliate promotion
     *
     * Searches the AliExpress catalog for products that can be promoted through
     * the affiliate program, with filtering by category, price, commission rate, etc.
     *
     * @param args Parameters for product search and filtering
     * @returns API response with product search results
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.product.query&methodType=GET/POST
     */
    queryProducts(args: Affiliate_Products_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Products_Result;
    }>;
    /**
     * Finds similar products that match given criteria
     *
     * Uses intelligent matching to find products similar to provided keywords, URLs,
     * or product IDs, which can be used to diversify affiliate product offerings.
     *
     * @param args Parameters for smart matching, including keywords or reference products
     * @returns API response with matched products
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21407&path=aliexpress.affiliate.product.smartmatch&methodType=GET/POST
     */
    smartMatchProducts(args: Affiliate_Smart_Match_Products_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: Affiliate_Smart_Match_Products_Result;
    }>;
}

/**
 * Client for interacting with AliExpress Dropshipping API endpoints.
 *
 * This class provides methods to access various AliExpress API endpoints related to
 * dropshipping, including product details, order management, logistics, tracking,
 * and other operations. It handles the authentication and normalization
 * of API responses to provide consistent data structures.
 *
 * @extends AESystemClient Base client with authentication and request execution capabilities
 */
declare class DropshipperClient extends AESystemClient {
    constructor(init: AE_Base_Client);
    /**
     * @deprecated - this was removed from the API
     *
     * Retrieves freight information for products
     *
     * AE API endpoint: `aliexpress.logistics.buyer.freight.get`
     *
     * @param args Freight calculation parameters including product and shipping details
     * @returns API response with freight calculation results
     * @link https://openservice.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.logistics.buyer.freight.get&methodType=GET/POST
     */
    freightInfo(args: DS_Freight_Calculation_Arguments): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Freight_Calculation_Result;
    }>;
    /**
     * Calculates shipping costs for buyer-selected options
     *
     * Uses the AliExpress shipping calculation API to get available shipping methods
     * and their associated costs based on product, quantity, and destination.
     *
     * @param args Shipping information parameters including product and destination details
     * @returns API response with available shipping methods and costs
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.logistics.buyer.freight.calculate&methodType=GET/POST
     */
    shippingInfo(args: DS_Shipping_Info_Arguments): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Shipping_Info_Result;
    }>;
    /**
     * @deprecated - this was removed from the API
     *
     * Retrieves tracking information for an order
     *
     * Gets detailed tracking events for a shipment using the order ID
     * and logistics tracking number.
     *
     * @param args Tracking information parameters including order ID and tracking number
     * @returns API response with tracking details and events
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.logistics.ds.trackinginfo.query&methodType=GET/POST
     */
    trackingInfo(args: DS_Tracking_Info_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Tracking_Info_Result;
    }>;
    /**
     * @deprecated - this was removed from the API
     *
     * Adds dropshipping information to an order
     *
     * @param args Dropshipping information parameters
     * @returns API response with operation result
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.add.info&methodType=GET/POST
     */
    addDropshippingInfo(args: DS_Add_Info_Arguments): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Add_Info_Result;
    }>;
    /**
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.image.search&methodType=GET/POST
     */
    /**
     * @deprecated - this was removed from the API
     *
     * Retrieves recommended products from featured promotions
     *
     * @param args Parameters for filtering and pagination of recommended products
     * @returns API response with recommended products
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.recommend.feed.get&methodType=GET/POST
     */
    queryfeaturedPromoProducts(args: DS_Recommended_Products_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Recommended_Products_Result;
    }>;
    /**
     * Creates a new order on AliExpress
     *
     * Places an order with the specified shipping address and product items.
     * This is the main endpoint for creating dropshipping orders.
     *
     * @param params Object containing logistics_address (shipping details) and product_items (products to order)
     * @returns API response with order creation result, including order numbers
     * @link https://openservice.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.order.create&methodType=GET/POST
     */
    createOrder({ logistics_address, product_items, promo_and_payment, }: {
        logistics_address: AE_Logistics_Address;
        product_items: AE_Product_Item[];
        promo_and_payment?: AE_Place_Order_Payment_Params;
    }): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Place_Order_Result;
    }>;
    /**
     * Retrieves detailed information about an order
     *
     * Gets comprehensive order details including products, shipping information,
     * payment status, and other order-related data.
     *
     * @param args Parameters for order retrieval, including order ID
     * @returns API response with complete order details
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.trade.ds.order.get&methodType=GET/POST
     */
    orderDetails(args: DS_Get_Order_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Get_Order_Result;
    }>;
    /**
     * Retrieves available featured promotions
     *
     * Gets a list of current promotional campaigns available for dropshippers,
     * which can be used to find discounted products.
     *
     * @param args Parameters for filtering and pagination of promotions
     * @returns API response with available promotions
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.feedname.get&methodType=GET/POST
     */
    queryFeaturedPromos(args: DS_Feedname_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Feedname_Result;
    }>;
    /**
     * Retrieves AliExpress category information
     *
     * Gets hierarchical category data that can be used for product browsing
     * or filtering in dropshipping applications.
     *
     * @param args Parameters for retrieving category information
     * @returns API response with category data
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.category.get&methodType=GET/POST
     */
    getCategories(args: Affiliate_Categories_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Categories_Result;
    }>;
    /**
     * @deprecated - this was removed from the API
     *
     * Retrieves a list of orders by index
     *
     * Gets paginated orders based on specified filters and sorting parameters.
     * Useful for building order management interfaces.
     *
     * @param args Parameters for filtering and pagination of orders
     * @returns API response with list of orders
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.commissionorder.listbyindex&methodType=GET/POST
     */
    ordersListByIndex(args: DS_Orders_ByIdx_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Orders_ByIdx_Result;
    }>;
    /**
     * @deprecated - this was removed from the API
     *
     * Submits order data to AliExpress
     *
     * Submits additional information about orders, such as tracking data
     * or customer information for dropshipping purposes.
     *
     * @param args Order data to submit
     * @returns API response with submission result
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.member.orderdata.submit&methodType=GET/POST
     */
    submitOrderData(args: DS_Order_Submit_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Order_Submit_Result;
    }>;
    /**
     * Retrieves detailed product information
     *
     * Gets comprehensive information about a product, including pricing,
     * variations, shipping options, seller information, and other product details.
     * This is a core API for dropshipping product sourcing.
     *
     * @param args Parameters for product retrieval, including product ID
     * @returns API response with complete product details
     * @link https://open.aliexpress.com/doc/api.htm#/api?cid=21038&path=aliexpress.ds.product.get&methodType=GET/POST
     */
    productDetails(args: DS_Product_Params): Promise<{
        ok: false;
        message: string;
        request_id?: string;
        error_response?: ErrorResponse;
        error?: Error;
    } | {
        ok: true;
        data: DS_Product_Result;
    }>;
}

export { type AE_Currency, type AE_Language, type AE_Logistics_Status, type AE_Order_Status, type AE_Platform_Type, type AE_Sort_Filter, type AE_Sort_Promo_Filter, AffiliateClient, DropshipperClient, type Result };
