Direct selling API v3

The Direct selling API allows you to retrieve offers that are published to a specific sales point on the direct sales channel, and sell products related to the offer. This API is mainly used for selling products through direct sales channels such as cash registers, self-service kiosks, or websites.

All information that passes through the Direct selling API is stored in Enviso.

Terminologies

In the context of using the Direct selling API, here's a short description of what certain terminologies imply.

Venue

A venue is an organisation unit that registers on the enviso sales application for selling their tickets through one or more sales channels (direct or indirect).

Organisation

An organisation is the overarching term that is used for bundling multiple venue units. In this case, multiple venue units are part of one organisation.

Sales point

A sales point is a physical or virtual location where orders can occur and sales can be made.

Eg: Cash register (physical) or Web shop (virtual)

Product

A product is a sell-able thing. In the context of the Direct selling API this can be referred to as a ticket.

Eg: Adult safari ticket is referred to as a product.

Note

Result of a product sale is a ticket barcode.

Offer

An offer is a bundle of Product(s) made available for selling.

Eg: An offer could consist of Adult safari ticket. While another offer could consist of two products, Adult safari ticket and Child safari ticket.

Capacity

Capacity refers to the restriction on the number of visitors for an offer. Capacity types are per day, per slot and total.

Reservation

A reservation is a temporary reserved product.

When a reservation is created, the total capacity is reduced with the number of products that are reserved.

By default, the reservation time is 30 minutes. This means that if a reservation is not confirmed within 30 minutes, the system will automatically expire the reservation and add the reserved number of products to the total capacity again.

Basket

A basket is a bundle of temporarily reserved products.

When the first reservation is created, a basket is automatically created as well.

A basket can be altered by adding new reservations, editing existing reservations or removing reservations from the basket.

Order

An order is the result of a basket checkout.

When a basket is ready to be paid, then we can checkout the basket which will result in a new order. This is necessary to take the end-user to the payment step.

Sale

A sale is the result of a paid order.

When an order is paid, it results in a sale that contains links to both the order and the related payment details.

Order process

DIRAPI_clip005.png

  1. Search products (offers)

    The Direct selling API returns the offers which are published to the corresponding direct channel sales point. Every offer contains one or more products which can be sold.

    Eg.: "Entrance to the museum" can be an offer where "Child ticket" & "Adult ticket" are it's products.

  2. Create reservation

    Create a reservation for a product. The needed capacity will be reserved for a temporary amount of time (by default 30 minutes).

    Eg.: A family decides to visit the museum and wants to buy 2 "Adult tickets" and 1 "Child ticket". For this 2 reservations are needed.

    The creation of your first reservation will automatically create a new basket to which new reservations can be added or existing reservations can be removed or altered.

  3. Checkout order

    Checkout the basket containing all the reservations to create an order which can be paid.

    Once the order is created, the capacity is now reserved for a longer amount of time to make sure that the end user has time to finalize his payment.

    Eg.: Both reservations are part of the same basket, so the basket containing 2 reservations from the previous step are bundled into a single order.

  4. Pay (confirm) order

    The visitor pays the order (= confirms the order) and as a result the corresponding sales are created in Enviso.

    Eg.: The payment for the order that was created in previous step has been approved. By confirming the order, the sales are created in Enviso and the tickets (with barcodes or QR codes) are generated.

Data model

The following image shows a high-level overview of the domain model for the Direct Selling API.

DIRAPI_clip006.png

Principles

The Direct selling API is a REST API solution and attempts to conform to the RESTful design principles.

Note

Throughout the document, {version} stands for the first digit of the version in use.

Eg: If you are using version 3.0, {version} would mean v3

Important to know:

  • All connections must be made over HTTPS, not HTTP.

  • All the query parameters are to be passed in lower case.

  • All date and time data in the API request passed/response received are in the UTC-00:00 format.

    • yyyy-MM-ddTHH:mm:ssZ (Eg.: 1994-11-05T13:15:30Z)

Response status codes

The following HTTP status codes are used within the Direct selling API.

Code

Description

200

OK

The request was successful, resulting in everything working as expected.

201

Created

The request was successful, resulting in the creation of new resource.

202

Accepted

The request has been accepted for processing, but processing has not been completed.

204

No Content

The request was successfully processed, and is not returning any content.

400

Bad Request

The server was unable to understand the request. The request is most likely malformed or a mandatory parameter is missing.

Note

It is recommended to make modifications to the current request and repeat the request.

401

Unauthorised

The request has not been processed because it lacks valid authentication credentials for the target resource.

If the request included valid authentication credentials, then the 401 response indicates that authorisation has been refused for the target resource.

403

Forbidden

The server understood the request but refuses to authorize it.

This probably means you did not pass the API Key (x-api-key) in your request headers.

404

Not Found

The requested resource does not exist.

The resource may be available in the future. Subsequent requests by the client are permissible.

409

Conflict

The request could not be handled due to a conflict.

This can be caused by an update of a resource conflicting with a prior change or data being out-of-sync. Subsequent requests by the client are permissible.

422

Unprocessable Entity

The server understands the content type of the request entity, but was unable to process the contained instructions.

For example, this error condition may occur if validation rules to process the entity fail.

429

Too Many Requests

The server received too many request in a given amount of time.

500

Internal Server Error

The server encountered an unexpected error, which prevented it from fulfilling the request.

502

Bad Gateway

The server, while acting as a gateway or proxy, received an invalid response from the upstream server.

503

Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.

Request headers

  • The request and response data is sent as JSON.

    content-type: application/json
  • The API Key is required to be passed in the HTTP Request Headers.

    x-api-key: your_api_key
  • The Tenant Key is required to be passed in the HTTP Request Headers.

    x-tenantsecretkey: your_tenant_key
  • The Authorization header is required for all endpoints.

    authorization: Bearer SPACE your_jwt_token

Error codes

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

1004

<field> must be greater than or equal to zero.

1005

The provided value for <field> is not valid.

1006

Please enter a valid email address.

1008

<field> must not exceed <field_max> characters.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

1012

<field> must be between <field_min> and <field_max>.

1013

<field> must not be in the past.

4004

Order ID <field_identifier> is not valid.

4006

Timeslot ID is not valid.

4007

Timeslot ID cannot be in the past.

4008

Tickets are not available in the requested quantity.

4011

Product ID <field_identifier> cannot be reserved as the offer period has elapsed.

4012

Reservations should occur per offer.

4013

Reservation ID <field_identifier> has expired.

4016

Order is already cancelled.

4019

Order is already confirmed.

4020

Order is already cancelled and it cannot be confirmed.

4021

Timeslot ID is not in the offer period.

4022

Visit date cannot be in the past.

4023

Visit date is not in the offer period.

4079

Order cannot be confirmed as the visit date has elapsed for the offer.

4091

Duplicate Reservation ID found.

4092

A maximum of 25 tickets can be added at a time.

4093

A maximum of total 100 tickets can be added at a time in an order.

4098

The entity could not be saved.

4101

One or more products not found.

4102

Reservations should occur per offer.

4103

One or more reservations not found.

4105

One or more reservations not found.

4106

The provided paid amount does not match the order amount.

4107

TimeSlotId is mandatory for reserving an offer with PERSLOT capacity.

4014

Reservation <field_identifier> is already confirmed. You can't create order for already confirmed reservation.

4018

VisitDate is mandatory for reserving an offer with PERDAY capacity.

4019

Product ID <field_identifier> cannot be reserved as the offer has expired.

4111

Orders cannot be cancelled within 2 hours of placing them.

4123

Order should occur per offer.

Authentication

Contact GANTNER support to obtain the Tenant key, API key and API secret key, which you need to start communicating to the API.

Once you have the needed information, you need to authenticate first before you'll be able to call the Direct selling API.

For this, you'll need to use the Authentication API.

Going live

When going from the staging environment to the production environment:

  • Use the production environment API key and API secret key of the Authentication API.

  • Use the production environment API Key and Tenant key of the Direct selling API.

    Note

    Contact GANTNER support to get your production environment keys of the Authentication API and Direct selling API.

  • Change the base URL from the staging environment to the production environment.

    • Production environment: https://api.enviso.io/directsellingapi

    • Staging environment: https://api.staging-enviso.io/directsellingapi

Offers

List offers

URL parameter

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offers for.

Offers will only be included in the result set when they are published to this sales point.

Query parameters

Name

Type

Required

Description

fromdate

date-time

false

Filter offer using from date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2018-01-20T00:00:00Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

false

Filter offer using end date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2018-01-20T23:59:59Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

searchcolumns

string

false

Filter offers by a certain field. For now, it is only possible to filter on offer name.

searchcolumns and searchterm should be used together for filtering offers.

searchterm

string

false

Filter offers using the provided search term.

searchterm and searchcolumns should be used together for filtering offers.

page

integer

false

Start page number for the range to show in the result set. If omitted, the first page of results will be returned.

page and perpage should be used together for applying pagination.

perpage

integer

false

Number of results per page. If omitted, the default page size will be used.

perpage and page should be used together for applying pagination.

language

string

false

The ISO 639-1 language code in which the offer information should be returned.

Default = en

updatedsince

date

false

When set, returns only those offers that have been updated since the given date (inclusive).

Format: yyyy-MM-dd

Example: updatedsince=2023-04-01

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Response

Success response code: 200 OK

Response header

link

<{Directselling Api Url}/{Version}/salespoints/{salespointid}/offers?page={Page}&perpage={PerPage}&searchcolumns={SearchColumns}&searchterm={SearchTerm}&fromdate={fromdate}&todate={todate}&language={language}>; rel="previous"; 

<{Directselling Api Url}/{Version}/salespoints/{salespointid}/offers?page={Page}&perpage={PerPage}&searchcolumns={SearchColumns}&searchterm={SearchTerm}&fromdate={fromdate}&todate={todate}&language={language}>; rel="current";

<{Directselling Api Url}/{Version}/salespoints/{salespointid}/offers?page={Page}&perpage={PerPage}&searchcolumns={SearchColumns}&searchterm={SearchTerm}&fromdate={fromdate}&todate={todate}&language={language}&updatedsince={updatedsince}>; rel="next"

Link relationship types

Relationship

Description

Method

Format

item

Get more detailed information about the offer

GET

{Directselling Api Url}/v3/salespoints/{salespointid}/offers/{id}

image

Get the offer image

GET

{Directselling Api Url}/v3/offers/{id}/images/{ImageKey}

Enum values

Parameter

Value

(offer) type

  • Regular

  • Group

ticketType

  • Individual

  • Group

Note

When offer type is 'Regular', the ticketType will be 'null'.

Possible error codes

Code

Message

1004

<field> must be greater than or equal to zero.

1005

The provided value for <field> is not valid.

1012

<field> must be between <field_min> and <field_max>.

9023

The provided value for <field> must be passed in <field_format> format.

9024

From date must be less than To date

9025

Sales Point ID <field_identifier> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/string/offers");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/string/offers")
  .header("Accept", "application/json")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/string/offers");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/salespoints/string/offers", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"offers": [
		{
			"offer": {
				"id": "number",
				"name": "string",
				"description": "string",
				"type": "string",
				"start": "date",
				"end": "date",
				"lastUpdatedOn": "date",
				"eventId": "number",
				"tags": [
					"string"
				],
				"ticketType": "string"
			},
			"links": [
				{
					"rel": "item",
					"href": "url_to_offer_detail"
				},
				{
					"rel": "image",
					"href": "url_to_offer_image"
				}
			]
		}
	]
}
{
	"errors": [
		{
			"message": "string",
			"propertyName": "string",
			"code": 0
		}
	]
}

Get offer detail

URL parameters

Name

Type

Required

Description

offerid

integer

true

The unique identifier of the offer.

salespointid

integer

true

The sales point ID to retrieve offers for.

Offers will only be included in the result set when they are published to this sales point.

Query parameter

Name

Type

Required

Description

language

string

true

The ISO 639-1 language code in which the offer information should be returned.

Default: en

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

self

Get the detailed information about the offer

GET {url}/v3/salespoints/{salespointid}/offers/{id}

image

Get the offer image

GET {url}/v3/offers/{id}/images/{ImageKey}

capacity

Get single offer capacity (in total, for 1 day or for 1 slot)

GET {url}/v3/salespoints/{salespointid}/offers/{id}/capacity

capacities

Get the offer capacities in bulk

GET {url}/v3/salespoints/{salespointid}/offers/{id}/capacities

timeslots

Get the offer time slots (when time slots are used)

GET {url}/v3/salespoints/{salespointid}/offers/{id}/timeslots

reserve

Reserve an offer product

POST {url}/v3/reservations?salespointid={salespointid}

Possible errors

Code

Message

1005

The provided value for <field> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/salespoints/0/offers/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"offer": {
		"id": "number",
		"name": "string",
		"type": "number",
		"description": "string",
		"start": "date",
		"end": "date",
		"lastUpdatedOn": "date",
		"eventId": "number",
		"groupSize": "number",
		"guideLanguages": [
			"en",
			"fr"
		],
		"capacity": {
			"frequency": "string",
			"amount": "number"
		},
		"products": [
			{
				"product": {
					"id": "number",
					"name": "string",
					"price": "number"
				},
				"links": [
					{
						"rel": "reserve",
						"href": "url_to_reserve_product"
					}
				]
			}
		]
	},
	"links": [
		{
			"rel": "self",
			"href": "url_to_offer_detail"
		},
		{
			"rel": "image",
			"href": "url_to_offer_image"
		},
		{
			"rel": "capacity",
			"href": "url_to_offer_capacity"
		},
		{
			"rel": "capacities",
			"href": "url_to_offer_capacities"
		},
		{
			"rel": "timeslots",
			"href": "url_to_offer_timeslots"
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer time slots

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve time slots for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date-time

false

The from date to fetch time slots for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2019-01-01T00:00:00

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

false

The to date to fetch time slots for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2019-01-31T23:59:59

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

capacity

Get the capacity for the timeslot

GET {url}/v3/salespoints/{salespointid}/offers/{id}/capacity?timeslotid={timeslotid}

offer

Get the detailed information about the offer

GET {url}/v3/salespoints/{salespointid}/offers/{id}

Possible error code

Code

Message

1005

The provided value for <field> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/timeslots");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/timeslots")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/timeslots");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/salespoints/0/offers/0/timeslots", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"timeslots": [
		{
			"timeslot": {
				"id": 0,
				"start": "2020-10-09T08:54:29.956Z",
				"end": "2020-10-09T08:54:29.956Z"
			},
			"links": [
				{
					"rel": "capacity",
					"href": "url_to_offer_capacity"
				}
			]
		}
	],
	"links": [
		{
			"rel": "offer",
			"href": "url_to_offer_detail"
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer image

URL parameters

Name

Type

Required

Description

id

integer

true

The unique identifier of the offer.

imagekey

string

true

The unique key of the image.

Response

Success response code: 200 OK

Response body on success: The image corresponding to the specified image key.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/offers/0/images/string");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/offers/0/images/string")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/offers/0/images/string");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/offers/0/images/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"value": {},
	"formatters": [
		{}
	],
	"contentTypes": [
		"string"
	],
	"declaredType": "string",
	"statusCode": 0
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

List offer capacity

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offer capacity for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date-time

true

The from date to fetch capacity for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2019-01-01T00:00:00

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

true

The to date to fetch capacity for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2019-01-31T23:59:59

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Note

You can directly use the visit date (without any date conversion) to fetch capacity as well as to reserve ticket quantity for offers that are of the capacity type PERDAY.

Response

Success response code: 200 OK

Response parameters per capacity type

Depending on the frequency, the content of the 'capacities' object will be different:

tick.png = included in the response

cross.png = not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

quantity

tick.png

tick.png

tick.png

date

cross.png

tick.png

cross.png

timeslot

cross.png

cross.png

tick.png

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/v3/salespoints/{salespointid}/offers/{id}

Enum value

Parameter

Value

frequency

  • Total

  • PerDay

  • PerSlot

Possible error codes

Code

Message

1001

<field> is required.

1005

The provided value for <field> is not valid.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/capacities");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/capacities")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/capacities");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/salespoints/0/offers/0/capacities", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"frequency": "string",
	"capacities": [
		{
			"quantity": "number",
			"date": "date",
			"timeslot": {
				"id": "number",
				"start": "date",
				"end": "date"
			}
		}
	],
	"links": [
		{
			"rel": "offer",
			"href": "url_to_offer_detail"
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

List available days

URL parameters

Name

Type

Required

Description

id

integer

true

The unique identifier of the sales point.

Offers will be included in the result set only when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date

true

The from date to fetch capacity for.

Format: yyyy-MM-dd

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Eg: fromdate=2019-01-01

todate

date

true

The to date to fetch capacity for.

Format: yyyy-MM-dd

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Eg: todate=2019-01-31

quantity

integer

false

The ticket quantity to fetch the available days for.

Default value: 1

Days will only be included in the result set when:

  • at least one time slot has the desired capacity when using PERSLOT capacity.

  • the day has the desired capacity when using PERDAY capacity.

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/v3/salespoints/{salespointid}/offers/{id}

Possible error codes

Code

Message

1001

<field> is required.

1005

The provided value for <field> is not valid.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/availabledays");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/availabledays")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/availabledays");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/salespoints/0/offers/0/availabledays", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"availableDays": [
		"date"
	],
	"links": [
		{
			"rel": "offer",
			"href": "url_to_offer_detail"
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer metadata

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the offer.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

Method

Format

item

Get more detailed information about the offer

GET

{url}/v3/salespoints/{salespointid}/offers/{id}

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/offers/string/metadata");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/offers/string/metadata")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/offers/string/metadata");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/offers/string/metadata", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"id": "number",
	"languagesOffered": "string",
	"visitDuration": "date",
	"formId": "string"
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Take or release capacity

Request parameters

Name

Type

Required

Description

offerid

route

true

The unique identifier of the offer.

salespointid

route

true

The unique identifier of the sales point.

timeslotid

query

true

The unique identifier of the timeslot.

Request body
Request body properties

Property

Type

Required

Description

quantity

number

true

Use a positive number to take capacity (taken capacity = increased).

Use a negative number to release capacity (taken capacity = decreased)

Response

Success response code: 204 No content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0") .header("accept", "text/plain") .header("authorization", "string") .header("x-tenantsecretkey", "string") .header("origin", "string") .header("x-api-key", "API_KEY") .asString();
Request
var data = null; var xhr = new XMLHttpRequest();
xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); }
}); xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY"); xhr.send(data);
Request
import http.client conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi") headers = { 'accept': "text/plain", 'authorization': "string", 'x-tenantsecretkey': "string", 'origin': "string", 'x-api-key': "API_KEY" } conn.request("GET", "/v3/salespoints/0/offers/0", headers=headers) res = conn.getresponse()
data = res.read() print(data.decode("utf-8"))
{
"quantity": "number"
}
Response
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

