After your AI automation processes an order, you must send the results back to SellerShorts using our callback endpoint. This completes the order and delivers results to the buyer.
📚 Before you start: Read Callback Basics for required fields, authentication, and response codes.
Callback flow: 1. Process the job. 2. POST /api/orders/callback with JSON payload (text, URL, or base64 file).
⚠️ Note: This guide is for payloads under 4.5 MB. For larger files, use the Callback (Over 4.5 MB) guide.
Use this format when sending text, JSON, or CSV content directly in the payload. The result_text field is required when using output_type: text, json, or csv.
Note: The 4.5 MB total payload limit applies to your entire JSON request body (including all fields and content). For larger content, use the Callback (Over 4.5 MB) guide.
💡 For HTML content: Use output_type: "url" instead. Host your HTML file and return the URL. This provides better performance, no size limits, and full control over your content.
The output_type field can be one of:
text - Plain text contentjson - JSON datacsv - CSV data⚠️ Important: These are template examples. Replace all placeholders with real values:
order-uuid-from-webhook → Use the actual order_id from your webhook payloadx-callback-secret header in your request (see cURL example below){
"ok": true,
"order_id": "order-uuid-from-webhook",
"output_type": "text",
"result_text": "Your analysis results go here..."
}{
"ok": true,
"order_id": "order-uuid-from-webhook",
"output_type": "json",
"result_text": "{\"status\": \"success\", \"data\": [1, 2, 3]}"
}{
"ok": true,
"order_id": "order-uuid-from-webhook",
"output_type": "csv",
"result_text": "Name,Age,City\nJohn,30,New York\nJane,25,Los Angeles"
}curl -X POST "https://api.example.com/callback" \
-H "Content-Type: application/json" \
-H "x-callback-secret: your-callback-secret" \
-d '{
"ok": true,
"order_id": "test-order-uuid",
"output_type": "text",
"result_text": "Analysis completed successfully..."
}'true for success, false for failuretext, json, csv, file, xlsx, url, videooutput_type: text, json, or csv. Contains the actual content as a string.If your AI Tool declared write verbs in the Inputs step wizard's "Post to Amazon (Optional)" section, the order detail page can render a one-click Apply to Amazon button that pushes your tool's output directly to the buyer's connected Amazon account.
For that button to appear, your v2 callback (api_version: "2") must include a structured_output object inside the metadata of at least one output. This works with any output shape: a single base64 file, multiple files, or a hosted URL. The shape is the same regardless of which Amazon provider you target; only the action and provider change.
📚 Two examples below: one for Amazon Seller Central (SP-API verbs like listings.update), and one for Amazon Ads (verbs like ads.sb.campaigns.create). Same envelope shape; the provider and action are the only differences.
This example would be returned by Tool 1 (Listing Fixer) after the agent generates a new title and bullets. When the buyer clicks Apply, the broker calls listings.update with the payload object.
{
"ok": true,
"api_version": "2",
"order_id": "order-uuid-from-webhook",
"status": "complete",
"outputs": [
{
"filename": "listing-rewrite.json",
"content_type": "application/json",
"file_base64": "base64-json-content",
"rank": 1,
"metadata": {
"structured_output": {
"action": "listings.update",
"provider": "amazon",
"payload": {
"sku": "ABC-123",
"title": "New title here",
"bullets": ["Bullet 1", "Bullet 2"]
},
"confirm": {
"summary": "Update title and bullets for SKU ABC-123",
"diff_preview": {
"before": { "title": "Old title" },
"after": { "title": "New title here" }
}
}
}
}
}
]
}This example would be returned by Tool 2 (Ad Campaign Builder) after the agent designs a new Sponsored Brands campaign. When the buyer clicks Apply, the broker calls ads.sb.campaigns.create with the payload object.
{
"ok": true,
"api_version": "2",
"order_id": "order-uuid-from-webhook",
"status": "complete",
"outputs": [
{
"filename": "campaign-plan.json",
"content_type": "application/json",
"file_base64": "base64-json-content",
"rank": 1,
"metadata": {
"structured_output": {
"action": "ads.sb.campaigns.create",
"provider": "amazon_ads",
"payload": {
"name": "Holiday 2026 SB Campaign",
"daily_budget": 50,
"start_date": "20261201",
"end_date": "20261231",
"ad_format": "productCollection",
"state": "paused"
},
"confirm": {
"summary": "Create Sponsored Brands campaign 'Holiday 2026 SB Campaign' with $50/day budget",
"diff_preview": {
"before": { "status": "no campaign yet" },
"after": { "name": "Holiday 2026 SB Campaign", "daily_budget": 50 }
}
}
}
}
}
]
}"listings.update", "listings.update_images", "listings.a_plus_generate", "messaging.request_review""ads.campaigns.create", "ads.keywords.update", "ads.negative_keywords.create", "ads.sb.campaigns.create", "ads.sb.keywords.create", "ads.sb.negative_keywords.create", "ads.sd.campaigns.create", "ads.sd.ad_groups.create", "ads.sd.product_ads.create", "ads.sd.targets.create", "ads.sd.negative_targets.create""amazon" for Amazon Seller Central verbs (the listings.*, messaging.* verbs)"amazon_ads" for Amazon Ads verbs (everything starting with ads.*)after in the modal's collapsible "View change preview" panel.The order detail page renders the Apply button when these four checks all pass (verified in src/app/orders/[id]/page.tsx):
apply_actions array has at least one entry with show_button: true. (Populated at dispatch time from what you declared and toggled ON in the wizard.)metadata.structured_output object.structured_output.action + provider matches one of the declared apply_actions entries.Two additional end-to-end prerequisites are not strictly button-render checks but the button won't be useful without them:
amazon verbs, Amazon Ads for amazon_ads verbs). If they don't, the broker call when the buyer clicks Apply will return an authorization error.metadata field, so the Apply button cannot work with v1. Use api_version: "2".structured_output is just one more well-known key inside the existing per-output metadata bag.payload against the verb's schema at click time. If field names use camelCase where the broker expects snake_case (e.g., "dailyBudget" instead of "daily_budget"), the broker call returns a validation error and the buyer sees "Apply failed" in the modal.structured_output, the Apply button uses the newest output whose action matches a declared verb.structured_output envelope can ride along with a base64 file, a hosted URL, or any other v2 output. You do not need to "send multiple files" to use it.⚠️ Compliance: do not mislead the buyer in confirm.summary or diff_preview
The confirm.summary and confirm.diff_preview fields are what the buyer sees before they consent to an Amazon write. They must accurately describe what the broker is about to do, in plain language. Do not:
diff_preview.after that you are actually sending in payload.confirm.summary as smaller or less invasive than it really is.structured_output to push writes that are not consistent with the tool's marketed purpose (Amazon's DPP requires informed consent for every write on the seller's account).The buyer (seller account owner) bears the policy responsibility for any change made via Apply. SellerShorts and Amazon both audit the broker call, so deceptive preview content can be detected after the fact. Misleading preview content is grounds for tool de-listing.
📚 Amazon authoritative source: SP-API Policies and Agreements (Data Protection Policy, Acceptable Use Policy).