v1

latestOpenAPI 3.0.12026-07-24501176.6 MB

Get badges for customer

get/api_gateway/v1/badges/customer/{customerId}

Path parameters

customerIdstring required

Query parameters

badgeType'AVAILABLE' | 'EARNED'

The type of badge to display

includeExpiredboolean

This is the earn expiry. If true then all the earned badges which are even expired will be part of the response. If false, then only the badges where earn is active will be a part of the response

sortOnstring

Enables sorting of badges based on rank. Value: rank.

groupIdstring

Badge group ID to which the badge belongs to.

lastEarnedOnDatenumber float

Date and time when the badge was awarded to the customer. Time format: Epoch format (UNIX timestamp in milliseconds).

lastEarnEventDatenumber float

Date and time when a triggering event (transactional or behavioural) occurred, initiating the badge earning. Time format: Epoch format (UNIX timestamp in milliseconds).

Headers

X-CAP-CUSTOMER-IDENTIFIER'email' | 'mobile' | 'cardNumber' | 'externalId'

Pass this header to search the customer based on their email, mobile number, card number or external ID.

Response

200

OR
OR

Example response

{
  "data": {
    "badges": [
      {
        "badgeMetaId": "67eb99516666db076c3c7519",
        "orgId": 100737,
        "name": "Badge Issue georgetest",
        "description": "Make 5 transactions",
        "startOn": 1735715131,
        "expiresOn": 1926235957,
        "images": [
          {
            "name": "Issued",
            "fileSvcHandle": "qwer-8634-8938",
            "url": "https://firebasestorage.googleapis.com/v0/b/createbadges.appspot.com/o/images%2Fsuccess1.jpg?alt=media&token=66b2f0bc-9c55-4e33-a5e9-c6be96d94f2d",
            "tag": "EARNED"
          }
        ],
        "badgeRank": 3,
        "ownership": {
          "restrictedToOwners": [
            "Milestones"
          ],
          "claims": [
            {
              "ownerType": "Loyalty",
              "referenceId": "1234",
              "isActive": true
            }
          ]
        },
        "earnType": "ISSUE_EARN",
        "benefits": [
          {
            "benefitType": "COUPON",
            "seriesId": 13745
          }
        ],
        "customerConstraints": [
          {
            "constraintType": "CUSTOMER_BADGE_FIXED_WINDOW",
            "referenceId": "e6791ec9-e92f-34af-bdc3-be2607fdf82c",
            "durationType": "DAYS",
            "refreshRate": 3,
            "maxEarnLimit": 2,
            "cycleStatus": "ACTIVE",
            "startDate": 1735715131,
            "endDate": 1926235957
          }
        ],
        "badgeConstraints": [
          {
            "constraintType": "BADGE_FIXED_VALUE",
            "maxEarnLimit": 10000
          }
        ],
        "active": true
      }
    ],
    "pagination": {
      "size": 5,
      "total": 5,
      "totalPages": 1
    }
  }
}