---
title: "Credit"
method: POST
path: "/token/credit"
tags: ["Token"]
---

# Credit

`POST /token/credit`

## Request

- Base URL: `https://consumer.uk.eagleeye.com/2.0`
- URL: `https://consumer.uk.eagleeye.com/2.0/token/credit`
- Auth: API key in header `X-EES-AUTH-CLIENT-ID` and API key in header `X-EES-AUTH-HASH`

This method allows the calling application to Credit an Account identified by a Account ID or a Token. Applicable to Stored Value Account types.

## Request body

- union: please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
  - object
    - `accountId` integer: EES AIR Account ID
    - `token` string, string, required: Token (Value)
    - `value` object
      - `amount` integer, required: Amount (monetary) to be credited to an EES AIR Account
    - `location` string, string: [Optional] Outlet incoming identifier where Transaction has happened
    - `details` TransactionDetailsEntity: JSON Object without a fixed structure (EES AIR Meta-Data)
  - object
    - `accountId` integer, required: EES AIR Account ID
    - `token` string, string: Token (Value)
    - `value` object
      - `amount` integer, required: Amount (monetary) to be credited to an EES AIR Account
    - `location` string, string: [Optional] Outlet incoming identifier where Transaction has happened
    - `details` TransactionDetailsEntity: JSON Object without a fixed structure (EES AIR Meta-Data)
  - object
    - `accountId` integer: EES AIR Account ID
    - `token` string, string: Token (Value)
    - `value` object, required
      - `amount` integer, required: Amount (monetary) to be credited to an EES AIR Account
    - `location` string, string: [Optional] Outlet incoming identifier where Transaction has happened
    - `details` TransactionDetailsEntity: JSON Object without a fixed structure (EES AIR Meta-Data)

## Response `201`

EES AIR successfully processed this request

- object
  - `accountId` integer, required: Account ID (EES Reference)
  - `accountTypeId` integer, required: Account Type ID (EES Internal Type Reference)
  - `accountType` 'Endpoints applicable to COUPON Account Type' | 'Endpoints applicable to STORED_VALUE Account Type', required: Account Type
  - `accountSubType` 'ECOUPON' | 'CONTINUITY' | 'PAPER' | 'VOUCHER' | 'DEBIT' | 'PLASTIC', required: Account Sub-type
  - `token` string, string, required: Generated Token
  - `tokenId` integer, required: Token ID (EES Reference)
  - `consumerId` integer: Consumer ID (EES Reference)
  - `issuerId` integer, required: Issuer ID
  - `barcodeImage` string, string: An base64-encoded Barcode Image of the generated Token. Please note currently 128C Barcode Type is supported only.
  - `accountStatus` 'ACTIVE' | 'BLOCKED' | 'CANCELLED' | 'DELETED' | 'EXPIRED' | 'INACTIVE' | 'INVALIDATED' | 'LOCKED' | 'STOLEN' | 'USED', required: Account status
  - `tokenStatus` 'INACTIVE' | 'ACTIVE' | 'REDEEMED' | 'CANCELLED' | 'EXPIRED' | 'INVALIDATED', required: Token status
  - `balances` union, required
    - object
      - `available` integer, required: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer: The Lifetime balance of the Account. Applicable only to Point Accounts
    - object
      - `available` integer: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer, required: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer: The Lifetime balance of the Account. Applicable only to Point Accounts
    - object
      - `available` integer: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer, required: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer: The Lifetime balance of the Account. Applicable only to Point Accounts
    - object
      - `available` integer: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer, required: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer: The Lifetime balance of the Account. Applicable only to Point Accounts
    - object
      - `available` integer: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer, required: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer: The Lifetime balance of the Account. Applicable only to Point Accounts
    - object
      - `available` integer: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer, required: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer: The Lifetime balance of the Account. Applicable only to Point Accounts
    - object
      - `available` integer: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer, required: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer: The Lifetime balance of the Account. Applicable only to Point Accounts
    - object
      - `available` integer: The available balance. This is applicable for all account types, except CONTINUITY, which uses its own balance keys.
      - `refundable` integer: The refundable balance. Applicable for all Account types, except ECOUPON and CONTINUITY
      - `totalSpend` integer: The Total Spend balance. Applicable only to Continuity Account types
      - `transactionCount` integer: The Transaction Counter. Applicable only to Continuity Account types
      - `current` integer: The Current Balance of the Account. Applicable only to Point Accounts
      - `usable` integer: The Usable Balance of the Account. Applicable only to Point Accounts
      - `locked` integer: The Locked Balance of the Account. Applicable only to Point Accounts
      - `lifetime` integer, required: The Lifetime balance of the Account. Applicable only to Point Accounts
  - `serialNumber` string, string: 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` object, required
    - `start` string, date-time, required: Token Valid-From date-time - If using 'useOldMysqlDateTimes' unit setting, use MySQL datetime format instead.
    - `end` string, date-time, required: Token Valid-To date-time - If using 'useOldMysqlDateTimes' unit setting, use MySQL datetime format instead.
  - `resourceType` 'CAMPAIGN' | 'PROGRAMME', required: Resource Type
  - `resourceId` integer, required: Programme Id, Campaign Id
  - `pin` string, string: 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` TokenOverrideEntity: [Optional] Overrides for reward or continuityQualification of the Token. Both the Unit and Campaign must have overrides enabled to use this.
    - `reward` object: Reward overrides for the Token.
      - `discountAmount` integer: The amount that should be discounted.
      - `creditAmount` integer: The number of points to credit a Points Account with.
      - `finalAmount` integer: The final amount to override with.
      - `percentageAmount` number: A percentage amount to be discounted. This must be an integer unless `allowDecimal` is enabled in the Unit.
      - `discountValue` integer: The discount value to override with.
    - `continuityQualification` object: Continuity qualification overrides for the Token.
      - `totalTransactionUnits` integer: The number of units that are needed in the transaction to qualify for the reward.
      - `totalTransactionSpend` integer: The transaction spend amount needed to qualify for the reward.
      - `totalTransactionCount` integer: The number of Account Transactions needed to qualify for the reward.
  - `accountTransactionId` string, string, nullable, required: ID of the Account Transaction created as result of this API endpoint call (if applicable, as not all AIR operations would generate Account Transaction)

## Other responses

- `400`: 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.)
- `401`: 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.
- `403`: 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.)
- `404`: EES AIR refuse to process that particular Request as requested Resource could not be found or referenced Resource is not active.
- `415`: EES AIR refuse to process that particular Request as requested `Mime-Type` is not supported (Currently only `application/json` is supported
- `429`: Too Many Requests
- `500`: EES AIR is not able to process that particular Request due to Unexpected Server Error.

---

[API](https://skmtc.dev/eagleeye/apis/token-api.md) - [All operations](https://skmtc.dev/eagleeye/apis/token-api/llms.txt) - [OpenAPI document](https://skmtc.dev/eagleeye/apis/token-api/revisions/9213fb14994e?raw)
