Reselling API v2

The Reselling API establishes a connection with the Enviso Trade backend, which facilitates the following activities on your selling interface:

  • Make partner venue data available

  • Make offer data available

  • Check offer availability

  • Place order

  • Retrieve order details

  • Cancel order

ResAPI001.png

Terminologies

Here's a short description of what certain terminologies imply when using the Reselling API.

Venue

A venue is an organisational unit that registers on the Enviso Trade application to enable partners for reselling their tickets.

Partner venue

A venue with whom partnership has been established from the Enviso Trade application.

Reseller

A company or an individual who is in partnership with the venue for reselling their tickets.

Partnership

An arrangement where a venue and a reseller partner up on the Enviso Trade application.

Product

Ticket is referred to as a product in the context of the Reselling API. Example: Adult safari ticket is referred to as a product.

Note

The result of a product sale is a ticket barcode.

Offer

Product(s) form an offer.

Note

It is possible that an offer contains one or multiple products.

Example: An offer could consist of an Adult safari ticket. While another offer could consist of two products, an Adult safari ticket and a 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.

Reserved product

A product that is added to the cart but the order is not yet placed.

It is possible to define (in minutes) for how long a product in the cart is reserved until it is confirmed. By default, the reserved time is 30 minutes. This means, if a product in the cart is not confirmed within 30 minutes, it will automatically be returned back to the pool of available products.

Order item

Product in an order.

Pre-bill report

A pre-bill report is an estimated invoice of the tickets sold by the reseller. A pre-bill report is automatically generated to the venue on the 2nd of every month.

Individual visit

The visit of individual visitors and their friends or family is referred to as an individual visit. Order for an individual visit can be confirmed without requiring a prior reservation.

Organisation visit

In the case of an organisation visit, for example, a school visit, changes are likely in the number of visitors until the actual visit. Therefore, such orders are generally booked in advance with a tentative number of visitors. Later, the order is confirmed with the updated number of visitors. Such an order is referred to as an organisation visit.

Conditions to confirm an order for an organisation visit:

  • For an order with time slots, the order should be confirmed at least 24 hours prior to the visit.

    Failing which, the order will be cancelled automatically, and the ticket quantity will be returned to the pool of available tickets.

  • For an order without time slots, the order should be confirmed a day prior to the day of visit.

    Failing which, the order will be cancelled automatically, and the ticket quantity will be returned to the pool of available tickets.

  • If an order is placed a day before the date of visit, such an order should be confirmed on the same day.

    Failing which, the order will have to be cancelled manually.

Note

For a reserved order, it is possible to change only the ticket quantity. Other order details such as visit date and time slot, cannot be changed for a reserved order.

Order process

TF_clip0002.png

The flow of placing a new order is:

  1. View venue details and offers of partners

    After successful integration, the Reselling API displays partner venues details and offers on your selling interface. It is possible to filter venues using search term, venue type and city.

  2. Select from venue offers.

    Offers added to the cart are reserved for a certain duration until the order is placed. See further Reserved product in terminologies.

    It is possible to filter offers using the search term.

  3. Place order

    The visitor places order on your online selling interface. Additional visitor information may be required for placing an order.

    Note

    A pre-requisite for placing an order is that all the offers added to the cart must be of the same currency.

    It is possible to filter orders by date range.

  4. Receive ticket barcode

    After placing the order the Reselling API generates ticket barcode(s) which can be shared with the visitor through your selling interface.

Data model

TF_clip0003.png

Principles

The Reselling 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:

  • The API Key is required to be passed in HTTP Request Headers (x-api-key)

  • The request and response data is sent as JSON (HTTP Content-Type header = application/json)

  • 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/response are in the UTC-00:00 format. This means that the date and time in offer details, offer time slots, etc. are shown as per the UTC 00:00 date and time.

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

Developers agreement

By using the Reselling API, you agree to our terms of service.

Response status codes

The following HTTP status codes are used within the Reselling 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.

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.

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

500

Internal Server Error

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

502

Bad Gateway

The server was unable to process the request for the moment.

-1

Unknown

The request could not be completed due to unknown reasons.

Offer and order status codes

Offer status codes

Code

Description

1

Available

The offer is available for sale.

4

Expired

The offer period has expired.

Order status codes

Code

Description

1

Confirmed

The order is confirmed.

2

Cancelled

The order is cancelled.

3

Reserved

The order is reserved for organisation visit.

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 Reselling 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 Reselling API.

    Note

    Contact Vintia support to get your production environment keys of the Authentication API and Reselling API.

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

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

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

Note

Contact Vintia support to get your production environment keys. Once you contact Vintia support to go live on the production environment, the production environment API link and the Tenant key will show in your Trade for Resellers account (Settings > Connection).

Venues

Search venues

Query parameters

Name

Type

Required

Description

type

integer

false

Filter venues by type.

Possible values:

0 = Amusement park

1 = Attraction

2 = Aquarium

3 = Museum

4 = Zoo

5 = Others

city

string

false

Filter venues by city name.

page

integer

false

The start page number for the range to show in the response. If omitted, all venues will be displayed on a single page.

Note

The parameters page and perpage are optional. However, if the value for one of the parameters is provided, it is mandatory to provide a value for the other parameter as well.

perpage

integer

false

Number of results per page. If omitted, all the results will be displayed on a single page.

Note

The parameters page and perpage are optional. However, if the value for one of the parameters is provided, it is mandatory to provide a value for the other parameter as well.

searchterm

string

false

Filter results by venue name using the provided search term.

orderby

string

false

Sorting order of the results by venue name or venue ID.

Possible values:

Name Desc

Name Asc

Id Desc

Id Asc

Note

The parameters page and perpage are optional. However, if a value for one of the parameters is provided, it is also mandatory to provide a value for the other parameter.

Link relationship types

Relationship

Description

self

Get information about the call itself. Use the self link returned by API request to get more information about the venue.

Format: GET {url}/{version}/venues/{VenueId}

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get the result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Responses

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

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

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

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

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "name": "string",
      "city": "string",
      "type": 0,
      "logoImageUrl": "string",
      "links": [
         {
            "href": "string", //// Sample href : /{version}/venues/1
            "rel": "string", //// description/information about href link (i.e. self (get details))
            "method": "string"
         }
      ]
   },  
   {            
        "id": "integer",            
        "name": "string",            
        "city": "string",            
        "type": "integer",            
        "logoImageUrl":"string",                       
        "links":            
    [                     
        {                           
            "href": "string",   //// Sample href : /{version}/venues/1                    
            "rel": "string"     //// description/information about href link (i.e. self (get details))               
            "method": "string"                
        }
    ]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch venue information

URL parameter

Name

Type

Required

Description

id

integer

true

The venue ID to retrieve information for.

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

8001

400

The requested profile does not exist.

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

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

conn.request("GET", "/v2/venues/0", headers=headers)

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

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "name": "string",
   "description": "string",
   "type": 0,
       "barcodeFormat": "string", // e.g. 'QRCode|Code128'. This means that the venue supports both the types of barcode format.
       "logoImageUrl": "string",
       "coverImageUrl": "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",
       "contact": "string"
}
json
{
   "errors": [
      {
         "message": "string",
         "code": 0
      }
   ]
}

Fetch venue offers

URL parameter

Name

Type

Required

Description

id

integer

true

The venue ID to retrieve offers for.

Query parameters

Name

Type

Required

Description

page

integer

false

The start page number for the range to show in the response. If omitted, all the results will be displayed on a single page.

Note

The parameters page and perpage are optional. However, if the value for one of the parameters is provided, it is mandatory to provide a value for the other parameter as well.

perpage

integer

false

Number of results per page. If omitted, all the results will be displayed on a single page.

Note

The parameters page and perpage are optional. However, if the value for one of the parameters is provided, it is mandatory to provide a value for the other parameter as well.

searchterm

string

false

Filter results by offer name using the provided search term.

orderby

string

false

Sorting order of the results by offer name or offer ID.

Possible values:

Name Desc

Name Asc

StartDate Desc

StartDate Asc

Default: Name Asc

Link relationship types

Relationship

Description

self

Get information about the call itself.

Use the self link returned by API request to get more information about the offer.

Format:GET {url}/v2/offers/{OfferId}

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

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

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

conn.request("GET", "/v2/venues/0/offers", headers=headers)

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

print(data.decode("utf-8"))
Response
[
  {
    "id": 0,
    "name": "string",
    "description": "string",
    "offerType": "string",
    "type": 1,
    "ticketType": 1,
    "startDate": "2019-08-24T14:15:22Z",
    "endDate": "2019-08-24T14:15:22Z",
    "salesStartDate": "2019-08-24T14:15:22Z",
    "salesEndDate": "2019-08-24T14:15:22Z",
    "imageUrl": "string",
    "status": 0,
    "venue": {
      "id": 0,
      "name": "string",
      "logoImageUrl": "string",
      "addressLine1": "string",
      "addressLine2": "string",
      "locality": "string",
      "postalCode": "string",
      "country": "string",
      "locale": {}
    },
    "links": [
      {}
    ]
  }
]
json
{
    "errors":[
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Fetch venue logo image

Response

Success response code: 200 OK

It will return the logo image of the partner venue.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/venues/0/logoimages/exampleimage.jpg");
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/resellingapi/v2/venues/0/logoimages/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/resellingapi/v2/venues/0/logoimages/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/resellingapi")

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

conn.request("GET", "/v2/venues/0/logoimages/string", headers=headers)

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

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

Fetch venue cover image

Responses

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/venues/0/coverimages/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/resellingapi/v2/venues/0/coverimages/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("GET", "https://api.staging-enviso.io/resellingapi/v2/venues/0/coverimages/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/resellingapi")

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

conn.request("GET", "/v2/venues/0/coverimages/string", headers=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
    }
  ]
}

Offers

Search offers

Query parameters

Name

Type

Required

Description

fromdate

date

false

Filter offer from date.

Note

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

todate

date

false

Filter offer end date.

Note

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

page

integer

false

Start the page number for the range to show in the response.

If omitted, all the results will be displayed on a single page.

Note

The parameters page and perpage are optional. However, if the value for one of the parameters is provided, it is mandatory to provide a value for the other parameter as well.

perpage

integer

false

Number of results per page.

If omitted, all the results will be displayed on a single page.

Note

The parameters page and perpage are optional. However, if the value for one of the parameters is provided, it is mandatory to provide a value for the other parameter as well.

searchterm

string

false

Filter results by offer name using the provided search term.

orderby

string

false

Sorting order of the results by offer name or offer ID.

Possible values:

  • Name Desc

  • Name Asc

  • StartDate Desc

  • StartDate Asc

status

integer

false

Filter on offer status.

1 = Available

4 = Expired

language

string

false

Two-letter ISO language code for fetching translations.

Eg: language=nl

  • The parameter language fetches translations for offer name, offer description and ticket name.

  • As a pre-requisite, translations should be first added to your Enviso Trade for Resellers account. Refer to Add translations

  • If translation for the requested language is not available in your Enviso Trade for Resellers account, the offer name, offer description and ticket name will be fetched in the default language which is English.

offertype

string

false

Filter on the offer type.

Values:

  • Ticket

  • Voucher

Eg: offertype=Ticket

Link relationship types

Relationship

Description

self

Get information about the call itself.

Use the self link returned by API request to get more information about the offer.

Format:GET {url}/{version}/offers/{OfferId}

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get a result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Response

Success response code: 200 OK

Parameter

Offer type

1=Regular

2=Group

Ticket type

1=Group offer with per person ticket

2=Group offer with group ticket

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

1007

400

From date cannot be greater than the To date.

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

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

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

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

