Create Event (Custom)

Lets you create a new behavioral event.

Authentication

  • Valid OAuth 2.0 authentication token must be included in the request header.
  • Use the X-CAP-API-OAUTH-TOKEN header to pass the token.

Request Body Parameters

ParameterTypeDescription
eventName*stringName of the event.
actions*enumDestination of the event. Values: EMFConsumer for EMF related events: Loyalty, DVS, and Communication, EIConsumer for Essential Insights.
descriptionstringShort description for the event.
fieldsobjConfigure fields for the current event with attributes: name, type, and value. The various attributes available are:
-addCustomerIfNotExists - Adds the customer if the customer does not exist.
-isRequired - Marks the attribute as mandatory
-isUniqueKeyField - Includes the attribute, to the unique key. Once defined as a unique key field, this attribute becomes mandatory and needs to be marked as isRequired. By default, customer identifier and event name are already part of the unique key.

- isPsiData - Mark the field as Protected Sensitive Information. For more information refer to, Classify Potentially Sensitive Information (PSI). Note - You cannot enable isPsiData for the mandatory customer identifier field.
namestringSpecify the name of the field.
typeenumSpecify the type of the attribute. Values: tillCode, couponCode, customer, productSku, productBrand, productCategory, string, double.
addCustomerIfNotExistsobjSet this value to true to allow registering new customers into the loyalty program automatically
valueTypeenumData-type of the attribute. For example, Boolean, Enum, String.
valuestringValue of the attribute based on its valueType.For example, if valueType is Boolean, value could be either true or false.
identifierTypeObjectSpecify the identifier type and its value
valueStringSupported values: userId, mobile, email, externalId, wechat, martjackId, cuid, fbid, unionId, fcmToken, line, cardnumber, cardExternalId
valueTypeStringValue for the identifier type
All parameters marked by * are mandatory.

For information on event uniqueness check, see Event uniqueness check.

API specific Error codes

Error CodeDescriptionReason
1806Event_name event already existsAlready existing event name
1810Event_name event actions invalidInvalid or unsupported event actions
1811event name invalidInvalid or unsupported event name
1823tillCod invalid event field typeInvalid or unsupported event field type
1802field attribute value fails for validation type isRequiredInvalid/null field attribute value
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!