x-explorer-enabled: false
openapi: 3.0.3
servers:
 - url: 'https://consumer.uk.eagleeye.com/2.0'
   description: UK Production
info:
  title: Token API
  description: >-
    Token API - set of AIR API endpoints to issue, update, defer, cancel,
    verify and redeem Tokens within the AIR platform
  version: 2.2.0
tags:
  - name: Token
    description: Set of API endpoints applicable to Tokens for `COUPON` and 'STORED_VALUE' account types.

paths:

  /token/create:
    post:
      summary: Create
      description: >-
        This method allows the calling application to create a new Token within AIR platform.
      operationId: createToken

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenCreate'

      responses:
        201:
          $ref: '#/components/responses/tokenCreate201'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/redeem:
    post:
      summary: Redeem
      description: >-
        This method allows the calling application to Redeem a Token. This API is replaced by the POS Connect 
        account APIs.
      operationId: redeemToken
      deprecated: true

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenRedeem'

      responses:
        201:
          $ref: '#/components/responses/tokenRedeem201'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/unredeem:
    post:
      summary: Unredeem
      description: >-
        This method allows the calling application to Unredeem a Token. This API is replaced by the POS Connect
        account APIs.
      operationId: unredeemToken
      deprecated: true

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenRedeem'

      responses:
        201:
          $ref: '#/components/responses/tokenRedeem201'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/verify:
    post:
      summary: Verify
      description: |
        This API method allows the calling application to verify a Token or Account that has been presented by a consumer.

        These checks can be used for a variety of use cases in order to:
        * Check it is genuine and valid within AIR. 
        * Check it hasn't already been redeemed (for single use Tokens/Accounts).
        * Check it's valid to redeem at that time (within the desired Valid-From & Valid-To range).
        * Check if the parent Campaign is still active. 
        * Check it hasn't been locked by another Outlet.
        * Check if there is enough balance. 
        * Check if the pin provided (passphrase) is correct (optional parameter).
        * Optionally, to improve the customer experience and reduce the fraud risk. Verified Tokens or Accounts could be locked as part of this request if instructed to do so (please note Campaign settings could prevent them from being locked). 
        
          Locked Tokens/Accounts can be redeemed, credited or debited, without unlocking, as long as the location specified in the API key or explicit location 'override' remains the same; otherwise, the Token/Account should be unlocked by the calling application e.g if a Consumer changes their mind and no longer wishes to redeem it. 
          
          Alternatively, they will be automatically unlocked after reaching the defined lock time-out.
          This API is replaced by the POS Connect account APIs.
      operationId: verifyToken
      deprecated: true

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenVerify'

      responses:
        201:
          $ref: '#/components/responses/tokenVerify201'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/unlock:
    patch:
      summary: Unlock
      description: >-
        This method allows the calling application to unlock previously locked Token. This API is replaced by the 
        POS Connect account APIs.
      operationId: unlockToken
      deprecated: true

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenUnlock'

      responses:
        200:
          $ref: '#/components/responses/tokenUnlock200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/credit:
    post:
      summary: Credit
      description: >-
        This method allows the calling application to Credit an Account identified by a Account ID or a Token. Applicable to Stored Value Account types.
      operationId: creditToken

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenCredit'

      responses:
        201:
          $ref: '#/components/responses/tokenCredit201'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/debit:
    post:
      summary: Debit
      description: >-
        This method allows the calling application to Debit an Account identified by Account Id or Token. 
        Applicable to Stored Value Account types. This API is replaced by the POS Connect account APIs.
      operationId: debitToken
      deprecated: true

      tags:
        - Token


      requestBody:
        $ref: '#/components/requestBodies/tokenDebit'

      responses:
        201:
          $ref: '#/components/responses/tokenDebit201'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/load:
    patch:
      summary: Load
      description: >-
        This method allows the calling application to Load a Token (Account). Please note - only INACTIVE Accounts should be loaded and this operation should be performed once (later down the line credit endpoint should be used)
      operationId: loadToken

      tags:
        - Token


      requestBody:
        $ref: '#/components/requestBodies/tokenLoad'

      responses:
        200:
          $ref: '#/components/responses/tokenLoad200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/activate:
    patch:
      summary: Activate
      description: >-
        This method allows the calling application to Activate a Token within the AIR platform (Change status of a Token to ACTIVE). Please note only INACTIVE Tokens could be Activated.
      operationId: activateToken

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenActivate'


      responses:
        200:
          $ref: '#/components/responses/tokenActivate200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/cancel:
    patch:
      summary: Cancel
      description: >-
        This method allows the calling application to Cancel a Token within the AIR platform. Please note this operation can not be undone.
      operationId: cancelToken
      deprecated: true

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenCancel'


      responses:
        200:
          $ref: '#/components/responses/tokenCancel200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/pin/update:
    patch:
      summary: Update PIN
      description: >-
        This method allows the calling application to change a Token's (Account's) PIN within the AIR platform. Please note - Campaign (or Programme) settings controls if a PIN is enabled or not
      operationId: updateTokenPin

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenPinUpdate'

      responses:
        200:
          $ref: '#/components/responses/tokenPinUpdate200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/dates/update:
    patch:
      summary: Update Dates
      description: >-
        This endpoint allows the calling application to Amend Token Dates (Valid-From and/or Valid-To) within the AIR platform.
      operationId: updateTokenDates

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenDatesUpdate'


      responses:
        200:
          $ref: '#/components/responses/tokenDatesUpdate200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/unexpire:
    post:
      summary: Unexpire a token and set a new expiry date
      description: >-
        This endpoint allows the calling application to Unexpire a token and set a new expiry date within the 
        AIR platform.
      operationId: unexpireToken
      tags:
        - Token
      requestBody:
        $ref: '#/components/requestBodies/tokenUnexpire'
      responses:
        200:
          $ref: '#/components/responses/tokenDatesUpdate200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/balancecheck:
    post:
      summary: Balance Check
      description: >-
        This endpoint allows the calling application to check an Account (Token) Balance. Please note&#58;
        * Checking balance would leave auditable trace in AIR in a form of an Account Transaction,
        * this endpoint is applicable only for Stored Value Accounts
      operationId: checkBalance

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenBalanceCheck'


      responses:
        200:
          $ref: '#/components/responses/tokenBalanceCheck200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/refund:
    post:
      summary: Refund
      description: >-
        This endpoint allows the calling application to perform a refund for an Account (Token). This API is replaced 
        by the POS Connect account APIs.
      operationId: refund
      deprecated: true

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenRefund'


      responses:
        200:
          $ref: '#/components/responses/tokenBalanceCheck200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/resend:
    post:
      summary: Resend
      description: >-
        This method allows the calling application to resend requested Token (maintaining existing AIR Account without the need for previous Token being deactivated and issuing new one). Please note that the initial delivery method (EMAIL/SMS) cannot be changed. The initial template will also be used if a new Template Id is not provided.
      operationId: resendToken

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenResend'

      responses:
        200:
          $ref: '#/components/responses/tokenResend200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/reissue:
    patch:
      summary: Reissue
      description: >-
        This method allows the calling application to request reissuing a Token (Invalidate Requested Token and Create a new one instead). Please note AIR Account ID will remain the same.
      operationId: reissueToken

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenReissue'

      responses:
        200:
          $ref: '#/components/responses/tokenReissue200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

  /token/void:
    patch:
      summary: Void
      description: >-
        This method allows the calling application to Void a Token within the AIR platform. Please note this operation can not be undone.
      operationId: voidToken

      tags:
        - Token

      requestBody:
        $ref: '#/components/requestBodies/tokenVoid'

      responses:
        200:
          $ref: '#/components/responses/tokenVoid200'
        400:
          $ref: '#/components/responses/error400Response'
        401:
          $ref: '#/components/responses/error401Response'
        403:
          $ref: '#/components/responses/error403Response'
        404:
          $ref: '#/components/responses/error404Response'
        415:
          $ref: '#/components/responses/error415Response'
        429:
          $ref: '#/components/responses/tooManyRequests'
        500:
          $ref: '#/components/responses/error500Response'

