Change a coupon's campaign, offer, precedence, status, end or note; its code and match never change
PATCH
/v1/buyer/coupons/{id}
const url = 'https://example.com/v1/buyer/coupons/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"campaign_id":1,"code":"example","ends_at":"2026-04-15T12:00:00Z","match":"exact","note":"example","offer_id":1,"precedence":"click","status":"active"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/buyer/coupons/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "campaign_id": 1, "code": "example", "ends_at": "2026-04-15T12:00:00Z", "match": "exact", "note": "example", "offer_id": 1, "precedence": "click", "status": "active" }'Who: a workspace’s buyer, or its key. API keys with the buyer:write scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
campaign_id
integer | null format: int64
code
string | null
ends_at
string | null format: date-time
match
string | null
note
string | null
offer_id
integer | null format: int64
precedence
string | null
status
string | null
Responses
Section titled “Responses”OK
Media typeapplication/json
object
campaign
required
object
id
required
integer format: int64
name
string
code
required
string
created_at
required
string format: date-time
ends_at
required
string | null format: date-time
id
required
integer format: int64
match
required
string | null
note
required
string
precedence
required
string | null
sequence
required
integer format: int64
status
required
string | null
updated_at
required
string format: date-time
workspace_id
required
integer format: int64
Example
{ "match": "exact", "precedence": "click", "status": "active"}default
Section titled “default”An error, as go-commons apperr maps it
Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string
Example generated
{ "error": { "code": "example", "fields": { "additionalProperty": "example" }, "message": "example" }}