Skip to content

Available capacity

As we have seen in the point obtain catalog, Products have the property DaysWithLimitedCapacity, as well as through the call to get sessions we see that Sessions can have AvailableCapacity defined.

If the field DaysWithLimitedCapacity is empty and, in case the product has non-auto assigned sessions (see in catalog), if the sessions do not have the AvailableCapacity field defined means that you do not have to check the availability for any date, therefore it is not necessary to make this API call.

If the DaysWithLimitedCapacity field has days defined or the sessions have AvailableCapacity defined, we must check the available capacity of the product and/or the corresponding session before offering the product to the customer.

If when trying to confirm the cart the capacity has been exceeded, that is, there is not enough capacity left to carry out the reservation, an error will be returned.

Available capacity refers to quota type tickets (IsQuotaTicket == true). Therefore, the capacity of a product is the number of quota type tickets that can be sold for that product.

Example

Obtain the following information from the catalog:

  • The following Product has August 15 and April 17, 2022 marked as dates to check availability.

    {
        "ProductId": "htgy4tgm9q21n",
        "DaysWithLimitedCapacity": "2022-04-17,2022-08-15"
    }
    
  • The following Product has two sessions, both with AvailableCapacity defined, so its availability must be checked.

    {
        "ProductId": "q2oghu9mye7h2",
        "Tickets": [
            {
                "TicketId": "fb8mcqxyo22rg",
                "IsQuotaTicket": true,
                "TicketEnclosureId": "g5u6m3xew6hxy"
            }
        ]
    }
    
    {
        "TicketEnclosureId": "g5u6m3xew6hxy",
        "Sessions": 
        {
            "SessionContentProfileId ": "dkjvidkfjkdfv",
            "SessionGroupProfileId": "dfjbfqwe8934d",
            "TicketEnclosureAutoAssignSessionType": 0
        }
    }
    

    When getting the sessions we see the following:

    {
    "Sessions": [
        {
            "SessionId": "5b8qkqnmhdmk1",
            "SessionTime": "2021-06-21T10:00:00",
            "AvailableCapacity": 165
        },
        {
            "SessionId": "5o3bwhx1ze1m1",
            "SessionTime": "2021-09-06T10:00:00",
            "AvailableCapacity": 230
        },
        {
            "SessionId": "sdviufdnvr843",
            "SessionTime": "2021-09-06T17:00:00"
        }
    ]
    }
    
  • The following Product is made up of three capacity-type tickets. So, if the capacity of the product were 9, we could only sell 3 products. And if the capacity was 16, we could only sell 5 products.

    {
        "ProductId": "htgy4tgm9q21n",
        "Tickets": [
            {
                "TicketId": "1tqgtrf7ctefc",
                "IsQuotaTicket": true
            }, 
            {
                "TicketId": "2lob55g8w3fff",
                "IsQuotaTicket": true
            }, 
            {
                "TicketId": "jkp78j40cnfh3",
                "IsQuotaTicket": true
            }, 
            {
                "TicketId": "gggsijt911am4",
                "IsQuotaTicket": false
            }
        ]
    }
    

Access method

POST /availablecapacity

Request structure

  • ProductIds: (list). Array of product identifiers to filter by.

    • (string): Product identifier.
  • SessionIds: (list). Array of session identifiers to filter by.

    • (string): Session identifier.
  • Dates: (list). Array of dates to filter by. ISO 8601 format (yyyy-MM-dd).
    • (date): Date to filter by.
  • FromDate: (date). If you want to filter by a date range, you can filter by start date. Does not allow values prior to today. Its default value is today. ISO 8601 format (yyyy-MM-dd).
  • ToDate: (date). If you want to filter by a date range, you can filter by end date. Its default value is the date corresponding to one year from now. ISO 8601 format (yyyy-MM-dd).

Important

At least one ProductId, or SessionId must be defined. You can add as many as you want and they will be considered an OR.

Request example

{
    "ProductIds": [
        "dj48vjsyufvyu",
        "jnvfnvjkivnnf"
    ]
}
{
    "SessionIds": [
        "usdhdsa124asd",
        "iujnvi83nd347"
    ]
}
{
    "ProductIds": [
        "dj48vjsyufvyu"
    ],
    "Dates": [
        "2022-08-15"
    ]
}
{
    "ProductIds": [
        "dj48vjsyufvyu"
    ],
    "FromDate": "2022-08-01",
    "ToDate": "2022-08-31"
}
{
    "ProductIds": 
    [
        "dj48vjsyufvyu",
        "jnvfnvjkivnnf"
    ],
    "SessionIds": [
        "usdhdsa124asd",
        "iujnvi83nd347"
    ],
    "Dates": 
    [
        "2022-08-15",
        "2022-11-01"
    ]
}

Response structure

  • Products: (list). Array containing the requested products. Corresponds to each limited-access day of each product.
    • ProductId: (string). Product identifier.
    • Date: (date). Access date. ISO 8601 format (yyyy-MM-dd).
    • AvailableCapacity: (int). Capacity available for sale.
  • Sessions: (list). Array containing the requested sessions. Corresponds to each limited-access day of each session.
    • SessionId: (string). Session identifier.
    • Date: (date). Access date. ISO 8601 format (yyyy-MM-ddThh:mm:ss.fffffff).
    • AvailableCapacity: (int). Capacity available for sale.
  • Success (boolean): value that indicates whether the call was processed correctly or not.
  • Timestamp (dateTime): time at which the request was processed. ISO 8601 format (yyyy-MM-ddThh:mm:ss.fffffff).
  • ErrorMessage (string): error message explaining why the request was not successful. If it was correct, it will return null.
  • ErrorCodes (string[]): list of codes that identify the errors that occurred in the call.
  • ErrorEntityBreakDown (list): list that contains objects with the name and ID in case of error.
    • Id (string): identifier
    • Name (string): related name of the identifier.

Response example

{
    "Products":
    [
        {
            "ProductId": "dj48vjsyufvyu",
            "Date": "2022-07-20",
            "AvailableCapacity": 0
        },
        {
            "ProductId": "jnvfnvjkivnnf",
            "Date": "2022-07-22",
            "AvailableCapacity": 63
        }
    ],
    "Sessions":
    [
        {
            "SessionId": "usdhdsa124asd",
            "Date": "2022-07-20T18:30:00.0000000",
            "AvailableCapacity": 2
        },
        {
            "SessionId": "iujnvi83nd347",
            "Date": "2022-07-20T20:00:00.0000000",
            "AvailableCapacity": 20
        }
    ],
    "Success": true,
    "Timestamp": "2022-02-18T17:02:27.8165916"
}