List prices

URL parameters

Name

Type

Required

Description

from

date

true

Filter offer from date.

Format: yyyy-MM-dd

Eg: from=2023-04-01

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

to

date

true

Filter offer end date.

Format: yyyy-MM-dd

Eg: to=2023-04-30

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/prices");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/prices")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/prices");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/salespoints/0/offers/0/prices", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"days": [
		{
			"date": "date",
			"products": [
				{
					"id": "number",
					"prices": [
						"number"
					]
				}
			]
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

List prices for a single day

URL parameter

Name

Type

Required

Description

date

date

true

Date to fetch price per time slot.

Format: yyyy-MM-dd

Eg: from=2023-04-01

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Response

Success response code: 200 OK

Note

The format for 'to' and 'from' timeslot is HH:mm:ss.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/priceperday");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/priceperday")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/salespoints/0/offers/0/priceperday");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/salespoints/0/offers/0/priceperday", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"timeslots": [
		{
			"id": "number",
			"from": "time",
			"to": "time",
			"products": [
				{
					"id": "number",
					"prices": "number"
				}
			]
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer translations

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the offer.

Eg: /offers/20/translation

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/offers/0/translation");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/offers/0/translation")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "v3/offers/0/translation");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/offers/0/translation", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"translations": [
		{
			"language": "string",
			"translation": {
				"name": "string",
				"description": "string",
				"shortDescription": "string",
				"tags": [
					"string"
				],
				"products": [
					{
						"id": "number",
						"name": "string"
					}
				]
			}
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer links

Request parameters

Name

Type

Required

Description

offerid

number

false

The unique identifier of the offer to filter links for a specific offer.

Eg: /offers/links?offerid=20

page

number

false

The page of the offer-links list you want to receive.

Default: 0

Eg: page=1

perpage

number

false

The number of offer links to receive per page.

Default: 50

Eg: perpage=25

Response

Success response code: 200 OK

Enum value

Parameter

Value

type

  • Clone

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/offers/links");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/offers/links")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/offers/links");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/offers/links", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
[
	{
		"sourceId": "number",
		"destinationId": "number",
		"type": "string"
	}
]
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Events

Get event details

Query parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the event.

Response

Success response code: 200 OK

Booking type

Booking type value

Booking type code

1

Single-slot

2

All slots

Event status

Event type value

Event type code

0

Draft

1

Active

2

In active

3

Archived

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/events/0");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/events/0")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/events/0");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/events/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": "number",
	"name": "string",
	"description": "string",
	"startDate": "dateTime",
	"endDate": "dateTime",
	"quantity": "number",
	"pictureUrl": "string",
	"timeSlots": [
		{
			"id": "number",
			"start": "dateTime",
			"end": "dateTime",
			"isBlocked": "boolean"
		}
	],
	"hasTimeSlots": "boolean",
	"address": {
		"latitude": "number",
		"longitude": "number"
	},
	"tags": [
		{
			"label": "string"
		}
	],
	"bookingType": "number",
	"status": "number"
}
json
{
	"errors": [
		{
			"message": "string",
			"propertyName": "string",
			"code": "number"
		}
	]
}

Basket/reservations

Create basket

Query parameter

Name

Type

Required

Description

salespointid

number

true

The sales point ID on which you want to create a basket.

Response

Success response code: 201 Created

Response parameters per capacity type

Depending on the frequency, the content of the request body should be different:

tick.png = Included in the response

cross.png = Not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

productId

tick.png

tick.png

tick.png

quantity

Note

In case of reservation of a group offer, the quantity will be the number of groups. Otherwise, the quantity will be the number of tickets.

tick.png

tick.png

tick.png

visitDate

cross.png

tick.png

cross.png

timeslotId

cross.png

cross.png

tick.png

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/baskets")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]")
  .asString();
