> For the complete documentation index, see [llms.txt](https://docs.stoqapp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoqapp.com/back-in-stock-api/create-an-intent.md).

# 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"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stoqapp.com/back-in-stock-api/create-an-intent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
