Issue badge (earn)

This API allows you to issue badges to the customer (the customer earns the badge).

👍

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 .
  • A badge can be issued via MemberCare without any owners or claim.

Prerequisites

  • Authentication: Basic authentication
  • Default access group

Resource information

URI/api_gateway/v1/badges/customer/earn
HTTP methodPOST
PaginationNo
Rate limitNA
Batch supportNA

API endpoint example

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

Request body parameters

ParameterData TypeDescription
badgeMetaIdStringUnique identifier ("id") generated during the creation of the badge.
customerId*NumberUnique identifier for the customer.
requestId*StringEnter a unique identifier to identify the request.
earnEventDateDateThe 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.
triggeredByObjectThe object containing information about what triggered the action.
ownerType*EnumThe module for which the badge is being issued.
Supported values: LOYALTY/REFERRAL_CAMPAIGNS/JOURNEYS/AUDIENCE_CAMPAIGNS/
REWARDS_CATALOG/ GOODWILL_MODULE/ MILESTONES.
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": "66276dc68fe258516a88ff8e",
   	"earnEventDate":"2023-11-03T21:51:00.192Z",
    "customerId": 62090013,
    "requestId": 2132,
    "triggeredBy": {
        "ownerType": "Loyalty",
        "referenceId": "123694"
    }
}

Reponse parameters

ParameterData TypeDescription
badgeMetaIdStringUnique identifier for the badge metadata.
customerIdNumberUnique identifier for the customer.
earnedBadgeIdStringUnique identifier for the earned badge.
expiresOnNumberThe time indicating when the badge expires. Timestamp in the ISO 8601 standard format format YYYY-MM-DDTHH:MM:SS.SSSZ.
errorsArrayArray to list any errors.
warningsArrayArray to list any warnings.
{
    "data": {
        "badgeMetaId": "66276dc68fe258516a88ff8e",
        "customerId": 62090013,
        "earnedBadgeId": "662771bd8fe258516a88ff98",
        "expiresOn": 1715070653.447744000,
        "requestId": 2131
    },
    "errors": [],
    "warnings": []
}

API-specific error codes

Error codeDescription
809Request with the same requestId is not allowed
811Badge issue is mandatory before earn
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!