openapi: 3.0.0
info:
  title: Baskets
  version: "2023"
  description: Baskets Service
tags:
  - name: Baskets
paths:
  /baskets:
    post:
      tags:
        - Baskets
      operationId: createBasket
      summary: Create a basket
      description: Creates a new basket which you can add products to.
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.Basket"
  /baskets/{id}:
    get:
      tags:
        - Baskets
      operationId: getBasket
      summary: Get a basket
      description: Returns the basket with the given id
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.Basket"
    delete:
      tags:
        - Baskets
      operationId: deleteBasket
      summary: Delete a basket
      description: Deletes the basket with the given id
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.Basket"
  /baskets/{id}/assign-contact:
    patch:
      tags:
        - Baskets
      operationId: assignContact
      summary: Assign contact
      description: Assigns the signed in contact to the basket
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
  /baskets/{id}/payment-intents:
    post:
      tags:
        - Baskets
      operationId: createPaymentIntent
      summary: Create a payment intent
      description: Creates a new payment intent so that checkout can begin.
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.PaymentIntent"
        "202":
          description: The request has been accepted for processing, but processing has
            not yet completed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.AcceptedNotificationResponse"
      requestBody:
        description: Additional data to be passed to the payment provider
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: {}
  /baskets/{id}/payment-intents/{paymentIntentId}:
    delete:
      tags:
        - Baskets
      operationId: deletePaymentIntent
      summary: Cancel a payment intent
      description: Cancels the previously created payment intent
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: paymentIntentId
          in: path
          required: true
          description: The id of the payment intent to delete.
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
  /baskets/{id}/products/{productId}:
    post:
      tags:
        - Baskets
      operationId: addProductToBasket
      summary: Add a product to a basket
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: productId
          in: path
          required: true
          description: The product id of the ticketed event that tickets are being
            purchased for.
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
      requestBody:
        description: Fields to refine the context of the product being added to the basket
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Baskets.AddProductToBasketRequestPayload"
  /baskets/{id}/products/{productId}/ticketing/select-seats:
    post:
      tags:
        - Baskets
      operationId: selectSeats
      summary: Select seats
      description: Select seats (auto and manual) for the given ticketed event.
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: productId
          in: path
          required: true
          description: The product id of the ticketed event that tickets are being
            purchased for.
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
      requestBody:
        description: Select seats automatically by setting rates, or manually by setting
          seats
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Baskets.SelectSeatsRequestPayload"
  /baskets/{id}/products/{productId}/time-slots/select-slot:
    post:
      tags:
        - Baskets
      operationId: selectTimeSlot
      summary: Select time slot
      description: Selects a given time slot for the given product.
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: productId
          in: path
          required: true
          description: The id of the time slot product.
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
      requestBody:
        description: Select the timeslot and rates for that slot to purchase
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Baskets.SelectTimeSlotRequestPayload"
  /baskets/{id}/provider/{providerBasketId}/items/{lineItemId}:
    delete:
      tags:
        - Baskets
      operationId: deleteLineItem
      summary: Delete line item
      description: Deletes the specified line item with the given id
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: providerBasketId
          in: path
          required: true
          description: The id provider basket
          schema:
            type: string
        - name: lineItemId
          in: path
          required: true
          description: The id item
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
    patch:
      tags:
        - Baskets
      operationId: updateLineItem
      summary: Update a line item
      description: "Updates the specified line item with the given "
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: providerBasketId
          in: path
          required: true
          description: The id provider basket
          schema:
            type: string
        - name: lineItemId
          in: path
          required: true
          description: The id item
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Models.LineItems.UpdateLineItemRequestPayload"
  /baskets/{id}/provider/{providerBasketId}/items/{lineItemId}/quantity:
    patch:
      tags:
        - Baskets
      operationId: updateLineItemQuantity
      summary: Update line item quantity
      description: Updates the specified line item quantity
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: providerBasketId
          in: path
          required: true
          description: The id provider basket
          schema:
            type: string
        - name: lineItemId
          in: path
          required: true
          description: The id item
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Models.LineItems.UpdateLineItemQuantityRequestPaylo\
                ad"
  /baskets/{id}/provider/{providerBasketId}/set-delivery-method:
    post:
      tags:
        - Baskets
      operationId: setProviderBasketDeliveryMethod
      summary: Set delivery method
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
        - name: providerBasketId
          in: path
          required: true
          description: The id of the provider basket basket
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Baskets.SetProviderBasketDeliveryMethodRequest"
  /baskets/{id}/set-customer-details:
    patch:
      tags:
        - Baskets
      operationId: setCustomerDetails
      summary: Set customer details
      description: Sets one or more customer detail fields on the basket
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
      responses:
        "202":
          description: The request has been accepted for processing, but processing has
            not yet completed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.AcceptedNotificationResponse"
        "204":
          description: There is no content to send for this request, but the headers may
            be useful.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Baskets.SetCustomerDetailsRequest"
  /baskets/{id}/voucher:
    post:
      tags:
        - Baskets
      operationId: addVoucherToBasket
      summary: Add voucher to basket
      description: Adds a voucher on the basket
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
        "204":
          description: There is no content to send for this request, but the headers may
            be useful.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Baskets.AddVoucherRequest"
    delete:
      tags:
        - Baskets
      operationId: removeVoucherFromBasket
      summary: Remove voucher from basket
      description: Removes a voucher from the basket
      parameters:
        - $ref: "#/components/parameters/StorefrontAuthHeaders"
        - name: id
          in: path
          required: true
          description: The id of the basket
          schema:
            type: string
      responses:
        "200":
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Models.NotificationResponse"
        "204":
          description: There is no content to send for this request, but the headers may
            be useful.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Baskets.RemoveVoucherRequest"
