Skip to main content

Asset

Overview

The asset object represents a redeemable item assigned to a member: gifts, vouchers, punch cards, and similar loyalty benefits. Each asset is campaign-based and has validity constraints and status tracking.

This is the object to use for gift redemption. It is not the same as a Discount, which only reports a deal the POS already applied and cannot redeem anything.

When to Use This Object

The asset object is returned in responses from member-related endpoints when:

  • Retrieving member details via /member/details
  • Listing all members via /members
  • Viewing transaction history with asset redemptions

Assets are issued by campaigns, not created by clients, and the full asset object is only ever returned to you, never sent. To redeem one, you do send a reference to it, in the usedAssets[] array. See Redeeming an asset below.

Field Reference

FieldTypeDescription
campaignIdstringUnique identifier of the campaign that issued this asset
assetKeystringUnique identifier for this specific asset instance
assignDatestringISO 8601 timestamp when the asset was assigned to the member
statusstringAsset status: "active" (available for use) or "inactive" (expired or used)
validFromstringISO 8601 timestamp indicating when the asset becomes valid
validUntilstringISO 8601 timestamp indicating when the asset expires
assetDetailsobjectMetadata object containing campaign and promotional information

AssetDetails Object

The assetDetails object contains human-readable information about the asset:

FieldTypeDescription
campaignIdstringCampaign identifier (matches parent asset's campaignId)
kindstringAsset type (e.g., "gift", "punchCard")
namestringHuman-readable name of the asset (e.g., "Buy 1 Get 1 Free")
descriptionstringDetailed description of what the asset provides
imagestringURL to the asset's promotional image

Sample Asset Object

{
"campaignId": "6a21b682bd293321900aad44",
"assetKey": "6OtRspANcZcM87WSEWHz",
"assignDate": "2025-02-01T09:01:02.123Z",
"status": "active",
"validFrom": "2025-11-09T23:00:00.000Z",
"validUntil": "2030-11-10T22:59:59.999Z",
"assetDetails": {
"campaignId": "6a21b682bd293321900aad44",
"kind": "gift",
"name": "Buy 1 Get 1 Free",
"description": "Buy any coffee and get another one for free. Valid for all coffee drinks.",
"image": "https://vault.uye.app/hub/assets/basicGift.png"
}
}

Asset Status Values

StatusDescription
activeAsset is valid and available for redemption during qualifying transactions
inactiveAsset has expired or been fully used and is no longer redeemable

Asset Kinds

Common asset kind values include:

KindDescription
giftPromotional gift or benefit that can be redeemed once
punchCardLoyalty punch card asset that tracks multiple redemptions until completion

Redeeming an asset

Redemption is two steps.

1. Read the member's assets. Call /member/details with the header x-return-assets: active. Active assets come back in member.assets[], each with its own assetKey.

2. Redeem it on the transaction. Send the asset in the usedAssets[] array of /transaction.

FieldTypeRequiredDescription
keystringConditionalThe assetKey from member.assets[]. Required unless code is sent
codestringConditionalA redemption code for the asset. Required unless key is sent
appliedAmountnumberNoValue applied, in the smallest currency unit (e.g., cents or kuruş)

Send either key or code, not both. Sending both is rejected.

"usedAssets": [
{
"key": "6OtRspANcZcM87WSEWHz",
"appliedAmount": 500
}
]

The same usedAssets[] array can also be sent to /member/details to check a redemption before committing it. When you do, the transaction object becomes required on that request.

note

Do not use appliedDeals[] for this. That array only reports a deal the POS already applied, and has no redemption effect.

Best Practices

  • Filter by status: When displaying assets to end users, consider filtering for "active" assets unless the UI is designed to show historical or expired benefits
  • Check validity windows: Respect validFrom and validUntil timestamps to ensure assets are presented within their effective date range
  • Display assetDetails: Use the name, description, and image fields from assetDetails to provide context to frontend applications
  • Track redemptions: Monitor which assets are used in transactions via /member/transactions or /member/member-assets endpoints
  • Handle expired assets: Transition assets from "active" to "inactive" when their validUntil timestamp passes
  • member — Contains the assets array in the loyalty member profile
  • transaction: Carries the usedAssets[] array that redeems an asset
  • discount: Reports a deal the POS applied. Does not redeem anything, and is a common wrong turn when looking for gifts
  • /member/details — Returns member information including active and inactive assets
  • /members — Lists all members with their assigned assets