---
title: "Create and Fetch Wallet Accounts"
method: POST
path: "/composite/wallet/accounts/createAndFetch"
tags: ["Recommendations"]
---

# Create and Fetch Wallet Accounts

`POST /composite/wallet/accounts/createAndFetch`

This endpoint allows you to fetch recommendations and campaigns based on the provided identity-value or walletId and mark them as accepted.  Campaigns are fetched based on tags, and accounts are created accordingly. All existing accounts (ACTIVE & LOCKED only) in the wallet are fetched and returned as part of the same response, but only in the results section. A single event is created for all accounts created.

## Request body

- union
  - object
    - `identity-value` string, required — The identity value of the customer. Required if no walletId is provided.
    - `campaigns` union[] — Array of campaigns to create accounts and fetch recommendations.
      - union
        - object
          - `campaignTag` string, required — The tag of the campaign.
          - `status` string, required — The status of the campaign.
          - `state` string, required — The state of the campaign.
        - object
          - `campaignId` integer, required — The ID of the campaign.
          - `status` string, required — The status of the campaign.
          - `state` string, required — The state of the campaign.
  - object
    - `walletId` integer, required — The wallet ID of the customer. Required if no identity-value is provided.
    - `campaigns` union[] — Array of campaigns to create accounts and fetch recommendations.
      - union
        - object
          - `campaignTag` string, required — The tag of the campaign.
          - `status` string, required — The status of the campaign.
          - `state` string, required — The state of the campaign.
        - object
          - `campaignId` integer, required — The ID of the campaign.
          - `status` string, required — The status of the campaign.
          - `state` string, required — The state of the campaign.

## Response `201`

Created

