Products
Product objects describe goods that can be purchased by customers. In difference to tickets they are usually not directly linked to an event. Using Product Streams predefined combinations can be offered during a shopping experience.
Create a Product
Create a Product
Payload
Required attributes
- Name
name- Type
- string
- Description
The name of the product
- Name
type- Type
- enum(voucher, product, donation, membership, addOn)
- Description
The type of the product
Optional attributes
- Name
description- Type
- string
- Description
The description of the product
- Name
image- Type
- string
- Description
The image of the product
- Name
variants- Type
- array<object>
- Description
Required nested attributes (1)
- Name
taxable- Type
- boolean
- Description
Whether the product is taxable or not
Optional nested attributes (10)
- Name
name- Type
- string
- Description
The Name of the product variant, defaults to product name if not specified
- Name
description- Type
- string
- Description
A description of the variant
- Name
price- Type
- number
- Description
The price of the product
- Name
priceType- Type
- enum(fixed, range)
- Description
- Name
priceRange- Type
- object
- Description
Optional nested attributes (2)
- Name
min- Type
- number
- Description
The minimum price of the product
- Name
max- Type
- number
- Description
The maximum price of the product
- Name
taxRate- Type
- number
- Description
The tax rate of the product
- Name
compareAtPrice- Type
- number
- Description
The recommended retail price to compare with the actual price.
- Name
taxServiceTypeId- Type
- string
- Description
The ID of the tax service of the product
- Name
gtin- Type
- string
- Description
- Name
localization- Type
- object
- Description
Localization of the product for multiple languages
- Name
categoryIds- Type
- array<string>
- Description
An array of categories to which the product belongs
- Name
voucherSettings- Type
- object
- Description
If the product is of type voucher
Optional nested attributes (5)
- Name
limitedValidityPeriod- Type
- boolean
- Description
Whether the voucher should expire
- Name
validityConfig- Type
- object
- Description
Optional nested attributes (3)
- Name
amount- Type
- number
- Description
- Name
type- Type
- number
- Description
- Name
untilEndOfPeriod- Type
- boolean
- Description
- Name
pdfImage- Type
- string
- Description
A marketing image printed onto voucher pdf
- Name
disclaimer- Type
- string
- Description
A disclaimer text printed onto voucher pdf
- Name
documentTemplateSettings- Type
- object
- Description
Optional nested attributes (1)
- Name
templates- Type
- array<object>
- Description
Required nested attributes (4)
- Name
templateId- Type
- string
- Description
The ID of the document template
- Name
format- Type
- enum(A4, LETTER, LEGAL, BOARDING-PASS, PLASTIC-CARD, CARD, LABEL, CUSTOM, APPLE, GOOGLE)
- Description
The format of document template for the dimensions.
- Name
target- Type
- enum(thermal, digital, wallet)
- Description
The target of document template for which targets it should be used.
- Name
type- Type
- enum(ticket, invoice, voucher, member-card, header-card)
- Description
The type of document template for which document it should be used. ticket = The document template will be used on tickets. invoice = The document template will be used on invoices.
- Name
addOnSettings- Type
- object
- Description
Optional nested attributes (2)
- Name
optOutDescription- Type
- string
- Description
The description that is shown to the user if he decides to not buy the addOn
- Name
localization- Type
- object
- Description
Localization of the addOnSettings for multiple languages
- Name
donationSettings- Type
- object
- Description
Settings for donation products
Required nested attributes (2)
- Name
campaignId- Type
- string
- Description
The ID of the fundraise campaign
- Name
fundId- Type
- string
- Description
The ID of the donation fund
- Name
active- Type
- boolean
- Description
Whether the product is active and can be distributed
- Name
meta- Type
- object
- Description
Custom key-value data. Metadata is useful for storing additional, structured information on an object.
- Name
isFulfillable- Type
- boolean
- Description
Whether the product can be delivered
- Name
localization- Type
- object
- Description
Localization of the product for multiple languages
Request
const response = await fetch('https://vivenu.com/api/products', {
method: 'POST',
headers: {
Authorization: 'Bearer {token}',
'Content-Type': 'application/json',
},
body: JSON.stringify( {
"name": "Example Name",
"type": "voucher",
"description": "string",
"image": "string",
"variants": [
{
"taxable": true,
"name": "Example Name",
"description": "string",
"price": 10.5,
"priceType": "fixed",
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"active": true,
"meta": {},
"isFulfillable": true,
"localization": {}
}),
})
const data = await response.json()Response (201)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"type": "voucher",
"sellerId": "507f191e810c19729de860ea",
"active": true,
"isFulfillable": true,
"image": "string",
"description": "string",
"variants": [
{
"_id": "507f191e810c19729de860ea",
"taxable": true,
"name": "Example Name",
"description": "string",
"priceType": "fixed",
"price": 10.5,
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"meta": {},
"localization": {},
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Get a Product
Get a Product
Request
const response = await fetch('https://vivenu.com/api/products/507f191e810c19729de860ea', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"type": "voucher",
"sellerId": "507f191e810c19729de860ea",
"active": true,
"isFulfillable": true,
"image": "string",
"description": "string",
"variants": [
{
"_id": "507f191e810c19729de860ea",
"taxable": true,
"name": "Example Name",
"description": "string",
"priceType": "fixed",
"price": 10.5,
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"meta": {},
"localization": {},
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Update a Product
Update a Product
Payload
Required attributes
- Name
name- Type
- string
- Description
The name of the product
- Name
type- Type
- enum(voucher, product, donation, membership, addOn)
- Description
The type of the product
Optional attributes
- Name
description- Type
- string
- Description
The description of the product
- Name
image- Type
- string
- Description
The image of the product
- Name
variants- Type
- array<object>
- Description
Required nested attributes (2)
- Name
_id- Type
- string
- Description
The ID of the product variant of the product
- Name
taxable- Type
- boolean
- Description
Whether the product is taxable or not
Optional nested attributes (10)
- Name
name- Type
- string
- Description
The Name of the product variant, defaults to product name if not specified
- Name
description- Type
- string
- Description
A description of the variant
- Name
price- Type
- number
- Description
The price of the product
- Name
priceType- Type
- enum(fixed, range)
- Description
- Name
priceRange- Type
- object
- Description
Optional nested attributes (2)
- Name
min- Type
- number
- Description
The minimum price of the product
- Name
max- Type
- number
- Description
The maximum price of the product
- Name
taxRate- Type
- number
- Description
The tax rate of the product
- Name
compareAtPrice- Type
- number
- Description
The recommended retail price to compare with the actual price.
- Name
taxServiceTypeId- Type
- string
- Description
The ID of the tax service of the product
- Name
gtin- Type
- string
- Description
- Name
localization- Type
- object
- Description
Localization of the product for multiple languages
- Name
categoryIds- Type
- array<string>
- Description
An array of categories to which the product belongs
- Name
voucherSettings- Type
- object
- Description
If the product is of type voucher
Optional nested attributes (5)
- Name
limitedValidityPeriod- Type
- boolean
- Description
Whether the voucher should expire
- Name
validityConfig- Type
- object
- Description
Optional nested attributes (3)
- Name
amount- Type
- number
- Description
- Name
type- Type
- number
- Description
- Name
untilEndOfPeriod- Type
- boolean
- Description
- Name
pdfImage- Type
- string
- Description
A marketing image printed onto voucher pdf
- Name
disclaimer- Type
- string
- Description
A disclaimer text printed onto voucher pdf
- Name
documentTemplateSettings- Type
- object
- Description
Optional nested attributes (1)
- Name
templates- Type
- array<object>
- Description
Required nested attributes (4)
- Name
templateId- Type
- string
- Description
The ID of the document template
- Name
format- Type
- enum(A4, LETTER, LEGAL, BOARDING-PASS, PLASTIC-CARD, CARD, LABEL, CUSTOM, APPLE, GOOGLE)
- Description
The format of document template for the dimensions.
- Name
target- Type
- enum(thermal, digital, wallet)
- Description
The target of document template for which targets it should be used.
- Name
type- Type
- enum(ticket, invoice, voucher, member-card, header-card)
- Description
The type of document template for which document it should be used. ticket = The document template will be used on tickets. invoice = The document template will be used on invoices.
- Name
addOnSettings- Type
- object
- Description
Optional nested attributes (2)
- Name
optOutDescription- Type
- string
- Description
The description that is shown to the user if he decides to not buy the addOn
- Name
localization- Type
- object
- Description
Localization of the addOnSettings for multiple languages
- Name
donationSettings- Type
- object
- Description
Settings for donation products
Required nested attributes (2)
- Name
campaignId- Type
- string
- Description
The ID of the fundraise campaign
- Name
fundId- Type
- string
- Description
The ID of the donation fund
- Name
active- Type
- boolean
- Description
Whether the product is active and can be distributed
- Name
meta- Type
- object
- Description
Custom key-value data. Metadata is useful for storing additional, structured information on an object.
- Name
isFulfillable- Type
- boolean
- Description
Whether the product can be delivered
- Name
localization- Type
- object
- Description
Localization of the product for multiple languages
Request
const response = await fetch('https://vivenu.com/api/products/507f191e810c19729de860ea', {
method: 'PUT',
headers: {
Authorization: 'Bearer {token}',
'Content-Type': 'application/json',
},
body: JSON.stringify( {
"name": "Example Name",
"type": "voucher",
"description": "string",
"image": "string",
"variants": [
{
"_id": "507f191e810c19729de860ea",
"taxable": true,
"name": "Example Name",
"description": "string",
"price": 10.5,
"priceType": "fixed",
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"active": true,
"meta": {},
"isFulfillable": true,
"localization": {}
}),
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"type": "voucher",
"sellerId": "507f191e810c19729de860ea",
"active": true,
"isFulfillable": true,
"image": "string",
"description": "string",
"variants": [
{
"_id": "507f191e810c19729de860ea",
"taxable": true,
"name": "Example Name",
"description": "string",
"priceType": "fixed",
"price": 10.5,
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"meta": {},
"localization": {},
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Delete a Product
Delete a Product
Request
const response = await fetch('https://vivenu.com/api/products/507f191e810c19729de860ea', {
method: 'DELETE',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"type": "voucher",
"sellerId": "507f191e810c19729de860ea",
"active": true,
"isFulfillable": true,
"image": "string",
"description": "string",
"variants": [
{
"_id": "507f191e810c19729de860ea",
"taxable": true,
"name": "Example Name",
"description": "string",
"priceType": "fixed",
"price": 10.5,
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"meta": {},
"localization": {},
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Get all Products
Get all Products
Query parameters
Optional query parameters
- Name
top- Type
- number
- Description
- Name
skip- Type
- number
- Description
- Name
name- Type
- string
- Description
- Name
type- Type
- enum(voucher, product, donation, membership, addOn)
- Description
- Name
active- Type
- boolean
- Description
Request
const response = await fetch('https://vivenu.com/api/products/rich?top=10.5&skip=10.5&name=Example+Name&type=voucher&active=true', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
{
"docs": [
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"type": "voucher",
"sellerId": "507f191e810c19729de860ea",
"active": true,
"isFulfillable": true,
"image": "string",
"description": "string",
"variants": [
{
"_id": "507f191e810c19729de860ea",
"taxable": true,
"name": "Example Name",
"description": "string",
"priceType": "fixed",
"price": 10.5,
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"meta": {},
"localization": {},
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}
],
"total": 1
}Create a Product Stream
Create a Product Stream
Payload
Required attributes
- Name
name- Type
- string
- Description
The name of the product stream.
Optional attributes
- Name
active- Type
- boolean
- Description
Whether the product stream is active or not.
- Name
products- Type
- array<string>
- Description
The products in the product stream.
Request
const response = await fetch('https://vivenu.com/api/products/streams', {
method: 'POST',
headers: {
Authorization: 'Bearer {token}',
'Content-Type': 'application/json',
},
body: JSON.stringify( {
"name": "Example Name",
"active": true,
"products": []
}),
})
const data = await response.json()Response (201)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"sellerId": "507f191e810c19729de860ea",
"products": [],
"active": true,
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Get a Product Stream
Get a Product Stream
Request
const response = await fetch('https://vivenu.com/api/products/streams/507f191e810c19729de860ea', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"sellerId": "507f191e810c19729de860ea",
"products": [],
"active": true,
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Update a Product Stream
Update a Product Stream
Payload
Required attributes
- Name
name- Type
- string
- Description
The name of the product stream.
Optional attributes
- Name
active- Type
- boolean
- Description
Whether the product stream is active or not.
- Name
products- Type
- array<string>
- Description
The products in the product stream.
Request
const response = await fetch('https://vivenu.com/api/products/streams/507f191e810c19729de860ea', {
method: 'PUT',
headers: {
Authorization: 'Bearer {token}',
'Content-Type': 'application/json',
},
body: JSON.stringify( {
"name": "Example Name",
"active": true,
"products": []
}),
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"sellerId": "507f191e810c19729de860ea",
"products": [],
"active": true,
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Delete a Product Stream
Delete a Product Stream
Request
const response = await fetch('https://vivenu.com/api/products/streams/507f191e810c19729de860ea', {
method: 'DELETE',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"sellerId": "507f191e810c19729de860ea",
"products": [],
"active": true,
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}Get all Product Streams
Get all Product Streams
Query parameters
Optional query parameters
- Name
top- Type
- number
- Description
- Name
skip- Type
- number
- Description
- Name
name- Type
- string
- Description
Request
const response = await fetch('https://vivenu.com/api/products/streams/rich?top=10.5&skip=10.5&name=Example+Name', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
{
"docs": [
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"sellerId": "507f191e810c19729de860ea",
"products": [],
"active": true,
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}
],
"total": 1
}Get a Product Stream's Products
Get a Product Stream's Products
Request
const response = await fetch('https://vivenu.com/api/products/streams/507f191e810c19729de860ea/products', {
method: 'GET',
headers: {
Authorization: 'Bearer {token}',
},
})
const data = await response.json()Response (200)
[
{
"_id": "507f191e810c19729de860ea",
"name": "Example Name",
"type": "voucher",
"sellerId": "507f191e810c19729de860ea",
"active": true,
"isFulfillable": true,
"image": "string",
"description": "string",
"variants": [
{
"_id": "507f191e810c19729de860ea",
"taxable": true,
"name": "Example Name",
"description": "string",
"priceType": "fixed",
"price": 10.5,
"priceRange": {
"min": 10.5,
"max": 10.5
},
"taxRate": 10.5,
"compareAtPrice": 10.5,
"taxServiceTypeId": "507f191e810c19729de860ea",
"gtin": "string",
"localization": {}
}
],
"categoryIds": [
"string"
],
"voucherSettings": {
"limitedValidityPeriod": true,
"validityConfig": {
"amount": 10.5,
"type": 10.5,
"untilEndOfPeriod": true
},
"pdfImage": "string",
"disclaimer": "string",
"documentTemplateSettings": {
"templates": [
{
"templateId": "507f191e810c19729de860ea",
"format": "A4",
"target": "thermal",
"type": "ticket"
}
]
}
},
"addOnSettings": {
"optOutDescription": "string",
"localization": {}
},
"donationSettings": {
"campaignId": "507f191e810c19729de860ea",
"fundId": "507f191e810c19729de860ea"
},
"meta": {},
"localization": {},
"createdAt": "2030-01-23T23:00:00.123Z",
"updatedAt": "2030-01-23T23:00:00.123Z"
}
]