Adds an offer to a cart.
Adds qty copies of one offer to the cart. Each copy is its own cart item and becomes its own order at checkout, in the item's campaign. `campaign` becomes required on 8 December 2026. Until then a request without it puts the items into the campaign selected in the Medialister dashboard at that moment, and switching the campaign there later does not move them; send campaign with every request now.
curl -X POST "/api/carts/{cartId}/cart_items" \
-H "apikey: $MEDIALISTER_CLIENT_API_KEY" \
-H "Content-Type: application/ld+json" \
-d '{
"product": "/api/formats/0a097745-ff39-4659-8cae-a9bfb596a124",
"campaign": "/api/campaigns/abcd32bd-a699-4f3e-bb19-ea807a0a6fc8",
"qty": 1
}'Authorization
apikeystringheaderrequiredValue for the apikey header parameter.
Parameters
cartIdstringpathrequiredCart identifier
Body
The new CartItem resource
productstringrequiredcampaignstring | nullThe campaign the new items go into, as an IRI. The campaign's organization pays for the cart, and all items of one cart must use campaigns of the same organization. Optional until 8 December 2026: without it (or with null) the items go into the campaign selected in the Medialister dashboard at that moment. From 8 December 2026 the campaign is required and a request without it is refused with 422, so send it now.
qtyintegerrequiredDefault:1
Response
CartItem resource created
@contextone of@idstringrequired@typestringrequireditemsCartItem.jsonld-cartItem.read[]
{
"@context": "string",
"@id": "string",
"@type": "string",
"items": [
{
"@context": "string",
"@id": "string",
"@type": "string",
"product": {
"@context": "string",
"@id": "string",
"@type": "string",
"mediaProject": "/api/media_projects/b64ed0ca-1a05-4898-9a52-765fed38bc5c"
},
"cart": "https://example.com/",
"campaign": "https://example.com/",
"excluded": false,
"cartItemExtras": [
{
"@context": "string",
"@id": "string",
"@type": "string",
"extra": {
"@context": "string",
"@id": "string",
"@type": "string",
"description": "string",
"conditions": {},
"name": "string"
},
"price": {}
}
]
}
]
}