Request
const data = JSON.stringify([
  {
    "productId": 0,
    "quantity": 0,
    "visitDate": "2019-08-24T14:15:22Z",
    "timeSlotId": 0
  }
]);

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v3/baskets");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("POST", "/v3/baskets", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
	"expireOn": "2020-10-14T19:25:32.059Z",
	"discountCode": "string",
	"discountCodes": [
		"string"
	],
	"pricing": {
		"subtotal": "decimal",
		"discount": "decimal",
		"total": "decimal"
	},
	"reservations": [
		{
			"offerId": "number",
			"visitDate": "2020-10-14T19:25:32.059Z",
			"timeSlot": {
				"id": "number",
				"from": "2020-10-14T19:25:32.059Z",
				"end": "2020-10-14T19:25:32.059Z"
			},
			"guideLanguage": "string",
			"groups": [
				{
					"numberOfVisitors": "number"
				}
			],
			"productReservations": [
				{
					"id": "number",
					"productId": "number",
					"quantity": "number",
					"unitPrice": "number",
					"pricing": {
						"subtotal": "number",
						"discount": "number",
						"total": "number"
					}
				}
			]
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get basket

URL parameter

Name

Type

Required

Description

id

GUID

true

The ID of the basket

Response

Success response code: 200 OK

Parameter

Parameter

Description

(reservations) id

This field will have a value only if the reservation is a group reservation. Otherwise, it will be null.

(productReservations) quantity

In case of a group reservation, the quantity will be in the number of groups. Otherwise, the quantity will be the number of tickets.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/baskets/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/baskets/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("GET", "/v3/baskets/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
	"expireOn": "2020-10-14T19:25:32.059Z",
	"discountCode": "string",
	"discountCodes": [
		"string"
	],
	"pricing": {
		"subtotal": "decimal",
		"discount": "decimal",
		"total": "decimal"
	},
	"reservations": [
		{
			"id": "number",
			"offerId": "number",
			"visitDate": "2020-10-14T19:25:32.059Z",
			"timeSlot": {
				"id": "number",
				"from": "2020-10-14T19:25:32.059Z",
				"end": "2020-10-14T19:25:32.059Z"
			},
			"guideLanguage": "string",
			"groups": [
				{
					"numberOfVisitors": "number"
				}
			],
			"productReservations": [
				{
					"id": "number",
					"productId": "number",
					"quantity": "number",
					"unitPrice": "number",
					"pricing": {
						"subtotal": "number",
						"discount": "number",
						"total": "number"
					}
				}
			]
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Edit basket reservation

URL parameters

Name

Type

Required

Description

id

GUID

true

The ID of the basket

reservationid

number

true

The ID of the reservation

Response

Success response code: 200 OK

Parameter

Parameter

Description

quantity

In case of reserving a group offer with group tickets, this will be the number of visitors.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations/string");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "{\"id\":0,\"quantity\":0}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations/string")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("{\"id\":0,\"quantity\":0}")
  .asString();
Request
const data = JSON.stringify({
  "id": 0,
  "quantity": 0
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations/string");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"id\":0,\"quantity\":0}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("PUT", "/v3/baskets/string/reservations/string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
	"expireOn": "2020-10-14T19:25:32.059Z",
	"discountCode": "string",
	"discountCodes": [
		"string"
	],
	"pricing": {
		"subtotal": 0,
		"discount": 0,
		"total": 0
	},
	"reservations": [
		{
			"id": 0,
			"productId": 0,
			"offerId": 0,
			"visitDate": "2020-10-14T19:25:32.059Z",
			"timeSlot": {
				"id": 0,
				"start": "2020-10-14T19:25:32.059Z",
				"end": "2020-10-14T19:25:32.059Z"
			},
			"quantity": 0,
			"unitPrice": 0,
			"pricing": {
				"subtotal": 0,
				"discount": 0,
				"total": 0
			},
			"guideLanguage": "string",
			"groups": [
				{
					"numberOfVisitors": 0
				}
			]
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Delete basket reservation

URL parameters

Name

Type

Required

Description

id

GUID

true

The ID of the basket

reservationid

number

true

The ID of the reservation

Response

Success response code: 200 OK

Parameter

Parameter

Description

quantity

In case of a group reservation, the quantity will be in number of groups. Otherwise, the quantity will be the number of tickets.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations/string");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.delete("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("DELETE", "/v3/baskets/string/reservations/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
	"expireOn": "2020-10-14T19:45:08.110Z",
	"discountCode": "string",
	"discountCodes": [
		"string"
	],
	"pricing": {
		"subtotal": "decimal",
		"discount": "decimal",
		"total": "decimal"
	},
	"reservations": [
		{
			"offerId": "number",
			"visitDate": "2020-10-14T19:45:08.111Z",
			"timeSlot": {
				"id": "number",
				"from": "2020-10-14T19:45:08.111Z",
				"end": "2020-10-14T19:45:08.111Z"
			},
			"guideLanguage": "string",
			"groups": [
				{
					"numberOfVisitors": "number"
				}
			],
			"productReservations": [
				{
					"id": "number",
					"productId": "number",
					"quantity": "number",
					"unitPrice": "number",
					"pricing": {
						"subtotal": "number",
						"discount": "number",
						"total": "number"
					}
				}
			]
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Add reservation(s) to basket

URL parameter

Name

Type

Required

Description

id

GUID

true

The ID of the basket

Response

Success response code: 200 OK

Depending on the frequency, the content of the request body should be different:

Response parameters per capacity type

tick.png = Included in the response

cross.png = Not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

productId

tick.png

tick.png

tick.png

quantity

tick.png

tick.png

tick.png

visitDate

cross.png

tick.png

cross.png

timeslotId

cross.png

cross.png

tick.png

Parameter

Parameter

Description

(reservations) quantity

In case of a group reservation, the quantity will be in number of groups.

numberOfVisitors

Number of visitors per group.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]")
  .asString();
Request
const data = JSON.stringify([
  {
    "productId": 0,
    "quantity": 0,
    "visitDate": "2019-08-24T14:15:22Z",
    "timeSlotId": 0
  }
]);

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v3/baskets/string/reservations");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("POST", "/v3/baskets/string/reservations", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
	"expireOn": "2020-10-14T19:54:40.037Z",
	"discountCode": "string",
	"discountCodes": [
		"string"
	],
	"pricing": {
		"subtotal": 0,
		"discount": 0,
		"total": 0
	},
	"reservations": [
		{
			"id": 0,
			"productId": 0,
			"offerId": 0,
			"visitDate": "2020-10-14T19:54:40.037Z",
			"timeSlot": {
				"id": 0,
				"start": "2020-10-14T19:54:40.037Z",
				"end": "2020-10-14T19:54:40.037Z"
			},
			"quantity": 0,
			"unitPrice": 0,
			"pricing": {
				"subtotal": 0,
				"discount": 0,
				"total": 0
			},
			"guideLanguage": "string",
			"groups": [
				{
					"numberOfVisitors": 0
				}
			]
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Add discount code to the basket

URL parameters

Name

Type

Required

Description

id

GUID

true

The ID of the basket.

code

string

true

The discount code.

Response

Success response code: 204 No content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Remove discount code from basket

URL parameters

Name

Type

Required

Description

id

GUID

true

The ID of the basket.

code

string

true

The discount code.

Response

Success response code: 204 No content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.delete("https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("DELETE", "/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Orders

Checkout basket (create order)

URL parameter

Name

Type

Required

Description

id

GUID

true

The ID of the basket.

Query parameter

Name

Type

Required

Description

language

string

false

The two-letter language code of the visitor

Eg: en

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/checkout");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/baskets/string/checkout")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}")
  .asString();
Request
const data = JSON.stringify({
  "visitor": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "address": {
      "country": "string",
      "city": "string",
      "postalcode": "string",
      "street": "string",
      "number": "string"
    },
    "phone": "string",
    "gender": 0,
    "dateOfBirth": "2019-08-24T14:15:22Z",
    "reasonForVisit": "string",
    "remarks": "string",
    "emailOfFinanceDivision": "string",
    "schoolName": "string",
    "groupName": "string",
    "ageRange": "string"
  },
  "formIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v3/baskets/string/checkout");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("POST", "/v3/baskets/string/checkout", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"id": 0,
	"number": "string",
	"amount": "number"
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Checkout basket as visitor (create order)

URL parameter

Name

Type

Required

Description

id

GUID

true

The ID of the basket.

Query parameter

Name

Type

Required

Description

language

string

false

The two-letter language code of the visitor

Eg: en

Request headers:

An additional request header called x-visitor-token is required. This should contain the JWT acquired using the Enviso Authentication API ( /v1/visitor/exchange-token ).

Further documentation on how to obtain this JWT can be found in the Enviso Authentication API documentation.

Warning

The JWT should not be prefixed with 'Bearer'. The raw token should be passed in this x-visitor-token header.

Request body (without dynamic checkout form)

Parameter

Parameter

Value

gender

  • 0 = UNKNOWN (default)

  • 1 = MALE

  • 2 = FEMALE

{
	"visitor": {
		"firstName": "string",
		"lastName": "string",
		"email": "string",
		"address": {
			"country": "string",
			"city": "string",
			"postalcode": "string",
			"street": "string",
			"number": "string"
		},
		"phone": "string",
		"gender": "number",
		"dateOfBirth": "2019-08-24T14:15:22Z",
		"reasonForVisit": "string",
		"remarks": "string",
		"emailOfFinanceDivision": "string",
		"schoolName": "string",
		"groupName": "string",
		"ageRange": "string",
		"covidFree": true,
		"newsletterOptIn": true
	},
	"formIds": [
		"497f6eca-6276-4993-bfeb-53cbbbba6f08"
	]
}
Request body (with dynamic checkout form)
{
	"visitor": {
		"<key>": "<value>"
	},
	"formIds": "string"
}
Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkoutasvisitor");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json-patch+json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\",\"covidFree\":true,\"newsletterOptIn\":true},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkoutasvisitor")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\",\"covidFree\":true,\"newsletterOptIn\":true},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}")
  .asString();
Request
const data = "{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\",\"covidFree\":true,\"newsletterOptIn\":true},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}";

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkoutasvisitor");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\",\"covidFree\":true,\"newsletterOptIn\":true},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}"

headers = {
    'Content-Type': "application/json-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("POST", "/v3/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkoutasvisitor", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"id": "number",
	"number": "string",
	"amount": "decimal"
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Cancel order

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order you want to cancel.

Query parameter

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to cancel an order.

Response

Success response code: 204 No Content

Possible errors

Code

Message

1003

<field> must be greater than 0.

4004

Order ID <field_identifier> is not valid.

4111

Orders cannot be cancelled within 2 hours of placing them.

4016

Order is already cancelled.

4019

Order is already confirmed.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/orders/string");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.delete("https://api.staging-enviso.io/directsellingapi/v3/orders/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.staging-enviso.io/directsellingapi/v3/orders/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("DELETE", "/v3/orders/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Confirm order

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order you want to confirm.

Query parameters

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to confirm the order.

sendemail

boolean

false

Indicates whether an e-mail with the tickets should be sent to the visitor.

Default value: False

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

Method

Format

item

Gets the order detail

GET

{url}/v3/orders/{id}?salespointid={salespointid}

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

1005

The provided value for <field> is not valid.

1006

Please enter a valid email address.

1008

<field_name> must not exceed <field_max> characters.

4004

Order ID <field_identifier> is not valid.

4019

Order is already confirmed.

4020

Order is already cancelled and it cannot be confirmed.

4079

Order cannot be confirmed as the visit date has elapsed for the offer.

4105

One or more reservations not found.

4106

The provided paid amount does not match the order amount.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/orders/string/confirm");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("undefined", "{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0},\"reference\":\"string\",\"method\":\"string\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/orders/string/confirm")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0},\"reference\":\"string\",\"method\":\"string\"}}")
  .asString();
Request
const data = JSON.stringify({
  "payment": {
    "amount": {
      "currency": "string",
      "value": 0
    },
    "reference": "string",
    "method": "string"
  }
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v3/orders/string/confirm");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0},\"reference\":\"string\",\"method\":\"string\"}}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("POST", "/v3/orders/string/confirm", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"order": {
		"id": 0,
		"number": "string",
		"amount": 0,
		"links": [
			{
				"rel": "string",
				"href": "string"
			}
		]
	},
	"sale": {
		"id": 0,
		"creationDate": "2020-10-15T05:57:47.401Z",
		"amount": 0,
		"salesPoint": {
			"id": 0,
			"name": "string"
		},
		"lines": [
			{
				"id": 0,
				"productId": 0,
				"eventId": 0,
				"timeSlotId": 0,
				"unitPrice": 0,
				"quantity": 0,
				"amount": 0,
				"creationDate": "2020-10-15T05:57:47.401Z",
				"orderLineId": 0,
				"vatRate": "number",
				"barcodes": [
					{
						"barcode": "string",
						"creationDate": "2020-10-15T05:57:47.401Z"
					}
				]
			}
		]
	}
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get order detail

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order.

Query parameter

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to get the order detail.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

confirm

Confirms an order

POST {url}/v3/orders/{id}/confirm?salespointid={salespointid}

cancel

Cancels an order

DELETE {url}/v3/orders/{id}?salespointid={salespointid}

Note

The links are only available when the order status is 'PENDING' as changes are not longer supported for cancelled or confirmed orders.

Parameter

Parameter

Value/Description

status

  • 1 = Confirmed

  • 2 = Cancelled

  • 3 = Reserved

(orderItems) product

Only for 'regular' offers and 'group' offers with 'group tickets'. For other offer types, it will be null.

Note

Either product or productOrderLines will be filled. The other one will always be null.

groups

Only for 'group' offers.

productOrderLines

Only for 'group' offers with 'individual tickets'. For other offer types, it will be null.

Note

Either product or productOrderLines will be filled. The other one will always be null.

(productOrderLines) id

orderline ID

visitor

This parameter is optional

gender

  • 0 = UNKNOWN (default)

  • 1 = MALE

  • 2 = FEMALE

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/orders/string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/orders/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/orders/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/orders/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"id": "number",
	"number": "string",
	"pricing": {
		"subTotal": "decimal",
		"total": "decimal",
		"discount": "decimal",
		"cost": "decimal"
	},
	"language": "en",
	"createdOn": "date",
	"lastUpdatedOn": "date",
	"status": "number",
	"orderItems": [
		{
			"id": "number",
			"unitPrice": "decimal",
			"visitDate": "date",
			"quantity": "number",
			"product": {
				"id": "number",
				"name": "string",
				"price": "number",
				"vatRate": "number"
			},
			"guideLanguage": "string",
			"timeSlot": {
				"id": "number",
				"start": "date",
				"end": "date"
			},
			"offer": {
				"id": "number",
				"name": "string",
				"type": "number",
				"imageUrl": "string"
			},
			"pricing": {
				"subTotal": "decimal",
				"total": "decimal",
				"discount": "decimal",
				"cost": "decimal"
			},
			"groups": [
				{
					"numberOfVisitors": "number"
				}
			],
			"productOrderLines": [
				{
					"id": "number",
					"unitPrice": "decimal",
					"quantity": "number",
					"product": {
						"id": "number",
						"name": "string",
						"price": "decimal",
						"vatRate": "number"
					},
					"guideLanguage": "string",
					"pricing": {
						"subTotal": "decimal",
						"total": "decimal",
						"discount": "decimal"
					}
				}
			]
		}
	],
	"visitor": {
		"firstName": "string",
		"lastName": "string",
		"email": "string",
		"address": {
			"country": "string",
			"countryName": "string",
			"city": "string",
			"postalCode": "string",
			"street": "string",
			"number": "string"
		},
		"phone": "string",
		"gender": "number",
		"dateOfBirth": "date",
		"newsletterOptIn": "boolean",
		"groupName": "string",
		"remarks": "string",
		"reasonForVisit": "string",
		"emailOfFinanceDivision": "string",
		"schoolName": "string",
		"ageRange": "string",
		"covidFree": "boolean"
	},
	"links": [
		{
			"rel": "update",
			"href": "url_to_update_order"
		},
		{
			"rel": "confirm",
			"href": "url_to_confirm_order"
		},
		{
			"rel": "cancel",
			"href": "url_to_cancel_order"
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Rebook order

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Query parameter

Name

Type

Required

Description

salespointid

number

true

The sales point ID that is linked with the order.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

Method

Format

confirm

Confirm an order

POST

{url}/v3/orders/{id}/confirm?salespointid={salespointid}

cancel

Cancels an order

DELETE

{url}/v3/orders/{id}?salespointid={salespointid}

Note

The links are only available when the order status is 'PENDING' because changes are no longer supported for cancelled or confirmed orders.

Parameter

Parameter

Value

status

  • 1 = Confirmed

  • 2 = Cancelled

  • 3 = Reserved

(orderItems/productOrderLines) id

orderline ID

(orderItems) product

Only for 'regular' offers and 'group' offers with 'group tickets'.

groups

Only for 'group' offers.

productOrderLines

Only for 'group' offers with 'individual tickets'.

visitor

This is optional.

gender

  • 0 = UNKNOWN (default)

  • 1 = MALE

  • 2 = FEMALE

Possible error codes

Code

Message

1001

<field_name> is required.

1003

<field_name> must be greater than 0.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/orders/0/rebook");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json-patch+json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/orders/0/rebook")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}")
  .asString();
Request
const data = "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}";

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/orders/0/rebook");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io")

payload = "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}"

headers = {
    'Content-Type': "application/json-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/orders/0/rebook", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": "number",
	"number": "string",
	"pricing": {
		"subTotal": "decimal",
		"total": "decimal",
		"discount": "decimal",
		"cost": "decimal"
	},
	"language": "en",
	"createdOn": "date",
	"lastUpdatedOn": "date",
	"status": "number",
	"orderItems": [
		{
			"id": "number",
			"unitPrice": "decimal",
			"visitDate": "date",
			"quantity": "number",
			"product": {
				"id": "number",
				"name": "string",
				"price": "number",
				"vatRate": "number"
			},
			"guideLanguage": "string",
			"timeSlot": {
				"id": "number",
				"start": "date",
				"end": "date"
			},
			"offer": {
				"id": "number",
				"name": "string",
				"type": "number",
				"imageUrl": "string"
			},
			"pricing": {
				"subTotal": "decimal",
				"total": "decimal",
				"discount": "decimal",
				"cost": "decimal"
			},
			"groups": [
				{
					"numberOfVisitors": "number"
				}
			],
			"productOrderLines": [
				{
					"id": "number",
					"unitPrice": "decimal",
					"quantity": "number",
					"product": {
						"id": "number",
						"name": "string",
						"price": "decimal",
						"vatRate": "number"
					},
					"guideLanguage": "string",
					"pricing": {
						"subTotal": "decimal",
						"total": "decimal",
						"discount": "decimal"
					}
				}
			]
		}
	],
	"visitor": {
		"firstName": "string",
		"lastName": "string",
		"email": "string",
		"address": {
			"country": "string",
			"countryName": "string",
			"city": "string",
			"postalCode": "string",
			"street": "string",
			"number": "string"
		},
		"phone": "string",
		"gender": "number",
		"dateOfBirth": "date",
		"newsletterOptIn": "boolean",
		"groupName": "string",
		"remarks": "string",
		"reasonForVisit": "string",
		"emailOfFinanceDivision": "string",
		"schoolName": "string",
		"ageRange": "string",
		"covidFree": "boolean"
	},
	"links": [
		{
			"rel": "update",
			"href": "url_to_update_order"
		},
		{
			"rel": "confirm",
			"href": "url_to_confirm_order"
		},
		{
			"rel": "cancel",
			"href": "url_to_cancel_order"
		}
	]
}
[
	{
		"offerId": "number",
		"currentTimeSlotId": "number",
		"newTimeSlotId": "number",
		"errors": [
			{
				"message": "string",
				"code": "number"
			}
		]
	}
]
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get order operations

Query parameters

Name

Type

Required

Description

fromdate

date

true

The from date to fetch capacity for.

Format: yyyy-MM-ddTHH:mm:ssZ

Example: fromdate=2022-01-01T00:00:00Z

Note

The date range (fromdate - todate) can not exceed the maximum of 31 days.

All date and time data in the API request/response are passed in UTC-00:00 format.

todate

date

true

The to date to fetch orders for.

Format: yyyy-MM-ddTHH:mm:ssZ

Example: todate=2022-01-31T23:59:59Z

Note

The date range (fromdate - todate) can not exceed the maximum of 31 days.

All date and time data in the API request/response are passed in UTC-00:00 format.

type

string

false

For Direct selling API version 3.2 only type=Rebook supported, if not provided then also it will return Rebook operations.

Example: type=rebook

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/orders/operations");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/orders/operations")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/orders/operations");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/orders/operations", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
	{
		"id": "number",
		"type": "string",
		"orderId": "number",
		"offerId": "number",
		"oldTimeslotId": "number",
		"timeslotId": "number",
		"timestamp": "datetime"
	}
]
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Initiate drop-in payment session for order

URL parameter

Name

Type

Required

Description

id

integer

true

The ID of the order.

Query parameter

Name

Type

Required

Description

returnUri

string

true

The URL to return to after the payment concludes.

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/orders/0/payment");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json-patch+json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"returnUri\":\"https://api.staging-enviso.io/directsellingapi\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/orders/0/payment")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"returnUri\":\"https://api.staging-enviso.io/directsellingapi\"}")
  .asString();
Request
const data = "{\"returnUri\":\"https://api.staging-enviso.io/directsellingapi\"}";

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v3/orders/0/payment");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"returnUri\":\"https://api.staging-enviso.io/directsellingapi\"}"

headers = {
    'Content-Type': "application/json-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("POST", "/v3/orders/0/payment", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"reference": "string",
	"paymentSession": "string"
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get order pass link

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Eg: /orders/28149

Query parameter

Name

Type

Required

Description

language

string

true

The language code in which the pass details should be returned.

Default: en

Eg: language=nl

Response

Success response code: 200 OK

Parameter

Parameter

Value/Description

status

  • Pending

  • Generated

format

  • Pdf

  • Html

link

Only if status is `Generated`

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/orders/0/passesfile");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/orders/0/passesfile")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/orders/0/passesfile");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/orders/0/passesfile", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"status": "string",
	"format": "string",
	"link": "string"
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Forms

Get default fields

Query parameter

Name

Type

Required

Description

language

string

false

Language for fields.

Default = en

includePerTicketFields

boolean

false

Display formfields for per-ticket forms.

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

item

Get more detailed information about the offer

GET {url}/v3/salespoints/{salespointid}/offers/{id}

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/forms/default/fields");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/forms/default/fields")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/forms/default/fields");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/forms/default/fields", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
    {
        "name": "firstName",
        "type": "text",
        "label": "First name",
        "validations": [
            {
                "type": "maxlength",
                "error": "First name must not exceed 50 characters",
                "value": 50
            }
        ],
        "perTicket": false
    },
    {
        "name": "lastName",
        "type": "text",
        "label": "Last name",
        "validations": [
            {
                "type": "maxlength",
                "error": "Last name must not exceed 50 characters",
                "value": 50
            }
        ],
        "perTicket": false
    },
    {
        "name": "email",
        "type": "email",
        "label": "Email",
        "infoText": "Make sure this is correct so you'll receive your tickets.",
        "validations": [
            {
                "type": "required",
                "error": "Email address is required"
            },
            {
                "type": "email",
                "error": "Invalid email address"
            },
            {
                "type": "maxlength",
                "error": "Email address must not exceed 255 characters",
                "value": 255
            },
            {
                "type": "confirm",
                "error": "Email address does not match"
            }
        ],
        "perTicket": true
    },
    {
        "name": "address.country",
        "type": "country",
        "label": "Country",
        "infoText": "We need your country to determine your available payment methods.",
        "items": [
            {
                "text": "Afghanistan",
                "value": "AF"
            },
            {
                "text": "Åland Islands",
                "value": "AX"
            },
            {
                "text": "Albania",
                "value": "AL"
            }
        ],
        "validations": [
            {
                "type": "required",
                "error": "Please select country"
            }
        ],
        "perTicket": false
    }
]
json
{
   "errors": [
      {
         "message": "string",
         "code": 0
      }
   ]
}

Get fields by FormId

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the form.

Query parameter

Name

Type

Required

Description

language

string

false

Language for fields.

Eg: /07c632c6-7e3b-4eca-b6bf-e8c792b0fc2f/fields?language=en

includePerTicketFields

boolean

false

Display formfields for per-ticket forms.

Eg: /07c632c6-7e3b-4eca-b6bf-e8c792b0fc2f/fields?includePerTicketFields=false

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

item

Get formid linked with an offer

GET {url}/v3/offers/{offerid}/metadata

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/forms/string/fields");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = deUnirest.get("https://api.staging-enviso.io/directsellingapi/v3/forms/string/fields")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/forms/string/fields");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/forms/string/fields", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
	{
		"name": "schoolName",
		"type": "text",
		"label": "School name",
		"validations": [
			{
				"type": "maxlength",
				"error": "School name must not exceed 300 characters",
				"value": 300
			}
		],
		"perTicket": false
	},
	{
		"name": "firstName",
		"type": "text",
		"label": "First name",
		"validations": [
			{
				"type": "maxlength",
				"error": "First name must not exceed 50 characters",
				"value": 50
			}
		],
		"perTicket": false
	},
	{
		"name": "lastName",
		"type": "text",
		"label": "Last name",
		"validations": [
			{
				"type": "maxlength",
				"error": "Last name must not exceed 50 characters",
				"value": 50
			}
		],
		"perTicket": false
	},
	{
		"name": "email",
		"type": "email",
		"label": "Email",
		"infoText": "Make sure this is correct so you'll receive your tickets.",
		"validations": [
			{
				"type": "required",
				"error": "Email address is required"
			},
			{
				"type": "email",
				"error": "Invalid email address"
			},
			{
				"type": "maxlength",
				"error": "Email address must not exceed 255 characters",
				"value": 255
			},
			{
				"type": "confirm",
				"error": "Email address does not match"
			}
		],
		"perTicket": true
	},
	{
		"name": "address.country",
		"type": "country",
		"label": "Country",
		"infoText": "We need your country to determine your available payment methods.",
		"items": [
			{
				"text": "Afghanistan",
				"value": "AF"
			},
			{
				"text": "Åland Islands",
				"value": "AX"
			},
			{
				"text": "Albania",
				"value": "AL"
			},
			{
				"text": "Algeria",
				"value": "DZ"
			}
		],
		"validations": [
			{
				"type": "required",
				"error": "Please select country"
			}
		],
		"perTicket": false
	},
	{
		"name": "emailOfFinanceDivision",
		"type": "email",
		"label": "Email of finance division",
		"validations": [
			{
				"type": "email",
				"error": "Invalid email address"
			},
			{
				"type": "maxlength",
				"error": "Email address must not exceed 255 characters",
				"value": 255
			}
		],
		"perTicket": false
	},
	{
		"name": "phone",
		"type": "phone",
		"label": "Phone",
		"validations": [
			{
				"type": "phone",
				"error": "Invalid phone number"
			}
		],
		"perTicket": true
	},
	{
		"name": "address.number",
		"type": "text",
		"label": "House number",
		"validations": [
			{
				"type": "maxlength",
				"error": "House number must not exceed 50 characters",
				"value": 50
			}
		],
		"perTicket": false
	},
	{
		"name": "address.street",
		"type": "text",
		"label": "Street name",
		"validations": [
			{
				"type": "maxlength",
				"error": "Street name must not exceed 300 characters",
				"value": 300
			}
		],
		"perTicket": false
	},
	{
		"name": "address.city",
		"type": "text",
		"label": "City",
		"validations": [
			{
				"type": "maxlength",
				"error": "City name must not exceed 50 character",
				"value": 50
			}
		],
		"perTicket": false
	},
	{
		"name": "address.postalCode",
		"type": "text",
		"label": "Postal code",
		"validations": [
			{
				"type": "maxlength",
				"error": "Postal code must not exceed 20 characters",
				"value": 20
			}
		],
		"perTicket": false
	},
	{
		"name": "reasonForVisit",
		"type": "textarea",
		"label": "Reason for visit",
		"validations": [
			{
				"type": "maxlength",
				"error": "Reason for visit must not exceed 300 characters",
				"value": 300
			}
		],
		"perTicket": true
	},
	{
		"name": "remarks",
		"type": "textarea",
		"label": "Remarks",
		"validations": [
			{
				"type": "maxlength",
				"error": "Remarks must not exceed 300 characters",
				"value": 300
			}
		],
		"perTicket": false
	}
]
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Venues

Get own venue information

Response

Success response code: 200 OK

Response parameter

Parameter

Description

isoCode

The official ISO-4217 three-letter ("Alpha-3") currency code.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/venues/self");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/venues/self")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/venues/self");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/venues/self", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
[
	{
		"id": "number",
		"name": "string",
		"description": "string",
		"logoImageUrl": "string",
		"address": {
			"addressLine1": "string",
			"addressLine2": "string",
			"locality": "string",
			"postalCode": "string",
			"country": "string"
		},
		"googleLocation": {
			"latitude": "decimal",
			"longitude": "decimal"
		},
		"website": "string",
		"facebook": "string",
		"twitter": "string",
		"linkedin": "string",
		"coverImageUrl": "string",
		"currency": {
			"isoCode": "EUR",
			"symbol": "€",
			"format": "-1.234.567.890,11 €"
		}
	}
]
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Sales

List Sales

Query parameters

Name

Type

Required

Description

fromdate

datetime

false

Filter sales using from date

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2021-01-20T00:00:00Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

datetime

false

Filter sales using the end date

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2021-01-20T23:59:59Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

page

number

false

The start page number for the range to show in the result set. If omitted, the first page of the results will be returned.

Default = 0

Note

page and perpage should be used together for applying pagination.

perpage

number

false

The number of results per page. If omitted, the default page size will be used.

Default = 50

Note

page and perpage should be used together for applying pagination.

only-include-product-sales-lines

boolean

false

Whether or not to return all sales-lines or only the product sales-lines of the sales.

The default value is 'true', so that we do not break any integrations.

However, integrators should set the value to 'false' immediately. They should handle the added SalesLineType enum property in the sales-line dto.

Default = true

Eg: only-include-product-sales-lines=true

Response

Success response code: 200 OK

Response header

link

<{Directselling Api Url}/{Version}/salespoints/{salespointid}/offers?page={Page}&perpage={PerPage}&searchcolumns={SearchColumns}&searchterm={SearchTerm}&fromdate={fromdate}&todate={todate}&language={language}>; rel="previous"; 

<{Directselling Api Url}/{Version}/salespoints/{salespointid}/offers?page={Page}&perpage={PerPage}&searchcolumns={SearchColumns}&searchterm={SearchTerm}&fromdate={fromdate}&todate={todate}&language={language}>; rel="current"; 

<{Directselling Api Url}/{Version}/salespoints/{salespointid}/offers?page={Page}&perpage={PerPage}&searchcolumns={SearchColumns}&searchterm={SearchTerm}&fromdate={fromdate}&todate={todate}&language={language}>; rel="next"

Possible error codes

Code

Message

1004

field_name must be greater than or equal to zero.

1012

field_name must be between field_min and field_max.

Eg: perpage must be between 1 and 50.

9023

The provided value for field_name must be passed in field_format format.

Eg: The provided value for fromdate must be passed in yyyy-MM-ddTHH:mm:ssZ format.

9024

From date must be less than To date

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/sales");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/sales")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/sales");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/sales", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
[
	{
		"externalId": "string",
		"orderNumber": "string",
		"payment": {
			"method": "string",
			"reference": "string"
		},
		"discount": {
			"code": "string",
			"codes": [
				"string"
			],
			"amount": 0
		},
		"salesLines": [
			{
				"discountAmount": 0,
				"barcodes": [
					{
						"id": 0,
						"barcode": "string",
						"scanned": true,
						"valid": true,
						"numberOfVisitors": 0,
						"createdOn": "2022-12-20T09:28:22.519Z"
					}
				],
				"id": 0,
				"productId": 0,
				"productName": "string",
				"eventId": 0,
				"offerId": 0,
				"offerName": "string",
				"timeSlotId": 0,
				"unitPrice": 0,
				"quantity": 0,
				"amount": 0,
				"createdOn": "2022-12-20T09:28:22.519Z",
				"orderLineId": 0,
				"commissionType": 0,
				"commissionRate": 0,
				"commissionAmount": 0,
				"salesLineType": 0,
				"offerType": "string"
			}
		],
		"cost": 0,
		"visitorData": "string",
		"id": 0,
		"createdOn": "2022-12-20T09:28:22.519Z",
		"amount": 0,
		"salesChannelType": 0,
		"partner": {
			"id": 0,
			"name": "string",
			"profileName": "string",
			"logoImageUrl": "string"
		},
		"salesPoint": {
			"id": 0,
			"name": "string",
			"channelType": 0
		},
		"orderId": 0,
		"links": [
			{
				"href": "string",
				"rel": "string",
				"method": "string"
			}
		],
		"currencyInfo": {
			"currencySymbol": "string",
			"isoCurrencySymbol": "string"
		}
	}
]
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get Sale detail

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the sale.

