Direct selling API v4

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 or a membership barcode.

Offer

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

Note

Starting from version 4 of the Direct selling API, two types of offers are available - Ticket offers and Membership offers.

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.

Note

Capacity applies to Ticket offer types only (and not Membership offers).

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 but it can be configured on the offer level. This means when the system automatically expires the reservation, the reserved number of products will be added 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.

Domain 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 4.0, {version} would mean v4

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)

Pagination and how to fetch all pages from List endpoints

For 'List' endpoints, such as List offers, List orders, and more, there may be several pages. Therefore, we recommend fetching pages until an empty page is returned.

Collecting visitor information using the visitor form

Visitor form fields are used by Basket-related endpoints such as Checkout basket, Create basket, Edit basket, and so on. The following table shows the expected value type depending on the visitor form field type.

Form field type

Expected value type

Example

text

string

"firstName": "john"

select

string

"ageRange": "31-45"

radio

string

"hotelBooking": "Yes"

date

date

"dateOfBirth": "1990-01-01"

numeric

number

"groupCount": 1

Note

Supports only numeric characters. The maximum limit is 20 characters.

phone

string

"phone": "+3225555555"

checkbox

string[]

"guidePreference": ["with French language knowledge", "with swimming knowledge"]

Note

The user will be able to select only from the predefined options.

text area

string

"remarks": "Please send a reminder before visit"

citizenship Id

string

"citizenshipId": "00.00.11-001.00"

email

string

"email": "john@gmail.com"

country

string (two-letter country ISO code)

"country": "be"

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 Vintia 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 Vintia 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

Remark: The fromdate and todate filter will only work for Ticket offer types.

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

Remark: The fromdate and todate filter will only work for Ticket offer types.

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.

Default: 0 (= first page)

Note

There may be several pages. Therefore, we recommend fetching pages until an empty page is returned.

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.

Default: 50

language

string

false

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

Default: en

offertype

string

false

Possible inputs:

  • membership

  • ticket

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

Note

The period will only be available for Ticket offer types.

Enum values

Property

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/v4/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/v4/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
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/v4/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", "/v4/salespoints/0/offers", headers=headers)

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

print(data.decode("utf-8"))
Response
json
[
  {
    "id": 0,
    "offerType": "Ticket",
    "ticketOfferType": "Regular",
    "name": "string",
    "description": "string",
    "shortDescription": "string",
    "tags": [
      "string"
    ],
    "period": {
      "start": "2024-03-06T10:44:21.622Z",
      "end": "2024-03-06T10:44:21.622Z"
    }
  }
]
{
	"errors": [
		{
			"message": "string",
			"code": 0
		}
	]
}

Get offer detail

URL parameters

Name

Type

Required

Description

id

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

Possible errors:

Code

Message

1005

The provided value for <field> is not valid.

Parameters

Parameter

Description

offerType

  • Ticket

  • Membership

  • Voucher

barcodeGenerationStrategy

  • PerPerson

  • PerGroup

linkedOfferProducts

Applicable only for voucher offers.

ticketOfferType

1 = Regular

2 = Group

groupSize

The number of visitors per group. Applicable only for group offers.

capacityfrequency

  • Total

  • PerDay

  • PerSlot

startDate: datetime

Eg: 2024-03-05T04:57:28.310Z

startWith

Eg: OnPurchase

capacityfrequency

This will always be 'Total' for vouchers.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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
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/v4/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", "/v4/salespoints/0/offers/0", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
  "offer": {
    "id": 0,
    "offerType": "string", 
    "barcodeGenerationStrategy": "string",
    "name": "string",
    "description": "string",
    "tags": [
      "string"
    ],
    "products": [
      {
        "id": "number",
        "name": "string",
        "description": "string",
        "unitPrice": "decimal",
        "linkedOfferProducts" : [{ 
          "id": "number",
          "quantity": "number"
        }]
      }
    ]
  },
  "ticketOffer": {
    "event": {
      "id": 0
    },
    "startDate": "2024-03-05T04:57:28.310Z",
    "endDate": "2024-03-05T04:57:28.310Z",
    "ticketOfferType": "string", 
    "capacity": {
		"capacityfrequency": "string", 
		"defaultcapacity": "number"
	},
	"visitorformid":"string",		
    "visitDuration": "string",
    "guideLanguages": [
      "string"
    ],
    "groupSize": 0,
  },
  "membershipOffer": {
    "shortDescription": "string",
    "validity": {
      "validityPeriod": {
        "type": "FixedDate",
        "startDate": "datetime",
        "endDate": "datetime",
        "startTime": "string",
        "endTime": "string",
        "daysOfWeek": [
          "number"
        ],
        "startWith": "string",
        "lengthInMonths": "number"
      }
    }
  },
  "voucherOffer": {
    "startDate": "datetime",
    "endDate": "datetime",
    "linkedOfferId": "number",
    "capacity": {
		"defaultcapacity": "number",
		"capacityfrequency": "string" 
	},
    "visitorFormId": "string"
  }
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer timeslots

URL parameters

Name

Type

Required

Description

salespointid

number

true

The sales point ID to retrieve timeslots for.

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

id

number

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

fromdate

date-time

true

The from date to fetch timeslots 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 timeslots 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

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/v4/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/v4/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
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/v4/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", "/v4/salespoints/0/offers/0/timeslots", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
	"timeslots": [{
		"timeslot": {
			"id": "number",
			"start": "date",
			"end": "date"
		}
	}]
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer image

URL parameters

Name

Type

Required

Description

id

integer

true

The unique identifier of the offer.

key

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/v4/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-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v4/offers/0/images/string")
  .header("Accept", "image/png")
  .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/v4/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-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-api-key': "API_KEY"
    }

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

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

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

List 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

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.

showfutureonly

boolean

false

Shows only future capacity.

Eg: showfutureonly=true

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

Note

You can directly use the visit date (without any date conversion) to fetch capacity and reserve ticket quantity for PerDay offers.

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

For Ticket Offer

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

Enum value

Property

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/v4/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/v4/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
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/v4/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", "/v4/salespoints/0/offers/0/capacities", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
	"frequency": "string", // Total/PerDay/PerSlot
	"capacities": [{
		"quantity": "number",
		"date": "date",
		"timeslot": {
			"id": "number",
			"start": "date",
			"end": "date"
		}
	}]
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

List available days

URL parameters

Name

Type

Required

Description

salespointid

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.

id

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 timeslot has the desired capacity when using PERSLOT capacity.

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

showfutureonly

boolean

false

Shows only future capacity. Moreover, an ongoing timeslot, that started in the past will also be shown.

Default value: false

Response

Success response code: 200 OK

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/v4/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/v4/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
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/v4/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", "/v4/salespoints/0/offers/0/availabledays", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
  "availableDays": [
    "2024-04-04T05:04:45.028Z"
  ],
  "capacityPerDay": [
    {
      "day": "2024-04-04T05:04:45.028Z",
      "availability": {
        "available": 0,
        "total": 0
      }
    }
  ]
}
{
	"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/v4/salespoints/0/offers/0/capacity/taken");
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", "{\"quantity\":0}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v4/salespoints/0/offers/0/capacity/taken")
  .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("{\"quantity\":0}")
  .asString();
Request
const data = "{\"quantity\":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/v4/salespoints/0/offers/0/capacity/taken");
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 = "{\"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("POST", "/v4/salespoints/0/offers/0/capacity/taken", payload, headers)

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

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

List prices

