Delivery Estimate Rest API - V3.

80% of the shoppers make buying decisions based on ship cost and delivery speed during pre-purchase. Fenix Delivery Experience Platform enables retailers to offer a personalized delivery experience to their customers through the entire shopping journey from pre-purchase to post-purchase.

Pre-requisites before making API requests to Fenix Delivery Experience Platform

  1. Carrier Information: The retailer should provide the current Carriers, the services opted for, carrier account information, or rate cards ( any specific). Kindly configure the carrier account information for fulfillment location-specific carrier accounts at a fulfillment location to get the most accurate rates. Global Credentials are always on priority.

  2. Fulfillment locations: Configure all the USA Fulfillment locations, including DC/Store, in the Business Console

    1. Lead Time (Time required to pick/pack/ship) for each fulfillment location after the order gets allocated

    2. Shipment Pick-up times for each carrier or by carrier service.

    3. Cut-off Time for the location

    4. Holidays for the location

  3. Inventory and Product: Various channels to share the inventory and product information with Fenix. Fenix's technical team helps you to choose the most appropriate method via SFTP/S3/Rest API.

  4. Integration varies from platform to platform. In the case of Bigcommerce or Shopify Fenix team will install the private app in the checkout, then retailer-specific PDP and CART Rest API endpoints will be provided by the Fenix team.

Integration Architecture

Zipcode Detection API

Fenix recommends zipcode detection on the PDP page load. If an existing API detects the buyer's zipcode using the customer IP address, kindly pass the zipcode as input to the Fenix EDD API. If not, please use fenix recommended zipcode detection API

API : https://ipapi.co/json/?key=<APIKEY>

  • Note: The API key needs to be purchased from the above vendor.

Delivery Estimate Rest API

Request & Response formats
  • All the request and response formats are accepted in application/JSON

API

/fenixdelest/api/v3/deliveryestimates

Method

POST

Request Headers

 

  • tenantId : mdnf79df0n89na1f2ce434b8861c0fab14fb813

  • Content-Type: application/json

  • x-api-key: mdnf79df0n89na1f2ce434b8861c0fab14fb813

Request body sample

{ "buyerZipCode": "string", "sessionTrackId": "string", "orderId": "string", "cartId": "string", "pageType": "string", "monetaryValue": 0, "responseFormat": "string", "additionalProcessing": true, "skus": [ { "sku": "string", "quantity": 0, "category": "string", "productName":"string", "leadTime": 0, "dimensions": { "height": 0, "length": 0, "thickness": 0, "units": "CM/IN", "width": 0 }, "skuInventories": [ { "locationId": "string", "quantity": 0 } ], "weight": { "units": "LB", "value": 0 } } ], "shippingInfo": { "carrier": "string", "trackId": "string", "shippingDate": "2021-03-02T08:56:39-06:00", "service": { "name": "string", "method": "string" } } "buyerAddress": { "name": "string", "state": "string", "zipcode": "string", "address1": "string", "address2": "string", "city": "string", "country": "string" } }

Response body sample

{ "sessionId": null, "responseTimeInMs": 0, "eddResponses": [ { "webId": "string", "hours": "string", "minutes": "string", "response": "string", "shippingCost": { "amount": 0, "currency": "USD" }, "buyerZipCode": "string", "deliveryZone": "string", "shippingDateTime": "string", "shippingMethodDesc": "string", "internationalOrder": false, "formattedDeliveryDate": "string", "guaranteedDeliveryDate": "string", "errorMessage": null, "packages": [ { "carrier": "string", "wrapperType": "string", "shipperLocId": "string", "deliveryDate": "string", "shippingDate": "string", "shipperZipCode": "string", "shippingMethod": "string", "actualMethodDesc": "string", "externalShippingMethod": null, "contents": null } ], "shipCostBreakUp": { "breakups": [ { "name": "string", "charges": { "amount": 0, "currency": "USD" } } ] }, "orderRoutingInfo": [ { "sku": "string", "location_id": "string" } ], "shippingDeliveryDate": "string" } ] }

 

Request Body Attribute Definitions 

Attribute

Description

sessionTrackId

mandatory

"sessionTrackId":"123123-2323-1231-23123"

  • Unique session track id generated on per session basis on client side

orderId

 

"orderId": "123123123"

  • Order Id generated by the retailer system

cartId

"cartId": "123123123"

  • A Cart Id generated by the retailer system

buyerZipCode

mandatory

"buyerZipCode" : "95129"

  • The zip of the item's buyer.

pageType

mandatory

"pageType": "cop"

  • Rules are tied to page type value.

E.g., Show fastest EDD on PDP and show all EDD options on COP.

PDP - Product Detail Page

CART - CART page/shopping Bag page

COP - Check out Page

MC - Mini Cart

CA - Cart Abandonment

OC - Order Confirmation

SC - Shipping Confirmation

Send Values as part of a delivery estimate request

moneytoryValue

mandatory

"monetaryValue": 50.0

  • Item price in PDP or the total cart in cart or total checkout value at checkout

