Notify a single intent
API v1 is the older API. It still works, but new integrations should use API v2. Migrating from v1 to v2
POST
/external/intents/notify_intentCosts 2 rate-limit points · Rate limits
Send the back-in-stock notification for a single intent immediately, regardless of current inventory. By default an intent that has already been notified will not be sent again; set allow_resend to true to force a resend. Returns 404 if the intent does not exist and 422 if the notification could not be sent.
Request body
idstringIntent ID
allow_resendbooleanAllow resending notification
Returns
successbooleanExample:trueintent_idstringExample:8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70
Errors
401
Unauthorized
404
Intent not found
422
Failed to notify intent
POST/external/intents/notify_intent
curl -X POST "https://app.stoqapp.com/api/v1/external/intents/notify_intent" \
-H "X-Auth-Token: $STOQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"allow_resend": false
}'const res = await fetch("https://app.stoqapp.com/api/v1/external/intents/notify_intent", {
method: "POST",
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"id": "8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"allow_resend": false
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.stoqapp.com/api/v1/external/intents/notify_intent",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
json={
"id": "8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"allow_resend": False
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v1/external/intents/notify_intent")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"], "Content-Type" => "application/json")
req.body = {
id: "8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
allow_resend: false
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)Response
{
"success": true,
"intent_id": "8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70"
}No body
No body
No body