Adds several offers to a cart.
Adds one cart item per entry of cartItems, all in the same campaign. Each item becomes its own order at checkout. `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/batch_create" \
-H "apikey: $MEDIALISTER_CLIENT_API_KEY" \
-H "Content-Type: application/ld+json" \
-d '{
"cartItems": [
{
"product": "/api/formats/0a097745-ff39-4659-8cae-a9bfb596a124"
},
{
"product": "/api/formats/0a097745-ff39-4659-8cae-a9bfb596a123"
},
{
"product": "/api/formats/0a097745-ff39-4659-8cae-a9bfb596a122"
}
],
"campaign": "/api/campaigns/abcd32bd-a699-4f3e-bb19-ea807a0a6fc8"
}'Authorization
apikeystringheaderrequiredValue for the apikey header parameter.
Parameters
cartIdstringpathrequiredCart identifier
Body
The new CartItem resource
cartItemsany[]requiredcampaignstring | 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.
Response
CartItem resource created
@contextone of@idstringrequired@typestringrequireditemsCartItem.jsonld-cartItem.batchCreated[]
{
"@context": "string",
"@id": "string",
"@type": "string",
"items": [
{
"@context": "string",
"@id": "string",
"@type": "string"
}
]
}