Based on my research, unfortunately, Shopify doesn’t provide a direct API for accessing their internal email domain validation logic that’s used in the checkout. However, I can help with a third-party service, DeBounce Integration by integrating the DeBounce into your Shopify forms API and adding your domain to the approved domain lists.
Here is the detailed info: https://debounce.io/integrations/shopify/
You can explore this code for further info.
async function validateEmailWithAPI(email) {
try {
const response = await fetch(`https://api.debounce.io/v1/?api=${YOUR_API_KEY}&email=${email}`);
const result = await response.json();
return result.debounce.result === 'Safe';
} catch (error) {
console.error('Email validation error:', error);
return false;
}
}
I hope this could helps.