print(data.decode("utf-8"))
Response
{
  [
    {
        "id": "integer",
        "name": "string",
        "description": "string",
        "offerType": "string",          //// Offer type: Ticket, Voucher
        "type": "integer",              //// Ticket Offer type: 1-Regular, 2-Group
        "ticketType": "integer",		//// TicketType: 1-Group offer with per person ticket, 2-Group offer with group ticket
        "startDate": "datetime",       //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "endDate": "datetime",         //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "salesStartDate": "datetime",  //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "salesEndDate": "datetime",    //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "imageUrl": "string",
        "status": "integer",
        "venue": {
            "id": "integer",
            "name": "string",
			"logoImageUrl":"string",
            "addressLine1": "string",
            "addressLine2": "string",
            "locality": "string",
            "postalCode": "string",
            "country": "string",
	        "locale": {
                 "culture": "string",
                 "timezoneId": "string",
                 "currencySymbol": "string",
                 "isoCurrencySymbol": "string",
                 "timeZoneOffset": "string"
             }
        },       
        "links":
        [     
           {
      		"href": "string",
      		"rel": "string",
      		"method": "string"
    	   }
        ]
    },
    {
        "id": "integer",
        "name": "string",
        "description": "string",
        "offerType": "string",          //// Offer type: Ticket, Voucher
        "type": "integer",              //// Ticket Offer type: 1-Regular, 2-Group
        "ticketType": "integer",		//// TicketType: 1-Group offer with per person ticket, 2-Group offer with group ticket
        "startDate": "datetime",       //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "endDate": "datetime",         //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "salesStartDate": "datetime",  //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "salesEndDate": "datetime",    //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
        "imageUrl": "string",
        "status": "integer",
        "venue": {
            "id": "integer",
            "name": "string",
			"logoImageUrl":"string",
            "addressLine1": "string",
            "addressLine2": "string",
            "locality": "string",
            "postalCode": "string",
            "country": "string",
	        "locale": {
                 "culture": "string",
                 "timezoneId": "string",
                 "currencySymbol": "string",
                 "isoCurrencySymbol": "string",
                 "timeZoneOffset": "string"
             }
        },       
        "links":
        [     
            {       
                "href": "string",
	      		"rel": "string",
	      		"method": "string"
            }
        ]
    }
  ] 
}
json
{
    "errors":[
		{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Fetch offer information

URL parameters

Name

Type

Required

Description

id

integer

true

The offer ID to retrieve information for.

language

string

false

Two-letter ISO language code for fetching translations.

Example: language=nl

  • The parameter language fetches translations for offer name, offer description and ticket name.

  • As a pre-requisite, translations should be first added to your Enviso Trade for Resellers account. Refer to Add translations

  • If translation for the requested language is not available in your Enviso Trade for Resellers account, the offer name, offer description and ticket name will be fetched in the default language which is English.

Response

Success response code: 200 OK

Possible error

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

Remark

id

This refers to the Offer's ID.

productId

The id in the product section refers to the Enviso-generated product ID.

id - In the product section

The id in the Product section is used to reserve a particular product.

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

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

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

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

print(data.decode("utf-8"))
Response
json
{
    "id": "integer",
    "name": "string",
    "description": "string",
	"type": "integer",					//// Offer type: 1-Regular, 2-Group
	"ticketType": "integer",			//// Ticket type: 1-per person, 2-Group
    "startDate": "datetime",            //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "endDate": "datetime",              //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "salesStartDate": "datetime",       //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "salesEndDate": "datetime",         //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "imageUrl": "string",
    "status": "integer",  
	"event": {
        "id": "integer",
        "name": "string"
    },
    "venue": {
        "id": "integer",
        "name": "string",
		"logoImageUrl":"string",
        "addressLine1": "string",
        "addressLine2": "string",
        "postalCode": "string",
        "locality": "string",
        "country": "string",
		"locale": {
            "culture": "string",
            "timezoneId": "string",
            "currencySymbol": "string",
            "isoCurrencySymbol": "string",
            "timeZoneOffset": "string"
        }
    },
    "products": [{
            "id": "integer",
            "name": "string",
            "price": "decimal",
			"partnerPrice":"decimal" // Price set by venue
        },
        {
            "id": "integer",
            "name": "string",
            "price": "decimal",
			"partnerPrice":"decimal", // Price set by venue
			"isEnabled": "boolean",
            "productId": "integer" 
        }
    ],
	"groupSize": "integer",
    "minimumVisitorPerVisit": "integer",
    "languages": [],
    "guideRequired": "boolean",
	"groupServiceFee": "decimal"
}
json
{
    "errors":[
		{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Fetch offer timeslots

URL parameter

Name

Type

Required

Description

id

integer

true

The offer ID to retrieve information for.

Query parameters

Name

Type

Required

Description

fromdate

datetime

false

Filter timeslots fromdate.

Acceptable formats:

yyyy-MM-ddTHH:mm:ssZ

yyyy-MM-dd HH:mm:ss

Note

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

todate

datetime

false

Filter timeslots todate.

Acceptable formats:

yyyy-MM-ddTHH:mm:ssZ

yyyy-MM-dd HH:mm:ss

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 errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1005

400

The provided value for <field> is not valid.

1007

400

From date cannot be greater than the To date.

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

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

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

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "slotDate": "2020-10-09T13:01:21.413Z", //// DateTime Format : yyyy-MM-dd (i.e. "2017-11-23")
      "startTime": "2020-10-09T13:01:21.413Z",
      "endTime": "2020-10-09T13:01:21.413Z"
   },
   {        
      "id": "integer",        
      "slotDate": "date", //// DateTime Format : yyyy-MM-dd (i.e. "2017-11-23")        
      "startTime": "string",         
      "endTime": "string"
    }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch offer image

Response

Success response code: 200 OK

It will return base46 string of LogoImage.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/venues/0/offers/0/images/exampleimage.jpg");
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/resellingapi/v2/venues/0/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/resellingapi/v2/venues/0/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/resellingapi")

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

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

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

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

Check offer capacity/availability for date range

URL parameter

Name

Type

Required

Description

id

integer

true

The offer ID to retrieve available capacity for.

Query parameters

Name

Type

Required

Description

visitdate

date

false

The date to retrieve offer capacity for.

Use to get results when offer capacity is defined day-wise, that is, PER_DAY.

The provided visit date must not be in the past.

Format: yyyy-MM-dd

timeslotid

integer

false

The time slot ID to retrieve offer capacity for.

Use to get results when offer capacity is defined slot-wise, that is PER_SLOT.

The value of time slot ID must be greater than 0.

Capacity for time slots with current or future dates will be retrieved, even if the slot time has elapsed for the current date.

fromdate

date

false

The start date of the date range for which offer capacity is to be retrieved.

fromdate must not be in the past.

fromdate is required if todate is provided.

Format: yyyy-MM-dd

todate

date

false

The end date of the date range for which offer capacity is to be retrieved.

todate must not be less than fromdate.

Format: yyyy-MM-dd

Note

  • Instead of fetching offer capacity for multiple dates individually, it is recommended to fetch offer capacity for a date range.

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

Visualisation of response parameters per capacity type

tick.png = The parameter will be shown

cross.png = The parameter will not be shown

Response parameter

TOTAL

PER_DAY

PER_SLOT

availableQuantity

tick.png

tick.png

tick.png

date

cross.png

tick.png

cross.png

timeSlotId

cross.png

cross.png

tick.png

Capacity types for the 'capacities → type' in the response

Capacity Type Value

Capacity Type Code

1

TOTAL

2

PER_DAY

3

PER_SLOT

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1005

400

The provided value for <field> is not valid.

1007

400

The To date cannot be less than the From date.

9057

400

Please provide valid query parameter to check capacity.

9009

400

Offer ID {offerId} is not valid.

4006

400

Timeslot ID is not valid.

4021

400

Timeslot ID is not in the offer period.

4023

400

Visit date is not in the offer period.

4048

400

<field> cannot be in the past.

9058

400

The date range must not be more than <maximum_number> days.

9014

400

The date range is not in the offer period.

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

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

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

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

print(data.decode("utf-8"))
Response
{
	"id": "integer", // offer ID
	"type": "integer",             // Capacity type   //// (i.e. 2 for "PER_DAY")
    "capacities": [{
            "availableQuantity": "integer", // if availableQuantity is -1, then you can sell unlimited quantity.
            "date": "date",         // Date Format : yyyy-MM-dd (i.e. "2017-11-23")
            "timeSlotId": "integer"
        }
    ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Check offer capacity/availability for the requested quantity

URL parameter

Name

Type

Required

Description

offerid

integer

true

The offer ID to retrieve available capacity for.

Query parameters

Name

Type

Required

Description

fromdate

date

true

The start date of the date range for which offer capacity is to be retrieved.

Format: yyyy-MM-dd

  • fromdate must not be in the past.

  • fromdate is required if todate is provided.

Example: visitdate=2021-05-23

Note

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

todate

date

true

The end date of the date range for which offer capacity is to be retrieved.

Format: yyyy-MM-dd

  • fromdate must not be in the past.

  • fromdate is required if todate is provided.

Example: todate=2021-05-23

Note

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

quantity

integer

true

The quantity to be reserved.

guidelanguage

string

false

The required guide language for the offer.

Example: guidelanguage=en

Responses

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/offers/0/availabilities");
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/resellingapi/v2/offers/0/availabilities")
  .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/resellingapi/v2/offers/0/availabilities");
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/resellingapi")

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

conn.request("GET", "/v2/offers/0/availabilities", headers=headers)

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

print(data.decode("utf-8"))
Response
[
    {
        "date": "date",
        "timeSlots": [
            {
                "id": "integer",
                "slotDate": "date",
                "startTime": "date",
                "endTime": "date"
            }
        ]
    },
    {
        "date": "date",
        "timeSlots": [
            {
                "id": "integer",
                "slotDate": "date",
                "startTime": "date",
                "endTime": "date"
            }
        ]
    }
]
json
{
    "errors":[
		{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Fetch offer product prices per day

Query parameter

Name

Type

Required

Description

date

date

true

The date for which offer product prices will be retrieved.

Format: yyyy-MM-dd

Eg: date=2021-05-23

Response

Success response code: 200 OK

Note

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

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

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

conn.request("GET", "/v2/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"
}]
}

Fetch offer product prices

Query parameter

Name

Type

Required

Description

from

date

true

The date for which offer product prices will be retrieved.

Format: yyyy-MM-dd

Eg: date=2021-05-23

to

date

true

The date for which offer product prices will be retrieved.

Format: yyyy-MM-dd

Eg: date=2021-05-24

Response

Success response code: 200 OK

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

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

conn.request("GET", "/v2/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"
}]
}

Fetch linked products

URL parameter

Name

Type

Required

Description

id

integer

true

The voucher offer ID to retrieve information of its linked products.

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/offers/0/linked-products");
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/resellingapi/v2/offers/0/linked-products")
  .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/resellingapi/v2/offers/0/linked-products");
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/resellingapi")

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

conn.request("GET", "/v2/offers/0/linked-products", headers=headers)

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

print(data.decode("utf-8"))
Response
[{
    "id": "integer",    // voucher offer product id
    "name": "string",   // voucher offer product name
    "linkedProducts": [
		{
			id: "integer",
			"name": "string",
			"quantity": "integer"
			"offer": {
				"id": "integer",
    			"name": "string" 
			}
		}
	]
}]
json
{
    "errors":[
		{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Baskets/Reservations

Note

Please note that the product price might differ for certain days, dates, or time slots depending on the price rules configured by the venue. This does not affect the margins set in your Trade for Resellers account.

Create basket with reservation(s)

Request fields

Name

Type

Required

Description

productId

integer

true

Product id to be reserved.

quantity

integer

true

Product quantity to be reserved.

visitDate

date

true

Reservation date of the product.

Format: yyyy-MM-dd

Note

Providing the visitDate is not required for products belonging to offer with PER_SLOT and TOTAL frequency.

timeSlotId

integer

false

ID of the time slot for which the product is to be reserved.

Note

Providing timeSlotId is required for products belonging to offer with PER_SLOT frequency.

guideLanguage

string

false

Guide language

Note

Providing guideLanguage is required for products belonging to guided offer.

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

PER_DAY

PER_SLOT

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

Responses

Success response code: 201Created

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/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\"}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/resellingapi/v2/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\"}]")
  .asString();
Request
const data = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"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/resellingapi/v2/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/resellingapi")

payload = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"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", "/v2/baskets", payload, headers)

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "pricing": {
        "subtotal": "decimal",
        "total": "decimal",
        "cost": "decimal"
    },
    "reservations": [
    {
      "id": "number" | null	// this will only have a value if the reservation is a group reservation
      "offer": {
            "id": "integer",
            "name": "string",
            "eventId": "integer",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            },
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
      },
      "visitDate": "date",
      "timeSlot": {
        "id": "number",
        "from": "date",
        "end": "date"
      },
      "guideLanguage": "string",
      "pricing": {
         "subtotal": "decimal",
         "total": "decimal",
         "cost": "decimal"
      },
      "expireOn": "date",
      "groups": [{
          "numberOfVisitors": "number"
      }],
      "productReservations": [
        {
          "id": "number",
          "product": {
               "id": "integer:,
               "name": "string",
               "price": "decimal"
            },
          "quantity": "number",		// if the reservation of group offer then the quantity will be in no. of groups, otherwise no. of tickets
          "unitPrice": "number",
          "pricing": {
            "subtotal": "number",
            "total": "number"
          }
        }
      ]
    }
  ]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Get basket

URL parameter

Name

Type

Required

Description

id

route

true

The ID of the basket.

Data type: GUID

Responses

Success response code: 200 OK

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

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

conn.request("GET", "/v2/baskets/0", headers=headers)

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "pricing": {
        "subtotal": "decimal",
        "total": "decimal",
        "cost": "decimal"
    },
    "reservations": [
    {
      "id": "number" | null	// this will only have a value if the reservation is a group reservation
      "offer": {
            "id": "integer",
            "name": "string",
            "eventId": "integer",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            },
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
      },
      "visitDate": "date",
      "timeSlot": {
        "id": "number",
        "from": "date",
        "end": "date"
      },
      "guideLanguage": "string",
      "pricing": {
         "subtotal": "decimal",
         "total": "decimal",
         "cost": "decimal"
      },
      "expireOn": "date",
      "groups": [{
          "numberOfVisitors": "number"
      }],
      "productReservations": [
        {
          "id": "number",
          "product": {
               "id": "integer:,
               "name": "string",
               "price": "decimal"
            },
          "quantity": "number",		// if the reservation of group offer then the quantity will be in no. of groups, otherwise no. of tickets
          "unitPrice": "number",
          "pricing": {
            "subtotal": "number",
            "total": "number"
          }
        }
      ]
    }
  ]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Delete basket reservation

URL parameters

Name

Type

Required

Description

id

route

true

The ID of the basket.

Data type: GUID

reservationid

route

true

The ID of the product reservation.

Data type: number

Responses

Success response code: 200 OK

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

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

conn.request("DELETE", "/v2/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations/0", headers=headers)

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "pricing": {
        "subtotal": "decimal",
        "total": "decimal",
        "cost": "decimal"
    },
    "reservations": [
    {
      "id": "number" | null	// this will only have a value if the reservation is a group reservation
      "offer": {
            "id": "integer",
            "name": "string",
            "eventId": "integer",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            },
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
      },
      "visitDate": "date",
      "timeSlot": {
        "id": "number",
        "from": "date",
        "end": "date"
      },
      "guideLanguage": "string",
      "pricing": {
         "subtotal": "decimal",
         "total": "decimal",
         "cost": "decimal"
      },
      "expireOn": "date",
      "groups": [{
          "numberOfVisitors": "number"
      }],
      "productReservations": [
        {
          "id": "number",
          "product": {
               "id": "integer:,
               "name": "string",
               "price": "decimal"
            },
          "quantity": "number",		// if the reservation of group offer then the quantity will be in no. of groups, otherwise no. of tickets
          "unitPrice": "number",
          "pricing": {
            "subtotal": "number",
            "total": "number"
          }
        }
      ]
    }
  ]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Add reservation(s) to basket

URL parameter

Name

Type

Required

Description

id

route

true

The ID of the basket.

Data type: GUID

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

PER_DAY

PER_SLOT

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

Responses

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/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,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"string\"}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post(https://api.staging-enviso.io/resellingapi/v2/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,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"string\"}]")
  .asString();
Request
const data = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"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/resellingapi/v2/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/resellingapi")

payload = "[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0,\"guideLanguage\":\"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", "/v2/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reservations", payload, headers)

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "pricing": {
        "subtotal": "decimal",
        "total": "decimal",
        "cost": "decimal"
    },
    "reservations": [
    {
      "id": "number" | null	// this will only have a value if the reservation is a group reservation
      "offer": {
            "id": "integer",
            "name": "string",
            "eventId": "integer",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            },
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
      },
      "visitDate": "date",
      "timeSlot": {
        "id": "number",
        "from": "date",
        "end": "date"
      },
      "guideLanguage": "string",
      "pricing": {
         "subtotal": "decimal",
         "total": "decimal",
         "cost": "decimal"
      },
      "expireOn": "date",
      "groups": [{
          "numberOfVisitors": "number"
      }],
      "productReservations": [
        {
          "id": "number",
          "product": {
               "id": "integer:,
               "name": "string",
               "price": "decimal"
            },
          "quantity": "number",		// if the reservation of group offer then the quantity will be in no. of groups, otherwise no. of tickets
          "unitPrice": "number",
          "pricing": {
            "subtotal": "number",
            "total": "number"
          }
        }
      ]
    },
    {
      "id": "number" | null	// this will only have a value if the reservation is a group reservation
      "offer": {
            "id": "integer",
            "name": "string",
            "eventId": "integer",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            },
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
      },
      "visitDate": "date",
      "timeSlot": {
        "id": "number",
        "from": "date",
        "end": "date"
      },
      "guideLanguage": "string",
      "pricing": {
         "subtotal": "decimal",
         "total": "decimal",
         "cost": "decimal"
      },
      "expireOn": "date",
      "groups": [{
          "numberOfVisitors": "number"
      }],
      "productReservations": [
        {
          "id": "number",
          "product": {
               "id": "integer:,
               "name": "string",
               "price": "decimal"
            },
          "quantity": "number",		// if the reservation of group offer then the quantity will be in no. of groups, otherwise no. of tickets
          "unitPrice": "number",
          "pricing": {
            "subtotal": "number",
            "total": "number"
          }
        }
      ]
    }
  ]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Orders

