Update reward custom field

This API allows you to update a custom field created for a reward.

👍

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 .

Prerequisites

  • Authentication: Basic or OAuth authentication details
  • Access group resource: Default

Resource information

URI/api_gateway/rewards/core/v1/brand/customfield/{id}
HTTP methodPUT
Rate limitNA
Batch supportNA

API endpoint example

https://eucrm.cc.capillarytech.com/api_gateway/rewards/core/v1/brand/customfield/106

Request path parameter

ParameterData TypeDescription
id*StringUnique name identifier for the custom field.

Request body parameter

Parameter NameData TypeDescription
name*StringUnique name identifier for the custom field.
orgIdStringUnique identifier for the organisation. To retrieve the orgId, use the Get Org Details API.
description*StringDescription for the custom field.
isMandatoryBooleanIndicates if the custom field is mandatory. Supported values:
true: Field is mandatory
false: Field is optional (default value)
isActiveBooleanIndicates the status of the custom field. Supported values:
true: Status is active (default value)
false: Status is inactive.
scope*EnumIndicates where the additional custom fields will apply. Supported values:
REWARD: While creating or updating a reward.
ISSUE_REWARD: While issuing a reward.
CATALOGUE_PROMOTION: While creating or updating a promotion.
defaultValueStringDefault value for the custom field used when no value is specified.
dataType*StringType of data for the custom field. Supported values:
BOOLEAN, ENUM, DATE, STRING, INTEGER.
255 is the character limit for the datatype STRING.

Use ENUM as the dataType to define a set of pre-defined values, ensuring error-free management of reward metadata. For example, as a reward manager, you can create a custom field called "Reward Category" and define possible values such as "Discount," "Free Gift," and "Cashback." When creating or updating a reward, you can select one of these predefined values for the "Reward Category" custom field.
enumValuesObjectObject containing the enum values. This parameter is required if dataType is ENUM.
Note:

- Define enum values using double quotes in a comma-separated list.
- You can provide a maximum of 30 enum values per custom field.
- Each enum value must not exceed 80 characters.
- Allowed special characters: []()-_ .
- Values must be unique within the custom field.
- defaultValue must be provided if dataType is ENUM.
{
    "orgId": 100458,
    "name": "CF1A112",
    "description": "CF1A112",
    "isMandatory": false,
    "isActive": true,
    "scope": "REWARD",
    "defaultValue": null,
    "dataType": "STRING"
}
{
    "orgId": 100458,
    "name": "Order confirmed",
    "description": "Reward is processing",
    "isMandatory": false,
    "isActive": true,
    "scope": "CATALOGUE_PROMOTION",
    "defaultValue": null,
    "dataType": "STRING"
}
{
    "orgId": 100458,
    "name": "CF1A112",
    "description": "CF1A112",
    "isMandatory": false,
    "isActive": true,
    "scope": "ISSUE_REWARD",
    "defaultValue": null,
    "dataType": "STRING"
}
{
    "orgId": 100458,
    "name": "CustomField",
    "description": "",
    "isMandatory": false,
    "isActive": false,
    "defaultValue": "PRIMARY",
    "dataType": "ENUM",
    "scope": "ISSUE_REWARD",
    "enumValues": [
        "PRIMARY",
        "SECONDARY"
    ]
}

Response parameters

Parameter NameData TypeDescription
idIntegerUnique identifier for the custom field.
orgIdIntegerUnique identifier of the organisation.
nameStringUnique name for the custom field.
descriptionStringDescription of the custom field.
isMandatoryBooleanIndicates if the custom field is mandatory. Possible values:
true: Field is mandatory
false: Field is optional (default value)
isActiveBooleanSpecify the status of the custom field. Possible values:
true: Status is active (default value)
false: Status is inactive.
scopeStringSpecify where the additional custom fields will apply. Possible values:
REWARD: While creating or updating a reward.
ISSUE_REWARD: While issuing a reward.
CATALOGUE_PROMOTION: While creating or updating a promotion.
defaultValueStringDefault value for the custom field used when no value is specified.
dataTypeStringType of data for the custom field. Possible values:
BOOLEAN, ENUM, DATE, STRING, INTEGER.
createdByIntegerUnique customer identifier of the user who created the custom field
createdOnDateCreation date and time of the field.
lastUpdatedByIntegerUnique customer identifier of the user who last updated the custom field
lastUpdatedOnDateLast update date and time of the field.
enumValuesObjectObject containing the enum values.
{
    "id": 209,
    "orgId": 100458,
    "name": "CF1A112",
    "description": "CF1A112",
    "isMandatory": false,
    "isActive": true,
    "scope": "REWARD",
    "defaultValue": null,
    "dataType": "STRING",
    "createdBy": 75086856,
    "createdOn": null,
    "lastUpdatedBy": 75086856,
    "lastUpdatedOn": null
}
{
    "id": 6913,
    "orgId": 100458,
    "name": "Order confirmed",
    "description": "Reward is processing",
    "isMandatory": false,
    "isActive": true,
    "scope": "CATALOGUE_PROMOTION",
    "defaultValue": null,
    "dataType": "STRING",
    "createdBy": 75130850,
    "createdOn": null,
    "lastUpdatedBy": 75130850,
    "lastUpdatedOn": null
}
{
    "id": 210,
    "orgId": 100458,
    "name": "CF1A112",
    "description": "CF1A112",
    "isMandatory": false,
    "isActive": true,
    "scope": "ISSUE_REWARD",
    "defaultValue": null,
    "dataType": "STRING",
    "createdBy": 75086856,
    "createdOn": null,
    "lastUpdatedBy": 75086856,
    "lastUpdatedOn": null
}
{
    "id": 15006,
    "orgId": 1231,
    "name": "CustomField",
    "description": "",
    "isMandatory": false,
    "isActive": true,
    "scope": "ISSUE_REWARD",
    "defaultValue": "PRIMARY",
    "dataType": "ENUM",
    "createdBy": 50716508,
    "createdOn": null,
    "lastUpdatedBy": 50716508,
    "lastUpdatedOn": null,
    "enumValues": [
        "PRIMARY",
        "SECONDARY"
    ]
}

API-specific error codes

Error codeDescriptionReason
3022ISSUE REWARD scope limit reached, max is {max_limit}. Allowed limit is 10.-
3025Default value not found in the enum listThe default value provided does not match any of the enums.
3030Enum value cannot be emptyOne or more enum values are null.
3024Invalid characters in enum value. Allowed characters: [a-z,A-Z,0-9, -_ ]One or more enum values have an unsupported character.
400ENUM's list size is out of limitThe enum object does not contain any values.
3028Enum value exceeds the limit of 80 charactersOne or more enum values have exceeded the supported character limit.
3029Duplicate enum values foundA duplicate enum is provided
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!