30th Jun 2020

API Reference

The Management API includes all information about your applications, campaigns, rulesets, attributes, and webhooks.

Authentication

Management API operations use a simple bearer token to authenticate requests. You can obtain a bearer token from your credentials using the createSession operation. The token property of the response is used to authenticate further requests with an HTTP header like Authorization: Bearer $TOKEN.

The Talon.One API records all incoming and outgoing requests. These API operations allow you to query those logs.

#

List Applications

GET  /v1/applications

List all application in the current account.

#Example


                                curl --location --request GET 'https://[YOUR DEPLOYMENT].talon.one/v1/applications' \
--header 'Authorization: Bearer [TOKEN]'
                            
                                {
  "data": [
    {
      "id": 1,
      "created": "2019-10-17T15:24:48.250081Z",
      "modified": "2019-10-17T15:24:48.250081Z",
      "accountId": 1,
      "name": "Integration API Application",
      "description": "",
      "timezone": "Europe/Berlin",
      "currency": "EUR",
      "caseSensitivity": "sensitive",
      "attributes": {},
      "limits": [],
      "attributesSettings": {},
      "sandbox": false,
      "loyaltyPrograms": [
        {
          "id": 1,
          "accountID": 1,
          "name": "Loyalty_program",
          "title": "Loyalty Program",
          "description": "Loyalty Program",
          "subscribedApplications": [
            1
          ],
          "defaultValidity": "unlimited",
          "allowSubledger": false
        }
      ]
    },
    {
      "id": 2,
      "created": "2020-04-16T11:34:17.976098Z",
      "modified": "2020-04-16T11:34:17.976098Z",
      "accountId": 1,
      "name": "Developer_Docs",
      "description": "Developer_Docs",
      "timezone": "Europe/Berlin",
      "currency": "EUR",
      "caseSensitivity": "sensitive",
      "attributes": {},
      "limits": [],
      "attributesSettings": {},
      "sandbox": false,
      "loyaltyPrograms": []
    }
  ],
  "totalResultSize": 2
}
                            

#Request Schema

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

modifiedstring
format: date-time

The exact moment this entity was last modified.

accountIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

The name of this application.

descriptionstring

A longer description of the application.

timezonestring
minlength: 1

A string containing an IANA timezone descriptor.

currencystring
minlength: 1

A string describing a default currency for new customer sessions.

caseSensitivitystring
sensitive,insensitive-uppercase,insensitive-lowercase

A string indicating how should campaigns in this application deal with case sensitivity on coupon codes.

attributesobject

Arbitrary properties associated with this campaign

limitsarray

Default limits for campaigns created in this application

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

campaignPrioritystring
universal,stackable,exclusive

Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive). If no value is provided, this is set to "universal"

exclusiveCampaignsStrategystring
listOrder,lowestDiscount,highestDiscount

The strategy used when choosing exclusive campaigns for evaluation, can be one of (listOrder, lowestDiscount, highestDiscount). If no value is provided, this is set to "listOrder"

attributesSettings
mandatory
campaigns array

List of mandatory attributes for campaigns.

coupons array

List of mandatory attributes for campaigns.

sandboxboolean

Flag indicating if this is a live or sandbox application

loyaltyProgramsarray

An array containing all the loyalty programs to which this application is subscribed

id integer

The ID of loyalty program.

accountID integer

The ID of the Talon.One account that owns this program.

name string

The internal name for the Loyalty Program.

title string

The display title for the Loyalty Program.

description string

Description of our Loyalty Program.

subscribedApplications array

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

subscribedApplications integer

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

defaultValidity string

Indicates the default duration after which new loyalty points should expire. The format is a number, followed by one letter indicating the unit; like '1h' or '40m'.

allowSubledger boolean

Indicates if this program supports subledgers inside the program

#

Get Application

GET  /v1/applications/{applicationId}

Get the application specified by the ID.

#Example


                                curl --location --request GET 'https://developerdocs.talon.one/v1/applications/[APPLICATION_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "id": 1,
  "created": "2019-10-17T15:24:48.250081Z",
  "modified": "2019-10-17T15:24:48.250081Z",
  "accountId": 1,
  "name": "Integration API Application",
  "description": "",
  "timezone": "Europe/Berlin",
  "currency": "EUR",
  "caseSensitivity": "sensitive",
  "attributes": {},
  "limits": [],
  "attributesSettings": {},
  "sandbox": false,
  "loyaltyPrograms": [
    {
      "id": 1,
      "accountID": 1,
      "name": "Loyalty_program",
      "title": "Loyalty Program",
      "description": "Loyalty Program",
      "subscribedApplications": [
        1
      ],
      "defaultValidity": "unlimited",
      "allowSubledger": false
    }
  ]
}
                            

#Request Schema

URL Parameter

applicationId integer required

Get the application specified by the ID.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

modifiedstring
format: date-time

The exact moment this entity was last modified.

accountIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

The name of this application.

descriptionstring

A longer description of the application.

timezonestring
minlength: 1

A string containing an IANA timezone descriptor.

currencystring
minlength: 1

A string describing a default currency for new customer sessions.

caseSensitivitystring
sensitive,insensitive-uppercase,insensitive-lowercase

A string indicating how should campaigns in this application deal with case sensitivity on coupon codes.

attributesobject

Arbitrary properties associated with this campaign

limitsarray

Default limits for campaigns created in this application

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

campaignPrioritystring
universal,stackable,exclusive

Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive). If no value is provided, this is set to "universal"

exclusiveCampaignsStrategystring
listOrder,lowestDiscount,highestDiscount

The strategy used when choosing exclusive campaigns for evaluation, can be one of (listOrder, lowestDiscount, highestDiscount). If no value is provided, this is set to "listOrder"

attributesSettings
mandatory
campaigns array

List of mandatory attributes for campaigns.

coupons array

List of mandatory attributes for campaigns.

sandboxboolean

Flag indicating if this is a live or sandbox application

loyaltyProgramsarray

An array containing all the loyalty programs to which this application is subscribed

id integer

The ID of loyalty program.

accountID integer

The ID of the Talon.One account that owns this program.

name string

The internal name for the Loyalty Program.

title string

The display title for the Loyalty Program.

description string

Description of our Loyalty Program.

subscribedApplications array

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

subscribedApplications integer

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

defaultValidity string

Indicates the default duration after which new loyalty points should expire. The format is a number, followed by one letter indicating the unit; like '1h' or '40m'.

allowSubledger boolean

Indicates if this program supports subledgers inside the program

#

Create a Campaign

POST  /v1/applications/{applicationId}/campaigns

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns'  \
--header 'Authorization: Bearer [BEARER_TOKEN]'  \
--header 'Content-Type: application/json'  \
--data-raw '{
 "name": "TEST_CAMPAIGN",
 "state": "disabled",
 "description": "",
 "tags": [],
 "features": [],
 "limits": []}'
                            
                                {
  "id": 70,
  "created": "2020-06-29T14:23:57.798801806Z",
  "applicationId": 2,
  "campaignGroups": null,
  "userId": 1,
  "name": "TEST_CAMPAIGN",
  "description": "",
  "attributes": {},
  "state": "disabled",
  "tags": [],
  "features": [],
  "limits": [],
  "updated": "2020-06-29T14:23:57.798801806Z",
  "updatedBy": "Admin"
}
                            

#Request Schema

URL Parameter

applicationId integer required

Body Parameter

name string required
minlength: 1

A friendly name for this campaign.

description string

A detailed description of the campaign.

startTime string
format: date-time

Datetime when the campaign will become active.

endTime string
format: date-time

Datetime when the campaign will become in-active.

attributes object

Arbitrary properties associated with this campaign

state string required
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetId integer

ID of Ruleset this campaign applies on customer session evaluation.

tags array required

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

features array required

A list of features for the campaign.

Allowed values:

coupons
referrals
loyalty
couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limits array required

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

applicationIdinteger

The ID of the application that owns this entity.

campaignGroupsarray

The IDs of the campaign groups that own this entity.

campaignGroups integer

The IDs of the campaign groups that own this entity.

userIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

A friendly name for this campaign.

descriptionstring

A detailed description of the campaign.

startTimestring
format: date-time

Datetime when the campaign will become active.

endTimestring
format: date-time

Datetime when the campaign will become in-active.

attributesobject

Arbitrary properties associated with this campaign

statestring
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetIdinteger

ID of Ruleset this campaign applies on customer session evaluation.

tagsarray

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

featuresarray

A list of features for the campaign.

features string

A list of features for the campaign.

couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limitsarray

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

couponRedemptionCountinteger

Number of coupons redeemed in the campaign.

referralRedemptionCountinteger

Number of referral codes redeemed in the campaign.

discountCountinteger

Total amount of discounts redeemed in the campaign.

discountEffectCountinteger

Total number of times discounts were redeemed in this campaign.

couponCreationCountinteger

Total number of coupons created by rules in this campaign.

lastActivitystring
format: date-time

Timestamp of the most recent event received by this campaign.

updatedstring
format: date-time

Timestamp of the most recent update to the campaign or any of its elements.

createdBystring

Name of the user who created this campaign if available.

updatedBystring

Name of the user who last updated this campaign if available.

#

List your Campaigns

GET  /v1/applications/{applicationId}/campaigns

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 68,
      "created": "2020-06-29T08:42:47.050098Z",
      "applicationId": 2,
      "campaignGroups": null,
      "userId": 1,
      "name": "COUPON",
      "description": "",
      "attributes": {},
      "state": "enabled",
      "activeRulesetId": 29,
      "tags": [],
      "features": [
        "coupons"
      ],
      "couponSettings": {
        "validCharacters": [
          "3",
          "4",
          "5",
          "7",
          "8",
          "9",
          "A",
          "B",
          "C",
          "D",
          "E",
          "F",
          "H",
          "J",
          "K",
          "L",
          "M",
          "N",
          "P",
          "Q",
          "R",
          "T",
          "U",
          "V",
          "W",
          "X",
          "Y"
        ],
        "couponPattern": "####-####"
      },
      "limits": [],
      "couponRedemptionCount": 1,
      "referralRedemptionCount": 0,
      "discountCount": 1,
      "discountEffectCount": 1,
      "couponCreationCount": 0,
      "lastActivity": "2020-06-29T08:44:16.641898Z",
      "updated": "2020-06-29T08:43:45.495413Z",
      "updatedBy": "Admin"
    },
    {
      "id": 70,
      "created": "2020-06-29T14:23:57.798801Z",
      "applicationId": 2,
      "campaignGroups": null,
      "userId": 1,
      "name": "TEST_CAMPAIGN",
      "description": "",
      "attributes": {},
      "state": "disabled",
      "tags": [],
      "features": [],
      "limits": [],
      "couponRedemptionCount": 0,
      "referralRedemptionCount": 0,
      "discountCount": 0,
      "discountEffectCount": 0,
      "couponCreationCount": 0,
      "updated": "2020-06-29T14:23:57.798801Z",
      "updatedBy": "Admin"
    }
  ],
  "totalResultSize": 2
}
                            

#Request Schema

URL Parameter

applicationId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

campaignState string
enabled,disabled,archived,draft,scheduled,running,expired

Filter results by the state of the campaign.

name string

Filter results performing case-insensitive matching against the name of the campaign.

tags string

Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the "name" query parameter, a logical OR will be performed to search both tags and name for the provided values

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp.

campaignGroupId integer

Filter results to campaigns owned by the specified campaign group ID.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

applicationIdinteger

The ID of the application that owns this entity.

campaignGroupsarray

The IDs of the campaign groups that own this entity.

campaignGroups integer

The IDs of the campaign groups that own this entity.

userIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

A friendly name for this campaign.

descriptionstring

A detailed description of the campaign.

startTimestring
format: date-time

Datetime when the campaign will become active.

