Loyalty and Rewards

Templates for creating and updating loyalty rewards in bulk in the Capillary platform.

Loyalty and rewards templates let you create and update rewards in bulk by ingesting reward data from an FTP or SFTP location on a schedule. Each template provides a pre-configured block sequence for a specific loyalty or rewards use case. You select a template, configure the block details for your environment, and deploy the dataflow.

The following templates are available for loyalty and rewards.

Create rewards

Use this template to create or update rewards in bulk from a source file. The template reads reward records from a CSV file, maps each record to the reward schema, and calls the Capillary reward creation API for every record.

Use case

A brand preparing a seasonal loyalty campaign needs to load hundreds of new rewards into its catalog before the campaign goes live. The reward details are exported from the brand's merchandising system to a CSV file. This template reads the file, transforms each row into the reward format, and creates every reward in a single scheduled run.

The template runs seven blocks in sequence: it reads the source file over SFTP, decrypts the content, converts the CSV rows to JSON, applies two transforms to map the data to the reward schema, filters out header or invalid rows, and posts each reward to the reward creation API.

Block configuration

The following table lists the blocks in the Create rewards template, describes what each block does, and provides the configured values for each field.

Block NameConfiguration FieldConfigured Value
Connect-to-source
Type: sftp_read
Hostnamedata.capillarydata.com
Usernamenull
Source directorynull
Filename pattern.*.csv. Matches all CSV files.
Processed directorynull
Unzip filesfalse
API error file pathnull
Search directory recursivelyfalse
Port22
File delimiter,
Report status codeall
Decrypt-data
Type: decrypt_content
Encryption algorithmPGP
Private key fileRedacted
Private passphraseRedacted
Is enabledfalse
File extension.zip
Transform-data-csv
Type: convert_csv_to_json
File type5c5b9607-0173-1000-87ad-a0b9ca44885f
Alphabetical sortfalse
Group size1
JSONPath expression$.[*]
Split responsetrue
Header value$['filter.condition.header']
Line numbers$.["LINE_NO"]
Brand ID$['rewards.standard.brandId']
Reward ID$['standard.data.rewardId']
Transform-data-jslt
Type: jslt_transform
Transformationif (is-array(.)) [ for (.) {} ] else {}
Transform-data-jolt
Type: jolt_transform
JOLT transformationMaps the source fields to the reward schema. Shifts rewards.standard.*, language-specific info, reward-level and customer-level restrictions, payment configs, and custom fields into their target paths, then splits categories on commas and converts each value to an integer.
Filter-Data
Type: filter_on_condition_hidden
Filter condition${header_value:equals('true'):or(${header_value:isEmpty()})}
Connect-to-destination
Type: http_write
Client keynull
Client secretRedacted
API endpoint/api_gateway/rewards/core/v1/reward/create
API base URL{intouch_url}
API methodPOST
OAuth base URL{intouch_url}
Parse responsetrue
Bulk supportfalse
Request split path$
Response split path$
Recoverable error codes502,504,520,521
Parse path map{"status_code":"$.['errors'].*.code","error_message":"$.['errors'].*.message"}
Yielding error codes429
Maximum retries3
Additional headersnull
Rate1000
Period1
Time unitMINUTES


Did this page help you?