v1

latestOpenAPI 3.0.12026-07-24501176.6 MB

Create badges

post/api_gateway/v1/badges/badgeMeta

Headers

X-CAP-BADGES-MIGRATION:string

Enables you to use historical badges.

Request body

RAW_BODYstring json

{ "name": "Furry Friend Badge", "description": "Purchase 5 pet products in 3 months and get a pet grooming voucher", "startOn": 1699596721, "expiresOn": 1828754110, "earnedBadgeExpiry": { "expiryType": "RELATIVE", "relativeExpirytype": "MONTHS", "value": 3 }, "ownership": { "restrictedToOwners": [ "Loyalty" ] }, "customerConstraints": [ { "constraintType": "CUSTOMER_BADGE_FIXED_VALUE", "maxEarnLimit": 1 } ], "badgeConstraints": [ { "constraintType": "BADGE_FIXED_VALUE", "maxEarnLimit": 1000 } ], "earnType": "EARN", "benefits": [ { "benefitType": "COUPON", "seriesId": 13686 }, { "benefitType": "LOYALTY_POINTS", "points": 100, "programId": 626, "promotionId": 80332, "allocationStrategyId": 1489, "expirationStrategyId": 3843 } ], "tags": [ { "name": "Type", "value": "Birthday" } ] }

Response

201

OR

Example response

{
  "data": {
    "id": "662749408fe258516a88fe89",
    "orgId": 100458,
    "name": "BADGE123",
    "description": "Purchase 5 pet products in 3 months and get a pet grooming voucher",
    "startOn": 1716803487,
    "expiresOn": 1726804000,
    "earnedBadgeExpiry": {
      "expiryType": "ABSOLUTE",
      "type": "WITH_BADGE_META",
      "expireWithBadgeMeta": true
    },
    "ownership": {
      "restrictedToOwners": [
        "Milestones"
      ]
    },
    "customerConstraints": [
      {
        "constraintType": "CUSTOMER_BADGE_FIXED_WINDOW",
        "referenceId": "e6791ec9-e92f-34af-bdc3-be2607fdf82c",
        "durationType": "DAYS",
        "refreshRate": 3,
        "maxEarnLimit": 1,
        "cycleStatus": "UPCOMING",
        "startDate": 1716803487,
        "endDate": 1726804000
      }
    ],
    "badgeConstraints": [
      {
        "constraintType": "BADGE_FIXED_WINDOW",
        "referenceId": "a1350b49-eb8e-3500-9e43-01f5493c91c1",
        "durationType": "DAYS",
        "refreshRate": 3,
        "maxEarnLimit": 2,
        "startDate": 1716803487,
        "endDate": 1726804000,
        "cycleStatus": "UPCOMING"
      }
    ],
    "benefits": [
      {
        "benefitType": "COUPON",
        "seriesId": 6789
      }
    ],
    "badgeRank": 1,
    "earnType": "EARN",
    "status": "UPCOMING",
    "createdOn": 1713850688.8114,
    "createdBy": 75086856,
    "lastUpdatedOn": 1713850688.8114,
    "lastUpdatedBy": 75086856
  }
}