Dynamics 365 Retail - CRT Services
Nghia Song - Microsoft Dynamics 365 Technical Consultant
Nghia Song
Tel - WhatsApp: +84967324794
Email: songnghia.uit@gmail.com
Each CRT service contains one or more requests/responses. For example, the Customer service in CRT contains all the customer-related requests/responses. Each request/response is run in a different flow.
Common Service
Service | Description |
---|---|
AddressService | This service verifies addresses and gets location information, such as cities, counties, or states. |
BarcodeService | This service processes the barcode that was scanned, based on the mask and barcode types, and calculates the quantity and price from the barcode. |
CartService | This service gets the cart from the transaction and sales transaction service from the transaction tables. |
ChargeService | This service implements logic that calculates automatic charges, price charges, and shipping charges for transactions. |
CouponService | This service validates and updates coupon-related requests. |
CurrencyService | This service converts currencies, based on exchange rates. |
CustomerService | This service contains customer related operations such as Save customer, purchase history, get customer and customer balance. |
EmployeeService | This service gets employee-related information and employees by store. |
FormattingService | This service implements logic for the format of numbers, currencies, and dates. |
GiftCardService | This service provides information about internal activities that are related to gift cards, such as issuing the gift card, getting the balance, and adding value. |
LoyaltyService | This service implements a program that rewards repeat customers. |
NotificationService | This service maintains the POS notification service. |
PaymentService | This service lets you connect your online store to a payment service to provide credit card authorization and use preconfigured payment processing. You can also extend the payment service to add additional third-party payment processors. |
ProductService | This service gets product-related and variant-related information. |
ProductsService | This service gets information that is related to products and variants. |
PricingService | This service gets the price of an item in real time. The price is adjusted, based on the base price and any applicable discounts. Discounts can be customized for each retailer. |
ProductAvailabilityService | This service calculates the quantities of products that are available to sell. |
ReasonCodeService | This service calculates and gets the required reason code for POS operations or any workflow. |
ReceiptService | This service gets and formats the receipt details. |
RoundingService | This service rounds the tender amount, based on the tender type and store. |
SalesOrderService | This service creates a sales order, based on a customer shopping cart. |
SearchProductsService | This service searches products, based on the input text. |
ShippingService | This service calculates shipping costs and determines shipping options for the current order. |
StockCountService | This service creates, commits, and synchronizes stock journals. |
StoreOperationService | This service maintains store-related operation services, such as Save and Drop, Tender declaration, and Search journal. |
TaxService | This service calculates the sales tax for the current order. You can use sales tax information provided, or from a third-party sales tax service. |
TotalingService | This service calculates the totals on the sales transactions and sales lines. |
For extension scenarios, you can add CRT triggers, create new services, and override any of the requests in the service class. For information about how to extend and understand CRT extension patterns, see Commerce runtime (CRT) extensibility.
Note
CRT extension code should not refer to or use any of the CRT business logic classes, methods, or handlers (such as classes from Runtime.Workflow, Runtime.Services, or Runtime.DataServices). These classes are not backward compatible, which could break extensions during an upgrade. Extensions should only use request, response, and entity classes from Runtime.*.Messages, Runtime.Framework, Runtime.Data, and Runtime.Entities.
AddressService
The Address service supports the following requests/responses for various extension scenarios.
Request | Purpose |
---|---|
GetCountryRegionsServiceRequest | This request gets the list of countries and regions that are supported. |
GetStateProvincesServiceRequest | This request gets the list of states or provinces that are supported for the country or region. |
GetCitiesServiceRequest | This request gets the list of cities that are supported for the state or region. |
GetDistrictServiceRequest | This request gets the list of districts that are supported. |
GetZipCodesServiceRequest | This request gets the list of ZIP Codes that are supported. |
GetFromZipPostalCodeServiceRequest | This request gets the list of postal codes supported. |
GetAddressFormattingServiceRequest | This request gets the address format for the specified country or region. |
BarcodeService
Request | Purpose |
---|---|
ProcessMaskSegmentsServiceRequest | This request processes the barcode, based on the barcode mask configuration. |
GetBarcodeTypeServiceRequest | This request gets the types of barcodes that are supported. |
CalculateQuantityFromPriceServiceRequest | This request calculates the price and quantity, based on the barcode that is scanned or entered. |
CartService
Request | Purpose |
---|---|
GetSalesTransactionsServiceRequest | This request gets the sales transaction from Headquarters. |
GetCartServiceRequest | This request gets the cart from the sales transaction table by using the cart ID. |
CalculateSalesTransactionServiceRequest | This request calculates the various sales transaction totals, based on the specified calculation mode. |
CalculateEstimatedShippingAuthorizationAmountServiceRequest | This request calculates the estimated shipping authorization amount on the transaction. |
ConvertSalesTransactionToCartServiceRequest | This request converts the sales transaction to a cart transaction, based on transaction ID that is passed. |
CouponService
Request | Purpose |
---|---|
UpdateCouponCodesOnCartServiceRequest | This request updates the coupon codes status in Headquarters, based on the coupons that are used in the cart. |
ValidateCouponCodesServiceRequest | This request validates the coupon code that is entered in the transactions. |
UpdateCouponUsageServiceRequest | This request updates coupon usage for the transaction. |
CustomerService
Request | Purpose |
---|---|
SaveCustomerServiceRequest | This request is called when you save a customer from the POS. |
GetCustomersServiceRequest | This request gets the selected customer details. |
CustomersSearchServiceRequest | This request is run when you search for a customer from the POS. |
GetCustomerGroupsServiceRequest | This request gets the customer group details. |
InitiateLinkToExistingCustomerServiceRequest | This request is an internal request for backward compatibility. |
FinalizeLinkToExistingCustomerServiceRequest | This request is an internal request for backward compatibility. |
UnlinkFromExistingCustomerServiceRequest | This request is an internal request for backward compatibility. |
GetCustomerBalanceServiceRequest | This request gets the balance of the customer's account. |
GetOrderHistoryServiceRequest | This request gets the customer's order history. |
GetPurchaseHistoryServiceRequest | This request gets the history of the customer's recent purchases. |
CustomerSearchByFieldsServiceRequest | This request is run when you search customer by using fields such as name, phone number etc. (hint search). |
GetCustomerSearchFieldsServiceRequest | This request gets the list of customer search fields (hint fields). |
PricingService
Request | Purpose |
---|---|
CalculatePricesServiceRequest | This request calculates the price for each item that is added to the cart and on the search screen. |
CalculateDiscountsServiceRequest | This request calculates the discount for each item that is added to the cart. |
GetIndependentPriceDiscountServiceRequest | This request calculates the price for each item on the price check screen and in other non-transaction-related flows. |
ValidateDiscountsServiceRequest | This request validates the discount that is entered, based on the employee. |
GetAllPeriodicDiscountsServiceRequest | This request gets all the periodic discounts that are configured. |
GetDiscountCodesServiceRequest | This request gets all the discount codes that are configured. |
ProductService
Request | Purpose |
---|---|
ProductSearchServiceRequest | This request gets the product list, based on the search text from the POS. (This is an old request. For customization, use the new SearchProductsServiceRequest request instead.) |
GetProductServiceRequest | This request gets the product, based on the product ID. |
GetProductRefinersRequest | This request retrieves the product refiner values. |
ProductsService
Request | Purpose |
---|---|
GetProductsServiceRequest | This request gets the products, based on the products IDs that are provided. |
GetVariantProductsServiceRequest | This request gets specific variations of master type products. |
ReasonCodeService
Request | Purpose |
---|---|
GetReasonCodesServiceRequest | This request gets the required reason code for the workflow or POS operation. |
CalculateRequiredReasonCodesServiceRequest | This request calculates the required reason code for the workflow or POS operation. |
CalculateCartRequiredReasonCodesServiceRequest | This request calculates the required reason code for the cart workflow. |
CalculateDropAndDeclareTransactionRequiredReasonCodesServiceRequest | This request calculates the required reason code for the drop and tender declaration transaction. |
CalculateNonSalesTransactionRequiredReasonCodesServiceRequest | This request calculates the required reason code for the non-sales transaction, such as tender declaration. |
GetReturnOrderReasonCodesServiceRequest | This request gets the required reason code for the return transaction. |
ValidateReasonCodeLineForUpdateServiceRequest | This request validates the reason code lines that are added during the save cart request. |
ReceiptService
Request | Purpose |
---|---|
GetReceiptServiceRequest | This request gets the receipt type and generates the receipt data, based on the receipt type. |
GetCustomReceiptFieldServiceRequest | Override this request, and add custom logic for your custom fields that are added in the receipt. |
GetEmailReceiptServiceRequest | This request gets the formatted receipts that will be used for print and email scenarios. |
PopulateTaxSummaryIndiaServiceRequest | This request populates the tax summary for India transaction. |
SearchProductsService
Request | Purpose |
---|---|
SearchProductsServiceRequest | This request is run when you search for a product from the POS. |
TaxService
Request | Purpose |
---|---|
CalculateTaxServiceRequest | This request calculates taxes on the transaction. |
AssignTaxCodesServiceRequest | This request assigns tax codes on the transaction's taxable items before the tax calculation. The default tax calculation handler of the CalculateTaxServiceRequest request uses this message. |
PopulateTaxRatesRequest | This request populates tax rates for the recalled transaction. No tax percentage information is persisted for tax lines. This message handler restores the information. |
Workflow layer
On top of the Services layer is the Workflow layer. A workflow is a collection of services and business logic that together define business processes. For example, when a customer adds an item to the cart, you can use a workflow to get the price, do validation, check the inventory quantity, calculate shipping, calculate tax, and calculate discounts. You can customize the existing workflows, or you can create new workflows. You can even use a workflow to connect to a third-party system as part of your business processes.
Just like services, workflows use the request/response pattern. The request object inherited from the base CRT Request class. The response object inherited from the base CRT Response class. A workflow also has a request handler class that extends the WorkflowRequestHandler<TRequest, TResponse> class. To create a workflow, you create a request class and a response class, and you then create a request handler class that contains the business logic for the workflow.
For example, when you create a cash-and-carry transaction or a customer order, many different steps or workflows are completed before the order is created. One of the workflow steps in the order process is the Save cart request. The Save cart request workflow is responsible for saving any changes that are made to the cart from the POS. For example, when you add an item to the cart, change the quantity, and so on, anything that you do in the POS will cause a call to the SaveCart to save the changes to the POS and database.
Default workflows and handlers
The following table lists the default workflow requests and response. CRT services call the workflows request and response based on the operation you perform in POS. You can customize any of these workflows request and response according to your business scenario.
No comments:
Post a Comment