Query parameter

Name

Type

Required

Description

only-include-product-sales-lines

boolean

false

Whether or not to return all sales-lines or only the product sales-lines of the sales.

The default value is 'true', so that we do not break any integrations.

However, integrators should set the value to 'false' immediately. They should handle the added SalesLineType enum property in the sales-line dto.

Default = true

Eg: only-include-product-sales-lines=true

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/sales/0");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/sales/0")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/sales/0");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string"
    }

conn.request("GET", "/v3/sales/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"id": 0,
	"creationDate": "2019-08-24T14:15:22Z",
	"amount": 0,
	"salesPoint": {
		"id": 0,
		"name": "string"
	},
	"lines": [
		{
			"id": 0,
			"productId": 0,
			"eventId": "string",
			"timeSlotId": 0,
			"unitPrice": 0,
			"quantity": 0,
			"amount": 0,
			"creationDate": "2019-08-24T14:15:22Z",
			"orderLineId": 0,
			"barcodes": [],
			"productName": "string",
			"commissionAmount": 0,
			"discountAmount": 0,
			"salesLineType": 0,
			"offerType": "string"
		}
	],
	"discountAmount": 0,
	"discountCodes": [
		"string"
	],
	"partner": {
		"id": 0,
		"name": "string"
	},
	"orderId": 0,
	"orderNumber": "string",
	"externalOrderId": "string",
	"payment": {
		"amount": {
			"currency": "string",
			"value": 0
		},
		"reference": "string",
		"method": "string"
	},
	"visitorData": {}
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Visitor

All requests for this resource will be executed as a logged-in visitor.

Request headers

An additional request header called 'x-visitor-token' (of type 'string') is required for all the requests. This should contain the JWT acquired using the Enviso Auth API (/v1/visitor/exchange-token). Further documentation on how to obtain this JWT can be found in the Enviso Auth API documentation.

Warning

The JWT should not be prefixed with 'Bearer'. The raw token should be passed in this x-visitor-token header.

Activate relation

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the visitor.

Eg: /visitor/21/activate

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/0/activate");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/visitor/0/activate")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/visitor/0/activate");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/visitor/0/activate", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"type": "string",
	"title": "string",
	"status": 0,
	"detail": "string",
	"instance": "string",
	"property1": null,
	"property2": null
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Deactivate relation

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the visitor.

Eg: /visitor/21/deactivate

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/0/deactivate");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/visitor/0/deactivate")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/visitor/0/deactivate");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/visitor/0/deactivate", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"type": "string",
	"title": "string",
	"status": 0,
	"detail": "string",
	"instance": "string",
	"property1": null,
	"property2": null
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get memberships

Response

Success response code: 200OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/memberships");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/visitor/memberships")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/visitor/memberships");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/visitor/memberships", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
[
	{
		"name": "string",
		"productName": "string",
		"membershipHolderName": "string",
		"validFrom": "date",
		"validTill": "date",
		"imageUrl": "string",
		"orderId": "number"
	}
]
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer image

URL parameter

Name

Type

Required

Description

offerid

number

true

The unique identifier of the offer.

Eg: /visitor/offers/123/images/912aa510-c595-4fca-97cd-319f7ff7dff1.jpeg

imagekey

string

true

The unique identifier of the offer image.

Eg: /visitor/offers/123/images/912aa510-c595-4fca-97cd-319f7ff7dff1.jpeg

Response

Success response code: 200 OK

Response body on success: The image corresponding to the specified image key.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/offers/0/images/string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "image/png");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/visitor/offers/0/images/string")
  .header("Accept", "image/png")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/visitor/offers/0/images/string");
xhr.setRequestHeader("Accept", "image/png");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "image/png",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/visitor/offers/0/images/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"value": null,
	"formatters": [
		{}
	],
	"contentTypes": [
		"string"
	],
	"declaredType": "string",
	"statusCode": 0
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get orders

Query parameters

Name

Type

Required

Description

fromdate

date

false

The from date to fetch orders for.

Format: yyyy-MM-ddTHH:mm:ssZ

Note

All date and time data in the API request/response are passed in UTC-00:00 format.

todate

date

false

The to date to fetch orders for.

Format: yyyy-MM-ddTHH:mm:ssZ

Note

All date and time data in the API request/response are passed in UTC-00:00 format.

visitfromdate

date

false

The from date of the visit of the orders you would like to receive.

Format: yyyy-MM-ddTHH:mm:ssZ

Note

All date and time data in the API request/response are passed in UTC-00:00 format.

visittodate

date

false

The to date of the visit of the orders you would like to receive.

Format: yyyy-MM-ddTHH:mm:ssZ

Note

All date and time data in the API request/response are passed in UTC-00:00 format.

page

integer

false

The page of the order-list you want to receive

Eg: page=1

perpage

integer

false

The number of orders to receive per page.

Default value: 50

Eg: perpage=25

searchterm

string

false

A string that is used to query results containing the given string in at least one of the following fields.

  • order number

  • reference-id

  • customer email

  • customer first name

  • customer last name

orderby

string

false

A string to sort the orders. You can sort by any of the below fields.

  • id

  • amount

  • createdon

  • lastupdatedon

  • status

  • quantity

  • number

  • email

  • name

After the given sort field, you can specify the direction. This is either ASC or DESC. The default is ASC.

Eg: orderby=createdon DESC

status

integer

(int,int,int)

false

Comma-separated list of status integers.

  • Draft = 0

  • Confirmed = 1

  • Cancelled = 2

  • Reserved = 3

  • Deleted = 4

Default value: 1,2,3

Eg: status=0

Request headers:

An additional request header called x-visitor-token is required. This should contain the JWT acquired using the Enviso Authentication API documentation (/v3/visitor/exchange-token).

Warning

The JWT should not be prefixed with 'Bearer'. The raw token should be passed in this x-visitor-token header.

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/visitor/orders");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/visitor/orders", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
	{
		"status": "number",
		"paymentStatus": "number",
		"id": "number",
		"number": "string",
		"amount": "number",
		"createdOn": "date",
		"currencyInfo": {
			"currencySymbol": "string",
			"isoCurrencySymbol": "string"
		},
		"salesPointId": "number",
		"isRefundable": "boolean"
	}
]
json
{
	"errors": [
		{
			"message": "string",
			"trace": "string"
		}
	]
}

Get order details

URL parameter

Name

Type

Required

Description

id

long

true

The unique identifier of the order.

Eg: visitor/orders/56/

Query parameter

Name

Type

Required

Description

salespointid

long

true

The sales point ID that is linked with an order.

Eg: salespointid=21

Request headers:

An additional request header called x-visitor-token is required. This should contain the JWT acquired using the Enviso Authentication API documentation (/v1/visitor/exchange-token).

Warning

The JWT should not be prefixed with 'Bearer'. The raw token should be passed in this x-visitor-token header.

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/visitor/orders/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"id": "number",
	"number": "string",
	"createdOn": "date",
	"payment": {
		"method": "string",
		"otherMethodName": "string",
		"amount": {
			"currency": "string",
			"value": "number"
		},
		"referenceId": "string",
		"isRefundable": "boolean"
	},
	"orderItems": [
		{
			"id": "number",
			"unitPrice": "number",
			"vatRate": "number",
			"quantity": "number",
			"totalPrice": "number",
			"visitDate": "string",
			"timeSlotId": "number",
			"startTime": "string",
			"endTime": "string",
			"product": {
				"offer": {
					"type": "number",
					"offerType": "number",
					"frequencyType": "number",
					"id": "number",
					"eventId": "number",
					"name": "string",
					"description": "string",
					"imageUrl": "string",
					"culture": "string",
					"venue": {
						"id": "number",
						"name": "string",
						"profileName": "string",
						"addressLine1": "string",
						"addressLine2": "string",
						"country": "string",
						"locality": "string",
						"postalcode": "string",
						"locale": {
							"culture": "string",
							"timezoneId": "string",
							"currencySymbol": "string",
							"isoCurrencySymbol": "string",
							"timeZoneOffset": "string"
						}
					},
					"startDate": "date",
					"endDate": "date"
				},
				"id": "number",
				"name": "string",
				"price": "number",
				"productId": "number"
			},
			"guideLanguage": "string",
			"ticketBarcodes": [
				{
					"barcodeFormat": "string",
					"barcodeString": "string",
					"barcode": "string",
					"creationDate": "date"
				}
			],
			"amount": "number",
			"visitorGroups": [
				{
					"numberOfVisitors": "number"
				}
			],
			"validFrom": "date",
			"validTill": "date",
			"isRebookable": "boolean",
			"isCancelable": "boolean"
		}
	],
	"currencyInfo": {
		"currencySymbol": "string",
		"isoCurrencySymbol": "string"
	}
}
json
{
	"errors": [
		{
			"message": "string",
			"trace": "string"
		}
	]
}

Cancel order

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Eg: visitor/orders/56

Query parameter

Name

Type

Required

Description

salespointid

number

true

The sales point ID which is linked with the order.

Eg: salespointid=21

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/cancel");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/cancel")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/cancel");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/visitor/orders/0/cancel", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get order pass link

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Eg: visitor/orders/28149

Query parameter

Name

Type

Required

Description

language

string

true

The language code in which the pass details should be returned.

Default: en

Eg: language=nl

Response

Success response code: 200 OK

Enum values

Parameter

Value/Description

status

  • Pending

  • Generated

format

  • Pdf

  • Html

link

Only if the status is `Generated`

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/passes/link");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/passes/link")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/passes/link");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/visitor/orders/0/passes/link", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"status": "string",
	"format": "string",
	"link": "string"
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Rebook order

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Eg: visitor/orders/56

Query parameter

Name

Type

Required

Description

salespointid

number

true

The sales point ID on which you want to get the order detail.

Eg: salespointid=21

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json-patch+json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}")
  .asString();
Request
const data = "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}";

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0}]}"

headers = {
    'Content-Type': "application/json-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/visitor/orders/0/rebook", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"orderItems": [
		{
			"offerId": "number",
			"currentTimeSlotId": "number",
			"newTimeSlotId": "number"
		}
	]
}
json
{
	"errors": [
		{
			"message": "string",
			"trace": "string"
		}
	]
}

Get relations

Response

Success response code: 200 OK

Enum value

Parameter

Value

type

  • Other

  • Partner

  • Child

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/relations");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/visitor/relations")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/visitor/relations");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/visitor/relations", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
[
	{
		"id": "number",
		"customerId": "number",
		"type": "string",
		"firstName": "string",
		"lastName": "string",
		"active": "boolean",
		"birthDate": "date",
		"pictureUrl": "string"
	}
]
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Create relation

Response

Success response code: 200 OK

Enum value

Parameter

Value

type

  • Other

  • Partner

  • Child

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/relations");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json-patch+json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"type\":\"Other\",\"firstName\":\"string\",\"lastName\":\"string\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/visitor/relations")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"type\":\"Other\",\"firstName\":\"string\",\"lastName\":\"string\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\"}")
  .asString();
Request
const data = "{\"type\":\"Other\",\"firstName\":\"string\",\"lastName\":\"string\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\"}";

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v3/visitor/relations");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"type\":\"Other\",\"firstName\":\"string\",\"lastName\":\"string\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\"}"