Checkout basket (Create order)

Request fields

Field

Type

Required?

Description

referenceId

string

false

The reseller’s reference order ID to be linked with the order placed using the Reselling API.

preferredLanguage

string

true

Two-letter ISO language code of the preferred guide language.

Example: "preferredLanguage": "nl"

visitor

object

false

Visitor information fields while placing the order.

firstname

string

false

First name of the visitor.

lastname

string

false

Last name of the visitor.

organization

object

false

Name of the organisation for whom the order is placed.

Note

organization is required if isOrganization= true

email

string

false

Email address of the visitor.

email is required in either of the following cases:

  • isOrganization= true

  • isOrganization= false and firstname is provided

contact

string

false

The contact number of the visitor.

Note

contact is required if isOrganization= true

city

string

false

City of the visitor.

postalcode

string

false

Postal code of the visitor.

Note

postalcode is required if the city is provided.

countryName

string

true

Two-letter country code of the visitor's country name.

Example: countryName=be

Here be is the two-letter country code for Belgium.

isOrganization

boolean

false

A visit type wherein the order is placed on behalf of an organisation.

  • if isOrganization = false, In this case, the order will be confirmed and the response will contain ticket barcode.

  • if isOrganization = true, In this case, the order will be reserved. The order has to be confirmed to get barcode ticket. Organisation details required for this case

URL parameter

Name

Type

Required

Description

id

route

true

The ID of the basket.

Data type: GUID

Important to know:
  • The ticket barcode string provided by the field barcodeString can be converted into any barcode types (e.g. QR Code, Code128, etc.). The field barcodeFormat does not have any impact on the ticket barcode. This field will be obsolete and removed in the future releases.

  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00. eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId. eg: 2017-11-24 16:30:00

Order status for the 'status' field in the response

Order Status Value

Order Status Code

1

Confirmed

2

Cancelled

3

Reserved

Link relationship types

Relationship

Description

URL

self

Get information about the call itself. Use the self link returned by API request to get more information about the order.

GET {url}/v2/orders/{orderId}

cancel

Cancel order using this link.

PUT {url}/v2/orders/{orderId}/cancel

link

Link order reference ID using this link.

POST {url}/v2/orders/{{orderId}}/link

Responses

Success response code: 201 Created

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/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", "{\"referenceId\":\"string\",\"preferredLanguage\":\"string\",\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\"},\"isOrganization\":true,\"organization\":{\"name\":\"string\"}}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/resellingapi/v2/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("{\"referenceId\":\"string\",\"preferredLanguage\":\"string\",\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\"},\"isOrganization\":true,\"organization\":{\"name\":\"string\"}}}")
  .asString();
Request
const data = "{\"referenceId\":\"string\",\"preferredLanguage\":\"string\",\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\"},\"isOrganization\":true,\"organization\":{\"name\":\"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/resellingapi/v2/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/resellingapi")

payload = "{\"referenceId\":\"string\",\"preferredLanguage\":\"string\",\"visitor\":{\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"address\":{\"country\":\"string\",\"city\":\"string\",\"postalcode\":\"string\"},\"isOrganization\":true,\"organization\":{\"name\":\"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", "/v2/baskets/497f6eca-6276-4993-bfeb-53cbbbba6f08/checkout", payload, headers)

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "number": "string",   // Unique order number e.g. A250000000000
    "status": "integer",
    "amount": "decimal",
    "quantity": "integer",
    "language": "string",
    "cost": "decimal",
    "channelName": "string",           //Reseller's sales channel name from where order is placed. Possible Values: POS, WebPortal, Kiosk, Other
    "source": "string",                //Possible Values: Tradeflow, ResellingApi
    "referenceId": "string",           //Reseller's order reference id to link with order of reselling api.
    "createdOn": "datetime",           //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-12 15:30:00")
    "lastUpdatedOn": "datetime",      //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "currencyInfo": {
        "currencySymbol": "string",
        "isoCurrencySymbol": "string"
    },	
    "payment": {
       "method": "string",       // By Default it will be ByInvoice
    },
    "orderItems": [{
        "id": "integer",
        "unitPrice": "decimal",
        "quantity": "integer",
        "totalPrice": "decimal",
        "guideLanguage": "string",
        "visitDate": "date",      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        "timeSlot": {
            "id": "integer",
            "slotDate": "date",    //// Date Format : yyyy-MM-dd (i.e. "2022-11-23")
            "startTime": "date",   //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
            "endTime": "date"      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        },
        "offer": {
            "id": "integer",
            "name": "string",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "eventId": "integer",
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                    "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            }
      },
      "product": {                 /// For group offer it will be null and available in product orderlines
         "id": "integer",
         "name": "string",
         "price": "decimal",
		 "linkedProducts": [{
			"id": 0,
			"quantity": 0,
			"price": 0,
		}]
      },
      "ticketBarcodes": [{
          "barcodeFormat": "string",
          "barcodeString": "string",
		  "validFrom": "date",
		  "validTill": "date",
		  "isScanned": "boolean"
      }],
      "groups": [{                      // Only for 'group' offers.
          "numberOfVisitors": "integer"
      }],
      "productOrderLines": [{            // Only for 'group' offers
          "id": "integer",
          "unitPrice": "decimal",
          "subTotal": "decimal",
          "quantity": "decimal",
          "product": {
             "id": "integer",
             "name": "string",
             "price": "decimal",
			 "linkedProducts": [{
				"id": 0,
				"quantity": 0,
				"price": 0,
			}]
           },
          "guideLanguage": "string",
          "timeSlot": {
             "id": "integer",
             "slotDate": "date",
             "startTime": "date",
             "endTime": "date"
           },
           "ticketBarcodes": [{
              "barcodeFormat": "string",
              "barcodeString": "string",
		  	  "validFrom": "date",
       		  "validTill": "date",
		      "isScanned": "boolean"
           }]
         }]
       }
	],
	"visitor": {
		"organization": { // for organization visit
			"name": "string"
		}, 
		"firstName": "string",
		"lastName": "string",
		"email": "string",
		"contact": "integer",
		"address": {
            "country": "string",
			"city": "string",
			"postalcode": "string"
		}
	},
    "links": [{
            "href": "string",
            "rel": "string",
            "method": "string",
        }]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Link order reference

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to be linked with reseller's order reference ID.

Query parameter

Name

Type

Required

Description

referenceid

string

true

The reseller’s reference order ID to be linked with the order placed using the Reselling API.

Response

Success response code: 201 CREATED

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1008

400

<field> must not exceed {maxlimit} characters.

4004

400

Order ID {orderId} is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/orders/0/link");
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-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/resellingapi/v2/orders/0/link")
  .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("POST", "https://api.staging-enviso.io/resellingapi/v2/orders/0/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/resellingapi")

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

conn.request("POST", "/v2/orders/0/link", headers=headers)

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

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

Fetch orders

Query parameters

Name

Type

Required

Description

page

integer

false

The start page number for the range to show in the response. If omitted, only records of the first page will be shown.

perpage

integer

false

Number of results per page. If omitted, only the first 50 records will be shown.

orderby

string

false

Sorting order of the results.

Possible values:

Id Asc

Id Desc

Amount Asc

Amount Desc

LastUpdatedOn Asc

LastUpdatedOn Desc

fromdate

string

true

The start date for the range to show in the response.

Format: yyyy-MM-dd

todate

string

true

The end date for the range to show in the response.

Format: yyyy-MM-dd

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Link relationship types

Relationship

Description

URL

self

Get information about the call itself.

Use the self link returned by API request to get more information about the order.

GET {url}/v2/orders/{orderId}

cancel

Cancel order using this link.

PUT {url}/v2/orders/{orderId}/cancel

link

Link order reference ID using this link.

POST {url}/v2/orders/{orderId}/link

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

1007

400

From date cannot be greater than the To date.

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

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

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

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "number": "string",
      "status": 0,
      "createdOn": "2020-10-09T13:58:57.929Z",
      "lastUpdatedOn": "2020-10-09T13:58:57.929Z",
      "amount": 0,
      "quantity": 0,
      "paymentMethod": "string",
      "channelName": "string",
      "source": "string",
      "referenceId": "string",
      "visitType": "string",
      "currencyInfo": {
         "currencySymbol": "string",
         "isoCurrencySymbol": "string"
      },
      "links": [
         {
            "href": "string",
            "rel": "string",
            "method": "string"
         }
      ]
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch order information

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to retrieve information for.

Response

Success response code: 200 OK

Parameter:

Parameter

Description

linkedProducts

Only set for voucher offer products.

Import things to know about Response

  • The ticket barcode string provided by the field barcodeString can be converted into any barcode types (e.g. QR Code, Code128, etc.). The field barcodeFormat does not have any impact on the ticket barcode. This field will be obsolete and removed in the future releases.

  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00.

    • Eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId.

    • Eg: 2017-11-24 16:30:00

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

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

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

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

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "number": "string",   // Unique order number e.g. A250000000000
    "status": "integer",
    "amount": "decimal",
    "quantity": "integer",
    "cost": "decimal",
    "language": "string",
    "channelName": "string",           //Reseller's sales channel name from where order is placed. Possible Values: POS, WebPortal, Kiosk, Other
    "source": "string",                //Possible Values: Tradeflow, ResellingApi
    "referenceId": "string",           //Reseller's order reference id to link with order of reselling api.
    "createdOn": "datetime",           //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-12 15:30:00")
    "lastUpdatedOn": "datetime",      //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "currencyInfo": {
        "currencySymbol": "string",
        "isoCurrencySymbol": "string"
    },	
    "payment": {
       "method": "string",       // By Default it will be ByInvoice
    },
    "orderItems": [{
        "id": "integer",
        "unitPrice": "decimal",
        "quantity": "integer",
        "totalPrice": "decimal",
        "cost": "decimal",
        "guideLanguage": "string",
        "visitDate": "date",      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        "timeSlot": {
			"id": "integer",
            "slotDate": "date",    //// Date Format : yyyy-MM-dd (i.e. "2022-11-23")
            "startTime": "date",   //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
            "endTime": "date"      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        },
        "offer": {
            "id": "integer",
            "name": "string",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "eventId": "integer",
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                    "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            }
      },
      "product": {                 /// For group offer it will be null and available in product orderlines
         "id": "integer",
         "name": "string",
         "price": "decimal",
		 "linkedProducts": [{
			"id": 0,
			"quantity": 0,
			"price": 0,
		}]
      },
      "ticketBarcodes": [{
          "barcodeFormat": "string",
          "barcodeString": "string",
		  "validFrom": "date",
		  "validTill": "date",
		  "isScanned": "boolean"
      }],
      "groups": [{                      // Only for 'group' offers.
          "numberOfVisitors": "integer"
      }],
      "productOrderLines": [{            // Only for 'group' offers
          "id": "integer",
          "unitPrice": "decimal",
          "subTotal": "decimal",
          "quantity": "decimal",
          "product": {
             "id": "integer",
             "name": "string",
             "price": "decimal",
			 "linkedProducts": [{
  				"id": 0,
				"quantity": 0,
				"price": 0,
			}]
           },
          "guideLanguage": "string",
          "timeSlot": {
             "id": "integer",
             "slotDate": "date",
             "startTime": "date",
             "endTime": "date"
           },
           "ticketBarcodes": [{
              "barcodeFormat": "string",
              "barcodeString": "string",
			  "validFrom": "date",
    		  "validTill": "date",
	     	  "isScanned": "boolean"
           }]
         }]
       }
	],
	"visitor": {
		"organization": { // for organization visit
			"name": "string"
		}, 
		"firstName": "string",
		"lastName": "string",
		"email": "string",
		"contact": "integer",
		"address": {
            "country": "string",
			"city": "string",
			"postalcode": "string"
		}
	},
    "links": [{
            "href": "string",
            "rel": "string",
            "method": "string",
        }]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Cancel order

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to be cancelled.

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

