Create a new Customer Class
POST
/v2/customerclass
const url = 'https://api-crm-staging.divinea.com/api/v2/customerclass';const options = { method: 'POST', headers: {APIKey: '<APIKey>', 'Content-Type': 'application/json'}, body: '{"caseDiscountRate":1,"classId":1,"className":"example","classType":"example","discountRate":1,"isActive":true,"isPaid":true,"price":1,"priceType":"example","validityDate":{"date":1,"day":1,"hours":1,"minutes":1,"month":1,"nanos":1,"seconds":1,"time":1,"timezoneOffset":1,"year":1},"wineryId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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/customerclass \ --header 'APIKey: <APIKey>' \ --header 'Content-Type: application/json' \ --data '{ "caseDiscountRate": 1, "classId": 1, "className": "example", "classType": "example", "discountRate": 1, "isActive": true, "isPaid": true, "price": 1, "priceType": "example", "validityDate": { "date": 1, "day": 1, "hours": 1, "minutes": 1, "month": 1, "nanos": 1, "seconds": 1, "time": 1, "timezoneOffset": 1, "year": 1 }, "wineryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Authorizations
Sezione intitolata “Authorizations”Request Body
Sezione intitolata “Request Body”Payload
Media typeapplication/json
CreateCustomerClassCommand
object
caseDiscountRate
number
classId
integer format: int32
className
string
classType
string
discountRate
number
isActive
boolean
isPaid
boolean
price
number
priceType
string
validityDate
Timestamp
object
date
integer format: int32
day
integer format: int32
hours
integer format: int32
minutes
integer format: int32
month
integer format: int32
nanos
integer format: int32
seconds
integer format: int32
time
integer format: int64
timezoneOffset
integer format: int32
year
integer format: int32
wineryId
string format: uuid
Examplegenerated
{ "caseDiscountRate": 1, "classId": 1, "className": "example", "classType": "example", "discountRate": 1, "isActive": true, "isPaid": true, "price": 1, "priceType": "example", "validityDate": { "date": 1, "day": 1, "hours": 1, "minutes": 1, "month": 1, "nanos": 1, "seconds": 1, "time": 1, "timezoneOffset": 1, "year": 1 }, "wineryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Sezione intitolata “Responses”OK
Media type*/*
CustomerClassDTO
Data Transfer Object representing a Customer Class entity
object
caseDiscountRate
Case discount rate (percentage)
number
Example
10classId
Numeric class ID (auto-incremental)
integer format: int32
Example
1className
Name of the class
string
Example
ConsumerclassType
Type of the class
string
Example
WholesalecreatedAt
Timestamp
Record creation timestamp
object
date
integer format: int32
day
integer format: int32
hours
integer format: int32
minutes
integer format: int32
month
integer format: int32
nanos
integer format: int32
seconds
integer format: int32
time
integer format: int64
timezoneOffset
integer format: int32
year
integer format: int32
Example
2025-10-13T12:30:00discountRate
Discount rate (percentage)
number
Example
0id
Unique identifier of the customer class (UUID)
string format: uuid
Example
550e8400-e29b-41d4-a716-446655440000isActive
Whether the customer class is active
boolean
Example
trueisExpired
Whether the customer class has expired (computed from validityDate)
boolean
Example
falseisPaid
Whether the customer class is paid
boolean
Example
falseprice
Price amount
number
Example
99.99priceType
Price type: MONTHLY, YEARLY, or UNA_TANTUM
string
Example
MONTHLYupdatedAt
Timestamp
Record last update timestamp
object
date
integer format: int32
day
integer format: int32
hours
integer format: int32
minutes
integer format: int32
month
integer format: int32
nanos
integer format: int32
seconds
integer format: int32
time
integer format: int64
timezoneOffset
integer format: int32
year
integer format: int32
Example
2025-10-13T12:45:00validityDate
Timestamp
Validity date when the customer class expires
object
date
integer format: int32
day
integer format: int32
hours
integer format: int32
minutes
integer format: int32
month
integer format: int32
nanos
integer format: int32
seconds
integer format: int32
time
integer format: int64
timezoneOffset
integer format: int32
year
integer format: int32
Example
2025-12-31T23:59:59wineryId
required
Winery ID associated with the customer class (UUID)
string format: uuid
Example
e1234567-e89b-12d3-a456-426614174000