endTimestring
format: date-time

Datetime when the campaign will become in-active.

attributesobject

Arbitrary properties associated with this campaign

statestring
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetIdinteger

ID of Ruleset this campaign applies on customer session evaluation.

tagsarray

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

featuresarray

A list of features for the campaign.

features string

A list of features for the campaign.

couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limitsarray

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

couponRedemptionCountinteger

Number of coupons redeemed in the campaign.

referralRedemptionCountinteger

Number of referral codes redeemed in the campaign.

discountCountinteger

Total amount of discounts redeemed in the campaign.

discountEffectCountinteger

Total number of times discounts were redeemed in this campaign.

couponCreationCountinteger

Total number of coupons created by rules in this campaign.

lastActivitystring
format: date-time

Timestamp of the most recent event received by this campaign.

updatedstring
format: date-time

Timestamp of the most recent update to the campaign or any of its elements.

createdBystring

Name of the user who created this campaign if available.

updatedBystring

Name of the user who last updated this campaign if available.

#

Get a Campaign

GET  /v1/applications/{applicationId}/campaigns/{campaignId}

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]
                            
                                {
  "id": 68,
  "created": "2020-06-29T08:42:47.050098Z",
  "applicationId": 2,
  "campaignGroups": null,
  "userId": 1,
  "name": "COUPON",
  "description": "",
  "attributes": {},
  "state": "enabled",
  "activeRulesetId": 29,
  "tags": [],
  "features": [
    "coupons"
  ],
  "couponSettings": {
    "validCharacters": [
      "3",
      "4",
      "5",
      "7",
      "8",
      "9",
      "A",
      "B",
      "C",
      "D",
      "E",
      "F",
      "H",
      "J",
      "K",
      "L",
      "M",
      "N",
      "P",
      "Q",
      "R",
      "T",
      "U",
      "V",
      "W",
      "X",
      "Y"
    ],
    "couponPattern": "####-####"
  },
  "limits": [],
  "couponRedemptionCount": 1,
  "referralRedemptionCount": 0,
  "discountCount": 1,
  "discountEffectCount": 1,
  "couponCreationCount": 0,
  "lastActivity": "2020-06-29T08:44:16.641898Z",
  "updated": "2020-06-29T08:43:45.495413Z",
  "updatedBy": "Admin"
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

applicationIdinteger

The ID of the application that owns this entity.

campaignGroupsarray

The IDs of the campaign groups that own this entity.

campaignGroups integer

The IDs of the campaign groups that own this entity.

userIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

A friendly name for this campaign.

descriptionstring

A detailed description of the campaign.

startTimestring
format: date-time

Datetime when the campaign will become active.

endTimestring
format: date-time

Datetime when the campaign will become in-active.

attributesobject

Arbitrary properties associated with this campaign

statestring
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetIdinteger

ID of Ruleset this campaign applies on customer session evaluation.

tagsarray

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

featuresarray

A list of features for the campaign.

features string

A list of features for the campaign.

couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limitsarray

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

couponRedemptionCountinteger

Number of coupons redeemed in the campaign.

referralRedemptionCountinteger

Number of referral codes redeemed in the campaign.

discountCountinteger

Total amount of discounts redeemed in the campaign.

discountEffectCountinteger

Total number of times discounts were redeemed in this campaign.

couponCreationCountinteger

Total number of coupons created by rules in this campaign.

lastActivitystring
format: date-time

Timestamp of the most recent event received by this campaign.

updatedstring
format: date-time

Timestamp of the most recent update to the campaign or any of its elements.

createdBystring

Name of the user who created this campaign if available.

updatedBystring

Name of the user who last updated this campaign if available.

#

Update a Campaign

PUT  /v1/applications/{applicationId}/campaigns/{campaignId}

#Example


                                curl --location --request PUT 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
 "name": "TEST",
 "state": "disabled",
 "activeRulesetId": 2,
 "tags": ["test"],
 "features": ["coupons"],
 "limits": []}
                            
                                {
  "id": 68,
  "created": "2020-06-29T08:42:47.050098Z",
  "applicationId": 2,
  "campaignGroups": null,
  "userId": 1,
  "name": "TEST",
  "description": "",
  "attributes": {},
  "state": "disabled",
  "activeRulesetId": 31,
  "tags": [
    "test"
  ],
  "features": [
    "coupons"
  ],
  "couponSettings": {
    "validCharacters": [
      "3",
      "4",
      "5",
      "7",
      "8",
      "9",
      "A",
      "B",
      "C",
      "D",
      "E",
      "F",
      "H",
      "J",
      "K",
      "L",
      "M",
      "N",
      "P",
      "Q",
      "R",
      "T",
      "U",
      "V",
      "W",
      "X",
      "Y"
    ],
    "couponPattern": "####-####"
  },
  "limits": [],
  "lastActivity": "2020-06-29T08:44:16.641898Z",
  "updated": "2020-06-29T14:55:22.427544327Z",
  "updatedBy": "Admin"
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Body Parameter

name string required
minlength: 1

A friendly name for this campaign.

description string

A detailed description of the campaign.

startTime string
format: date-time

Datetime when the campaign will become active.

endTime string
format: date-time

Datetime when the campaign will become in-active.

attributes object

Arbitrary properties associated with this campaign

state string
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetId integer

ID of Ruleset this campaign applies on customer session evaluation.

tags array required

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

features array required

A list of features for the campaign.

Allowed values:

coupons
referrals
loyalty
couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limits array required

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

applicationIdinteger

The ID of the application that owns this entity.

campaignGroupsarray

The IDs of the campaign groups that own this entity.

campaignGroups integer

The IDs of the campaign groups that own this entity.

userIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

A friendly name for this campaign.

descriptionstring

A detailed description of the campaign.

startTimestring
format: date-time

Datetime when the campaign will become active.

endTimestring
format: date-time

Datetime when the campaign will become in-active.

attributesobject

Arbitrary properties associated with this campaign

statestring
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetIdinteger

ID of Ruleset this campaign applies on customer session evaluation.

tagsarray

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

featuresarray

A list of features for the campaign.

features string

A list of features for the campaign.

couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limitsarray

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

couponRedemptionCountinteger

Number of coupons redeemed in the campaign.

referralRedemptionCountinteger

Number of referral codes redeemed in the campaign.

discountCountinteger

Total amount of discounts redeemed in the campaign.

discountEffectCountinteger

Total number of times discounts were redeemed in this campaign.

couponCreationCountinteger

Total number of coupons created by rules in this campaign.

lastActivitystring
format: date-time

Timestamp of the most recent event received by this campaign.

updatedstring
format: date-time

Timestamp of the most recent update to the campaign or any of its elements.

createdBystring

Name of the user who created this campaign if available.

updatedBystring

Name of the user who last updated this campaign if available.

#

Delete a Campaign

DELETE  /v1/applications/{applicationId}/campaigns/{campaignId}

#Example


                                curl --location --request DELETE 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]
                            
                                {}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

#Response Schema

#

Copy the campaign into every specified application

POST  /v1/applications/{applicationId}/campaigns/{campaignId}/copy

