Salta ai contenuti

Create a new Customer Class

POST
/v2/customerclass
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" }'

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"
}

OK

Media type*/*
CustomerClassDTO

Data Transfer Object representing a Customer Class entity

object
caseDiscountRate

Case discount rate (percentage)

number
Example
10
classId

Numeric class ID (auto-incremental)

integer format: int32
Example
1
className

Name of the class

string
Example
Consumer
classType

Type of the class

string
Example
Wholesale
createdAt
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:00
discountRate

Discount rate (percentage)

number
Example
0
id

Unique identifier of the customer class (UUID)

string format: uuid
Example
550e8400-e29b-41d4-a716-446655440000
isActive

Whether the customer class is active

boolean
Example
true
isExpired

Whether the customer class has expired (computed from validityDate)

boolean
Example
false
isPaid

Whether the customer class is paid

boolean
Example
false
price

Price amount

number
Example
99.99
priceType

Price type: MONTHLY, YEARLY, or UNA_TANTUM

string
Example
MONTHLY
updatedAt
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:00
validityDate
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:59
wineryId
required

Winery ID associated with the customer class (UUID)

string format: uuid
Example
e1234567-e89b-12d3-a456-426614174000