Skip to main content
POST
Adds an item to the cart by offer. Mercur resolves the offer’s variant and stamps the offer_id on the line item so the cart can later split into per-seller orders.
Unlike vanilla Medusa, this route takes an offer_id instead of a variant_id; an unknown offer returns a 404.

Path parameters

string
required
The cart’s ID.

Body parameters

string
required
ID of the offer to add.
number
required
Quantity to add; must be a positive integer.
number
Custom unit price overriding the offer’s calculated price.
number
Compare-at unit price shown as the original price.
object
Custom key-value data stored on the line item; offer_id is merged in automatically.
object
Data passed to the add-to-cart workflow’s hooks.

Response

object