Copy the campaign into every specified application.

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/copy' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
 "applicationIds": ["2"]
}'
                            
                                {
  "data": [
    {
      "id": 71,
      "created": "2020-06-29T15:08:24.328906081Z",
      "applicationId": 2,
      "campaignGroups": null,
      "userId": 1,
      "name": "Copy of TEST_CAMPAIGN",
      "description": "",
      "attributes": {},
      "state": "disabled",
      "activeRulesetId": 32,
      "tags": null,
      "features": [],
      "limits": [],
      "couponRedemptionCount": 0,
      "referralRedemptionCount": 0,
      "discountCount": 0,
      "discountEffectCount": 0,
      "couponCreationCount": 0,
      "updated": "2020-06-29T15:08:24.357907742Z",
      "updatedBy": "Admin"
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required

Copy the campaign into every specified application.

campaignId integer required

Body Parameter

name string

Name of the copied campaign (Defaults to "Copy of original campaign name")

applicationIds array required

Application IDs of the applications to which a campaign should be copied to

applicationIds string

Application IDs of the applications to which a campaign should be copied to

description string

A detailed description of the campaign.

startTime string
format: date-time

Datetime when the campaign will become active.

endTime string
format: date-time

Datetime when the campaign will become in-active.

tags array

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

applicationIdinteger

The ID of the application that owns this entity.

campaignGroupsarray

The IDs of the campaign groups that own this entity.

campaignGroups integer

The IDs of the campaign groups that own this entity.

userIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

A friendly name for this campaign.

descriptionstring

A detailed description of the campaign.

startTimestring
format: date-time

Datetime when the campaign will become active.

endTimestring
format: date-time

Datetime when the campaign will become in-active.

attributesobject

Arbitrary properties associated with this campaign

statestring
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetIdinteger

ID of Ruleset this campaign applies on customer session evaluation.

tagsarray

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

featuresarray

A list of features for the campaign.

features string

A list of features for the campaign.

couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limitsarray

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

couponRedemptionCountinteger

Number of coupons redeemed in the campaign.

referralRedemptionCountinteger

Number of referral codes redeemed in the campaign.

discountCountinteger

Total amount of discounts redeemed in the campaign.

discountEffectCountinteger

Total number of times discounts were redeemed in this campaign.

couponCreationCountinteger

Total number of coupons created by rules in this campaign.

lastActivitystring
format: date-time

Timestamp of the most recent event received by this campaign.

updatedstring
format: date-time

Timestamp of the most recent update to the campaign or any of its elements.

createdBystring

Name of the user who created this campaign if available.

updatedBystring

Name of the user who last updated this campaign if available.

#

Get a list of all campaigns that match the given attributes

POST  /v1/applications/{applicationId}/campaigns_search

Gets a list of all the campaigns that exactly match a set of attributes.

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns_search' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{"attributes": {}}'
                            
                                {
  "data": [
    {
      "id": 70,
      "created": "2020-06-29T14:23:57.798801Z",
      "applicationId": 2,
      "campaignGroups": null,
      "userId": 1,
      "name": "TEST_CAMPAIGN",
      "description": "",
      "attributes": {},
      "state": "disabled",
      "activeRulesetId": 30,
      "tags": [],
      "features": [],
      "limits": [],
      "couponRedemptionCount": 0,
      "referralRedemptionCount": 0,
      "discountCount": 0,
      "discountEffectCount": 0,
      "couponCreationCount": 0,
      "updated": "2020-06-29T14:23:57.798801Z",
      "updatedBy": "Admin"
    },
    {
      "id": 71,
      "created": "2020-06-29T15:08:24.328906Z",
      "applicationId": 2,
      "campaignGroups": null,
      "userId": 1,
      "name": "Copy of TEST_CAMPAIGN",
      "description": "",
      "attributes": {},
      "state": "disabled",
      "activeRulesetId": 32,
      "tags": null,
      "features": [],
      "limits": [],
      "couponRedemptionCount": 0,
      "referralRedemptionCount": 0,
      "discountCount": 0,
      "discountEffectCount": 0,
      "couponCreationCount": 0,
      "updated": "2020-06-29T15:08:24.357907Z",
      "updatedBy": "Admin"
    }
  ],
  "totalResultSize": 2
}
                            

#Request Schema

URL Parameter

applicationId integer required

Gets a list of all the campaigns that exactly match a set of attributes.

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

campaignState string
enabled,disabled,archived,draft,scheduled,running,expired

Filter results by the state of the campaign.

Body Parameter

attributes object required

Properties to match against a campaign. All provided attributes will be exactly matched against campaign attributes

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

applicationIdinteger

The ID of the application that owns this entity.

campaignGroupsarray

The IDs of the campaign groups that own this entity.

campaignGroups integer

The IDs of the campaign groups that own this entity.

userIdinteger

The ID of the account that owns this entity.

namestring
minlength: 1

A friendly name for this campaign.

descriptionstring

A detailed description of the campaign.

startTimestring
format: date-time

Datetime when the campaign will become active.

endTimestring
format: date-time

Datetime when the campaign will become in-active.

attributesobject

Arbitrary properties associated with this campaign

statestring
default: enabled enabled,disabled,archived

A disabled or archived campaign is not evaluated for rules or coupons.

activeRulesetIdinteger

ID of Ruleset this campaign applies on customer session evaluation.

tagsarray

A list of tags for the campaign.

tags string
minlength: 1

A list of tags for the campaign.

featuresarray

A list of features for the campaign.

features string

A list of features for the campaign.

couponSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

referralSettings
validCharacters array

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

limitsarray

The set of limits that will operate for this campaign

action string

The limitable action to which this limit will be applied

limit number

The value to set for the limit

entities array

The entities that make the address of this limit

entities string

The entities that make the address of this limit

couponRedemptionCountinteger

Number of coupons redeemed in the campaign.

referralRedemptionCountinteger

Number of referral codes redeemed in the campaign.

discountCountinteger

Total amount of discounts redeemed in the campaign.

discountEffectCountinteger

Total number of times discounts were redeemed in this campaign.

couponCreationCountinteger

Total number of coupons created by rules in this campaign.

lastActivitystring
format: date-time

Timestamp of the most recent event received by this campaign.

updatedstring
format: date-time

Timestamp of the most recent update to the campaign or any of its elements.

createdBystring

Name of the user who created this campaign if available.

updatedBystring

Name of the user who last updated this campaign if available.

#

Create a Ruleset

POST  /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/rulesets' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
 "rules": [{"title": "",
 "condition": ["and",
 ["couponValid"]],
 "effects": [["catch",
 ["noop"],
 ["setDiscount",
 "40% off",
 ["*",
 [".",
 "Session",
 "Total"],
 ["/",
 40,
 100]]]]]}],
 "bindings": [],
 "rbVersion": "v2",
 "activate": true}'
                            
                                {
  "id": 33,
  "created": "2020-06-30T07:50:08.92015162Z",
  "campaignId": 70,
  "userId": 1,
  "rules": [
    {
      "title": "",
      "condition": [
        "and",
        [
          "couponValid"
        ]
      ],
      "effects": [
        [
          "catch",
          [
            "noop"
          ],
          [
            "setDiscount",
            "40% off",
            [
              "*",
              [
                ".",
                "Session",
                "Total"
              ],
              [
                "/",
                40,
                100
              ]
            ]
          ]
        ]
      ]
    }
  ],
  "bindings": [],
  "rbVersion": "v2"
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Body Parameter

rules array required

Set of rules to apply.

title string

A short description of the rule.

description string

A longer, more detailed description of the rule.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

condition array

A Talang expression that will be evaluated in the context of the given event.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

bindings array required

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

rbVersion string

A string indicating which version of the rulebuilder was used to create this ruleset.

activate boolean

A boolean indicating whether this newly created ruleset should also be activated for the campaign owns it

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

userIdinteger

The ID of the account that owns this entity.

rulesarray

Set of rules to apply.

title string

A short description of the rule.

description string

A longer, more detailed description of the rule.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

condition array

A Talang expression that will be evaluated in the context of the given event.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

bindingsarray

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

rbVersionstring

A string indicating which version of the rulebuilder was used to create this ruleset.

activateboolean

A boolean indicating whether this newly created ruleset should also be activated for the campaign owns it

activatedAtstring
format: date-time

Timestamp indicating when this Ruleset was activated.

#

List Campaign Rulesets

GET  /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/rulesets' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 30,
      "created": "2020-06-29T14:54:19.041822Z",
      "campaignId": 70,
      "userId": 1,
      "rules": [
        {
          "title": "1",
          "condition": [
            "and",
            [
              "catch",
              false,
              [
                "do",
                [
                  ".",
                  "Session",
                  "CartItemTotal"
                ],
                [
                  [
                    "Variable"
                  ],
                  [
                    "=",
                    [
                      ".",
                      "Variable"
                    ],
                    1
                  ]
                ]
              ]
            ]
          ],
          "effects": [
            [
              "catch",
              [
                "noop"
              ],
              [
                "setDiscount",
                "10% off",
                [
                  "*",
                  [
                    ".",
                    "Session",
                    "Total"
                  ],
                  [
                    "/",
                    10,
                    100
                  ]
                ]
              ]
            ]
          ]
        }
      ],
      "bindings": [],
      "rbVersion": "v2"
    },
    {
      "id": 33,
      "created": "2020-06-30T07:50:08.920151Z",
      "campaignId": 70,
      "userId": 1,
      "rules": [
        {
          "title": "",
          "condition": [
            "and",
            [
              "couponValid"
            ]
          ],
          "effects": [
            [
              "catch",
              [
                "noop"
              ],
              [
                "setDiscount",
                "40% off",
                [
                  "*",
                  [
                    ".",
                    "Session",
                    "Total"
                  ],
                  [
                    "/",
                    40,
                    100
                  ]
                ]
              ]
            ]
          ]
        }
      ],
      "bindings": [],
      "rbVersion": "v2"
    }
  ],
  "totalResultSize": 2
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

userIdinteger

The ID of the account that owns this entity.

rulesarray

Set of rules to apply.

title string

A short description of the rule.

description string

A longer, more detailed description of the rule.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

condition array

A Talang expression that will be evaluated in the context of the given event.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

bindingsarray

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

rbVersionstring

A string indicating which version of the rulebuilder was used to create this ruleset.

activateboolean

A boolean indicating whether this newly created ruleset should also be activated for the campaign owns it

activatedAtstring
format: date-time

Timestamp indicating when this Ruleset was activated.

#

Update a Ruleset

PUT  /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/rulesets' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 30,
      "created": "2020-06-29T14:54:19.041822Z",
      "campaignId": 70,
      "userId": 1,
      "rules": [
        {
          "title": "1",
          "condition": [
            "and",
            [
              "catch",
              false,
              [
                "do",
                [
                  ".",
                  "Session",
                  "CartItemTotal"
                ],
                [
                  [
                    "Variable"
                  ],
                  [
                    "=",
                    [
                      ".",
                      "Variable"
                    ],
                    1
                  ]
                ]
              ]
            ]
          ],
          "effects": [
            [
              "catch",
              [
                "noop"
              ],
              [
                "setDiscount",
                "10% off",
                [
                  "*",
                  [
                    ".",
                    "Session",
                    "Total"
                  ],
                  [
                    "/",
                    10,
                    100
                  ]
                ]
              ]
            ]
          ]
        }
      ],
      "bindings": [],
      "rbVersion": "v2"
    },
    {
      "id": 33,
      "created": "2020-06-30T07:50:08.920151Z",
      "campaignId": 70,
      "userId": 1,
      "rules": [
        {
          "title": "",
          "condition": [
            "and",
            [
              "couponValid"
            ]
          ],
          "effects": [
            [
              "catch",
              [
                "noop"
              ],
              [
                "setDiscount",
                "40% off",
                [
                  "*",
                  [
                    ".",
                    "Session",
                    "Total"
                  ],
                  [
                    "/",
                    40,
                    100
                  ]
                ]
              ]
            ]
          ]
        }
      ],
      "bindings": [],
      "rbVersion": "v2"
    }
  ],
  "totalResultSize": 2
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required
rulesetId integer required

Body Parameter

rules array required

Set of rules to apply.

title string

A short description of the rule.

description string

A longer, more detailed description of the rule.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

condition array

A Talang expression that will be evaluated in the context of the given event.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

bindings array required

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

rbVersion string

A string indicating which version of the rulebuilder was used to create this ruleset.

activate boolean

A boolean indicating whether this newly created ruleset should also be activated for the campaign owns it

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

userIdinteger

The ID of the account that owns this entity.

rulesarray

Set of rules to apply.

title string

A short description of the rule.

description string

A longer, more detailed description of the rule.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

condition array

A Talang expression that will be evaluated in the context of the given event.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

bindingsarray

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

rbVersionstring

A string indicating which version of the rulebuilder was used to create this ruleset.

activateboolean

A boolean indicating whether this newly created ruleset should also be activated for the campaign owns it

activatedAtstring
format: date-time

Timestamp indicating when this Ruleset was activated.

#

Get a Ruleset

GET  /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/rulesets/[RULESET_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "id": 33,
  "created": "2020-06-30T07:50:08.920151Z",
  "campaignId": 70,
  "userId": 1,
  "rules": [
    {
      "title": "",
      "condition": [
        "and",
        [
          "couponValid"
        ]
      ],
      "effects": [
        [
          "catch",
          [
            "noop"
          ],
          [
            "setDiscount",
            "40% off",
            [
              "*",
              [
                ".",
                "Session",
                "Total"
              ],
              [
                "/",
                40,
                100
              ]
            ]
          ]
        ]
      ]
    }
  ],
  "bindings": [],
  "rbVersion": "v2"
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required
rulesetId integer required

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

userIdinteger

The ID of the account that owns this entity.

rulesarray

Set of rules to apply.

title string

A short description of the rule.

description string

A longer, more detailed description of the rule.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

bindings array

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

condition array

A Talang expression that will be evaluated in the context of the given event.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

effects array

An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.

bindingsarray

An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.

name string

A descriptive name for the value to be bound.

expression array

A Talang expression that will be evaluated and its result attached to the name of the binding.

rbVersionstring

A string indicating which version of the rulebuilder was used to create this ruleset.

activateboolean

A boolean indicating whether this newly created ruleset should also be activated for the campaign owns it

activatedAtstring
format: date-time

Timestamp indicating when this Ruleset was activated.

#

Delete a Ruleset

DELETE  /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}

#Example


                                curl --location --request DELETE 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/rulesets/[RULESET_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required
rulesetId integer required

#Response Schema

#

Create Coupons

POST  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons

Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created.

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
 "usageLimit": 1,
 "validCharacters": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
 "couponPattern": "test_#######",
 "numberOfCoupons": 1,
 "discountLimit": 125.20}'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "totalResultSize": -1
}
                            

#Request Schema

URL Parameter

applicationId integer required

Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created.

campaignId integer required

Query Parameter

silent string

If set to 'yes', response will be an empty 204, otherwise a list of the coupons generated (to to 1000).

Body Parameter

usageLimit integer required

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimit number

The amount of discounts that can be given with this coupon code.

startDate string
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate string
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

validCharacters array required

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

validCharacters string

Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp).

couponPattern string required
minlength: 3

The pattern that will be used to generate coupon codes. The character # acts as a placeholder and will be replaced by a random character from the validCharacters set.

numberOfCoupons integer required

The number of new coupon codes to generate for the campaign. Must be at least 1.

uniquePrefix string

A unique prefix to prepend to all generated coupons.

attributes object

Arbitrary properties associated with this item

recipientIntegrationId string

The integration ID for this coupon's beneficiary's profile

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Update a Batch of Coupons

PUT  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons

#Example


                                curl --location --request PUT 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{"batchID": "bfksqcpd","usageLimit": 2}'
                            
                                {}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Body Parameter

usageLimit integer

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimit number

The amount of discounts that can be given with this coupon code.

startDate string
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate string
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

attributes object

Arbitrary properties associated with this item

batchID string required

The id of the batch the coupon belongs to.

#Response Schema

#

List Coupons (with total count)

GET  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

startsAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

startsBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

expiresAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

expiresBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

batchId string

Filter results by batches of coupons

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Delete Coupons

DELETE  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons

#Example


                                curl --location --request DELETE 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json'
                            
                                {}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Query Parameter

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

startsAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

startsBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

expiresAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

expiresBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

batchId string

Filter results by batches of coupons

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