security:
  - BearerAuth: []
components:
  parameters:
    StorefrontAuthHeaders:
      name: x-api-key
      in: header
      required: true
      schema:
        type: string
  schemas:
    Address:
      type: object
      required:
        - StreetLine1
        - City
        - CountryCode
        - PostalCode
      properties:
        StreetLine1:
          type: string
        StreetLine2:
          type: string
        StreetLine3:
          type: string
        City:
          type: string
        Region:
          type: string
        CountryCode:
          type: string
        PostalCode:
          type: string
    Baskets.AddProductToBasketRequestPayload:
      type: object
      required:
        - quantity
      properties:
        quantity:
          type: integer
          format: int32
          description: The number of instances of the product to add te the basket
        crossSoldFromProductId:
          type: string
          description: If this is a cross-sell product, then this field will contain the
            id of the product that it was cross-sold from
        crossSoldFromLineItemId:
          type: string
          description: If this product is being cross-sold against a line item already in
            the basket, the id of that parent line item. The parent line must
            exist before the add.
        productGroupId:
          type: string
          description: The product that the product belongs to, if applicable
        kioskId:
          type: string
          description: The kiosk that the product belongs to, if applicable
        timestreamId:
          type: string
          description: The time stream that the product belongs to, if applicable
        productVariantId:
          type: string
        currency:
          type: string
        subscriptionKey:
          type: string
        subscriptionUpgradeId:
          type: string
        subscriptionRenewId:
          type: string
    Baskets.AddVoucherRequest:
      type: object
      required:
        - voucherCode
      properties:
        voucherCode:
          type: string
    Baskets.RateSelection:
      type: object
      description: One or more rates. The system will attempt to find seats at the
        given rates, for the given quantities.
      required:
        - rateId
        - quantity
      properties:
        rateId:
          type: string
        quantity:
          type: integer
          format: int32
    Baskets.RemoveVoucherRequest:
      type: object
      required:
        - voucherCode
      properties:
        voucherCode:
          type: string
    Baskets.SeatSelection:
      type: object
      description: One or more specific seats to add to the basket.
      required:
        - rateId
        - seatId
      properties:
        rateId:
          type: string
        seatId:
          type: string
    Baskets.SelectSeatsRequestPayload:
      type: object
      description: Select seats automatically by setting rates, or manually by setting
        seats.
      properties:
        rates:
          type: array
          items:
            $ref: "#/components/schemas/Baskets.RateSelection"
        seats:
          type: array
          items:
            $ref: "#/components/schemas/Baskets.SeatSelection"
    Baskets.SelectTimeSlotRequestPayload:
      type: object
      description: Select a time slot to purchase, with the given rates
      required:
        - timeSlotId
        - rates
      properties:
        timeSlotId:
          type: string
        rates:
          type: array
          items:
            $ref: "#/components/schemas/Baskets.TimeSlotRateSelection"
    Baskets.SetCustomerDetailsRequest:
      type: object
      properties:
        customerDetails:
          type: array
          items:
            $ref: "#/components/schemas/Models.CustomerDetailFieldValue"
    Baskets.SetProviderBasketDeliveryMethodRequest:
      type: object
      required:
        - deliveryMethod
      properties:
        deliveryMethod:
          anyOf:
            - $ref: "#/components/schemas/Models.DeliveryMethods.KioskCollectionDeliverySelec\
                tion"
            - $ref: "#/components/schemas/Models.DeliveryMethods.InSeatDeliverySelection"
            - $ref: "#/components/schemas/Models.DeliveryMethods.AddressDeliverySelection"
            - $ref: "#/components/schemas/Models.DeliveryMethods.DigitalDeliverySelection"
    Baskets.TimeSlotRateSelection:
      type: object
      description: One or more specific rates to add to the basket for a given time slot.
      required:
        - rateId
        - quantity
      properties:
        rateId:
          type: string
        quantity:
          type: integer
          format: int32
    Instant:
      type: string
      format: date-time
    Models.AcceptedNotificationResponse:
      type: object
      allOf:
        - $ref: "#/components/schemas/Models.NotificationResponse"
    Models.Basket:
      type: object
      required:
        - id
        - created
        - updated
        - providerBaskets
        - customerDetails
        - totalPrice
        - deliveryTotalPrice
        - missingCustomerDetailFields
        - vouchers
      properties:
        id:
          type: string
        created:
          $ref: "#/components/schemas/Instant"
        updated:
          $ref: "#/components/schemas/Instant"
        contactId:
          type: string
        providerBaskets:
          type: array
          items:
            $ref: "#/components/schemas/Models.ProviderBasket"
        customerDetails:
          type: array
          items:
            $ref: "#/components/schemas/Models.CustomerDetailField"
        totalPrice:
          $ref: "#/components/schemas/Money"
        deliveryTotalPrice:
          $ref: "#/components/schemas/Money"
        originalTotalPrice:
          $ref: "#/components/schemas/Money"
        totalProviderDiscounts:
          $ref: "#/components/schemas/Money"
        missingCustomerDetailFields:
          type: boolean
        activePaymentIntentId:
          type: string
        vouchers:
          type: array
          items:
            $ref: "#/components/schemas/Models.Voucher"
    Models.ConsumableLineItem:
      type: object
      required:
        - quantity
        - UnitPrice
        - title
      properties:
        quantity:
          type: integer
          format: int32
        UnitPrice:
          $ref: "#/components/schemas/Money"
        productGroupId:
          type: string
        kioskId:
          type: string
        timestreamId:
          type: string
        validUntil:
          $ref: "#/components/schemas/Instant"
        title:
          type: string
        description:
          type: string
        allergens:
          type: string
        image:
          type: string
        calories:
          type: integer
          format: int32
    Models.CrossSellLineItemFeature:
      type: object
      required:
        - type
        - crossSoldFromLineItemId
      allOf:
        - $ref: "#/components/schemas/Models.LineItemFeature"
      properties:
        type:
          type: string
          enum:
            - cross-sell
        crossSoldFromLineItemId:
          $ref: "#/components/schemas/ProviderIdentity"
          description: The id of the parent line item this line was cross-sold against.
    Models.CustomerDetailField:
      type: object
      required:
        - type
      properties:
        type:
          $ref: "#/components/schemas/Models.CustomerDetailFieldType"
    Models.CustomerDetailFieldType:
      type: string
      enum:
        - Email
        - FirstName
        - LastName
        - PhoneNumber
        - BillingAddress
        - DeliveryAddress
        - BillingFirstName
        - BillingLastName
    Models.CustomerDetailFieldValue:
      type: object
      required:
        - type
      properties:
        type:
          $ref: "#/components/schemas/Models.CustomerDetailFieldType"
        value:
          type: object
    Models.DeliveryMethods.AddressDeliveryMethod:
      type: object
      required:
        - type
        - title
        - description
        - provider
        - entries
        - totalPrice
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethod"
      properties:
        type:
          type: string
          enum:
            - Address
        title:
          type: string
          description: The title of the option. 'Express Delivery', 'Standard Delivery', etc
        description:
          type: string
          description: Further information about the option -- 'Next day', '2-3 days', etc.
        provider:
          allOf:
            - $ref: "#/components/schemas/Models.DeliveryMethods.AddressDeliveryProvider"
          description: The provider of the delivery. 'DHL', 'Fedex', etc
        entries:
          type: array
          items:
            $ref: "#/components/schemas/Models.DeliveryMethods.AddressEntry"
          description: Pre configured addresses that the user can select from, if any.
        totalPrice:
          allOf:
            - $ref: "#/components/schemas/Money"
          description: The total price of this delivery method, including any taxes.
    Models.DeliveryMethods.AddressDeliveryProvider:
      type: object
      required:
        - name
        - logo
      properties:
        name:
          type: string
          description: The name of the provider
        logo:
          type: string
          description: The url of the provider's logo
    Models.DeliveryMethods.AddressDeliverySelection:
      type: object
      required:
        - type
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethodSelection"
      properties:
        type:
          type: string
          enum:
            - Address
        addressEntryId:
          type: string
          description: The id of an existing address entry, if being selected
        address:
          allOf:
            - $ref: "#/components/schemas/Address"
          description: A new address to deliver to, if an existing address is not being
            selected
    Models.DeliveryMethods.AddressEntry:
      type: object
      description: Represents a predefined address that can be selected
      required:
        - id
        - address
      properties:
        id:
          type: string
        address:
          type: string
    Models.DeliveryMethods.DeliveryMethod:
      type: object
      discriminator:
        propertyName: type
        mapping:
          Address: "#/components/schemas/Models.DeliveryMethods.AddressDeliveryMethod"
          KioskCollection: "#/components/schemas/Models.DeliveryMethods.KioskCollectionDe\
            liveryMethod"
          InSeat: "#/components/schemas/Models.DeliveryMethods.InSeatDeliveryMethod"
          Digital: "#/components/schemas/Models.DeliveryMethods.DigitalDeliveryMethod"
      required:
        - type
        - id
      properties:
        type:
          $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethodType"
        id:
          type: string
          description: The id of the option.
    Models.DeliveryMethods.DeliveryMethodSelection:
      type: object
      discriminator:
        propertyName: type
        mapping:
          KioskCollection: "#/components/schemas/Models.DeliveryMethods.KioskCollectionDe\
            liverySelection"
          InSeat: "#/components/schemas/Models.DeliveryMethods.InSeatDeliverySelection"
          Address: "#/components/schemas/Models.DeliveryMethods.AddressDeliverySelection"
          Digital: "#/components/schemas/Models.DeliveryMethods.DigitalDeliverySelection"
      required:
        - type
        - id
      properties:
        type:
          allOf:
            - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethodType"
          description: The type of the delivery method selection
        id:
          type: string
          description: The id of the option being selected.
    Models.DeliveryMethods.DeliveryMethodType:
      type: string
      description: Discriminator for delivery method types
      enum:
        - Digital
        - Address
        - KioskCollection
        - InSeat
    Models.DeliveryMethods.DigitalDeliveryMethod:
      type: object
      required:
        - type
        - title
        - description
        - totalPrice
        - alwaysIncluded
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethod"
      properties:
        type:
          type: string
          enum:
            - Digital
        title:
          type: string
          description: The title of the option. 'Email', 'Your Stadion FC Account', etc
        description:
          type: string
          description: Further information about the option -- 'Your products will be sent
            to your email', 'Your products will be available after signing in to
            the app and/or website', etc.
        totalPrice:
          allOf:
            - $ref: "#/components/schemas/Money"
          description: The total price of this delivery method, including any taxes.
        alwaysIncluded:
          type: boolean
          description: If true, this delivery method will be active without the customer
            having to explicitly choose it.
    Models.DeliveryMethods.DigitalDeliverySelection:
      type: object
      required:
        - type
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethodSelection"
      properties:
        type:
          type: string
          enum:
            - Digital
    Models.DeliveryMethods.InSeatDeliveryMethod:
      type: object
      required:
        - type
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethod"
      properties:
        type:
          type: string
          enum:
            - InSeat
    Models.DeliveryMethods.InSeatDeliverySelection:
      type: object
      required:
        - type
        - kioskId
        - collectionTime
        - collectionId
        - seatId
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethodSelection"
      properties:
        type:
          type: string
          enum:
            - InSeat
        kioskId:
          type: string
        collectionTime:
          $ref: "#/components/schemas/Instant"
        collectionId:
          type: string
        seatId:
          type: string
    Models.DeliveryMethods.KioskCollectionDeliveryMethod:
      type: object
      required:
        - type
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethod"
      properties:
        type:
          type: string
          enum:
            - KioskCollection
    Models.DeliveryMethods.KioskCollectionDeliverySelection:
      type: object
      required:
        - type
        - kioskId
        - collectionTime
        - collectionId
        - seatId
      allOf:
        - $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethodSelection"
      properties:
        type:
          type: string
          enum:
            - KioskCollection
        kioskId:
          type: string
        collectionTime:
          $ref: "#/components/schemas/Instant"
        collectionId:
          type: string
        seatId:
          type: string
    Models.EventType:
      type: string
      enum:
        - SportsMatch
    Models.LineItem:
      type: object
      required:
        - id
        - type
        - productId
        - totalPrice
      properties:
        id:
          $ref: "#/components/schemas/ProviderIdentity"
        type:
          $ref: "#/components/schemas/Models.LineItemType"
        productId:
          $ref: "#/components/schemas/ProviderIdentity"
        crossSoldFromProductId:
          $ref: "#/components/schemas/ProviderIdentity"
        totalPrice:
          $ref: "#/components/schemas/Money"
        ticketing:
          $ref: "#/components/schemas/Models.TicketingLineItem"
        consumable:
          $ref: "#/components/schemas/Models.ConsumableLineItem"
        timeSlot:
          $ref: "#/components/schemas/Models.TimeSlotLineItem"
        variableProduct:
          $ref: "#/components/schemas/Models.VariableProductLineItem"
        originalTotalPrice:
          $ref: "#/components/schemas/Money"
        totalProviderDiscounts:
          $ref: "#/components/schemas/Money"
        providerDiscounts:
          type: array
          items:
            $ref: "#/components/schemas/Models.ProviderDiscount"
        deliveryMethodIdOptions:
          type: array
          description: The delivery methods that can satisfy this line. At least one must
            be covered by the basket's selected methods before payment.
          items:
            type: string
        features:
          type: array
          description: Extensible set of features attached to this line item, e.g.
            cross-sell provenance. Unknown feature types must be skipped by
            consumers.
          items:
            $ref: "#/components/schemas/Models.LineItemFeature"
    Models.LineItemFeature:
      type: object
      description: Extensible polymorphic feature attached to a line item. Unknown
        feature types must be skipped by consumers.
      required:
        - type
      discriminator:
        propertyName: type
        mapping:
          cross-sell: "#/components/schemas/Models.CrossSellLineItemFeature"
      properties:
        type:
          type: string
        key:
          type: string
          nullable: true
    Models.LineItemType:
      type: string
      enum:
        - Ticketing
        - Consumable
        - TimeSlot
        - VariableProduct
    Models.LineItems.UpdateLineItemQuantityRequestPayload:
      type: object
      properties:
        quantity:
          type: integer
          format: int32
    Models.LineItems.UpdateLineItemRequestPayload:
      type: object
      discriminator:
        propertyName: type
        mapping:
          TimeSlot: "#/components/schemas/Models.LineItems.UpdateTimeSlotLineItemRequestP\
            ayload"
      properties:
        type:
          $ref: "#/components/schemas/Models.LineItems.UpdateLineItemRequestType"
    Models.LineItems.UpdateLineItemRequestType:
      type: string
      enum:
        - TimeSlot
    Models.LineItems.UpdateTimeSlotLineItemRequestPayload:
      type: object
      allOf:
        - $ref: "#/components/schemas/Models.LineItems.UpdateLineItemRequestPayload"
      properties:
        type:
          type: string
          enum:
            - TimeSlot
        quantity:
          type: integer
          format: int32
    Models.NotificationResponse:
      type: object
      required:
        - notificationId
      properties:
        notificationId:
          type: string
          description: The id of a notification that can be used to poll the Notification
            service for the result of the request.
    Models.PaymentDetails:
      type: object
      required:
        - totalPaid
        - components
      properties:
        totalPaid:
          $ref: "#/components/schemas/Money"
        components:
          type: array
          items:
            $ref: "#/components/schemas/Models.PaymentDetailsComponent"
    Models.PaymentDetailsComponent:
      type: object
      required:
        - providerBasketId
        - portionOfTotalPaid
      properties:
        providerBasketId:
          $ref: "#/components/schemas/ProviderIdentity"
        portionOfTotalPaid:
          $ref: "#/components/schemas/Money"
    Models.PaymentIntent:
      type: object
      required:
        - id
        - status
        - created
        - updated
        - paymentDetails
        - creationStateMachine
      properties:
        id:
          type: string
        status:
          $ref: "#/components/schemas/Models.PaymentIntentStatus"
        created:
          $ref: "#/components/schemas/Instant"
        updated:
          $ref: "#/components/schemas/Instant"
        paymentDetails:
          $ref: "#/components/schemas/Models.PaymentDetails"
        creationStateMachine:
          $ref: "#/components/schemas/Models.PaymentIntentStateMachine"
        cancellationStateMachine:
          $ref: "#/components/schemas/Models.PaymentIntentStateMachine"
        pspPaymentreference:
          $ref: "#/components/schemas/ProviderIdentity"
        pspPayload:
          type: object
          additionalProperties: {}
    Models.PaymentIntentStateMachine:
      type: object
      required:
        - pendingProviderBasjets
        - pendingPaymentProvider
        - ready
      properties:
        pendingProviderBasjets:
          type: array
          items:
            $ref: "#/components/schemas/ProviderIdentity"
        pendingPaymentProvider:
          type: boolean
        notificationId:
          type: string
        ready:
          type: boolean
    Models.PaymentIntentStatus:
      type: string
      enum:
        - PreparingPayment
        - AwaitingPayment
        - Cancelled
        - PaymentComplete
    Models.ProviderBasket:
      type: object
      required:
        - id
        - totalPrice
        - lineItems
        - deliveryMethods
        - deliveryMethodSelections
      properties:
        id:
          $ref: "#/components/schemas/ProviderIdentity"
        expires:
          $ref: "#/components/schemas/Instant"
        totalPrice:
          $ref: "#/components/schemas/Money"
        lineItems:
          type: array
          items:
            $ref: "#/components/schemas/Models.LineItem"
        deliveryMethods:
          type: array
          items:
            $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethod"
        deliveryMethodSelections:
          type: array
          items:
            $ref: "#/components/schemas/Models.DeliveryMethods.DeliveryMethodSelection"
        originalTotalPrice:
          $ref: "#/components/schemas/Money"
        totalProviderDiscounts:
          $ref: "#/components/schemas/Money"
        providerDiscounts:
          type: array
          items:
            $ref: "#/components/schemas/Models.ProviderDiscount"
    Models.ProviderDiscount:
      type: object
      required:
        - id
        - title
        - code
        - description
        - amount
      properties:
        id:
          type: string
        title:
          type: string
        code:
          type: string
        description:
          type: string
        amount:
          $ref: "#/components/schemas/Money"
    Models.SportsCompetition:
      type: object
      required:
        - name
        - season
        - competitionType
      properties:
        name:
          type: string
        season:
          type: string
        competitionType:
          type: string
    Models.SportsMatch:
      type: object
      required:
        - matchDate
        - competition
        - hostTeam
        - opponentTeam
      properties:
        matchDate:
          $ref: "#/components/schemas/Instant"
        competition:
          $ref: "#/components/schemas/Models.SportsCompetition"
        hostTeam:
          $ref: "#/components/schemas/Models.SportsTeam"
        opponentTeam:
          $ref: "#/components/schemas/Models.SportsTeam"
    Models.SportsTeam:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
        logoImageUrl:
          type: string
    Models.Ticket:
      type: object
      required:
        - id
        - providerSeatId
        - seatCategory
        - tariff
        - section
        - providerSectionId
        - row
        - seat
        - price
      properties:
        id:
          type: string
        providerSeatId:
          type: string
        seatCategory:
          type: string
        tariff:
          type: string
        section:
          type: string
        providerSectionId:
          type: string
        row:
          type: string
        seat:
          type: string
        price:
          $ref: "#/components/schemas/Money"
    Models.TicketingLineItem:
      type: object
      required:
        - type
        - tickets
      properties:
        type:
          $ref: "#/components/schemas/Models.TicketingType"
        eventType:
          $ref: "#/components/schemas/Models.EventType"
        sportsMatch:
          $ref: "#/components/schemas/Models.SportsMatch"
        tickets:
          type: array
          items:
            $ref: "#/components/schemas/Models.Ticket"
    Models.TicketingType:
      type: string
      enum:
        - TicketedEvent
    Models.TimeSlotLineItem:
      type: object
      required:
        - quantity
        - unitPrice
        - tariffId
        - tariffName
        - rateId
        - timeSlotId
        - productName
      properties:
        quantity:
          type: integer
          format: int32
        unitPrice:
          $ref: "#/components/schemas/Money"
        tariffId:
          $ref: "#/components/schemas/ProviderIdentity"
        tariffName:
          type: string
        rateId:
          $ref: "#/components/schemas/ProviderIdentity"
        timeSlotId:
          $ref: "#/components/schemas/ProviderIdentity"
        productName:
          type: string
    Models.VariableProductLineItem:
      type: object
      required:
        - quantity
        - unitPrice
        - variant
      properties:
        quantity:
          type: integer
          format: int32
        unitPrice:
          $ref: "#/components/schemas/Money"
        variant:
          $ref: "#/components/schemas/Models.VariableProductVariant"
    Models.VariableProductVariant:
      type: object
      required:
        - id
        - name
        - sku
        - imageUrl
      properties:
        id:
          type: string
        name:
          type: string
        sku:
          type: string
        imageUrl:
          type: string
    Models.Voucher:
      type: object
      required:
        - name
        - code
        - productId
        - variantId
        - originalPrice
        - voucherPrice
        - discountAmount
      properties:
        name:
          type: string
        code:
          type: string
        productId:
          $ref: "#/components/schemas/ProviderIdentity"
        variantId:
          type: string
        originalPrice:
          $ref: "#/components/schemas/Money"
        voucherPrice:
          $ref: "#/components/schemas/Money"
        discountAmount:
          $ref: "#/components/schemas/Money"
    Money:
      type: object
      required:
        - minorUnits
        - currencyCode
        - precision
      properties:
        minorUnits:
          type: integer
          format: int32
        currencyCode:
          type: string
        precision:
          type: integer
          format: int32
    ProviderIdentity:
      type: string
      pattern: ^[a-z0-9]{1,5}(:[a-z0-9]{1,12})?\|[a-z0-9]{24}$
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
servers:
  - url: https://storefront.sandbox.onebasket.io
    description: Sandbox
    variables: {}
  - url: https://storefront.live.onebasket.io
    description: Live
    variables: {}