responseFormat

 

"responseFormat" : "json"

  • The attribute provides the desired delivery estimate response format. Allowed formats are “Json” and “binary.” The default response format is JSON.

additionalProcessing

"additionalProcessing": true

  • True if a particular item required additional processing time than normal SKU

skus

mandatory

 

"skus": [ { "sku": "SKU-001", "leadTime": 0, "nonShip": false, "quantity": 1, "dimensions": { "height": 3, "length": 3, "width": 0, "thickness": 6, "units": "CM/IN" }, "skuInventories": [ { "locationId": "Dc-01", "quantity": 1 } ], "weight": { "units": "LB", "value": 0 } } ]
  • sku (mandatory): The item's SKU (stock keeping unit).

  • leadTime (optional): The time required to prepare the item to ship

  • productName (optional): The name of the product

  • category (optional): The category name of the product

  • quantity (mandatory): The number of items that were chosen to buy.

  • dimensions (optional):  The dimensions and weight of the item along with unit of measurement. Required only when there is no product & inventory sync integration with Fenix Commerce

  • skuInventories (mandatory): Inventory location and quantity details of SKU. This field serves as the routing information for this order

  • locationId (mandatory): The physical location (DC/Store ID) of the item. Required only when there is no product & inventory sync integration with Fenix Commerce

  • quantity (mandatory):The total quantity

  • weight (optional): The total weight of the item

buyerAddress

mandatory

  • name (optional): Full name of the buyer

  • address1 (optional): The street address of the buyer address.

  • address2 (optional): An optional additional field for the street address of the buyer address.

  • city (optional): The city, town, or village of the buyer address

  • state (optional): The state of the buyer address

  • country (mandatory): The country code of the buyer address. It should be two letter ISO country code

  • zipcode (mandatory): The postal code (zip, postcode, Eircode, …) of the buyer address.

 

shippingInfo

mandatory

  • carrier (mandatory): The carrier that is being used to ship the order with

  • trackId (optional): The tracking number for the order

  • shippingDate (optional): The actual shipping date for the order

  • service/name (optional): The name of the service being used for shipping

  • service/method (mandatory): The shipping method the order is being shipped with

Response Attribute Definitions

Delivery Estimates response vary from the type of rule configured in the business console.

Attribute

Description

eddResponses

This field contains a list of shipping estimates

webId

"webId": "0194NCOS"

  • The item's SKU (stock keeping unit).

hours

"hours": "2"

minutes

"minutes": "1"

  • Total min leftover for to order an item before configured cutoff time

carrier

"carrier": "fedex"

  • The name of the recommended shipping carrier

Response

"response": "Order within <span class=fenix-resp-span-time>2 hrs 1 mins</span><br>Get it by <span class=fenix-resp-span-date>Fri, May 21</span> with <span class=fenix-resp-span-shippingname>Federal Express </span>" E.g. Order within 2 hrs 1 mins Get it by Fri, May 21 with Federal Express ·      

  • The formatted response required to paint the Estimated Delivery Date (EDD) on required page types. This format can be changed through Fenix business console

 

shippingCost

"shippingCost": {
            "amount": 0.00 ,
            "currency": "USD"
        }

  • Amount : The shipcost need to pay by buyer

  • Currency: The shipcost currency format

shipperLocId

"shipperLocId": null,

  • The shipping location Id of the retailer’s DC/Store

buyerZipCode

"buyerZipCode": "10001"

  • The zipcode of the customer

shipperZipCode

"shipperZipCode": "10001",

  • The shipping location zipcode of the retailer’s DC/Store

shippingMethod

"shippingMethod": null,

  • The shipping method to choose by retailer

shippingDateTime

"shippingDateTime": "19 May 2021, 19:00",

  • The shipping date time of the shipment by a retailer

actualMethodDesc

"actualMethodDesc": "Fedex Ground" ,

  • The actual method description of a shipping method

shippingMethodCode

"shippingMethodCode": "Free Standard Delivery"

  • The shipping method code delivery date to show it to end customer

shippingMethodDesc

"shippingMethodDesc": "Free Standard Delivery"

  • The shipping method description

ShippingDeliveryDate

"shippingDeliveryDate": "Wed, 26 May 2021"

·       The minimum delivery date that item will be delivered. In few cases this will be date range

formattedDeliveryDate

"formattedDeliveryDate": "Wed, May 26" ·       The formatted delivery date to show it to end customer on various pages

guaranteedDeliveryDate

"guaranteedDeliveryDate": "Wed, 26 May 2021" ·       The guaranteed delivery date provided by Fenix Commerce

errorMessage

"errorMessage": null,

  • The delivery estimate error responses in case of inventory not found , tenant disabled etc

Packages

"packages": [{

            "carrier": "DHL",

            "wrapperType": "DEFAULT",

            "shipperLocId": "manual",

            "shipperZipCode": "90058",

            "actualMethodDesc": "DHL SM Parcel Ground",

            "contents": {

                        "0194NCOS": 100

            }

}]

 