#Response Schema

#

List Coupons

GET  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons/no_total' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "hasMore": false
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

batchId string

Filter results by batches of coupons

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Update a Coupon

PUT  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}

#Example


                                curl --location --request PUT 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons/[COUPON_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
 "usageLimit": 10}'
                            
                                {
  "id": 8,
  "created": "2020-06-30T09:03:18.494438Z",
  "campaignId": 70,
  "value": "test_NM67YAG",
  "usageLimit": 10,
  "usageCounter": 0,
  "attributes": {},
  "reservation": true,
  "batchId": "bfksqcpd"
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required
couponId string required

The ID of the coupon code to update

Body Parameter

usageLimit integer

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimit number

The amount of discounts that can be given with this coupon code.

startDate string
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate string
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

recipientIntegrationId string

The integration ID for this coupon's beneficiary's profile

attributes object

Arbitrary properties associated with this item

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Delete one Coupon

DELETE  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}

#Example


                                curl --location --request DELETE 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons/[COUPON_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--data-raw ''
                            
                                {}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required
couponId string required

The ID of the coupon code to delete

#Response Schema

#

Get a list of the coupons that match the given attributes

POST  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search

Gets a list of all the coupons that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request.

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/coupons_search' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{"attributes": {}}'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required

Gets a list of all the coupons that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request.

campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

batchId string

Filter results by batches of coupons

Body Parameter

attributes object required

Properties to match against a coupon. All provided attributes will be exactly matched against attributes

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Get a list of the coupons that match the given attributes in all active campaigns of an application (with total count)

POST  /v1/applications/{applicationId}/coupons_search

Gets a list of all the coupons with attributes matching the query criteria Application wide

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/coupons_search' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{"attributes": {}}'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required

Gets a list of all the coupons with attributes matching the query criteria Application wide

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

batchId string

Filter results by batches of coupons

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

campaignState string
enabled,disabled,archived,draft,scheduled,running,expired

Filter results by the state of the campaign.

Body Parameter

attributes object required

Properties to match against a coupon. All provided attributes will be exactly matched against attributes

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Get a list of the coupons that match the given attributes (with total count)

POST  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced

Gets a list of all the coupons with attributes matching the query criteria

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons_search_advanced' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{}'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required

Gets a list of all the coupons with attributes matching the query criteria

campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

batchId string

Filter results by batches of coupons

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Get a list of the coupons that match the given attributes

POST  /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total

Gets a list of all the coupons with attributes matching the query criteria

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/coupons_search_advanced/no_total' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{}'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "hasMore": false
}
                            

#Request Schema

URL Parameter

applicationId integer required

Gets a list of all the coupons with attributes matching the query criteria

campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

batchId string

Filter results by batches of coupons

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Get a list of the coupons that match the given attributes in all active campaigns of an application (with total count)

POST  /v1/applications/{applicationId}/coupons_search_advanced

Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/coupons_search_advanced' \
--header 'Content-Type: application/json' \
--data-raw '{}'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required

Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

batchId string

Filter results by batches of coupons

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

campaignState string
enabled,disabled,archived,draft,scheduled,running,expired

Filter results by the state of the campaign.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

Get a list of the coupons that match the given attributes in all active campaigns of an application

POST  /v1/applications/{applicationId}/coupons_search_advanced/no_total

Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/coupons_search_advanced/no_total' \
--header 'Content-Type: application/json' \
--data-raw '{}'
                            
                                {
  "data": [
    {
      "id": 8,
      "created": "2020-06-30T09:03:18.494438Z",
      "campaignId": 70,
      "value": "test_NM67YAG",
      "usageLimit": 2,
      "usageCounter": 0,
      "attributes": {},
      "reservation": true,
      "batchId": "bfksqcpd"
    }
  ],
  "hasMore": false
}
                            

#Request Schema

URL Parameter

applicationId integer required

Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

value string

Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only coupons where usageCounter < usageLimit will be returned, "false" will return only coupons where usageCounter >= usageLimit.

referralId integer

Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.

recipientIntegrationId string

Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field

batchId string

Filter results by batches of coupons

exactMatch boolean

Filter results to an exact case-insensitive matching against the coupon code

campaignState string
enabled,disabled,archived,draft,scheduled,running,expired

Filter results by the state of the campaign.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

The ID of the campaign that owns this entity.

valuestring
minlength: 4

The actual coupon code.

usageLimitinteger

The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply.

discountLimitnumber

The amount of discounts that can be given with this coupon code.

startDatestring
format: date-time

Timestamp at which point the coupon becomes valid.

expiryDatestring
format: date-time

Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative.

usageCounterinteger

The number of times this coupon has been successfully used.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

attributesobject

Arbitrary properties associated with this item

referralIdinteger

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger

The ID of the Import which created this coupon.

reservationboolean

This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.

batchIdstring

The id of the batch the coupon belongs to.

#

List Referrals (with total count)

GET  /v1/applications/{applicationId}/campaigns/{campaignId}/referrals

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/referrals' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 60,
      "created": "2020-06-30T09:49:18.0246Z",
      "campaignId": 70,
      "advocateProfileIntegrationId": "DemoUser",
      "code": "UAVJ-CH75",
      "usageCounter": 0,
      "usageLimit": 0
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

code string

Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches referrals in which the expiry date is set and in the past. The second matches referrals in which start date is null or in the past and expiry date is null or in the future, the third matches referrals in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only referrals where usageCounter < usageLimit will be returned, "false" will return only referrals where usageCounter >= usageLimit.

advocate string

Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

ID of the campaign from which the referral received the referral code.

advocateProfileIntegrationIdstring

The Integration Id of the Advocate's Profile

friendProfileIntegrationIdstring

An optional Integration ID of the Friend's Profile

startDatestring
format: date-time

Timestamp at which point the referral code becomes valid.

expiryDatestring
format: date-time

Expiry date of the referral code. Referral never expires if this is omitted, zero, or negative.

codestring
minlength: 4

The actual referral code.

usageCounterinteger

The number of times this referral code has been successfully used.

usageLimitinteger

The number of times a referral code can be used. This can be set to 0 for no limit, but any campaign usage limits will still apply.

#

Delete one Referral

DELETE  /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}

#Example


                                --location --request DELETE 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/referrals/[REFERRAL_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required
referralId string required

The ID of the referral code to delete

#Response Schema

#

List Referrals

GET  /v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/referrals/no_total' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 60,
      "created": "2020-06-30T09:49:18.0246Z",
      "campaignId": 70,
      "advocateProfileIntegrationId": "DemoUser",
      "code": "UAVJ-CH75",
      "usageCounter": 0,
      "usageLimit": 0
    }
  ],
  "hasMore": false
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

code string

Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters.

createdBefore string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp.

createdAfter string
format: date-time

Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp.

valid string
expired,validNow,validFuture

Either "expired", "validNow", or "validFuture". The first option matches referrals in which the expiry date is set and in the past. The second matches referrals in which start date is null or in the past and expiry date is null or in the future, the third matches referrals in which start date is set and in the future.

usable string
true,false

Either "true" or "false". If "true", only referrals where usageCounter < usageLimit will be returned, "false" will return only referrals where usageCounter >= usageLimit.

advocate string

Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

campaignIdinteger

ID of the campaign from which the referral received the referral code.

advocateProfileIntegrationIdstring

The Integration Id of the Advocate's Profile

friendProfileIntegrationIdstring

An optional Integration ID of the Friend's Profile

startDatestring
format: date-time

Timestamp at which point the referral code becomes valid.

expiryDatestring
format: date-time

Expiry date of the referral code. Referral never expires if this is omitted, zero, or negative.

codestring
minlength: 4

The actual referral code.

usageCounterinteger

The number of times this referral code has been successfully used.

usageLimitinteger

The number of times a referral code can be used. This can be set to 0 for no limit, but any campaign usage limits will still apply.

#

List all loyalty Programs

GET  /v1/loyalty_programs

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/loyalty_programs' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 1,
      "accountID": 1,
      "name": "Loyalty_program",
      "title": "Loyalty Program",
      "description": "Loyalty Program",
      "subscribedApplications": [
        1
      ],
      "defaultValidity": "unlimited",
      "allowSubledger": false
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

#Response Schema

idinteger

The ID of loyalty program.

accountIDinteger

The ID of the Talon.One account that owns this program.

namestring

The internal name for the Loyalty Program.

titlestring

The display title for the Loyalty Program.

descriptionstring

Description of our Loyalty Program.

subscribedApplicationsarray

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

subscribedApplications integer

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

subscribedApplications integer

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

defaultValiditystring

Indicates the default duration after which new loyalty points should expire. The format is a number, followed by one letter indicating the unit; like '1h' or '40m'.

allowSubledgerboolean

Indicates if this program supports subledgers inside the program

#

Get a loyalty program

GET  /v1/loyalty_programs/{programID}

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/loyalty_programs/[LOYALTY_PROGRAM_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "id": 1,
  "accountID": 1,
  "name": "Loyalty_program",
  "title": "Loyalty Program",
  "description": "Loyalty Program",
  "subscribedApplications": [
    1
  ],
  "defaultValidity": "unlimited",
  "allowSubledger": false
}
                            

#Request Schema

URL Parameter

programID string required

#Response Schema

idinteger

The ID of loyalty program.

accountIDinteger

The ID of the Talon.One account that owns this program.

namestring

The internal name for the Loyalty Program.

titlestring

The display title for the Loyalty Program.

descriptionstring

Description of our Loyalty Program.

subscribedApplicationsarray

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

subscribedApplications integer

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

subscribedApplications integer

A list containing the IDs of all applications that are subscribed to this Loyalty Program.

defaultValiditystring

Indicates the default duration after which new loyalty points should expire. The format is a number, followed by one letter indicating the unit; like '1h' or '40m'.

allowSubledgerboolean

Indicates if this program supports subledgers inside the program

#

get the Loyalty Ledger for this integrationID

GET  /v1/loyalty_programs/{programID}/profile/{integrationID}

Get the Loyalty Ledger for this profile integration ID.

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/loyalty_programs/[LOYALTY_PROGRAM_ID]/profile/[USER_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "ledger": {
    "total": 10,
    "transactions": [
      {
        "created": "2020-06-30T09:58:40.804217Z",
        "programID": 1,
        "customerProfileID": "DemoUser",
        "type": "addition",
        "amount": 10,
        "name": "",
        "subLedgerID": "",
        "userID": 1
      }
    ],
    "expiringPoints": []
  },
  "subLedgers": {}
}
                            

#Request Schema

URL Parameter

programID string required

The identifier for the application, must be unique within the account.

integrationID string required

The identifier for the application, must be unique within the account.

#Response Schema

ledger

The balance of the main ledger in the loyalty program

total number

The balance of the main ledger in the loyalty program

transactions array

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

created string
format: date-time

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

programID integer

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

customerProfileID string

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

customerSessionID string

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

eventID integer

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

type string

The type of the ledger transaction. Possible values are addition, subtraction, expire or expiring (for expiring points ledgers)

amount number

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

startDate string
format: date-time

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

expiryDate string
format: date-time

Transactions contains a list of all events that have happened such as additions, subtractions and expiries

name string

A name referencing the condition or effect that added this entry, or the specific name provided in an API call.

subLedgerID string

This specifies if we are adding loyalty points to the main ledger or a subledger

userID integer

This is the ID of the user who created this entry, if the addition or subtraction was done manually.

expiringPoints array

ExpiringPoints contains a list of all points that will expiry and when

created string
format: date-time

ExpiringPoints contains a list of all points that will expiry and when

programID integer

ExpiringPoints contains a list of all points that will expiry and when

customerProfileID string

ExpiringPoints contains a list of all points that will expiry and when

customerSessionID string

ExpiringPoints contains a list of all points that will expiry and when

eventID integer

