IOrderService
Defines the Vendr Order service
public interface IOrderService : ICachedEntityService<OrderReadOnly>, IService
Inheritance
- interface ICachedEntityService<TEntityType>
- interface IService
Namespace
Methods
DeleteOrder (1 of 4)
Deletes a Order
public void DeleteOrder(Guid orderId)
Parameters
Parameter | Description |
---|---|
orderId |
The ID of the Order to delete |
DeleteOrder (2 of 4)
Deletes a Order
public void DeleteOrder(Order entity)
Parameters
Parameter | Description |
---|---|
entity |
The Order to delete |
DeleteOrder (3 of 4)
Deletes a Order
public void DeleteOrder(Guid orderId, bool revertFinalized)
Parameters
Parameter | Description |
---|---|
orderId |
The ID of the Order to delete |
revertFinalized |
A boolean flag indicating whether to reverse the order finalization, undoing any stock reductions, discount code usages or gift card deductions |
DeleteOrder (4 of 4)
Deletes a Order
public void DeleteOrder(Order entity, bool revertFinalized)
Parameters
Parameter | Description |
---|---|
entity |
The Order to delete |
revertFinalized |
A boolean flag indicating whether to reverse the order finalization, undoing any stock reductions, discount code usages or gift card deductions |
GetAllOrdersForCustomer
Gets a list of all open or finalized OrderReadOnly
entities for a given customer
public IEnumerable<OrderReadOnly> GetAllOrdersForCustomer(Guid storeId,
string customerReferenceOrEmail)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the OrderReadOnly entities belong to |
customerReferenceOrEmail |
The unique reference or email address of the customer associated with the OrderReadOnly entities |
Returns
A list of OrderReadOnly
entities
GetFinalizedOrderCount
Get the total number of finalized Order
entities in a given Store
public long GetFinalizedOrderCount(Guid storeId)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store to count from |
Returns
A count of the number of finalized Order
entities in the given Store
GetFinalizedOrdersForCustomer
Gets a list of finalized OrderReadOnly
entities for a given customer
public IEnumerable<OrderReadOnly> GetFinalizedOrdersForCustomer(Guid storeId,
string customerReferenceOrEmail)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the OrderReadOnly entities belong to |
customerReferenceOrEmail |
The unique reference or email address of the customer associated with the OrderReadOnly entities |
Returns
A list of OrderReadOnly
entities
GetOpenOrdersForCustomer
Gets a list of open OrderReadOnly
entities for a given customer
public IEnumerable<OrderReadOnly> GetOpenOrdersForCustomer(Guid storeId,
string customerReferenceOrEmail)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the OrderReadOnly entities belong to |
customerReferenceOrEmail |
The unique reference or email address of the customer associated with the OrderReadOnly entities |
Returns
A list of OrderReadOnly
entities
GetOrder (1 of 2)
Get an OrderReadOnly
entity by ID
public OrderReadOnly GetOrder(Guid orderId)
Parameters
Parameter | Description |
---|---|
orderId |
The ID of the OrderReadOnly entity to fetch |
Returns
An OrderReadOnly
entity
GetOrder (2 of 2)
Get a OrderReadOnly
entity by Store
and cart or order number
public OrderReadOnly GetOrder(Guid storeId, string cartOrOrderNumber)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the OrderReadOnly entity belongs to |
cartOrOrderNumber |
The cart or order number to search for |
Returns
A OrderReadOnly
entity
GetOrders
Gets a list of OrderReadOnly
entities matching the given IDs
public IEnumerable<OrderReadOnly> GetOrders(Guid[] ids)
Parameters
Parameter | Description |
---|---|
ids |
The IDs of the OrderReadOnly entities to fetch |
Returns
A list of OrderReadOnly
entities
SaveOrder
Saves a Order
public void SaveOrder(Order entity)
Parameters
Parameter | Description |
---|---|
entity |
The Order to save |
SearchOrders (1 of 2)
Search for OrderReadOnly
entities in a given store matching the given criteria
public PagedResult<OrderReadOnly> SearchOrders(Guid storeId, string searchTerm = null,
string cartOrOrderNumber = null, string firstName = null, string lastName = null,
bool? isFinalized = null, Guid? orderStatusId = default(Guid?),
PaymentStatus? paymentStatus = default(PaymentStatus?),
DateTime? fromDate = default(DateTime?), DateTime? toDate = default(DateTime?),
long currentPage = 1, long itemsPerPage = 50)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the OrderReadOnly entities belong to |
searchTerm |
A term to search for across the cart number, order number, customer first name and customer last name fields |
cartOrOrderNumber |
A cart or order number to search for |
firstName |
A customer first name to search for |
lastName |
A customer last name to search for |
isFinalized |
A boolean flag to indicate whether to only search finalized orders |
orderStatusId |
The ID of an OrderStatus the OrderReadOnly entities should be in |
paymentStatus |
The PaymentStatus the OrderReadOnly entities should be in |
fromDate |
A date after which to search from |
toDate |
A date up to which to search to |
currentPage |
The page of results of which to retrieve |
itemsPerPage |
The number of items per page to return |
Returns
A paginated list of OrderReadOnly
entities
SearchOrders (2 of 2)
Search for OrderReadOnly
entities in a given store matching the given criteria
public PagedResult<OrderReadOnly> SearchOrders(Guid storeId, string searchTerm = null,
string cartOrOrderNumber = null, string firstName = null, string lastName = null,
bool? isFinalized = null, IEnumerable<Guid> orderStatusIds = null,
IEnumerable<PaymentStatus> paymentStatuses = null, DateTime? fromDate = default(DateTime?),
DateTime? toDate = default(DateTime?), long currentPage = 1, long itemsPerPage = 50)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the OrderReadOnly entities belong to |
searchTerm |
A term to search for across the cart number, order number, customer first name and customer last name fields |
cartOrOrderNumber |
A cart or order number to search for |
firstName |
A customer first name to search for |
lastName |
A customer last name to search for |
isFinalized |
A boolean flag to indicate whether to only search finalized orders |
orderStatusIds |
The IDs of any OrderStatus the OrderReadOnly entities should be in |
paymentStatuses |
A list of any PaymentStatus the OrderReadOnly entities should be in |
fromDate |
A date after which to search from |
toDate |
A date up to which to search to |
currentPage |
The page of results of which to retrieve |
itemsPerPage |
The number of items per page to return |
Returns
A paginated list of OrderReadOnly
entities