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 Name | Configuration Field | Configured Value |
|---|---|---|
| Connect-to-source Type: sftp_read | Hostname | data.capillarydata.com |
| Username | null | |
| Source directory | null | |
| Filename pattern | .*.csv. Matches all CSV files. | |
| Processed directory | null | |
| Unzip files | false | |
| API error file path | null | |
| Search directory recursively | false | |
| Port | 22 | |
| File delimiter | , | |
| Report status code | all | |
| Decrypt-data Type: decrypt_content | Encryption algorithm | PGP |
| Private key file | Redacted | |
| Private passphrase | Redacted | |
| Is enabled | false | |
| File extension | .zip | |
| Transform-data-csv Type: convert_csv_to_json | File type | 5c5b9607-0173-1000-87ad-a0b9ca44885f |
| Alphabetical sort | false | |
| Group size | 1 | |
| JSONPath expression | $.[*] | |
| Split response | true | |
| 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 | Transformation | if (is-array(.)) [ for (.) {} ] else {} |
| Transform-data-jolt Type: jolt_transform | JOLT transformation | Maps 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 key | null |
| Client secret | Redacted | |
| API endpoint | /api_gateway/rewards/core/v1/reward/create | |
| API base URL | {intouch_url} | |
| API method | POST | |
| OAuth base URL | {intouch_url} | |
| Parse response | true | |
| Bulk support | false | |
| Request split path | $ | |
| Response split path | $ | |
| Recoverable error codes | 502,504,520,521 | |
| Parse path map | {"status_code":"$.['errors'].*.code","error_message":"$.['errors'].*.message"} | |
| Yielding error codes | 429 | |
| Maximum retries | 3 | |
| Additional headers | null | |
| Rate | 1000 | |
| Period | 1 | |
| Time unit | MINUTES |
Updated about 6 hours ago