ExpiringPoints contains a list of all points that will expiry and when

type string

The type of the ledger transaction. Possible values are addition, subtraction, expire or expiring (for expiring points ledgers)

amount number

ExpiringPoints contains a list of all points that will expiry and when

startDate string
format: date-time

ExpiringPoints contains a list of all points that will expiry and when

expiryDate string
format: date-time

ExpiringPoints contains a list of all points that will expiry and when

name string

A name referencing the condition or effect that added this entry, or the specific name provided in an API call.

subLedgerID string

This specifies if we are adding loyalty points to the main ledger or a subledger

userID integer

This is the ID of the user who created this entry, if the addition or subtraction was done manually.

subLedgersobject

A map containing a list of all loyalty subledger balances

#

Add points in a certain loyalty program for the specified customer

PUT  /v1/loyalty_programs/{programID}/profile/{integrationID}/add_points

#Example


                                curl --location --request PUT 'https://[YOUR_DEPLOYMENT].talon.one/v1/loyalty_programs/[LOYALTY_PROGRAM_ID]/profile/[USER_ID]/add_points' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{"points": 10}'
                            
                                {}
                            

#Request Schema

URL Parameter

programID string required
integrationID string required

Body Parameter

points number required

Amount of loyalty points

name string

Allows to specify a name for the addition or deduction

expiryDuration string

Indicates the duration after which the added loyalty points should expire. The format is a number followed by one letter indicating the time unit, like '1h' or '40m' (defined by Go time package).

pendingDuration string

Indicates the amount of time before the points are considered valid. The format is a number followed by one letter indicating the time unit, like '1h' or '40m' (defined by Go time package).

subLedgerID string

This specifies if we are adding loyalty points to the main ledger or a subledger

#Response Schema

#

Deduct points in a certain loyalty program for the specified customer

PUT  /v1/loyalty_programs/{programID}/profile/{integrationID}/deduct_points

#Example


                                curl --location --request PUT 'https://[YOUR_DEPLOYMENT].talon.one/v1/loyalty_programs/[LOYALTY_PROGRAM_ID]/profile/[USER_ID]/deduct_points' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{"points": 10}'
                            
                                {}
                            

#Request Schema

URL Parameter

programID string required
integrationID string required

Body Parameter

points number required

Amount of loyalty points

name string

Allows to specify a name for the addition or deduction

expiryDuration string

Indicates the duration after which the added loyalty points should expire. The format is a number followed by one letter indicating the time unit, like '1h' or '40m' (defined by Go time package).

pendingDuration string

Indicates the amount of time before the points are considered valid. The format is a number followed by one letter indicating the time unit, like '1h' or '40m' (defined by Go time package).

subLedgerID string

This specifies if we are adding loyalty points to the main ledger or a subledger

#Response Schema

#

Get access logs for application (with total count)

GET  /v1/applications/{applicationId}/access_logs

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/access_logs?rangeStart=2019-12-31T23:59:59Z&rangeEnd=2021-12-31T23:59:59Z' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "uuid": "b62dfec1-a1a2-43e0-9a1f-47996cd69466",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession223423",
      "time": "2020-06-30T09:49:18.003992Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"test_NM67YAG\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":8,\"created\":\"2020-06-30T09:03:18.494438Z\",\"campaignId\":70,\"value\":\"test_NM67YAG\",\"usageLimit\":2,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"bfksqcpd\"}],\"createdCoupons\":[],\"createdReferrals\":[{\"id\":60,\"created\":\"2020-06-30T09:49:18.024600085Z\",\"campaignId\":70,\"advocateProfileIntegrationId\":\"DemoUser\",\"code\":\"UAVJ-CH75\",\"usageCounter\":0,\"usageLimit\":0}],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":4,\"totalSales\":79.2,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-30T09:49:18.031611472Z\"},\"customerSession\":{\"integrationId\":\"postmansession223423\",\"created\":\"2020-06-30T09:49:18.010465Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"test_NM67YAG\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":false,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":70,\"rulesetId\":35,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"acceptCoupon\",\"props\":{\"value\":\"test_NM67YAG\"}},{\"campaignId\":70,\"rulesetId\":35,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"setDiscount\",\"props\":{\"name\":\"40% off\",\"value\":7.92}},{\"campaignId\":70,\"rulesetId\":35,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"referralCreated\",\"props\":{\"value\":\"UAVJ-CH75\"}}],\"triggeredCampaigns\":[{\"id\":70,\"created\":\"2020-06-29T14:23:57.798801Z\",\"applicationId\":2,\"campaignGroups\":null,\"userId\":1,\"name\":\"TEST_CAMPAIGN\",\"description\":\"\",\"attributes\":{},\"state\":\"enabled\",\"activeRulesetId\":35,\"tags\":[],\"features\":[\"coupons\",\"referrals\"],\"couponSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"referralSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"limits\":[],\"updated\":\"2020-06-30T09:49:11.021662Z\",\"updatedBy\":\"Admin\"}]}"
    },
    {
      "uuid": "32f8fb6e-1ac3-4108-9001-8eae25feb7b9",
      "status": 400,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession22342",
      "time": "2020-06-30T09:49:14.621061Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"test_NM67YAG\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"message\":\"Only open sessions can be closed. Cannot move session to state \\\"closed\\\" from state \\\"closed\\\"\",\"errors\":null,\"StatusCode\":400}"
    },
    {
      "uuid": "4c2998fc-28ac-4620-83b0-d45cb404479b",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession22342",
      "time": "2020-06-30T09:49:03.585711Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"test_NM67YAG\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":8,\"created\":\"2020-06-30T09:03:18.494438Z\",\"campaignId\":70,\"value\":\"test_NM67YAG\",\"usageLimit\":2,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"bfksqcpd\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":3,\"totalSales\":59.4,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-30T09:49:03.602519911Z\"},\"customerSession\":{\"integrationId\":\"postmansession22342\",\"created\":\"2020-06-30T09:49:03.594617Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"test_NM67YAG\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":false,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":70,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"test_NM67YAG\",\"rejectionReason\":\"CouponPartOfNotRunningCampaign\"}}],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "f5f963a7-22a5-4981-bf78-217f1e35ee81",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession2234",
      "time": "2020-06-30T09:48:33.011306Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"ewbhfewiwih\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":2,\"totalSales\":39.6,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-30T09:48:33.031535311Z\"},\"customerSession\":{\"integrationId\":\"postmansession2234\",\"created\":\"2020-06-30T09:48:33.022699Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"ewbhfewiwih\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":false,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":0,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"ewbhfewiwih\",\"rejectionReason\":\"CouponNotFound\"}}],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "31aeb40f-9287-4be7-b29a-de4028256a38",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession12",
      "time": "2020-06-29T11:56:19.64973Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"attributes\": {\n            \"pointsToSpend\": 100\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":1,\"totalSales\":19.8,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T11:56:19.66440704Z\"},\"customerSession\":{\"integrationId\":\"postmansession12\",\"created\":\"2020-06-29T11:56:19.661348Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[],\"attributes\":{\"pointsToSpend\":100},\"firstSession\":false,\"total\":0,\"cartItemTotal\":0,\"additionalCostTotal\":0},\"effects\":[],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "f6f8192e-0f2e-4836-928d-38c3469f65bc",
      "status": 400,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession12",
      "time": "2020-06-29T11:55:54.439728Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"attributes\": {\n            \"pointsToSpend\": 100\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"message\":\"The submitted data was invalid\",\"errors\":[{\"title\":\"Attribute not found\",\"details\":\"The attribute \\\"pointsToSpend\\\" is not defined on CustomerSession entities.\",\"source\":{\"pointer\":\"/attributes/pointsToSpend\"}}],\"StatusCode\":400}"
    },
    {
      "uuid": "29d0aab3-fe53-4544-aacf-387d20411aed",
      "status": 400,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T11:55:48.466085Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"attributes\": {\n            \"pointsToSpend\": 100\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"message\":\"Only open sessions can be closed. Cannot move session to state \\\"closed\\\" from state \\\"closed\\\"\",\"errors\":null,\"StatusCode\":400}"
    },
    {
      "uuid": "df7bab67-8645-4cf8-af38-464962f7c512",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:44:16.63191Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\"\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":5,\"created\":\"2020-06-29T08:43:10.854885Z\",\"campaignId\":68,\"value\":\"TEST_CODE\",\"usageLimit\":0,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"eycpzbip\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":1,\"totalSales\":19.8,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:44:16.656811845Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"TEST_CODE\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"acceptCoupon\",\"props\":{\"value\":\"TEST_CODE\"}},{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"setDiscount\",\"props\":{\"name\":\"10% off\",\"value\":1.98}}],\"triggeredCampaigns\":[{\"id\":68,\"created\":\"2020-06-29T08:42:47.050098Z\",\"applicationId\":2,\"campaignGroups\":null,\"userId\":1,\"name\":\"COUPON\",\"description\":\"\",\"attributes\":{},\"state\":\"enabled\",\"activeRulesetId\":28,\"tags\":[],\"features\":[\"coupons\"],\"couponSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"limits\":[],\"updated\":\"2020-06-29T08:43:45.495413Z\",\"updatedBy\":\"Admin\"}]}"
    },
    {
      "uuid": "8e3f177d-0063-4ab2-ba5b-1276637de62b",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:43:48.637677Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"TEST_CODE\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":5,\"created\":\"2020-06-29T08:43:10.854885Z\",\"campaignId\":68,\"value\":\"TEST_CODE\",\"usageLimit\":0,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"eycpzbip\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:43:48.669442412Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"TEST_CODE\"],\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"acceptCoupon\",\"props\":{\"value\":\"TEST_CODE\"}},{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"setDiscount\",\"props\":{\"name\":\"10% off\",\"value\":1.98}}],\"triggeredCampaigns\":[{\"id\":68,\"created\":\"2020-06-29T08:42:47.050098Z\",\"applicationId\":2,\"campaignGroups\":null,\"userId\":1,\"name\":\"COUPON\",\"description\":\"\",\"attributes\":{},\"state\":\"enabled\",\"activeRulesetId\":28,\"tags\":[],\"features\":[\"coupons\"],\"couponSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"limits\":[],\"updated\":\"2020-06-29T08:43:45.495413Z\",\"updatedBy\":\"Admin\"}]}"
    },
    {
      "uuid": "06fd3992-c840-4a1b-9f54-450ff035facb",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:43:26.579412Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"TEST_CODE\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":5,\"created\":\"2020-06-29T08:43:10.854885Z\",\"campaignId\":68,\"value\":\"TEST_CODE\",\"usageLimit\":0,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"eycpzbip\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:43:26.598524417Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"TEST_CODE\"],\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":68,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"TEST_CODE\",\"rejectionReason\":\"CouponPartOfNotRunningCampaign\"}}],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "2758d0e7-c456-4694-9057-5aa0f046fb0e",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:42:33.444038Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"dwdqwdwd\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:42:33.47628448Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"dwdqwdwd\"],\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":0,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"dwdqwdwd\",\"rejectionReason\":\"CouponNotFound\"}}],\"triggeredCampaigns\":[]}"
    }
  ],
  "totalResultSize": 11
}
                            

#Request Schema

URL Parameter

applicationId integer required

Query Parameter

path string

Only return results where the request path matches the given regular expression.

method string
get,put,post,delete,patch

Only return results where the request method matches the given regular expression.

status string
success,error

Filter results by HTTP status codes.

rangeStart string required
format: date-time

Only return results from after this timestamp, must be an RFC3339 timestamp string

rangeEnd string required
format: date-time

Only return results from before this timestamp, must be an RFC3339 timestamp string

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

#Response Schema

uuidstring

UUID reference of request

statusinteger

HTTP status code of response

methodstring

HTTP method of request

requestUristring

target URI of request

timestring
format: date-time

