## Syntax

This example shows the syntax:

JavaScript

```javascript
// This function returns a promise containing a deliveryEstimate
shipiumClient.productView(productId, postalCode, countryCode);
```

## Parameters

This table shows the parameters used:

| Parameter (type) | Description |
| --- | --- |
| **productId (string)** | The `productId` for which a delivery estimate should be provided. This can be any unique identifier such as ISBN or UPC.<br>- _Note:_\* You must use a consistent identifier throughout the order and shipment lifecycle. |
| **postalCode (string)** | The postal code to be used to calculate a delivery estimate. For US zip codes, zero-padded zip5 strings must be used. |
| **countryCode (string)** | The two character Alpha-2 ISO 3166 country code. |

## Return value (promise)

This example shows the parameters promise returned:

JSON

```json
{
    deliveryEstimateDate: '2020-04-08T20:00:00-04:00',
    deliveryEstimateId: 'cf66e167-fcba-4dbd-85fc-bfce8a24bae2',
    customerCountryCode: 'us',
    customerPostalCode: '98110',
    productId: '123456',
    options: {
      shippingOptions: {
        shipOption: 'Standard',
        fromCountry: 'US',
        fromPostalCode: '00000'
      }
    },
    formattedDeliveryEstimateMessage: 'tomorrow at 5:00 PM'
  }
```

## Example usage

This example shows the usage:

JavaScript

```javascript
// promise
window.shipiumClient.productView('123456789-12', '98110', 'us').then(function(deliveryEstimate) {   // Get an HTML element to append the delivery message to into
  var shipiumDiv = document.getElementById("shipium-delivery-estimate");
  // Create a text node with the delivery estimate
  var shipiumContent = document.createTextNode('Get it by ' + deliveryEstimate.formattedDeliveryEstimate);
  // add the text node to the element
  shipiumDiv.appendChild(shipiumContent);
});
```

> 📘
>
> ### More information on the API responses
>
> As with all Shipium API responses, this API follows the [API Response Codes](https://docs.shipium.com/docs/api-response-codes) standards unless otherwise specified.

Updated 7 months ago