Query 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/v4/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/v4/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/v4/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", "/v4/salespoints/0/offers/0/prices", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
	"days": [{
		"date": "date",
		"products": [{
			"id": "number",
			"prices": ["number"]
		}]
	}]
}
{
	"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 timeslot.

Format: yyyy-MM-dd

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/v4/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/v4/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/v4/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", "/v4/salespoints/0/offers/0/priceperday", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
	"timeslots": [{
		"id": "number",
		"from": "time", 
		"to": "time",
		"products": [{
			"id": "number",
			"prices": "number"
		}]
	}]
}
{
	"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/v4/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/v4/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", "https://api.staging-enviso.io/directsellingapi/v4/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("https://api.staging-enviso.io/directsellingapiexample.com")

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

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

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

print(data.decode("utf-8"))
Response
json
{
  "translations": [
    {
      "language": "string",
      "translation": {
        "name": "string",
        "description": "string",
        "shortDescription": "string",
        "tags": [
          "string"
        ],
        "products": [
          {
            "id": number,
            "name": "string",
			"description": "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

Note

There may be several pages. Therefore, we recommend fetching pages until an empty page is returned.

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

Property

Value

type

  • Clone

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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", "/v4/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"
		}
	]
}

Get offer capacity details

URL parameters

Name

Type

Required

Description

salespointid

number

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

number

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

date

date

false

The from date to fetch capacity for.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: 2019-01-01T00:00:00Z

Note

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

timeslotid

date

false

The TimeslotID for which the capacity details are needed.

Response

Success response code: 200 OK

Note

For offers with TOTAL capacity, this will return the total capacity.

For offers with PERDAY capacity, this will return the capacity for a specific date.

For offers with PERSLOT capacity, this will return the capacity for a specific timeslot.

Capacity Type

Capacity type value

Capacity type code

1

Free Selling

2

Allocated

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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
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/v4/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", "/v4/salespoints/0/offers/0/capacity", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
  "frequency": "string",
  "capacity": {
    "quantity": 0,
    "date": "2024-04-04T05:08:06.860Z",
    "timeslot": {
      "id": 0,
      "start": "2024-04-04T05:08:06.860Z",
      "end": "2024-04-04T05:08:06.860Z"
    }
  }
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get offer pass validity

URL parameters

Name

Type

Required

Description

id

number

true

The unique identifier of the offer.

Query parameters

Name

Type

Required

Description

from

date

true

The from date to be used for filtering.

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

The till date to be used for filtering.

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.

Note

The date range (from - till) can not exceed the maximum of 31 days.

Response

Success response code: 200 OK

An example of date in the response is '2024-07-28'.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/offers/0/passvalidity/dates");
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/v4/offers/0/passvalidity/dates")
  .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/v4/offers/0/passvalidity/dates");
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", "/v4/offers/0/passvalidity/dates", headers=headers)

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

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

Events

Get event details

URL 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/v4/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/v4/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/v4/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", "/v4/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": 1, 
	"status": "number" 
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Baskets

Create basket

Query parameter

Name

Type

Required

Description

salespointid

number

true

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

Request body:

[{
    "productId": "number",
    "quantity": "number", 
    "voucher": "string",
    "visitDate": "date",
    "timeslotId": "number"
    "guideLanguage": "string",
    "visitors": [{
            "<key>": "<value>"
    }],
    "formId": string
}]

Parameters

Parameter

Description

quantity

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.

When reserving a group offer with group tickets, this is the number of visitors.

voucher

This property should only be used when exchanging a voucher. It cannot be combined with the productId and quantity properties.

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

For Ticket Offer

For Membership Offer

Exchange voucher

Parameter

TOTAL

PERDAY

PERSLOT

productId

tick.png

tick.png

tick.png

tick.png

cross.png

quantity

tick.png

tick.png

tick.png

tick.png

cross.png

voucher

cross.png

cross.png

cross.png

cross.png

tick.png

visitDate

cross.png

tick.png

cross.png

cross.png

tick.png

timeslotId

cross.png

cross.png

tick.png

cross.png

tick.png

Response

Success response code: 201 Created

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/baskets");
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,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v4/baskets")
  .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,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]")
  .asString();
Request
const data = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]";

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/v4/baskets");
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,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]"

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", "/v4/baskets", payload, headers)

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

print(data.decode("utf-8"))
Response
{
  "id": "GUID"
}
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

voucher

It will be filled only when the ticket reservation is created by exchanging a voucher.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08");
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/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08")
  .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/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08");
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", "/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "expireOn": "2024-03-12T11:10:56.560Z",
  "pricing": {
    "subtotal": 0,
    "discount": 0,
    "total": 0,
    "cost": 0
  },
  "discountCodes": [
    "string"
  ],
  "discountSources": [
    {
      "type": "string",
      "name": "string"
    }
  ],
  "reservations": {
    "ticketReservations": [
      {
        "id": 0,
        "offerId": 0,
        "visitDate": "2024-03-12T11:10:56.560Z",
        "timeSlot": {
          "id": 0,
          "from": "2024-03-12T11:10:56.560Z",
          "to": "2024-03-12T11:10:56.560Z"
        },
        "guideLanguage": "string",
        "groups": [
          {
            "numberOfVisitors": 0
          }
        ],
        "voucher": "string",
        "productReservations": [
          {
            "id": 0,
            "productId": 0,
            "quantity": 0,
            "unitPrice": 0,
            "pricing": {
              "subtotal": 0,
              "discount": 0,
              "total": 0,
              "cost": 0
            }
          }
        ],
        "pricing": {
          "subtotal": 0,
          "discount": 0,
          "total": 0,
          "cost": 0
        }
      }
    ],
    "membershipReservations": [
      {
        "id": 0,
        "offerId": 0,
        "productReservations": [
          {
            "id": 0,
            "productId": 0,
            "unitPrice": 0,
            "membershipHolder": {
              "relationId": 0
            },
            "pricing": {
              "subtotal": 0,
              "discount": 0,
              "total": 0,
              "cost": 0
            }
          }
        ],
        "pricing": {
          "subtotal": 0,
          "discount": 0,
          "total": 0,
          "cost": 0
        }
      }
    ],
    "voucherReservations": [
      {
        "id": 0,
        "offerId": 0,
        "productReservations": [
          {
            "id": 0,
            "productId": 0,
            "quantity": 0,
            "unitPrice": 0,
            "pricing": {
              "subtotal": 0,
              "discount": 0,
              "total": 0,
              "cost": 0
            },
            "linkedProducts": [{
              "id": 0,
              "quantity": 0
            }]
          }
        ],
        "pricing": {
          "subtotal": 0,
          "discount": 0,
          "total": 0,
          "cost": 0
        }
      }
    ]

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

Request body (with dynamic checkout form):

[{
    "productId": "number",
    "quantity": "number", 
    "visitDate": "date",
    "timeslotId": "number"
    "guideLanguage": "string",
    "visitors": [{
            "<key>": "<value>"
    }],
    "formId": string
}]

Request body (without dynamic checkout form):

[{
    "productId": "number",
    "quantity": "number", 
    "visitDate": "date",
    "timeslotId": "number"
    "guideLanguage": "string"
]}
Response

Success response code: 204 No content

Parameter:

Parameter

Description

quantity

When reserving a group offer with group tickets, this is the number of visitors.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/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-api-key", "API_KEY");
request.AddParameter("application/json-patch+json", "{\"quantity\":0,\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0")
  .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("{\"quantity\":0,\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"}]}")
  .asString();
Request
const data = "{\"quantity\":0,\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"string\"}]}";

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/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/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-api-key", "API_KEY");

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

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

payload = "{\"quantity\":0,\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"address\":{},\"phone\":\"string\",\"gender\":0,\"dateOfBirth\":\"2019-08-24T14:15:22Z\",\"reasonForVisit\":\"string\",\"remarks\":\"string\",\"emailOfFinanceDivision\":\"string\",\"schoolName\":\"string\",\"groupName\":\"string\",\"ageRange\":\"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("PUT", "/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0", payload, headers)

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

