PATCH
Update a promotion campaign

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

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.

name
string

Required on create. What a merchant recognises the budget by in their own dashboard. Never shown to a shopper.

budget_limit
integer

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.

Required range: x >= 0
description
string | null

Merchant notes. Never shown to a shopper.

starts_at
string<date-time> | null

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.

ends_at
string<date-time> | null

After this instant the budget guard refuses every draw. Omit, or send null on a patch, to let the campaign run indefinitely.

Response

Success

data
object