headers = {
    'Content-Type': "application/json-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("POST", "/v3/visitor/relations", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"firstName": "string",
	"lastName": "string",
	"type": "string",
	"birthDate": "date",
	"newPictureData": "string"
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Modify relation

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the relation.

Eg: /visitor/relations/56

Response

Success response code: 204 No Content

Enum value

Parameter

Value

type

  • Other

  • Partner

  • Child

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/relations/0");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json-patch+json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"firstName\":\"string\",\"lastName\":\"string\",\"type\":\"Other\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\",\"removePicture\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/visitor/relations/0")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"firstName\":\"string\",\"lastName\":\"string\",\"type\":\"Other\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\",\"removePicture\":true}")
  .asString();
Request
const data = "{\"firstName\":\"string\",\"lastName\":\"string\",\"type\":\"Other\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\",\"removePicture\":true}";

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/visitor/relations/0");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"firstName\":\"string\",\"lastName\":\"string\",\"type\":\"Other\",\"birthDate\":\"2019-08-24T14:15:22Z\",\"newPictureData\":\"string\",\"removePicture\":true}"

headers = {
    'Content-Type': "application/json-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/visitor/relations/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
	"firstName": "string",
	"lastName": "string",
	"type": "string",
	"birthDate": "date",
	"newPictureData": "string",
	"removePicture": "boolean"
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get user profile

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/userprofile");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v3/visitor/userprofile")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v3/visitor/userprofile");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v3/visitor/userprofile", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"firstName": "string",
	"lastName": "string",
	"email": "string",
	"language": "string",
	"country": "string",
	"pictureUrl": "string"
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Modify user profile

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/userprofile");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json-patch+json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-visitor-token", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"language\":\"string\",\"country\":\"string\",\"newPictureData\":\"string\",\"removePicture\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v3/visitor/userprofile")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-visitor-token", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"language\":\"string\",\"country\":\"string\",\"newPictureData\":\"string\",\"removePicture\":true}")
  .asString();
Request
const data = "{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"language\":\"string\",\"country\":\"string\",\"newPictureData\":\"string\",\"removePicture\":true}";

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v3/visitor/userprofile");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-visitor-token", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"language\":\"string\",\"country\":\"string\",\"newPictureData\":\"string\",\"removePicture\":true}"

headers = {
    'Content-Type': "application/json-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-visitor-token': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v3/visitor/userprofile", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
	"firstName": "string",
	"lastName": "string",
	"email": "string",
	"language": "string",
	"country": "string",
	"newPictureData": "string",
	"removePicture": "boolean"
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Changelog

This section contains the notable changes in the Direct selling API.

Direct selling v3

Direct selling API v2

  • Changed reservation and order endpoints to work with the basket system in Enviso. Includes support for the group and guided offers.

Direct selling API v1

Initial version

Direct selling API v2

Note

The Direct selling API v2 will be replaced by Direct selling API v3 in the future. We recommend using Direct selling API v3.

The Direct selling API allows you to retrieve offers that are published to a specific sales point on the direct sales channel, and sell products related to the offer. This API is mainly used for selling products through direct sales channels such as cash registers, self-service kiosks or websites.

All information that passes through the Direct selling API is stored in Enviso.

Terminologies

In the context of using the Direct selling API, here's a short description of what certain terminologies imply.

Venue

A venue is an organisation unit that registers on the enviso sales application for selling their tickets through one or more sales channels (direct or indirect).

Organisation

An organisation is the overarching term that is used for bundling multiple venue units. In this case, multiple venue units are part of one organisation.

Sales point

A sales point is a physical or virtual location where orders can occur and sales can be made.

Eg: Cash register (physical) or Web shop (virtual)

Product

A product is a sell-able thing. In the context of the Direct selling API this can be referred to as a ticket.

Eg: Adult safari ticket is referred to as a product.

Note

Result of a product sale is a ticket barcode.

Offer

An offer is a bundle of Product(s) made available for selling.

Eg: An offer could consist of Adult safari ticket. While another offer could consist of two products, Adult safari ticket and Child safari ticket.

Capacity

Capacity refers to the restriction on the number of visitors for an offer. Capacity types are per day, per slot and total.

Reservation

A reservation is a temporary reserved product.

When a reservation is created, the total capacity is reduced with the number of products that are reserved.

By default, the reservation time is 30 minutes. This means that if a reservation is not confirmed within 30 minutes, the system will automatically expire the reservation and add the reserved number of products to the total capacity again.

Basket

A basket is a bundle of temporarily reserved products.

When the first reservation is created, a basket is automatically created as well.

A basket can be altered by adding new reservations, editing existing reservations or removing reservations from the basket.

Order

An order is the result of a basket checkout.

When a basket is ready to be paid, then we can checkout the basket which will result in a new order. This is necessary to take the end-user to the payment step.

Sale

A sale is the result of a paid order.

When an order is paid, it results in a sale that contains links to both the order and the related payment details.

Order process

DIRAPI_clip005.png

  1. Search products (offers)

    The Direct selling API returns the offers which are published to the corresponding direct channel sales point. Every offer contains one or more products which can be sold.

    Eg.: "Entrance to the museum" can be an offer where "Child ticket" & "Adult ticket" are it's products.

  2. Create reservation

    Create a reservation for a product. The needed capacity will be reserved for a temporary amount of time (by default 30 minutes).

    Eg.: A family decides to visit the museum and wants to buy 2 "Adult tickets" and 1 "Child ticket". For this 2 reservations are needed.

    The creation of your first reservation will automatically create a new basket to which new reservations can be added or existing reservations can be removed or altered.

  3. Checkout order

    Checkout the basket containing all the reservations to create an order which can be paid.

    Once the order is created, the capacity is now reserved for a longer amount of time to make sure that the end user has time to finalize his payment.

    Eg.: Both reservations are part of the same basket, so the basket containing 2 reservations from the previous step are bundled into a single order.

  4. Pay (confirm) order

    The visitor pays the order (= confirms the order) and as a result the corresponding sales are created in Enviso.

    Eg.: The payment for the order that was created in previous step has been approved. By confirming the order, the sales are created in Enviso and the tickets (with barcodes or QR codes) are generated.

Data model

The following image shows a high-level overview of the domain model for the Direct Selling API.

DIRAPI_clip006.png

Principles

The Direct selling API is a REST API solution and attempts to conform to the RESTful design principles.

Note

Throughout the document, {version} stands for the first digit of the version in use.

Eg: If you are using version 2.0, {version} would mean v2

Important to know:

  • All connections must be made over HTTPS, not HTTP.

  • All the query parameters are to be passed in lower case.

  • All date and time data in the API request passed/response received are in the UTC-00:00 format.

    • yyyy-MM-ddTHH:mm:ssZ (Eg.: 1994-11-05T13:15:30Z)

Response status codes

The following HTTP status codes are used within the Direct selling API.

Code

Description

200

OK

The request was successful, resulting in everything working as expected.

201

Created

The request was successful, resulting in the creation of new resource.

202

Accepted

The request has been accepted for processing, but processing has not been completed.

204

No Content

The request was successfully processed, and is not returning any content.

400

Bad Request

The server was unable to understand the request. The request is most likely malformed or a mandatory parameter is missing.

Note

It is recommended to make modifications in the current request and repeat the request.

401

Unauthorised

The request has not been processed because it lacks valid authentication credentials for the target resource.

If the request included valid authentication credentials, then the 401 response indicates that authorisation has been refused for the target resource.

403

Forbidden

The server understood the request but refuses to authorize it.

This probably means you did not pass the API Key (x-api-key) in your request headers.

404

Not Found

The requested resource does not exist.

The resource may be available in the future. Subsequent requests by the client are permissible.

422

Unprocessable Entity

The server understands the content type of the request entity, but was unable to process the contained instructions.

For example, this error condition may occur if validation rules to process the entity failed.

429

Too Many Requests

The server received too many request in a given amount of time.

500

Internal Server Error

The server encountered an unexpected error, which prevented it from fulfilling the request.

502

Bad Gateway

The server, while acting as a gateway or proxy, received an invalid response from the upstream server.

503

Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.

Request headers

  • The request and response data is sent as JSON.

    content-type: application/json
  • The API Key is required to be passed in the HTTP Request Headers.

    x-api-key: your_api_key
  • The Tenant Key is required to be passed in the HTTP Request Headers.

    x-tenantsecretkey: your_tenant_key
  • The Authorization header is required for all endpoints.

    authorization: Bearer SPACE your_jwt_token

Error codes

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

1004

<field> must be greater than or equal to zero.

1005

The provided value for <field> is not valid.

1006

Please enter a valid email address.

1008

<field> must not exceed <field_max> characters.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

1012

<field> must be between <field_min> and <field_max>.

1013

<field> must not be in the past.

4004

Order ID <field_identifier> is not valid.

4006

Timeslot ID is not valid.

4007

Timeslot ID cannot be in the past.

4008

Tickets are not available in the requested quantity.

4011

Product ID <field_identifier> cannot be reserved as the offer period has elapsed.

4012

Reservations should occur per offer.

4013

Reservation ID <field_identifier> has expired.

4016

Order is already cancelled.

4019

Order is already confirmed.

4020

Order is already cancelled and it cannot be confirmed.

4021

Timeslot ID is not in the offer period.

4022

Visit date cannot be in the past.

4023

Visit date is not in the offer period.

4079

Order cannot be confirmed as the visit date has elapsed for the offer.

4091

Duplicate Reservation ID found.

4092

A maximum of 25 tickets can be added at a time.

4093

A maximum of total 100 tickets can be added at a time in an order.

4098

The entity could not be saved.

4101

One or more products not found.

4102

Reservations should occur per offer.

4103

One or more reservations not found.

4105

One or more reservations not found.

4106

The provided paid amount does not match the order amount.

4107

TimeSlotId is mandatory for reserving an offer with PERSLOT capacity.

4014

Reservation <field_identifier> is already confirmed. You can't create order for already confirmed reservation.

4018

VisitDate is mandatory for reserving an offer with PERDAY capacity.

4019

Product ID <field_identifier> cannot be reserved as the offer has expired.

4111

Orders cannot be cancelled within 2 hours of placing them.

4123

Order should occur per offer.

Authentication

Contact GANTNER support to obtain the Tenant key, API key and API secret key, which you need to start communicating to the API.

Once you have the needed information, you need to authenticate first before you'll be able to call the Direct selling API.

For this, you'll need to use the Authentication API.

Going live

When going from the staging/testing environment to the production environment:

  • Use the production environment API key and API secret key of the Authentication API

  • Use the production environment API Key and Tenant key of the Direct selling API

  • Change the base URL to the production environment https://api.enviso.io/directsellingapi

Note

Contact GANTNER support to get your production environment keys.

Offers

List offers

URL parameter

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offers for.

Offers will only be included in the result set when they are published to this sales point.

Query parameters

Name

Type

Required

Description

fromdate

date-time

false

Filter offer using from date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2018-01-20T00:00:00Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

false

Filter offer using end date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2018-01-20T23:59:59Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

searchcolumns

string

false

Filter offers by a certain field. For now, it is only possible to filter on offer name.

searchcolumns and searchterm should be used together for filtering offers.

searchterm

string

false

Filter offers using the provided search term.

searchterm and searchcolumns should be used together for filtering offers.

page

integer

false

Start page number for the range to show in the result set. If omitted, the first page of results will be returned.

page and perpage should be used together for applying pagination.

perpage

integer

false

Number of results per page. If omitted, the default page size will be used.

perpage and page should be used together for applying pagination.

Responses

Success response code: 200 OK

Link relationship types

Relationship

Description

Method

Format

item

Get more detailed information about the offer

GET

{url}/v2/salespoints/{salespointid}/offers/{id}

image

Get the offer image

GET

{url}/v2/offers/{id}/images/{ImageKey}

Possible error codes

Code

Message

1004

<field> must be greater than or equal to zero.

1005

The provided value for <field> is not valid.

1012

<field> must be between <field_min> and <field_max>.

9023

The provided value for <field> must be passed in <field_format> format.

9024

From date must be less than To date

9025

Sales Point ID <field_identifier> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/salespoints/string/offers");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/salespoints/string/offers")
  .header("Accept", "application/json")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/salespoints/string/offers");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/salespoints/string/offers", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
  "offers": [
    {
      "offer": {
        "id": 0,
        "name": "string",
        "description": "string",
        "start": "2020-10-15T06:45:15.915Z",
        "end": "2020-10-15T06:45:15.915Z",
        "type": "string", // Regular | Group
      },
      "links": [
        {
          "rel": "item",
          "href": "url_to_offer_detail"
        }, 
        {"rel": "image", 
         "href": "url_to_offer_image"
        }
      ]
    }
  ]
}
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer detail

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offers for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

self

Get the detailed information about the offer

GET {url}/v2/salespoints/{salespointid}/offers/{id}

image

Get the offer image

GET {url}/v2/offers/{id}/images/{ImageKey}

capacity

Get single offer capacity (in total, for 1 day or for 1 slot)

GET {url}/v2/salespoints/{salespointid}/offers/{id}/capacity

capacities

Get the offer capacities in bulk

GET {url}/v2/salespoints/{salespointid}/offers/{id}/capacities

timeslots

Get the offer time slots (when time slots are used)

GET {url}/v2/salespoints/{salespointid}/offers/{id}/timeslots

reserve

Reserve an offer product

POST {url}/v2/reservations?salespointid={salespointid}

Possible errors

Code

Message

1005

The provided value for <field> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/salespoints/0/offers/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "name": "string",
   "description": "string",
   "start": "2020-10-09T08:43:43.227Z",
   "end": "2020-10-09T08:43:43.227Z",
   "capacity": {
      "frequency": "string", // Total/PerDay/PerSlot
      "amount": 0
   },
   "products": [
      {
         "product": {
            "id": 0,
            "name": "string",
            "price": 0
         },
         "links": [
            {
               "rel": "reserve",
               "href": "url_to_reserve_product"
            }
         ]
      }
   ]
},    
        "links": [
            {
                "rel": "self",
                "href": "url_to_offer_detail"
            },
            {
                "rel": "image",
                "href": "url_to_offer_image"},

            {
                "rel": "capacity",        
                "href": "url_to_offer_capacity"    
            },
            {
                "rel": "capacities",
                "href": "url_to_offer_capacities"    
            }, 
            {        
                "rel": "timeslots",        
                "href": "url_to_offer_timeslots"    
        }
    ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer time slots

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve time slots for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date-time

false

The from date to fetch time slots for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2019-01-01T00:00:00

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

false

The to date to fetch time slots for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2019-01-31T23:59:59

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

capacity

Get the capacity for the timeslot

GET {url}/v2/salespoints/{salespointid}/offers/{id}/capacity?timeslotid={timeslotid}

offer

Get the detailed information about the offer

GET {url}/v2/salespoints/{salespointid}/offers/{id}

Possible error code

Code

Message

1005

The provided value for <field> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/timeslots");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/timeslots")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/timeslots");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/salespoints/0/offers/0/timeslots", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "timeslots": [
      {
         "timeslot": {
            "id": 0,
            "start": "2020-10-09T08:54:29.956Z",
            "end": "2020-10-09T08:54:29.956Z"
         },
         "links": [
            {
               "rel": "capacity",
               "href": "url_to_offer_capacity"
            }
         ]
      }
   ],
   "links": [
      {
         "rel": "offer",
         "href": "url_to_offer_detail"
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer image

URL parameters

Name

Type

Required

Description

id

integer

true

The unique identifier of the offer.

imagekey

string

true

The unique key of the image.

Response

Success response code: 200 OK

Response body on success: The image corresponding to the specified image key.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/offers/0/images/string");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/offers/0/images/string")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/offers/0/images/string");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/offers/0/images/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "value": {},
   "formatters": [
      {}
   ],
   "contentTypes": [
      "string"
   ],
   "declaredType": "string",
   "statusCode": 0
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer capacity

URL parameters

Name

Type

Required

Description

salespointid

integer

true

The sales point ID to retrieve offer capacity for.

Offers will only be included in the result set when they are published to this sales point.

id

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

date

date

false

The date to retrieve offer capacity for.

Only to be used for offers with PERDAY capacity.

Format: yyyy-MM-dd

timeslotid

integer

false

The time slot to retrieve offer capacity for.

Only to be used for offers with PERSLOT capacity.

Note

You can directly use the visit date (without any date conversion) to fetch capacity as well as to reserve ticket quantity for offers that are of the capacity type PERDAY.

Response

Success response code: 200 OK

Response parameters per capacity type

Depending on the frequency, the content of the 'capacities' object will be different:

tick.png = Included in the response

cross.png = Not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

quantity

tick.png

tick.png

tick.png

date

cross.png

tick.png

cross.png

timeslot

cross.png

cross.png

tick.png

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/v2/salespoints/{salespointid}/offers/{id}

Possible errors

Code

Message

1005

The provided value for <field> is not valid.

1013

<field> must not be in the past.

4006

Timeslot ID is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/capacity");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/capacity")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/capacity");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/salespoints/0/offers/0/capacity", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "frequency": "string", // Total/PerDay/PerSlot
   "capacity": {
      "quantity": 0
   }
}

