---
title: "Refund"
method: POST
path: "/token/refund"
tags: ["Token"]
deprecated: true
---

# Refund

`POST /token/refund`

> **Deprecated.**

This endpoint allows the calling application to perform a refund for an Account (Token). This API is replaced  by the POS Connect account APIs.

## Request body

- union
  - object — please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
    - `amount` integer — Refund Amount
    - `pin` string, string — 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.
    - `location` string, string — [Optional] Outlet incoming identifier where Transaction has happened
    - `details` TransactionDetailsEntity — JSON Object without a fixed structure (EES AIR Meta-Data)
    - `accountTransactionId` string, string — Transaction Id
  - object — please note - one of the following attributes `accountId` or `token` is mandatory and has to be provided
    - `amount` integer — Refund Amount
    - `pin` string, string — 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.
    - `location` string, string — [Optional] Outlet incoming identifier where Transaction has happened
    - `details` TransactionDetailsEntity — JSON Object without a fixed structure (EES AIR Meta-Data)
    - `accountTransactionId` string, string — Transaction Id

## Response `200`

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` AccountBalancesEntity, required — The object of balances. Some balances only apply to certain types of accounts. See notes below on balances.
    - `available` integer — The available balance. This is applicable for all account types, except POINTS and CONTINUITY, which uses its own balance keys. For ECOUPON account type this property will be returned and will be equal to zero.
    - `refundable` integer — The refundable balance. This is applicable for all account types except POINTS and CONTINUITY, but is not used during account creation. For an Account Entity, the amount displayed here is the total refundable balance available. Please note for ECOUPON account type this property will be returned and equal to zero.
    - `totalSpend` integer — The total spend balance. Applicable only to CONTINUITY type Accounts. If totalSpend is not provided on creation, this will be set to 0.
    - `transactionCount` integer — The transaction counter. Applicable only to CONTINUITY type Accounts. If transactionCount is not provided on creation, this will be set to 0.
    - `current` integer — The current balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
    - `usable` integer — The usable balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
    - `locked` integer — The locked balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
    - `lifetime` integer — The lifetime balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
  - `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.net/eagleeye/apis/wallet-api.md) · [All operations](https://skmtc.net/eagleeye/apis/wallet-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eagleeye/wallet-api/versions/90a122bb14cc/schema)
