---
title: "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."
url: https://docs.stoqapp.com/v1/back-in-stock/create-customer-intent-to-buy-product/
api: "API v1 (legacy)"
method: POST
path: "/intents.json"
---

# Create customer intent to buy product

`POST https://app.stoqapp.com/api/v1/intents.json`

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.

## Headers

- `X-Shopify-Shop-Domain` (string, required): The Shopify shop domain (e.g. 'restock-rocket-demo.myshopify.com')
- `Content-Type` (string, required): Must be application/json One of: `application/json`.

## Request body

- `intent` (object, required)
  - `shopify_variant_id` (integer, required): The ID for the Shopify Variant
  - `shopify_product_id` (integer, required): The ID for the Shopify Product
  - `shopify_market_id` (integer): The ID for the Shopify Market (for multi-market stores)
  - `channel` (string, required): The notification channel (email requires customer.email, sms requires customer.phone) One of: `email`, `sms`.
  - `quantity` (integer, required): The quantity of the Variant they want
  - `source` (string, required): Should be set to 'api' One of: `api`.
- `customer` (object, required)
  - `id` (string): Optional customer id from previous API call response
  - `name` (string): Customer's name (Shop must be on standard plan or above)
  - `email` (string): Customer email address (required if channel is email)
  - `phone` (string): Customer phone number with country code but without '+' (required if channel is sms)
  - `country_code` (string): Country code for the customer phone number
  - `country` (string): Country in two letter code for the customer (improves phone number validation)
  - `accepts_marketing` (boolean): Whether the customer has agreed to receive email content from your online store
  - `locale` (string): Customer locale
  - `shopify_market_id` (integer): Customer's Shopify Market ID for multi-market stores
  - `shopify_customer_id` (string): Customer's Shopify ID
- `product` (object): Product data is only needed if you have optin confirmation or alerts to your shop set up
  - `variant_count` (integer): The number of variants the Shopify Product has
  - `title` (string): The title for the Shopify Product
  - `variant_title` (string): The title for the Shopify Variant
  - `vendor` (string): The vendor/brand of the product
  - `sku` (string): The SKU of the variant

## Returns

- `errors` (array of strings)

Rate limit: this call costs 2 points ([rate limits](https://docs.stoqapp.com/docs/rate-limits/)).

## Example request

```sh
curl -X POST "https://app.stoqapp.com/api/v1/intents.json" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "intent": {
      "shopify_variant_id": 43900910010503,
      "shopify_product_id": 7891234567890,
      "channel": "email",
      "quantity": 1,
      "source": "api"
    },
    "customer": {
      "email": "shopper@example.com",
      "name": "Alex Shopper",
      "accepts_marketing": true,
      "country": "us"
    }
  }'
```

## 200

Request processed but with errors

```json
{
  "errors": [
    "string"
  ]
}
```

## 201

Intent created successfully

```json
{
  "intents": [
    {
      "channel": "email",
      "email": "shopper@example.com",
      "phone": null,
      "quantity": 1,
      "source": "api",
      "type": "restock",
      "optin_confirmed": false,
      "notified_at": null,
      "shopify_product_id": 7891234567890,
      "shopify_variant_id": 43900910010503,
      "shopify_market_id": null,
      "country": null,
      "created_at": "2026-06-20T14:30:00Z",
      "customer": {
        "id": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
      }
    }
  ],
  "errors": []
}
```

## 400

Bad request

## 401

Unauthorized