print(data.decode("utf-8"))
Response
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: 204 No content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0");
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/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/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("DELETE", "https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/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("DELETE", "/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0", headers=headers)

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

print(data.decode("utf-8"))
Response
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.

Request body (with dynamic checkout form):

[{
    "productId": "number",
    "quantity": "number", 
    "voucher": "string",
    "visitDate": "date",
    "timeslotId": "number"
    "guideLanguage": "string",
    "visitors": [{
            "<key>": "<value>"
    }],
    "formId": string
}]

Request body (without dynamic checkout form):

[{
    "productId": "number",
    "quantity": "number",
    "visitDate": "date",
    "timeslotId": "number"
    "guideLanguage": "string"
]}

Parameters:

Parameter

Description

quantity

When reserving a group offer with group tickets, this is the number of visitors.

voucher

This property should only be used when exchanging a voucher. It cannot be combined with the properties productId and quantity properties.

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

For Ticket Offer

For Membership Offer

Exchange Voucher

Parameter

TOTAL

PERDAY

PERSLOT

productId

tick.png

tick.png

tick.png

tick.png

cross.png

quantity

tick.png

tick.png

tick.png

tick.png

cross.png

visitDate

cross.png

tick.png

cross.png

cross.png

tick.png

timeslotId

cross.png

cross.png

tick.png

cross.png

tick.png

formId

tick.png

tick.png

tick.png

cross.png

tick.png

Response

Success response code: 204 No content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/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,\"voucher\":\"string\",\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/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,\"voucher\":\"string\",\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]")
  .asString();
Request
const data = "[{\"productId\":0,\"quantity\":0,\"voucher\":\"string\",\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]";

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/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/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,\"voucher\":\"string\",\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"string\",\"formId\":\"126460ed-49b2-4c69-849a-bd8904ec5d8f\",\"visitors\":[{}]}]"

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", "/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations", payload, headers)

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

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

Add discount code to basket

Note

If the discount has already expired, this operation will fail with an HTTP 410 Gone.

Warning

Please ensure to URL-encode the discount code when using reserved characters such as a forward slash ('/').

Failing to do so might cause errors, as the resulting URL may get interpreted as a different route/code.

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/v4/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/v4/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/v4/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", "/v4/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/v4/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/v4/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/v4/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", "/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/discounts/string", headers=headers)

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

print(data.decode("utf-8"))
Response
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

false

The two-letter language code of the visitor.

Eg: en

Note

In case language is not provided in the query, then the API will consider the language from the response body property $.language.

Request body (without dynamic checkout form):

{
  "visitor": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "address": {
        "country": "string",
        "city": "string",
        "postalCode": "string",
        "street": "string",
        "number": "string"
    },
    "phone": "string",
    "gender": "number", 
    "dateOfBirth": "date"
    "reasonForVisit": "string"
    "remarks": "string"
    "emailOfFinanceDivision": "string"
    "schoolName": "string"
    "groupName": "string"
    "ageRange": "string"
  }
}

Request body (with dynamic checkout form):

{
  "visitor": {
	"<key>": "<value>"
  },
  "formIds": [string]
}

Parameter

Parameter

Value

gender

0 = UNKNOWN (default)

1 = MALE

2 = FEMALE

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout");
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", "{\"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/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout")
  .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("{\"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 = "{\"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/v4/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout");
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 = "{\"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-patch+json",
    'Accept': "text/plain",
    'Authorization': "string",
    'x-tenantsecretkey': "string",
    'origin': "string",
    'x-api-key': "API_KEY"
    }

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

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

print(data.decode("utf-8"))
Response
{
	"id": "number",
	"number": "string",
	"amount": "number"
}
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.

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/v4/orders/0");
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/v4/orders/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("DELETE", "https://api.staging-enviso.io/directsellingapi/v4/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("DELETE", "/v4/orders/0", 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

sendemail

boolean

false

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

Default value: False

Request body:
Response

Success response code: 200 OK

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/v4/orders/0/confirm");
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", "{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0.1},\"reference\":\"string\",\"method\":\"string\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v4/orders/0/confirm")
  .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("{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0.1},\"reference\":\"string\",\"method\":\"string\"}}")
  .asString();
Request
const data = "{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0.1},\"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/v4/orders/0/confirm");
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 = "{\"payment\":{\"amount\":{\"currency\":\"string\",\"value\":0.1},\"reference\":\"string\",\"method\":\"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", "/v4/orders/0/confirm", payload, headers)

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

print(data.decode("utf-8"))
{
	"payment": {
		"amount": {
			"currency": "string",
			"value": "number"
		},
		"reference": "string",
		"method": "string"
	}
}
Response
json
{
	"order": {
		"id": "number",
		"number": "string",
		"amount": "decimal"		
	},
	"sale": {
		"id": "number",
		"creationDate": "date",
		"amount": "decimal",
		"salesPoint": {
			"id": "number",
			"name": "string"
		},
		"lines": [{
			"id": "number",
			"productId": "number",
			"eventId": "number",
			"timeSlotId": "number",
			"unitPrice": "decimal",
			"quantity": "number",
			"amount": "decimal",
			"creationDate": "date",
			"orderLineId": "number",
			"vatRate" : "number",
			"barcodes": [{
				"barcode": "string",
				"creationDate": "date"
			}]
		}]
	}
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get order detail

URL parameter

Name

Type

Required

Description

id

integer

true

The unique identifier of the order.

Response

Success response code: 200 OK

Parameters:

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.

offertype

  • Ticket

  • Membership

  • Voucher

frequencyType

1 = Total

2 = PerDay

3 = PerSlot

ticketType

  • Individual

  • Group

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.

linkedProducts

Only set for voucher offer products.

(productOrderLines) id

orderline ID

visitor

This parameter is optional.

gender

0 = UNKNOWN (default)

1 = MALE

2 = FEMALE

discountSources (type)

Eg:

  • Campaign

  • Promotion

ChannelType

0 = Indirect

1 = Direct

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/v4/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/v4/orders/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/v4/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", "/v4/orders/0", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
    "id": "number",
    "number": "string",
    "status": "number", 
    "hasPendingRebook": "boolean",
    "pricing": {
        "subTotal": decimal,
        "total": decimal,
        "discount": decimal,
        "cost": decimal
    },
    "language": "en",
    "createdOn": date,
    "lastUpdatedOn": date,
	"referenceId": "string",
    "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",
	        "imageUrl": "string",
            "offertype": "string",					
            "frequencyType": "number",       		
            "ticketOfferType": "string",					
			"barcodeGenerationStrategy": "string",
            "eventId": number,
            "startDate": date,
            "endDate": date
        },
        "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",
                "linkedProducts": [{ 
                  "id": number,
                  "quantity": number,
                  "price": number
                }]
            },
            "guideLanguage": "string",
            "pricing": {
                "subTotal": decimal,
                "total": decimal,
                "discount": decimal
            },
          "voucherPassId": "string",
          "voucherUnitPrice": "number"
        }],
        "passes": [{
            "id": "string",
            "isScanned": boolean,
            "createdOn": "date"
        }],
        "voucherPassId": "string",
        "voucherUnitPrice": "number"
    }],
    "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": bool
    },
    "discount": { 
        "codes": [
           "string"
    	],
    	"amount": 0
  	},
    "discountSources": [{
        "type": "string",
        "name": "string"
    }],
    "salesPoint": {
      "id": "number",
      "name": "string",
      "channelType": "number"
    }
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Rebook order

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Request body
Response

Success response code: 200 OK

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'.

(offer) type

  • Regular

  • Group

ticketType

  • Individual

  • Group

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/v4/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/v4/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/v4/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/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-api-key': "API_KEY"
    }

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

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

