/// <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)); }
/// <summary> /// Use this call to add a new item to a variation group /// </summary> /// <param name="pkVariationItemId">The variation group id</param> /// <param name="pkStockItemIds">The list of item ids to add</param> /// <returns>The row id for the new item</returns> public List <VariationItem> AddVariationItems(Guid pkVariationItemId, List <Guid> pkStockItemIds) { var response = GetResponse("Stock/AddVariationItems", "pkVariationItemId=" + pkVariationItemId + "&pkStockItemIds=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(pkStockItemIds)) + "", "POST"); return(JsonFormatter.ConvertFromJson <List <VariationItem> >(response)); }
/// <summary> /// Used to get inventory information at a basic level /// </summary> /// <param name="keyword">Your seearch term</param> /// <param name="loadCompositeParents">Whether you want to load composite parents or ignore them</param> /// <param name="loadVariationParents">Whether you want to load variation parents</param> /// <param name="entriesPerPage">The amount of entries you require. Maximum 200.</param> /// <param name="pageNumber">The current page number you are requesting</param> /// <param name="dataRequirements">The data you require. eg. StockLevels will load the stock levels for each location</param> /// <param name="searchTypes">The parameters that you would like to search by</param> 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=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(dataRequirements)) + "&searchTypes=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(searchTypes)) + "", "POST"); return(JsonFormatter.ConvertFromJson <List <StockItemFull> >(response)); }
/// <summary> /// Use this call to search for processed orders. /// </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> /// <returns>Returns the requested list of processed orders. The columns returned can be changed through the SetColumns method.</returns> public GenericPagedResult <ProcessedOrderWeb> SearchProcessedOrdersPaged(DateTime?from, DateTime?to, SearchDateType dateType, String searchField, Boolean exactMatch, String searchTerm, Int32 pageNum, Int32 numEntriesPerPage) { var response = GetResponse("ProcessedOrders/SearchProcessedOrdersPaged", "from=" + JsonFormatter.ConvertToJson(from) + "&to=" + JsonFormatter.ConvertToJson(to) + "&dateType=" + dateType.ToString() + "&searchField=" + System.Net.WebUtility.UrlEncode(searchField) + "&exactMatch=" + exactMatch + "&searchTerm=" + System.Net.WebUtility.UrlEncode(searchTerm) + "&pageNum=" + pageNum + "&numEntriesPerPage=" + numEntriesPerPage + ""); return(JsonFormatter.ConvertFromJson <GenericPagedResult <ProcessedOrderWeb> >(response)); }
/// <param name="pkOrderId">The order id</param> /// <param name="exchangeItems">A list of items to be exchanged, including quantity, scrap, refund, etc.</param> /// <param name="despatchLocation">The id of the location to despatch replacement items from</param> /// <param name="returnLocation">The id of the location to return stock to</param> /// <param name="channelReason">Channel reason - required if a refund on the channel is required</param> /// <param name="channelSubReason">Channel subreason - required if a refund on the channel is required.</param> /// <param name="category">The refund category</param> /// <param name="reason">The reason for the reason</param> /// <param name="isBooking">True if it is a exchange booking, False if it is a new exchange</param> /// <param name="ignoredValidation">True if failed validation has been ignored (see IsRefundValid). Otherwise, false. When set to true, refunds will not be automatically actioned on the channel. Ignored if creating a booking as a refund is not created at this stage.</param> /// <returns>Returns information about the new exchanges</returns> public List <ReturnInfo> CreateExchange(Guid pkOrderId, List <RowQty> exchangeItems, Guid despatchLocation, Guid returnLocation, String channelReason, String channelSubReason, String category, String reason, Boolean isBooking, Boolean ignoredValidation) { var response = GetResponse("ProcessedOrders/CreateExchange", "pkOrderId=" + pkOrderId + "&exchangeItems=" + JsonFormatter.ConvertToJson(exchangeItems) + "&despatchLocation=" + despatchLocation + "&returnLocation=" + returnLocation + "&channelReason=" + System.Net.WebUtility.UrlEncode(channelReason) + "&channelSubReason=" + System.Net.WebUtility.UrlEncode(channelSubReason) + "&category=" + System.Net.WebUtility.UrlEncode(category) + "&reason=" + System.Net.WebUtility.UrlEncode(reason) + "&isBooking=" + isBooking + "&ignoredValidation=" + ignoredValidation + ""); return(JsonFormatter.ConvertFromJson <List <ReturnInfo> >(response)); }
/// <summary> /// Creates a resend /// </summary> /// <param name="pkOrderId">Order ID that needs to be resend</param> /// <param name="resendItems">Resend items information</param> /// <param name="despatchLocation">Location ID where from resend be despatched</param> /// <param name="category">Category</param> /// <param name="reason">Resond reason</param> /// <param name="additionalCost">Order-level additional cost</param> public List <ReturnInfo> CreateResend(Guid pkOrderId, List <RowQty> resendItems, Guid despatchLocation, String category, String reason, Double additionalCost) { var response = GetResponse("ProcessedOrders/CreateResend", "pkOrderId=" + pkOrderId + "&resendItems=" + JsonFormatter.ConvertToJson(resendItems) + "&despatchLocation=" + despatchLocation + "&category=" + System.Net.WebUtility.UrlEncode(category) + "&reason=" + System.Net.WebUtility.UrlEncode(reason) + "&additionalCost=" + additionalCost + ""); return(JsonFormatter.ConvertFromJson <List <ReturnInfo> >(response)); }
/// <summary> /// Use this call to determine if the refunds in a given return set are valid. /// </summary> /// <param name="pkOrderId">The id of the order to validate the refund with</param> /// <param name="refundItems">The refund rows</param> /// <returns>The validation result and, if provided, additional information</returns> public ValidationResult IsRefundValid(Guid pkOrderId, List <RefundItem> refundItems) { var response = GetResponse("ProcessedOrders/IsRefundValid", "pkOrderId=" + pkOrderId + "&refundItems=" + JsonFormatter.ConvertToJson(refundItems) + ""); return(JsonFormatter.ConvertFromJson <ValidationResult>(response)); }
public List <GetStockLevel_BatchResponse> GetStockLevel_Batch(GetStockLevel_BatchRequest request) { var response = GetResponse("Stock/GetStockLevel_Batch", "request=" + JsonFormatter.ConvertToJson(request) + ""); return(JsonFormatter.ConvertFromJson <List <GetStockLevel_BatchResponse> >(response)); }
public BinracksResponse GetSuggestedBinRacks(SearchBinracksRequest request) { var response = GetResponse("Stock/GetSuggestedBinRacks", "request=" + JsonFormatter.ConvertToJson(request) + ""); return(JsonFormatter.ConvertFromJson <BinracksResponse>(response)); }
public List <StockItem> GetStockItemsByKey(Search_Stock_ByKey stockIdentifier) { var response = GetResponse("Stock/GetStockItemsByKey", "stockIdentifier=" + JsonFormatter.ConvertToJson(stockIdentifier) + ""); return(JsonFormatter.ConvertFromJson <List <StockItem> >(response)); }
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)); }
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)); }
/// <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)); }
/// <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)); }
public List <StockConsumption> GetStockConsumption(Guid stockItemId, Guid?locationId, DateTime startDate, DateTime endDate) { var response = GetResponse("Stock/GetStockConsumption", "stockItemId=" + stockItemId + "&locationId=" + JsonFormatter.ConvertToJson(locationId) + "&startDate=" + JsonFormatter.ConvertToJson(startDate) + "&endDate=" + JsonFormatter.ConvertToJson(endDate) + ""); return(JsonFormatter.ConvertFromJson <List <StockConsumption> >(response)); }
public StockItemBatch BookInStockBatch(BatchedBookIn stockItem) { var response = GetResponse("Stock/BookInStockBatch", "stockItem=" + JsonFormatter.ConvertToJson(stockItem) + ""); return(JsonFormatter.ConvertFromJson <StockItemBatch>(response)); }
/// <summary> /// Use this call to request the creation of a CSV file containing the query results. /// </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> /// <returns>Returns the URL of the CSV file</returns> public String CreateProcessedOrdersCSV(DateTime?from, DateTime?to, SearchDateType dateType, String searchField, Boolean exactMatch, String searchTerm, String sortColumn, Boolean sortDirection) { var response = GetResponse("ProcessedOrders/CreateProcessedOrdersCSV", "from=" + JsonFormatter.ConvertToJson(from) + "&to=" + JsonFormatter.ConvertToJson(to) + "&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 + ""); return(JsonFormatter.ConvertFromJson <String>(response)); }
public void Update_StockItemPartial(PartialUpdateParameter update) { GetResponse("Stock/Update_StockItemPartial", "update=" + JsonFormatter.ConvertToJson(update) + ""); }
/// <summary> /// Use this call to retrieve the total value of refunds against an order. /// </summary> /// <param name="pkOrderId">The id of the order</param> /// <param name="includeBookings">If true, pending refunds against return bookings and exchange bookings will be included. (Optional, default is false.)</param> /// <returns>Returns the total refund amount as retrieved based on the parameters.</returns> public ExistingRefundTotal GetTotalRefunds(Guid pkOrderId, Boolean?includeBookings = null) { var response = GetResponse("ProcessedOrders/GetTotalRefunds", "pkOrderId=" + pkOrderId + "&includeBookings=" + JsonFormatter.ConvertToJson(includeBookings) + ""); return(JsonFormatter.ConvertFromJson <ExistingRefundTotal>(response)); }
public List <StockItemLevel> UpdateStockLevelsBySKU(List <StockLevelUpdate> stockLevels, String changeSource = null) { var response = GetResponse("Stock/UpdateStockLevelsBySKU", "stockLevels=" + JsonFormatter.ConvertToJson(stockLevels) + "&changeSource=" + System.Net.WebUtility.UrlEncode(changeSource) + ""); return(JsonFormatter.ConvertFromJson <List <StockItemLevel> >(response)); }
/// <summary> /// Use this call to refund one or more services on an order. Please check that any automated refunds are valid prior to calling this method. /// </summary> /// <param name="pkOrderId">The id of the order to refund services for.</param> /// <param name="refundItems">Refunds for service items</param> /// <returns>A list of new refunds</returns> public List <RefundInfo> RefundServices(Guid pkOrderId, List <RefundItem> refundItems) { var response = GetResponse("ProcessedOrders/RefundServices", "pkOrderId=" + pkOrderId + "&refundItems=" + JsonFormatter.ConvertToJson(refundItems) + ""); return(JsonFormatter.ConvertFromJson <List <RefundInfo> >(response)); }
public void BookInStockItem(BookInStockItem stockItem) { GetResponse("Stock/BookInStockItem", "stockItem=" + JsonFormatter.ConvertToJson(stockItem) + ""); }
/// <summary> /// Edit an existing order note /// </summary> /// <param name="pkOrderNoteId">Primary key for order note</param> /// <param name="noteText">New note message</param> /// <param name="isInternal">Whether the note is an internal note</param> /// <param name="noteTypeId">Set the type of note</param> public void ChangeOrderNote(Guid pkOrderNoteId, String noteText, Boolean isInternal, Byte?noteTypeId = null) { GetResponse("ProcessedOrders/ChangeOrderNote", "pkOrderNoteId=" + pkOrderNoteId + "¬eText=" + System.Net.WebUtility.UrlEncode(noteText) + "&isInternal=" + isInternal + "¬eTypeId=" + JsonFormatter.ConvertToJson(noteTypeId) + ""); }
public List <StockItemBatch> CreateStockBatches(List <StockItemBatch> batches) { var response = GetResponse("Stock/CreateStockBatches", "batches=" + JsonFormatter.ConvertToJson(batches) + ""); return(JsonFormatter.ConvertFromJson <List <StockItemBatch> >(response)); }
/// <summary> /// Use this call to delete variation items in bulk /// </summary> /// <param name="request">Contains variation group id 'VariationItemId' and id list of child items 'StockItemIds'</param> public void DeleteVariationItems(DeleteVariationItemsRequest request) { GetResponse("Stock/DeleteVariationItems", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST"); }
public VariationGroup CreateVariationGroup(VariationGroupTemplate template) { var response = GetResponse("Stock/CreateVariationGroup", "template=" + JsonFormatter.ConvertToJson(template) + ""); return(JsonFormatter.ConvertFromJson <VariationGroup>(response)); }
/// <summary> /// Returns a list of Stock Items for the provided key and location /// </summary> /// <param name="stockIdentifier">Made up of a string key, used to search Item Number, Barcode Number, Supplier Code and Supplier Basrcode Fields as well as Stock Location.</param> /// <returns>A list of Stock Items</returns> public List <StockItem> GetStockItemsByKey(Search_Stock_ByKey stockIdentifier) { var response = GetResponse("Stock/GetStockItemsByKey", "stockIdentifier=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(stockIdentifier)) + "", "POST"); return(JsonFormatter.ConvertFromJson <List <StockItem> >(response)); }
public void DeleteVariationItems(DeleteVariationItemsRequest request) { GetResponse("Stock/DeleteVariationItems", "request=" + JsonFormatter.ConvertToJson(request) + ""); }
/// <summary> /// Used to get inventory item information at a basic level from ids. /// </summary> /// <param name="request">Object with a list of pkStockItemIds and Data Requirements</param> /// <returns>Object with StockItemsFullExtendedByIds</returns> public GetStockItemsFullByIdsResponse GetStockItemsFullByIds(GetStockItemsFullByIdsRequest request) { var response = GetResponse("Stock/GetStockItemsFullByIds", "request=" + System.Net.WebUtility.UrlEncode(JsonFormatter.ConvertToJson(request)) + "", "POST"); return(JsonFormatter.ConvertFromJson <GetStockItemsFullByIdsResponse>(response)); }
/// <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)); }