Esempio n. 1
0
        /// <summary>
        /// 修改还未标记为发货的订单的收货信息 (异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="orderId"></param>
        /// <param name="streetAddress1"></param>
        /// <param name="city"></param>
        /// <param name="zipCode"></param>
        /// <param name="country"></param>
        /// <param name="streetAddress2"></param>
        /// <param name="state"></param>
        /// <param name="phoneNumber"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <OrderResultBase> OrderNotShippedModifyShippingInformationAsync(string clientId, string accessToken, string orderId, string streetAddress1, string city, string zipCode, string country, string streetAddress2 = null, string state = null, string phoneNumber = null, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/order/change-shipping",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    id = orderId,
                    street_address1 = streetAddress1,
                    city = city,
                    zipcode = zipCode,
                    country = country,
                    street_address2 = streetAddress2,
                    state = state,
                    phone_number = phoneNumber
                };

                var result = CommonJsonSend.SendAsync <OrderResultBase>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 2
0
        /// <summary>
        /// 获取所有商品(异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="posStart">起始位置,数字</param>
        /// <param name="numLimit">要获取的商品数量,数字 </param>
        /// <param name="sinceDate">自此时间之后</param>
        /// <param name="showRejected">为true 则wish审核未通过的商品也一起列出</param>
        /// <param name="sessionType">prod 正式环境 ,sandbox 沙盒环境 </param>
        /// <returns></returns>
        public static async Task <ProductList> ProductAllRetrieveAsync(string clientId, string accessToken, int?posStart = null, int?numLimit = null, string sinceDate = null, bool?showRejected = null, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/product/multi-get",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);
                var data = new
                {
                    ///optional An offset into the list of returned items.
                    ///Use 0 to start at the beginning. The API will return the requested number of items starting at this offset. Default to 0 if not supplied
                    start = posStart,

                    ///optional A limit on the number of products that can be returned. Limit can range from 1 to 250 items and the default is 50
                    limit = numLimit,

                    ///optional A date string in the format YYYY-MM-DD.
                    ///If a date is provided, only products updated since the given date will be fetched. Default is to fetch all.
                    since = sinceDate,

                    ///optional If specified to 'true', this API will return all products including those inappropriate products that were rejected during review.
                    show_rejected = showRejected
                };

                var result = CommonJsonSend.SendAsync <ProductList>(token, url, data, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 3
0
 /// <summary>
 /// 订单详情查看(卖家视角)
 /// </summary>
 /// <param name="requestPolicy"></param>
 /// <param name="reqModelOrderDetailOnSellerView"></param>
 /// <param name="timeOut"></param>
 /// <returns></returns>
 public static async Task <Com.Alibaba.Trade.Entities.OrderDetailForSellerContainer> OrderDetailOnSellerViewAsyncRetrieve(
     Com.Alibaba.Entities.Request.RequestPolicy requestPolicy,
     Com.Alibaba.Trade.Entities.Request.ReqModelOrderDetailForSeller reqModelOrderDetailOnSellerView,
     int timeOut = Config.TIME_OUT)
 {
     return(await ApiHandlerWrapper.TryCommonApiAsync(reqPoli =>
     {
         var result = CommonJsonSend.SendAsync <Com.Alibaba.Trade.Entities.OrderDetailForSellerContainer>(requestPolicy, reqModelOrderDetailOnSellerView, timeOut: timeOut);
         return result;
     }, requestPolicy : requestPolicy));
 }
Esempio n. 4
0
        /// <summary>
        /// 获取违规通知次数 (异步)
        ///
        /// 请求原始文档
        /// > curl "https://china-merchant.wish.com/api/v2/count/infractions?access_token=an_example_access_token"
        /// 返回数据原始文档:
        /// {
        ///     u 'message': u '', u 'code': 0, u 'data': {
        ///         u 'CountInfractionsResponse': {
        ///             u 'count': u '156'
        ///         }
        ///     }
        /// }
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <CountInfractionsResult> InfractionCountRetrieveAsync(string clientId, string accessToken, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/count/infractions",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var result = CommonJsonSend.SendAsync <CountInfractionsResult>(token, url, null, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 5
0
        /// <summary>
        /// 修改商品规格 (异步)
        /// variant参数 =>
        /// sku,
        /// inventory 可空,
        /// price 可空,
        /// shipping 可空,
        /// enabled 可空,
        /// color 可空,
        /// size 可空,
        /// msrp 可空,
        /// shipping_time 可空,
        /// main_image 可空
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="variant"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <VariantResult> ProductVariantUpdateAsync(string clientId, string accessToken, Wl.Wish.Entities.Request.Variant variant, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/variant/update",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var result = CommonJsonSend.SendAsync <VariantResult>(token, url, variant, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 6
0
        /// <summary>
        /// 获取未查看通知的条数 (异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <NotificationResultBase> NotificationUnviewedCountRetrieveAsync(string clientId, string accessToken, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/noti/get-unviewed-count",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var result = CommonJsonSend.SendAsync <NotificationResultBase>(token, url, null, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 7
0
        /// <summary>
        /// 获取系统更改通知 ( 异步 )
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <SystemUpdateNotification> SystemUpdateNotificationRetrieveAsync(string clientId, string accessToken, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/fetch-sys-updates-noti",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var result = CommonJsonSend.SendAsync <SystemUpdateNotification>(token, url, null, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 8
0
        /// <summary>
        /// 获得某商品到某国家的运费(异步)
        ///
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="productShippingPriceSingle"> id,parent_sku 必写其一;country 两位国家代码 </param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <ProductShippingPriceSingle> ProductShippingPriceRetrieveSingleAsync(string clientId, string accessToken, Wl.Wish.Entities.Request.ProductShippingPriceSingle productShippingPriceSingle, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/product/get-shipping",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var result = CommonJsonSend.SendAsync <ProductShippingPriceSingle>(token, url, productShippingPriceSingle, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 9
0
        /// <summary>
        /// 移除商品的图片,只保留主图(异步,通过 product_id或 parent_sku )
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="productId"></param>
        /// <param name="parentSku"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <ProductResultBase> ProductExtraPhotoRemoveAsync(string clientId, string accessToken, string productId, string parentSku, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/product/remove-extra-images",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);
                var data = new
                {
                    id = productId,
                    parent_sku = parentSku
                };

                var result = CommonJsonSend.SendAsync <ProductResultBase>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 10
0
        /// <summary>
        /// 获得多个商品的所有运费设置(异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="productIds"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <ProductShippingPriceMultipleOfMany> ProductShippingPriceRetrieveMultipleOfManyAsync(string clientId, string accessToken, string productIds = null, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/product/get-products-shipping",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    ids = productIds
                };

                var result = CommonJsonSend.SendAsync <ProductShippingPriceMultipleOfMany>(token, url, data, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 11
0
        /// <summary>
        /// 获取订单(异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="orderId"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <OrderResult> OrderRetrieveAsync(string clientId, string accessToken, string orderId, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/order",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    id = orderId
                };

                var result = CommonJsonSend.SendAsync <OrderResult>(token, url, data, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 12
0
        /// <summary>
        /// 标记通知为已读 ( 异步 )
        /// 参数中的noti_id 在
        /// https://www.merchant.wish.com/documentation/api/v2#noti-mark
        /// 中示例为id
        /// 但是在
        /// https://www.merchant.wish.com/documentation/api/explorer/noti/mark-as-viewed
        /// 中为noti_id
        /// 此处对参数存疑问
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="notificationId"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <NotificationResultBase> NotificationMarkViewedAsync(string clientId, string accessToken, string notificationId, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/noti/mark-as-viewed",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    noti_id = notificationId
                };

                var result = CommonJsonSend.SendAsync <NotificationResultBase>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 13
0
        /// <summary>
        /// 禁用一个商品规格 (异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="sku"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <VariantResultBase> ProductVariantDisableAsync(string clientId, string accessToken, string sku, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/variant/disable",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    sku = sku
                };

                var result = CommonJsonSend.SendAsync <VariantResultBase>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 14
0
        /// <summary>
        /// 取消商品下载任务(异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="jobId"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <ProductDownloadTask> ProductDownloadTaskCancelAsync(string clientId, string accessToken, string jobId, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/product/cancel-download-job",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    job_id = jobId
                };

                var result = CommonJsonSend.SendAsync <ProductDownloadTask>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 15
0
        /// <summary>
        /// 就某个Ticket 请求Wish 的支持( 异步 )
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="ticketId"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <TicketResultBase> TicketAppealWishSupportAsync(string clientId, string accessToken, string ticketId, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/ticket/appeal-to-wish-support",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    id = ticketId
                };

                var result = CommonJsonSend.SendAsync <TicketResultBase>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 16
0
        /// <summary>
        /// 开始批量下载商品的任务(异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="sinceDate"></param>
        /// <param name="limitNum"></param>
        /// <param name="sortString"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <ProductDownloadTask> ProductDownloadTaskStartAsync(string clientId, string accessToken, string sinceDate, int?limitNum, string sortString, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/product/create-download-job",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    since = sinceDate,
                    limit = limitNum
                };

                var result = CommonJsonSend.SendAsync <ProductDownloadTask>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 17
0
        /// <summary>
        /// 获取所有商品规格数据
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="start">起始</param>
        /// <param name="limit">限制</param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <VariantList> ProductVariantListAllAsync(string clientId, string accessToken, int start = 0, int limit = 50, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/variant/multi-get",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    start = start,
                    limit = limit
                };

                var result = CommonJsonSend.SendAsync <VariantList>(token, url, data, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 18
0
        /// <summary>
        /// 获取违规通知列表 ( 异步 )
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <InfractionList> InfractionListRetrieveAsync(string clientId, string accessToken, int startNumber = 0, int limitNumber = 50, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/get/infractions",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    start = startNumber,
                    limit = limitNumber
                };

                var result = CommonJsonSend.SendAsync <InfractionList>(token, url, data, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 19
0
        /// <summary>
        /// 订单取消/退款
        /// ReasonCode 见 https://www.merchant.wish.com/documentation/api/v2#cancel-an-order
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="orderId"></param>
        /// <param name="reasonCode"></param>
        /// <param name="reasonNote"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <OrderResultBase> OrderRefundOrCancelAsync(string clientId, string accessToken, string orderId, Wl.Wish.Entities.ResonCodeOfRefundOrCancel reasonCode = Wish.Entities.ResonCodeOfRefundOrCancel.Other, string reasonNote = null, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/order/refund",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    id = orderId,
                    reason_code = (int)reasonCode,
                    reason_note = reasonNote
                };

                var result = CommonJsonSend.SendAsync <OrderResultBase>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 20
0
        /// <summary>
        /// 获取未履约订单 (异步)
        /// * 未履约订单  https://www.merchant.wish.com/documentation/api/v2#list-unfulfilled-orders
        /// 根据此处未履约订单的地址 为 https://china-merchant.wish.com/api/v2/order/get-fulfill
        /// 此处存疑
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="start"></param>
        /// <param name="limit"></param>
        /// <param name="since"></param>
        /// <param name="wish_express_only"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <OrderList> OrdersUnfulfilledRetrieveAsync(string clientId, string accessToken, int start = 0, int limit = 50, string since = null, bool?wish_express_only = null, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/order/get-fulfill",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    start = start,
                    limit = limit,
                    since = since,
                    wish_express_only = wish_express_only
                };

                var result = CommonJsonSend.SendAsync <OrderList>(token, url, data, CommonJsonSendType.GET);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 21
0
        /// <summary>
        /// 开始一个订单下载的任务 (异步)
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="startDate">开始日期,形如 2017-01-01</param>
        /// <param name="endDate">结束日期,形如 2017-04-01</param>
        /// <param name="limitNumber"></param>
        /// <param name="sortNotation">排序方式 asc,desc</param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <OrderDownloadTask> OrderDownloadAsync(string clientId, string accessToken, string startDate = null, string endDate = null, int?limitNumber = null, string sortNotation = "desc", SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/order/create-download-job",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    start = startDate,
                    end = endDate,
                    limit = limitNumber,
                    sort = sortNotation
                };

                var result = CommonJsonSend.SendAsync <OrderDownloadTask>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 22
0
        /// <summary>
        /// 修改已发货订单的跟踪信息
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="orderId"></param>
        /// <param name="trackingProvider"></param>
        /// <param name="trackingNumber"></param>
        /// <param name="shipNote"></param>
        /// <param name="sessionType"></param>
        /// <returns></returns>
        public static async Task <OrderResultBase> OrderShippedModifyTrackingAsync(string clientId, string accessToken, string orderId, string trackingProvider, string trackingNumber = null, string shipNote = null, SessionType sessionType = SessionType.Prod)
        {
            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var url =
                    string.Format("{0}/api/v2/order/modify-tracking",
                                  sessionType == SessionType.Sandbox ? Wl.Wish.Config.RequestUriRootSandbox : Wl.Wish.Config.RequestUriRoot);

                var data = new
                {
                    id = orderId,
                    tracking_provider = trackingProvider,
                    tracking_number = trackingNumber,
                    ship_note = shipNote
                };

                var result = CommonJsonSend.SendAsync <OrderResultBase>(token, url, data, CommonJsonSendType.POST);

                return result;
            }, clientId, accessToken, sessionType));
        }