4004

400

Order ID {orderId} is not valid.

4016

400

Order is already cancelled.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/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-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/resellingapi/v2/orders/0/cancel")
  .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("PUT", "https://api.staging-enviso.io/resellingapi/v2/orders/0/cancel");
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/resellingapi")

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

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

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

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

Confirm reserved order

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to be confirmed.

Important to know about Response
  • The ticket barcode string provided by the field barcodeString can be converted into any barcode types (e.g. QR Code, Code128, etc.). The field barcodeFormat does not have any impact on the ticket barcode. This field will be obsolete and removed in the future releases.

  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00.

    • Eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId.

    • Eg: 2017-11-24 16:30:00

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

4004

400

Order ID {orderId} is not valid.

4019

400

Order is already confirmed.

4020

400

Order is already cancelled and it cannot be confirmed.

4079

422

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

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/orders/0/confirm");
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/resellingapi/v2/orders/0/confirm")
  .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("PUT", "https://api.staging-enviso.io/resellingapi/v2/orders/0/confirm");
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/resellingapi")

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

conn.request("PUT", "/v2/orders/0/confirm", headers=headers)

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "number": "string",   // Unique order number e.g. A250000000000
    "status": "integer",
    "amount": "decimal",
    "quantity": "integer",
    "cost": "decimal",
    "language": "string",
    "channelName": "string",           //Reseller's sales channel name from where order is placed. Possible Values: POS, WebPortal, Kiosk, Other
    "source": "string",                //Possible Values: Tradeflow, ResellingApi
    "referenceId": "string",           //Reseller's order reference id to link with order of reselling api.
    "createdOn": "datetime",           //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-12 15:30:00")
    "lastUpdatedOn": "datetime",      //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "currencyInfo": {
        "currencySymbol": "string",
        "isoCurrencySymbol": "string"
    },	
    "payment": {
       "method": "string",       // By Default it will be ByInvoice
    },
    "orderItems": [{
        "id": "integer",
        "unitPrice": "decimal",
        "quantity": "integer",
        "totalPrice": "decimal",
        "cost": "decimal",
        "guideLanguage": "string",
        "visitDate": "date",      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        "timeSlot": {
			"id": "integer",
            "slotDate": "date",    //// Date Format : yyyy-MM-dd (i.e. "2022-11-23")
            "startTime": "date",   //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
            "endTime": "date"      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        },
        "offer": {
            "id": "integer",
            "name": "string",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "eventId": "integer",
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                    "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            }
      },
      "product": {                 /// For group offer it will be null and available in product orderlines
         "id": "integer",
         "name": "string",
         "price": "decimal",
		 "linkedProducts": [{
			"id": 0, 
 			"quantity": 0,
			"price": 0,
		}]
      },
      "ticketBarcodes": [{
          "barcodeFormat": "string",
          "barcodeString": "string"
      }],
      "groups": [{                      // Only for 'group' offers.
          "numberOfVisitors": "integer"
      }],
      "productOrderLines": [{            // Only for 'group' offers
          "id": "integer",
          "unitPrice": "decimal",
          "subTotal": "decimal",
          "quantity": "decimal",
          "product": {
             "id": "integer",
             "name": "string",
             "price": "decimal",
			"linkedProducts": [{
				"id": 0,
				"quantity": 0,
				"price": 0,
			}]
           },
          "guideLanguage": "string",
          "timeSlot": {
             "id": "integer",
             "slotDate": "date",
             "startTime": "date",
             "endTime": "date"
           },
           "ticketBarcodes": [{
              "barcodeFormat": "string",
              "barcodeString": "string",
          	  "validFrom": "date",
    		  "validTill": "date",
     	   	  "isScanned": "boolean"
           }]
         }]
       }
	],
	"visitor": {
		"organization": { // for organization visit
			"name": "string"
		}, 
		"firstName": "string",
		"lastName": "string",
		"email": "string",
		"contact": "integer",
		"address": {
            "country": "string",
			"city": "string",
			"postalcode": "string"
		}
	},
    "links": [{
            "href": "string",
            "rel": "string",
            "method": "string",
        }]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}

Update reserved order

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to be updated.

Note

If the quantity is updated to 0, the order line will be removed.

Request fields

Field

Type

Required

Description

productId

integer

true

ID of the product which is to be updated.

quantity

integer

true

Product quantity to be updated.

visitDate

date

true

Visit date for which product quantity is to be updated.

Providing visitDate is not required for products belonging to offer with PER_SLOT frequency.

Format: yyyy-MM-dd

timeSlotId

integer

false

ID of the time slot for which the product quantity is to be updated.

Providing timeslotid is mandatory for products belonging to offer with PER_SLOT frequency.

Important things to know about Response
  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00.

    • Eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId.

    • Eg: 2017-11-24 16:30:00

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

4002

400

Product ID {productId} is not valid.

4004

400

Order ID {orderId} is not valid.

9067

422

No availability or guides available for the selected ticket quantity

4076

400

Order is already confirmed and it cannot be updated.

4077

400

Order is already cancelled and it cannot be updated.

4084

422

Order cannot be updated as the visit date of the offer has elapsed.

4092

400

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

4093

400

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

4094

400

Product id with same date & time exists.

4112

400

Order item/s of only one offer can be updated at a time.

4113

400