timestamp of request

requestPayloadstring

payload of request

responsePayloadstring

payload of response

#

Get access logs for application

GET  /v1/applications/{applicationId}/access_logs/no_total

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/access_logs/no_total?rangeStart=2019-12-31T23:59:59Z&rangeEnd=2021-12-31T23:59:59Z' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "uuid": "b62dfec1-a1a2-43e0-9a1f-47996cd69466",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession223423",
      "time": "2020-06-30T09:49:18.003992Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"test_NM67YAG\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":8,\"created\":\"2020-06-30T09:03:18.494438Z\",\"campaignId\":70,\"value\":\"test_NM67YAG\",\"usageLimit\":2,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"bfksqcpd\"}],\"createdCoupons\":[],\"createdReferrals\":[{\"id\":60,\"created\":\"2020-06-30T09:49:18.024600085Z\",\"campaignId\":70,\"advocateProfileIntegrationId\":\"DemoUser\",\"code\":\"UAVJ-CH75\",\"usageCounter\":0,\"usageLimit\":0}],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":4,\"totalSales\":79.2,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-30T09:49:18.031611472Z\"},\"customerSession\":{\"integrationId\":\"postmansession223423\",\"created\":\"2020-06-30T09:49:18.010465Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"test_NM67YAG\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":false,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":70,\"rulesetId\":35,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"acceptCoupon\",\"props\":{\"value\":\"test_NM67YAG\"}},{\"campaignId\":70,\"rulesetId\":35,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"setDiscount\",\"props\":{\"name\":\"40% off\",\"value\":7.92}},{\"campaignId\":70,\"rulesetId\":35,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"referralCreated\",\"props\":{\"value\":\"UAVJ-CH75\"}}],\"triggeredCampaigns\":[{\"id\":70,\"created\":\"2020-06-29T14:23:57.798801Z\",\"applicationId\":2,\"campaignGroups\":null,\"userId\":1,\"name\":\"TEST_CAMPAIGN\",\"description\":\"\",\"attributes\":{},\"state\":\"enabled\",\"activeRulesetId\":35,\"tags\":[],\"features\":[\"coupons\",\"referrals\"],\"couponSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"referralSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"limits\":[],\"updated\":\"2020-06-30T09:49:11.021662Z\",\"updatedBy\":\"Admin\"}]}"
    },
    {
      "uuid": "32f8fb6e-1ac3-4108-9001-8eae25feb7b9",
      "status": 400,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession22342",
      "time": "2020-06-30T09:49:14.621061Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"test_NM67YAG\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"message\":\"Only open sessions can be closed. Cannot move session to state \\\"closed\\\" from state \\\"closed\\\"\",\"errors\":null,\"StatusCode\":400}"
    },
    {
      "uuid": "4c2998fc-28ac-4620-83b0-d45cb404479b",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession22342",
      "time": "2020-06-30T09:49:03.585711Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"test_NM67YAG\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":8,\"created\":\"2020-06-30T09:03:18.494438Z\",\"campaignId\":70,\"value\":\"test_NM67YAG\",\"usageLimit\":2,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"bfksqcpd\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":3,\"totalSales\":59.4,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-30T09:49:03.602519911Z\"},\"customerSession\":{\"integrationId\":\"postmansession22342\",\"created\":\"2020-06-30T09:49:03.594617Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"test_NM67YAG\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":false,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":70,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"test_NM67YAG\",\"rejectionReason\":\"CouponPartOfNotRunningCampaign\"}}],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "f5f963a7-22a5-4981-bf78-217f1e35ee81",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession2234",
      "time": "2020-06-30T09:48:33.011306Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"ewbhfewiwih\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":2,\"totalSales\":39.6,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-30T09:48:33.031535311Z\"},\"customerSession\":{\"integrationId\":\"postmansession2234\",\"created\":\"2020-06-30T09:48:33.022699Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"ewbhfewiwih\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":false,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":0,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"ewbhfewiwih\",\"rejectionReason\":\"CouponNotFound\"}}],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "31aeb40f-9287-4be7-b29a-de4028256a38",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession12",
      "time": "2020-06-29T11:56:19.64973Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"attributes\": {\n            \"pointsToSpend\": 100\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":1,\"totalSales\":19.8,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T11:56:19.66440704Z\"},\"customerSession\":{\"integrationId\":\"postmansession12\",\"created\":\"2020-06-29T11:56:19.661348Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[],\"attributes\":{\"pointsToSpend\":100},\"firstSession\":false,\"total\":0,\"cartItemTotal\":0,\"additionalCostTotal\":0},\"effects\":[],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "f6f8192e-0f2e-4836-928d-38c3469f65bc",
      "status": 400,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession12",
      "time": "2020-06-29T11:55:54.439728Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"attributes\": {\n            \"pointsToSpend\": 100\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"message\":\"The submitted data was invalid\",\"errors\":[{\"title\":\"Attribute not found\",\"details\":\"The attribute \\\"pointsToSpend\\\" is not defined on CustomerSession entities.\",\"source\":{\"pointer\":\"/attributes/pointsToSpend\"}}],\"StatusCode\":400}"
    },
    {
      "uuid": "29d0aab3-fe53-4544-aacf-387d20411aed",
      "status": 400,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T11:55:48.466085Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\",\n        \"attributes\": {\n            \"pointsToSpend\": 100\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"message\":\"Only open sessions can be closed. Cannot move session to state \\\"closed\\\" from state \\\"closed\\\"\",\"errors\":null,\"StatusCode\":400}"
    },
    {
      "uuid": "df7bab67-8645-4cf8-af38-464962f7c512",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:44:16.63191Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"closed\",\n        \"profileId\": \"DemoUser\"\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":5,\"created\":\"2020-06-29T08:43:10.854885Z\",\"campaignId\":68,\"value\":\"TEST_CODE\",\"usageLimit\":0,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"eycpzbip\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":1,\"totalSales\":19.8,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:44:16.656811845Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"TEST_CODE\"],\"referralCode\":\"\",\"state\":\"closed\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"acceptCoupon\",\"props\":{\"value\":\"TEST_CODE\"}},{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"setDiscount\",\"props\":{\"name\":\"10% off\",\"value\":1.98}}],\"triggeredCampaigns\":[{\"id\":68,\"created\":\"2020-06-29T08:42:47.050098Z\",\"applicationId\":2,\"campaignGroups\":null,\"userId\":1,\"name\":\"COUPON\",\"description\":\"\",\"attributes\":{},\"state\":\"enabled\",\"activeRulesetId\":28,\"tags\":[],\"features\":[\"coupons\"],\"couponSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"limits\":[],\"updated\":\"2020-06-29T08:43:45.495413Z\",\"updatedBy\":\"Admin\"}]}"
    },
    {
      "uuid": "8e3f177d-0063-4ab2-ba5b-1276637de62b",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:43:48.637677Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"TEST_CODE\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":5,\"created\":\"2020-06-29T08:43:10.854885Z\",\"campaignId\":68,\"value\":\"TEST_CODE\",\"usageLimit\":0,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"eycpzbip\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:43:48.669442412Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"TEST_CODE\"],\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"acceptCoupon\",\"props\":{\"value\":\"TEST_CODE\"}},{\"campaignId\":68,\"rulesetId\":28,\"ruleIndex\":0,\"ruleName\":\"1\",\"effectType\":\"setDiscount\",\"props\":{\"name\":\"10% off\",\"value\":1.98}}],\"triggeredCampaigns\":[{\"id\":68,\"created\":\"2020-06-29T08:42:47.050098Z\",\"applicationId\":2,\"campaignGroups\":null,\"userId\":1,\"name\":\"COUPON\",\"description\":\"\",\"attributes\":{},\"state\":\"enabled\",\"activeRulesetId\":28,\"tags\":[],\"features\":[\"coupons\"],\"couponSettings\":{\"validCharacters\":[\"3\",\"4\",\"5\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\"],\"couponPattern\":\"####-####\"},\"limits\":[],\"updated\":\"2020-06-29T08:43:45.495413Z\",\"updatedBy\":\"Admin\"}]}"
    },
    {
      "uuid": "06fd3992-c840-4a1b-9f54-450ff035facb",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:43:26.579412Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"TEST_CODE\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[{\"id\":5,\"created\":\"2020-06-29T08:43:10.854885Z\",\"campaignId\":68,\"value\":\"TEST_CODE\",\"usageLimit\":0,\"usageCounter\":0,\"attributes\":{},\"reservation\":true,\"batchId\":\"eycpzbip\"}],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:43:26.598524417Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"TEST_CODE\"],\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":68,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"TEST_CODE\",\"rejectionReason\":\"CouponPartOfNotRunningCampaign\"}}],\"triggeredCampaigns\":[]}"
    },
    {
      "uuid": "2758d0e7-c456-4694-9057-5aa0f046fb0e",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v2/customer_sessions/postmansession1",
      "time": "2020-06-29T08:42:33.444038Z",
      "requestPayload": "{\n    \"customerSession\": {\n        \"state\": \"open\",\n        \"profileId\": \"DemoUser\",\n        \"cartItems\": [\n            {\n                \"name\": \"Pizza\",\n                \"sku\": \"kd-100\",\n                \"quantity\": 1,\n                \"price\": 13,\n                \"category\": \"pizzas\"\n            },\n            {\n                \"name\": \"Club Mate 330ml\",\n                \"sku\": \"cm-33\",\n                \"quantity\": 1,\n                \"price\": 1.8,\n                \"category\": \"beverages\"\n            }\n        ],\n        \"couponCodes\": [\n            \"dwdqwdwd\"\n        ],\n        \"attributes\": {\n            \"ShippingCity\": \"Berlin\"\n        },\n        \"additionalCosts\": {\n            \"ShippingCost\": {\n                \"price\": 5\n            }\n        }\n    },\n    \"responseContent\": [\n        \"customerSession\",\n        \"customerProfile\",\n        \"triggeredCampaigns\",\n        \"coupons\"\n    ]\n}",
      "responsePayload": "{\"coupons\":[],\"createdCoupons\":[],\"createdReferrals\":[],\"customerProfile\":{\"integrationId\":\"DemoUser\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"attributes\":{},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":null,\"lastActivity\":\"2020-06-29T08:42:33.47628448Z\"},\"customerSession\":{\"integrationId\":\"postmansession1\",\"created\":\"2020-06-29T08:42:33.462042Z\",\"applicationId\":2,\"profileId\":\"DemoUser\",\"couponCodes\":[\"dwdqwdwd\"],\"referralCode\":\"\",\"state\":\"open\",\"cartItems\":[{\"name\":\"Pizza\",\"sku\":\"kd-100\",\"quantity\":1,\"price\":13,\"category\":\"pizzas\",\"position\":0},{\"name\":\"Club Mate 330ml\",\"sku\":\"cm-33\",\"quantity\":1,\"price\":1.8,\"category\":\"beverages\",\"position\":1}],\"additionalCosts\":{\"ShippingCost\":{\"price\":5}},\"attributes\":{\"ShippingCity\":\"Berlin\"},\"firstSession\":true,\"total\":19.8,\"cartItemTotal\":14.8,\"additionalCostTotal\":5},\"effects\":[{\"campaignId\":0,\"rulesetId\":0,\"ruleIndex\":0,\"ruleName\":\"\",\"effectType\":\"rejectCoupon\",\"props\":{\"value\":\"dwdqwdwd\",\"rejectionReason\":\"CouponNotFound\"}}],\"triggeredCampaigns\":[]}"
    }
  ],
  "hasMore": false
}
                            

#Request Schema

URL Parameter

applicationId integer required

Query Parameter

path string

Only return results where the request path matches the given regular expression.

method string
get,put,post,delete,patch

Only return results where the request method matches the given regular expression.

status string
success,error

Filter results by HTTP status codes.

rangeStart string required
format: date-time