- WalletRecommendationsEntity — Recommendations successfully accepted.
  - `total` integer — Successfully processed Entities count.
  - `failed` object — Failed AIR atomic operations details.
    - `total` integer — Failures item count.
    - `results` DefaultErrorEntity[]
      - `errorCode` 'NF' | 'IR' | 'U' | 'AF' | 'AT' | 'IFU' | 'CE' | 'IPR' | 'MNA' | 'MPA' | 'P' | 'ALR' | 'CX' | 'CI' | 'CP' | 'CR' | 'CU' | 'CORQ' | 'CTNR' | 'DSN' | 'IW' | 'RW' | 'VURC' | 'VURI' | 'FES' | 'IOC' | 'AA' | 'ILA' | 'IP' | 'LIR' | 'LNA' | 'LPR' | 'MAC' | 'MTLE' | 'MLV' | 'MAR' | 'OC' | 'RWI' | 'TEXP' | 'TULR' | 'UAS' | 'UV' | 'VA' | 'VC' | 'VXP' | 'VI' | 'VL' | 'VNL' | 'VPUF' | 'VSM' | 'VUA' | 'ITID' | 'VU' | 'IH' — Internal Error Code
      - `errorMessage` string — Human Friendly Error Message
  - `results` object[]
    - `meta` MetaEntity
      - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
      - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
    - `type` string — Wallet flag informing what is the type of that particular wallet. Could be defined per Client as part of the Onboarding process.
    - `dates` DatesEntity
      - `start` string, date-time
      - `end` string, date-time
    - `state` string — Additional flag, list of possible enum values could be defined per Client, as part of the Onboarding process.
    - `status` 'ACTIVE' | 'DELETED' | 'INACTIVE' | 'SUSPENDED' | 'TERMINATED' | 'MERGED' — Status of the EE Wallet.
    - `balances` object — 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.
    - `walletId` string — Wallet ID.
    - `accountId` string — The account id related to this transaction.
    - `overrides` union
      - CouponAccountOverridesEntity, nullable
        - `offer` object, required — Account's Offer Override (applicable for `COUPON` Account type)
          - `reward` object, nullable, required — Account's Offer Reward Override
            - `discountValue` number, float, nullable — EES AIR Account Override&#58; Discount Value
            - `discountPercentage` number, float, nullable — EES AIR Account Override&#58; Discount Percentage
            - `creditAmount` number, float, nullable — EES AIR Account Override&#58; Credit Amount
            - `finalAmount` number, float, nullable — EES AIR Account Override&#58; Final Amount
            - `percentageAmount` number, float, nullable — EES AIR Account Override&#58; Percentage Amount
          - `qualification` object, required — Account's Offer Qualification Override (Structure TBC)
        - `campaign` object, nullable, required — Campaign Rules Override (applicable for `COUPON` Account type )
          - `rules` object
            - `couponLimit` integer, nullable — Limit of Maximum number of times a Coupon Account can be redeemed
      - ContinuityAccountOverridesEntity, nullable — Account Override for Continuity Type Account.
        - `continuityQualification` object, nullable — Overrides for continuity qualification.
          - `totalTransactionCount` integer, nullable — Account override for totalTransactionCount - Only valid if campaign uses totalTransactionCount.
          - `totalTransactionSpend` integer, nullable — Account override for totalTransactionSpend - Only valid if campaign uses totalTransactionSpend.
          - `totalTransactionUnits` integer, nullable — Account override for totalTransactionUnits - Only valid if campaign uses totalTransactionUnits.
        - `reward` object, nullable — Overrides for continuity rewards
          - `creditAmount` integer — Account override for the amount of points to be awarded.
    - `campaignId` string — Campaign ID.
    - `clientType` string — Account client type.
    - `dateCreated` string — Date this Account was created.
    - `lastUpdated` string — Date this Account was last updated.
    - `mobileWallet` string — The URL that returns a digital platform wallet.
    - `relationships` WalletRelationshipsEntity
      - `parent` string[] — an Array of Wallet IDs that current Wallet should be / is parent
      - `child` string[] — an Array of Wallet IDs that current Wallet should be / is child
      - `associate` string[] — an Array of existing Wallet IDs that current Wallet should be / is associated to
      - `donor` string[] — an Array of existing Wallet IDs that current Wallet is donating into
  - `successful` object — Successfully process accounts.
    - `total` integer, required — Successfully processed Entities count.
    - `results` WalletAccountEntity[], required
      - `accountId` string, required — EES AIR Wallet Account ID
      - `relationships` object — Wallet Accounts Relations
        - `ENTITLEMENT` object
          - `accountType` WalletAccountRelationEntity
            - `accountId` string, int64, required — Account ID
            - `dateCreated` string, date-time, required — Relation creation date-time
        - `ENTITLEMENT_OF` object
          - `accountType` WalletAccountRelationEntity
            - `accountId` string, int64, required — Account ID
            - `dateCreated` string, date-time, required — Relation creation date-time
      - `walletId` string, required — EES AIR Wallet ID
      - `campaignId` string, required — The campaignId (Campaign or Programme) this account belongs to.
      - `type` 'ECOUPON' | 'VOUCHER' | 'PAPER' | 'DEBIT' | 'PLASTIC', required — EES AIR Account Type.
      - `clientType` string, required — Account client type.
      - `status` 'ACTIVE' | 'BLOCKED' | 'CANCELLED' | 'DELETED' | 'EXPIRED' | 'INACTIVE' | 'INVALIDATED' | 'LOCKED' | 'STOLEN' | 'USED', required — Account status
      - `state` string, required — Account state, managed per retailer base, list of possible enum values could be set-up as part of the Onboarding process.
      - `dates` DatesEntity, required
        - `start` string, date-time
        - `end` string, date-time
      - `meta` MetaEntity, required
        - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
        - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
      - `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.
      - `dateCreated` string, date-time, required — Date this Account was created
      - `lastUpdated` string, date-time, required — Date this Account was last updated
      - `tokens` TokenEntity[] — Array of token entities, present only if include=tokens is passed in the query string.
        - `tokenId` string — The Token ID.
        - `accountId` string — The Account ID.
        - `token` string — The Token.
        - `validFrom` string, date-time — The date this token is valid from.
        - `validTo` string, date-time — The date this token is valid to.
        - `dateCreated` string, date-time — The date this token was created.
        - `lastUpdated` string, date-time — The date this token was last updated.
        - `status` string — The status of the Token.
        - `tokenLock` object — Token lock information. All values can be null if no token lock exists.
          - `validFrom` string, date-time — The date the token lock is valid from.
          - `validTo` string, date-time — The date the token lock is valid to.

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Not Found.
- `415` — Unsupported Media Type
- `429` — Too Many Requests
- `500` — 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/revisions/90a122bb14cc/schema)
