upsertCommandCoupons
POST
/v2/coupons
const url = 'https://api-crm-staging.divinea.com/api/v2/coupons';const options = { method: 'POST', headers: {APIKey: '<APIKey>', 'Content-Type': 'application/json'}, body: '{"active":true,"allChannels":true,"allExperiences":true,"channels":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"code":"example","discountCents":1,"discountPercent":1,"discountType":"percent","endAt":"2026-04-15","experiences":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","minimumOrderCents":1,"purchaseType":"RESERVATION","startAt":"2026-04-15","useCount":1,"useMax":1,"useMaxByEmail":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-crm-staging.divinea.com/api/v2/coupons \ --header 'APIKey: <APIKey>' \ --header 'Content-Type: application/json' \ --data '{ "active": true, "allChannels": true, "allExperiences": true, "channels": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "code": "example", "discountCents": 1, "discountPercent": 1, "discountType": "percent", "endAt": "2026-04-15", "experiences": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "minimumOrderCents": 1, "purchaseType": "RESERVATION", "startAt": "2026-04-15", "useCount": 1, "useMax": 1, "useMaxByEmail": 1 }'Authorizations
Sezione intitolata “Authorizations”Request Body
Sezione intitolata “Request Body”Coupon
Media typeapplication/json
UpsertRequestCoupon
object
active
boolean
allChannels
boolean
allExperiences
boolean
channels
Array<string>
code
string
discountCents
integer format: int64
discountPercent
integer format: int32
discountType
string
endAt
string format: date
experiences
Array<string>
id
string format: uuid
minimumOrderCents
integer format: int64
purchaseType
string
startAt
string format: date
useCount
integer format: int32
useMax
integer format: int32
useMaxByEmail
integer format: int32
Responses
Sezione intitolata “Responses”OK
Media type*/*
Coupon
object
active
boolean
code
string
couponRules
Array<object>
CouponRuleobject
coupon
Coupon
object
active
boolean
code
string
couponRules
Array<object> recursive
createdAt
string format: date-time
discountCents
integer format: int64
discountPercent
integer format: int32
discountType
string
endAt
string format: date-time
id
string format: uuid
minimumOrderCents
integer format: int64
startAt
string format: date-time
type
string
updatedAt
string format: date-time
useCount
integer format: int32
useMax
integer format: int32
useMaxByEmail
integer format: int32
winery
Winery
object
createdAt
string format: date-time
id
string format: uuid
name
string
updatedAt
string format: date-time
createdAt
string format: date-time
entityId
string
entityType
string
id
string format: uuid
rules
object
updatedAt
string format: date-time
createdAt
string format: date-time
discountCents
integer format: int64
discountPercent
integer format: int32
discountType
string
endAt
string format: date-time
id
string format: uuid
minimumOrderCents
integer format: int64
startAt
string format: date-time
type
string
updatedAt
string format: date-time
useCount
integer format: int32
useMax
integer format: int32
useMaxByEmail
integer format: int32
winery
Winery
object
createdAt
string format: date-time
id
string format: uuid
name
string
updatedAt
string format: date-time