x-explorer-enabled: false
openapi: 3.0.0
servers:
 - url: 'https://consumer.uk.eagleeye.com/2.0'
   description: UK Production
info:
  title: Orders API
  description: Orders API - Set of AIR API endpoints for Bulk type operations.
  version: 1.0.2
paths:
  /order/bulk:
    post:
      summary: Bulk Order
      description: >-
        This method allows the calling application to create a Bulk Order.

        Please note received Bulk Order Request will be processed by AIR
        after a HTTP Response is sent to the calling application.
      operationId: tokenBulkOrder
      tags:
        - Order
      parameters:
        - $ref: '#/components/parameters/eesAuthenticationClientId'
        - $ref: '#/components/parameters/eesAuthenticationRequestHash'
        - $ref: '#/components/parameters/httpConnection'
        - $ref: '#/components/parameters/httpAcceptEncoding'
        - $ref: '#/components/parameters/eesMessageId'
        - $ref: '#/components/parameters/eesMessageRetry'
        - $ref: '#/components/parameters/customSubsystemId'
        - $ref: '#/components/parameters/customWildCard'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/tokenOrderBulkPayload'
        description: JSON payload
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      orderId:
                        type: integer
                        format: int64
                        description: EES AIR Order ID
                  - $ref: '#/components/schemas/tokenOrderBulkPayload'
            request:
              examples:
                response:
                  value:
                    Content-Type: application/json;charset=utf-8
                    Accept: application/json
                    X-EES-AUTH-CLIENT-ID: aaabbbccccdddeee357
                    X-EES-AUTH-HASH: ...
                    Connection: keep-alive
                    Accept-Encoding: 'gzip,deflate'
                    clientSecret: 111111
                    X-EES-TRANSACTION-ID: external-system-unique-reference-1123
                    X-CUSTOM-SUBSYSTEM-ID: CRM
                    body: |-
                      {
                        "reference": "AB_887234_GH",
                        "items": [
                          {
                            "programmeId": "4684",
                            "quantity": "3",
                            "denomination": "1000"
                          },
                          {
                            "campaignId": "6658",
                            "quantity": "250000"    
                      }
                        ],
                        "notes": ""
                      }
            response:
              examples:
                response:
                  value:
                    HTTP/1.1: 201
                    Content-Type: 'application/json;charset=utf-8,'
                    Content-Encoding: gzip
                    payload: |-
                      {
                        "orderId":"1234",
                        "reference": "AB_887234_GH",
                        "items": [
                          {
                            "programmeId": "4684",
                            "quantity": "3",
                            "denomination": "1000"
                          },
                          {
                            "campaignId": "6658",
                            "quantity": "250000"    
                          }
                        ],
                        "notes": ""
                      }
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
  /order/retail:
    post:
      summary: Retail Order
      description: >-
        This method allows the calling application to create Gift Voucher or
        plastic card Order
      operationId: tokenOrderCrete
      tags:
        - Order
      parameters:
        - $ref: '#/components/parameters/eesAuthenticationClientId'
        - $ref: '#/components/parameters/eesAuthenticationRequestHash'
        - $ref: '#/components/parameters/httpConnection'
        - $ref: '#/components/parameters/httpAcceptEncoding'
        - $ref: '#/components/parameters/eesMessageId'
        - $ref: '#/components/parameters/eesMessageRetry'
        - $ref: '#/components/parameters/customSubsystemId'
        - $ref: '#/components/parameters/customWildCard'
        - name: include
          in: query
          required: false
          description: Include either accounts or accounts and tokens in the response.
          schema:
            type: array
            items:
              type: string
              enum:
                - accounts
                - tokens
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/tokenOrderRetailPayload'
        description: JSON payload
        required: true
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tokenOrderRetailEntity'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
  /order/fulfil:
    post:
      summary: Fulfil Order
      description: This method allows the calling application to fulfil an existing Order
      operationId: tokenOrderFulfil
      tags:
        - Order
      parameters:
        - $ref: '#/components/parameters/eesAuthenticationClientId'
        - $ref: '#/components/parameters/eesAuthenticationRequestHash'
        - $ref: '#/components/parameters/httpConnection'
        - $ref: '#/components/parameters/httpAcceptEncoding'
        - $ref: '#/components/parameters/eesMessageId'
        - $ref: '#/components/parameters/eesMessageRetry'
        - $ref: '#/components/parameters/customSubsystemId'
        - $ref: '#/components/parameters/customWildCard'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/tokenOrderFulfilPayload'
        description: JSON payload
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tokenOrderFulfilEntity'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '429':
          $ref: '#/components/responses/tooManyRequests'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/defaultErrorEntity'