Only return results from after this timestamp, must be an RFC3339 timestamp string

rangeEnd string required
format: date-time

Only return results from before this timestamp, must be an RFC3339 timestamp string

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

#Response Schema

uuidstring

UUID reference of request

statusinteger

HTTP status code of response

methodstring

HTTP method of request

requestUristring

target URI of request

timestring
format: date-time

timestamp of request

requestPayloadstring

payload of request

responsePayloadstring

payload of response

#

Get all access logs

GET  /v1/access_logs

Fetches the access logs for the entire account. Sensitive requests (logins) are always filtered from the logs.

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/access_logs?rangeStart=2019-12-31T23:59:59Z&rangeEnd=2021-12-31T23:59:59Z' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "uuid": "7ad264b7-cb84-4b4b-b493-fcc8946ade2e",
      "status": 200,
      "method": "GET",
      "requestUri": "/v1/roles",
      "time": "2020-06-29T14:52:55.012542Z",
      "requestPayload": "",
      "responsePayload": "{\"data\":[{\"id\":1,\"accountID\":1,\"name\":\"Read_only\",\"description\":\"Read_only\",\"members\":[3],\"acl\":{\"Applications\":{\"1\":{\"Overall\":1,\"ActiveCampaignPermission\":2,\"Custom\":{\"CreateCampaign\":1},\"Campaigns\":{\"0\":{\"Overall\":1,\"Custom\":{\"Coupons\":0,\"Referrals\":0,\"Insights\":0,\"Settings\":0,\"RuleBuilder\":1}}}}},\"CampaignGroup\":null}}],\"totalResultSize\":1}"
    },
    {
      "uuid": "09182f43-58b8-4c53-bef4-6b111f5962ac",
      "status": 200,
      "method": "GET",
      "requestUri": "/v1/applications",
      "time": "2020-06-29T14:52:55.001898Z",
      "requestPayload": "",
      "responsePayload": "{\"data\":[{\"id\":1,\"created\":\"2019-10-17T15:24:48.250081Z\",\"modified\":\"2019-10-17T15:24:48.250081Z\",\"accountId\":1,\"name\":\"Integration API Application\",\"description\":\"\",\"timezone\":\"Europe/Berlin\",\"currency\":\"EUR\",\"caseSensitivity\":\"sensitive\",\"attributes\":{},\"limits\":[],\"attributesSettings\":{},\"sandbox\":false,\"loyaltyPrograms\":[{\"id\":1,\"accountID\":1,\"name\":\"Loyalty_program\",\"title\":\"Loyalty Program\",\"description\":\"Loyalty Program\",\"subscribedApplications\":[1],\"defaultValidity\":\"unlimited\",\"allowSubledger\":false}]},{\"id\":2,\"created\":\"2020-04-16T11:34:17.976098Z\",\"modified\":\"2020-06-29T08:42:24.433326Z\",\"accountId\":1,\"name\":\"Developer_Docs\",\"description\":\"aece1d67f3c5bd2cd8f10b17c71a4d910d799acd407314a626633939f28e1617\",\"timezone\":\"Europe/Berlin\",\"currency\":\"EUR\",\"caseSensitivity\":\"sensitive\",\"attributes\":{},\"limits\":[],\"attributesSettings\":{},\"sandbox\":false,\"loyaltyPrograms\":[]}],\"totalResultSize\":2}"
    },
    {
      "uuid": "0f5486c3-d324-42f1-86fc-c6951ae7f7f4",
      "status": 200,
      "method": "GET",
      "requestUri": "/v1/campaign_manager/config",
      "time": "2020-06-29T14:52:54.999355Z",
      "requestPayload": "",
      "responsePayload": "{}"
    },
    {
      "uuid": "71829c53-bcc8-40ff-ae68-7f7572defa8a",
      "status": 200,
      "method": "GET",
      "requestUri": "/v1/users/1",
      "time": "2020-06-29T14:52:54.995401Z",
      "requestPayload": "",
      "responsePayload": "{\"id\":1,\"created\":\"2019-10-16T13:28:10.443619Z\",\"modified\":\"2019-10-16T14:05:28.892671Z\",\"email\":\"support+developerdocs@talon.one\",\"accountId\":1,\"inviteToken\":\"\",\"state\":\"active\",\"name\":\"Admin\",\"policy\":{\"Role\":127,\"Applications\":{}},\"latestFeedTimestamp\":\"2020-06-05T10:11:49.64137Z\",\"roles\":null,\"applicationNotificationSubscriptions\":{},\"authMethod\":\"basic_auth\"}"
    },
    {
      "uuid": "97cdb587-954b-41df-a066-56cdf079c93a",
      "status": 200,
      "method": "GET",
      "requestUri": "/v1/feature_flags",
      "time": "2020-06-29T14:52:53.639673Z",
      "requestPayload": "",
      "responsePayload": "{\"data\":[{\"name\":\"api_v2\",\"value\":\"true\",\"created\":\"2020-04-06T14:06:56.914283Z\"}],\"totalResultSize\":1}"
    }
  ]
}
                            

#Request Schema

Query Parameter

rangeStart string required
format: date-time

Only return results from after this timestamp, must be an RFC3339 timestamp string

rangeEnd string required
format: date-time

Only return results from before this timestamp, must be an RFC3339 timestamp string

path string

Only return results where the request path matches the given regular expression.

method string
get,put,post,delete,patch

Only return results where the request method matches the given regular expression.

status string
success,error

Filter results by HTTP status codes.

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

#Response Schema

uuidstring

UUID reference of request

statusinteger

HTTP status code of response

methodstring

HTTP method of request

requestUristring

target URI of request

timestring
format: date-time

timestamp of request

requestPayloadstring

payload of request

responsePayloadstring

payload of response

#

Get analytics of campaigns

GET  /v1/applications/{applicationId}/campaigns/{campaignId}/analytics

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/campaigns/[CAMPAIGN_ID]/analytics?rangeStart=2019-12-31T23:59:59Z&rangeEnd=2021-12-31T23:59:59Z&granularity=1 month' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "date": "2019-12-31T00:00:00Z",
      "campaignRevenue": 0,
      "totalCampaignRevenue": 0,
      "campaignRefund": 0,
      "totalCampaignRefund": 0,
      "campaignDiscountCosts": 0,
      "totalCampaignDiscountCosts": 0,
      "campaignRefundedDiscounts": 0,
      "totalCampaignRefundedDiscounts": 0,
      "campaignFreeItems": 0,
      "totalCampaignFreeItems": 0,
      "couponRedemptions": 0,
      "totalCouponRedemptions": 0,
      "couponRolledbackRedemptions": 0,
      "totalCouponRolledbackRedemptions": 0,
      "referralRedemptions": 0,
      "totalReferralRedemptions": 0,
      "couponsCreated": 0,
      "totalCouponsCreated": 0,
      "referralsCreated": 0,
      "totalReferralsCreated": 0
    }
  ],
  "totalResultSize": 1
}
                            

#Request Schema

URL Parameter

applicationId integer required
campaignId integer required

Query Parameter

rangeStart string required
format: date-time

Only return results from after this timestamp, must be an RFC3339 timestamp string

rangeEnd string required
format: date-time

Only return results from before this timestamp, must be an RFC3339 timestamp string

granularity string
1 hour,1 day,1 week,1 month,1 year

The time interval between the results in the returned time-series.

#Response Schema

datestring
format: date-time
campaignRevenuenumber

Amount of revenue in this campaign (for coupon or discount sessions).

totalCampaignRevenuenumber

Amount of revenue in this campaign since it began (for coupon or discount sessions).

campaignRefundnumber

Amount of refunds in this campaign (for coupon or discount sessions).

totalCampaignRefundnumber

Amount of refunds in this campaign since it began (for coupon or discount sessions).

campaignDiscountCostsnumber

Amount of cost caused by discounts given in the campaign.

totalCampaignDiscountCostsnumber

Amount of cost caused by discounts given in the campaign since it began.

campaignRefundedDiscountsnumber

Amount of discounts rolledback due to refund in the campaign.

totalCampaignRefundedDiscountsnumber

Amount of discounts rolledback due to refund in the campaign since it began.

campaignFreeItemsinteger

Amount of free items given in the campaign.

totalCampaignFreeItemsinteger

Amount of free items given in the campaign since it began.

couponRedemptionsinteger

Number of coupon redemptions in the campaign.

totalCouponRedemptionsinteger

Number of coupon redemptions in the campaign since it began.

couponRolledbackRedemptionsinteger

Number of coupon redemptions that have been rolled back (due to canceling closed session) in the campaign.

totalCouponRolledbackRedemptionsinteger

Number of coupon redemptions that have been rolled back (due to canceling closed session) in the campaign since it began.

referralRedemptionsinteger

Number of referral redemptions in the campaign.

totalReferralRedemptionsinteger

Number of referral redemptions in the campaign since it began.

couponsCreatedinteger

Number of coupons created in the campaign by the rule engine.

totalCouponsCreatedinteger

Number of coupons created in the campaign by the rule engine since it began.

referralsCreatedinteger

Number of referrals created in the campaign by the rule engine.

totalReferralsCreatedinteger

Number of referrals created in the campaign by the rule engine since it began.

#

List Application Customers

GET  /v1/applications/{applicationId}/customers

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/customers' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 259,
      "created": "2020-06-29T08:42:33.462042Z",
      "integrationId": "DemoUser",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 4,
      "totalSales": 79.2,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-30T09:49:18.031611Z"
    }
  ],
  "totalResultSize": 8
}
                            

#Request Schema

URL Parameter

applicationId integer required

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

The exact moment this entity was created. The exact moment this entity was created.
integrationIdstring
format: string

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributesobject

Arbitrary properties associated with this item

accountIdinteger

The ID of the Talon.One account that owns this profile.

The ID of the Talon.One account that owns this profile.

closedSessionsinteger

The total amount of closed sessions by a customer. A closed session is a successful purchase.

totalSalesnumber

Sum of all purchases made by this customer

loyaltyMembershipsarray

A list of loyalty programs joined by the customer

joined string
format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId integer

The ID of the loyalty program belonging to this entity.

lastActivitystring
format: date-time

Timestamp of the most recent event received from this customer

#

Get a list of the customer profiles that match the given attributes