security:
  - eesAuthenticationClientId: []
    eesAuthentictionHash: []

components:

  schemas:

    tokenAccountEntity:
      type: object
      required:
        - accountId
        - accountTypeId
        - accountType
        - accountSubType
        - token
        - tokenId
        - issuerId
        - accountStatus
        - tokenStatus
        - tokenDates
        - resourceType
        - resourceId
        - balances
      properties:
        accountId:
          type: integer
          format: int64
          description: Account ID (EES Reference)
          nullable: false
        accountTypeId:
          type: integer
          format: int32
          nullable: false
          description: Account Type ID (EES Internal Type Reference)
        accountType:
          type: string
          description: Account Type
          enum:
            - Endpoints applicable to COUPON Account Type
            - Endpoints applicable to STORED_VALUE Account Type
          nullable: false
        accountSubType:
          type: string
          description: Account Sub-type
          nullable: false
          enum:
            - ECOUPON
            - CONTINUITY
            - PAPER
            - VOUCHER
            - DEBIT
            - PLASTIC
        token:
          type: string
          format: string
          nullable: false
          description: Generated Token
        tokenId:
          type: integer
          format: int64
          nullable: false
          description: Token ID (EES Reference)
        consumerId:
          type: integer
          format: int64
          nullable: false
          description: Consumer ID (EES Reference)
        issuerId:
          type: integer
          format: int64
          nullable: false
          description: Issuer ID
        barcodeImage:
          type: string
          format: string
          nullable: false
          description: >-
            An base64-encoded Barcode Image of the generated Token. Please note currently 128C Barcode Type is supported only.
        accountStatus:
          type: string
          description: Account status
          nullable: false
          enum:
            - ACTIVE
            - BLOCKED
            - CANCELLED
            - DELETED
            - EXPIRED
            - INACTIVE
            - INVALIDATED
            - LOCKED
            - STOLEN
            - USED
        tokenStatus:
          type: string
          description: Token status
          nullable: false
          enum:
            - INACTIVE
            - ACTIVE
            - REDEEMED
            - CANCELLED
            - EXPIRED
            - INVALIDATED
        balances:
          $ref: '#/components/schemas/accountBalancesEntity'
        serialNumber:
          type: string
          format: string
          nullable: false
          description: >-
            Token Serial Number. Please note this optional attribute is available for Stored Value Account only. This attribute will not show up in the Response unless appropriate Programme setting is turned on
        tokenDates:
          type: object
          required:
            - start
            - end
          properties:
            start:
              type: string
              format: date-time
              nullable: false
              pattern: >-
                ^((((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))\-02\-29|((19\d{2}|[2-9]\d{3})\-((0[13578]|1[02])\-31))|((19\d{2}|[2-9]\d{3})\-(0[13-9]|1[0-2])\-(29|30))|((19\d{2}|[2-9]\d{3})\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-8])))\ ([01][0-9]\:[0-5][0-9]\:[0-5][0-9]|2[0-3]\:[0-5][0-9]\:[0-5][0-9]))$
              description: Token Valid From date-time
            end:
              type: string
              format: date-time
              nullable: false
              pattern: >-
                ^((((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))\-02\-29|((19\d{2}|[2-9]\d{3})\-((0[13578]|1[02])\-31))|((19\d{2}|[2-9]\d{3})\-(0[13-9]|1[0-2])\-(29|30))|((19\d{2}|[2-9]\d{3})\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-8])))\ ([01][0-9]\:[0-5][0-9]\:[0-5][0-9]|2[0-3]\:[0-5][0-9]\:[0-5][0-9]))$
              description: Token Valid To date-time
        resourceType:
          type: string
          description: Resource Type
          nullable: false
          enum:
            - CAMPAIGN
            - PROGRAMME
        resourceId:
          type: integer
          format: int64
          nullable: false
          description: 'Programme Id, Campaign Id'
        pin:
          type: string
          format: string
          nullable: false
          description: >
            This JSON property would return randomly generated by the AIR PIN,
            if a referenced Resource (Campaign or Programme) is configured to
            support PINs. Because of security reasons AIR would return this
            PIN value only as part of Token Create Response
        overrides:
          $ref: '#/components/schemas/tokenOverrideEntity'

    tokenAccountTransactionIdEntity:
      type: object
      required: [accountTransactionId]
      properties:
        accountTransactionId:
          type: string
          format: string
          nullable: true
          description: >-
            ID of the Account Transaction created as result of this API endpoint call (if applicable, as not all AIR operations would generate Account Transaction)

    deliveryEntity:
      type: object
      description: >-
        Optional section showing up in the Response when Delivery Mechanism was requested
      properties:
        delivery:
          type: object
          required: [type,status]
          properties:
            type:
              type: string
              description: Delivery Type
              enum:
              - EMAIL
              - SMS
            status:
              type: string
              description: Delivery Status
              enum:
              - QUEUED
              - SENT


    defaultErrorEntity:
      type: object
      required:
        - errorCode
        - errorMessage
      properties:
        errorCode:
          type: string
          nullable: false
          description: EES AIR Error Code
          enum:
            - NF
              # Not Found
            - IR
              # Invalid Request
            - U
              # Unknown Error
            - AF
              # Authorisation Failed
            - AT
              # Account Type
            - IFU
              # Insufficient Founds
            - CE
              # Configuration Error
            - IPR
              # IP Address Rejected
            - MNA
              # Method Not Allowed
            - MPA
              # Missing Parameter
            - P
              # Privileges
            - ALR
              # Account Limit Reached
            - CX
              # Campaign Expired
            - CI
              # Campaign Inactive
            - CP
              # Campaign Pending
            - CR
              # Campaign Removed
            - CU
              # Campaign Unknown
            - CORQ
              # Consumer Required
            - CTNR
              # Consumer Type Not Recognized
            - DSN
              # Duplicated Serial Number
            - IW
              # Voucher Can Not Be Created
            - RW
              # Voucher Can Not Be Redeemed
            - VURC
              # No Voucher Available to Redeem for Campaign
            - VURI
              # No Voucher Available to Redeem for this Identity
            - FES
              # Scheduling Format Incorrect
            - IOC
              # Improper Offer Configuration
            - AA
              # Invalid Access to API Method
            - ILA
              # Invalid Load Amount
            - IP
              # Invalid Parameter
            - LIR
              # Outlet Identifier Required
            - LNA
              # Outlet Not Allowed
            - LPR
              # Outlet Prohibited by Campaign Settings
            - MAC
              # Maximum Number of Code Variations
            - MTLE
              # Max Active Tokens Limit Exceeded
            - MLV
              # Maximum Voucher Value Exceeded
            - MAR
              # Minimum Amount Required
            - OC
              # Campaign has no Offer
            - RWI
              # Token can not be Redeemed at this time. Blocked by redemption windows.
            - TEXP
              # Token Expired
            - TULR
              # Token Usage Limit Reached
            - UAS
              # Transaction Not Allowed by current account status
            - UV
              # Voucher Unknown
            - VA
              # Voucher already been sent
            - VC
              # Voucher Cancelled
            - VXP
              # Voucher Expired
            - VI
              # Voucher Invalid
            - VL
              # Voucher Locked
            - VNL
              # Voucher Not Locked
            - VPUF
              # You don't have privileges to unlock this token
            - VSM
              # Voucher Serial Mismatch
            - VUA
              # No vouchers available for this campaign
            - ITID
              # Invalid Transaction ID
            - VU
              # Voucher already redeemed
            - IH
              # Invalid Header set
            - RFL
              # Max redemption limit ... per period ... has been exceeded
            - ISD
              # Invalid Start Date (Could not be outside Campaign Valid From - Campaign Valid To dates)
          example: NF
        errorMessage:
          type: string
          format: string
          nullable: false
          description: Human Friendly EES AIR Error Message
          example: Not Found

      x-enum-values:
        - { 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: Voucher 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 }
        - { errorCode: RFL, errorMessage: "Redemption failed, Max redemption limit ... per period ... has been exceeded" }
        - { errorCode: ISD, errorMessage: "Invalid Start Date (Could not be outside Campaign Valid From - Campaign Valid To dates)" }

    deliveryTemplateEntity:
      type: object
      nullable: false
      properties:
        template:
          type: object
          required: [templateId]
          properties:
            templateId:
              type: integer
              format: int32
              description: EES AIR Template ID to be used when resending Token to a Consumer

    transactionDetailsEntity:
      type: object
      nullable: false
      description: JSON Object without a fixed structure (EES AIR Meta-Data)
      example:
        key1: Value1
        key2: AnotherValue

    deliveryRequestEntity:
      description: >-
        Optional section (key and value), if defined AIR will try to deliver
        EMAIL or SMS delivery notification to requested end-Client.
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: Requested Delivery Method
          enum:
            - EMAIL
            - SMS
        scheduled:
          type: string
          format: date-time
          description: The date and time of delivery for the token code in the format YYYY-MM-DD HH:MM:SS
        template:
          type: object
          properties:
            templateId:
              type: integer
              format: int32
              nullable: false
              description: >-
                Id of the template, from AIR, to be used to deliver the message. This parameter is mandatory
                if the templateId is not defined on the campaign.
            content:
              description: Optional (additional) Template Variables & Values (key-values)
              type: object
              nullable: false
              example:
                key1:
                  type: string
                  format: string
                  description: Additional Template Variable Name
                key2:
                  type: string
                  format: string
                  description: Additional Template Variable Value

    accountBalancesEntity:
      type: object
      anyOf:
        - required: [available]
        - required: [refundable]
        - required: [totalSpend]
        - required: [transactionCount]
        - required: [current]
        - required: [usable]
        - required: [locked]
        - required: [lifetime]
      properties:
        available:
          type: integer
          format: int32
          nullable: false
          description: >-
            The available balance. This is applicable for all account types,
            except CONTINUITY, which uses its own balance keys.
        refundable:
          type: integer
          format: int32
          nullable: false
          description: >-
            The refundable balance. Applicable for all Account types, except
            ECOUPON and CONTINUITY
        totalSpend:
          type: integer
          format: int32
          nullable: false
          description: The Total Spend balance. Applicable only to Continuity Account types
        transactionCount:
          type: integer
          format: int32
          nullable: false
          description: The Transaction Counter. Applicable only to Continuity Account types
        current:
          type: integer
          format: int32
          nullable: false
          description: >-
            The Current Balance of the Account. Applicable only to Point
            Accounts
        usable:
          type: integer
          format: int32
          nullable: false
          description: The Usable Balance of the Account. Applicable only to Point Accounts
        locked:
          type: integer
          format: int32
          nullable: false
          description: >-
            The Locked Balance of the Account. Applicable only to Point
            Accounts
        lifetime:
          type: integer
          format: int32
          nullable: false
          description: >-
            The Lifetime balance of the Account. Applicable only to Point
            Accounts

    tokenCreateResourceTypeAndResourceIdEntity:
      type: object
      required:
        - resourceType
        - resourceId
      properties:
        resourceType:
          type: string
          description: Type of Account Token to be created
          enum:
            - CAMPAIGN
            - PROGRAMME
          nullable: false
        resourceId:
          description: Campaign ID or Programme ID (depending on `resourceType` value)
          type: integer
          format: int64
          nullable: false

    tokenLocationDeliveryMobileWalletEntity:
      type: object
      minProperties: 0
      properties:
        location:
          type: string
          format: string
          description: >-
            [Optional] Outlet incoming identifier to override where this Transaction has happened, if not provided AIR will use location arisen from used API Key
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'
        delivery:
          $ref: '#/components/schemas/deliveryRequestEntity'
        mobileWallet:
          type: string
          format: boolean
          nullable: false
          default: false
          description: >-
              An optional boolean flag, to instruct API to include a link to Mobile Wallet into a Response. (Please note this feature requires App Manager service enabled for a Client).

    tokenCreateOrReissueSharedEntity:
      type: object
      minProperties: 0
      properties:
        barcodeImage:
          type: boolean
          nullable: false
          description: >-
            An optional boolean flag to instruct AIR to include into returned Response an additional attribute `barcodeImage` containing base64-encoded Barcode Image of the Token. Please note currently 128C Barcode Format is supported only.
          enum:
            - true
          default: false
        tokenDates:
          type: object
          nullable: false
          oneOf:
            - required: [start]
            - required: [end]
          description: >-
            [Optional] This optional request structure allows to override Campaign or Programme settings for Token Valid-From and/or Valid-To dates;  newly created Token will have these dates as explicitly requested. Please note explicit date-times has to be within a referenced Campaign or Programme validity window.
          properties:
            start:
              type: string
              format: date-time
              pattern: >-
                ^((((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))\-02\-29|((19\d{2}|[2-9]\d{3})\-((0[13578]|1[02])\-31))|((19\d{2}|[2-9]\d{3})\-(0[13-9]|1[0-2])\-(29|30))|((19\d{2}|[2-9]\d{3})\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-8])))\ ([01][0-9]\:[0-5][0-9]\:[0-5][0-9]|2[0-3]\:[0-5][0-9]\:[0-5][0-9]))$
              nullable: false
              description: Token Valid-From date-time
            end:
              type: string
              format: date-time
              pattern: >-
                ^((((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))\-02\-29|((19\d{2}|[2-9]\d{3})\-((0[13578]|1[02])\-31))|((19\d{2}|[2-9]\d{3})\-(0[13-9]|1[0-2])\-(29|30))|((19\d{2}|[2-9]\d{3})\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-8])))\ ([01][0-9]\:[0-5][0-9]\:[0-5][0-9]|2[0-3]\:[0-5][0-9]\:[0-5][0-9]))$
              nullable: false
              description: Token Valid-To date-time
        consumerIdentifier:
          type: object
          nullable: false
          minProperties: 1
          maxProperties: 1
          oneOf:
            - required: [email]
            - required: [mobile]
            - required: [consumerId]
            - required: [reference]
          description: >-
            Only one of following keys could be provided to fulfil Consumer search (by email, by mobile number, by customerId, by external system Reference). If Consumer with provided email or mobile doesn't exist, AIR will create a new Consumer using provided email or mobile. Please note for Campaigns with a strict issuance per Consumer limit this field will be mandatory.
          properties:
            email:
              type: string
              format: string
              nullable: false
              description: Consumer email
            mobile:
              type: string
              format: string
              nullable: false
              description: Consumer mobile number
            consumerId:
              type: string
              format: string
              nullable: false
              description: Id of the Consumer in EES AIR
            reference:
              type: string
              format: string
              nullable: false
              description: >-
                External system Consumer Reference, so EES AIR could search for
                provided value
        value:
          type: object
          properties:
            amount:
              type: integer
              format: int32
              default: 0
              description: >-
                This property is applicable to Stored Value Accounts, to provide initial Account Balance for a created Token, Please note Account Balance should be denominated to a smallest currency unit (for British Pound it should be in pence)
        overrides:
          $ref: '#/components/schemas/tokenOverrideEntity'

    tokenOverrideEntity:
      type: object
      nullable: false
      minProperties: 0
      maxProperties: 2
      description:  >-
        [Optional] Overrides for reward or continuityQualification of the Token. Both the Unit and Campaign must have overrides enabled to use this.
      properties:
        reward:
          type: object
          nullable: false
          minProperties: 0
          description: Reward overrides for the Token.
          properties:
            discountAmount:
              type: integer
              minimum: 1
              description: The amount that should be discounted.
            creditAmount:
              type: integer
              minimum: 0
              description: The number of points to credit a Points Account with.
            finalAmount:
              type: integer
              minimum: 1
              description: The final amount to override with.
            percentageAmount:
              type: number
              minimum: 1
              description: A percentage amount to be discounted. This must be an integer unless `allowDecimal` is enabled in the Unit.
            discountValue:
              type: integer
              minimum: 1
              description: The discount value to override with.
        continuityQualification:
          type: object
          nullable: false
          minProperties: 0
          maxProperties: 3
          description: Continuity qualification overrides for the Token.
          properties:
            totalTransactionUnits:
              type: integer
              minimum: 1
              description: The number of units that are needed in the transaction to qualify for the reward.
            totalTransactionSpend:
              type: integer
              minimum: 1
              description: The transaction spend amount needed to qualify for the reward.
            totalTransactionCount:
              type: integer
              minimum: 1
              description: The number of Account Transactions needed to qualify for the reward.

    tokenOrAccountIdEntity:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
      minProperties: 1
      maxProperties: 1
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)

    locationEntity:
      type: object
      properties:
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened

    detailsEntity:
      type: object
      minProperties: 1
      nullable: false
      properties:
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    pinEntity:
      type: object
      maxProperties: 1
      properties:
        pin:
          type: string
          format: string
          nullable: false
          description: >-
            If this key and its value is present in a incoming Request, EES AIR would perform additional check (if known to AIR PIN matches requested PIN) and only if true, AIR would attempt to perform requested action. Up to the calling application to include this key into Request Payload or not.

    tokenLoadRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
        - required: [amount]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        value:
          type: object
          nullable: false
          required: [value]
          properties:
            amount:
              type: integer
              format: int64
              nullable: false
              description: >-
                amount to be credited to an Account
        autoActivateOnLoad:
          type: boolean
          default: true
          nullable: false
          description: >-
            Optional flag to instruct AIR to Activate an Account on successful load, (if this flag is not present in the request, Account status will be changed to ACTIVE)

        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenVerifyRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        lock:
          type: boolean
          nullable: false
          default: false
          description: >-
            Optional boolean flag to instruct AIR to lock this token to the particular location so it can not be verified, redeemed nor debited elsewhere, until the lock is present.
        pin:
          type: string
          format: string
          nullable: false
          description: >-
            If this key is present in the Request payload, AIR will perform an additional check and only if this value matches the PIN stored in AIR then Verify action will be attempted. Up to the calling application to include PIN into a Request Payload or not.
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where this Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenUnlockRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        lock:
          type: boolean
          nullable: false
          default: false
          description: >-
            Optional boolean flag to instruct AIR to lock this token to the particular location so it can not be verified, redeemed nor debited elsewhere, until the lock is present.
        pin:
          type: string
          format: string
          nullable: false
          description: >-
            If this key is present in the Request payload, EES AIR will perform an additional check if it matches with a PIN value stored in EES AIR and only if it matches the Unlock action will be attempted. Up to the calling application to include this key into Request Payload or not.
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where this Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenRedeemRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        pin:
          type: string
          format: string
          nullable: false
          description: >-
            If this key is present in the Request payload, AIR will perform an additional check if it matches with a PIN value stored in AIR and only if it matches next action (in this case Redemption) will be attempted. Up to the calling application to include this key into Request Payload or not.
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenCancelRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenVoidRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenPinUpdateRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
        - required: [pin]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        pin:
          type: string
          format: string
          nullable: false
          description: >-
            If this key is present in the Request payload, EES AIR will perform an additional check if it matches with a PIN value stored in EES AIR and only then the next action will be attempted (in this case PIN change). Up to the calling application to include this key into Request Payload or not.
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenDatesUpdateRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
        - required: [tokenDates]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        tokenDates:
          type: object
          nullable: false
          oneOf:
            - required: [start]
            - required: [end]
          properties:
            start:
              type: string
              format: date-time
              description: Token Valid-From date-time
              nullable: false
              pattern: >-
                ^((((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))\-02\-29|((19\d{2}|[2-9]\d{3})\-((0[13578]|1[02])\-31))|((19\d{2}|[2-9]\d{3})\-(0[13-9]|1[0-2])\-(29|30))|((19\d{2}|[2-9]\d{3})\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-8])))\ ([01][0-9]\:[0-5][0-9]\:[0-5][0-9]|2[0-3]\:[0-5][0-9]\:[0-5][0-9]))$
            end:
              type: string
              format: date-time
              description: Token Valid-To date-time
              nullable: false
              pattern: >-
                ^((((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))\-02\-29|((19\d{2}|[2-9]\d{3})\-((0[13578]|1[02])\-31))|((19\d{2}|[2-9]\d{3})\-(0[13-9]|1[0-2])\-(29|30))|((19\d{2}|[2-9]\d{3})\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-8])))\ ([01][0-9]\:[0-5][0-9]\:[0-5][0-9]|2[0-3]\:[0-5][0-9]\:[0-5][0-9]))$
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'

    tokenUnexpireRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
      description: >-
        Please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      required: [tokenDates]
      properties:
        token:
          type: string
          format: string
          nullable: false
          description: EES AIR Token
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID,
        tokenDates:
          type: object
          nullable: false
          required: [ end ]
          properties:
            end:
              type: string
              format: date-time
              description: Token Valid-To date-time
              nullable: false
              pattern: >-
                ^((((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00))\-02\-29|((19\d{2}|[2-9]\d{3})\-((0[13578]|1[02])\-31))|((19\d{2}|[2-9]\d{3})\-(0[13-9]|1[0-2])\-(29|30))|((19\d{2}|[2-9]\d{3})\-(0[1-9]|1[0-2])\-(0[1-9]|1[0-9]|2[0-8])))\ ([01][0-9]\:[0-5][0-9]\:[0-5][0-9]|2[0-3]\:[0-5][0-9]\:[0-5][0-9]))$
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'


    tokenCreditRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
        - required: [value]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        value:
          type: object
          nullable: false
          required:
            - amount
          properties:
            amount:
              type: integer
              format: int64
              description: Amount (monetary) to be credited to an EES AIR Account
              nullable: false
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'
      example:
        accountId: 134153416
        value:
          amount: 150

    tokenDebitRequest:
      type: object
      oneOf:
        - required: [token]
        - required: [accountId]
        - required: [value]
      description: >-
        please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
      properties:
        accountId:
          type: integer
          format: int64
          nullable: false
          description: EES AIR Account ID
        token:
          type: string
          format: string
          nullable: false
          description: Token (Value)
        value:
          type: object
          nullable: false
          required:
            - amount
          properties:
            amount:
              type: integer
              format: int64
              description: Amount (monetary) to be debited from an EES AIR Account
              nullable: false
        location:
          type: string
          format: string
          nullable: false
          description: >-
            [Optional] Outlet incoming identifier where Transaction has happened
        details:
          $ref: '#/components/schemas/transactionDetailsEntity'
      example:
        accountId: 134153416
        value:
          amount: 150

    deliveryResponseEntity:
      type: object
      nullable: false
      properties:
        delivery:
          type: object
          required:
            - type
            - status
          properties:
            type:
              type: string
              format: string
              description: Delivery Type
              nullable: false
              enum:
                - EMAIL
                - SMS
            status:
              type: string
              description: Delivery Status
              nullable: false
              enum:
                - QUEUED
                - SENT

    mobileWalletUrlResponseEntity:
      type: object
      required:
        - mobileWalletUrl
      properties:
        mobileWalletUrl:
          type: string
          format: string
          nullable: false
          description: 'Mobile Wallet URL, this attribute will be returned only if '

    accountTransactionId:
      type: object
      properties:
        accountTransactionId:
          type: string
          format: string
          description: Transaction Id

  requestBodies:

    tokenCreate:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenCreateResourceTypeAndResourceIdEntity'
              - $ref: '#/components/schemas/tokenCreateOrReissueSharedEntity'
              - $ref: '#/components/schemas/tokenLocationDeliveryMobileWalletEntity'
              - type: object
                properties:
                  tokenCode:
                    type: string
                    description: 'Used for the token, if campaign is configured to allow it'
                  accountDetails:
                    type: object
                    properties:
                      utm_source:
                        type: string
                        format: string
                        description: Identifies which site sent the traffic
                      utm_medium:
                        type: string
                        format: string
                        description: Identifies what type of link was used
                      utm_campaign:
                        type: string
                        format: string
                        description: Identifies a specific product promotion or strategic campaign
                      utm_term:
                        type: string
                        format: string
                        description: Identifies search terms
                      utm_content:
                        type: string
                        format: string
                        description: Identifies what specifically was clicked to bring the user to the site

            example:
              resourceType: CAMPAIGN
              resourceId: 1178
              tokenDates:
                start: '2018-11-21 16:22:20'
                end: '2019-01-21 16:22:20'
          examples:
            'Create a COUPON':
              value:
                resourceType: CAMPAIGN
                resourceId: 1178
            'Create a COUPON with a token code':
              value:
                resourceType: CAMPAIGN
                resourceId: 1178
                tokenCode: '23587254325'
            'Create a STORED VALUE':
              value:
                resourceType: PROGRAMME
                resourceId: 2247
            'Create a STORED VALUE - Complex example':
              value:
                resourceType: PROGRAMME
                resourceId: 2247
                tokenDates:
                  start: '2017-01-25 00:00:00'
                  end: '2018-02-28 23:59:59'
                consumerIdentifier:
                  email: 'john.doe@domain.org'
                value:
                  amount: 1000
                location: 'Guildford High Street'
                details:
                  foo: bar
                  key1: value1
                delivery:
                  type: EMAIL
                  template:
                    templateId: 664
                    content:
                      variable: value
                      anotherVariable: anotherValue
            'Create a Coupon with tracking information':
              value:
                resourceType: 'CAMPAIGN'
                resourceId: 18
                accountDetails:
                  utm_source: 'twitter'
                  utm_medium: 'social'
                  utm_campaign: 'Big drink offer'
                  utm_term: 'beer'
                  utm_content: 'Get it now'

    tokenLoad:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenLoadRequest'
          example:
            token: '6337780396438949156'
            value:
              amount: 300

    tokenActivate:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenOrAccountIdEntity'
              - $ref: '#/components/schemas/locationEntity'
              - $ref: '#/components/schemas/detailsEntity'
            description: >-
              please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
          example:
            token: '1279365310'

    tokenBalanceCheck:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenOrAccountIdEntity'
              - $ref: '#/components/schemas/pinEntity'
              - $ref: '#/components/schemas/locationEntity'
              - $ref: '#/components/schemas/detailsEntity'

            description: >-
              please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
          example:
            token: '6337780396438949156'

    tokenRefund:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenOrAccountIdEntity'
              - type: object
                properties:
                  amount:
                    type: integer
                    format: int32
                    description: Refund Amount
              - $ref: '#/components/schemas/pinEntity'
              - $ref: '#/components/schemas/locationEntity'
              - $ref: '#/components/schemas/detailsEntity'
              - $ref: '#/components/schemas/accountTransactionId'


            description: >-
              please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
          example:
            token: '6337780396438949156'
            amount: 1500

    tokenResend:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenOrAccountIdEntity'
              - $ref: '#/components/schemas/deliveryTemplateEntity'

            description: >-
              please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
          example:
            token: '6337780396438949156'
            template:
              templateId: 77883

    tokenReissue:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenOrAccountIdEntity'
              - $ref: '#/components/schemas/tokenCreateOrReissueSharedEntity'
              - $ref: '#/components/schemas/tokenLocationDeliveryMobileWalletEntity'

            description: >-
              please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
          example:
            token: '6337780396438949156'
            template:
              templateId: 77883

    tokenRedeem:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenRedeemRequest'
          example:
            token: "EEIRM35KCX"
            location: Guildford-HighStreet
            details:
              key1: 'Key #1 Value'
              key2: 'Key #2 Value'

    tokenUnredeem:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenRedeemRequest'
          example:
            token: "EEIRM35KCX"
            location: Guildford-HighStreet
            details:
              key1: 'Key #1 Value'
              key2: 'Key #2 Value'

    tokenCancel:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenCancelRequest'
          example:
            token: '6684962791'

    tokenVoid:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenVoidRequest'
          example:
            token: '6684962791'

    tokenVerify:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenVerifyRequest'
          example:
            token: "33753743845"
            lock: true
            location: "Guildford_HighStreet"
            details:
              key1: "Key #1 Value"
              key2: "Key #2 Value"

    tokenUnlock:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenUnlockRequest'
          example:
            token: "33753743845"
            location: "Guildford_HighStreet"
            details:
              key1: "Key #1 Value"
              key2: "Key #2 Value"

    tokenPinUpdate:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenPinUpdateRequest'
          example:
            token: "33753743845"
            pin: "77335511"

    tokenDatesUpdate:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenDatesUpdateRequest'
          example:
            token: '6684962791'
            tokenDates:
              start: '2017-12-20 07:00:00'
              end: '2018-03-23 21:00:01'

    tokenUnexpire:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenUnexpireRequest'

    tokenCredit:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenCreditRequest'
          example:
            token: "6337780396438949156"
            value:
              amount: 150

    tokenDebit:
      description: JSON Request Payload
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/tokenDebitRequest'
          example:
            token: "6337780396438949156"
            value:
              amount: 150

  responses:
    tokenCreate201:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'
              - $ref: '#/components/schemas/mobileWalletUrlResponseEntity'
              - $ref: '#/components/schemas/deliveryResponseEntity'
          example:
            accountId: 115950017
            accountStatus: ACTIVE
            accountTypeId: 1
            accountTransactionId: '187730287'
            accountType: COUPON
            balances:
              available: 0
              refundable: 0
            issuerId: 10800
            resourceId: 111300
            resourceType: CAMPAIGN
            token: 430ABCDEDD
            tokenDates:
              start: '2017-01-25 00:00:00'
              end: '2018-02-28 23:59:59'
            tokenId: 116049300
            tokenStatus: ACTIVE
          x-fullExample:
            request:
              Content-Type: application/json;charset=utf-8
              Accept: application/json
              X-EES-AUTH-CLIENT-ID: aaabbbccccdddeee357
              X-EES-AUTH-HASH: 9c359c7d5cdfb59d6a987913c5b42374163469e91161f423a7ddf930403dc1e7
              Connection: keep-alive
              Accept-Encoding: 'gzip,deflate'
              clientSecret: 111111
              X-EES-TRANSACTION-ID: external-system-unique-reference-1123
              X-CUSTOM-SUBSYSTEM-ID: CRM
              body:
                resourceType: CAMPAIGN
                resourceId: '111300'
            response:
              HTTP Status: HTTP/1.1 201 Created
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 115950017
                accountStatus: ACTIVE
                accountTypeId: 1
                accountTransactionId: '187730287'
                accountType: COUPON
                balances:
                  available: 0
                  refundable: 0
                issuerId: 10800
                resourceId: 111300
                resourceType: CAMPAIGN
                token: 430ABCDEDD
                tokenDates:
                  start: '2017-01-25 00:00:00'
                  end: '2018-02-28 23:59:59'
                tokenId: 116049300
                tokenStatus: ACTIVE

    tokenActivate200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153409
            accountStatus: ACTIVE
            accountTypeId: 2
            accountTransactionId: '188934252'
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 0
              refundable: 0
            issuerId: 14898
            resourceId: 104472
            resourceType: PROGRAMME
            token: '1279365310'
            tokenDates:
              start: '2018-01-18 10:31:33'
              end: '2038-01-19 03:14:07'
            tokenId: 134248793
            tokenStatus: ACTIVE

          x-fullExample:
            request:
              Content-Type: application/json;charset=utf-8
              Accept: application/json
              X-EES-AUTH-CLIENT-ID: aaabbbccccdddeee357
              X-EES-AUTH-HASH: 9c359c7d5cdfb59d6a987913c5b42374163469e91161f423a7ddf930403dc1e7
              Connection: keep-alive
              Accept-Encoding: 'gzip,deflate'
              clientSecret: 111111
              X-EES-TRANSACTION-ID: external-system-unique-reference-1123
              X-CUSTOM-SUBSYSTEM-ID: CRM
              body:
                accountId: '134153409'

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153409
                accountStatus: ACTIVE
                accountTypeId: 2
                accountTransactionId: '188934252'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 0
                  refundable: 0
                issuerId: 14898
                resourceId: 104472
                resourceType: PROGRAMME
                token: '1279365310'
                tokenDates:
                  start: '2018-01-18 10:31:33'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248793
                tokenStatus: ACTIVE

    tokenLoad200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: '188934281'
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 100
              refundable: 100
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'


          x-fullExample:
            request:
              Content-Type: application/json;charset=utf-8
              Accept: application/json
              X-EES-AUTH-CLIENT-ID: aaabbbccccdddeee357
              X-EES-AUTH-HASH: 9c359c7d5cdfb59d6a987913c5b42374163469e91161f423a7ddf930403dc1e7
              Connection: keep-alive
              Accept-Encoding: 'gzip,deflate'
              clientSecret: 111111
              X-EES-TRANSACTION-ID: external-system-unique-reference-1123
              X-CUSTOM-SUBSYSTEM-ID: CRM
              body:
                accountId: 134153416
                value:
                  amount: 100


            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153416
                accountStatus: ACTIVE
                accountTypeId: 6
                accountTransactionId: '188934281'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 100
                  refundable: 100
                issuerId: 14898
                resourceId: 103723
                resourceType: PROGRAMME
                token: '6337780396438949156'
                tokenDates:
                  start: '2018-01-18 10:41:18'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248800
                tokenStatus: ACTIVE
                serialNumber: '73126'

    tokenCancel200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153413
            accountStatus: INACTIVE
            accountTypeId: 2
            accountTransactionId: null
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 0
              refundable: 0
            issuerId: 14898
            resourceId: 104472
            resourceType: PROGRAMME
            token: '6684962791'
            tokenDates:
              start: '2017-12-20 07:00:00'
              end: '2018-03-23 21:00:01'
            tokenId: 134248797
            tokenStatus: ACTIVE

          x-fullExample:
            request:
              Content-Type: application/json;charset=utf-8
              Accept: application/json
              X-EES-AUTH-CLIENT-ID: aaabbbccccdddeee357
              X-EES-AUTH-HASH: 9c359c7d5cdfb59d6a987913c5b42374163469e91161f423a7ddf930403dc1e7
              Connection: keep-alive
              Accept-Encoding: 'gzip,deflate'
              clientSecret: 111111
              X-EES-TRANSACTION-ID: external-system-unique-reference-1123
              X-CUSTOM-SUBSYSTEM-ID: CRM
              body:
                accountId: '134153409'

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153409
                accountStatus: ACTIVE
                accountTypeId: 2
                accountTransactionId: '188934252'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 0
                  refundable: 0
                issuerId: 14898
                resourceId: 104472
                resourceType: PROGRAMME
                token: '1279365310'
                tokenDates:
                  start: '2018-01-18 10:31:33'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248793
                tokenStatus: ACTIVE

    tokenVoid200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153413
            accountStatus: INACTIVE
            accountTypeId: 2
            accountTransactionId: null
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 0
              refundable: 0
            issuerId: 14898
            resourceId: 104472
            resourceType: PROGRAMME
            token: '6684962791'
            tokenDates:
              start: '2017-12-20 07:00:00'
              end: '2018-03-23 21:00:01'
            tokenId: 134248797
            tokenStatus: ACTIVE

          x-fullExample:
            request:
              Content-Type: application/json;charset=utf-8
              Accept: application/json
              X-EES-AUTH-CLIENT-ID: aaabbbccccdddeee357
              X-EES-AUTH-HASH: 9c359c7d5cdfb59d6a987913c5b42374163469e91161f423a7ddf930403dc1e7
              Connection: keep-alive
              Accept-Encoding: 'gzip,deflate'
              clientSecret: 111111
              X-EES-TRANSACTION-ID: external-system-unique-reference-1123
              X-CUSTOM-SUBSYSTEM-ID: CRM
              body:
                accountId: '134153409'

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153409
                accountStatus: ACTIVE
                accountTypeId: 2
                accountTransactionId: '188934252'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 0
                  refundable: 0
                issuerId: 14898
                resourceId: 104472
                resourceType: PROGRAMME
                token: '1279365310'
                tokenDates:
                  start: '2018-01-18 10:31:33'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248793
                tokenStatus: ACTIVE

    tokenRedeem201:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153833
            accountStatus: USED
            accountTypeId: '1'
            accountTransactionId: '188935142'
            accountType: COUPON
            accountSubType: ECOUPON
            balances:
              available: 0
            issuerId: 5807
            resourceId: 112136
            resourceType: CAMPAIGN
            token: EEIRM35KCX
            tokenDates:
              start: '2018-01-18 11:16:39'
              end: '2018-04-30 17:14:59'
            tokenId: 134249217
            tokenStatus: REDEEMED


          x-fullExample:
            request:
              Content-Type: application/json;charset=utf-8
              Accept: application/json
              X-EES-AUTH-CLIENT-ID: aaabbbccccdddeee357
              X-EES-AUTH-HASH: 9c359c7d5cdfb59d6a987913c5b42374163469e91161f423a7ddf930403dc1e7
              Connection: keep-alive
              Accept-Encoding: 'gzip,deflate'
              clientSecret: 111111
              X-EES-TRANSACTION-ID: external-system-unique-reference-1123
              X-CUSTOM-SUBSYSTEM-ID: CRM
              body:
                token: EEIRM35KCX
                location: Guildford-HighStreet
                details:
                  key1: 'Key #1 Value'
                  key2: 'Key #2 Value'

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153833
                accountStatus: USED
                accountTypeId: '1'
                accountTransactionId: '188935142'
                accountType: COUPON
                accountSubType: ECOUPON
                balances:
                  available: 0
                issuerId: 5807
                resourceId: 112136
                resourceType: CAMPAIGN
                token: EEIRM35KCX
                tokenDates:
                  start: '2018-01-18 11:16:39'
                  end: '2018-04-30 17:14:59'
                tokenId: 134249217
                tokenStatus: REDEEMED

    tokenPinUpdate200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: null
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 0
              refundable: 0
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'
            pin: '77335511'

          x-fullExample:
            request:
              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:
                accountId: 134153416
                pin: '77335511'

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153416
                accountStatus: ACTIVE
                accountTypeId: 6
                accountTransactionId: null
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 0
                  refundable: 0
                issuerId: 14898
                resourceId: 103723
                resourceType: PROGRAMME
                token: '6337780396438949156'
                tokenDates:
                  start: '2018-01-18 10:41:18'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248800
                tokenStatus: ACTIVE
                serialNumber: '73126'
                pin: '77335511'

    tokenDatesUpdate200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153413
            accountStatus: INACTIVE
            accountTypeId: 2
            accountTransactionId: null
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 0
              refundable: 0
            issuerId: 14898
            resourceId: 104472
            resourceType: PROGRAMME
            token: '6684962791'
            tokenDates:
              start: '2017-12-20 07:00:00'
              end: '2018-03-23 21:00:01'
            tokenId: 134248797
            tokenStatus: ACTIVE

          x-fullExample:
            request:
              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:
                accountId: 134153413
                tokenDates:
                  start: '2017-12-20 07:00:00'
                  end: '2018-03-23 21:00:01'

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153413
                accountStatus: INACTIVE
                accountTypeId: 2
                accountTransactionId: null
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 0
                  refundable: 0
                issuerId: 14898
                resourceId: 104472
                resourceType: PROGRAMME
                token: '6684962791'
                tokenDates:
                  start: '2017-12-20 07:00:00'
                  end: '2018-03-23 21:00:01'
                tokenId: 134248797
                tokenStatus: ACTIVE

    tokenBalanceCheck200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: '188934334'
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 200
              refundable: 200
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'


          x-fullExample:
            request:
              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:
                token: '6337780396438949156'

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153416
                accountStatus: ACTIVE
                accountTypeId: 6
                accountTransactionId: '188934334'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 200
                  refundable: 200
                issuerId: 14898
                resourceId: 103723
                resourceType: PROGRAMME
                token: '6337780396438949156'
                tokenDates:
                  start: '2018-01-18 10:41:18'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248800
                tokenStatus: ACTIVE
                serialNumber: '73126'

    tokenCredit201:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: '188934288'
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 250
              refundable: 250
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'

          x-fullExample:
            request:
              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:
                accountId: 134153416
                value:
                  amount: 150

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153416
                accountStatus: ACTIVE
                accountTypeId: 6
                accountTransactionId: '188934288'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 250
                  refundable: 250
                issuerId: 14898
                resourceId: 103723
                resourceType: PROGRAMME
                token: '6337780396438949156'
                tokenDates:
                  start: '2018-01-18 10:41:18'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248800
                tokenStatus: ACTIVE
                serialNumber: '73126'

    tokenDebit201:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: '188934292'
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 200
              refundable: 200
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'

          x-fullExample:
            request:
              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:
                accountId: 134153416
                value:
                  amount: 50

            response:
              HTTP Status: HTTP/1.1 201 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153416
                accountStatus: ACTIVE
                accountTypeId: 6
                accountTransactionId: '188934292'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 200
                  refundable: 200
                issuerId: 14898
                resourceId: 103723
                resourceType: PROGRAMME
                token: '6337780396438949156'
                tokenDates:
                  start: '2018-01-18 10:41:18'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248800
                tokenStatus: ACTIVE
                serialNumber: '73126'

    tokenVerify201:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: '188934329'
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 200
              refundable: 200
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'
            promoId: null

          x-fullExample:
            request:
              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:
                accountId: 134153416
                location: Guildford-HighStreet
                details:
                  key1: 'Key #1 Value'
                  key2: 'Key #2 Value'

            response:
              HTTP Status: HTTP/1.1 201 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153416
                accountStatus: ACTIVE
                accountTypeId: 6
                accountTransactionId: '188934329'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 200
                  refundable: 200
                issuerId: 14898
                resourceId: 103723
                resourceType: PROGRAMME
                token: '6337780396438949156'
                tokenDates:
                  start: '2018-01-18 10:41:18'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248800
                tokenStatus: ACTIVE
                serialNumber: '73126'
                promoId: null

    tokenUnlock200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: '188934322'
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 200
              refundable: 200
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'


          x-fullExample:
            request:
              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:
                accountId: 134153416
                location: Guildford-HighStreet
                details:
                  key1: 'Key #1 Value'
                  key2: 'Key #2 Value'

            response:
              HTTP Status: HTTP/1.1 201 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                accountId: 134153416
                accountStatus: ACTIVE
                accountTypeId: 6
                accountTransactionId: '188934322'
                accountType: STORED_VALUE
                accountSubType: VOUCHER
                balances:
                  available: 200
                  refundable: 200
                issuerId: 14898
                resourceId: 103723
                resourceType: PROGRAMME
                token: '6337780396438949156'
                tokenDates:
                  start: '2018-01-18 10:41:18'
                  end: '2038-01-19 03:14:07'
                tokenId: 134248800
                tokenStatus: ACTIVE
                serialNumber: '73126'

    tokenResend200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'
              - $ref: '#/components/schemas/deliveryEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: null
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 100
              refundable: 100
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'
            delivery:
              type: EMAIL
              status: SENT


          x-fullExample:
            request:
              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:
                {}

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                {}

    tokenReissue200:
      description: EES AIR successfully processed this request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/tokenAccountEntity'
              - $ref: '#/components/schemas/tokenAccountTransactionIdEntity'
              - $ref: '#/components/schemas/deliveryEntity'

          example:
            accountId: 134153416
            accountStatus: ACTIVE
            accountTypeId: 6
            accountTransactionId: null
            accountType: STORED_VALUE
            accountSubType: VOUCHER
            balances:
              available: 100
              refundable: 100
            issuerId: 14898
            resourceId: 103723
            resourceType: PROGRAMME
            token: '6337780396438949156'
            tokenDates:
              start: '2018-01-18 10:41:18'
              end: '2038-01-19 03:14:07'
            tokenId: 134248800
            tokenStatus: ACTIVE
            serialNumber: '73126'
            delivery:
              type: EMAIL
              status: SENT


          x-fullExample:
            request:
              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:
                {}

            response:
              HTTP Status: HTTP/1.1 200 OK
              Content-Type: application/json;charset=utf-8
              Content-Encoding: gzip
              payload:
                {}


    error400Response:
      description: >-
        EES AIR refuse to process that particular Request as there is something
        wrong with the Request (e.g. Request Payload is unprocessable, Mandatory
        Request Parameter value is not provided, etc.)
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: MPA
              errorMessage: "Missing Parameter 'parameter'"

    error401Response:
      description: >-
        EES AIR refuse to process that particular Request due to Authentication
        error(s). This could be caused by missing one or more of mandatory AUTH
        headers, invalid Hash calculation, invalid or inactive API Key used, etc.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: AF
              errorMessage: >-
                Authentication Failure, Please check if required AUTH headers
                are present in your Request and if AUTH Hash is calculated
                correctly

    error403Response:
      description: >-
        EES AIR refuse to process that particular Request due to Authorisation
        error(s). Please note nothing is wrong with  Authentication nor hash
        Calculation, it is simply due to lack of permission to perform that
        particular action (e.g. Issuance Partner attempts to Redeem a Token or
        Redemption Partner attempts to Issue a Token, etc.)
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: AF
              errorMessage: Authorisation Failure

    error404Response:
      description: >-
        EES AIR refuse to process that particular Request as requested Resource
        could not be found or referenced Resource is not active.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: NF
              errorMessage: Campaign 1178 not found

    error415Response:
      description: >-
        EES AIR refuse to process that particular Request as requested
        `Mime-Type` is not supported (Currently only `application/json` is
        supported
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: '??'
              errorMessage: '??'

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

    error500Response:
      description: >-
        EES AIR is not able to process that particular Request due to Unexpected
        Server Error.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: U
              errorMessage: Unknown Server Error

    error503Response:
      description: >-
        EES AIR is not able to process that particular Request due to one or more EES AIR Services being         Unavailable. Please note during EES scheduled maintenance window, EES APIs may not be available
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: '??'
              errorMessage: '??'

    error504Response:
      description: >-
        EES AIR is not able to process that particular Request due to Networking
        issues (Gateway Timeout)
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/defaultErrorEntity'
            example:
              errorCode: '??'
              errorMessage: '??'

  parameters:

    eesAuthenticationClientId:
      name: X-EES-AUTH-CLIENT-ID
      in: header
      description: 'Client ID, provided during Client onboarding by EES'
      required: true
      schema:
        type: string
        format: string
        nullable: false

    eesAuthenticationRequestHash:
      name: X-EES-AUTH-HASH
      in: header
      description: >-
        Request Authentication Hash, obtained by concatenating Full Request URI
        Path (with API prefix), Request Query String(s) (if applicable), Request
        Payload (if applicable), Client Secret and then calculating SHA256 from
        this concatenated string
      required: true
      schema:
        type: string
        format: string
        nullable: false

    httpConnection:
      name: Connection
      in: header
      required: false
      schema:
        type: string
        default: close
        enum:
          - close
          - keep-alive
        nullable: false
      description: >-
        This general HTTP header controls (or rather influences) whether a
        network connection would stay in a special state, allowing it to be reused,
        after the current transaction finishes. This special state removes the
        need for the TCP 3-way handshake for new connections and helps avoid TCP
        slow-start, but it requires HTTP 1.1 or higher to be used. If this
        header value is `keep-alive`, the connection would stay in this special
        state on the EES Server, so subsequent requests to the same server could
        benefit from persistent connection mechanism. Please note these
        connections will be closed after `X` seconds of inactivity or every `Y`
        requests (`X` and `Y` values are returned by EES API as a Response
        Header `Keep-Alive` value).

    httpAcceptEncoding:
      name: Accept-Encoding
      in: header
      required: false
      schema:
        type: string
        nullable: false
        enum:
          - gzip
          - deflate
          - 'gzip,deflate'
      description: >-
        This general 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 compression algorithms are `gzip` and `deflate`, if
        this Request Header is not present in a request, no compression will be
        used.

  securitySchemes:
    eesAuthenticationClientId:
      type: apiKey
      in: header
      description: >-
        Client ID, This will be provided by EES and is unique to the company
        calling the API. Please note the authentication mechanic requires the
        receipt of the full payload so any headers that would chunk the request
        up, such as transfer-encoding chunked could potentially cause
        authentication failures.
      name: X-EES-AUTH-CLIENT-ID
    eesAuthentictionHash:
      type: apiKey
      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. Please note the authentication mechanic requires the
        receipt of the full payload so any headers that would chunk the request
        up, such as transfer-encoding chunked could potentially cause
        authentication failures.
      name: X-EES-AUTH-HASH