x-securityDefinitions:
  eesAuthentication:
    - type: apiKey
      in: header
      name: X-EES-AUTH-CLIENT-ID
    - type: apiHash
      in: header
      name: X-EES-AUTH-HASH
security:
  - eesAuthentication: []
components:
  parameters:
    eesAuthenticationClientId:
      name: X-EES-AUTH-CLIENT-ID
      in: header
      description: >-
        Client ID, This will be provided by EES and is unique to the company
        calling the API.
      required: true
      schema:
        type: string
        format: string
    eesAuthenticationRequestHash:
      name: X-EES-AUTH-HASH
      in: header
      description: >
        Request Security Hash, calculated using SHA-256 function from
        concatenated full Request URI Path with Query String(s), Payload and
        Client Secret
      required: true
      schema:
        type: string
        format: string
    eesMessageId:
      name: X-EES-TRANSACTION-ID
      in: header
      description: Unique Reference for the API transaction within the calling company.
      required: false
      schema:
        type: string
        format: string
    eesMessageRetry:
      name: X-EES-RETRY
      in: header
      description: >-
        This flag denotes the number of attempts that have been made for this
        request.
      required: false
      schema:
        type: string
        format: string
    customSubsystemId:
      name: X-CUSTOM-SUBSYSTEM-ID
      in: header
      description: >-
        Optional header provided by the calling application for EES AIR to
        identify what was the external Subsystem Id / Name.
      required: false
      schema:
        type: string
        format: string
    customWildCard:
      name: X-CUSTOM-KEY
      in: header
      description: >
        Optional header(s) provided by the calling application to EES AIR.
        Please note this header name has to follow pattern X-CUSTOM-*
      required: false
      schema:
        type: string
        format: string
    httpConnection:
      name: Connection
      in: header
      required: false
      description: >
        This general HTTP header controls (or rather influences) whether the
        network connection stays open after the current transaction finishes. If
        the sent value is `keep-alive`, the connection should stay in a special
        state, allowing to be reused for subsequent requests to the same server.
        Please note these connections will be closed after reaching timeout
        threshold by server (usually after 5 seconds).
      schema:
        type: string
        enum:
          - close
          - keep-alive
        default: close
    httpAcceptEncoding:
      name: Accept-Encoding
      in: header
      required: false
      description: >
        This request HTTP header advertises which content encoding (usually a
        compression algorithm) the calling application is able to understand.
        The server selects one of the proposals, use it and informs the client
        of its choice with the Content-Encoding response header. Currently
        supported `gzip` and `deflate`, if request header not present no
        compression will be used.
      schema:
        type: string
        enum:
          - ''
          - gzip
          - deflate
          - 'gzip,deflate'
        default: ''
  securitySchemes:
    eesAuthentication:
      type: apiKey
      in: header
      name: X-EES-AUTH-CLIENT-ID
  responses:
    tooManyRequests:
      description: Too Many Requests
      headers:
        Retry-after:
          description: The number of seconds after which to retry the request
          schema:
            type: integer
      content:
        application/json:
          schema:
            properties:
              errorCode:
                type: string
                description: The error code
                enum:
                  - 'CE'
              errorMessage:
                type: string
                description: The error message for this error
                enum:
                  - 'This request has been throttled. Please try again later.'
  schemas:
    tokenOrderBulkPayload:
      type: object
      properties:
        reference:
          type: string
          description: External reference to this order.
        items:
          type: array
          items:
            type: object
            properties:
              campaignId:
                type: string
                format: string
                description: EES AIR Campaign ID
              programmeId:
                type: string
                format: string
                description: EES AIR Programme ID
              schemeId:
                type: string
                format: string
                description: EES AIR Scheme ID
              denomination:
                type: string
                format: string
              quantity:
                type: string
                format: string
        notes:
          type: string
          format: string
    tokenOrderRetailPayload:
      type: object
      properties:
        reference:
          type: string
          description: External reference to this order.
        purchaser:
          $ref: '#/components/schemas/purchaserEntity'
        tracking:
          type: string
          description: >
            [Optional] The tracking reference, if tracking has been used by the
            calling application
        items:
          type: array
          items:
            type: object
            properties:
              programmeId:
                type: integer
                format: int64
              amount:
                type: integer
                format: int32
              delivery:
                type: object
                properties:
                  type:
                    type: string
                    description: delivery method
                    enum:
                      - SMS
                      - EMAIL
                  identity:
                    type: string
                    description: Mobile number or Email value
                  scheduled:
                    type: string
                    format: date-time
                    description: Requested delivery of Test message or Email
                  template:
                    type: object
                    properties:
                      templateId:
                        type: integer
                        format: int32
                        description: >-
                          Id of the template, from EES AIR, to be used to
                          delivery message
                      content:
                        type: object
                        description: Template Variable Values
                        properties:
                          TO:
                            type: string
                            description: >-
                              Recipient Friendly name, this value will be used
                              in the referenced template
                          FROM:
                            type: string
                            description: >-
                              Sender Friendly name, this value will be used in
                              the referenced template
                          CUSTOM:
                            type: string
                            description: SMS or Email subject
              discount:
                type: integer
                format: int32
                description: Discount Value
              total:
                type: integer
                format: int32
                description: Total Value
              meta:
                $ref: '#/components/schemas/metaEntity'
        orderTotals:
          type: object
          properties:
            voucherTotal:
              type: integer
              format: int32
              description: The total value of vouchers or plastic cards in the order
            deliveryTotal:
              type: integer
              format: int32
              description: >
                The amount charged to the purchaser for delivering this order.
                Only required where there are one or more plastic cards in the
                order
            cardCharge:
              type: integer
              format: int32
              description: An amount added to the order for card processing fees
            discountTotal:
              type: integer
              format: int32
              description: The total discount being applied to this order
            grandTotal:
              type: integer
              format: int32
              description: The total the customer is being charged for this order
        payment:
          type: object
          properties:
            token:
              type: object
              properties:
                type:
                  type: string
                  description: Payment Type
                  enum:
                    - ONCE
                    - RECURRING
                value:
                  type: string
                  description: The "tokenised" card details
                deviceData:
                  type: string
                  description: The device data string
            amount:
              type: string
              description: >-
                The amount of money to take. Normally will be the same as the
                'chargeTotal' amount
        meta:
          $ref: '#/components/schemas/metaEntity'
    tokenOrderRetailEntity:
      type: object
      properties:
        orderId:
          type: integer
          format: int64
          description: EES AIR Order ID
        unitId:
          type: integer
          format: int64
          description: EES AIR Unit ID
        creatorId:
          type: integer
          format: int64
          description: EES AIR Creator ID
        consumerId:
          type: integer
          format: int64
          description: EES AIR Consumer ID
        reference:
          type: string
          description: Requested Order Reference
        tracking:
          type: string
          description: Requested External tracking value
        status:
          type: string
          description: EES AIR Order Status
          enum:
            - COMPLETE
            - AWAITING_FULFILMENT
            - FAILED
        purchaserId:
          type: integer
          format: int64
          description: EES AIR Order Purchaser ID
        purchaser:
          type: object
          properties:
            purchaserId:
              type: integer
              format: int64
              description: EES AIR Order Purchaser ID
            unitId:
              type: integer
              format: int64
              description: EES AIR Unit ID
            title:
              type: string
              description: |
                [Optional] Requested Purchaser's Title
            firstName:
              type: string
              description: |
                [Optional] Requested Purchaser's First Name
            secondName:
              type: string
              description: |
                [Optional] Requested Purchaser's Last Name
            phone:
              type: string
              description: |
                [Optional] Requested Purchaser's Phone number
            emailAddress:
              type: string
              description: |
                [Optional] Requested Purchaser's Email address
            marketing:
              type: string
              description: |
                Requested value of Purchaser's Marketing flag
            reference:
              type: string
              description: |
                [Optional] Requested Purchaser's external system reference
            purcharserAddresses:
              type: array
              items:
                type: object
                properties:
                  purcharserAddressId:
                    type: integer
                    format: int64
                    description: EES AIR Purchaser Address ID
                  purchaserId:
                    type: integer
                    format: int64
                    description: EES AIR Purchaser ID
                  line1:
                    type: string
                    description: |
                      [Optional] Purchaser's first line of address
                  line2:
                    type: string
                    description: |
                      [Optional] Purchaser's second line of address
                  line3:
                    type: string
                    description: |
                      [Optional] Purchaser's third line of address
                  line4:
                    type: string
                    description: |
                      [Optional] Purchaser's fourth line of address
                  city:
                    type: string
                    description: |
                      [Optional] Purchaser's City name
                  county:
                    type: string
                    description: |
                      [Optional] Purchaser's County name
                  postcode:
                    type: string
                    description: |
                      [Optional] The purchaser's postcode
                  country:
                    type: string
                    description: |
                      [Optional] Purchaser's Country
        dateCreated:
          type: string
          format: date-time
          description: Order Creation date-time
        lastUpdated:
          type: string
          format: date-time
          description: Order last update date-time
        items:
          type: array
          items:
            type: object
            properties:
              itemId:
                type: integer
                format: int64
                description: EES AIR Order Item ID
              orderId:
                type: integer
                format: int64
                description: EES AIR Order ID
              programmeId:
                type: integer
                format: int64
                description: EES AIR Campaign ID
              consumerId:
                type: integer
                format: int64
                description: EES AIR Consumer ID
              quantity:
                type: integer
                format: int32
                description: Requested Items quantity
              statusId:
                type: integer
                format: int32
                description: EES AIR Order Status ID
              status:
                description: EES AIR Order Status
                type: string
                enum:
                  - COMPLETE
                  - AWAITING_FULFILMENT
                  - FAILED
              deliveryId:
                type: integer
                format: int64
                description: EES AIR Delivery ID
              delivery:
                type: object
                properties:
                  deliveryId:
                    type: integer
                    format: int64
                    description: EES AIR Delivery ID
                  accountId:
                    type: integer
                    format: int64
                    description: EES AIR Account ID
                  deliveryType:
                    type: string
                    description: Delivery type (e.g. POSTAL)
                  templateId:
                    type: integer
                    format: int64
                    description: EES AIR Template ID
                  content:
                    type: object
                    properties:
                      address:
                        type: object
                        properties:
                          firstName:
                            type: string
                            description: |
                              [Optional] Purchaser's First Name
                          lastName:
                            type: string
                            description: |
                              [Optional] Purchaser's Last Name
                          line1:
                            type: string
                            description: |
                              [Optional] Purchaser's first line of address
                          line2:
                            type: string
                            description: |
                              [Optional] Purchaser's second line of address
                          line3:
                            type: string
                            description: |
                              [Optional] Purchaser's third line of address
                          line4:
                            type: string
                            description: |
                              [Optional] Purchaser's fourth line of address
                          city:
                            type: string
                            description: |
                              [Optional] Purchaser's City name
                          county:
                            type: string
                            description: |
                              [Optional] Purchaser's County name
                          postcode:
                            type: string
                            description: |
                              [Optional] The purchaser's postcode
                          country:
                            type: string
                            description: |
                              [Optional] Purchaser's Country
                      type:
                        type: string
                        description: Delivery Type (e.g. POSTAL)
                      identity:
                        type: string
                        description: Identity value
                      template:
                        type: object
                        properties:
                          templateId:
                            type: integer
                            format: int64
                            description: EES AIR Template ID
                          content:
                            type: object
                            properties:
                              address:
                                type: string
                                description: Template Value
                              TO:
                                type: string
                                description: Template Value
                              FROM:
                                type: string
                                description: Template Value
                              CUSTOM:
                                type: string
                                description: Template Value
                              amount:
                                type: string
                                description: Template Value
              value:
                type: integer
                format: int32
                description: Single Coupon / Plastic Value
              total:
                type: integer
                format: int32
                description: Order Item Total Value
              discountTotal:
                type: integer
                format: int32
                description: Order Item Discount Total
              meta:
                $ref: '#/components/schemas/metaEntity'
              accounts:
                type: array
                description: Array of account entities.
                items:
                  $ref: '#/components/schemas/walletAccountEntity'
              dateCreated:
                type: string
                format: date-time
                description: EES AIR Item Creation Date-Time
              lastUpdated:
                type: string
                format: date-time
                description: EES AIR Item Last Updated Date-Time
        payment:
          type: object
          description: |
            [Optional] Payment Object
          properties:
            paymentId:
              type: integer
              format: int42
              description: EES AIR Payment ID
            amount:
              type: integer
              format: int32
              description: >-
                Payment Amount denominated in smallest currency unit (for GBP
                this should be in pence)
        orderTotals:
          type: object
          properties:
            voucherTotal:
              type: integer
              format: int32
              description: Voucher Total
            deliveryTotal:
              type: integer
              format: int32
              description: Delivery Total
            cardCharge:
              type: integer
              format: int32
              description: Card Charge
            discountTotal:
              type: integer
              format: int32
              description: Discount Total
            grandTotal:
              type: integer
              format: int32
              description: Grand Total
    tokenOrderFulfilPayload:
      type: object
      properties:
        itemId:
          type: integer
          format: int64
          description: EES AIR Order Item ID
        tokens:
          type: array
          items:
            type: string
            description: |
              [Optional] EES AIR Token Value (e.g. Card Numbers)
        amount:
          type: integer
          format: int32
          description: >-
            Amount value denominated to smallest currency unit (for GBP this
            should be in pence)
    tokenOrderFulfilEntity:
      type: object
      properties:
        itemId:
          type: integer
          format: int64
          description: EES AIR Order Item ID
        orderId:
          type: integer
          format: int64
          description: EES AIR Order ID
        programmeId:
          type: integer
          format: int64
          description: EES AIR Campaign ID
        consumerId:
          type: integer
          format: int64
          description: EES AIR Consumer ID
        quantity:
          type: integer
          format: int32
          description: Order Item Token quantity
        status:
          type: string
          description: Order Item Fulfilment status
          enum:
            - COMPLETE
            - AWAITING_FULFILMENT
            - FAILED
        deliveryId:
          type: integer
          format: int64
          description: EES AIR Delivery ID
        delivery:
          type: object
          properties:
            deliveryId:
              type: integer
              format: int64
              description: EES AIR Delivery ID
            accountId:
              type: integer
              format: int64
              description: EES AIR Account ID
            deliveryType:
              type: string
              description: Delivery Type
              enum:
                - POSTAL
            templateId:
              type: integer
              format: int64
              description: EES AIR Template ID
            content:
              type: object
              properties:
                address:
                  type: object
                  properties:
                    firstName:
                      type: string
                      description: First Name
                    secondName:
                      type: string
                      description: Last Name
                    line1:
                      type: string
                      description: Address Line 1
                    line2:
                      type: string
                      description: Address Line 2
                    line3:
                      type: string
                      description: Address Line 3
                    line4:
                      type: string
                      description: Address Line 4
                    city:
                      type: string
                      description: City
                    county:
                      type: string
                      description: County
                    postcode:
                      type: string
                      description: Postcode
                    country:
                      type: string
                      description: Country
                type:
                  type: string
                  description: Type
                identity:
                  type: string
                  description: Identity Value
                template:
                  type: object
                  properties:
                    templateId:
                      type: integer
                      format: int64
                      description: EES AIR Template ID
                    content:
                      type: object
                      properties:
                        address:
                          type: string
                          description: Template Variable Value
                        TO:
                          type: string
                          description: Template Variable Value
                        FROM:
                          type: string
                          description: Template Variable Value
                        CUSTOM:
                          type: string
                          description: Template Variable Value
                        amount:
                          type: string
                          description: Template Variable Value
        value:
          type: integer
          format: int32
          description: Value
        total:
          type: integer
          format: int32
          description: Total
        discountTotal:
          type: integer
          format: int32
          description: Discount Total
        meta:
          $ref: '#/components/schemas/metaEntity'
        accounts:
          type: array
          items:
            type: string
            description: Account ID
        dateCreated:
          type: string
          format: date-time
          description: Creation Date Time
        lastUpdated:
          type: string
          format: date-time
          description: Last Updated Date Time
        tokens:
          type: array
          items:
            type: string
            description: Token
    purchaserEntity:
      type: object
      properties:
        title:
          type: string
          description: Title of the purchaser
        firstName:
          type: string
          description: First name of the purchaser
        secondName:
          type: string
          description: Second name of the purchaser
        phone:
          type: string
          description: |
            [Optional] Phone number of the purchaser
        emailAddress:
          type: string
          description: Email address of the purchaser
        marketing:
          type: boolean
          description: >-
            Boolean Flag to inform EES AIR if the Customer agreed to receive
            Marketing information, if unsure please use false
        purchaserAddresses:
          type: array
          items:
            type: object
            properties:
              line1:
                type: string
                description: |
                  [Optional] Purchaser's first line of address
              line2:
                type: string
                description: |
                  [Optional] Purchaser's second line of address
              line3:
                type: string
                description: |
                  [Optional] Purchaser's third line of address
              line4:
                type: string
                description: |
                  [Optional] Purchaser's fourth line of address
              city:
                type: string
                description: |
                  [Optional] Purchaser's City name
              county:
                type: string
                description: |
                  [Optional] Purchaser's County name
              postcode:
                type: string
                description: |
                  [Optional] The purchaser's postcode
              country:
                type: string
                description: |
                  [Optional] Purchaser's Country
    walletAccountEntity:
      type: object
      required:
        - campaignId
        - accountId
        - walletId
        - type
        - clientType
        - status
        - state
        - dates
        - meta
        - balances
        - dateCreated
        - lastUpdated
      description: >-
        The account object, present only if include=accounts is passed in the
        query string.
      properties:
        accountId:
          type: string
          description: EES AIR Wallet Account ID
        relationships:
          type: object
          description: Wallet Accounts Relations
          properties:
            ENTITLEMENT:
              type: object
              properties:
                accountType:
                  $ref: '#/components/schemas/walletAccountRelationEntity'
            ENTITLEMENT_OF:
              type: object
              properties:
                accountType:
                  $ref: '#/components/schemas/walletAccountRelationEntity'
        walletId:
          type: string
          description: EES AIR Wallet ID
        campaignId:
          type: string
          description: The campaignId (Campaign or Programme) this account belongs to.
        type:
          type: string
          description: EES AIR Account Type.
          enum:
            - ECOUPON
            - VOUCHER
            - PAPER
            - DEBIT
            - PLASTIC
        clientType:
          type: string
          description: Account client type.
        status:
          type: string
          description: Account status
          enum:
            - ACTIVE
            - BLOCKED
            - CANCELLED
            - DELETED
            - EXPIRED
            - INACTIVE
            - INVALIDATED
            - LOCKED
            - STOLEN
            - USED
        state:
          type: string
          description: >-
            Account state, managed per retailer base, list of possible enum
            values could be set-up as part of the Onboarding process.
        dates:
          $ref: '#/components/schemas/datesEntity'
        meta:
          $ref: '#/components/schemas/metaEntity'
        balances:
          $ref: '#/components/schemas/accountBalancesEntity'
        dateCreated:
          description: Date this Account was created
          type: string
          format: date-time
        lastUpdated:
          description: Date this Account was last updated
          type: string
          format: date-time
        tokens:
          type: array
          description: >-
            Array of token entities, present only if include=tokens is passed in
            the query string.
          items:
            $ref: '#/components/schemas/tokenEntity'
    datesEntity:
      type: object
      properties:
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
    walletAccountRelationEntity:
      type: object
      required:
        - accountId
        - dateCreated
      properties:
        accountId:
          type: string
          format: int64
          description: Account ID
        dateCreated:
          type: string
          format: date-time
          description: Relation creation date-time
    tokenEntity:
      type: object
      description: An object representing a token.
      properties:
        tokenId:
          type: string
          description: The Token ID.
        accountId:
          type: string
          description: The Account ID.
        token:
          type: string
          description: The Token.
        validFrom:
          type: string
          format: date-time
          description: The date this token is valid from.
        validTo:
          type: string
          format: date-time
          description: The date this token is valid to.
        dateCreated:
          type: string
          format: date-time
          description: The date this token was created.
        lastUpdated:
          type: string
          format: date-time
          description: The date this token was last updated.
        status:
          type: string
          description: The status of the Token.
        tokenLock:
          type: object
          description: >-
            Token lock information. All values can be null if no token lock
            exists.
          properties:
            validFrom:
              type: string
              format: date-time
              description: The date the token lock is valid from.
            validTo:
              type: string
              format: date-time
              description: The date the token lock is valid to.
    accountBalancesEntity:
      type: object
      description: >-
        The object of balances. Some balances only apply to certain types of
        accounts. See notes below on balances.
      properties:
        available:
          type: integer
          description: >-
            The available balance. This is applicable for all account types,
            except POINTS and CONTINUITY, which uses its own balance keys. For
            ECOUPON account type this property will be returned and will be
            equal to zero.
        refundable:
          type: integer
          description: >-
            The refundable balance. This is applicable for all account types
            except POINTS and CONTINUITY, but is not used during account
            creation. For an Account Entity, the amount displayed here is the
            total refundable balance available. Please note for ECOUPON account
            type this property will be returned and equal to zero.
        totalSpend:
          type: integer
          description: >-
            The total spend balance. Applicable only to CONTINUITY type
            Accounts. If totalSpend is not provided on creation, this will be
            set to 0.
        transactionCount:
          type: integer
          description: >-
            The transaction counter. Applicable only to CONTINUITY type
            Accounts. If transactionCount is not provided on creation, this will
            be set to 0.
        current:
          type: integer
          description: >-
            The current balance. Applicable only to accounts of type POINTS and
            STAMP. If not provided on creation, this will be set to 0.
        usable:
          type: integer
          description: >-
            The usable balance. Applicable only to accounts of type POINTS. If
            not provided on creation, this will be set to 0.
        locked:
          type: integer
          description: >-
            The locked balance. Applicable only to accounts of type POINTS. If
            not provided on creation, this will be set to 0.
        lifetime:
          type: integer
          description: >-
            The lifetime balance. Applicable only to accounts of type POINTS and
            STAMP. If not provided on creation, this will be set to 0.
    metaEntity:
      type: object
      properties:
        key1:
          type: string
          description: >-
            Meta 1 property, up to 250 characters; up to 750 characters for Key
            1 Value
        key2:
          type: string
          description: >-
            Meta 2 property, up to 250 characters; up to 750 characters for Key
            2 Value
    defaultErrorEntity:
      type: object
      properties:
        errorCode:
          type: string
          description: Internal Error Code
          enum:
            - NF
            - IR
            - U
            - AF
            - AT
            - IFU
            - CE
            - IPR
            - MNA
            - MPA
            - P
            - ALR
            - CX
            - CI
            - CP
            - CR
            - CU
            - CORQ
            - CTNR
            - DSN
            - IW
            - RW
            - VURC
            - VURI
            - FES
            - IOC
            - AA
            - ILA
            - IP
            - LIR
            - LNA
            - LPR
            - MAC
            - MTLE
            - MLV
            - MAR
            - OC
            - RWI
            - TEXP
            - TULR
            - UAS
            - UV
            - VA
            - VC
            - VXP
            - VI
            - VL
            - VNL
            - VPUF
            - VSM
            - VUA
            - ITID
            - VU
            - IH
        errorMessage:
          type: string
          description: Human Friendly Error Message
      x-enum:
        - errorCode: NF
          errorMessage: Not Found
        - errorCode: IR
          errorMessage: Invalid Request
        - errorCode: U
          errorMessage: Unknown Error
        - errorCode: AF
          errorMessage: Authorisation Failed
        - errorCode: U
          errorMessage: Unknown Error
        - errorCode: AF
          errorMessage: Authorisation Failed
        - errorCode: AT
          errorMessage: Account Type
        - errorCode: IFU
          errorMessage: Insufficient Founds
        - errorCode: CE
          errorMessage: Configuration Error
        - errorCode: IPR
          errorMessage: IP Address Rejected
        - errorCode: MNA
          errorMessage: Method Not Allowed
        - errorCode: MPA
          errorMessage: Missing Parameter
        - errorCode: P
          errorMessage: Privileges
        - errorCode: ALR
          errorMessage: Account Limit Reached
        - errorCode: CX
          errorMessage: Campaign Expired
        - errorCode: CI
          errorMessage: Campaign Inactive
        - errorCode: CP
          errorMessage: Campaign Pending
        - errorCode: CR
          errorMessage: Campaign Removed
        - errorCode: CU
          errorMessage: Campaign Unknown
        - errorCode: CORQ
          errorMessage: Consumer Required
        - errorCode: CTNR
          errorMessage: Consumer Type Not Recognized
        - errorCode: DSN
          errorMessage: Duplicated Serial Number
        - errorCode: IW
          errorMessage: Voucher Can Not Be Created
        - errorCode: RW
          errorMessage: Voucher Can Not Be Redeemed
        - errorCode: VURC
          errorMessage: No Voucher Available to Redeem for Campaign
        - errorCode: VURI
          errorMessage: No Voucher Available to Redeem for this Identity
        - errorCode: FES
          errorMessage: Scheduling Format Incorrect
        - errorCode: IOC
          errorMessage: Improper Offer Configuration
        - errorCode: AA
          errorMessage: Invalid Access to API Method
        - errorCode: ILA
          errorMessage: Invalid Load Amount
        - errorCode: IP
          errorMessage: Invalid Parameter
        - errorCode: LIR
          errorMessage: Outlet Identifier Required
        - errorCode: LNA
          errorMessage: Outlet Not Allowed
        - errorCode: LPR
          errorMessage: Outlet Prohibited by Campaign Settings
        - errorCode: MAC
          errorMessage: Maximum Number of Code Variations
        - errorCode: MTLE
          errorMessage: Max Active Tokens Limit Exceeded
        - errorCode: MLV
          errorMessage: Maximum Voucher Value Exceeded
        - errorCode: MAR
          errorMessage: Minimum Amount Required
        - errorCode: OC
          errorMessage: Campaign has no Offer
        - errorCode: RWI
          errorMessage: >-
            Token can not be Redeemed at this time. Blocked by redemption
            windows.
        - errorCode: TEXP
          errorMessage: Token Expired
        - errorCode: TULR
          errorMessage: Token Usage Limit Reached
        - errorCode: UAS
          errorMessage: Transaction Not Allowed by current account status
        - errorCode: UV
          errorMessage: Voucher Unknown
        - errorCode: VA
          errorMessage: Voucher already been sent
        - errorCode: VC
          errorMessage: Voucher Cancelled
        - errorCode: VXP
          errorMessage: Voucher Expired
        - errorCode: VI
          errorMessage: Voucher Invalid
        - errorCode: VL
          errorMessage: Voucher Locked
        - errorCode: VNL
          errorMessage: Voucher Not Locked
        - errorCode: VPUF
          errorMessage: You don't have privileges to unlock this token
        - errorCode: VSM
          errorMessage: Voucher Serial Mismatch
        - errorCode: VUA
          errorMessage: No vouchers available for this campaign
        - errorCode: ITID
          errorMessage: Invalid Transaction ID
        - errorCode: VU
          errorMessage: Voucher already redeemed
        - errorCode: IH
          errorMessage: Invalid Header set
