POST
Put a discount under a campaign budget

Authorizations

Authorization
string
header
required

A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.

Headers

Idempotency-Key
string
required

A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.

Path Parameters

campaignId
string
required

Body

application/json

Links a discount to this campaign, which is what puts it under the budget. Until this is called a campaign is a cap with nothing drawing on it. IT MOVES A DISCOUNT THAT IS ALREADY IN ANOTHER CAMPAIGN. A discount has at most one campaign, so there is no additive form of this call; the response carries campaign_id so you can see where it ended up. What does not move is spend: draws the discount already made stay counted against the campaign it made them under. 200 rather than 201, because nothing is created. One field on an existing discount is set, and re-sending the same pair converges.

promotion_id
string
required

The id GET /api/v1/discounts serves. Not the code, which is editable and only unique within one store.

Response

Success

data
object