POST  /v1/customer_search/no_total

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/customer_search/no_total' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{}'
                            
                                {
  "data": [
    {
      "id": 1,
      "created": "2019-10-28T15:23:27.917371Z",
      "integrationId": "NewCustomerProfile44",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2019-10-29T06:43:00.668893Z"
    },
    {
      "id": 2,
      "created": "2019-10-28T16:04:05.259725Z",
      "integrationId": "NewCustomerProfile3",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2019-10-28T16:06:16.277163Z"
    },
    {
      "id": 32,
      "created": "2019-11-28T14:34:26.904132Z",
      "integrationId": "Advocate2",
      "attributes": {
        "Tier": "VIP"
      },
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-30T09:59:16.881633Z"
    },
    {
      "id": 221,
      "created": "2020-04-06T14:32:53.721796Z",
      "integrationId": "exampleprofileid",
      "attributes": {
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-26T14:21:09.830143Z"
    },
    {
      "id": 254,
      "created": "2020-05-06T12:07:46.728999Z",
      "integrationId": "TEST-USER-ID-2",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-05-06T12:31:35.491273Z"
    },
    {
      "id": 257,
      "created": "2020-06-03T19:02:44.577623Z",
      "integrationId": "TEST-USER-ID4",
      "attributes": {
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-03T19:02:44.602683Z"
    },
    {
      "id": 260,
      "created": "2020-06-29T09:03:23.193926Z",
      "integrationId": "FWC-2",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-29T09:03:23.193889Z"
    }
  ],
  "hasMore": false
}
                            

#Request Schema

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

Body Parameter

attributes object

Properties to match against a customer profile. All provided attributes will be exactly matched against profile attributes

integrationIDs array

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

integrationIDs string

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

profileIDs array

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

profileIDs integer

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

The exact moment this entity was created. The exact moment this entity was created.
integrationIdstring
format: string

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributesobject

Arbitrary properties associated with this item

accountIdinteger

The ID of the Talon.One account that owns this profile.

The ID of the Talon.One account that owns this profile.

closedSessionsinteger

The total amount of closed sessions by a customer. A closed session is a successful purchase.

totalSalesnumber

Sum of all purchases made by this customer

loyaltyMembershipsarray

A list of loyalty programs joined by the customer

joined string
format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId integer

The ID of the loyalty program belonging to this entity.

lastActivitystring
format: date-time

Timestamp of the most recent event received from this customer

#

Get Customer Profile

GET  /v1/customers/{customerId}

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/customers/[INTERNAL_CUSTOMER_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {}
                            

#Request Schema

URL Parameter

customerId integer required

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

The exact moment this entity was created. The exact moment this entity was created.
integrationIdstring
format: string

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributesobject

Arbitrary properties associated with this item

accountIdinteger

The ID of the Talon.One account that owns this profile.

The ID of the Talon.One account that owns this profile.

closedSessionsinteger

The total amount of closed sessions by a customer. A closed session is a successful purchase.

totalSalesnumber

Sum of all purchases made by this customer

loyaltyMembershipsarray

A list of loyalty programs joined by the customer

joined string
format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId integer

The ID of the loyalty program belonging to this entity.

lastActivitystring
format: date-time

Timestamp of the most recent event received from this customer

#

List Customer Profiles

GET  /v1/customers/no_total

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/customers/no_total' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "data": [
    {
      "id": 1,
      "created": "2019-10-28T15:23:27.917371Z",
      "integrationId": "NewCustomerProfile44",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2019-10-29T06:43:00.668893Z"
    },
    {
      "id": 2,
      "created": "2019-10-28T16:04:05.259725Z",
      "integrationId": "NewCustomerProfile3",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2019-10-28T16:06:16.277163Z"
    },
    {
      "id": 3,
      "created": "2019-10-29T06:42:45.744295Z",
      "integrationId": "NewCustomerProfile96",
      "attributes": {},
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2019-10-29T06:42:45.750919Z"
    },
    {
      "id": 4,
      "created": "2019-10-31T09:31:50.356413Z",
      "integrationId": "TEST-USER-ID",
      "attributes": {
        "Credits": 3300,
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 1,
      "totalSales": 99,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-30T09:59:19.658305Z"
    }
  ],
  "hasMore": false
}
                            

#Request Schema

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

The exact moment this entity was created. The exact moment this entity was created.
integrationIdstring
format: string

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributesobject

Arbitrary properties associated with this item

accountIdinteger

The ID of the Talon.One account that owns this profile.

The ID of the Talon.One account that owns this profile.

closedSessionsinteger

The total amount of closed sessions by a customer. A closed session is a successful purchase.

totalSalesnumber

Sum of all purchases made by this customer

loyaltyMembershipsarray

A list of loyalty programs joined by the customer

joined string
format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId integer

The ID of the loyalty program belonging to this entity.

lastActivitystring
format: date-time

Timestamp of the most recent event received from this customer

#

Get a list of the customer profiles that match the given attributes (with total count)

POST  /v1/application_customer_search

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

#Example


                                curl --location --request POST 'https://[YOUR_DEPLOYMENT].talon.one/v1/application_customer_search' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{{"attributes": { "Language": "english"}}}'
                            
                                {
  "data": [
    {
      "id": 4,
      "created": "2019-10-31T09:31:50.356413Z",
      "integrationId": "TEST-USER-ID",
      "attributes": {
        "Credits": 3300,
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 1,
      "totalSales": 99,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-30T09:59:19.658305Z"
    },
    {
      "id": 221,
      "created": "2020-04-06T14:32:53.721796Z",
      "integrationId": "exampleprofileid",
      "attributes": {
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-26T14:21:09.830143Z"
    },
    {
      "id": 255,
      "created": "2020-06-03T16:55:45.404196Z",
      "integrationId": "TEST-USER-ID2",
      "attributes": {
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-03T16:55:55.689028Z"
    },
    {
      "id": 256,
      "created": "2020-06-03T16:56:30.081138Z",
      "integrationId": "TEST-USER-ID3",
      "attributes": {
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-03T16:56:51.947511Z"
    },
    {
      "id": 257,
      "created": "2020-06-03T19:02:44.577623Z",
      "integrationId": "TEST-USER-ID4",
      "attributes": {
        "Gender": "female",
        "Language": "english",
        "ShippingCountry": "UK"
      },
      "accountId": 1,
      "closedSessions": 0,
      "totalSales": 0,
      "loyaltyMemberships": [],
      "lastActivity": "2020-06-03T19:02:44.602683Z"
    }
  ],
  "hasMore": false
}
                            

#Request Schema

Body Parameter

attributes object

Properties to match against a customer profile. All provided attributes will be exactly matched against profile attributes

integrationIDs array

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

integrationIDs string

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

profileIDs array

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

profileIDs integer

Gets a list of all the customer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

The exact moment this entity was created. The exact moment this entity was created.
integrationIdstring
format: string

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributesobject

Arbitrary properties associated with this item

accountIdinteger

The ID of the Talon.One account that owns this profile.

The ID of the Talon.One account that owns this profile.

closedSessionsinteger

The total amount of closed sessions by a customer. A closed session is a successful purchase.

totalSalesnumber

Sum of all purchases made by this customer

loyaltyMembershipsarray

A list of loyalty programs joined by the customer

joined string
format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId integer

The ID of the loyalty program belonging to this entity.

lastActivitystring
format: date-time

Timestamp of the most recent event received from this customer

#

Get Application Customer

GET  /v1/applications/{applicationId}/customers/{customerId}

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/customers/[INTERNAL_CUSTOMER_ID]' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json'
                            
                                {
  "id": 259,
  "created": "2020-06-29T08:42:33.462042Z",
  "integrationId": "DemoUser",
  "attributes": {},
  "accountId": 1,
  "closedSessions": 4,
  "totalSales": 79.2,
  "loyaltyMemberships": [],
  "lastActivity": "2020-06-30T09:49:18.031611Z"
}
                            

#Request Schema

URL Parameter

applicationId integer required
customerId integer required

#Response Schema

idinteger

Unique ID for this entity.

createdstring
format: date-time

The exact moment this entity was created.

The exact moment this entity was created. The exact moment this entity was created.
integrationIdstring
format: string

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributesobject

Arbitrary properties associated with this item

accountIdinteger

The ID of the Talon.One account that owns this profile.

The ID of the Talon.One account that owns this profile.

closedSessionsinteger

The total amount of closed sessions by a customer. A closed session is a successful purchase.

totalSalesnumber

Sum of all purchases made by this customer

loyaltyMembershipsarray

A list of loyalty programs joined by the customer

joined string
format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId integer

The ID of the loyalty program belonging to this entity.

lastActivitystring
format: date-time

Timestamp of the most recent event received from this customer

#

Get Activity Reports for Application Customers (with total count)

GET  /v1/applications/{applicationId}/customer_activity_reports

Fetch summary reports for all application customers based on a time range

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/customer_activity_reports?rangeStart=2019-12-31T23:59:59Z&rangeEnd=2020-12-31T23:59:59Z' \
--header 'Authorization: Bearer [BEARER_TOKEN]' \
--header 'Content-Type: application/json'
                            
                                {
  "data": [
    {
      "integrationId": "DemoUser",
      "created": "2020-06-29T08:42:33.462042Z",
      "name": "",
      "customerId": 259,
      "lastActivity": "2020-06-30T09:49:18.031611Z",
      "couponRedemptions": 1,
      "couponUseAttempts": 2,
      "couponFailedAttempts": 1,
      "accruedDiscounts": 7.92,
      "accruedRevenue": 39.6,
      "totalOrders": 2,
      "totalOrdersNoCoupon": 1,
      "campaignName": "TEST_CAMPAIGN"
    },
    {
      "integrationId": "DemoUser",
      "created": "2020-06-29T08:42:33.462042Z",
      "name": "",
      "customerId": 259,
      "lastActivity": "2020-06-30T09:49:18.031611Z",
      "couponRedemptions": 1,
      "couponUseAttempts": 5,
      "couponFailedAttempts": 3,
      "accruedDiscounts": 1.98,
      "accruedRevenue": 39.6,
      "totalOrders": 2,
      "totalOrdersNoCoupon": 1,
      "campaignName": "-"
    }
  ],
  "totalResultSize": 2
}
                            

#Request Schema

URL Parameter

applicationId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

rangeStart string required
format: date-time

Only return results from after this timestamp, must be an RFC3339 timestamp string

rangeEnd string required
format: date-time

Only return results from before this timestamp, must be an RFC3339 timestamp string

name string

Only return reports matching the customer name

integrationId string

Only return reports matching the integrationId

campaignName string

Only return reports matching the campaignName

advocateName string

Only return reports matching the current customer referrer name

#Response Schema

integrationIdstring
format: string

The ID used for this entity in the application system.

createdstring
format: date-time

The exact moment this entity was created.

namestring

The name for this customer profile.

customerIdinteger

The internal Talon.One ID of the customer.

lastActivitystring
format: date-time

The last activity of the customer.

couponRedemptionsinteger

Number of coupon redemptions in all customer campaigns.

couponUseAttemptsinteger

Number of coupon use attempts in all customer campaigns.

couponFailedAttemptsinteger

Number of failed coupon use attempts in all customer campaigns.

accruedDiscountsnumber

Number of accrued discounts in all customer campaigns.

accruedRevenuenumber

Amount of accrued revenue in all customer campaigns.

totalOrdersinteger

Number of orders in all customer campaigns.

totalOrdersNoCouponinteger

Number of orders without coupon used in all customer campaigns.

campaignNamestring

The name of the campaign this customer belongs to.

#

Get Activity Reports for Application Customers

GET  /v1/applications/{applicationId}/customer_activity_reports/no_total

Fetch summary reports for all application customers based on a time range. Instead of having the total number of results in the response, this endpoint only if there are more results.

#Example


                                curl --location --request GET 'https://[YOUR_DEPLOYMENT].talon.one/v1/applications/[APPLICATION_ID]/customer_activity_reports/[INTERNAL_CUSTOMER_ID]?rangeStart=2019-12-31T23:59:59Z&rangeEnd=2020-12-31T23:59:59Z' \
--header 'Authorization: Bearer [BEARER_TOKEN]'
                            
                                {
  "integrationId": "DemoUser",
  "created": "2020-06-29T08:42:33.462042Z",
  "name": "",
  "customerId": 259,
  "lastActivity": "2020-06-30T09:49:18.031611Z",
  "couponRedemptions": 2,
  "couponUseAttempts": 7,
  "couponFailedAttempts": 4,
  "accruedDiscounts": 9.9,
  "accruedRevenue": 79.2,
  "totalOrders": 4,
  "totalOrdersNoCoupon": 2,
  "campaignName": "TEST_CAMPAIGN"
}
                            

#Request Schema

URL Parameter

applicationId integer required

Query Parameter

pageSize integer

The number of items to include in this response. When omitted, the maximum value of 1000 will be used.

Skips the given number of items when paging through large result sets.

sort string

The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with - to sort in descending order.

rangeStart string required
format: date-time

Only return results from after this timestamp, must be an RFC3339 timestamp string

rangeEnd string required
format: date-time

Only return results from before this timestamp, must be an RFC3339 timestamp string

name string

Only return reports matching the customer name

integrationId string

Only return reports matching the integrationId