Dynamics 365 Retail - CRT Services - Song Nghia - Microsoft Dynamics Partner

Song Nghia - Microsoft Dynamics Partner

Song Nghia - Microsoft Dynamics Partner

Breaking

Sunday, September 18, 2022

Dynamics 365 Retail - CRT Services

 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

ServiceDescription
AddressServiceThis service verifies addresses and gets location information, such as cities, counties, or states.
BarcodeServiceThis service processes the barcode that was scanned, based on the mask and barcode types, and calculates the quantity and price from the barcode.
CartServiceThis service gets the cart from the transaction and sales transaction service from the transaction tables.
ChargeServiceThis service implements logic that calculates automatic charges, price charges, and shipping charges for transactions.
CouponServiceThis service validates and updates coupon-related requests.
CurrencyServiceThis service converts currencies, based on exchange rates.
CustomerServiceThis service contains customer related operations such as Save customer, purchase history, get customer and customer balance.
EmployeeServiceThis service gets employee-related information and employees by store.
FormattingServiceThis service implements logic for the format of numbers, currencies, and dates.
GiftCardServiceThis service provides information about internal activities that are related to gift cards, such as issuing the gift card, getting the balance, and adding value.
LoyaltyServiceThis service implements a program that rewards repeat customers.
NotificationServiceThis service maintains the POS notification service.
PaymentServiceThis 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.
ProductServiceThis service gets product-related and variant-related information.
ProductsServiceThis service gets information that is related to products and variants.
PricingServiceThis 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.
ProductAvailabilityServiceThis service calculates the quantities of products that are available to sell.
ReasonCodeServiceThis service calculates and gets the required reason code for POS operations or any workflow.
ReceiptServiceThis service gets and formats the receipt details.
RoundingServiceThis service rounds the tender amount, based on the tender type and store.
SalesOrderServiceThis service creates a sales order, based on a customer shopping cart.
SearchProductsServiceThis service searches products, based on the input text.
ShippingServiceThis service calculates shipping costs and determines shipping options for the current order.
StockCountServiceThis service creates, commits, and synchronizes stock journals.
StoreOperationServiceThis service maintains store-related operation services, such as Save and Drop, Tender declaration, and Search journal.
TaxServiceThis service calculates the sales tax for the current order. You can use sales tax information provided, or from a third-party sales tax service.
TotalingServiceThis 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.

RequestPurpose
GetCountryRegionsServiceRequestThis request gets the list of countries and regions that are supported.
GetStateProvincesServiceRequestThis request gets the list of states or provinces that are supported for the country or region.
GetCitiesServiceRequestThis request gets the list of cities that are supported for the state or region.
GetDistrictServiceRequestThis request gets the list of districts that are supported.
GetZipCodesServiceRequestThis request gets the list of ZIP Codes that are supported.
GetFromZipPostalCodeServiceRequestThis request gets the list of postal codes supported.
GetAddressFormattingServiceRequestThis request gets the address format for the specified country or region.

BarcodeService

RequestPurpose
ProcessMaskSegmentsServiceRequestThis request processes the barcode, based on the barcode mask configuration.
GetBarcodeTypeServiceRequestThis request gets the types of barcodes that are supported.
CalculateQuantityFromPriceServiceRequestThis request calculates the price and quantity, based on the barcode that is scanned or entered.

CartService

RequestPurpose
GetSalesTransactionsServiceRequestThis request gets the sales transaction from Headquarters.
GetCartServiceRequestThis request gets the cart from the sales transaction table by using the cart ID.
CalculateSalesTransactionServiceRequestThis request calculates the various sales transaction totals, based on the specified calculation mode.
CalculateEstimatedShippingAuthorizationAmountServiceRequestThis request calculates the estimated shipping authorization amount on the transaction.
ConvertSalesTransactionToCartServiceRequestThis request converts the sales transaction to a cart transaction, based on transaction ID that is passed.

CouponService