The number of shippable packages information per service response basis

  • Carrier: The name of the carrier

  • wrapperType: The package or box type need to be used to ship the package

  • shipperLocId: The DC/Store unique Id

  • shipperZipCode: The DC/Store zipcode

  • actualMethodDesc: The actual shipping method description

  • contents: The sku and quantity information in particular package

"SKU":quantity

pickUpTimes

 

"pickUpTimes": {
            "81": "05-19-2021 19:00",
            "82": "05-19-2021 19:00"
        }

·       The configured pickup time of each shipping service method code

"shipping service method code" : "Configured pickup time."

pickFromStoreResponse

This field contains a list of pick up responses

locationsWithIn

This field shows the distance (in miles) within which the fulfillment locations are considered

storeInfos

This field contains a list of stores the customers can go and pick up their order

locId

The location Id of the pick up store

address

The address of the pick up store

distance

The distance of the store to the buyer

pickUpCost

This field lets the user know if there is any cost associated with the pick up

mapsRoute

Shows the Google Maps url

leadTimeForPickUp

This field tells the customers how soon they can pick the order after it is placed

lineItems

The products that are included in this pick up

workingHours

This field tells you the working hours of the store.

 

The above request is a Fenix commerce master request with all the attributes the request body will change based on the retailer, such as inventory product feed integration.

PDP Integration Procedure

Precheck

  • Restrict the delivery estimates to only USA region and for only USA Customers

  • Don't make a delivery estimate call if the item is out of stock and other exceptional handling cases

Signed User

Guest User

  • Zipcode detection starts with https://ipapi.com/ , and the rest of the procedure is the same as above

Delivery Estimate Call

  • Call Fenix delivery estimate API after product images and variants get loaded in the PDP Page

  • Pass product price, SKU Id, Unique sessionTrackId, and buyer Zipcode to below API. It applies when the buyer selects a different variant on the PDP page as well

  • Page type should be PDP when the call is initiated from the PDP page

  • sessionTrackId should generate one per session and pass the same PDP and CART delivery estimate requests. sessionTrackId should live until customers sign out of the website or close the browser/tab

Sample PDP API Integration Details

  • Show fastest estimates at CART level

API

/fenixdelest/api/v3/deliveryestimates

Request Headers

 

  • tenantId : mdnf79df0n89na1f2ce43dfsfds4b8861c0fab14fb813

  • Content-Type: application/json

  • x-api-key: mdnf79df0n89na1f2ce434b8861ckkndfsdk0fab14fb813

Request Body Sample:

 

Response Body Sample

 

 

CART and Checkout Page Integration Procedure 

Precheck

  • Restrict the delivery estimates to only USA region and for only USA Customers

  • Don't make a delivery estimate call if the item is out of stock and other exceptional handling cases

CART API Details

  • Show fastest estimates at CART level

API

/fenixdelest/api/v3/deliveryestimates

Request Headers

 

  • tenantId : mdnf79df0n89na1f2ce43dfsfds4b8861c0fab14fb813

  • Content-Type: application/json

  • x-api-key: mdnf79df0n89na1f2ce434b8861ckkndfsdk0fab14fb813

Request Body Sample:

 

Response Body Sample

 

 

Checkout Page Request and Response

API

/fenixdelest/api/v3/deliveryestimates

Method

POST

Request Headers

 

  • tenantId : mdnf79df0n89na1f2ce434b8861c0fab14fb813

  • Content-Type: application/json

  • x-api-key: mdnf79df0n89na1f2ce434b8861c0fab14fb813

Request Body

 

Respone Body

 

 

Exception Use Cases :

Use Case

HTTP Status Code

Response Payload

Use Case

HTTP Status Code

Response Payload

Invalid Inventory

400

{
"error_code": "600",
"identifier": "INVALID_INVENTORY",
"error_message": "Inventory is not found for these items: 11001-BU-345",
"description": "Invalid Inventory"
}

Invalid TenantId

400

{
"error_code": "400",
"identifier": "INVALID_PARAMETERS",
"error_message": "Organization or Organization Config is null for tenantId: 986ca45fb2254e9f9cf1faf4c8c103501\n",
"description": "Delivery Estimates requested parameters should not be null"
}

Invalid Zipcode

400

{
"error_code": "400",
"identifier": "INVALID_PARAMETERS",
"error_message": "Invalid Buyer Zipcode: 101\n",
"description": "Delivery Estimates requested parameters should not be null"
}

Invalid Page Type

400

{
"error_code": "400",
"identifier": "INVALID_PARAMETERS",
"error_message": "Please provide a valid page type, it should be any of PDP/CART/COP/MC/CA/OC/SC",
"description": "Delivery Estimates requested parameters should not be null"
}

Invalid Product Info

400

{
"error_code": "400",
"identifier": "INVALID_PARAMETERS",
"error_message": "Product Info should not be null/empty",
"description": "Delivery Estimates requested parameters should not be null"
}