print(data.decode("utf-8"))
{
	"orderItems": [{
		"offerId": "number",
		"currentTimeSlotId": "number",
		"newTimeSlotId": "number"
	}]
}
Response
json
{
    "id": "number",
    "number": "string",
    "status": "number", 
    "hasPendingRebook": "boolean",
    "pricing": {
        "subTotal": decimal,
        "total": decimal,
        "discount": decimal,
        "cost": decimal
    },
    "language": "en",
    "createdOn": date,
    "lastUpdatedOn": date,
    "referenceId": "string",
    "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",
            "imageUrl": "string",
			"frequencyType": "string",
			"offerType": "string",
			"ticketOfferType": "string",
			"barcodeGenerationStrategy": "string",					
			"eventId": number,
			"startDate": date,
			"endDate": date
        },
        "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
            }
        }],
		"passes": [{
			"id": "string",
			"isScanned": boolean,
			"createdOn": "string"
		}]
    }],
    "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": bool
    },
	"discount: {
		"codes": "string",
		"amount": "decimal"
	},
	"discountSources":  [{
		"type": "string",
		"name": "string"
		}],
	"salesPoint": {
		"id": "number",
		"channelType": "number",
		"name": "string"
	}
}
[{
	"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

Possible error codes

Code

Message

1001

field_name is required.

1011

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

Parameter

Parameter

Description

id

Unique operation ID

type

Rebook

oldTimeslotId

Old timeslot ID

timeslotId

New/rebooked timeslot ID

timestamp

Rebooked date and time

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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/directsellingapi")

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

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

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

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

Initiate payment for order

URL parameter

Name

Type

Required

Description

id

integer

true

The ID of the order.

Request body

Name

Type

Required

Description

paymentType

string

false

The defined type of payment to be created.

It can be either of the two:

  • DropIn

  • PayByLink

Default: DropIn

expiresOn

date

false

The payment expiry date.

If not set, then the default values will be used.

The maximum custom expiry for a payment of type 'PayByLink' is 14 days.

The maximum custom expiry for a payment of type 'DropIn' is 30 minutes.

returnUri

string

false

The URL to return to after the payment concludes.

This is only applicable for payments of type 'DropIn'

Request body
Response
  • When payment for the order is needed

    Success response code: 200 OK

  • When the order is in a state where a payment won't be needed

    Success response code: 204 No Content

    Example: If an order is in a 'Confirmed' state and the order has no payment or its payment is already finalised, then it is NoContent.

    Response body on success:

    No response body

    401 Unauthorized error response

Note

The error response code 422 Unprocessable Entity will be returned if the order has no visitor information associated with it, and thus insufficient information is present to create a payment.

Parameters

Parameter

Description

paymentSession

This is optional.

paymentLink

This is optional.

expiresOn

This is optional and is empty for a free payment.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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", "{\"paymentType\":\"string\",\"expiresOn\":\"2019-08-24T14:15:22Z\",\"returnUri\":\"string\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v4/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("{\"paymentType\":\"string\",\"expiresOn\":\"2019-08-24T14:15:22Z\",\"returnUri\":\"string\"}")
  .asString();
Request
const data = "{\"paymentType\":\"string\",\"expiresOn\":\"2019-08-24T14:15:22Z\",\"returnUri\":\"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/v4/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 = "{\"paymentType\":\"string\",\"expiresOn\":\"2019-08-24T14:15:22Z\",\"returnUri\":\"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", "/v4/orders/0/payment", payload, headers)

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

print(data.decode("utf-8"))
{
  "paymentType": "string",
  "expiresOn": "date",
  "returnUri": "string"
}
Response
json
{
	"reference": "string",
	"paymentSession": "string",
	"paymentLink": "string",
	"expiresOn": "date",
	"amount": "number"
}
{
	"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 the status is 'Generated'.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v4/orders/0/passes/link")
  .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/v4/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-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", "/v4/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"
		}
	]
}

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.

Default: true

Response

Success response code: 200 OK

Link relationship type

Relationship

Description

URL

item

Get more detailed information about the offer

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

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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
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/v4/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", "/v4/forms/default/fields", headers=headers)

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

print(data.decode("utf-8"))
Response
json
[
    {
        "name": "firstName",
        "type": "text",
        "label": "First name",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "First name must not exceed 50 characters",
                "value": 50
            }
        ]
		"perTicket": false
    },
    {
        "name": "lastName",
        "type": "text",
        "label": "Last name",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "Last name must not exceed 50 characters",
                "value": 50
            }
        ],
		"perTicket": false
    },
    {
        "name": "email",
        "type": "email",
        "label": "Email",
		"sortOrder": "0",
        "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",
		"sortOrder": "0",
        "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
    }
]
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Get fields by Form identifier

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the form.

Eg: /offers/07c632c6-7e3b-4eca-b6bf-e8c792b0fc2f/fields

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}/{Version}/offers/{offerid}/metadata

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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
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/v4/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", "/v4/forms/string/fields", headers=headers)

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