{    
    "frequency": "string", // Total/PerDay/PerSlot    
    "capacity": {        
        "quantity": 0,        
        "date": "date",  // Capacity will be date wise if capacity type is PER_DAY.   //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")        
        "timeslot": {
            "id": "01",            
            "start": "date"  ,
            "end": "date"
        }
    },
    "links": 
    [
        {        
            "rel": "offer",        
            "href": "url_to_offer_detail"    
        }
    ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

List offer capacity

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offer capacity for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date-time

true

The from date to fetch capacity for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2019-01-01T00:00:00

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

true

The to date to fetch capacity for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2019-01-31T23:59:59

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Note

You can directly use the visit date (without any date conversion) to fetch capacity as well as to reserve ticket quantity for offers that are of the capacity type PERDAY.

Response

Success response code: 200 OK

Response parameters per capacity type

Depending on the frequency, the content of the 'capacities' object will be different:

tick.png = included in the response

cross.png = not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

quantity

tick.png

tick.png

tick.png

date

cross.png

tick.png

cross.png

timeslot

cross.png

cross.png

tick.png

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/v2/salespoints/{salespointid}/offers/{id}

Possible error codes

Code

Message

1001

<field> is required.

1005

The provided value for <field> is not valid.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/capacities");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/capacities")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/capacities");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/salespoints/0/offers/0/capacities", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{"frequency":"string","capacities":[{"quantity":0}]}

{
    "frequency": "string", // Total/PerDay/PerSlot
    "capacities": 
    [
    {
        "quantity": 1,
        "date": "date",
        "timeslot":        
    {                
        "id": 0,
        "start": "date",
        "end": "date"        
    }
}
],
    "links": 
    [
        {
        "rel": "offer",
        "href": "url_to_offer_detail"    
        }
    ]
}
json
{
  "frequency": "string",
  "capacities": [
    {
      "quantity": 0
    }
  ]
}

List available days

URL parameters

Name

Type

Required

Description

id

integer

true

The unique identifier of the sales point.

Offers will be included in the result set only when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date

true

The from date to fetch capacity for.

Format: yyyy-MM-dd

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Eg: fromdate=2019-01-01

todate

date

true

The to date to fetch capacity for.

Format: yyyy-MM-dd

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Eg: todate=2019-01-31

quantity

integer

false

The ticket quantity to fetch the available days for.

Default value: 1

Days will only be included in the result set when:

  • at least one time slot has the desired capacity when using PERSLOT capacity.

  • the day has the desired capacity when using PERDAY capacity.

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/v2/salespoints/{salespointid}/offers/{id}

Possible error codes

Code

Message

1001

<field> is required.

1005

The provided value for <field> is not valid.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/availabledays");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/availabledays")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/salespoints/0/offers/0/availabledays");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/salespoints/0/offers/0/availabledays", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "availableDays": [
      "2020-10-09T09:11:40.712Z"
   ]
}
{    
    "availableDays": [ 
        "date" ],
        "links": 
    [
        {
        "rel": "offer",
        "href": "url_to_offer_detail"    
        }
    ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer metadata

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the offer.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

Method

Format

item

Get more detailed information about the offer

GET

{url}/v2/salespoints/{salespointid}/offers/{id}

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/offers/string/metadata");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/offers/string/metadata")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/offers/string/metadata");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/offers/string/metadata", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
{
   "id": 0,
   "languagesOffered": [
      "string"
   ],
   "visitDuration": "date",
   "formId": "string"
}
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Basket/reservations

Create basket

Query parameter

Name

Type

Required

Description

salespointid

number

true

The sales point ID on which you want to create a basket.

Response

Success response code: 201 Created

Response parameters per capacity type

Depending on the frequency, the content of the request body should be different:

tick.png = Included in the response

cross.png = Not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

productId

tick.png

tick.png

tick.png

quantity

tick.png

tick.png

tick.png

visitDate

cross.png

tick.png

cross.png

timeslotId

cross.png

cross.png

tick.png

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/baskets");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v2/baskets")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]")
  .asString();
Request
const data = JSON.stringify([
  {
    "productId": 0,
    "quantity": 0,
    "visitDate": "2019-08-24T14:15:22Z",
    "timeSlotId": 0
  }
]);

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v2/baskets");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("POST", "/v2/baskets", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
   "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "expireOn": "2020-10-14T19:12:41.540Z",
   "discountCode": "string",
   "discountCodes": [
      "string"
   ],
   "pricing": {
      "subtotal": 0,
      "discount": 0,
      "total": 0
   },
   "reservations": [
      {
         "id": 0,
         "productId": 0,
         "offerId": 0,
         "visitDate": "2020-10-14T19:12:41.540Z",
         "timeSlot": {
            "id": 0,
            "start": "2020-10-14T19:12:41.540Z",
            "end": "2020-10-14T19:12:41.540Z"
         },
         "quantity": 0,
         "unitPrice": 0,
         "pricing": {
            "subtotal": 0,
            "discount": 0,
            "total": 0
         },
         "guideLanguage": "string",
         "groups": [
            {
               "numberOfVisitors": 0
            }
         ]
      }
   ]
}
json
{
  "errors": [
    {
      "message": "string",
      "propertyName": "string",
      "code": 0
    }
  ]
}

Get basket

URL parameter

Name

Type

Required

Description

id

GUID

true

The ID of the basket

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/baskets/string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/baskets/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/baskets/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("GET", "/v2/baskets/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
   "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "expireOn": "2020-10-14T19:22:44.084Z",
   "discountCode": "string",
   "discountCodes": [
      "string"
   ],
   "pricing": {
      "subtotal": 0,
      "discount": 0,
      "total": 0
   },
   "reservations": [
      {
         "id": 0,
         "productId": 0,
         "offerId": 0,
         "visitDate": "2020-10-14T19:22:44.084Z",
         "timeSlot": {
            "id": 0,
            "start": "2020-10-14T19:22:44.084Z",
            "end": "2020-10-14T19:22:44.085Z"
         },
         "quantity": 0,
         "unitPrice": 0,
         "pricing": {
            "subtotal": 0,
            "discount": 0,
            "total": 0
         },
         "guideLanguage": "string",
         "groups": [
            {
               "numberOfVisitors": 0
            }
         ]
      }
   ]
}
json
{
  "errors": [
    {
      "message": "string",
      "propertyName": "string",
      "code": 0
    }
  ]
}

Edit basket reservation

URL parameters

Name

Type

Required

Description

id

GUID

true

The ID of the basket

reservationid

number

true

The ID of the reservation

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations/string");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "{\"id\":0,\"quantity\":0}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations/string")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("{\"id\":0,\"quantity\":0}")
  .asString();
Request
const data = JSON.stringify({
  "id": 0,
  "quantity": 0
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations/string");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"id\":0,\"quantity\":0}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("PUT", "/v2/baskets/string/reservations/string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
   "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "expireOn": "2020-10-14T19:25:32.059Z",
   "discountCode": "string",
   "discountCodes": [
      "string"
   ],
   "pricing": {
      "subtotal": 0,
      "discount": 0,
      "total": 0
   },
   "reservations": [
      {
         "id": 0,
         "productId": 0,
         "offerId": 0,
         "visitDate": "2020-10-14T19:25:32.059Z",
         "timeSlot": {
            "id": 0,
            "start": "2020-10-14T19:25:32.059Z",
            "end": "2020-10-14T19:25:32.059Z"
         },
         "quantity": 0, // when reserving a group offer with group tickets, this is the number of visitors
         "unitPrice": 0,
         "pricing": {
            "subtotal": 0,
            "discount": 0,
            "total": 0
         },
         "guideLanguage": "string",
         "groups": [
            {
               "numberOfVisitors": 0
            }
         ]
      }
   ]
}
json
{
  "errors": [
    {
      "message": "string",
      "propertyName": "string",
      "code": 0
    }
  ]
}

Delete basket reservation

URL parameters

Name

Type

Required

Description

id

GUID

true

The ID of the basket

reservationid

number

true

The ID of the reservation

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations/string");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.delete("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("DELETE", "/v2/baskets/string/reservations/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
   "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "expireOn": "2020-10-14T19:45:08.110Z",
   "discountCode": "string",
   "discountCodes": [
      "string"
   ],
   "pricing": {
      "subtotal": 0,
      "discount": 0,
      "total": 0
   },
   "reservations": [
      {
         "id": 0,
         "productId": 0,
         "offerId": 0,
         "visitDate": "2020-10-14T19:45:08.111Z",
         "timeSlot": {
            "id": 0,
            "start": "2020-10-14T19:45:08.111Z",
            "end": "2020-10-14T19:45:08.111Z"
         },
         "quantity": 0, // if the reservation of group offer then the quantity will be in no. of groups
         "unitPrice": 0,
         "pricing": {
            "subtotal": 0,
            "discount": 0,
            "total": 0
         },
         "guideLanguage": "string",
         "groups": [
            {
               "numberOfVisitors": 0
            }
         ]
      }
   ]
}
json
{
  "errors": [
    {
      "message": "string",
      "propertyName": "string",
      "code": 0
    }
  ]
}

Add reservation(s) to basket

URL parameter

Name

Type

Required

Description

id

GUID

true

The ID of the basket

Response

Success response code: 200 OK

Response parameters per capacity type

Depending on the frequency, the content of the request body should be different:

tick.png = Included in the response

cross.png = Not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

productId

tick.png

tick.png

tick.png

quantity

tick.png

tick.png

tick.png

visitDate

cross.png

tick.png

cross.png

timeslotId

cross.png

cross.png

tick.png

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]")
  .asString();
Request
const data = JSON.stringify([
  {
    "productId": 0,
    "quantity": 0,
    "visitDate": "2019-08-24T14:15:22Z",
    "timeSlotId": 0
  }
]);

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v2/baskets/string/reservations");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("POST", "/v2/baskets/string/reservations", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
   "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "expireOn": "2020-10-14T19:54:40.037Z",
   "discountCode": "string",
   "discountCodes": [
      "string"
   ],
   "pricing": {
      "subtotal": 0,
      "discount": 0,
      "total": 0
   },
   "reservations": [
      {
         "id": 0,
         "productId": 0,
         "offerId": 0,
         "visitDate": "2020-10-14T19:54:40.037Z",
         "timeSlot": {
            "id": 0,
            "start": "2020-10-14T19:54:40.037Z",
            "end": "2020-10-14T19:54:40.037Z"
         },
         "quantity": 0, // if the reservation of group offer then the quantity will be in no. of groups
         "unitPrice": 0,
         "pricing": {
            "subtotal": 0,
            "discount": 0,
            "total": 0
         },
         "guideLanguage": "string",
         "groups": [
            {
               "numberOfVisitors": 0 // number of visitors per group
            }
         ]
      }
   ]
}
json
{
  "errors": [
    {
      "message": "string",
      "propertyName": "string",
      "code": 0
    }
  ]
}

Orders

Checkout basket (create order)

URL parameter

Name

Type

Required

Description

id

GUID

true

The ID of the basket.

Query parameter

Name

Type

Required

Description

language

string

true

The two-letter language code of the visitor

Eg: fr

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/checkout");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddParameter("undefined", "{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v2/baskets/string/checkout")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .body("{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}")
  .asString();
Request
const data = JSON.stringify({
  "visitor": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "address": {
      "country": "string",
      "city": "string",
      "postalcode": "string",
      "street": "string",
      "number": "string"
    },
    "phone": "string",
    "gender": 0,
    "dateOfBirth": "2019-08-24T14:15:22Z",
    "reasonForVisit": "string",
    "remarks": "string",
    "emailOfFinanceDivision": "string",
    "schoolName": "string",
    "groupName": "string",
    "ageRange": "string"
  },
  "formIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v2/baskets/string/checkout");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string"
    }

conn.request("POST", "/v2/baskets/string/checkout", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "number": "string",
   "amount": 0,
   "links": [
      {
         "rel": "string",
         "href": "string"
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Cancel order

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order you want to cancel.

Query parameter

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to cancel an order.

Response

Success response code: 204 No Content

Possible errors

Code

Message

1003

<field> must be greater than 0.

4004

Order ID <field_identifier> is not valid.

4111

Orders cannot be cancelled within 2 hours of placing them.

4016

Order is already cancelled.

4019

Order is already confirmed.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/orders/string");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.delete("https://api.staging-enviso.io/directsellingapi/v2/orders/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.staging-enviso.io/directsellingapi/v2/orders/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("DELETE", "/v2/orders/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Confirm order

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order you want to confirm.

Query parameters

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to confirm the order.

sendemail

boolean

false

Indicates whether an e-mail with the tickets should be sent to the visitor.

Default value: False

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

Method

Format

item

Gets the order detail

GET

{url}/v2/orders/{id}?salespointid={salespointid}

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

1005

The provided value for <field> is not valid.

1006

Please enter a valid email address.

1008

<field_name> must not exceed <field_max> characters.

4004

Order ID <field_identifier> is not valid.

4019

Order is already confirmed.

4020

Order is already cancelled and it cannot be confirmed.

4079

Order cannot be confirmed as the visit date has elapsed for the offer.

4105

One or more reservations not found.

4106

The provided paid amount does not match the order amount.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/orders/string/confirm");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("undefined", "{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0},\"reference\":\"string\",\"method\":\"string\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v2/orders/string/confirm")
  .header("Content-Type", "application/json")
  .header("Accept", "application/json")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0},\"reference\":\"string\",\"method\":\"string\"}}")
  .asString();
Request
const data = JSON.stringify({
  "payment": {
    "amount": {
      "currency": "string",
      "value": 0
    },
    "reference": "string",
    "method": "string"
  }
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v2/orders/string/confirm");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0},\"reference\":\"string\",\"method\":\"string\"}}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("POST", "/v2/orders/string/confirm", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "order": {
      "id": 0,
      "number": "string",
      "amount": 0,
      "links": [
         {
            "rel": "string",
            "href": "string"
         }
      ]
   },
   "sale": {
      "id": 0,
      "creationDate": "2020-10-15T05:57:47.401Z",
      "amount": 0,
      "salesPoint": {
         "id": 0,
         "name": "string"
      },
      "lines": [
         {
            "id": 0,
            "productId": 0,
            "eventId": 0,
            "timeSlotId": 0,
            "unitPrice": 0,
            "quantity": 0,
            "amount": 0,
            "creationDate": "2020-10-15T05:57:47.401Z",
            "orderLineId": 0,
            "barcodes": [
               {
                  "barcode": "string",
                  "creationDate": "2020-10-15T05:57:47.401Z"
               }
            ]
         }
      ]
   }
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get order detail

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order.

Query parameter

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to get the order detail.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

confirm

Confirms an order

POST {url}/v2/orders/{id}/confirm?salespointid={salespointid}

cancel

Cancels an order

DELETE {url}/v2/orders/{id}?salespointid={salespointid}

Note

The links are only available when the order status is 'PENDING' as changes are not longer supported for cancelled or confirmed orders.

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/orders/string");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/orders/string")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/orders/string");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/orders/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "order": {
      "id": 0,
      "number": "string",
      "amount": 0,
      "status": 1, // 1 = Confirmed, 2 = Cancelled, 3 = Reserved
      "orderItems": [
         {
            "id": 0,
            "quantity": 0,
            "amount": 0,
            "visitDate": "2020-10-15T06:07:08.590Z",
            "timeSlotId": 0,
            "product": {
               "id": 0,
               "name": "string",
               "price": 0
            }
         }
      ],
      "visitor": { // Optional
         "firstName": "string",
         "lastName": "string",
         "email": "string",
         "address": {
            "country": "string",
            "city": "string",
            "postalcode": "string",
            "street": "string",
            "number": "string"
         },
         "phone": "string",
         "gender": 0, // 0 = UNKNOWN (default), 1 = MALE, 2 = FEMALE
         "dateOfBirth": "2020-10-15T06:07:08.590Z",
         "newsletterOptIn": "boolean"
         "reasonForVisit": "string",
         "remarks": "string",
         "emailOfFinanceDivision": "string",
         "schoolName": "string",
         "groupName": "string",
         "ageRange": "string"
      },
      "links": [
         {
            "rel": "update",
            "href": "url_to_update_order"
         }
         {
            "rel": "confirm",
            "href": "url_to_confirm_order"
         }
         {
            "rel": "cancel",
            "href": "url_to_cancel_order"
         }
      ]
   }
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Forms

Get default fields

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

item

Get more detailed information about the offer