RequestPurpose
UpdateCouponCodesOnCartServiceRequestThis request updates the coupon codes status in Headquarters, based on the coupons that are used in the cart.
ValidateCouponCodesServiceRequestThis request validates the coupon code that is entered in the transactions.
UpdateCouponUsageServiceRequestThis request updates coupon usage for the transaction.

CustomerService

RequestPurpose
SaveCustomerServiceRequestThis request is called when you save a customer from the POS.
GetCustomersServiceRequestThis request gets the selected customer details.
CustomersSearchServiceRequestThis request is run when you search for a customer from the POS.
GetCustomerGroupsServiceRequestThis request gets the customer group details.
InitiateLinkToExistingCustomerServiceRequestThis request is an internal request for backward compatibility.
FinalizeLinkToExistingCustomerServiceRequestThis request is an internal request for backward compatibility.
UnlinkFromExistingCustomerServiceRequestThis request is an internal request for backward compatibility.
GetCustomerBalanceServiceRequestThis request gets the balance of the customer's account.
GetOrderHistoryServiceRequestThis request gets the customer's order history.
GetPurchaseHistoryServiceRequestThis request gets the history of the customer's recent purchases.
CustomerSearchByFieldsServiceRequestThis request is run when you search customer by using fields such as name, phone number etc. (hint search).
GetCustomerSearchFieldsServiceRequestThis request gets the list of customer search fields (hint fields).

PricingService

RequestPurpose
CalculatePricesServiceRequestThis request calculates the price for each item that is added to the cart and on the search screen.
CalculateDiscountsServiceRequestThis request calculates the discount for each item that is added to the cart.
GetIndependentPriceDiscountServiceRequestThis request calculates the price for each item on the price check screen and in other non-transaction-related flows.
ValidateDiscountsServiceRequestThis request validates the discount that is entered, based on the employee.
GetAllPeriodicDiscountsServiceRequestThis request gets all the periodic discounts that are configured.
GetDiscountCodesServiceRequestThis request gets all the discount codes that are configured.

ProductService

RequestPurpose
ProductSearchServiceRequestThis 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.)
GetProductServiceRequestThis request gets the product, based on the product ID.
GetProductRefinersRequestThis request retrieves the product refiner values.

ProductsService

RequestPurpose
GetProductsServiceRequestThis request gets the products, based on the products IDs that are provided.
GetVariantProductsServiceRequestThis request gets specific variations of master type products.

ReasonCodeService

RequestPurpose
GetReasonCodesServiceRequestThis request gets the required reason code for the workflow or POS operation.
CalculateRequiredReasonCodesServiceRequestThis request calculates the required reason code for the workflow or POS operation.
CalculateCartRequiredReasonCodesServiceRequestThis request calculates the required reason code for the cart workflow.
CalculateDropAndDeclareTransactionRequiredReasonCodesServiceRequestThis request calculates the required reason code for the drop and tender declaration transaction.
CalculateNonSalesTransactionRequiredReasonCodesServiceRequestThis request calculates the required reason code for the non-sales transaction, such as tender declaration.
GetReturnOrderReasonCodesServiceRequestThis request gets the required reason code for the return transaction.
ValidateReasonCodeLineForUpdateServiceRequestThis request validates the reason code lines that are added during the save cart request.

ReceiptService

RequestPurpose
GetReceiptServiceRequestThis request gets the receipt type and generates the receipt data, based on the receipt type.
GetCustomReceiptFieldServiceRequestOverride this request, and add custom logic for your custom fields that are added in the receipt.
GetEmailReceiptServiceRequestThis request gets the formatted receipts that will be used for print and email scenarios.
PopulateTaxSummaryIndiaServiceRequestThis request populates the tax summary for India transaction.

SearchProductsService

RequestPurpose
SearchProductsServiceRequestThis request is run when you search for a product from the POS.

TaxService