No order item is associated with the requested visitdate/timeslot.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v2/orders/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", "{\"orderItems\":[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/resellingapi/v2/orders/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("{\"orderItems\":[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]}")
  .asString();
Request
var data = "{\"orderItems\":[{\"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("PUT", "https://api.staging-enviso.io/resellingapi/v2/orders/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/resellingapi")

payload = "{\"orderItems\":[{\"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("PUT", "/v2/orders/0", payload, headers)

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

print(data.decode("utf-8"))
Response
{
    "id": "integer",
    "number": "string",   // Unique order number e.g. A250000000000
    "status": "integer",
    "amount": "decimal",
    "quantity": "integer",
    "cost": "decimal",
    "language": "string",
    "channelName": "string",           //Reseller's sales channel name from where order is placed. Possible Values: POS, WebPortal, Kiosk, Other
    "source": "string",                //Possible Values: Tradeflow, ResellingApi
    "referenceId": "string",           //Reseller's order reference id to link with order of reselling api.
    "createdOn": "datetime",           //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-12 15:30:00")
    "lastUpdatedOn": "datetime",      //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "currencyInfo": {
        "currencySymbol": "string",
        "isoCurrencySymbol": "string"
    },	
    "payment": {
       "method": "string",       // By Default it will be ByInvoice
    },
    "orderItems": [{
        "id": "integer",
        "unitPrice": "decimal",
        "quantity": "integer",
        "totalPrice": "decimal",
        "cost": "decimal",
        "guideLanguage": "string",
        "visitDate": "date",      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        "timeSlot": {
			"id": "integer",
            "slotDate": "date",    //// Date Format : yyyy-MM-dd (i.e. "2022-11-23")
            "startTime": "date",   //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
            "endTime": "date"      //// Date Format : yyyy-MM-dd HH:mm:ss (i.e. "2022-11-23 00:00:00")
        },
        "offer": {
            "id": "integer",
            "name": "string",
            "type": "integer",
            "ticketType": "integer",
            "imageUrl": "string",
            "frequencyType": "integer",
            "eventId": "integer",
            "startDate": "date",
            "endDate": "date",
            "minimumVisitorsPerVisit": "integer"
            "venue": {
                "id": "integer",
                "name": "string",
                "logoImageUrl": "string",
                "locale": {
                    "culture": "string",
                    "timezoneId": "string",
                    "currencySymbol": "string",
                    "isoCurrencySymbol": "string",
                    "timeZoneOffset": "string"
                }
            }
      },
      "product": {                 /// For group offer it will be null and available in product orderlines
         "id": "integer",
         "name": "string",
         "price": "decimal",
		 "linkedProducts": [{
			"id": 0,
			"quantity": 0,
			"price": 0,
		}]
      },
      "ticketBarcodes": [{
          "barcodeFormat": "string",
          "barcodeString": "string"
      }],
      "groups": [{                      // Only for 'group' offers.
          "numberOfVisitors": "integer"
      }],
      "productOrderLines": [{            // Only for 'group' offers
          "id": "integer",
          "unitPrice": "decimal",
          "subTotal": "decimal",
          "quantity": "decimal",
          "product": {
             "id": "integer",
             "name": "string",
             "price": "decimal",
			 "linkedProducts": [{
				"id": 0,
				"quantity": 0,
				"price": 0,
			}]
           },
          "guideLanguage": "string",
          "timeSlot": {
             "id": "integer",
             "slotDate": "date",
             "startTime": "date",
             "endTime": "date"
           },
           "ticketBarcodes": [{
              "barcodeFormat": "string",
              "barcodeString": "string",
           	  "validFrom": "date",
    		  "validTill": "date",
     		  "isScanned": "boolean"
           }]
         }]
       }
	],
	"visitor": {
		"organization": { // for organization visit
			"name": "string"
		}, 
		"firstName": "string",
		"lastName": "string",
		"email": "string",
		"contact": "integer",
		"address": {
            "country": "string",
			"city": "string",
			"postalcode": "string"
		}
	},
    "links": [{
            "href": "string",
            "rel": "string",
            "method": "string",
        }]
}
json
{
	"errors": [{
		"message": "string",
		"code": "number"
	}]
}
json
[{	
	"visitDate": "date",
	"timeSlotId": "integer",
	"errors": [{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
},
{
	"visitDate": "date",
	"timeSlotId": "integer",
	"errors": [{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}]

Changelog

This section contains the notable changes in the Reselling API.

Reselling API v2

Reselling API v1

  • Initial version

Reselling API v1

Note

Reselling API v1 does not support group offers, price rules, and voucher offers. If you wish to use these features, please switch to Reselling API v2.

We recommend switching to Reselling API v2 because it will replace Reselling API v1 in the future.

The Reselling API establishes a connection with Enviso Trade backend, which facilitates the following activities on your selling interface:

  • Make venue data available

  • Make offer data available

  • Check offer availability

  • Place order

  • Retrieve order details

  • Cancel order

ResAPI001.png

Terminologies

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

Venue

A venue is an organisational unit that registers on the Enviso Trade application to enable partners for reselling their tickets.

Reseller

A company or an individual who is in partnership with the venue for reselling their tickets.

Partnership

An arrangement where a venue and a reseller partner up on the Enviso Trade application.

Product

Ticket is referred to as a product in the context of the Reselling API. Example: Adult safari ticket is referred to as a product.

Note

The result of a product sale is a ticket barcode.

Offer

Product(s) form an offer.

Note

It is possible that an offer contains one or multiple products.

Example: An offer could consist of an Adult safari ticket. While another offer could consist of two products, an Adult safari ticket and a 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.

Reserved product

A product that is added to the cart but the order is not yet placed.

It is possible to define (in minutes) for how long a product in the cart is reserved until it is confirmed. By default, the reserved time is 30 minutes. This means, if a product in the cart is not confirmed within 30 minutes, it will automatically be returned back to the pool of available products.

Order item

Product in an order.

Pre-bill report

A pre-bill report is an estimated invoice of the tickets sold by the reseller. A pre-bill report is automatically generated to the venue on the 2nd of every month.

Individual visit

The visit of individual visitors and their friends or family is referred to as an individual visit. Order for an individual visit can be confirmed without requiring a prior reservation.

Group visit

In the case of a visit of a group, for example, a college group, changes are likely in the number of visitors. Therefore, such orders are generally booked in advance with the tentative number of visitors. Later, the order is confirmed with the updated number of visitors. Such an order is referred to as a group visit.

Order process

TF_clip0002.png

Flow of placing a new order is:

  1. View venue details and offers of partners

    After successful integration, the Reselling API displays partner venues details and offers on your selling interface. It is possible to filter venues using search term, venue type and city.

  2. Select from venue offers.

    Offers added to the cart are reserved for a certain duration until the order is placed. See further Reserved product in terminologies.

    It is possible to filter offers using the search term.

  3. Place order

    The visitor places order on your online selling interface. Additional visitor information may be required for placing an order.

    Note

    A pre-requisite for placing an order is that all the offers added to the cart must be of the same currency.

    It is possible to filter orders by date range.

  4. Receive ticket barcode

    After placing the order the Reselling API generates ticket barcode(s) which can be shared with the visitor through your selling interface.

Data model

TF_clip0003.png

Principles

The Reselling 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 1.0, {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 Reselling 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 a new resource.

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.

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

500

Internal Server Error

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

502

Bad Gateway

The server was unable to process the request for the moment.

-1

Unknown

The request could not be completed due to unknown reasons.

Offer and order status codes

Offer status codes

Code

Description

1

Available

The offer is available for sale.

4

Expired

The offer period has expired.

Order status codes

Code

Description

1

Confirmed

The order is confirmed.

2

Cancelled

The order is cancelled.

3

Reserved

The order is reserved for organisation visit.

Getting started

  1. After registering on Enviso Trade, log into your Enviso Trade for Resellers account.

  2. From the side menu, go to Settings > Connection.

  3. On the Connection screen, you will find the API link and the Tenant key.

    RS1.jpg

    Contact Vinita support and share your Tenant key in order to obtain the API key and API secret key.

    Note

    The API secret key must be kept confidential. Enviso will never ask for your API secret. If you forget your API key and/or API secret key, contact Vintia support.

  4. Generate JWT access bearer token by following the steps for Obtaining JWT Access bearer token.

    To learn about JWT access bearer tokens, visit https://jwt.io/.

Obtaining JWT access bearer token

  1. Concatenate the API key with the current timestamp in the format below:

    <<APIKEY>>_<<timestamp(yyyy'-'MM'-'ddTHH:mm:ss.fffZ)>>

  2. Create a SHA256 hash of this value. Based on the hashed value, a digital signature will be created.

  3. The combination of the created signature along with the provided API secret key will act as the digital signature of the call.

  4. Send these values to the login action.

  5. After successful validation, a JWT Access bearer token will be provided.

    The validity of JWT token is for 1 hour. The parameter refreshToken allows to extend the session by renewing the JWT token from the server side before the existing token expires. See further, the endpoint Get new token.

    Note

    To make this process easier, a sample application is created which can be used to validate if the created signature is correct. It is also available on  https://github.com/gantner-nv/EnvisoApiAuthentication

Example

API key

QrCDN6CcXkGOnRiNcZMrpw==

API secret

-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgBSU90PX4WyXFAZ/+M84dJNEi/0j5OermfydTU4g2JvnpO6BOQjNpb5+mOLjVoij7DWTdDtx1WThRm04N3DVuyh+a5cledvMbcngvyiXpQCdskT9bVmI4QLbmRny46S7MER1jhziMQRfRw9gbmlB2iCEqn21kDr842Q+WDtLE4QIDAQAB-----END PUBLIC KEY-----

TimeStamp

2018-01-22T13:58:33.871Z

The hashed value of step 2 will be:

The signature of step 3 will be:

The values to post to the login action will be:

Send values to the Login action

Login

POST /v1/apis/login HTTP/1.2

Host: https://api.staging-enviso.io/resellingapi

Content-Type: application/json

Cache-Control: no-cache

9952375a30708b46739986482303cae30ad51fc9a362b5794d298dfc22f7ec02
iMTchrTU9pMWFDRYQNCnUiD2ekDdCgp0ybN7xzvj9DLtceTFsF/kxzr9q5OnqP0quyt7OGBZ/vEQlOKhODxK2wsAml/v9Rm9Ha/CVTbQ2jVWxUH3HyDqDSRQBfYPlA79vxP2CcFEB1DbNla9TlBAwovSJVy9D0oURPoe8XrJqog=
{

    "apikey":"QrCDN6CcXkGOnRiNcZMrpw==",

    "timestamp":"2018-01-22T13:58:33.871Z",

    "signature":"iMTchrTU9pMWFDRYQNCnUiD2ekDdCgp0ybN7xzvj9DLtceTFsF/kxzr9q5OnqP0quyt7OGBZ/vEQlOKhODxK2wsAml/v9Rm9Ha/CVTbQ2jVWxUH3HyDqDSRQBfYPlA79vxP2CcFEB1DbNla9TlBAwovSJVy9D0oURPoe8XrJqog="

}
{

"apikey":"QrCDN6CcXkGOnRiNcZMrpw==",

"timestamp":"2018-01-22T13:58:33.871Z",

"signature":"iMTchrTU9pMWFDRYQNCnUiD2ekDdCgp0ybN7xzvj9DLtceTFsF/kxzr9q5OnqP0quyt7OGBZ/vEQlOKhODxK2wsAml/v9Rm9Ha/CVTbQ2jVWxUH3HyDqDSRQBfYPlA79vxP2CcFEB1DbNla9TlBAwovSJVy9D0oURPoe8XrJqog="

}

How to make calls to Reselling API

Once the JWT token is obtained, it must be sent along with each request together with the API key to get access to the actions of the API.

Example:

GET /v1/Offers/ HTTP/1.2

Host: https://api.staging-enviso.io/resellingapi

x-tenantsecretkey: TadeHm6PjEig8gUAewcgsg/==

x-api-key: QrCDN6CcXkGOnRiNcZMrpw==

Authorization: bearer SPACE <JWT-access token>

Content-Type: application/json

The communication flow with Reselling API
image2018-4-26_12-19-44.png

Resources

This section of the Reselling API document pertains to customising the integration to your needs.

Important to know:

  • The API key and Tenant key availed from Vintia support are required to be passed in the Request Header of the resources.

  • Depending on the environment, the Reselling API URL will differ.

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

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

  • Portions of an end point's URL format signifies specific information.

    For example, for the URL format of endpoint Login {Reselling Api Url}/{version}/apis/login

    • The initial part {Reselling Api Url} is the API link obtained from your Enviso Trade for Resellers account. For more information on API link, refer Getting started.

    • The following part {version} signifies the version of the Reselling API.

    • For this Reselling API version, the value for {version} is v1.

  • The API key and Tenant key can be as header parameter x-api-key and x-tenantsecretkey respectively.

  • For all Authorization requests, you will need to pass the JWT token in the header with the request.

    • Authorization: Bearer SPACE <access_token>

  • All the query parameters are in lower case.

APIs

Login

Note

You can use the same authToken for each request for up to 1 hour. To extend the session before it expires, use the endpoint Get new token.

Responses

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

73

401

Api key authentication failed.

Eg: Possible error case:

  • Signature length is wrong - Invalid length for a Base-64 char array or string

  • invalid signature - unknown block type

1

422

<field> must not me empty.

Eg:

  • 'Signature' must not be empty.

  • 'Apikey' must not be empty.

0

422

Data type conversion error.

Could not convert string to DateTime: 2018-50-19T13:05:37.042Z. Path 'timestamp', line 1, position 75

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/apis/login");
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("origin", "string");
request.AddParameter("application/json-patch+json", "{\"apiKey\":\"string\",\"timestamp\":\"2019-08-24T14:15:22Z\",\"signature\":\"string\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/resellingapi/v1/apis/login")
  .header("Content-Type", "application/json-patch+json")
  .header("Accept", "text/plain")
  .header("Authorization", "string")
  .header("origin", "string")
  .body("{\"apiKey\":\"string\",\"timestamp\":\"2019-08-24T14:15:22Z\",\"signature\":\"string\"}")
  .asString();
Request
const data = "{\"apiKey\":\"string\",\"timestamp\":\"2019-08-24T14:15:22Z\",\"signature\":\"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/resellingapi/v1/apis/login");
xhr.setRequestHeader("Content-Type", "application/json-patch+json");
xhr.setRequestHeader("Accept", "text/plain");
xhr.setRequestHeader("Authorization", "string");
xhr.setRequestHeader("origin", "string");

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

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

payload = "{\"apiKey\":\"string\",\"timestamp\":\"2019-08-24T14:15:22Z\",\"signature\":\"string\"}"

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

conn.request("POST", "/v1/apis/login", payload, headers)

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

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

Get new token

Note

The validity of JWT token is for 1 hour. The parameter refreshToken allows to extend the session by renewing the JWT token from the server side before the existing token expires.

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/apis/getnewtoken");
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", "{\"refreshToken\":\"string\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/resellingapi/v1/apis/getnewtoken")
  .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("{\"refreshToken\":\"string\"}")
  .asString();
Request
const data = "{\"refreshToken\":\"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/resellingapi/v1/apis/getnewtoken");
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/resellingapi")

payload = "{\"refreshToken\":\"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/apis/getnewtoken", payload, headers)

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

print(data.decode("utf-8"))
Response
{"token":"string"}

Venues

Search venues

Query parameters

Name

Type

Required

Description

type

integer

false

Filter venues by type.

Possible values:

0 = Amusement park

1 = Attraction

2 = Aquarium

3 = Museum

4 = Zoo

5 = Others

city

string

false

Filter venues by city name.

page

integer

false

The start page number for the range to show in the response. If omitted, all venues will be displayed on a single page.

perpage

integer

false

Number of results per page. If omitted, all the results will be displayed on a single page.

searchterm

string

false

Filter results by venue name using the provided search term.

orderby

string

false

Sorting order of the results by venue name or venue ID.

Possible values:

Name Desc

Name Asc

Id Desc

Id Asc

Note

The parameters page and perpage are optional. However, if value for one of the parameters is provided, it is mandatory to provide value for the other parameter as well.

Link relationship types

Relationship

Description

self

Get information about the call itself. Use the self link returned by API request to get more information about the venue.

Format:GET {url}/v1/venues/{VenueId}

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Responses

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

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

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

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

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "name": "string",
      "city": "string",
      "type": 0,
      "logoImageUrl": "string",
      "isPartner": boolean,
      "links": [
         {
            "href": "string", //// Sample href : /v1/venues/1
            "rel": "string", //// description/information about href link (i.e. self (get details))
            "method": "string"
         }
      ]
   },  
   {            
        "id": "integer",            
        "name": "string",            
        "city": "string",            
        "type": "integer",            
        "logoImageUrl":"string",            
        "isPartner": "boolean",            
        "links":            
    [                     
        {                           
            "href": "string",   //// Sample href : /v1/venues/1                    
            "rel": "string"     //// description/information about href link (i.e. self (get details))               
            "method": "string"                
        }
    ]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch venue information

URL parameter

Name

Type

Required

Description

id

integer

true

The venue ID to retrieve information for.

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

8001

400

The requested profile does not exist.

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

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

conn.request("GET", "/v1/venues/0", headers=headers)

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

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "name": "string",
   "description": "string",
   "type": 0,
   "barcodeFormat": "string", // e.g. 'QRCode|Code128'. This means that the venue supports both the types of barcode format.
   "logoImageUrl": "string",
   "coverImageUrl": "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",
   "contact": "string"
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch venue offers

URL parameter

Name

Type

Required

Description

id

integer

true

The venue ID to retrieve offers for.

Query parameters

Name

Type

Required

Description

page

integer

false

The start page number for the range to show in the response. If omitted, all the results will be displayed on a single page.

perpage

integer

false

Number of results per page. If omitted, all the results will be displayed on a single page.

searchterm

string

false

Filter results by offer name using the provided search term.

orderby

string

false

Sorting order of the results by offer name or offer ID.

Possible values:

Name Desc

Name Asc

StartDate Desc

StartDate Asc

Default: Name Asc

Note

The parameters page and perpageare optional. However, if value for one of the parameters is provided, it is mandatory to provide value for the other parameter as well.

Link relationship types

Relationship

Description

self

Get information about the call itself.

Use the self link returned by API request to get more information about the offer.

Format:GET {url}/v1/offers/{OfferId}

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

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

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

conn.request("GET", "/v1/venues/0/offers", headers=headers)

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "name": "string",
      "description": "string",
      "startDate": "2020-10-09T12:34:09.543Z",
      "endDate": "2020-10-09T12:34:09.543Z",
      "salesStartDate": "2020-10-09T12:34:09.543Z",
      "salesEndDate": "2020-10-09T12:34:09.543Z",
      "imageUrl": "string",
      "status": 0,
      "venue": {
         "id": 0,
         "name": "string",
         "logoImageUrl": "string",
         "addressLine1": "string",
         "addressLine2": "string",
         "locality": "string",
         "postalCode": "string",
         "country": "string",
         "locale": {
            "culture": "string",
            "timezoneId": "string",
            "currencySymbol": "string",
            "isoCurrencySymbol": "string",
            "timeZoneOffset": "string"
         }
      },
      "links": 
      [
         {
            "href": "string",
            "rel": "string",
            "method": "string"
         }
      ]
    },
    {
        "id": "integer",        
        "name": "string",        
        "description": "string",        
        "startDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "endDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "salesStartDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "salesEndDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "imageUrl": "string",        
        "status": "string",        
        "venue":{            
            "id": "integer",            
            "name": "string",            
            "logoImageUrl":"string",            
            "addressLine1": "string",            
            "addressLine2": "string",            
            "locality": "string",            
            "postalCode": "string",            
            "country": "string",            
            "locale":{                 
                "culture": "string",                 
                "timezoneId": "string",                 
                "currencySymbol": "string",                 
                "isoCurrencySymbol": "string",                 
                "timeZoneOffset": "string"                     
            }        
        },              
        "links":            
        [                
            {                
                "href": "string",                
                "rel": "string",                
                "method": "string"            
             }
         ]
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch venue logo image

Response

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/venues/0/logoimages/exampleimage.jpg");
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/resellingapi/v1/venues/0/logoimages/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/resellingapi/v1/venues/0/logoimages/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/resellingapi")

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

conn.request("GET", "/v1/venues/0/logoimages/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
      }
   ]
}

Fetch venue cover image

Responses

Success response code: 200 OK

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/venues/0/coverimages/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/resellingapi/v1/venues/0/coverimages/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("GET", "https://api.staging-enviso.io/resellingapi/v1/venues/0/coverimages/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/resellingapi")

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

conn.request("GET", "/v1/venues/0/coverimages/string", headers=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
    }
  ]
}

Offers

Note

Please note that Reselling API v1 does not support regular offers with guide, group offers, and voucher offers. If you wish to use them, please switch to Reselling API v2.

Search offers

Query parameters

Name

Type

Required

Description

fromdate

date

false

Filter offer from date.

todate

date

false

Filter offer end date.

page

integer

false

Start page number for the range to show in the response.

If omitted, all the results will be displayed on a single page.

perpage

integer

false

Number of results per page.

If omitted, all the results will be displayed on a single page.

searchterm

string

false

Filter results by offer name using the provided search term.

orderby

string

false

Sorting order of the results by offer name or offer ID.

Possible values:

Name Desc

Name Asc

StartDate Desc

StartDate Asc

status

integer

false

Filter on offer status

1 = Available

4 = Expired

Note

The parameters page and perpage are optional. However, if value for one of the parameters is provided, it is mandatory to provide value for the other parameter as well.

Link relationship types

Relationship

Description

self

Get information about the call itself.

Use the self link returned by API request to get more information about the offer.

Format:GET {url}/v1/offers/{OfferId}

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get a result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

1007

400