GET {url}/v2/salespoints/{salespointid}/offers/{id}

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/forms/default/fields");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/forms/default/fields")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/forms/default/fields");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/forms/default/fields", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
   {
      "name": "firstName",
      "type": "text",
      "label": "First name",
      "infoText": "string",
      "sortOrder": 0,
      "items": [
         {
            "text": "string",
            "value": "string"
         }
      ],
      "validations": [
         {
            "type": "maxlength",
            "error": "First name must not exceed 50 characters",
            "value": 50
         }
      ]
   }
]
[    
    {        
        "name": "lastName",        
        "type": "text",        
        "label": "Last name",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "First name must not exceed 50 characters",                
                "value": 50            
            }        
        ]    
        },    
            {        
                "name": "lastName",        
                "type": "text",        
                "label": "Last name",        
                "validations":     
        [            
            {                
                "type": "maxlength",                
                "error": "Last name must not exceed 50 characters",                
                "value": 50
            }
        ]   
            }      
            },
            {
                "name": "email",
                "type": "email",
                "label": "Email",
                "infoText": "Make sure this is correct so you'll receive your tickets.",
                "validations":[       
            {
                "type": "required",                
                "error": "Email address is required"            
            },
            {                
                "type": "email",                
                "error": "Invalid email address"            
            },            
            {                
                "type": "maxlength",                
                "error": "Email address must not exceed 255 characters",                
                "value": 255            
            },
            {
                "type": "confirm",                
                "error": "Email address does not match"            
            }        
        ]    
    },             
            {        
                "name": "address.country",        
                "type": "country",        
                "label": "Country",        
                "infoText": "We need your country to determine your available payment methods.",        
                "items": [            
                    {                
                        "text": "Afghanistan",                
                        "value": "AF"            
                    },            
                    {                
                        "text": "Åland Islands",                
                        "value": "AX"            
                    },            
                    {                
                        "text": "Albania",                
                        "value": "AL"            
                    }        
                ],        
                "validations": 
                [            
                    {                
                        "type": "required",                
                        "error": "Please select country"            
                    }        
                ]    
        }
    ]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get fields by FormId

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the form.

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

item

Get formid linked with an offer

GET {url}/v2/offers/{offerid}/metadata

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/forms/string/fields");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = deUnirest.get("https://api.staging-enviso.io/directsellingapi/v2/forms/string/fields")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/forms/string/fields");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/forms/string/fields", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
   {
      "name": "schoolName",
      "type": "text",
      "label": "School name",
      "infoText": "string",
      "sortOrder": 0,
      "items": [
         {
            "text": "string",
            "value": "string"
         }
      ],
      "validations": [
         {
            "type": "string",
            "error": "string",
            "value": {}
         }
      ]
   }
]

[    
    {        
        "name": "schoolName",        
        "type": "text",        
        "label": "School name",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "School name must not exceed 300 characters",                
                "value": 300            
            }        
        ]    
    },    
    {        
        "name": "firstName",        
        "type": "text",        
        "label": "First name",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "First name must not exceed 50 characters",                
                "value": 50            
            }        
        ]    
    },    
    {        
        "name": "lastName",        
        "type": "text",        
        "label": "Last name",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "Last name must not exceed 50 characters",                
                "value": 50            
            }        
        ]    
    },    
    {        
        "name": "email",        
        "type": "email",        
        "label": "Email",        
        "infoText": "Make sure this is correct so you'll receive your tickets.",        
        "validations": [            
            {                
                "type": "required",                
                "error": "Email address is required"            
            },            
            {                
                "type": "email",                
                "error": "Invalid email address"            
            },            
            {                
                "type": "maxlength",                
                "error": "Email address must not exceed 255 characters",                
                "value": 255            
            },            
            {                
                "type": "confirm",                
                "error": "Email address does not match"            
            }        
        ]    
    },    
    {        
        "name": "address.country",        
        "type": "country",        
        "label": "Country",        
        "infoText": "We need your country to determine your available payment methods.",        
        "items":[            
            {                
                "text": "Afghanistan",                
                "value": "AF"            
            },            
            {                
                "text": "Åland Islands",                
                "value": "AX"            
            },            
            {                
                "text": "Albania",                
                "value": "AL"            
            },            
            {                
                "text": "Algeria",                
                "value": "DZ"            
            }],        
        "validations": [            
            {                
                "type": "required",                
                "error": "Please select country"            
            }        
        ]    
    },    
    {        
        "name": "emailOfFinanceDivision",        
        "type": "email",        
        "label": "Email of finance division",        
        "validations": [            
            {                
                "type": "email",                
                "error": "Invalid email address"            
    },            
    {                
        "type": "maxlength",                
        "error": "Email address must not exceed 255 characters",                
        "value": 255            
    }        
]    
    },    
    {        
        "name": "phone",        
        "type": "phone",        
        "label": "Phone",        
        "validations": [            
            {                
                "type": "phone",                
                "error": "Invalid phone number"            
            }        
        ]    
    },    
    {        
        "name": "address.number",        
        "type": "text",        
        "label": "House number",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "House number must not exceed 50 characters",                
                "value": 50            
            }        
        ]    
    },    
    {        
        "name": "address.street",        
        "type": "text",        
        "label": "Street name",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "Street name must not exceed 300 characters",                
                "value": 300            
            }        
        ]    
    },    
    {        
        "name": "address.city",        
        "type": "text",        
        "label": "City",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "City name must not exceed 50 character",                
                "value": 50            
            }        
        ]    
    },    
    {        
        "name": "address.postalCode",        
        "type": "text",        
        "label": "Postal code",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "Postal code must not exceed 20 characters",                
                "value": 20            
            }        
        ]    
    },    
    {        
        "name": "reasonForVisit",        
        "type": "textarea",        
        "label": "Reason for visit",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "Reason for visit must not exceed 300 characters",                
                "value": 300            
            }        
        ]    
    },    
    {        
        "name": "remarks",        
        "type": "textarea",        
        "label": "Remarks",        
        "validations": [            
            {                
                "type": "maxlength",                
                "error": "Remarks must not exceed 300 characters",                
                "value": 300            
            }        
        ]    
    }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Venues

Get own venue information

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v2/venues/self");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("origin", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("Authorization", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v2/venues/self")
  .header("Accept", "application/json")
  .header("origin", "string")
  .header("x-tenantsecretkey", "string")
  .header("Authorization", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v2/venues/self");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'Accept': "application/json",
    'origin': "string",
    'x-tenantsecretkey': "string",
    'Authorization': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v2/venues/self", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
json
{
   "id": 0,
   "name": "string",
   "description": "string",
   "logoImageUrl": "string",
   "address": {
      "addressLine1": "string",
      "addressLine2": "string",
      "locality": "string",
      "postalCode": "string",
      "country": "string"
   },
   "googleLocation": {
      "latitude": 0,
      "longitude": 0
   },
   "website": "string",
   "facebook": "string",
   "twitter": "string",
   "linkedin": "string",
   "coverImageUrl": "string"
}
json
{
  "errors": [
    {
      "message": "string",
      "propertyName": "string",
      "code": 0
    }
  ]
}

Changelog

This section contains the notable changes in the Direct selling API.

Direct selling API v2

  • Changed reservation and order endpoints to work with the basket system in Enviso. Includes support for the group and guided offers.

Direct selling API v1

Initial version

Direct selling API v1

Note

The Direct selling API v1 will be replaced by Direct selling API v3 in the future. We recommend using Direct selling API v3.

The Direct selling API allows you to retrieve offers that are published to a specific sales point on the direct sales channel and sell it's related products. This API is mainly used for selling products through direct sales channels such as cash registers, self-service kiosks or websites.

All information that passes the Direct selling API is stored in Enviso.

Terminologies

In the context of using the Direct selling API, here's a short description of what certain terminologies imply.

Venue

A venue is an organisation unit that registers on the enviso sales application for selling their tickets through one or more sales channels (direct or indirect).

Organisation

An organisation is the overarching term that is used for bundling multiple venue units. In this case, multiple venue units are part of one organisation.

Sales point

A sales point is a physical or virtual location where orders can occur and sales can be made.

Example: Cash register (physical) or Web shop (virtual)

Product

A product is a sell-able thing. In the context of the Direct selling API this can be referred to as a ticket.

Example: Adult safari ticket is referred to as a product.

Note

Result of a product sale is a ticket barcode.

Offer

An offer is a bundle of Product(s) made available for selling.

Capacity

Capacity refers to the restriction on the number of visitors for an offer. Capacity types are per day, per slot and total.

Reservation

A reservation is a temporary reserved product.

When a reservation is created, the total capacity is reduced with the number of products that are reserved.

By default, the reservation time is 30 minutes. This means that if a reservation is not confirmed within 30 minutes, the system will automatically expire the reservation and add the reserved number of products to the total capacity again.

Order

An order is a bundle of one or multiple reservations.

Sale

A sale is the result of a paid order.

When an order is paid, it results in a sale that contains links to both the order and the related payment details.

Order process

UUID-4ccfc478-0b38-95fa-661f-d7ed35e867a4.png
  1. Search products (offers)

    The Direct selling API returns the offers which are published to the corresponding direct channel sales point. Every offer contains one or more products which can be sold.

    Eg.: "Entrance to the museum" can be an offer where "Child ticket" & "Adult ticket" are it's products.

  2. Create reservation

    Create a reservation for a product. The needed capacity will be reserved for a temporary amount of time (by default 30 minutes).

    Eg.: A family decides to visit the museum and wants to buy 2 "Adult tickets" and 1 "Child ticket". For this 2 reservations are needed.

  3. Create order

    Bundle all temporary reservations into an order which can be paid.

    Once the order is created, the capacity is now reserved for a longer amount of time.

    Eg.: Both reservations will be bought into a single transaction, so the 2 reservations from the previous step are bundled into a single order.

  4. Pay (confirm) order

    The visitor pays the order (= confirms the order) and as a result the corresponding sales are created in Enviso.

    Eg.: The payment for the order that was created in previous step has been approved. By confirming the order, the sales are created in enviso and the tickets (with barcodes or QR codes) are generated.

Data model

The following image shows a high level overview of the domain model for the Direct Selling API.

UUID-52cbb2cb-4941-ed20-bfeb-a95e4532ef1c.png

Principles

The Direct selling API is a REST API solution and attempts to conform to the RESTful design principles.

Note

Throughout the document, {version} stands for the first digit of the version in use.

Eg: If you are using the version 1.1, {version} would mean v1

Important to know:

  • All connections must be made over HTTPS, not HTTP.

  • All the query parameters are to be passed in lower case.

  • All date and time data in the API request passed/response received are in the UTC-00:00 format.

    • yyyy-MM-ddTHH:mm:ssZ (Eg.: 1994-11-05T13:15:30Z)

Response status codes

The following HTTP status codes are used within the Direct selling API.

Code

Description

200

OK

The request was successful, resulting in everything working as expected.

201

Created

The request was successful, resulting in the creation of new resource.

202

Accepted

The request has been accepted for processing, but processing has not been completed.

204

No Content

The request was successfully processed, and is not returning any content.

400

Bad Request

The server was unable to understand the request. The request is most likely malformed or a mandatory parameter is missing.

Tip

It is recommended to make modifications in the current request and repeat the request.

401

Unauthorised

The request has not been processed because it lacks valid authentication credentials for the target resource.

Tip

If the request included valid authentication credentials, then the 401 response indicates that authorisation has been refused for the target resource.

403

Forbidden

The server understood the request but refuses to authorize it.

Tip

This probably means you did not pass the API Key (x-api-key) in your request headers.

404

Not Found

The requested resource does not exist.

Tip

The resource may be available in the future. Subsequent requests by the client are permissible.

422

Unprocessable Entity

The server understands the content type of the request entity, but was unable to process the contained instructions.

For example, this error condition may occur if validation rules to process the entity failed.

429

Too Many Requests

The server received too many request in a given amount of time.

500

Internal Server Error

The server encountered an unexpected error, which prevented it from fulfilling the request.

502

Bad Gateway

The server, while acting as a gateway or proxy, received an invalid response from the upstream server.

503

Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.

Request headers

  • The request and response data is sent as JSON.

    • content-type: application/json

  • The API Key is required to be passed in the HTTP Request Headers.

    • x-api-key: your_api_key

  • The Tenant Key is required to be passed in the HTTP Request Headers.

    • x-tenantsecretkey: your_tenant_key

  • The Authorization header is required for all endpoints.

    • authorization: Bearer SPACE your_jwt_token

Error codes

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

1004

<field> must be greater than or equal to zero.

1005

The provided value for <field> is not valid.

1006

Please enter a valid email address.

1008

<field> must not exceed <field_max> characters.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

1012

<field> must be between <field_min> and <field_max>.

1013

<field> must not be in the past.

4004

Order ID <field_identifier> is not valid.

4006

Timeslot ID is not valid.

4007

Timeslot ID cannot be in the past.

4008

Tickets are not available in the requested quantity.

4011

Product ID <field_identifier> cannot be reserved as the offer period has elapsed.

4012

Reservations should occur per offer.

4013

Reservation ID <field_identifier> has expired.

4016

Order is already cancelled.

4019

Order is already confirmed.

4020

Order is already cancelled and it cannot be confirmed.

4021

Timeslot ID is not in the offer period.

4022

Visit date cannot be in the past.

4023

Visit date is not in the offer period.

4079

Order cannot be confirmed as the visit date has elapsed for the offer.

4091

Duplicate Reservation ID found.

4092

A maximum of 25 tickets can be added at a time.

4093

A maximum of total 100 tickets can be added at a time in an order.

4098

The entity could not be saved.

4101

One or more products not found.

4102

Reservations should occur per offer.

4103

One or more reservations not found.

4105

One or more reservations not found.

4106

The provided paid amount does not match the order amount.

4107

TimeSlotId is mandatory for reserving an offer with PERSLOT capacity.

4014

Reservation <field_identifier> is already confirmed. You can't create order for already confirmed reservation.

4018

VisitDate is mandatory for reserving an offer with PERDAY capacity.

4019

Product ID <field_identifier> cannot be reserved as the offer has expired.

4111

Orders cannot be cancelled within 2 hours of placing them.

4123

Order should occur per offer.

Authentication

Contact GANTNER support to obtain the Tenant key, API key and API secret key, which you need to start communicating to the API.

Once you have the needed information, you need to authenticate first before you'll be able to call the Direct selling API.

For this, you'll need to use the Authentication API.

Going live

When going from the staging/testing environment to the production environment:

  • Use the production environment API key and API secret key of the Authentication API

  • Use the production environment API Key and Tenant key of the Direct selling API

  • Change the base URL to the production environment https://api.enviso.io/directsellingapi

Note

Contact GANTNER support to get your production environment keys.

Offers

List offers

URL parameter

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offers for.

Offers will only be included in the result set when they are published to this sales point.

Query parameters

Name

Type

Required

Description

fromdate

date-time

false

Filter offer using from date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2018-01-20T00:00:00Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

false

Filter offer using end date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2018-01-20T23:59:59Z

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

searchcolumns

string

false

Filter offers by a certain field. For now, it is only possible to filter on offer name.

searchcolumns and searchterm should be used together for filtering offers.

searchterm

string

false

Filter offers using the provided search term.

searchterm and searchcolumns should be used together for filtering offers.

page

integer

false

Start page number for the range to show in the result set. If omitted, the first page of results will be returned.

page and perpage should be used together for applying pagination.

perpage

integer

false

Number of results per page. If omitted, the default page size will be used.

perpage and page should be used together for applying pagination.

Responses

Success response code: 200 OK

Possible error codes

Code

Message

1004

<field> must be greater than or equal to zero.

1005

The provided value for <field> is not valid.

1012

<field> must be between <field_min> and <field_max>.

9023

The provided value for <field> must be passed in <field_format> format.

9024

From date must be less than To date

9025

Sales Point ID <field_identifier> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi/")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/salespoints/0/offers", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "offers": [
      {
         "offer": {
            "id": 0,
            "name": "string",
            "description": "string",
            "start": "2020-10-09T05:52:45.746Z",
            "end": "2020-10-09T05:52:45.746Z"
         },
         "links": [
            {
               "rel": "string",
               "href": "string"
            }
         ]
      }
   ]
}

Get offer detail

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offers for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

self

Get the detailed information about the offer

GET {url}/{version}/salespoints/{salespointid}/offers/{id}

image

Get the offer image

GET {url}/{version}/offers/{id}/images/{ImageKey}

capacity

Get single offer capacity (in total, for 1 day or for 1 slot)

GET {url}/{version}/salespoints/{salespointid}/offers/{id}/capacity

capacities

Get the offer capacities in bulk

GET {url}/{version}/salespoints/{salespointid}/offers/{id}/capacities

timeslots

Get the offer time slots (when time slots are used)

GET {url}/{version}/salespoints/{salespointid}/offers/{id}/timeslots

reserve

Reserve an offer product

POST {url}/{version}/reservations?salespointid={salespointid}

