Send shipping update emails to multiple orders
API v1 is the older API. It still works, but new integrations should use API v2. Migrating from v1 to v2
POST
/external/preorders/send_shipping_updateCosts 2 rate-limit points · Rate limits
Send shipping update emails to multiple preorders. You can specify orders using either:
- STOQ internal order IDs (UUIDs) via
order_ids - Shopify order IDs via
shopify_order_ids
You must provide one or the other, but not both.
Headers
X-Auth-TokenstringRequiredAPI key for authentication
Request body
order_idsarray of stringsArray of STOQ internal order UUIDs to send shipping updates to (mutually exclusive with shopify_order_ids)
shopify_order_idsarray of integersArray of Shopify order IDs to send shipping updates to (mutually exclusive with order_ids)
subjectstringRequiredEmail subject line
headerstringRequiredEmail header text
descriptionstringRequiredEmail body description
Returns
successbooleanExample:truemessagestringExample:Shipping updates queuedorders_countintegerNumber of orders that will receive the shipping update
Errors
400
Bad request - missing required parameters or invalid input
401
Unauthorized
404
No valid orders found
POST/external/preorders/send_shipping_update
curl -X POST "https://app.stoqapp.com/api/v1/external/preorders/send_shipping_update" \
-H "X-Auth-Token: $STOQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"shopify_order_ids": [
5012345678901,
5012345678902
],
"subject": "Your preorder has shipped",
"header": "Good news!",
"description": "Your Summer Preorder items are on the way and should arrive within 5–7 business days."
}'const res = await fetch("https://app.stoqapp.com/api/v1/external/preorders/send_shipping_update", {
method: "POST",
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"shopify_order_ids": [
5012345678901,
5012345678902
],
"subject": "Your preorder has shipped",
"header": "Good news!",
"description": "Your Summer Preorder items are on the way and should arrive within 5–7 business days."
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.stoqapp.com/api/v1/external/preorders/send_shipping_update",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
json={
"shopify_order_ids": [
5012345678901,
5012345678902
],
"subject": "Your preorder has shipped",
"header": "Good news!",
"description": "Your Summer Preorder items are on the way and should arrive within 5–7 business days."
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v1/external/preorders/send_shipping_update")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"], "Content-Type" => "application/json")
req.body = {
shopify_order_ids: [
5012345678901,
5012345678902
],
subject: "Your preorder has shipped",
header: "Good news!",
description: "Your Summer Preorder items are on the way and should arrive within 5–7 business days."
}.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,
"message": "Shipping updates queued",
"orders_count": 2
}No body
No body
No body