Further Guidance

🚧

Note: All requests from this guide return the current state of a basket in the same format (please check the API reference for more details).

Create/update basket

In order to hold inventory selected by customer, the "create basket" request requires at least this information:

channel identifier
performance information
The request body should be sent in JSON format. An example is shown here:

PATCH https://basket-service.tixuk.io/api/v1/baskets

{
  "channelId": "encoretickets",
  "reservations": [
    {
      "venueId": "163",
      "productId": "2102",
      "date": "2019-04-10T19:30:00+02:00",
      "quantity": "1",
      "items": [
        {
          "aggregateReference": "eyJzYm9BbW91bnQiOjY5MDAsInNib1ByaWNlIjo2OTAwLCJob3VzZVByaWNlIjo2OTAwLCJzdGFDb3N0Ijo2OTAwfQ=="
        }
      ]
    }
  ]
}

*Note that the "aggregateReference" is returned by the Inventory Service to identify a specific set of seats/items, which can be added to the basket. This must be included in the request to the Basket Service so that it knows exactly which items have been chosen by a customer.

For updating an existing basket, you need to send the same request, but with the basket reference:

{
  "reference": "1010101",
  ...
}

Get basket info

In order to retrieve details of a basket (useful for customer queries or internal reporting), you need to include the basket reference of an existing basket. For example:

GET https://basket-service.tixuk.io/api/v1/baskets/1010101

Remove item from basket

To remove a reservation line item from a basket (if, you need to provide a basket reference and reservation identifier. For example:

DELETE https://basket-service.tixuk.io/api/v1/baskets/1010101/reservations/1

In the response, you will receive the basket information without the removed reservation line. Note that, if you remove the last item in a basket, it will also clear any promotion and delivery information associated with the basket.

Clear basket

Clear basket keeps the basket reference live but removes the hold from the basket (so it's empty) Clear basket is performed by a PATCH request, without body data. For example:

PATCH https://basket-service.tixuk.io/api/v1/baskets/1010101/clear

In the response, you will get basket information without reservation, delivery and promotion details.

Apply promotion

To apply a promotion, you will need to send a coupon code. For example:

PATCH https://basket-service.tixuk.io/api/v1/baskets/1010101

applyPromotion

{
  "coupon": {
    "code": "SAMPLE_SOURCE_CODE"
  }
}

If the code provided is valid, then the Basket Service will return the basket information with the promotion details, adjusting the line items in the basket according to the validated promotion discount. If the code provided is invalid, the Basket Service will return the current basket with a warning about the failed promo, within the "context" section of the response.

Note that confirmation of a basket is performed during the checkout process. Refer to the Checkout and Payment Service "confirm" request for more details.

For more information about the Basket Service API, please refer to its API reference.