print(data.decode("utf-8"))
Response
json
[
    {
        "name": "schoolName",
        "type": "text",
        "label": "School name",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "School name must not exceed 300 characters",
                "value": 300
            }
        ],
		"perTicket": false
    },
    {
        "name": "firstName",
        "type": "text",
        "label": "First name",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "First name must not exceed 50 characters",
                "value": 50
            }
        ],
		"perTicket": false
    },
    {
        "name": "lastName",
        "type": "text",
        "label": "Last name",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "Last name must not exceed 50 characters",
                "value": 50
            }
        ],
		"perTicket": false
    },
    {
        "name": "email",
        "type": "email",
        "label": "Email",
		"sortOrder": "0",
        "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",
		"sortOrder": "0",
        "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",
		"sortOrder": "0",
        "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",
		"sortOrder": "0",
        "validations": [
            {
                "type": "phone",
                "error": "Invalid phone number"
            }
        ],
		"perTicket": true
    },
    {
        "name": "address.number",
        "type": "text",
        "label": "House number",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "House number must not exceed 50 characters",
                "value": 50
            }
        ],
		"perTicket": false
    },
    {
        "name": "address.street",
        "type": "text",
        "label": "Street name",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "Street name must not exceed 300 characters",
                "value": 300
            }
        ],
		"perTicket": false
    },
    {
        "name": "address.city",
        "type": "text",
        "label": "City",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "City name must not exceed 50 character",
                "value": 50
            }
        ],
		"perTicket": false
    },
    {
        "name": "address.postalCode",
        "type": "text",
        "label": "Postal code",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "Postal code must not exceed 20 characters",
                "value": 20
            }
        ]
		"perTicket": false
    },
    {
        "name": "reasonForVisit",
        "type": "textarea",
        "label": "Reason for visit",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "Reason for visit must not exceed 300 characters",
                "value": 300
            }
        ]
		"perTicket": true
    },
    {
        "name": "remarks",
        "type": "textarea",
        "label": "Remarks",
		"sortOrder": "0",
        "validations": [
            {
                "type": "maxlength",
                "error": "Remarks must not exceed 300 characters",
                "value": 300
            }
        ],
		"perTicket": false
    }
]
{
	"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.

Eg: EUR

symbol

Eg:

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/venues/self");
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/v4/venues/self")
  .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/v4/venues/self");
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", "/v4/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": "string", 
            "symbol": "string", 
            "format": "string"
        }
	}
]
{
	"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.

Note

There may be several pages. Therefore, we recommend fetching pages until an empty page is returned.

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.

Default: true

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

Note

The default value is true therefore it does not break any integrations.

However, integrators should set this to false immediately. The 'SaleType' enum property should be handled in the saleDto.

skiprebook

boolean

false

Whether or not to skip rebook sales.

Default: true

Note

The default value is true therefore it does not break any integrations.

However, integrators should set this to false immediately. The 'SaleType' enum property should be handled in the saleDto.

Response

Success response code: 200 OK

Enum values

Property

Value

salesType

0 = Order confirmed

1 = Cancellation

2 = Rebook

salesLineType

0 = Product

1 = Service fee

2 = Voucher discount

salesChannelType

1 = Online

2 = Onsite

3 = Reseller

4 = B2B

channelType

0 = Indirect

1 = Direct

offerType

  • Ticket

  • Membership

  • Voucher

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/v4/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/v4/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/v4/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", "/v4/sales", headers=headers)

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

print(data.decode("utf-8"))
Response
json
[
  {
    "saleType": "number",
    "externalId": "string",
    "orderNumber": "string",
    "payment": {
      "method": "string",
      "reference": "string"
    },
    "discount": {
      "code": "string",
      "codes": [
        "string"
      ],
      "amount": "decimal"
    },
    "salesLines": [
      {
        "discountAmount": "decimal",
        "barcodes": [
          {
            "id": "number",
            "barcode": "string",
            "scanned": "boolean",
            "valid": "boolean",
            "numberOfVisitors": "number",
            "createdOn": "date"
          }
        ],
        "id": "number",
        "productId": "number",
        "productName": "string",
        "eventId": "number",
        "offerId": "number",
        "offerName": "string",
        "timeSlotId": "number",
        "visitDate": "date",
        "unitPrice": "decimal",
        "quantity": "number",
        "amount": "decimal",
        "createdOn": "date",
        "orderLineId": "number",
        "commissionType": "number",
        "commissionRate": "decimal",
        "commissionAmount": "decimal",
        "salesLineType": "number",
        "offerType": "string",
        "vatRate": "decimal"
      }
    ],
    "cost": "decimal",
    "visitorData": "string",
    "id": "number",
    "createdOn": "date",
    "amount": "decimal",
    "salesChannelType": "number",
    "partner": {
      "id": "number",
      "name": "string",
      "profileName": "string",
      "logoImageUrl": "string"
    },
    "salesPoint": {
      "id": "number",
      "name": "string",
      "channelType": "number"
    },
    "orderId": "number",
    "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

Enum values

Property

Value

salesChannelType

1 = Online

2 = Onsite

3 = Reseller

4 = B2B

channelType

0 = Indirect

1 = Direct

offerType

  • Ticket

  • Membership

  • Voucher

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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");
request.AddHeader("x-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.get("https://api.staging-enviso.io/directsellingapi/v4/sales/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/v4/sales/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", "/v4/sales/0", headers=headers)

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

print(data.decode("utf-8"))
Response
json
{
    "saleType": "number",
    "externalId": "string",
    "orderNumber": "string",
    "payment": {
      "method": "string",
      "reference": "string"
    },
    "discount": {
      "code": "string",
      "codes": [
        "string"
      ],
      "amount": "decimal"
    },
    "salesLines": [
      {
        "discountAmount": "decimal",
        "barcodes": [
          {
            "id": "number",
            "barcode": "string",
            "scanned": "boolean",
            "valid": "boolean",
            "numberOfVisitors": "number",
            "createdOn": "date"
          }
        ],
        "id": "number",
        "productId": "number",
        "productName": "string",
        "eventId": "number",
        "offerId": "number",
        "offerName": "string",
        "timeSlotId": "number",
        "visitDate": "date",
        "unitPrice": "decimal",
        "quantity": "number",
        "amount": "decimal",
        "createdOn": "date",
        "orderLineId": "number",
        "commissionType": "number",
        "commissionRate": "decimal",
        "commissionAmount": "decimal",
        "salesLineType": "number",
        "offerType": "string",
        "vatRate": "decimal"
      }
    ],
    "cost": "decimal",
    "visitorData": "string",
    "id": "number",
    "createdOn": "date",
    "amount": "decimal",
    "salesChannelType": "number",
    "partner": {
      "id": "number",
      "name": "string",
      "profileName": "string",
      "logoImageUrl": "string"
    },
    "salesPoint": {
      "id": "number",
      "name": "string",
      "channelType": "number"
    },
    "orderId": "number", 
    "currencyInfo": {
      "currencySymbol": "string",
      "isoCurrencySymbol": "string"
    }
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Visitor

Request headers:

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

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/v4/visitor/relations/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/v4/visitor/relations/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/v4/visitor/relations/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", "/v4/visitor/relations/0/activate", headers=headers)

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

print(data.decode("utf-8"))
Response
{
	"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/v4/visitor/relations/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/v4/visitor/relations/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/v4/visitor/relations/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", "/v4/visitor/relations/0/deactivate", headers=headers)

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

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

Assign membership to either the logged-in visitor or a relation

URL parameters

Name

Type

Required

Description

id

GUID

true

The unique identifier of the basket that contains the membership to be assigned.

Eg: id=6B29FC40-CA47-1067-D41D-00DD020662BA

reservationid

number

true

The unique identifier of the reservation that contains the membership to be assigned.

Eg: reservationid=236

Query parameter

Name

Type

Required

Description

relationid

number

false

The unique identifier of the visitor's relation.

Default: null

Eg: relationid=639

Response

Success response code: 204 No content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0/assignholder");
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/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0/assignholder")
  .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/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0/assignholder");
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", "/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0/assignholder", headers=headers)

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

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

Get memberships

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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", "/v4/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/v4/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/v4/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/v4/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
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Get orders

Query parameters

Name

Type

Required

Description

fromdate & todate

date

false

The from date to fetch orders for.

Format: yyyy-MM-ddTHH:mm:ssZ

fromdate and todate works in combination. If a value for one parameter is provided, a value for the other parameter must be provided too.

Note

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

visitfromdate & visittodate

date

false

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

Format: yyyy-MM-ddTHH:mm:ssZ

visitfromdate and visittodate works in combination. If a value for one parameter is provided, a value for the other parameter must be provided too.

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

Note

There may be several pages. Therefore, we recommend fetching pages until an empty page is returned.

perpage

integer

false

The number of orders to receive per page.

Default value: 50

Eg: perpage=25

searchfieldname

string

false

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

  • ordernumber Searches the full order number.

  • email Searches the full or a part of the email address.

  • visitorname Searches the full or a part of the visitor first and/or last name.

Eg: searchfieldname=ordernumber

searchfieldvalue

string

false

A string that is used to query the actual result within the searchfieldname.

Eg: searchfieldvalue =E63QISYD455XP

orderby

string

false

A string to sort the orders. You can sort by the field lastupdatedon.

After the given sort field, you can specify the direction as either ASC or DESC.

Default: ASC

Eg: orderby=lastupdatedon DESC

status

number

false

The number used to filter visitor orders on status.

1 = Confirmed

2 = Cancelled

3 = Reserved

Note

status does not work in combination with the searchfieldname parameter.

Eg: status=1

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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", "/v4/visitor/orders", headers=headers)

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

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

Get order details

URL parameter

Name

Type

Required

Description

id

long

true

The unique identifier of the order.

Eg: visitor/orders/56/

Response

Success response code: 200 OK

Parameter

Value

barcodeGenerationStrategy

  • PerPerson

  • PerGroup

status

1 = Confirmed

2 = Cancelled

3 = Reserved

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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", "/v4/visitor/orders/0", headers=headers)

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

print(data.decode("utf-8"))
Response
{
  "id": "number",
  "number": "string",
  "createdOn": "date",
  "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",
          "barcodeGenerationStrategy" : "string",    
          "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",
          "isScanned": "boolean"
        }
      ],
      "amount": "number",
      "visitorGroups": [
        {
          "numberOfVisitors": "number"
        }
      ],
      "validFrom": "date",
      "validTill": "date",
      "isRebookable": "boolean",
      "isCancelable": "boolean",
      "voucherPassId": "string",
      "voucherUnitPrice": "number"
    }
  ],
  "payment": {
    "method": "string",
    "otherMethodName": "string",
    "amount": {
      "currency": "string",
      "value": "number"
    },
    "referenceId": "string",
    "isRefundable": "boolean"
  },
  "hasPendingRebook": "boolean",
  "status": "number", 
  "currencyInfo": {
    "currencySymbol": "string",
    "isoCurrencySymbol": "string"
  }
}

json
{
	"errors": [
		{
			"message": "string",
			"trace": "string"
		}
	]
}

Checkout basket

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):