Possible errors

Code

Message

1005

The provided value for <field> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/{version}/salespoints/0/offers/0");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/{version}/salespoints/0/offers/0")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/{version}/salespoints/0/offers/0");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi/")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/{version}/salespoints/0/offers/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "name": "string",
   "description": "string",
   "start": "2020-10-09T08:43:43.227Z",
   "end": "2020-10-09T08:43:43.227Z",
   "capacity": {
      "frequency": "string",
      "amount": 0
   },
   "products": [
      {
         "product": {
            "id": 0,
            "name": "string",
            "price": 0
         },
         "links": [
            {
               "rel": "string",
               "href": "string"
            }
         ]
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer time slots

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve time slots for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date-time

false

The from date to fetch time slots for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2019-01-01T00:00:00

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

false

The to date to fetch time slots for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2019-01-31T23:59:59

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

capacity

Get the capacity for the timeslot

GET {url}/v1/salespoints/{salespointid}/offers/{id}/capacity?timeslotid={timeslotid}

offer

Get the detailed information about the offer

GET {url}/v1/salespoints/{salespointid}/offers/{id}

Possible error code

Code

Message

1005

The provided value for <field> is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/timeslots");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/timeslots")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/timeslots");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi/")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/salespoints/0/offers/0/timeslots", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "timeslots": [
      {
         "timeslot": {
            "id": 0,
            "start": "2020-10-09T08:54:29.956Z",
            "end": "2020-10-09T08:54:29.956Z"
         },
         "links": [
            {
               "rel": "string",
               "href": "string"
            }
         ]
      }
   ],
   "links": [
      {
         "rel": "string",
         "href": "string"
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer image

URL parameters

Name

Type

Required

Description

id

integer

true

The unique identifier of the offer.

imagekey

string

true

The unique key of the image.

Response

Success response code: 200 OK

Response body on success: The image corresponding to the specified image key.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/offers/0/images/string");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/offers/0/images/string")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/offers/0/images/string");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi/")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/offers/0/images/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "value": {},
   "formatters": [
      {}
   ],
   "contentTypes": [
      "string"
   ],
   "declaredType": "string",
   "statusCode": 0
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer capacity

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offer capacity for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

date

date

false

The date to retrieve offer capacity for.

Only to be used for offers with PERDAY capacity.

Format: yyyy-MM-dd

timeslotid

integer

false

The time slot to retrieve offer capacity for.

Only to be used for offers with PERSLOT capacity.

Note

You can directly use the visit date (without any date conversion) to fetch capacity as well as to reserve ticket quantity for offers that are of the capacity type PERDAY.

Response

Success response code: 200 OK

Response parameters per capacity type

Depending on the frequency, the content of the 'capacities' object will be different:

UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png = Included in the response

UUID-29528d63-7541-d8dd-508a-009e978179a5.png = Not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

quantity

UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png

date

UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-29528d63-7541-d8dd-508a-009e978179a5.png

timeslot

UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/v1/salespoints/{salespointid}/offers/{id}

Possible errors

Code

Message

1005

The provided value for <field> is not valid.

1013

<field> must not be in the past.

4006

Timeslot ID is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/capacity");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/capacity")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/capacity");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi/")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/salespoints/0/offers/0/capacity", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "frequency": "string",
   "capacity": {
      "quantity": 0
   }
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

List offer capacity

URL parameters

Name

Type

Required

Description

id

integer

true

The sales point ID to retrieve offer capacity for.

Offers will only be included in the result set when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date-time

true

The from date to fetch capacity for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2019-01-01T00:00:00

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

todate

date-time

true

The to date to fetch capacity for.

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2019-01-31T23:59:59

Note

All date and time data in the API request passed/response received are in the UTC-00:00 format.

Note

You can directly use the visit date (without any date conversion) to fetch capacity as well as to reserve ticket quantity for offers that are of the capacity type PERDAY.

Response

Success response code: 200 OK

Response parameters per capacity type

Depending on the frequency, the content of the 'capacities' object will be different:

UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png = included in the response

UUID-29528d63-7541-d8dd-508a-009e978179a5.png = not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

quantity

UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png

date

UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-29528d63-7541-d8dd-508a-009e978179a5.png

timeslot

UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/{version}/salespoints/{salespointid}/offers/{id}

Possible error codes

Code

Message

1001

<field> is required.

1005

The provided value for <field> is not valid.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/{version}/salespoints/0/offers/0/capacities");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/{version}/salespoints/0/offers/0/capacities")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/{version}/salespoints/0/offers/0/capacities");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi/")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/{version}/salespoints/0/offers/0/capacities", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{"frequency":"string","capacities":[{"quantity":0}]}
json
{
  "frequency": "string",
  "capacities": [
    {
      "quantity": 0
    }
  ]
}

List available days

URL parameters

Name

Type

Required

Description

id

integer

true

The unique identifier of the sales point.

Offers will be included in the result set only when they are published to this sales point.

offerid

integer

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date

true

The from date to fetch capacity for.

Format: yyyy-MM-dd

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Eg: fromdate=2019-01-01

todate

date

true

The to date to fetch capacity for.

Format: yyyy-MM-dd

Date range (fromdate - todate) can not exceed the maximum of 31 days.

Eg: todate=2019-01-31

quantity

integer

false

The ticket quantity to fetch the available days for.

Default value: 1

Days will only be included in the result set when:

  • at least one time slot has the desired capacity when using PERSLOT capacity.

  • the day has the desired capacity when using PERDAY capacity.

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

offer

Get the detailed information about the offer

GET {url}/v1/salespoints/{salespointid}/offers/{id}

Possible error codes

Code

Message

1001

<field> is required.

1005

The provided value for <field> is not valid.

1010

The provided date range can not be in the past.

1011

The provided date range can not exceed more than 31 days.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/availabledays");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/availabledays")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/salespoints/0/offers/0/availabledays");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/salespoints/0/offers/0/availabledays", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "availableDays": [
      "2020-10-09T09:11:40.712Z"
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get offer metadata

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the offer.

Response

Success response code: 200 OK

Link relation type

Relationship

Description

Method

Format

item

Get more detailed information about the offer

GET

{url}/v1/salespoints/{salespointid}/offers/{id}

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/offers/0/metadata");
var request = new RestRequest(Method.OPTIONS);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.options("https://api.staging-enviso.io/directsellingapi/v1/offers/0/metadata")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("OPTIONS", "https://api.staging-enviso.io/directsellingapi/v1/offers/0/metadata");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi/")

conn.request("OPTIONS", "/v1/offers/0/metadata")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
{
   "id": 0,
   "languagesOffered": [
      "string"
   ],
   "visitDuration": "string",
   "formId": "string"
}
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Reservations

Create reservation(s)

Query parameter

Name

Type

Required

Description

salespointid

integer

true

The unique identifier of the sales point.

Response

Success response code: 200 OK

Response parameters per capacity type

Depending on the frequency, the content of the 'capacities' object will be different:

UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png = included in the response

UUID-29528d63-7541-d8dd-508a-009e978179a5.png = not included in the response

Parameter

TOTAL

PERDAY

PERSLOT

productid

UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png

quantity

UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png

date

UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png
UUID-29528d63-7541-d8dd-508a-009e978179a5.png

timeslotid

UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-29528d63-7541-d8dd-508a-009e978179a5.png
UUID-b7bc3841-d6d7-ee02-1eb4-d4e6a3d191b7.png

Link relationship types

Relationship

Description

URL

update

Update a reservation

PUT {url}/v1/reservations/{id}?salespointid={salespointid}

delete

Delete a reservation

DELETE {url}/v1/reservations/{id}?salespointid={salespointid}

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

1005

The provided value for <field> is not valid.

4006

Timeslot ID is not valid.

4007

Timeslot ID cannot be in the past.

4008

Tickets are not available in the requested quantity.

4011

Product ID <field_identifier> cannot be reserved as the offer period has elapsed.

4021

Timeslot ID is not in the offer period.

4022

Visit date cannot be in the past.

4023

Visit date is not in the offer period.

4092

A maximum of 25 tickets can be added at a time.

4098

The entity could not be saved.

4101

One or more products not found.

4102

Reservations should occur per offer.

4107

TimeSlotId is mandatory for reserving an offer with PERSLOT capacity.

4108

VisitDate is mandatory for reserving an offer with PERDAY capacity.

4109

Product ID <field_identifier> cannot be reserved as the offer has expired.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/reservations");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json-patch+json");
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v1/reservations")
  .header("content-type", "application/json-patch+json")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]")
  .asString();
Request
var data = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v1/reservations");
xhr.setRequestHeader("content-type", "application/json-patch+json");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]"

headers = {
    'content-type': "application/json-patch+json",
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("POST", "/v1/reservations", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "expirationDate": "2020-10-09T10:53:26.210Z",
      "links": [
         {
            "rel": "string",
            "href": "string"
         }
      ]
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Edit reservation(s)

Query parameter

Name

Type

Required

Description

salespointid

integer

false

The sales point ID on which you want to edit a reservation.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

update

Update a reservation

PUT {url}/v1/reservations/{id}?salespointid={salespointid}

delete

Delete a reservation

DELETE {url}/v1/reservations/{id}?salespointid={salespointid}

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

4006

Timeslot ID is not valid.

4007

Timeslot ID cannot be in the past.

4008

Tickets are not available in the requested quantity.

4011

Product ID <field_identifier> cannot be reserved as the offer period has elapsed.

4013

Reservation ID <field_identifier> has expired.

4022

Visit date cannot be in the past.

4092

A maximum of 25 tickets can be added at a time.

4098

The entity could not be saved.

4102

Reservations should occur per offer.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/reservations");
var request = new RestRequest(Method.PUT);
request.AddHeader("content-type", "application/json-patch+json");
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "[{\"id\":0,\"quantity\":0}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v1/reservations")
  .header("content-type", "application/json-patch+json")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("[{\"id\":0,\"quantity\":0}]")
  .asString();
Request
var data = "[{\"id\":0,\"quantity\":0}]";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.staging-enviso.io/directsellingapi/v1/reservations");
xhr.setRequestHeader("content-type", "application/json-patch+json");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "[{\"id\":0,\"quantity\":0}]"

headers = {
    'content-type': "application/json-patch+json",
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("PUT", "/v1/reservations", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "expirationDate": "2020-10-09T10:57:36.596Z",
      "links": [
         {
            "rel": "string",
            "href": "string"
         }
      ]
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Delete reservation(s)

Query parameter

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to delete the reservation(s).

Response

Success response code: 202 Accepted

Possible errors

Code

Message

1001

<field> is required.

1005

The provided value for <field> is not valid.

4012

Reservations should occur per offer.

4013

One or more reservations not found.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/reservations");
var request = new RestRequest(Method.DELETE);
request.AddHeader("content-type", "application/json-patch+json");
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"reservationIds\":[0]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.delete("https://api.staging-enviso.io/directsellingapi/v1/reservations")
  .header("content-type", "application/json-patch+json")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"reservationIds\":[0]}")
  .asString();
Request
var data = "{\"reservationIds\":[0]}";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://api.staging-enviso.io/directsellingapi/v1/reservations");
xhr.setRequestHeader("content-type", "application/json-patch+json");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"reservationIds\":[0]}"

headers = {
    'content-type': "application/json-patch+json",
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("DELETE", "/v1/reservations", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}{"errors":[{"message":"string","propertyName":"string","code":0}]}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Orders

Create order

URL parameter

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to delete the reservation(s).

Gender parameter values

Parameter

Value

Unknown

0

Male

1

Female

2

Response

Success response code: 201 Created

Link relationship types

Relationship

Description

URL

item

Gets the order detail

GET {url}/v1/orders/{id}?salespointid={salespointid}

confirm

Confirms an order

POST {url}/v1/orders/{id}/confirm?salespointid={salespointid}

cancel

Cancels an order

DELETE {url}/v1/orders/{id}?salespointid={salespointid}

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

1005

The provided value for <field> is not valid.

1006

Please enter a valid email address.

1008

<field> must not exceed <field_max> characters.

4013

Reservation ID <field_identifier> has expired.

4091

Duplicate Reservation ID found.

4092

A maximum of 25 tickets can be added at a time.

4093

A maximum of total 100 tickets can be added at a time in an order.

4014

Reservation <field_identifier> is already confirmed. You can't create order for already confirmed reservation.

4103

One or more reservations not found.

4123

Order should occur per offer.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/orders");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json-patch+json");
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"orderItems\":[{\"reservationId\":0}],\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formId\":\"string\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v1/orders")
  .header("content-type", "application/json-patch+json")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .body("{\"orderItems\":[{\"reservationId\":0}],\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formId\":\"string\"}")
  .asString();
Request
var data = "{\"orderItems\":[{\"reservationId\":0}],\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formId\":\"string\"}";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.staging-enviso.io/directsellingapi/v1/orders");
xhr.setRequestHeader("content-type", "application/json-patch+json");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

payload = "{\"orderItems\":[{\"reservationId\":0}],\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\",\"street\":\"string\",\"number\":\"string\"},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"},\"formId\":\"string\"}"

headers = {
    'content-type': "application/json-patch+json",
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("POST", "/v1/orders", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "number": "string",
   "amount": 0,
   "links": [
      {
         "rel": "string",
         "href": "string"
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get order detail

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order.

Query parameter

Name

Type

Required

Description

salespointid

integer

true

The sales point ID on which you want to get the order detail.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

confirm

Confirms an order

POST {url}/v1/orders/{id}/confirm?salespointid={salespointid}

cancel

Cancels an order

DELETE {url}/v1/orders/{id}?salespointid={salespointid}

Note

The links are only available when the order status is 'PENDING' as changes are no longer supported for cancelled or confirmed orders.

Possible errors

Code

Message

1001

<field> is required.

1003

<field> must be greater than 0.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/orders/0");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/orders/0")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/orders/0");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/orders/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
{
   "order": {
      "id": 0,
      "number": "string",
      "amount": 0,
      "status": 1,
      "orderItems": [
         {
            "id": 0,
            "quantity": 0,
            "amount": 0,
            "visitDate": "2020-10-09T11:18:12.154Z",
            "timeSlotId": 0,
            "product": {
               "id": 0,
               "name": "string",
               "price": 0
            }
         }
      ],
      "visitor": {
         "firstName": "string",
         "lastName": "string",
         "email": "string",
         "address": {
            "country": "string",
            "city": "string",
            "postalcode": "string",
            "street": "string",
            "number": "string"
         },
         "phone": "string",
         "gender": 0,
         "dateOfBirth": "2020-10-09T11:18:12.154Z",
         "reasonForVisit": "string",
         "remarks": "string",
         "emailOfFinanceDivision": "string",
         "schoolName": "string",
         "groupName": "string",
         "ageRange": "string"
      },
      "links": [
         {
            "rel": "string",
            "href": "string"
         }
      ]
   }
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Forms

Get default fields

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

item

Get more detailed information about the offer

GET {url}/v1/salespoints/{salespointid}/offers/{id}

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/forms/default/fields");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/forms/default/fields")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/forms/default/fields");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/forms/default/fields", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
   {
      "name": "string",
      "type": "string",
      "label": "string",
      "infoText": "string",
      "sortOrder": 0,
      "items": [
         {
            "text": "string",
            "value": "string"
         }
      ],
      "validations": [
         {
            "type": "string",
            "error": "string",
            "value": {}
         }
      ]
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Get fields by FormId

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the form.

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

item

Get formid linked with an offer

GET {url}/v1/offers/{offerid}/metadata

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v1/forms/string/fields");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "text/plain");
request.AddHeader("authorization", "string");
request.AddHeader("x-tenantsecretkey", "string");
request.AddHeader("origin", "string");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v1/forms/string/fields")
  .header("accept", "text/plain")
  .header("authorization", "string")
  .header("x-tenantsecretkey", "string")
  .header("origin", "string")
  .header("x-api-key", "API_KEY")
  .asString();
Request
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.staging-enviso.io/directsellingapi/v1/forms/string/fields");
xhr.setRequestHeader("accept", "text/plain");
xhr.setRequestHeader("authorization", "string");
xhr.setRequestHeader("x-tenantsecretkey", "string");
xhr.setRequestHeader("origin", "string");
xhr.setRequestHeader("x-api-key", "API_KEY");

xhr.send(data);
Request
import http.client

conn = http.client.HTTPSConnection("https://api.staging-enviso.io/directsellingapi")

headers = {
    'accept': "text/plain",
    'authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

conn.request("GET", "/v1/forms/string/fields", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response
[
   {
      "name": "string",
      "type": "string",
      "label": "string",
      "infoText": "string",
      "sortOrder": 0,
      "items": [
         {
            "text": "string",
            "value": "string"
         }
      ],
      "validations": [
         {
            "type": "string",
            "error": "string",
            "value": {}
         }
      ]
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}