Amazon A+ createMedia 201, 200, 409: retry-safe uploads on Sume

Amazon's createMedia answers 201, 200 or 409 on retry. Pair it with one Sume Idempotency-Key per asset so a retried submit never bills twice.

4 min readSume
All posts

Amazon's createMedia is idempotent: it answers 201 for a new asset, 200 when the same asset already exists with identical metadata, and 409 when it exists with different metadata. That makes the Amazon side safe to retry. The Sume side needs its own guard: send one Idempotency-Key per asset on the video submit, and a replay returns the original job.

Amazon facts are from its SP-API release notes (September 30, 2026) and A+ media tutorial; Sume facts are from video generation and Jobs and results, read 2026-10-01.

What does createMedia return on a retry?

The A+ Content API v2020-11-01 added createMedia, getMedia, and updateMedia. You first upload the file with the Uploads API (createUploadDestinationForResource) and then call createMedia with the uploadDestinationId. Amazon says a later request that uses the resulting mediaId is treated as the same asset.

createMedia status codes and the matching Sume habit, read 2026-10-01.
Amazon statusMeaningSume equivalent
201New asset or pairing createdFirst submit with a new Idempotency-Key creates a job
200Already exists, identical metadataReplay with the same key returns the original job
409Exists, metadata differsReuse the key with a changed intent only on purpose; change the key to start a new paid job

How do I key a Sume retry?

Docs: send Idempotency-Key to make retries safe; a replay returns the original job. After a timeout, reuse the same key; the docs say a retried submit then returns the original job instead of billing a second one. Build the key from your own asset identity so it is stable across restarts.

async function submit(slot) {
  const res = await fetch("https://api.sume.com/v1/videos", {
    method: "POST",
    headers: {
      Authorization: "Bearer " + process.env.SUME_API_KEY,
      "Content-Type": "application/json",
      "Idempotency-Key": "a-plus-hero-" + slot + "-v1",
    },
    body: JSON.stringify({ model: "seedance-2", prompt: "Product turntable, white sweep" }),
  });
  console.log(res.status, await res.json());
}
submit("B0EXAMPLE01");

What about webhook retries?

For webhook mode the docs say receivers must treat job_id as the idempotency key. The same idea as Amazon's 200: seeing the same job twice is normal, so make your handler a no-op the second time. See Shopify event id removed: dedupe on Sume job id.

Does a 409 from Amazon mean I should regenerate?

No. A 409 means the asset exists with different metadata. Fix the metadata or use updateMedia; a new Sume generation costs money and does not change Amazon's stored fields.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume