Skip to main content

Add and edit products

Every catalog operation uses your mk_user_* key. You get it one of two ways:
  • You own a Marea store. Mint $MAREA_USER_KEY from your dashboard (the mk_user_* represents you). This is the common case.
  • You’re a partner. The user-key was returned in the POST /v1/users response when you bootstrapped the user — see Bootstrap a user account.
Both endpoints below require scope catalog:write and honor Idempotency-Key (see Safe mutations).

Add a product

POST /v1/storefronts/{storefrontId}/products — returns 201 Created with the full product DTO.

Response — 201 Created

imageProcessingPending: true means Marea will sweep the source URL into its own CDN asynchronously; imageUrl continues to serve from the source until then.

Required + optional fields

Update a product

PATCH /v1/storefronts/{storefrontId}/products/{productId} — returns 200 OK with the full updated ProductDto. Every field is PATCHable (no immutable fields).
Partial update — only the fields you send change. To clear an optional field, send null (e.g. { "imageUrl": null }). Omitting a field leaves it untouched.

Idempotency

Same Idempotency-Key + same body within 24 hours → original response replayed (no duplicate writes). Same key + different body → 409 idempotency_conflict. See Safe mutations. If your batch importer hits a transient network error mid-flight, retry with the same Idempotency-Key per product — the server is replay-safe.

Plan caps and 402 mid-batch

The single-product POST endpoint returns 402 plan_limit (plan_max_products_reached) the moment a write would exceed the user’s plan cap. Stop the batch as soon as you see it; surface error.upgrade.upgradeUrl; do not retry until the user upgrades.

Bulk-load alternative: 207 Multi-Status

If you’re seeding a whole catalog at once, use POST /v1/storefronts with the manifest’s products[] array (or pass initialStorefront.products on POST /v1/users). When the manifest exceeds the plan cap, Marea returns 207 Multi-Status — the storefront is created with products up to the cap and the response errors[] array lists what was skipped:
Surface the skipped list to the user and offer the upgrade; the accepted products are already live.

Other recoverable errors

Quick lookup:

Cross-references