Issue badge to multiple customers

This API allows you to issue badges to multiple customers at once.

👍

Note

For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .

API endpoint example

https://eucrm.cc.capillarytech.com/api_gateway/v1/badges/customer/earnBulk

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Default access group

Resource information

URIapi_gateway/v1/badges/customer/earnBulk
HTTP methodPOST
PaginationNA
Rate limitNA
Batch supportNA

Request body parameters

ParameterDatatypeDescription
badgeMetaIdStringUnique identifier ("id") generated during the badge creation.
customerIds*ArrayA list of unique identifiers for customers. To issue bulk badges, pass multiple customerId in an array.
requestIdStringEnter a unique identifier to identify the request.
triggeredByObjectObject containing information about the trigger source for the badge issue.
- ownerType*EnumThe module for which the badge is being issued.
Supported values: Loyalty, Loyalty_Promotion, Referral_Campaigns, Journeys, Audience_Campaigns, Rewards_Catalog, Goodwill_Module, Milestones, Historical_Import
earnEvenrDateDateThe date on which the customer performed the activity. Earn event date has to be between the badge start date and end date if it is a direct earn type of badge and it has to be between the badge issual start date and end date if it is an issue & earn type of badge.
You can also enter a past date. This can be used to issue a badge against an older transaction.
- referenceId*StringEnter a unique identifier to identify the owner (ownerType). The referenceId passed here should be the same as the referenceId in the claim badge API .
{
    "badgeMetaId": "653de334b3cda7078c7c68eb",
    "customerIds": [
  62090013,553162563
    ],
    "requestId": "1234",
  	"earnEventDate":"2023-11-03T21:51:00.192Z",
    "triggeredBy": {
        "ownerType": "Loyalty",
        "referenceId": "123457"
    }
}

Response parameters

ParameterDatatypeDescription
dataObjectThe main container for the badge issue details.
- badgeMetaIdStringUnique identifier ("id") generated during the badge creation.
- triggeredByObjectObject containing information about the trigger source for the badge issue.
-- ownerTypeEnumThe module for which the badge is being issued.
Supported values: LOYALTY/REFERRAL_CAMPAIGNS/JOURNEYS/AUDIENCE_CAMPAIGNS/
REWARDS_CATALOG/ GOODWILL_MODULE/ MILESTONES.
-- referenceIdStringA unique identifier to identify the owner (ownerType).
- expiresOnDateUnix timestamp indicating when the badge issuance expires.
- issuedBadgesArrayA list of objects each representing a badge issued to a customer.
-- customerIdIntegerUnique identifier for the customer who received the badge.
-- issuedIdStringA Unique identifier representing the specific issuance instance of the badge.
-- statusEnumIndicates the current state of the badge. Supported values:
LIVE: The badge is currently available for redemption.
UPCOMING: The badge will be available in the future.
EXPIRED: The badgeis no longer available.
- requestIdStringA unique identifier to identify the request.
errorsArrayA list of any errors that occurred.
warningsArrayA list of warnings.
{
    "data": {
        "badgeMetaId": "653de334b3cda7078c7c68eb",
        "triggeredBy": {
            "ownerType": "Loyalty",
            "referenceId": "123457"
        },
        "expiresOn": 1717935013.121711000,
        "issuedBadges": [
            {
                "customerId": 553162563,
                "issuedId": "661681a535bc684e9e72553a",
                "status": "EXPIRED"
            },
            {
                "customerId": 62090013,
                "issuedId": "661681a535bc684e9e72553b",
                "status": "LIVE"
            }
        ],
        "requestId": "1234"
    },
    "errors": [],
    "warnings": []
}
{
    "data": {
        "badgeMetaId": "66f3be92a8647e03dc526a5f",
        "triggeredBy": {
            "ownerType": "Loyalty",
            "referenceId": "xyz"
        },
        "expiresOn": 1722155344.000000000,
        "issuedBadges": [
            {
                "customerId": 11115,
                "issuedId": "66f3bf91c7bf1e4d65e126b1",
                "error": {
                    "code": 1040,
                    "message": "An active issue for the badge already exists.",
                    "reference": null
                },
                "status": "EXPIRED"
            }
        ],
        "requestId": "VGagtK2zN16jkRU56zs1"
    },
    "errors": [],
    "warnings": []
}

API-specific errors

Error codeDescription
809Request with the same requestId is not allowed.
810The badge needs to be claimed first using the claim badge API.
1040An active issue for the badge already exists.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!