# Working with Encoded Shopify Data

The Shopify data indexed by Nacelle is sourced from the Shopify Storefront Api. When Shopify sends the data to Nacelle, Shopify encodes the IDs, and Nacelle renames them. The two IDs below map to the same product in Shopify.

Shopify product.id
1234512345

Nacelle product.pimSyncSourceProductId
"Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEyMzQ1MTIzNDU="

# Using The Correct IDs

At times it may necessary to decode the IDs back to their original numeric values. This is particularly important when working with 3rd party apps, which rely on the original Shopify IDs.

# Decoding The IDs

The IDs sourced from the Shopify Storefront Api are base-64 encoded Global IDs, which take the form of:

"gid://shopify/Product/1234512345"
"gid://shopify/ProductVariant/678967896789"

The easiest way to decode the IDs is using one of the following methods.

const productId = Buffer.from(product.pimSyncSourceProductId, "base64")
  .toString("ascii")
  .split("/")
  .pop()
import { decode } from 'js-base64'

const productId = decode(product.pimSyncSourceProductID)
  .split("/")
  .pop()
}