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.0 ends Oct 6, 2026: pin the version in your uploader
Meta lists Marketing API v24.0 as available until October 6, 2026 and v25.0 as latest. Make the version a setting, and keep Sume render jobs separate.
- 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.
- Match white balance across two AI product photos with Pillow
Two image models gave your product photos different color casts. Fix both with a gray-world gain in Pillow, check the channel means, and know when it fails.
Written by Sume