RequestPurpose
CalculateTaxServiceRequestThis request calculates taxes on the transaction.
AssignTaxCodesServiceRequestThis 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.
PopulateTaxRatesRequestThis 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.

RequestHandlerPurpose
AddOrderInvoiceToCartRequestAddOrderInvoiceToCartRequestHandlerThis request adds the invoice to the cart as a cart line.
AddOrRemoveDiscountCodesRequestAddOrRemoveDiscountCodesRequestHandlerThis request adds discount codes to the cart or removes them from the cart.
CancelOrderRequestCancelOrderRequestHandlerThis request is triggered when you cancel an order from the POS.
CopyCartRequestCopyCartRequestHandlerThis request creates an identical shopping cart that has the specified cart type.
GetAddressRequestGetAddressRequestHandlerThis request gets the address from the list.
GetCardPaymentAcceptPointRequestGetCardPaymentAcceptPointRequestHandlerThis request shows the accepting page for card payment.
GetCartRequestGetCartRequestHandlerThis request gets the shopping cart, based on the cart search criteria.
GetDiscountCodesRequestGetDiscountCodesRequestHandlerThis request gets the discount codes.
GetOrdersRequestGetOrdersRequestHandlerThis request gets sales orders.
GetPromotionsRequestGetPromotionsRequestHandlerThis request gets the shopping cart together with promotion lines for the cart and the cart items.
GetScanResultRequestGetScanResultRequestHandlerThis request gets the entity details, based on the details that are scanned or typed.
GetSupportedCardTypesRequestGetSupportedCardTypesRequestHandlerThis request retrieves the cart types that are supported for the specified currency.
IssueOrAddToGiftCardRequestIssueOrAddToGiftCardRequestHandlerThis request issues a gift card or adds to a gift card's balance.
PickAndPackOrderRequestPickAndPackOrderRequestHandlerThis request represents a request for picking list creation and packing slip creation for a customer order.
PickupAtStoreRequestPickupAtStoreRequestHandlerThis request represents a request for pick-up at the store.
RecalculateOrderRequestRecalculateOrderRequestHandlerThis request represents a request for the recalculate order workflow.
RecallCustomerOrderRequestRecallCustomerOrderRequestHandlerThis request gets sales orders and converts them into a cart.
RecallSalesInvoiceRequestRecallSalesInvoiceRequestHandlerThis request gets invoices.
ResumeCartRequestResumeCartRequestHandlerThis request represents a request to resume a cart that was suspended.
SaveCartLinesRequestSaveCartLinesRequestHandlerThis request represents a request for create, update, delete, or void operations on the cart line.
SaveCartRequestSaveCartRequestHandlerThis request is triggered when you make any changes in that POS that affect the cart.
SaveCustomerOrderRequestSaveCustomerOrderRequestHandlerThis request initiates a request to save the customer order, based on the specified cart identifier and payment card information.
SaveReasonCodeLineRequestSaveReasonCodeLineRequestHandlerThis request adds or updates a reason code on the cart line.
SaveTenderLineRequestSaveTenderLineRequestHandlerThis request adds, removes, or updates a tender line for the given shopping cart.
SaveVoidTransactionRequestSaveVoidTransactionRequestHandlerThis request voids a transaction.
SubmitSalesTransactionRequestSubmitOrderRequestHandlerThis request initiates a request to submit the sales transaction, based on the specified cart identifier.
SuspendCartRequestSuspendCartRequestHandlerThis request represents a request to suspend the cart.
TransferCartRequestTransferCartRequestHandlerThis request transfers the specified shopping cart.
UpdateCommissionSalesGroupRequestUpdateCommissionSalesGroupHandlerThis request encapsulates a request for updating the sales representative on the cart or the cart line.
UploadOrderRequestUploadOrderRequestHandlerThis request uploads the sales order.
ValidateCartForCheckoutRequestValidateCartForCheckoutRequestHandlerThis request validates the cart for checkout.



No comments:

Post a Comment