Map a bulk queue item index back to a SKU: keep your own ledger
Queue items return index, status and run_id, not your SKU. Save a SKU-by-index table at submit time and join it to the queue receipt when you poll.

The queue receipt does not echo your item bodies. Each entry in items has index, status, run_id and error, so the join back to your catalog is yours to keep. Write the SKU-by-index table when you create the queue.
Why not read it from the output
It is tempting to bind an output_schema with an order_id or sku field and read it back. The docs warn against it: the projection step never sees input or instruction, so an id you supplied does not reliably round-trip. Your own ledger does not depend on the model.
The ledger
index is the zero-based position in the array you sent, in the same order. A row in your database per item is enough.
create table batch_item (
queue_id text not null,
idx int not null,
sku text not null,
run_id text,
status text not null default 'queued',
primary key (queue_id, idx)
);
-- after each poll of GET /v1/format-run-queues/{id}:
-- update batch_item set run_id = $1, status = $2
-- where queue_id = $3 and idx = $4;Edge cases
run_idis null while an item is queued, and stays null if the child failed to start; the item then carriesformat_run_failed_to_start.- A bad item makes the create fail with 400
invalid_requestanddetails.index, before any queue exists, so there is nothing to map yet. - A replayed Idempotency-Key returns the old queue, so the same ledger rows still apply.
Sources
Related posts
More in Developers
- Marketing API v24 expiry runbook: replay the upload, not the render
When Meta's v24.0 window closes on October 6, 2026, fix uploads by replaying stored Sume job results. The same Idempotency-Key never bills a render twice.
- Match STT results to file ids: the job echoes your Idempotency-Key
Sending 300 recordings to Sume STT? Set Idempotency-Key to your own file id. The job record returns it, so results map back after a crash or a retry.
- max_spend_usd is optional on Sume MCP: send it on every paid call
Sume enforces max_spend_usd only when you send it. Make your coding agent send it with dry_run and an idempotency_key. Wallet admission is the real gate.
- MCP SEP-2352: credentials bound to issuer, re-register on a new host
MCP SEP-2352 binds client credentials to the issuer and deprecates DCR for Client ID Metadata Documents. Re-register if the Sume host changes.
Written by Sume