From date cannot be greater than the To date.

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

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

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

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "name": "string",
      "description": "string",
      "startDate": "2020-10-09T12:38:54.400Z", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
      "endDate": "2020-10-09T12:38:54.400Z", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
      "salesStartDate": "2020-10-09T12:38:54.400Z", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
      "salesEndDate": "2020-10-09T12:38:54.400Z", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
      "imageUrl": "string",
      "status": 0,
      "venue": {
         "id": 0,
         "name": "string",
         "logoImageUrl": "string",
         "addressLine1": "string",
         "addressLine2": "string",
         "locality": "string",
         "postalCode": "string",
         "country": "string",
         "locale": {
            "culture": "string",
            "timezoneId": "string",
            "currencySymbol": "string",
            "isoCurrencySymbol": "string",
            "timeZoneOffset": "string"
         }
      },
      "links": 
     [
         {
            "href": "string",
            "rel": "string",
            "method": "string"
         }
       ]
    },
    {        
        "id": "integer",        
        "name": "string",        
        "description": "string",        
        "startDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "endDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "salesStartDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "salesEndDate": "datetime", //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")        
        "imageUrl": "string",        
        "status": "integer",        
        "venue": {            
            "id": "integer",            
            "name": "string",            
            "logoImageUrl":"string",            
            "addressLine1": "string",            
            "addressLine2": "string",            
            "locality": "string",            
            "postalCode": "string",            
            "country": "string",            
            "locale"{                 
                "culture": "string",                 
                "timezoneId": "string",                 
                "currencySymbol": "string",                 
                "isoCurrencySymbol": "string",                 
                "timeZoneOffset": "string"             
            }        
        },              
        "links":        
        [                
            {                      
                "href": "string",                
                "rel": "string",                
                "method": "string"            
            }        
        ]    
    }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch offer information

URL parameter

Name

Type

Required

Description

id

integer

true

The offer ID to retrieve information for.

Query parameter

Name

Type

Required

Description

includetimeslots

boolean

false

The parameter for adding time slots in offer details.

Default value: False

Capacity types for the 'capacityAllocation → type' in the response

Capacity Type Value

Capacity Type Code

1

TOTAL

2

PER_DAY

3

PER_SLOT

Caution

The field capacityAllocation will be obsolete in the future release.

Response

Success response code: 200 OK

Possible error

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

Remark

id

This refers to the Offer's ID.

productId

The id in the product section refers to the Enviso-generated product ID.

id - In the product section

The id in the Product section is used to reserve a particular product.

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

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

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

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

print(data.decode("utf-8"))
Response
json
{
    "id": "integer",
    "name": "string",
    "description": "string",
	"type": "integer",					//// Offer type: 1-Regular, 2-Group
	"ticketType": "integer",			//// Ticket type: 1-per person, 2-Group
    "startDate": "datetime",            //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "endDate": "datetime",              //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "salesStartDate": "datetime",       //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "salesEndDate": "datetime",         //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "imageUrl": "string",
    "status": "integer",  
	"event": {
        "id": "integer",
        "name": "string"
    },
    "venue": {
        "id": "integer",
        "name": "string",
		"logoImageUrl":"string",
        "addressLine1": "string",
        "addressLine2": "string",
        "postalCode": "string",
        "locality": "string",
        "country": "string",
		"locale": {
            "culture": "string",
            "timezoneId": "string",
            "currencySymbol": "string",
            "isoCurrencySymbol": "string",
            "timeZoneOffset": "string"
        }
    },
    "products": [{
            "id": "integer",
            "name": "string",
            "price": "decimal",
			"partnerPrice":"decimal" // Price set by venue
        },
        {
            "id": "integer",
            "name": "string",
            "price": "decimal",
			"partnerPrice":"decimal", // Price set by venue
			"isEnabled": "boolean",
            "productId": "integer" 
        }
    ],
	"groupSize": "integer",
    "minimumVisitorPerVisit": "integer",
    "languages": [],
    "guideRequired": "boolean",
	"groupServiceFee": "decimal"
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch offer timeslots

URL parameter

Name

Type

Required

Description

id

integer

true

The offer ID to retrieve information for.

Query parameters

Name

Type

Required

Description

fromdate

datetime

false

Filter timeslots fromdate.

Acceptable formats:

yyyy-MM-ddTHH:mm:ssZ

yyyy-MM-dd HH:mm:ss

Note

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

todate

datetime

false

Filter timeslots todate.

Acceptable formats:

yyyy-MM-ddTHH:mm:ssZ

yyyy-MM-dd HH:mm:ss

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 errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1005

400

The provided value for <field> is not valid.

1007

400

From date cannot be greater than the To date.

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

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

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

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "slotDate": "2020-10-09T13:01:21.413Z", //// DateTime Format : yyyy-MM-dd (i.e. "2017-11-23")
      "startTime": "2020-10-09T13:01:21.413Z",
      "endTime": "2020-10-09T13:01:21.413Z"
   },
   {        
      "id": "integer",        
      "slotDate": "date", //// DateTime Format : yyyy-MM-dd (i.e. "2017-11-23")        
      "startTime": "string",         
      "endTime": "string"
    }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch offer image

Response

Success response code: 200 OK

It will return base46 string of LogoImage.

Request
var client = new RestClient("https://example.com/v1/venues/0/offers/0/images/exampleimage.jpg");
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://example.com/v1/venues/0/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://example.com/v1/venues/0/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("example.com")

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

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

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

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

Check offer capacity/availability

URL parameter

Name

Type

Required

Description

id

integer

true

The offer ID to retrieve available capacity for.

Query parameters

Name

Type

Required

Description

timeslotid

integer

false

The time slot ID to retrieve offer capacity for.

Use to get results when offer capacity is defined slot-wise, that is PER_SLOT.

The value of time slot ID must be greater than 0.

Capacity for time slots with current or future dates will be retrieved, even if the slot time has elapsed for the current date.

visitdate

date

false

The date to retrieve offer capacity for.

Format: yyyy-MM-dd

Use it to get results when offer capacity is defined day-wise, that is, PER_DAY. The provided visit date must not be in the past.

Capacity types for the 'capacities → type' in the response

Capacity Type Value

Capacity Type Code

1

TOTAL

2

PER_DAY

3

PER_SLOT

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

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1005

400

The provided value for <field> is not valid.

4001

400

Offer ID {offerId} is not valid.

4006

400

Timeslot ID is not valid.

4021

400

Timeslot ID is not in the offer period.

4023

400

Visit date is not in the offer period.

4048

400

<field> cannot be in the past.

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

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

conn.request("GET", "/v1/offers/0/capacity", headers=headers)

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

