Delivery dates in an external Magento 2 frontend: plan the REST integration

3 min read

Four silver product, customer-cart, guest, and order contexts connected by blue lines to a server and turquoise calendar

An external frontend needs the appropriate estimate, not just a date from any endpoint. A product, guest cart, and historical order have different contexts. Start Kowal Estimated Delivery Date integration with the REST contract, access, and result presentation.

Choose one of four GET contexts

In reviewed version 1.0.24, webapi.xml declares these routes. A conventional Magento installation uses the prefix /rest/<store_view_code>; Adobe’s documentation distinguishes this model from Commerce as a Cloud Service. The table shows source declarations, not confirmation of deployment in every store.

ContextGET routeAccess declaration
Product/V1/estimated-delivery/product/:skuanonymous
Customer cart/V1/estimated-delivery/cart/:cartIdself
Guest cart/V1/estimated-delivery/guest-cart/:cartIdanonymous
Order/V1/estimated-delivery/order/:orderIdMagento_Sales::actions_view

The self declaration requires a customer but does not itself establish ownership checks for the supplied cart. The reviewed method fetches by ID without an explicit owner comparison. Provide that check before connecting a frontend and test refusal using two synthetic accounts. Adobe documents ownership verification separately.

Guests use a masked cart identifier, not the internal numeric ID. Protect it from disclosure and public logs. The order endpoint requires the stated administrator or integration permission; it is not a public customer-account API. Serve storefront access through a server layer with ownership checks, without a privileged token in the browser. Do not equate internal order ID with the customer-facing order number.

Separate current calculations from stored promises

Product estimates have a storeId parameter, while carts carry their own store and item context. Align the request’s Store View with the actual cart. For orders, the service first looks for a stored promise: source is then snapshot. When none exists, it calculates and marks the result calculated. Do not present both paths as the same historical promise.

REST does not provide a ready PWA component or GraphQL. Module documentation lists those integrations and full checkout shipping-rate integration as further development. The frontend must separately decide when to refresh after product, quantity, or cart-data changes and keep results in the correct context.

Confirm JSON and field meaning before building a parser

The service and README describe ship_date and delivery_date with from/to bounds, plus confidence, message, rule_code, calculated_at, and source. Shipping date differs from delivery date. The interface declares mixed[], so a README example does not replace checking actual serialized JSON in the target installation. Inspect the local REST contract and a test-environment network response.

Handle empty date bounds and missing messages. Do not turn a confidence label into a percentage guarantee. Agree on language, date format, and time zone; do not shift calendar dates through accidental browser-time conversion. Separate caches by context, store, and relevant cart state, not just SKU.

Accept context, access, and data changes

Plan tests for a product in two views, an owned cart, refusal for another synthetic customer, valid and unknown guest masks, and orders with and without stored promises. Compare responses with presentation and behavior after cart changes. This source inspection is not a performed authorization or serialization test of a production API.

Kowal Estimated Delivery Date supplies estimates; accept calendars and cut-off using the earlier guide. Connect dates with shipping-method availability checks and, after ordering, pending-payment messaging. An estimate alone confirms neither carrier availability nor receipt of payment.

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)