Esempio n. 23
0
        /// <summary>
        /// 订单详情查看(卖家视角)
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="clientSecret"></param>
        /// <param name="accessToken"></param>
        /// <param name="reqModelOrderDetailOnSellerView"></param>
        /// <param name="apiRoot"></param>
        /// <param name="apiVersion"></param>
        /// <param name="apiNamespace"></param>
        /// <param name="apiName"></param>
        /// <param name="protocol"></param>
        /// <param name="sessionType"></param>
        /// <param name="requestSchema"></param>
        /// <param name="validateSignature"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        public static async Task <Com.Alibaba.Trade.Entities.OrderDetailForSellerContainer> OrderListOnSellerViewAsyncRetrieve(
            string clientId,
            string clientSecret,
            string accessToken,
            Com.Alibaba.Trade.Entities.Request.ReqModelOrderDetailForSeller reqModelOrderDetailOnSellerView,
            string apiRoot                = "openapi",
            string apiVersion             = "1",
            string apiNamespace           = "com.alibaba.trade",
            string apiName                = "alibaba.trade.get.sellerView",
            Com.Alibaba.Protocol protocol = Com.Alibaba.Protocol.param2,
            SessionType sessionType       = SessionType.Prod,
            UriSchema requestSchema       = UriSchema.https,
            bool validateSignature        = true,
            int timeOut = Config.TIME_OUT)
        {
            var requestPolicy = new Com.Alibaba.Entities.Request.RequestPolicy
            {
                ClientId          = clientId,
                ClientSecret      = clientSecret,
                AccessToken       = accessToken,
                ApiRoot           = apiRoot,
                ApiVersion        = apiVersion,
                ApiNamespace      = apiNamespace,
                ApiName           = apiName,
                Protocol          = protocol,
                SessionType       = sessionType,
                RequestSchema     = requestSchema,
                ValidateSignature = validateSignature
            };

            return(await ApiHandlerWrapper.TryCommonApiAsync(token =>
            {
                var result = CommonJsonSend.SendAsync <Com.Alibaba.Trade.Entities.OrderDetailForSellerContainer>(requestPolicy, reqModelOrderDetailOnSellerView, timeOut: timeOut);
                return result;
            }, requestPolicy : requestPolicy));
        }