Stoq HTTP API Documentation
We provide HTTP APIs for Stoq. This can be used to integrate Stoq into custom themes or headless Shopify installations.
You can also follow this Postman link to look at the documentation in an interactive format.
Store Customer Intent to Buy Product
POST https://app.restockrocket.io/api/v1/intents.json
You can also follow this Postman link to look at the documentation in an interactive format.
// Headers
{
"X-Shopify-Shop-Domain": 'restock-rocket-demo.myshopify.com',
"Content-Type": 'application/json',
}
// Body
{
"intent": { // The Product Variant the customer intends to buy
"shopify_variant_id": 111111111, // The ID for the Shopify Variant
"shopify_product_id": 222222222, // The ID for the Shopify Product
// The channel they are subscribing on either email (requires customer.email to be filled),
// sms (requires customer.phone to be filled) or push (requires customer.push to be filled)
"channel": "email",
"quantity": 2, // The quantity of the Variant they want
"source": "api" // Don't change this
},
"customer": { // Customer details
// Customer id that you can get from a previous API call response
// Sending id makes it so that the same customer is updated instead of a new one created
// if there are new or different details in this call
// "id": "1861e9da-13c8-4fdb-93d2-1ca5dc4ecbe8",
"email": "support@restockrocket.io", // Customer email address
"phone": "918123676393", // Customer phone number with country code but without '+'
"country_code": "91", // Country code for the customer phone number (not required)
"country": "in", // Country in two letter code for the customer (not required but improves phone number validation)
"accepts_marketing": true, // Whether the customer has agreed to receive email content from your online store
"locale": "en" // Customer locale
},
"product": { // Product data is only needed if you have optin confirmation or alerts to your shop set up
"variant_count": 3, // The number of variants the Shopify Product has
"title": "Shirt", // The title for the Shopify Product
"variant_title": "Green" // The title for the Shopify Variant
}
}
Updated on: 12/09/2024
Thank you!