Update a promotion campaign
Authorizations
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
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
Body
Every value is an absolute target, so replaying converges. An omitted key keeps its stored value; an explicit null on description, starts_at or ends_at REMOVES it, which is the only way to make a campaign that ends on a date run indefinitely. LOWERING budget_limit BELOW budget_used STOPS THE CAMPAIGN DEAD and announces nothing. The guard compares the two on every draw, so the next redemption of every linked promotion is refused at checkout and shoppers holding a code simply stop getting the discount. status is not settable here; use the enable and disable routes. campaign_identifier and budget_type are refused by name, because both are fixed at creation and budget_used has already accumulated in one unit.
Required on create. What a merchant recognises the budget by in their own dashboard. Never shown to a shopper.
Required on create. ZERO MEANS UNCAPPED, not a campaign that can spend nothing, which is why an omitted key is refused rather than defaulted. Lowering it below budget_used on a patch stops every linked discount at checkout immediately and tells nobody.
x >= 0Merchant notes. Never shown to a shopper.
Before this instant the budget guard refuses every draw, so linked discounts do not apply. Omit, or send null on a patch, for no lower bound.
After this instant the budget guard refuses every draw. Omit, or send null on a patch, to let the campaign run indefinitely.
Response
Success
