# Create an Intent

## Create Customer Intent to Buy Product

> Create a new intent for a customer to be notified when a product is back in stock. Unlike other API endpoints for Back in Stock, this API endpoint does not require an API Key.

```json
{"openapi":"3.0.3","info":{"title":"STOQ Public API","version":"1.0.0"},"servers":[{"url":"https://app.stoqapp.com/api/v1","description":"Production server"}],"paths":{"/intents.json":{"post":{"summary":"Create Customer Intent to Buy Product","description":"Create a new intent for a customer to be notified when a product is back in stock. Unlike other API endpoints for Back in Stock, this API endpoint does not require an API Key.","tags":["Intents"],"parameters":[{"in":"header","name":"X-Shopify-Shop-Domain","required":true,"schema":{"type":"string"},"description":"The Shopify shop domain (e.g. 'restock-rocket-demo.myshopify.com')"},{"in":"header","name":"Content-Type","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"Must be application/json"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["intent","customer"],"properties":{"intent":{"type":"object","required":["shopify_variant_id","shopify_product_id","channel","quantity","source"],"properties":{"shopify_variant_id":{"type":"integer","description":"The ID for the Shopify Variant"},"shopify_product_id":{"type":"integer","description":"The ID for the Shopify Product"},"shopify_market_id":{"type":"integer","description":"The ID for the Shopify Market (for multi-market stores)"},"channel":{"type":"string","enum":["email","sms","push"],"description":"The notification channel (email requires customer.email, sms requires customer.phone, push requires customer.push)"},"quantity":{"type":"integer","description":"The quantity of the Variant they want"},"source":{"type":"string","enum":["api"],"description":"Should be set to 'api'"}}},"customer":{"type":"object","properties":{"id":{"type":"string","description":"Optional customer id from previous API call response"},"name":{"type":"string","description":"Customer's name (Shop must be on standard plan or above)"},"email":{"type":"string","description":"Customer email address (required if channel is email)"},"phone":{"type":"string","description":"Customer phone number with country code but without '+' (required if channel is sms)"},"push":{"type":"string","description":"Push notification token (required if channel is push)"},"country_code":{"type":"string","description":"Country code for the customer phone number"},"country":{"type":"string","pattern":"^[a-z]{2}$","description":"Country in two letter code for the customer (improves phone number validation)"},"accepts_marketing":{"type":"boolean","description":"Whether the customer has agreed to receive email content from your online store"},"locale":{"type":"string","description":"Customer locale"},"shopify_market_id":{"type":"integer","description":"Customer's Shopify Market ID for multi-market stores"},"shopify_customer_id":{"type":"string","description":"Customer's Shopify ID"}}},"product":{"type":"object","description":"Product data is only needed if you have optin confirmation or alerts to your shop set up","properties":{"variant_count":{"type":"integer","description":"The number of variants the Shopify Product has"},"title":{"type":"string","description":"The title for the Shopify Product"},"variant_title":{"type":"string","description":"The title for the Shopify Variant"},"vendor":{"type":"string","description":"The vendor/brand of the product"},"sku":{"type":"string","description":"The SKU of the variant"}}}}}}}},"responses":{"200":{"description":"Request processed but with errors","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}},"201":{"description":"Intent created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"intents":{"type":"array","items":{"type":"object","description":"Created intent details"}},"errors":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"}}}}}}
```
