JavaScript API
Available APIs
Page Type
Available APIs
openModal
openModal(productData, variantId, customerData)
const addToCartBtn = document.getElementById('quick-add-btn');
addToCartBtn.addEventListener('click', () => {
const productData = { id: 1111, variants: [{ id: 2222, available: false }] };
const variantId = '41XX';
const customerData = {
shopify_customer_id: 9999,
email: '[email protected]',
phone: '8123999123', // phone number
country_code: '1', // country code
country: 'us' // 2 letter ISO country code
} // Optional
window._RestockRocket.openModal(productData, variantId, customerData);
// Alternative: Using Liquid objects directly in Javascript
// window._RestockRocket.openModal({{ product | json }}, '{{ product.selected_or_first_available_variant.id }}');
});openInlineForm
openInlineForm(productData, variantId, customerData, inlineFormContainer, inlineFormContainerInsertType)
removeInlineForm
renderButtonForVariant
renderButtonForVariant(variantId)
getSellingPlan
getSellingPlan(variantId)
Integration Examples
Quick Add Button on Collection Page
Notify Me Button on Product Page
Custom Integration on Product Page
marketId
Last updated