{
  "visitor": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "address": {
        "country": "string",
        "city": "string",
        "postalCode": "string",
        "street": "string",
        "number": "string"
    },
    "phone": "string",
    "gender": "number",
    "dateOfBirth": "date"
    "reasonForVisit": "string"
    "remarks": "string"
    "emailOfFinanceDivision": "string"
    "schoolName": "string"
    "groupName": "string"
    "ageRange": "string"
  }
}

Enum values

Parameter

Value

gender

0 = UNKNOWN (default)

1 = MALE

2 = FEMALE

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/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout");
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\"},\"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/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout")
  .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\"},\"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\"},\"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/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout");
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\"},\"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", "/v4/visitor/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout", 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

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/v4/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/v4/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/v4/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", "/v4/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

Property

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/v4/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/v4/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/v4/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", "/v4/visitor/orders/0/passes/link", headers=headers)

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

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

Rebook order

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Request body
{
  "orderItems": [
    {
      "offerId": 0,
      "currentTimeSlotId": 0,
      "newTimeSlotId": 0
    }
  ]
}
Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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", "/v4/visitor/orders/0/rebook", payload, headers)

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

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

Get relations

Response

Success response code: 200 OK

Enum value

Property

Value

type

  • Other

  • Partner

  • Child

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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", "/v4/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

Request body

Response

Success response code: 200 OK

Enum value

Property

Value

type

  • Other

  • Partner

  • Child

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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", "/v4/visitor/relations", payload, headers)

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

print(data.decode("utf-8"))
{
    "firstName": "string",
    "lastName": "string",
    "type": "string", 
    "birthDate": "date",
    "newPictureData": "string"
}
Response
{
    "id": 0,
    "customerId": 0,
    "type": "Other",
    "firstName": "string",
    "lastName": "string",
    "active": true,
    "birthDate": "2024-04-03T08:19:06.261Z",
    "pictureKey": "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

Request body

Response

Success response code: 204 No Content

Enum value

Property

Value

type

  • Other

  • Partner

  • Child

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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"))
{
	"firstName": "string",
	"lastName": "string",
	"type": "string",
	"birthDate": "date",
	"newPictureData": "string",
	"removePicture": "boolean"
}
Response
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/v4/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/v4/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/v4/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

Request body

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/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/v4/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/v4/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"))
{
  "firstName": "string",
  "lastName": "string",
  "email": "string",
  "language": "string",
  "country": "string",
  "newPictureData": "string",
  "removePicture": true
}
Response
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Initiate rebook

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Request body
{
  "orderItems": [
    {
      "offerId": 0,
      "currentTimeSlotId": 0,
      "newTimeSlotId": 0,
      "currentVisitDate": "2019-08-24T14:15:22Z",
      "newVisitDate": "2019-08-24T14:15:22Z",
      "passIds": [],
      "groupVisitorQuantityPerPassId": []
    }
  ]
}
Request body properties

Property

Type

Required

Description

PassIds

string array

false

PassIds are the same as the barcodes present in sales data (returned on order confirmation)

Eg: EOPF2D3438D8XD8S, EOUI2IL035M9QKZ6, EOZX2KW6379220EI

  • If provided, rebooks only the specified tickets of the given offer.

  • If omitted, rebooks all the tickets of the given offer for the specified timeslot.

CurrentTimeSlotId

number

false

The timeslot where the passes are currently ordered on.

Note

This property is required if the offer capacity type is PerSlot, otherwise it should be omitted.

NewTimeSlotId

number

false

The timeslot where the passes should be moved to.

Note

This property is required if the offer capacity type is PerSlot, otherwise it should be omitted.

CurrentVisitDate

number

false

The date where the passes are currently ordered on.

Note

This property is required if the offer capacity type is PerDay, otherwise it should be omitted.

NewVisitDate

number

false

The date where the passes should be moved to.

Note

This property is required if the offer capacity type is PerDay, otherwise it should be omitted.

Response

Success response code: 200 OK

Response parameters

Parameter

Description

offerId

This is an optional parameter.

currentTimeSlotId

This is an optional parameter.

newTimeSlotId

This is an optional parameter.

currentVisitDate

This is an optional parameter.

newVisitDate

This is an optional parameter.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/0/rebook/initiate");
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", "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0,\"currentVisitDate\":\"2019-08-24T14:15:22Z\",\"newVisitDate\":\"2019-08-24T14:15:22Z\",\"passIds\":[],\"groupVisitorQuantityPerPassId\":[]}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/0/rebook/initiate")
  .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,\"currentVisitDate\":\"2019-08-24T14:15:22Z\",\"newVisitDate\":\"2019-08-24T14:15:22Z\",\"passIds\":[],\"groupVisitorQuantityPerPassId\":[]}]}")
  .asString();
Request
const data = "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0,\"currentVisitDate\":\"2019-08-24T14:15:22Z\",\"newVisitDate\":\"2019-08-24T14:15:22Z\",\"passIds\":[],\"groupVisitorQuantityPerPassId\":[]}]}";

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/v4/visitor/orders/0/rebook/initiate");
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,\"currentVisitDate\":\"2019-08-24T14:15:22Z\",\"newVisitDate\":\"2019-08-24T14:15:22Z\",\"passIds\":[],\"groupVisitorQuantityPerPassId\":[]}]}"

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", "/v4/visitor/orders/0/rebook/initiate", payload, headers)

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

print(data.decode("utf-8"))
Response
json
{
	"paymentAmount": "decimal",
	"expiresOn": "date"
}
{
	"errors": [{
        "message": "string",
        "code": "number",
        "offerId": "number",	
        "currentTimeSlotId": "number",	
        "newTimeSlotId": "number"	
        "currentVisitDate": "date",	
        "newVisitDate": "date",	
	}]
}

Confirm rebook

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/0/rebook/confirm");
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", "{\"payment\":{\"amount\":0.1,\"currency\":\"string\",\"reference\":\"string\",\"method\":\"string\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/0/rebook/confirm")
  .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("{\"payment\":{\"amount\":0.1,\"currency\":\"string\",\"reference\":\"string\",\"method\":\"string\"}}")
  .asString();
Request
const data = "{\"payment\":{\"amount\":0.1,\"currency\":\"string\",\"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/v4/visitor/orders/0/rebook/confirm");
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 = "{\"payment\":{\"amount\":0.1,\"currency\":\"string\",\"reference\":\"string\",\"method\":\"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", "/v4/visitor/orders/0/rebook/confirm", payload, headers)

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

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