print(data.decode("utf-8"))
Response
{
   "id": 0, // offer ID
   "capacities": [
      {
         "availableQuantity": 0, // if availableQuantity is -1, then you can sell unlimited quantity.
         "allocatedQuantity": 0, // if allocatedQuantity is -1, then you can sell unlimited quantity.
         "type": 0, // Capacity type   //// (i.e. "PER_DAY")
         "visitDate": "2020-10-09T13:09:38.752Z", // Capacity will be date wise if capacity type is PER_DAY.   //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
         "timeSlotId": 0, // Capacity will be slot wise if capacity type is PER_SLOT.
         "sharedAllocation": true // if sharedAllocation is 'true' then capacity is shared with other users so they can use/reserve capacity.
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Check offer capacity/availability for date range

URL parameter

Name

Type

Required

Description

id

integer

true

The offer ID to retrieve available capacity for.

Query parameters

Name

Type

Required

Description

visitdate

date

false

The date to retrieve offer capacity for.

Use to get results when offer capacity is defined day-wise, that is, PER_DAY.

The provided visit date must not be in the past.

Format: yyyy-MM-dd

timeslotid

integer

false

The time slot ID to retrieve offer capacity for.

Use to get results when offer capacity is defined slot-wise, that is PER_SLOT.

The value of time slot ID must be greater than 0.

Capacity for time slots with current or future dates will be retrieved, even if the slot time has elapsed for the current date.

fromdate

date

false

The start date of the date range for which offer capacity is to be retrieved.

fromdate must not be in the past.

fromdate is required if todate is provided.

Format: yyyy-MM-dd

todate

date

false

The end date of the date range for which offer capacity is to be retrieved.

todate must not be less than fromdate.

Format: yyyy-MM-dd

Note

  • Instead of fetching offer capacity for multiple dates individually, it is recommended to fetch offer capacity for a date range.

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

Visualisation of response parameters per capacity type

tick.png = The parameter will be shown

cross.png = The parameter will not be shown

Response parameter

TOTAL

PER_DAY

PER_SLOT

availableQuantity

tick.png

tick.png

tick.png

date

cross.png

tick.png

cross.png

timeSlotId

cross.png

cross.png

tick.png

Capacity types for the 'capacities → type' in the response

Capacity Type Value

Capacity Type Code

1

TOTAL

2

PER_DAY

3

PER_SLOT

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1005

400

The provided value for <field> is not valid.

1007

400

The To date cannot be less than the From date.

1012

400

Please provide valid query parameter to check capacity.

4001

400

Offer ID {offerId} is not valid.

4006

400

Timeslot ID is not valid.

4021

400

Timeslot ID is not in the offer period.

4023

400

Visit date is not in the offer period.

4048

400

<field> cannot be in the past.

4083

400

The date range must not be more than <maximum_number> days.

4085

400

The date range is not in the offer period.

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

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

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

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

print(data.decode("utf-8"))
Response
{
   "id": 0, // offer ID
   "allocatedQuantity": 0, // if allocatedQuantity is -1, then you can sell unlimited quantity.
   "type": 0, // Capacity type   //// (i.e. 2 for "PER_DAY")
   "sharedAllocation": boolean, // if sharedAllocation is 'true' then capacity is shared with other users so they can use/reserve capacity.
   "capacities": [
      {
         "availableQuantity": 0, // if availableQuantity is -1, then you can sell unlimited quantity.
         "date": "2020-10-09T13:07:58.623Z", // Date Format : yyyy-MM-dd (i.e. "2017-11-23")
         "timeSlotId": 0
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Products

Note

Please note that price rules are not applicable in Reselling API v1. To sell offers based on the venue’s price rules, please switch to Reselling API v2.

Reserve product

URL parameter

Name

Type

Required

Description

id

integer

true

ID of the product to be reserved.

Query parameter

Name

Type

Required

Description

reservetime

integer

false

The reservation time for the reserved product.

The reservation time can only be set in minutes.

Default reservation time: 30 minutes

Request fields

Field

Type

Required

Description

quantity

integer

true

Product quantity to be reserved.

visitDate

date

true

Reservation date of the product.

Providing visitDate is not required for products belonging to offer with PER_SLOT frequency.

Format: yyyy-MM-dd

timeSlotId

integer

false

ID of the time slot for which the product is to be reserved.

Providing timeslotId is mandatory for products belonging to offer with PER_SLOT frequency.

Link relationship types

Relationship

Description

URL

update

Update reserved product details.

PUT {url}/v1/products/{productId}/reservations/{reservationId}

update bulk

Update details of multiple reserved products.

PUT {url}/v1/products/reservations

delete

Delete reserved product.

DELETE {url}/v1/products/{productId}/reservations/{reservationId}

delete bulk

Delete multiple reserved products.

DELETE {url}/v1/products/reservations

Response

Success response code: 201 CREATED

Possible errors

Code

HTTP status code

Message

1001

422

<field> is required.

1003

400

<field> must be greater than 0.

4002

422

Product ID {productId} is not valid.

4006

422

Timeslot ID is not valid.

4007

422

Timeslot ID cannot be in the past.

4008

422

Tickets are not available in the requested quantity.

4010

422

Product ID {productId} cannot be reserved as the sales period has not started.

4011

422

Product ID {productId} cannot be reserved as the offer period has elapsed.

4012

422

Product ID {productId} cannot be reserved as the sales period has elapsed.

4021

422

Timeslot ID is not in the offer period.

4022

400

Visit date cannot be in the past.

4023

422

Visit date is not in the offer period.

4092

400

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

4095

400

Either visitdate or timeslotid should be passed.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/products/0/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", "{\"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/resellingapi/v1/products/0/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("{\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}")
  .asString();
Request
var data = "{\"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/resellingapi/v1/products/0/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/resellingapi")

payload = "{\"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/products/0/reservations", payload, headers)

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

print(data.decode("utf-8"))
Response

Response body (HTTP status: 201)

{
    "id": "integer",
    "productId": "integer",    
    "quantity": "integer",    
    "updateOn": "datetime",              //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "timeSlotId": "integer",
    "visitDate": "date",                 //// Date Format : yyyy-MM-dd (i.e. "2017-11-12")
    "reservedTimeLength": "timespan",
    "source": "string",
	"links": [
    	{
      		"href": "string",
      		"rel": "string",
      		"method": "string"
    	},
    	{
      		"href": "string",
      		"rel": "string",
      		"method": "string"
    	}
  	]
}

Response body (HTTP status: 400)

json
{
    "errors":[
		{
			"message": "string",
			"propertyName": "string",   //// Optional : When Application throw invalid data exception then this required to identity which field data is invalid.
			"code": "integer"
		},
		{
			"message": "string",
			"propertyName": "string",   //// Optional : When Application throw invalid data exception then this required to identity which field data is invalid.
			"code": "integer"
		}
	]
}

Response body (HTTP status: 422)

json
{
	"productId": "integer",
	"quantity": "integer",
	"timeSlotId": "integer",
	"visitDate": "date",          //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
	"errors": [{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Reserve products in bulk

URL parameter

Name

Type

Required

Description

reservetime

integer

false

The reservation time for the reserved product.

The reservation time can only be set in minutes.

Default reservation time: 30 minutes

Request fields

Field

Type

Required

Description

productId

integer

true

ID of the product to be reserved.

quantity

integer

true

Product quantity to be reserved.

visitDate

date

true

Reservation date of the product.

Providing visitDate is not required for products belonging to offer with PER_SLOT frequency.

Format: yyyy-MM-dd

timeSlotId

integer

false

ID of the time slot for which the product is to be reserved.

Providing timeslotid is mandatory for products belonging to offer with PER_SLOT frequency.

Link relationship types

Relationship

Description

URL

update

Update reserved product details.

PUT {url}/v1/products/{productId}/reservations/{reservationId}

update bulk

Update details of multiple reserved products.

PUT {url}/v1/products/reservations

delete

Delete reserved product.

DELETE {url}/v1/products/{productId}/reservations/{reservationId}

delete bulk

Delete multiple reserved products.

DELETE {url}/v1/products/reservations

Response

Success response code: 201 CREATED

Possible errors

Code

HTTP status code

Message

1001

422

<field> is required.

1003

400

<field> must be greater than 0.

4002

422

Product ID {productId} is not valid.

4006

422

Timeslot ID is not valid.

4007

422

Timeslot ID cannot be in the past.

4008

422

Tickets are not available in the requested quantity.

4010

422

Product ID {productId} cannot be reserved as the sales period has not started.

4011

422

Product ID {productId} cannot be reserved as the offer period has elapsed.

4012

422

Product ID {productId} cannot be reserved as the sales period has elapsed.

4021

422

Timeslot ID is not in the offer period.

4022

400

Visit date cannot be in the past.

4023

422

Visit date is not in the offer period.

4092

400

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

4094

400

Product ID with same date & time exists.

4095

400

Either visitdate or timeslotid should be passed.

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

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/products/reservations", payload, headers)

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

print(data.decode("utf-8"))
Response

Response body (HTTP status: 201)

[{
	"id": "integer",
	"productId": "integer",
	"quantity": "integer",
	"updateOn": "datetime",               //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
	"timeSlotId": "integer",
	"visitDate": "date",                  //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
	"reservedTimeLength": "timespan",
    "source": "string",
	"links": [{
		"href": "string",
		"rel": "string",
		"method": "string"
	}, {
		"href": "string",
		"rel": "string",
		"method": "string"
	}]
}, 
{
	"id": "integer",
	"productId": "integer",
	"quantity": "integer",
	"updateOn": "datetime",            //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
	"timeSlotId": "integer",
	"visitDate": "date",               //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
	"reservedTimeLength": "timespan",
    "source": "string",
	"links": [{
		"href": "string",
		"rel": "string",
		"method": "string"
	}, {
		"href": "string",
		"rel": "string",
		"method": "string"
	}]
}]

Response body (HTTP status: 400)

json
{
	"errors": [{
		"message": "string",
		"code": "integer"
	}, 
	{
		"message": "string",
		"code": "integer"
	}]
}

Response body (HTTP status: 422)

json
[{
	"productId": "integer",
	"quantity": "integer",
	"timeSlotId": "integer",
	"visitDate": "date",             //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
	"errors": [{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
},
{
	"productId": "integer",
	"quantity": "integer",
	"timeSlotId": "integer",
	"visitDate": "date",            //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
	"errors": [{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}]

Update reserved product

URL parameters

Name

Type

Required

Description

id

integer

true

ID of the product which is reserved.

reservationid

integer

true

Reservation ID of the product which is to be updated.

Request fields

Field

Type

Required

Description

quantity

integer

true

Product quantity to be reserved.

visitDate

date

true

Reservation date of the product.

Providing visitDate is not required for products belonging to offer with PER_SLOT frequency.

Format: yyyy-MM-dd

timeSlotId

integer

false

ID of the time slot for which the product is to be reserved.

Providing timeslotId is mandatory for products belonging to offer with PER_SLOT frequency.

Link relationship types

Relationship

Description

URL

update

Update reserved product details.

PUT {url}/v1/products/{productId}/reservations/{reservationId}

update bulk

Update details of multiple reserved products.

PUT {url}/v1/products/reservations

delete

Delete reserved product.

DELETE {url}/v1/products/{productId}/reservations/{reservationId}

delete bulk

Delete multiple reserved products.

DELETE {url}/v1/products/reservations

Response

Success response code: 200 OK

Possible error codes

Code

HTTP status code

Message

1001

422

<field> is required.

1003

422

<field> must be greater than 0.

4003

422

Reservation ID {reservedId} is not valid.

4006

422

Timeslot ID is not valid.

4007

422

Timeslot ID cannot be in the past.

4008

422

Tickets are not available in the requested quantity.

4011

422

Product ID {productId} cannot be reserved as the offer period has elapsed.

4012

422

Product ID {productId} cannot be reserved as the sales period has elapsed.

4013

422

Reservation ID {reservedId} has expired.

4014

422

Reservation ID and/or Product ID are invalid.

4021

422

Timeslot ID is not in the offer period.

4022

400

Visit date cannot be in the past.

4023

422

Visit date is not in the offer period.

4092

400

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

4095

400

Either visitdate or timeslotid should be passed.

4109

422

Product ID {productId} cannot be reserved as the offer has expired.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/products/0/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,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/resellingapi/v1/products/0/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,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}")
  .asString();
Request
var data = "{\"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("PUT", "https://api.staging-enviso.io/resellingapi/v1/products/0/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/resellingapi")

payload = "{\"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("PUT", "/v1/products/0/reservations/0", payload, headers)

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

print(data.decode("utf-8"))
Response

Response body (HTTP status: 200)

{
    "id": "integer",
    "productId": "integer",    
    "quantity": "integer",    
    "updateOn": "datetime",                  //// DateTime Format : yyyy-MM-dd HH:mm:ss (i.e. "2017-11-23 15:30:00")
    "timeSlotId": "integer", 
    "visitDate": "date",                     //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
    "reservedTimeLength": "timespan",
    "source": "string",
	"links": [
    	{
      		"href": "string",
      		"rel": "string",
      		"method": "string"
    	},
    	{
      		"href": "string",
      		"rel": "string",
      		"method": "string"
    	}
  	]
}

Response body (HTTP status: 400)

json
{
    "errors":[
		{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Response body (HTTP status: 422)

json
{
	"id": "integer",
	"productId": "integer",
	"quantity": "integer",
	"timeSlotId": "integer",
	"visitDate": "date",         //// Date Format : yyyy-MM-dd (i.e. "2017-11-23")
	"errors": [{
			"message": "string",
			"code": "integer"
		},
		{
			"message": "string",
			"code": "integer"
		}
	]
}

Update reserved products in bulk

Request fields

Field

Type

Required

Description

id

integer

true

Reservation ID which is to be updated.

productId

integer

true

ID of the product to be reserved.

quantity

integer

true

Product quantity to be reserved.

visitDate

date

true

Reservation date of the product.

Providing visitDate is not required for products belonging to offer with PER_SLOT frequency.

Format: yyyy-MM-dd

timeSlotId

integer

false

ID of the time slot for which the product is to be reserved.

Providing timeslotId is mandatory for products belonging to offer with PER_SLOT frequency.

Link relationship types

Relationship

Description

URL

update

Update reserved product details.

PUT {url}/v1/products/{productId}/reservations/{reservationId}

update bulk

Update details of multiple reserved products.

PUT {url}/v1/products/reservations

delete

Delete reserved product.

DELETE {url}/v1/products/{productId}/reservations/{reservationId}

delete bulk

Delete multiple reserved products.

DELETE {url}/v1/products/reservations

Response

Success response code: 200 OK

Possible error codes

Code

HTTP status code

Message

1001

422

<field> is required.

1003

400

<field> must be greater than 0.

4003

422

Reservation ID {reservedId} is not valid.

4006

422

Timeslot ID is not valid.

4007

422

Timeslot ID cannot be in the past.

4008

422

Tickets are not available in the requested quantity.

4011

422

Product ID {productId} cannot be reserved as the offer period has elapsed.

4012

42

Product ID {productId} cannot be reserved as the sales period has elapsed.

4013

422

Reservation ID {reservedId} has expired.

4014

422

Reservation ID and/or Product ID are invalid.

4021

422

Timeslot ID is not in the offer period.

4022

400

Visit date cannot be in the past.

4023

422

Visit date is not in the offer period.

4091

400

Duplicate Reservation ID found.

4092

400

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

4095

400

Either visitdate or timeslotid should be passed.

4109

422

Product ID {productId} cannot be reserved as the offer has expired.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/products/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,\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/resellingapi/v1/products/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,\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]")
  .asString();
Request
var data = "[{\"id\":0,\"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("PUT", "https://api.staging-enviso.io/resellingapi/v1/products/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/resellingapi")

payload = "[{\"id\":0,\"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("PUT", "/v1/products/reservations", payload, headers)

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "productId": 0,
      "quantity": 0,
      "updateOn": "2020-10-09T13:30:37.243Z",
      "timeSlotId": 0,
      "visitDate": "2020-10-09T13:30:37.243Z",
      "reservedTimeLength": "string",
      "source": "string",
      "links": [
         {
            "href": "string",
            "rel": "string",
            "method": "string"
         }
      ]
   }
]
json
[
   {
      "id": 0,
      "productId": 0,
      "quantity": 0,
      "visitDate": "2020-10-09T13:30:37.286Z",
      "timeSlotId": 0,
      "errors": [
         {
            "message": "string",
            "propertyName": "string",
            "code": 0
         }
      ]
   }
]

json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Delete reserved product

URL parameters

Name

Type

Required

Description

id

integer

true

ID of the product which is reserved.

reservationid

integer

true

Reservation ID of the product which is to be deleted.

Response

Success response code: 204 NO CONTENT

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

4003

400

Reservation ID {reservedId} is not valid.

4014

400

Reservation ID and/or Product ID are invalid.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/products/0/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/resellingapi/v1/products/0/reservations/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("DELETE", "https://api.staging-enviso.io/resellingapi/v1/products/0/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/resellingapi")

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

conn.request("DELETE", "/v1/products/0/reservations/0", headers=headers)

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

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

Delete reserved products in bulk

Request field

Name

Type

Required

Description

reservationIds

integer

true

Array of reservation IDs which are to be deleted.

Response

Success response code: 204 NO CONTENT

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

4003

400

Reservation ID {reservedId} is not valid.

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

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/products/reservations", payload, headers)

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

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

Reservations

Fetch reservations

Link relationship types

Relationship

Description

URL

update

Update reserved product details.

PUT {url}/v1/products/{productId}/reservations/{reservationId}

update bulk

Update details of multiple reserved products.

PUT {url}/v1/products/reservations

delete

Delete reserved product.

DELETE {url}/v1/products/{productId}/reservations/{reservationId}

delete bulk

Delete multiple reserved products.

DELETE {url}/v1/products/reservations

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

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

conn.request("GET", "/v1/reservations", headers=headers)

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "quantity": 0,
      "updateOn": "2020-10-09T13:46:36.017Z",
      "timeSlotId": 0,
      "visitDate": "2020-10-09T13:46:36.017Z",
      "reservedTimeLength": "string",
      "source": "string",
      "product": {
         "offer": {
            "id": 0,
            "name": "string",
            "description": "string",
            "startDate": "2020-10-09T13:46:36.017Z",
            "endDate": "2020-10-09T13:46:36.017Z"
         },
         "id": 0,
         "name": "string",
         "price": 0
      },
      "links": [
         {
            "href": "string",
            "rel": "string",
            "method": "string"
         }
      ]
   }
]
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Orders

Place order

Query parameter

Name

Type

Required

Description

referenceid

string

false

The reseller’s reference order ID to be linked with the order placed using the Reselling API.

Note

The maximum limit for referenceid is 50 characters.

Request fields

Name

Type

Required

Description

orderItems

object

true

Product item(s) in an order.

The product could be a reserved product or a product that does not require reservation for placing an order.

reservationId

integer

true

ID of the reservation for a reserved product for which order is to be placed.

preferredLanguage

string

false

Two-letter ISO language code of the preferred guide language.

Example: "preferredLanguage": "nl"

visitor

object

false

Visitor information fields while placing the order.

channelName

string

false

Reseller's sales channel name from where the order is placed.

Possible values:

  • POS

  • WebPortal

  • Kiosk

  • Other

organizationName

string

false

Name of the organisation for whom order is placed.

organizationName is required if groupVisit = true

firstName

string

false

First name of the visitor.

lastName

string

false

Last name of the visitor.

email

string

false

Email address of the visitor.

email is required in either of the following cases:

groupVisit = true

groupVisit = false and firstname is provided

contact

string

false

Contact number of the visitor.

contact is required if groupVisit = true

Note

The contact number must not exceed 15 characters.

city

string

false

City of the visitor.

postalcode

string

false

Postal code of the visitor.

postalcode is required if city is provided.

countryName

string

true

Country name of the visitor.

groupVisit

boolean

false

A visit type wherein the order is placed on behalf of an organisation.

if groupVisit = false, then the order is considered as individual visit. In this case, the order is confirmed and the response will contain ticket barcode.

if groupVisit = true, then order is considered as group visit. In this case, the order status will be reserved. The order has to be confirmed to get barcode ticket.

Important to know about Response:
  • The ticket barcode string provided by the field barcodeString can be converted into any barcode types (e.g. QR Code, Code128, etc.). The field barcodeFormat does not have any impact on the ticket barcode. This field will be obsolete and removed in the future releases.

  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00.

    • Eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId.

    • Eg: 2017-11-24 16:30:00

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Link relationship types

Relationship

Description

URL

self

Get information about the call itself.

Use the self link returned by API request to get more information about the order.

GET {url}/v1/orders/{orderId}

cancel

Cancel order using this link.

PUT {URL}/v1/orders/{orderId}/cancel

link

Link order reference ID using this link.

POST {url}/v1/orders/{orderId}/link

Response

Success response code: 201 CREATED

Code

HTTP status code

Message

1001

400

<field> is required.

1003

422

<field> must be greater than 0.

1006

422

Please enter a valid email address.

1008

400

<field> must not exceed {maxlimit} characters.

4003

422

Reservation ID {reservedId} is not valid.

4013

422

Reservation ID {reservedId} has expired.

4081

422

Cannot place order as currency of reservations are different.

4087

422

Group visit for multiple venues cannot be reserved.

4091

400

Duplicate Reservation ID found.

4093

400

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

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/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}],\"preferredLanguage\":\"string\",\"channelName\":\"string\",\"visitor\":{\"organizationName\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"country\":\"string\",\"address\":{\"city\":\"string\",\"postalcode\":\"string\"}},\"countryName\":\"string\",\"groupVisit\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/resellingapi/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}],\"preferredLanguage\":\"string\",\"channelName\":\"string\",\"visitor\":{\"organizationName\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"country\":\"string\",\"address\":{\"city\":\"string\",\"postalcode\":\"string\"}},\"countryName\":\"string\",\"groupVisit\":true}")
  .asString();
Request
var data = "{\"orderItems\":[{\"reservationId\":0}],\"preferredLanguage\":\"string\",\"channelName\":\"string\",\"visitor\":{\"organizationName\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"country\":\"string\",\"address\":{\"city\":\"string\",\"postalcode\":\"string\"}},\"countryName\":\"string\",\"groupVisit\":true}";

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

payload = "{\"orderItems\":[{\"reservationId\":0}],\"preferredLanguage\":\"string\",\"channelName\":\"string\",\"visitor\":{\"organizationName\":\"string\",\"firstName\":\"string\",\"lastName\":\"string\",\"email\":\"string\",\"contact\":\"string\",\"country\":\"string\",\"address\":{\"city\":\"string\",\"postalcode\":\"string\"}},\"countryName\":\"string\",\"groupVisit\":true}"

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",
   "status": 0,
   "amount": 0,
   "preferredLanguage": "string",
   "channelName": "string",
   "source": "string",
   "referenceId": "string",
   "createdOn": "2020-10-09T13:51:37.836Z",
   "lastUpdatedOn": "2020-10-09T13:51:37.836Z",
   "currencyInfo": {
      "currencySymbol": "string",
      "isoCurrencySymbol": "string"
   },
   "payment": {
      "method": "string",
      "otherMethodName": "string"
   },
   "orderItems": [
      {
         "id": 0,
         "unitPrice": 0,
         "quantity": 0,
         "totalPrice": 0,
         "visitDate": "2020-10-09T13:51:37.836Z",
         "timeSlotId": 0,
         "product": {
            "id": 0,
            "name": "string",
            "price": 0
         },
         "ticketBarcodes": [
            {
               "barcodeFormat": "string",
               "barcodeString": "string"
            }
         ]
      }
   ],
   "visitor": {
      "organizationName": "string",
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "contact": "string",
      "country": "string",
      "address": {
         "city": "string",
         "postalcode": "string"
      }
   },
   "links": [
      {
         "href": "string",
         "rel": "string",
         "method": "string"
      }
   ]
}
json
[
   {
      "reservationId": 0,
      "errors": [
         {
            "message": "string",
            "propertyName": "string",
            "code": 0
         }
      ]
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Link order reference

URL parameter

Name

Type

Required

Description

id

integer

true

The reseller’s reference order ID to be linked with the order placed using the Reselling API.

Note

The maximum limit for referenceid is 50 characters.

Query parameter

Name

Type

Required

Description

referenceid

string

true

The reseller’s reference order ID to be linked with the order placed using the Reselling API.

Response

Success response code: 201 CREATED

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1008

400

<field> must not exceed {maxlimit} characters.

4004

400

Order ID {orderId} is not valid.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/orders/0/link");
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-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.post("https://api.staging-enviso.io/resellingapi/v1/orders/0/link")
  .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("POST", "https://api.staging-enviso.io/resellingapi/v1/orders/0/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/resellingapi")

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

conn.request("POST", "/v1/orders/0/link", headers=headers)

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

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

Fetch orders

Query parameter

Name

Type

Required

Description

page

integer

false

The start page number for the range to show in the response. If omitted, only records of the first page will be shown.

perpage

integer

false

Number of results per page. If omitted, only the first 50 records will be shown.

orderby

string

false

Sorting order of the results.

Possible values:

Id Asc

Id Desc

Amount Asc

Amount Desc

LastUpdatedOn Asc

LastUpdatedOn Desc

fromdate

string

false

The start date for the range to show in the response.

Format: yyyy-MM-dd

todate

string

false

The end date for the range to show in the response.

Format: yyyy-MM-dd

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Link relationship types

Relationship

Description

self

Get information about the call itself.

Use the self link returned by API request to get more information about the order.

URL: GET {url}/v1/orders/{orderId}

cancel

Cancel order using this link.

URL: PUT {url}/v1/orders/{orderId}/cancel

link

Link order reference ID using this link.

URL: POST {url}/v1/orders/{orderId}/link

first

Navigate to the first page of the result list.

Method: GET

previous

Navigate to the previous page of the result list.

Method: GET

current

Get result list of the current request.

Method: GET

next

Navigate to the next page of the result list.

Method: GET

last

Navigate to the last page of the result list.

Method: GET

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

1007

400

From date cannot be greater than the To date.

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

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

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

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

print(data.decode("utf-8"))
Response
[
   {
      "id": 0,
      "number": "string",
      "status": 0,
      "createdOn": "2020-10-09T13:58:57.929Z",
      "lastUpdatedOn": "2020-10-09T13:58:57.929Z",
      "amount": 0,
      "quantity": 0,
      "paymentMethod": "string",
      "channelName": "string",
      "source": "string",
      "referenceId": "string",
      "visitType": "string",
      "currencyInfo": {
         "currencySymbol": "string",
         "isoCurrencySymbol": "string"
      },
      "links": [
         {
            "href": "string",
            "rel": "string",
            "method": "string"
         }
      ]
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Fetch order information

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to retrieve information for.

Import things to know about Response:
  • The ticket barcode string provided by the field barcodeString can be converted into any barcode types (e.g. QR Code, Code128, etc.). The field barcodeFormat does not have any impact on the ticket barcode. This field will be obsolete and removed in the future releases.

  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00.

    • Eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId.

    • Eg: 2017-11-24 16:30:00

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Response

Success response code: 200 OK

Possible error

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

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

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
{
   "id": 0,
   "number": "string",
   "status": 0,
   "amount": 0,
   "preferredLanguage": "string",
   "channelName": "string",
   "source": "string",
   "referenceId": "string",
   "createdOn": "2020-10-09T14:01:51.108Z",
   "lastUpdatedOn": "2020-10-09T14:01:51.108Z",
   "currencyInfo": {
      "currencySymbol": "string",
      "isoCurrencySymbol": "string"
   },
   "payment": {
      "method": "string",
      "otherMethodName": "string"
   },
   "orderItems": [
      {
         "id": 0,
         "unitPrice": 0,
         "quantity": 0,
         "totalPrice": 0,
         "visitDate": "2020-10-09T14:01:51.108Z",
         "timeSlotId": 0,
         "product": {
            "id": 0,
            "name": "string",
            "price": 0
         },
         "ticketBarcodes": [
            {
               "barcodeFormat": "string",
               "barcodeString": "string",
               "isScanned": "boolean"
            }
         ]
      }
   ],
   "visitor": {
      "organizationName": "string",
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "contact": "string",
      "country": "string",
      "address": {
         "city": "string",
         "postalcode": "string"
      }
   },
   "links": [
      {
         "href": "string",
         "rel": "string",
         "method": "string"
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Cancel order

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to be cancelled.

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

4004

400

Order ID {orderId} is not valid.

4016

400

Order is already cancelled.

4017

400

Order cannot be cancelled as the pre-bill has been generated.

4018

422

Order cannot be cancelled as the visit date has elapsed for the offer {offerName}.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/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-api-key", "API_KEY");
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/resellingapi/v1/orders/0/cancel")
  .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("PUT", "https://api.staging-enviso.io/resellingapi/v1/orders/0/cancel");
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/resellingapi")

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

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

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

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

Confirm reserved order

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to be confirmed.

Important to know about Response:
  • The ticket barcode string provided by the field barcodeString can be converted into any barcode types (e.g. QR Code, Code128, etc.). The field barcodeFormat does not have any impact on the ticket barcode. This field will be obsolete and removed in the future releases.

  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00.

    • Eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId.

    • Eg: 2017-11-24 16:30:00

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1003

400

<field> must be greater than 0.

4004

400

Order ID {orderId} is not valid.

4019

400

Order is already confirmed.

4020

400

Order is already cancelled and it cannot be confirmed.

4079

422

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

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/orders/0/confirm");
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/resellingapi/v1/orders/0/confirm")
  .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("PUT", "https://api.staging-enviso.io/resellingapi/v1/orders/0/confirm");
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/resellingapi")

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

conn.request("PUT", "/v1/orders/0/confirm", headers=headers)

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

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "number": "string",
   "status": 0,
   "amount": 0,
   "preferredLanguage": "string",
   "channelName": "string",
   "source": "string",
   "referenceId": "string",
   "createdOn": "2020-10-09T14:07:34.227Z",
   "lastUpdatedOn": "2020-10-09T14:07:34.227Z",
   "currencyInfo": {
      "currencySymbol": "string",
      "isoCurrencySymbol": "string"
   },
   "payment": {
      "method": "string",
      "otherMethodName": "string"
   },
   "orderItems": [
      {
         "id": 0,
         "unitPrice": 0,
         "quantity": 0,
         "totalPrice": 0,
         "visitDate": "2020-10-09T14:07:34.227Z",
         "timeSlotId": 0,
         "product": {
            "id": 0,
            "name": "string",
            "price": 0
         },
         "ticketBarcodes": [
            {
               "barcodeFormat": "string",
               "barcodeString": "string"
            }
         ]
      }
   ],
   "visitor": {
      "organizationName": "string",
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "contact": "string",
      "country": "string",
      "address": {
         "city": "string",
         "postalcode": "string"
      }
   },
   "links": [
      {
         "href": "string",
         "rel": "string",
         "method": "string"
      }
   ]
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ],
   "id": 0,
   "status": 0
}
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Update reserved order

URL parameter

Name

Type

Required

Description

id

integer

true

The order ID to be updated.

Note

In case the updated quantity is 0, the order line will be removed.

Request fields

Field

Type

Required

Description

productId

integer

true

ID of the product which is to be updated.

quantity

integer

true

Product quantity to be updated.

visitDate

date

true

Visit date for which product quantity is to be updated.

Providing visitDate is not required for products belonging to offer with PER_SLOT frequency.

Format: yyyy-MM-dd

timeSlotId

integer

false

ID of the time slot for which the product quantity is to be updated.

Providing timeslotid is mandatory for products belonging to offer with PER_SLOT frequency.

Important things to know about Response:
  • For offer capacity type Total and Per day, the parameter visitDate will additionally return time 00:00:00.

    • Eg: 2017-11-23 00:00:00

  • For offer capacity type Per slot, the parameter visitDate will additionally return the start time of the provided timeSlotId.

    • Eg: 2017-11-24 16:30:00

Order status for 'status' in the response

Order Type Value

Order Type Code

1

Confirmed

2

Cancelled

3

Reserved

Response

Success response code: 200 OK

Possible errors

Code

HTTP status code

Message

1001

400

<field> is required.

1003

400

<field> must be greater than 0.

1004

400

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

1005

400

The provided value for <field> is not valid.

4002

400

Product ID {productId} is not valid.

4004

400

Order ID {orderId} is not valid.

4008

422

Tickets are not available in the requested quantity.

4076

400

Order is already confirmed and it cannot be updated.

4077

400

Order is already cancelled and it cannot be updated.

4084

422

Order cannot be updated as the visit date of the offer has elapsed.

4092

400

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

4093

400

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

4094

400

Product id with same date & time exists.

4112

400

Order item/s of only one offer can be updated at a time.

4113

400

No order item is associated with the requested visitdate/timeslot.

Request
var client = new RestClient("https://api.staging-enviso.io/resellingapi/v1/orders/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", "{\"orderItems\":[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Request
HttpResponse<String> response = Unirest.put("https://api.staging-enviso.io/resellingapi/v1/orders/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("{\"orderItems\":[{\"productId\":0,\"quantity\":0,\"visitDate\":\"2019-08-24T14:15:22Z\",\"timeSlotId\":0}]}")
  .asString();
Request
var data = "{\"orderItems\":[{\"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("PUT", "https://api.staging-enviso.io/resellingapi/v1/orders/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/resellingapi")

payload = "{\"orderItems\":[{\"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("PUT", "/v1/orders/0", payload, headers)

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

print(data.decode("utf-8"))
Response
{
   "id": 0,
   "number": "string",
   "status": 0,
   "amount": 0,
   "preferredLanguage": "string",
   "channelName": "string",
   "source": "string",
   "referenceId": "string",
   "createdOn": "2020-10-09T14:11:15.002Z",
   "lastUpdatedOn": "2020-10-09T14:11:15.002Z",
   "currencyInfo": {
      "currencySymbol": "string",
      "isoCurrencySymbol": "string"
   },
   "payment": {
      "method": "string",
      "otherMethodName": "string"
   },
   "orderItems": [
      {
         "id": 0,
         "unitPrice": 0,
         "quantity": 0,
         "totalPrice": 0,
         "visitDate": "2020-10-09T14:11:15.002Z",
         "timeSlotId": 0,
         "product": {
            "id": 0,
            "name": "string",
            "price": 0
         },
         "ticketBarcodes": [
            {
               "barcodeFormat": "string",
               "barcodeString": "string"
            }
         ]
      }
   ],
   "visitor": {
      "organizationName": "string",
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "contact": "string",
      "country": "string",
      "address": {
         "city": "string",
         "postalcode": "string"
      }
   },
   "links": [
      {
         "href": "string",
         "rel": "string",
         "method": "string"
      }
   ]
}
json
[
   {
      "productId": 0,
      "quantity": 0,
      "visitDate": "2020-10-09T14:11:15.092Z",
      "timeSlotId": 0
   }
]
json
{
   "errors": [
      {
         "message": "string",
         "propertyName": "string",
         "code": 0
      }
   ]
}

Changelog

This section contains the notable changes in the Reselling API.

Reselling API v1

  • Removed the filter ispartner from the endpoint Search Venues. So now only those venues that have partnered with the Reseller will be shown.

  • For the endpoint Place order, added the query parameter referenceid.

  • It is possible to reserve up to 100 tickets per product. However, when placing an order (confirm or reserve order), the total ticket quantity must not exceed 100 tickets. The affected endpoints are Reserve product, Reserve products in bulk, Update reserved product, Update reserved products in bulk, Place order and Update reserved order.