Data Fields
Data Fields are special extra fields that hold questions the customer can be asked on checkout. DataFields can be applied to tickettypes or globally to events.
The Data Field object
Required attributes
- Name
_id- Type
- string
- Description
The ID of the data field
- Name
sellerId- Type
- string
- Description
The ID of the seller of the data field
- Name
name- Type
- string
- Description
The name of the data field
- Name
type- Type
- enum(text, number, select, checkbox, tel, country, email, date, documentUpload, signature, address)
- Description
The type of data field
- Name
slug- Type
- string
- Description
The slug generated out of name
Optional attributes
- Name
title- Type
- string
- Description
The default title of the data field
- Name
isPersonalData- Type
- boolean
- Description
Whether the data field is personal data
- Name
description- Type
- string
- Description
The default description of the data field
- Name
options- Type
- array<string>
- Description
An array of options when type is select
- Name
minLength- Type
- number float
- Description
Minimum length for a text input
- Name
maxLength- Type
- number float
- Description
Maximum length for a text input
- Name
settings- Type
- oneOf
- Description
- One of — Only one of the following types
The settings of the upload document data field
Optional attributes
- Name
allowedMimeTypes- Type
- array<enum(application/pdf, image/jpeg, image/png)>
- Description
An array of allowed mime types
Example
{
"_id": "507f191e810c19729de860ea",
"sellerId": "507f191e810c19729de860ea",
"name": "Some fancy Name",
"type": "text",
"slug": "string",
"title": "string",
"isPersonalData": true,
"description": "string",
"options": [
"string"
],
"minLength": 10.5,
"maxLength": 10.5,
"settings": {
"allowedMimeTypes": [
"application/pdf"
]
}
}Create a Data Field
Create a Data Field
Payload
Required attributes
- Name
type- Type
- enum(text, number, select, checkbox, tel, country, email, date, documentUpload, signature, address)
- Description
The type of data field
- Name
name- Type
- string
- Description
Optional attributes
- Name
title- Type
- string
- Description
The default title of the data field
- Name
description- Type
- string
- Description
The default description of the data field
- Name
isPersonalData- Type
- boolean
- Description
Whether the data field is personal data
- Name
options- Type
- array<string>
- Description
An array of options when type is select
- Name
minLength- Type
- number float
- Description
Minimum length for a text input
- Name
maxLength- Type
- number float
- Description
Maximum length for a text input
- Name
settings- Type
- oneOf
- Description
- One of — Only one of the following types
The settings of the upload document data field
Optional attributes
- Name
allowedMimeTypes- Type
- array<enum(application/pdf, image/jpeg, image/png)>
- Description
An array of allowed mime types
Request
const response = await fetch('https://vivenu.com/api/data-fields', {
method: 'POST',
headers: {
Authorization: 'Bearer {token}',
'Content-Type': 'application/json',
},
body: JSON.stringify( {
"type": "text",
"name": "Some fancy Name",
"title": "string",
"description": "string",
"isPersonalData": true,
"options": [
"string"
],
"minLength": 10.5,
"maxLength": 10.5,
"settings": {
"allowedMimeTypes": [
"application/pdf"
]
}
}),
})
const data = await response.json()Response (201)
{
"_id": "507f191e810c19729de860ea",
"sellerId": "507f191e810c19729de860ea",
"name": "Some fancy Name",
"type": "text",
"slug": "string",
"title": "string",
"isPersonalData": true,
"description": "string",
"options": [
"string"
],
"minLength": 10.5,
"maxLength": 10.5,
"settings": {
"allowedMimeTypes": [
"application/pdf"
]
}
}Update a Data Field
Update a Data Field
Payload
Optional attributes
- Name
title- Type
- string
- Description
The default title of the data field
- Name
description- Type
- string
- Description
The default description of the data field
- Name
isPersonalData- Type
- boolean
- Description
Whether the data field is personal data
- Name
options- Type
- array<string>
- Description
An array of options when type is select
- Name
minLength- Type
- number float
- Description
Minimum length for a text input
- Name
maxLength- Type
- number float
- Description
Maximum length for a text input
- Name
settings- Type
- oneOf
- Description
- One of — Only one of the following types
The settings of the upload document data field
Optional attributes
- Name
allowedMimeTypes- Type
- array<enum(application/pdf, image/jpeg, image/png)>
- Description
An array of allowed mime types
Request
const response = await fetch('https://vivenu.com/api/data-fields/507f191e810c19729de860ea', {
method: 'PUT',
headers: {
Authorization: 'Bearer {token}',
'Content-Type': 'application/json',
},
body: JSON.stringify( {
"title": "string",
"description": "string",
"isPersonalData": true,
"options": [
"string"
],
"minLength": 10.5,
"maxLength": 10.5,
"settings": {
"allowedMimeTypes": [
"application/pdf"
]
}
}),
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"sellerId": "507f191e810c19729de860ea",
"name": "Some fancy Name",
"type": "text",
"slug": "string",
"title": "string",
"isPersonalData": true,
"description": "string",
"options": [
"string"
],
"minLength": 10.5,
"maxLength": 10.5,
"settings": {
"allowedMimeTypes": [
"application/pdf"
]
}
}Get a Data Field
Get a Data Field
Request
const response = await fetch('https://vivenu.com/api/data-fields/507f191e810c19729de860ea', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"sellerId": "507f191e810c19729de860ea",
"name": "Some fancy Name",
"type": "text",
"slug": "string",
"title": "string",
"isPersonalData": true,
"description": "string",
"options": [
"string"
],
"minLength": 10.5,
"maxLength": 10.5,
"settings": {
"allowedMimeTypes": [
"application/pdf"
]
}
}Get all Data Fields
Get all Data Fields
Request
const response = await fetch('https://vivenu.com/api/data-fields', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
[
{
"_id": "507f191e810c19729de860ea",
"sellerId": "507f191e810c19729de860ea",
"name": "Some fancy Name",
"type": "text",
"slug": "string",
"title": "string",
"isPersonalData": true,
"description": "string",
"options": [
"string"
],
"minLength": 10.5,
"maxLength": 10.5,
"settings": {
"allowedMimeTypes": [
"application/pdf"
]
}
}
]Get all Data Fields by reference
Get all Data Fields by reference
Query parameters
Required query parameters
- Name
sellerId- Type
- string
- Description
- Name
scope- Type
- enum(CUSTOMER, TICKET, TRANSACTION, CHECKOUT)
- Description
The scope of the data-fields.
Optional query parameters
- Name
eventId- Type
- string
- Description
- Name
shopId- Type
- string
- Description
- Name
ticketTypeId- Type
- string
- Description
- Name
checkoutId- Type
- string
- Description
- Name
locale- Type
- string
- Description
Resolve the data-fields for a specific language
Request
const response = await fetch('https://vivenu.com/api/data-fields/resolve?sellerId=507f191e810c19729de860ea&scope=CUSTOMER&eventId=507f191e810c19729de860ea&shopId=507f191e810c19729de860ea&ticketTypeId=507f191e810c19729de860ea&checkoutId=507f191e810c19729de860ea&locale=value', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
[
{
"_id": "507f191e810c19729de860ea",
"name": "Some fancy Name",
"type": "text",
"slug": "string",
"options": [
"string"
],
"description": "string"
}
]