Cancel rebook

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/0/rebook/cancel");
var request = new RestRequest(Method.POST);
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.post("https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/0/rebook/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("POST", "https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/0/rebook/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("POST", "/v4/visitor/orders/0/rebook/cancel", headers=headers)

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

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

Get order passes

Query parameters

Name

Type

Required

Description

scanned

bool

false

Possible values are:

  • true - In this case the API will return passes that have been scanned.

  • false - In this case the API will return passes that have not been scanned.

Eg: scanned=true

page

number

false

The page of the passes you want to receive.

Default: 0

Eg: page=2

Note

There may be several pages. Therefore, we recommend fetching pages until an empty page is returned.

fromdate

date

true

Filter offer from date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2023-09-01T00:00:00Z

todate

date

true

Filter offer end date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2023-09-31T23:59:59Z

Note

The date range can be a maximum of 13 months.

perpage

number

false

The number of passes you want to receive per page.

Default: 50

Eg: perpage=10

passtype

string

false

The type of passes you want to receive.

Possible values are:

  • Ticket

  • Membership

Eg: passtype=ticket

language

string

false

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

Default: en

Eg: language=en

Response

Success response code: 200 OK

Response parameters

Parameter

Description

isCancelled

If the pass is cancelled, returns true else false.

validity

Shows pass validity.

dateOfFirstVisit

If a pass is scanned, then the scanned date of the pass will return, else null.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/visitor/orders/passes");
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/v4/visitor/orders/passes")
  .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/v4/visitor/orders/passes");
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", "/v4/visitor/orders/passes", headers=headers)

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

print(data.decode("utf-8"))
Response
{
	"passId": "string",
	"offerName": "string",
	"productName": "string",
	"isCancelled": "boolean",
	"passType": "string",
	"validity": {
		"validFrom": "DateTime",
		"validTo": "DateTime"
	},
	"offerId": "number",
	"productId": "number",
	"dateOfFirstVisit": "datetime",
        "orderid": "number",
	"orderNumber": "string"
}
{
	"errors": [
		{
			"message": "string",
			"code": "number"
		}
	]
}

Passes

Get voucher pass validation

URL parameter

Name

Type

Required

Description

passId

string

true

The unique identifier of the pass you want to validate.

Eg: EOP02DL948D8SZIB

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/passes/vouchers/string/validate");
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/v4/passes/vouchers/string/validate")
  .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/v4/passes/vouchers/string/validate");
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", "/v4/passes/vouchers/string/validate", headers=headers)

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

print(data.decode("utf-8"))
Response
{
  "voucher": "string",
  "voucherOfferId": "number",
  "linkedTicketOffer": "number",
  "linkedProducts": [{
    "id": "number",
    "quantity": "number",
    "price": "number"
  },{
    "id": "number",
    "quantity": "number",
    "price": "number"
  }]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Get voucher pass availability

URL parameter

Name

Type

Required

Description

passId

string

true

The unique identifier of the pass you want to validate.

Eg: EOP02DL948D8SZIB/availabledays

Query parameters

Name

Type

Required

Description

from

date

true

The from date to be used for filtering.

Format: yyyy-MM-dd

Note

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

till

date

true

The till date to be used for filtering.

Format: yyyy-MM-dd

Note

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

Note

The date range (from - till) can not exceed the maximum of 31 days.

Response

Success response code: 200 OK

An example of date in the response is '2024-07-28'.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v4/passes/vouchers/string/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/v4/passes/vouchers/string/availabledays")
  .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/v4/passes/vouchers/string/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", "/v4/passes/vouchers/string/availabledays", headers=headers)

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

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

Changelog

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

Direct selling v4

Sept 2024

Aug 2024

July 2024

  • Added a new endpoint Get voucher pass validation to check if the voucher pass is still valid.

  • The endpoint, Create basket now supports vouchers, products, and quantity.

  • The response of the endpoint Get basket now contains voucher property and pricing changes on ticket reservation.

  • Updated the request body of Add reservation(s) to basket to support vouchers, products, and quantity.

  • For the endpoint Get order detail, added voucherPassId and voucherUnitPrice on order detail, for regular offers and group offers.

May 2024

  • Added a new endpoint 'Assign membership to either the logged-in visitor or a relation' that allows assigning the membership available in the basket to either the currently logged-in visitor or a relation of the visitor.

  • Removed the endpoints - 'Assign logged-in visitor' and 'Assign relation'.

  • Route changed for the endpoint Checkout Basket (As Visitor) from /baskets/{id}/checkoutasvisitor to /visitor/baskets/{id}/checkout.

  • Route changed for the endpoint Deactivate relation from /visitor/{id}/deactivate to /visitor/relations/{id}/deactivate.

  • Route changed for the endpoint Activate relation from /visitor/{id}/activate to /visitor/relations/{id}/activate.

April 2024

  • Support Membership in offer and basket API.

  • Added new endpoint Assign Customer to Basket Membership Products to support membership.Assign customer to basket membership products

  • Removed the endpoint 'Get Offer Metadata' endpoint. It will be a part of the endpoint Offer details.

  • It is possible to configure the basket expiry time. Refer to the endpoint Create basket.

  • Moved the endpoint 'Checkout basket as visitors' from Orders to Visitor.

  • Removed Links from the response in all the List endpoints.

  • Removed 'x-page-count' and 'link' from the header response.

  • Removed salespointid from the request query parameter for the endpoints Cancel order, Confirm order and Rebook order.

Direct selling API 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 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 Vintia 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 Vintia 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.

Parameters

Parameter

Description

type

  • 1 = Regular

  • 2 = Group

groupSize

The number of visitors per group. Applicable only for group offers.

frequency

  • Total

  • PerDay

  • PerSlot

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",
					"description": "string"
				},
				"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",
						"description": "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.

Response

Success response code: 200 OK

Link relationship types

Relationship

Description

URL

confirm

Confirms an order

POST {url}/v3/orders/{id}/confirm

cancel

Cancels an order

DELETE {url}/v3/orders/{id}

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

discountSources (type)

  • Campaign

  • Promotion

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",
			"frequencyType": "string",
			"ticketType": "string",				
			"eventId": number,
			"startDate": date,
			"endDate": date
        },
        "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,
            },
            "passes": [{
                "id": "string",
                "isScanned": boolean,
                "createdOn": "date",
            }]
        }],
        "passes": [{
            "id": "string",
            "isScanned": boolean,
            "createdOn": "date",
        }]
    }],
    "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": bool,
    },
