Notify multiple intents in bulk
API v1 is the older API. It still works, but new integrations should use API v2. Migrating from v1 to v2
POST
/external/intents/bulk_notify_intentCosts 2 rate-limit points · Rate limits
Send back-in-stock notifications for multiple intents in one request. Each intent is processed independently; the response reports which succeeded and which failed, returning 207 when only some succeed. Set allow_resend to true to re-notify intents that were already sent.
Request body
intent_idsarray of stringsArray of intent IDs
allow_resendbooleanAllow resending notifications
Returns
successarray of stringsfailedarray of objectsShow 2 child attributesHide child attributes
intent_idstringExample:1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809errorstringExample:Already notified
Errors
400
Bad request
401
Unauthorized
POST/external/intents/bulk_notify_intent
curl -X POST "https://app.stoqapp.com/api/v1/external/intents/bulk_notify_intent" \
-H "X-Auth-Token: $STOQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"intent_ids": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
],
"allow_resend": false
}'const res = await fetch("https://app.stoqapp.com/api/v1/external/intents/bulk_notify_intent", {
method: "POST",
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"intent_ids": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
],
"allow_resend": false
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.stoqapp.com/api/v1/external/intents/bulk_notify_intent",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
json={
"intent_ids": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
],
"allow_resend": False
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v1/external/intents/bulk_notify_intent")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"], "Content-Type" => "application/json")
req.body = {
intent_ids: [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70",
"1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809"
],
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": [
"8f3c2b1a-7d4e-4c2a-9f10-2b3c4d5e6f70"
],
"failed": [
{
"intent_id": "1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809",
"error": "Already notified"
}
]
}{
"success": [
"string"
],
"failed": [
{
"intent_id": "string",
"error": "string"
}
]
}No body
No body