Ejemplo n.º 1
0
        public DateTime GetServerUTCTime()
        {
            var response = GetResponse("Auth/GetServerUTCTime", "");

            return(JsonFormatter.ConvertFromJson <DateTime>(response));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates a sesssion and provide Authorization Token and server in response.
        /// </summary>
        /// <param name="request"></param>
        public BaseSession AuthorizeByApplication(AuthorizeByApplicationRequest request)
        {
            var response = GetResponse("Auth/AuthorizeByApplication", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "");

            return(JsonFormatter.ConvertFromJson <BaseSession>(response));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns current application subscription profile information for a given application for a specific user.
        /// You can use this method to get the current application subscription after AuthorizedByApplication returned a session.
        /// The session will contain Id, this is the UserId you need to supply in the call.
        /// If there are no current subscriptions for the application for the user. The method will return null (nothing)
        /// </summary>
        /// <param name="applicationId">Your application Id</param>
        /// <param name="applicationSecret">Your application secret key</param>
        /// <param name="userId">User Id (Id field of the session)</param>
        /// <returns>Class that represents the application subscription profile</returns>
        public ApplicationProfileResponse GetApplicationProfileBySecretKey(Guid applicationId, Guid applicationSecret, Guid userId)
        {
            var response = GetResponse("Auth/GetApplicationProfileBySecretKey", "applicationId=" + applicationId + "&applicationSecret=" + applicationSecret + "&userId=" + userId + "");

            return(JsonFormatter.ConvertFromJson <ApplicationProfileResponse>(response));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns a paged list of processed or acknowledged error RMA headers
        /// </summary>
        /// <param name="request">The request class for this call</param>
        public GetProcessedOrAckedErrorRMAHeadersResponse GetProcessedOrAckedErrorRMAHeaders(GetProcessedOrAckedErrorRMAHeadersRequest request)
        {
            var response = GetResponse("ReturnsRefunds/GetProcessedOrAckedErrorRMAHeaders", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST");

            return(JsonFormatter.ConvertFromJson <GetProcessedOrAckedErrorRMAHeadersResponse>(response));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// This method is used to further validate and create a cancellation in Linnworks, as well as submit it to the channel where this is requested
        /// </summary>
        /// <param name="request">The requested cancellation settings, including whether or not to submit the cancellation to the channel</param>
        /// <returns>A validation and submission result (where appropriate) for the requested cancellation</returns>
        public ValidatedCancellation CreateCancellation(CancellationRequest request)
        {
            var response = GetResponse("PostSale/CreateCancellation", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST");

            return(JsonFormatter.ConvertFromJson <ValidatedCancellation>(response));
        }
Ejemplo n.º 6
0
        public List <StockItem> GetStockItemsByKey(Search_Stock_ByKey stockIdentifier)
        {
            var response = GetResponse("Stock/GetStockItemsByKey", "stockIdentifier=" + JsonFormatter.ConvertToJson(stockIdentifier) + "");

            return(JsonFormatter.ConvertFromJson <List <StockItem> >(response));
        }
Ejemplo n.º 7
0
        public List <StockItemFull> GetStockItemsFull(String keyword, Boolean loadCompositeParents, Boolean loadVariationParents, Int32 entriesPerPage, Int32 pageNumber, List <StockInformationDataRequirement> dataRequirements, List <StockInformationSearchType> searchTypes)
        {
            var response = GetResponse("Stock/GetStockItemsFull", "keyword=" + System.Net.WebUtility.UrlEncode(keyword) + "&loadCompositeParents=" + loadCompositeParents + "&loadVariationParents=" + loadVariationParents + "&entriesPerPage=" + entriesPerPage + "&pageNumber=" + pageNumber + "&dataRequirements=" + JsonFormatter.ConvertToJson(dataRequirements) + "&searchTypes=" + JsonFormatter.ConvertToJson(searchTypes) + "");

            return(JsonFormatter.ConvertFromJson <List <StockItemFull> >(response));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Gets all warehouse locations
        /// </summary>
        /// <returns>List of warehouse names and location IDs</returns>
        public List <WarehouseLocation> GetWarehouseLocations()
        {
            var response = GetResponse("ReturnsRefunds/GetWarehouseLocations", "", "POST");

            return(JsonFormatter.ConvertFromJson <List <WarehouseLocation> >(response));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Searches through returns/refunds history that meets the parameters' criteria
        /// </summary>
        /// <param name="from">The lower end of the date range to search. Can be null if searching for 'all dates'. Maximum range is 3 months.</param>
        /// <param name="to">The upper end of the date range to search. Can be null if searching for 'all dates'. Maximum range is 3 months.</param>
        /// <param name="dateType">The search type (e.g. ALLDATES)</param>
        /// <param name="searchField">The field to search by. Can be found by calling GetSearchTypes.</param>
        /// <param name="exactMatch">Set to true if an exact match is required for the search data.</param>
        /// <param name="searchTerm">The term which you are searching for.</param>
        /// <param name="pageNum">The page number of the request.</param>
        /// <param name="numEntriesPerPage">The number of entries required on a page. Maximum 200.</param>
        /// <param name="historyType">Search type. Allow RETURNS or REFUNDS</param>
        /// <returns>Returns the requested list of processed orders. The columns returned can be changed through the SetColumns method.</returns>
        public GenericPagedResult <ReturnsRefundsWeb> SearchReturnsRefundsPaged(DateTime?from, DateTime?to, ReturnsRefundsSearchDateType dateType, String searchField, Boolean exactMatch, String searchTerm, Int32 pageNum, Int32 numEntriesPerPage, HistoryType historyType = HistoryType.RETURNS)
        {
            var response = GetResponse("ReturnsRefunds/SearchReturnsRefundsPaged", "from=" + System.Net.WebUtility.UrlEncode(from.HasValue ? from.Value.ToString("yyyy-MM-dd HH:mm:ss") : "null") + "&to=" + System.Net.WebUtility.UrlEncode(to.HasValue ? to.Value.ToString("yyyy-MM-dd HH:mm:ss") : "null") + "&dateType=" + dateType.ToString() + "&searchField=" + System.Net.WebUtility.UrlEncode(searchField) + "&exactMatch=" + exactMatch + "&searchTerm=" + System.Net.WebUtility.UrlEncode(searchTerm) + "&pageNum=" + pageNum + "&numEntriesPerPage=" + numEntriesPerPage + "&historyType=" + historyType.ToString() + "", "POST");

            return(JsonFormatter.ConvertFromJson <GenericPagedResult <ReturnsRefundsWeb> >(response));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets a list of valid search types. These are needed to search processed orders.
        /// </summary>
        /// <param name="historyType">Search type. Allow RETURNS or REFUNDS</param>
        /// <returns>All search types</returns>
        public List <SearchField> GetSearchTypes(HistoryType historyType)
        {
            var response = GetResponse("ReturnsRefunds/GetSearchTypes", "historyType=" + historyType.ToString() + "", "POST");

            return(JsonFormatter.ConvertFromJson <List <SearchField> >(response));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Gets the refundable amunt of an order
        /// </summary>
        /// <param name="fkOrderId">unique order ID of the order</param>
        /// <returns>Refundable amount</returns>
        public Double GetTotalRefunds(Guid fkOrderId)
        {
            var response = GetResponse("ReturnsRefunds/GetTotalRefunds", "fkOrderId=" + fkOrderId + "", "POST");

            return(JsonFormatter.ConvertFromJson <Double>(response));
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Acknowledges all error responses for a given RMA header
        /// </summary>
        /// <param name="request">The request class for this call</param>
        public AcknowledgeRMAErrorsResponse AcknowledgeRMAErrors(AcknowledgeRMAErrorsRequest request)
        {
            var response = GetResponse("ReturnsRefunds/AcknowledgeRMAErrors", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST");

            return(JsonFormatter.ConvertFromJson <AcknowledgeRMAErrorsResponse>(response));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Returns all RMA headers associated with the given order ID
        /// </summary>
        /// <param name="request">The request class for this call</param>
        public GetRMAHeadersByOrderIdResponse GetRMAHeadersByOrderId(GetRMAHeadersByOrderIdRequest request)
        {
            var response = GetResponse("ReturnsRefunds/GetRMAHeadersByOrderId", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST");

            return(JsonFormatter.ConvertFromJson <GetRMAHeadersByOrderIdResponse>(response));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Gets all refund order items for all orders
        /// </summary>
        /// <returns>List of refund order items</returns>
        public List <RefundOrder> GetRefundOrders()
        {
            var response = GetResponse("ReturnsRefunds/GetRefundOrders", "", "POST");

            return(JsonFormatter.ConvertFromJson <List <RefundOrder> >(response));
        }
Ejemplo n.º 15
0
        public List <StockItemDuePO> GetStockDuePO(Guid stockItemId)
        {
            var response = GetResponse("Stock/GetStockDuePO", "stockItemId=" + stockItemId + "");

            return(JsonFormatter.ConvertFromJson <List <StockItemDuePO> >(response));
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Accepts a booked return or exchange in the system
        /// </summary>
        /// <param name="request">The request class for this call</param>
        public ActionRMABookingResponse ActionRMABooking(ActionRMABookingRequest request)
        {
            var response = GetResponse("ReturnsRefunds/ActionRMABooking", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST");

            return(JsonFormatter.ConvertFromJson <ActionRMABookingResponse>(response));
        }
Ejemplo n.º 17
0
        public GenericPagedResult <StockItem> GetStockItems(String keyWord, Guid?locationId, Int32 entriesPerPage, Int32 pageNumber, Boolean excludeComposites = false, Boolean excludeVariations = false, Boolean excludeBatches = false)
        {
            var response = GetResponse("Stock/GetStockItems", "keyWord=" + System.Net.WebUtility.UrlEncode(keyWord) + "&locationId=" + JsonFormatter.ConvertToJson(locationId) + "&entriesPerPage=" + entriesPerPage + "&pageNumber=" + pageNumber + "&excludeComposites=" + excludeComposites + "&excludeVariations=" + excludeVariations + "&excludeBatches=" + excludeBatches + "");

            return(JsonFormatter.ConvertFromJson <GenericPagedResult <StockItem> >(response));
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Creates a refund in the system for approval
        /// </summary>
        /// <param name="request">The request class for this call</param>
        public CreateRefundResponse CreateRefund(CreateRefundRequest request)
        {
            var response = GetResponse("ReturnsRefunds/CreateRefund", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST");

            return(JsonFormatter.ConvertFromJson <CreateRefundResponse>(response));
        }
Ejemplo n.º 19
0
        public List <StockItemScrap> GetStockItemScrapStat(Guid stockItemId)
        {
            var response = GetResponse("Stock/GetStockItemScrapStat", "stockItemId=" + stockItemId + "");

            return(JsonFormatter.ConvertFromJson <List <StockItemScrap> >(response));
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Creates a CSV file of the search result for download
        /// </summary>
        /// <param name="from">The lower end of the date range to search. Can be null if searching for 'all dates'. Maximum range is 3 months.</param>
        /// <param name="to">The upper end of the date range to search. Can be null if searching for 'all dates'. Maximum range is 3 months.</param>
        /// <param name="dateType">The search type (e.g. ALLDATES)</param>
        /// <param name="searchField">The field to search by. Can be found by calling GetSearchTypes.</param>
        /// <param name="exactMatch">Set to true if an exact match is required for the search data.</param>
        /// <param name="searchTerm">The term which you are searching for.</param>
        /// <param name="sortColumn">The column to sort by</param>
        /// <param name="sortDirection">The sort direction (true = ascending, false = descending).</param>
        /// <param name="historyType">Search type. Allow RETURNS or REFUNDS</param>
        /// <returns>Returns the URL of the CSV file</returns>
        public String CreateReturnsRefundsCSV(DateTime?from, DateTime?to, ReturnsRefundsSearchDateType dateType, String searchField, Boolean exactMatch, String searchTerm, String sortColumn, Boolean sortDirection, HistoryType historyType = HistoryType.RETURNS)
        {
            var response = GetResponse("ReturnsRefunds/CreateReturnsRefundsCSV", "from=" + System.Net.WebUtility.UrlEncode(from.HasValue ? from.Value.ToString("yyyy-MM-dd HH:mm:ss") : "null") + "&to=" + System.Net.WebUtility.UrlEncode(to.HasValue ? to.Value.ToString("yyyy-MM-dd HH:mm:ss") : "null") + "&dateType=" + dateType.ToString() + "&searchField=" + System.Net.WebUtility.UrlEncode(searchField) + "&exactMatch=" + exactMatch + "&searchTerm=" + System.Net.WebUtility.UrlEncode(searchTerm) + "&sortColumn=" + System.Net.WebUtility.UrlEncode(sortColumn) + "&sortDirection=" + sortDirection + "&historyType=" + historyType.ToString() + "", "POST");

            return(JsonFormatter.ConvertFromJson <String>(response));
        }
Ejemplo n.º 21
0
        public List <VariationItem> AddVariationItems(Guid pkVariationItemId, List <Guid> pkStockItemIds)
        {
            var response = GetResponse("Stock/AddVariationItems", "pkVariationItemId=" + pkVariationItemId + "&pkStockItemIds=" + JsonFormatter.ConvertToJson(pkStockItemIds) + "");

            return(JsonFormatter.ConvertFromJson <List <VariationItem> >(response));
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Deletes all lines from the given RMA header that have not yet been processed, or acknowledged as errors, removing it from the "RMA Bookings" screen. If no lines are left, the header row is deleted
        /// </summary>
        /// <param name="request">The request class for this call</param>
        public DeleteRMAResponse DeleteRMA(DeleteRMARequest request)
        {
            var response = GetResponse("ReturnsRefunds/DeleteRMA", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST");

            return(JsonFormatter.ConvertFromJson <DeleteRMAResponse>(response));
        }