"discountSources": [
	{
		"type": "string", 
		"name": "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",
			"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 payment for order

URL parameter

Name

Type

Required

Description

id

integer

true

The ID of the order.

Request body

Name

Type

Required

Description

paymentType

string

false

The defined type of payment to be created.

It can be either of the two:

  • DropIn

  • PayByLink

Default: DropIn

expiresOn

date

false

The payment expiry date.

If not set, then the default values will be used.

The maximum custom expiry for a payment of type 'PayByLink' is 14 days.

The maximum custom expiry for a payment of type 'DropIn' is 30 minutes.

returnUri

string

false

The URL to return to after the payment concludes.

This is only applicable for payments of type 'DropIn'

Response
  • When payment for the order is needed

    Success response code: 200 OK

  • When the order is in a state where a payment won't be needed

    Success response code: 204 No Content

    Example: If an order is in a 'Confirmed' state and the order has no payment or its payment is already finalised, then it is NoContent.

    Response body on success:

    No response body

    401 Unauthorized error response

Note

The error response code 422 Unprocessable Entity will be returned if the order has no visitor information associated with it, and thus insufficient information is present to create a payment.

Parameters

Parameter

Description

paymentSession

This is optional.

paymentLink

This is optional.

expiresOn

This is optional and is empty for a free payment.

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",
	"paymentLink": "string",
	"expiresOn": "date",
	"amount": "number"
}
{
	"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 the 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

skiprebook

boolean

false

Whether or not to skip rebook sales.

Default: skiprebook=true

Note

The default value is true therefore it does not break any integrations.

However, integrators should set this to false immediately. The 'SaleType' enum property should be handled in the saleDto.

Response

Success response code: 200 OK

Enums

SalesType

Value

OrderConfirmed

0

Cancellation

1

Rebook

2

SalesLineType

Value

Product

0

ServiceFee

1

Response header

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

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
[
	{
		"saleType": "number",
		"externalId": "string",
		"orderNumber": "string",
		"payment": {
			"method": "string",
			"reference": "string"
		},
		"discount": {
			"code": "string",
			"codes": [
				"string"
			],
			"amount": "decimal"
		},
		"salesLines": [
			{
				"discountAmount": "decimal",
				"barcodes": [
					{
						"id": "number",
						"barcode": "string",
						"scanned": "boolean",
						"valid": "boolean",
						"numberOfVisitors": "number",
						"createdOn": "date"
					}
				],
				"id": "number",
				"productId": "number",
				"productName": "string",
				"eventId": "number",
				"offerId": "number",
				"offerName": "string",
				"timeSlotId": "number",
				"unitPrice": "decimal",
				"quantity": "number",
				"amount": "decimal",
				"createdOn": "date",
				"orderLineId": "number",
				"commissionType": "number",
				"commissionRate": "decimal",
				"commissionAmount": "decimal",
				"salesLineType": "number",
				"offerType": "string"
			}
		],
		"cost": "decimal",
		"visitorData": "string",
		"id": "number",
		"createdOn": "date",
		"amount": "decimal",
		"salesChannelType": "number",
		"partner": {
			"id": "number",
			"name": "string",
			"profileName": "string",
			"logoImageUrl": "string"
		},
		"salesPoint": {
			"id": "number",
			"name": "string",
			"channelType": "number"
		},
		"orderId": "number",
		"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
{
	"saleType": "number",
	"externalId": "string",
	"orderNumber": "string",
	"payment": {
		"method": "string",
		"reference": "string"
	},
	"discount": {
		"code": "string",
		"codes": [
			"string"
		],
		"amount": "decimal"
	},
	"salesLines": [
		{
			"discountAmount": "decimal",
			"barcodes": [
				{
					"id": "number",
					"barcode": "string",
					"scanned": "boolean",
					"valid": "boolean",
					"numberOfVisitors": "number",
					"createdOn": "date"
				}
			],
			"id": "number",
			"productId": "number",
			"productName": "string",
			"eventId": "number",
			"offerId": "number",
			"offerName": "string",
			"timeSlotId": "number",
			"unitPrice": "decimal",
			"quantity": "number",
			"amount": "decimal",
			"createdOn": "date",
			"orderLineId": "number",
			"commissionType": "number",
			"commissionRate": "decimal",
			"commissionAmount": "decimal",
			"salesLineType": "number",
			"offerType": "string"
		}
	],
	"cost": "decimal",
	"visitorData": "string",
	"id": "number",
	"createdOn": "date",
	"amount": "decimal",
	"salesChannelType": "number",
	"partner": {
		"id": "number",
		"name": "string",
		"profileName": "string",
		"logoImageUrl": "string"
	},
	"salesPoint": {
		"id": "number",
		"name": "string",
		"channelType": "number"
	},
	"orderId": "number",
	"links": [
		{
			"href": "string",
			"rel": "string",
			"method": "string"
		}
	],
	"currencyInfo": {
		"currencySymbol": "string",
		"isoCurrencySymbol": "string"
	}
}
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 & todate

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 & visittodate

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

searchfieldname

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.

Eg: orderby=createdon DESC

searchfieldvalue

string

(int,int,int)

false

A string that is used to query the actual result within the searchfieldname.

  • 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",
		"id": "number",
		"number": "string",
		"amount": "number",
		"createdOn": "date",
		"currencyInfo": {
			"currencySymbol": "string",
			"isoCurrencySymbol": "string"
		},
		"salesPointId": "number",
		"isRefundable": "boolean",
		"hasPendingRebook": "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/

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",
	"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"
		}
	],
	"payment": {
		"method": "string",
		"otherMethodName": "string",
		"amount": {
			"currency": "string",
			"value": "number"
		},
		"referenceId": "string",
		"isRefundable": "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"
		}
	]
}

Initiate rebook

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Request body Property

Property

Type

Required

Description

PassIds

string array

false

PassIds are the same as the barcodes present in sales data (returned on order confirmation)

Eg: EOPF2D3438D8XD8S, EOUI2IL035M9QKZ6, EOZX2KW6379220EI

  • If present, will rebook only the specified tickets of the given offer.

  • If omitted, will rebook all the tickets of the given offer for the specified time slot.

Response

Success response code: 200 OK

Response parameters

Parameter

Description

offerId

This is an optional parameter.

currentTimeSlotId

This is an optional parameter.

newTimeSlotId

This is an optional parameter.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook/initiate");
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", "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0,\"passIds\":[]}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook/initiate")
  .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,\"passIds\":[]}]}")
  .asString();
Request
const data = "{\"orderItems\":[{\"offerId\":0,\"currentTimeSlotId\":0,\"newTimeSlotId\":0,\"passIds\":[]}]}";

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/orders/0/rebook/initiate");
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,\"passIds\":[]}]}"

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/orders/0/rebook/initiate", payload, headers)

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

print(data.decode("utf-8"))
Response
{
	"paymentAmount": "decimal",
	"expiresOn": "date"
}
json
{
	"errors": [
		{
			"message": "string",
			"code": "number",
			"offerId": "number",
			"currentTimeSlotId": "number",
			"newTimeSlotId": "number"
		}
	]
}

Confirm rebook

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook/confirm");
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", "{\"payment\":{\"amount\":0,\"currency\":\"string\",\"reference\":\"string\",\"method\":\"string\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook/confirm")
  .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("{\"payment\":{\"amount\":0,\"currency\":\"string\",\"reference\":\"string\",\"method\":\"string\"}}")
  .asString();
Request
const data = "{\"payment\":{\"amount\":0,\"currency\":\"string\",\"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/visitor/orders/0/rebook/confirm");
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 = "{\"payment\":{\"amount\":0,\"currency\":\"string\",\"reference\":\"string\",\"method\":\"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/orders/0/rebook/confirm", payload, headers)

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

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

Cancel rebook

URL parameter

Name

Type

Required

Description

id

number

true

The unique identifier of the order.

Response

Success response code: 204 No Content

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook/cancel");
var request = new RestRequest(Method.POST);
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.post("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook/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("POST", "https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/0/rebook/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("POST", "/v3/visitor/orders/0/rebook/cancel", headers=headers)

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

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

Get order passes

Query parameters

Name

Type

Required

Description

scanned

bool

false

Possible values are:

  • true - In this case the API will return passes that have been scanned.

  • false - In this case the API will return passes that have not been scanned.

Eg: scanned=true

page

number

false

The page of the passes you want to receive.

Default: 0

Eg: page=2

Note

There may be several pages. Therefore, we recommend fetching pages until an empty page is returned.

fromdate

date

true

Filter offer from date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: fromdate=2023-09-01T00:00:00Z

todate

date

true

Filter offer end date.

Format: yyyy-MM-ddTHH:mm:ssZ

Eg: todate=2023-09-31T23:59:59Z

Note

The date range can be a maximum of 13 months.

perpage

number

false

The number of passes you want to receive per page.

Default: 50

Eg: perpage=10

passtype

string

false

The type of passes you want to receive.

Possible values are:

  • Ticket

  • Membership

Eg: passtype=ticket

language

string

false

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

Default: en

Eg: language=en

Response

Success response code: 200 OK

Response parameters

Parameter

Description

isCancelled

If the pass is cancelled, returns true else false.

validity

Shows pass validity.

dateOfFirstVisit

If a pass is scanned, then the scanned date of the pass will return, else null.

Request
var client = new RestClient("https://api.staging-enviso.io/directsellingapi/v3/visitor/orders/passes");
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/passes")
  .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/passes");
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/passes", headers=headers)

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

print(data.decode("utf-8"))
Response
{
	"passId": "string",
	"offerName": "string",
	"productName": "string",
	"isCancelled": "boolean",
	"passType": "string",
	"validity": {
		"validFrom": "DateTime",
		"validTo": "DateTime"
	},
	"offerId": "number",
	"productId": "number",
	"dateOfFirstVisit": "datetime",
        "orderid": "number",
	"orderNumber": "string"
}
{
	"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 Vintia 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 Vintia 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 Vintia 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 Vintia 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
json
{
  "frequency": "string",
  "capacities": [
    {
      "quantity": 0
    }
  ]
}
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}/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
      }
   ]
}
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.

Response

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