19th Dec 2019

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

                                {
  "url": "GET https://demo.talon.one/v1/applications",
  "body": {
    "pageSize": 0,
    "skip": 1
  }
}
                            
                                {
  "totalResultSize": 2,
  "data": [
    {
      "id": 2,
      "created": "2018-11-28T09:19:27.560Z",
      "modified": "2018-11-28T09:19:27.560Z",
      "accountId": 1,
      "name": "Test_application_2",
      "key": "8b19a369c789cfe6",
      "timezone": "Europe/Berlin",
      "currency": "EUR",
      "description": "Test_application_2",
      "caseSensitivity": "sensitive"
    }
  ]
}
                            

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

attributesSettings
mandatory
campaigns array

List of mandatory attributes for campaigns.

coupons array

List of mandatory attributes for campaigns.

keystring
minlength: 16

Hex key for HMAC-signing API calls as coming from this application (16 hex digits)

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' or '30d'.

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

                                {
  "url": "GET https://demo.talon.one/v1/applications/1",
  "body": {}
}
                            
                                {
  "id": 1,
  "created": "2019-07-25T11:24:01.373Z",
  "modified": "2019-07-25T11:24:01.373Z",
  "accountId": 1,
  "name": "demo",
  "key": "b46ce205e5b28e27",
  "timezone": "Europe/Berlin",
  "currency": "USD",
  "description": "demo",
  "caseSensitivity": "sensitive"
}
                            

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

attributesSettings
mandatory
campaigns array

List of mandatory attributes for campaigns.

coupons array

List of mandatory attributes for campaigns.

keystring
minlength: 16

Hex key for HMAC-signing API calls as coming from this application (16 hex digits)

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' or '30d'.

allowSubledger boolean

Indicates if this program supports subledgers inside the program

#

Create a Campaign

POST  /v1/applications/{applicationId}/campaigns

Example

                                {
  "url": "POST https://demo.talon.one/v1/applications/1/campaigns",
  "body": {
    "body": {
      "name": "0.19462433559627135",
      "state": "disabled",
      "tags": [],
      "features": [],
      "limits": []
    }
  }
}
                            
                                {
  "id": 31,
  "created": "2019-07-25T12:07:22.515Z",
  "applicationId": 1,
  "userId": 1,
  "name": "0.19462433559627135",
  "description": "",
  "state": "disabled",
  "tags": [],
  "features": [],
  "limits": [],
  "attributes": {},
  "updated": "2019-07-25T12:07:22.515Z",
  "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.

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).

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).

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

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.

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

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/campaigns",
  "body": {}
}
                            
                                {
  "totalResultSize": 1,
  "data": [
    {
      "id": 1,
      "created": "2018-11-28T11:59:59.433Z",
      "applicationId": 1,
      "userId": 1,
      "name": "TEST",
      "description": "",
      "state": "disabled",
      "tags": [],
      "features": [
        "coupons"
      ],
      "limits": [],
      "attributes": {},
      "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": "####-####"
      },
      "couponRedemptionCount": 0,
      "referralRedemptionCount": 0,
      "discountCount": 0,
      "updated": "2018-11-28T11:59:59.433Z",
      "updatedBy": "Admin"
    }
  ]
}
                            

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.

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.

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 Set

PUT  /v1/applications/{applicationId}/campaign_set

Example

                                No example request
                            
                                No example response
                            

Request Schema

URL Parameter

applicationId integer required

Body Parameter

applicationId integer required

The ID of the application that owns this entity.

set required
type string

Indicates the node type

name string

Name of the set

operator string

How does the set operates on its elements

elements array

Child elements of this set

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.

set
type string

Indicates the node type

name string

Name of the set

operator string

How does the set operates on its elements

elements array

Child elements of this set

type string

Child elements of this set

#

List CampaignSet

GET  /v1/applications/{applicationId}/campaign_set

Example

                                No example request
                            
                                No example response
                            

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.

applicationIdinteger

The ID of the application that owns this entity.

set
type string

Indicates the node type

name string

Name of the set

operator string

How does the set operates on its elements

elements array

Child elements of this set

type string

Child elements of this set

#

Get a Campaign

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

Example

                                {
  "url": "GET https://demo.talon.one/v1/applications/5/campaigns/399",
  "body": {}
}
                            
                                {
  "id": 399,
  "created": "2017-11-21T10:11:28.677Z",
  "applicationId": 5,
  "userId": 2,
  "name": "Buy 2 get 1 gift (Toys)",
  "description": "When a customer buys 2 items from the category Toys, he will get a gift item in the cart. This works with a coupon.",
  "state": "enabled",
  "tags": [
    "coupon"
  ],
  "features": [
    "coupons"
  ],
  "limits": [
    {
      "action": "setDiscount",
      "limit": 1,
      "entities": []
    }
  ],
  "attributes": {},
  "activeRulesetId": 733,
  "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": "####-####"
  },
  "couponRedemptionCount": 0,
  "referralRedemptionCount": 0,
  "discountCount": 0,
  "lastActivity": "2018-04-11T08:53:56.020Z",
  "updated": "2018-08-27T13:18:38.284Z",
  "updatedBy": "Felix Möckel"
}
                            

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.

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

                                {
  "url": "PUT https://demo.talon.one/v1/applications/1/campaigns/2",
  "body": {
    "body": {
      "name": "TEST2",
      "state": "disabled",
      "activeRulesetId": 3,
      "tags": [
        "test"
      ],
      "features": [
        "coupons"
      ],
      "limits": [
        {
          "action": "redeemCoupon",
          "entities": [
            "Coupon"
          ],
          "limit": 62.02
        },
        {
          "action": "setDiscount",
          "entities": [
            "Coupon"
          ],
          "limit": 34.08
        },
        {
          "action": "redeemCoupon",
          "entities": [
            "Coupon"
          ],
          "limit": 71.97
        },
        {
          "action": "redeemReferral",
          "entities": [
            "Coupon"
          ],
          "limit": 24.49
        }
      ]
    }
  }
}
                            
                                {
  "id": 2,
  "created": "2018-11-28T12:13:44.574Z",
  "applicationId": 1,
  "userId": 1,
  "name": "TEST2",
  "description": "",
  "state": "disabled",
  "tags": [
    "test"
  ],
  "features": [
    "coupons"
  ],
  "limits": [
    {
      "action": "redeemCoupon",
      "limit": 62.02,
      "entities": [
        "Coupon"
      ]
    },
    {
      "action": "setDiscount",
      "limit": 34.08,
      "entities": [
        "Coupon"
      ]
    },
    {
      "action": "redeemCoupon",
      "limit": 71.97,
      "entities": [
        "Coupon"
      ]
    },
    {
      "action": "redeemReferral",
      "limit": 24.49,
      "entities": [
        "Coupon"
      ]
    }
  ],
  "attributes": {},
  "activeRulesetId": 3,
  "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": "####-####"
  },
  "couponRedemptionCount": 0,
  "referralRedemptionCount": 0,
  "discountCount": 0,
  "updated": "2018-11-28T12:23:52.978Z",
  "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.

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).

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).

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

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.

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

                                {
  "url": "DELETE https://example.talon.one/v1/applications/1/campaigns/1",
  "body": {}
}
                            
                                null
                            

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

                                No example request
                            
                                No example response
                            

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

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.

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

                                {
  "url": "POST https://demo.talon.one/v1/applications/1/campaigns_search",
  "body": {
    "body": {
      "attributes": {
        "test": "test"
      }
    }
  }
}
                            
                                {
  "totalResultSize": 0,
  "data": []
}
                            

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.

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

                                {
  "url": "POST https://demo.talon.one/v1/applications/132/campaigns/1477/rulesets",
  "body": {
    "body": {
      "body": " ",
      "rules": [
        {
          "title": "",
          "condition": [
            "and",
            [
              "couponValid"
            ]
          ],
          "effects": [
            [
              "catch",
              [
                "noop"
              ],
              [
                "setDiscount",
                "40% off",
                [
                  "*",
                  [
                    ".",
                    "Session",
                    "Total"
                  ],
                  [
                    "/",
                    40,
                    100
                  ]
                ]
              ]
            ]
          ]
        }
      ],
      "bindings": [],
      "rbVersion": "v2",
      "activate": true
    }
  }
}
                            
                                {
  "id": 3357,
  "created": "2019-07-26T15:06:29.948Z",
  "campaignId": 1477,
  "userId": 93,
  "rules": [
    {
      "title": "",
      "condition": [
        "and",
        [
          "couponValid"
        ]
      ],
      "effects": [
        [
          "catch",
          [
            "noop"
          ],
          [
            "setDiscount",
            "40% off",
            [
              "*",
              [
                ".",
                "Session",
                "Total"
              ],
              [
                "/",
                40,
                100
              ]
            ]
          ]
        ]
      ]
    }
  ],
  "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.

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.

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

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/campaigns/1/rulesets",
  "body": {}
}
                            
                                {
  "totalResultSize": 1,
  "data": [
    {
      "id": 1,
      "created": "2018-11-28T12:05:28.598Z",
      "campaignId": 1,
      "userId": 1,
      "rules": [
        {
          "title": "Adjustable Base and a Mattress for 20% Off Rule",
          "condition": [
            "and",
            [
              "catch",
              false,
              [
                "do",
                [
                  ".",
                  "MattressTotalQuantity"
                ],
                [
                  [
                    "Variable"
                  ],
                  [
                    ">",
                    [
                      ".",
                      "Variable"
                    ],
                    0
                  ]
                ]
              ]
            ],
            [
              "catch",
              false,
              [
                "do",
                [
                  ".",
                  "AdjustableBedQuantityTotal"
                ],
                [
                  [
                    "Variable"
                  ],
                  [
                    ">",
                    [
                      ".",
                      "Variable"
                    ],
                    0
                  ]
                ]
              ]
            ]
          ],
          "effects": [
            [
              "catch",
              [
                "noop"
              ],
              [
                "foreach",
                [
                  ".",
                  "AdjustableBaseItems"
                ],
                [
                  [
                    "Item"
                  ],
                  [
                    "setDiscountPerItem",
                    "20% off per item",
                    [
                      "*",
                      [
                        "*",
                        [
                          ".",
                          "Item",
                          "Quantity"
                        ],
                        [
                          ".",
                          "Item",
                          "Price"
                        ]
                      ],
                      [
                        "/",
                        20,
                        100
                      ]
                    ],
                    [
                      ".",
                      "Item",
                      "Position"
                    ]
                  ]
                ]
              ]
            ]
          ],
          "bindings": [
            {
              "name": "AdjustableBedQuantityTotal",
              "expression": [
                "sum",
                [
                  "filter",
                  [
                    ".",
                    "Session",
                    "CartItems"
                  ],
                  [
                    [
                      "Item"
                    ],
                    [
                      "catch",
                      false,
                      [
                        "do",
                        [
                          ".",
                          "Item",
                          "Category"
                        ],
                        [
                          [
                            "Variable"
                          ],
                          [
                            "=",
                            [
                              ".",
                              "Variable"
                            ],
                            "adjustable-base"
                          ]
                        ]
                      ]
                    ]
                  ]
                ],
                [
                  [
                    "Item"
                  ],
                  [
                    ".",
                    "Item",
                    "Quantity"
                  ]
                ]
              ]
            },
            {
              "name": "MattressTotalQuantity",
              "expression": [
                "sum",
                [
                  "filter",
                  [
                    ".",
                    "Session",
                    "CartItems"
                  ],
                  [
                    [
                      "Item"
                    ],
                    [
                      "catch",
                      false,
                      [
                        "do",
                        [
                          ".",
                          "Item",
                          "Category"
                        ],
                        [
                          [
                            "Variable"
                          ],
                          [
                            "=",
                            [
                              ".",
                              "Variable"
                            ],
                            "mattresses"
                          ]
                        ]
                      ]
                    ]
                  ]
                ],
                [
                  [
                    "Item"
                  ],
                  [
                    ".",
                    "Item",
                    "Quantity"
                  ]
                ]
              ]
            },
            {
              "name": "AdjustableBaseItems",
              "expression": [
                "filter",
                [
                  ".",
                  "Session",
                  "CartItems"
                ],
                [
                  [
                    "Item"
                  ],
                  [
                    "catch",
                    false,
                    [
                      "do",
                      [
                        ".",
                        "Item",
                        "Category"
                      ],
                      [
                        [
                          "Variable"
                        ],
                        [
                          "=",
                          [
                            ".",
                            "Variable"
                          ],
                          "adjustable-base"
                        ]
                      ]
                    ]
                  ]
                ]
              ]
            }
          ]
        }
      ],
      "rbVersion": "unspecified"
    }
  ]
}
                            

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

                                No example request
                            
                                No example response
                            

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.

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.

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

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/campaigns/1/rulesets/1",
  "body": {}
}
                            
                                {
  "id": 1,
  "created": "2018-11-28T12:05:28.598Z",
  "campaignId": 1,
  "userId": 1,
  "rules": [
    {
      "title": "Adjustable Base and a Mattress for 20% Off Rule",
      "condition": [
        "and",
        [
          "catch",
          false,
          [
            "do",
            [
              ".",
              "MattressTotalQuantity"
            ],
            [
              [
                "Variable"
              ],
              [
                ">",
                [
                  ".",
                  "Variable"
                ],
                0
              ]
            ]
          ]
        ],
        [
          "catch",
          false,
          [
            "do",
            [
              ".",
              "AdjustableBedQuantityTotal"
            ],
            [
              [
                "Variable"
              ],
              [
                ">",
                [
                  ".",
                  "Variable"
                ],
                0
              ]
            ]
          ]
        ]
      ],
      "effects": [
        [
          "catch",
          [
            "noop"
          ],
          [
            "foreach",
            [
              ".",
              "AdjustableBaseItems"
            ],
            [
              [
                "Item"
              ],
              [
                "setDiscountPerItem",
                "20% off per item",
                [
                  "*",
                  [
                    "*",
                    [
                      ".",
                      "Item",
                      "Quantity"
                    ],
                    [
                      ".",
                      "Item",
                      "Price"
                    ]
                  ],
                  [
                    "/",
                    20,
                    100
                  ]
                ],
                [
                  ".",
                  "Item",
                  "Position"
                ]
              ]
            ]
          ]
        ]
      ],
      "bindings": [
        {
          "name": "AdjustableBedQuantityTotal",
          "expression": [
            "sum",
            [
              "filter",
              [
                ".",
                "Session",
                "CartItems"
              ],
              [
                [
                  "Item"
                ],
                [
                  "catch",
                  false,
                  [
                    "do",
                    [
                      ".",
                      "Item",
                      "Category"
                    ],
                    [
                      [
                        "Variable"
                      ],
                      [
                        "=",
                        [
                          ".",
                          "Variable"
                        ],
                        "adjustable-base"
                      ]
                    ]
                  ]
                ]
              ]
            ],
            [
              [
                "Item"
              ],
              [
                ".",
                "Item",
                "Quantity"
              ]
            ]
          ]
        },
        {
          "name": "MattressTotalQuantity",
          "expression": [
            "sum",
            [
              "filter",
              [
                ".",
                "Session",
                "CartItems"
              ],
              [
                [
                  "Item"
                ],
                [
                  "catch",
                  false,
                  [
                    "do",
                    [
                      ".",
                      "Item",
                      "Category"
                    ],
                    [
                      [
                        "Variable"
                      ],
                      [
                        "=",
                        [
                          ".",
                          "Variable"
                        ],
                        "mattresses"
                      ]
                    ]
                  ]
                ]
              ]
            ],
            [
              [
                "Item"
              ],
              [
                ".",
                "Item",
                "Quantity"
              ]
            ]
          ]
        },
        {
          "name": "AdjustableBaseItems",
          "expression": [
            "filter",
            [
              ".",
              "Session",
              "CartItems"
            ],
            [
              [
                "Item"
              ],
              [
                "catch",
                false,
                [
                  "do",
                  [
                    ".",
                    "Item",
                    "Category"
                  ],
                  [
                    [
                      "Variable"
                    ],
                    [
                      "=",
                      [
                        ".",
                        "Variable"
                      ],
                      "adjustable-base"
                    ]
                  ]
                ]
              ]
            ]
          ]
        }
      ]
    }
  ],
  "rbVersion": "unspecified"
}
                            

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

                                No example request
                            
                                No example response
                            

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

                                {
  "url": "POST https://demo.talon.one/v1/applications/132/campaigns/1477/coupons",
  "body": {
    "body": {
      "usageLimit": 1,
      "validCharacters": [
        "A",
        "B",
        "C",
        "wweifewifeihewihfe"
      ],
      "couponPattern": "test_####wro00",
      "numberOfCoupons": 1
    }
  }
}
                            
                                {
  "totalResultSize": -1,
  "data": [
    {
      "id": 1588242,
      "created": "2019-07-26T07:27:31.688Z",
      "campaignId": 1477,
      "value": "test_BBCwweifewifeihewihfewro00",
      "usageLimit": 0,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "satotada"
    }
  ]
}
                            

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.

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.

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.

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 a referred customer profile.

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

                                No example request
                            
                                No example response
                            

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.

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

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

Example

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/campaigns/1/coupons",
  "body": {
    "valid": "expired"
  }
}
                            
                                {
  "totalResultSize": 0,
  "data": []
}
                            

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.

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.

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 a referred customer profile.

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

                                {
  "url": "DELETE https://example.talon.one/v1/applications/19/campaigns/38/coupons/14",
  "body": {}
}
                            
                                null
                            

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

                                No example request
                            
                                No example response
                            

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.

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.

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 a referred customer profile.

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

                                {
  "url": "PUT https://example.talon.one/v1/applications/19/campaigns/38/coupons/14",
  "body": {
    "body": {
      "usageLimit": 100
    }
  }
}
                            
                                {
  "id": 14,
  "created": "2018-11-15T14:33:06.611Z",
  "campaignId": 38,
  "value": "test_CCBC",
  "usageLimit": 100,
  "usageCounter": 0,
  "attributes": {},
  "batchId": "zuqalixi"
}
                            

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.

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.

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.

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 a referred customer profile.

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

                                No example request
                            
                                No example response
                            

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

                                {
  "url": "POST https://demo.talon.one/v1/applications/151/campaigns/1653/coupons_search",
  "body": {
    "body": {
      "attributes": {}
    }
  }
}
                            
                                {
  "totalResultSize": 10,
  "data": [
    {
      "id": 1813657,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "T745XEYF",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813658,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "J83WQ3BT",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813659,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "UA3XR9TX",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813660,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "CJ5WMVLM",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813661,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "HFYNW4AN",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813662,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "P9CRUY3Y",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813663,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "7F8NLJXF",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813664,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "KUHUCDXR",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813665,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "F3KJKUDX",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813666,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "WC5FNP8C",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    }
  ]
}
                            

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.

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.

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 a referred customer profile.

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

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

Example

                                {
  "url": "POST https://demo.talon.one/v1/applications/151/coupons_search",
  "body": {
    "body": {
      "attributes": {}
    }
  }
}
                            
                                {
  "totalResultSize": 10,
  "data": [
    {
      "id": 1813657,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "T745XEYF",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813658,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "J83WQ3BT",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813659,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "UA3XR9TX",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813660,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "CJ5WMVLM",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813661,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "HFYNW4AN",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813662,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "P9CRUY3Y",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813663,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "7F8NLJXF",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813664,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "KUHUCDXR",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813665,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "F3KJKUDX",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813666,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "WC5FNP8C",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    }
  ]
}
                            

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.

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.

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 a referred customer profile.

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

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

Example

                                {
  "url": "POST https://demo.talon.one/v1/applications/151/campaigns/1653/coupons_search_advanced",
  "body": {
    "body": {}
  }
}
                            
                                {
  "totalResultSize": 10,
  "data": [
    {
      "id": 1813657,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "T745XEYF",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813658,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "J83WQ3BT",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813659,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "UA3XR9TX",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813660,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "CJ5WMVLM",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813661,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "HFYNW4AN",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813662,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "P9CRUY3Y",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813663,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "7F8NLJXF",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813664,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "KUHUCDXR",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813665,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "F3KJKUDX",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    },
    {
      "id": 1813666,
      "created": "2019-10-07T07:24:44.953Z",
      "campaignId": 1653,
      "value": "WC5FNP8C",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "clbdfzek"
    }
  ]
}
                            

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.

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.

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 a referred customer profile.

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

                                No example request
                            
                                No example response
                            

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.

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.

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 a referred customer profile.

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

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

Example

                                No example request
                            
                                No example response
                            

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.

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.

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 a referred customer profile.

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

                                No example request
                            
                                No example response
                            

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.

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.

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 a referred customer profile.

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

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

Example

                                No example request
                            
                                No example response
                            

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

                                No example request
                            
                                No example response
                            

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

                                No example request
                            
                                No example response
                            

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

                                No example request
                            
                                No example response
                            

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' or '30d'.

allowSubledgerboolean

Indicates if this program supports subledgers inside the program

#

Get a loyalty program

GET  /v1/loyalty_programs/{programID}

Example

                                No example request
                            
                                No example response
                            

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' or '30d'.

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

                                No example request
                            
                                No example response
                            

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

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

amount number

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

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

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

amount number

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

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

                                No example request
                            
                                No example response
                            

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 unit, like '1h' or '40m' or '30d'.

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

                                No example request
                            
                                No example response
                            

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 unit, like '1h' or '40m' or '30d'.

subLedgerID string

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

Response Schema

#

Get access logs for application

GET  /v1/applications/{applicationId}/access_logs

Example

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/access_logs",
  "body": {
    "rangeStart": "2018-11-11T13:54:23+00:00",
    "rangeEnd": "2018-11-15T13:54:23+00:00"
  }
}
                            
                                {
  "totalResultSize": 6,
  "data": [
    {
      "uuid": "3597a2cd-f857-4d1f-bd45-75315a510878",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v1/customer_profiles/TEST-USER-ID",
      "time": "2018-11-15T10:19:59.785Z",
      "requestPayload": "{\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"}}",
      "responsePayload": "{\"session\":{\"integrationId\":\"\",\"created\":\"2018-11-15T10:19:59.8461177Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"coupon\":\"\",\"referral\":\"\",\"state\":\"open\",\"cartItems\":[],\"total\":0,\"attributes\":{},\"firstSession\":false,\"discounts\":{}},\"profile\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-20T13:15:10.051903Z\",\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":[],\"lastActivity\":\"2018-11-15T10:07:26.707166Z\"},\"event\":{\"id\":4493,\"created\":\"2018-11-15T10:19:59.8513492Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"sessionId\":\"\",\"type\":\"talon_profile_updated\",\"attributes\":{\"integrationId\":\"TEST-USER-ID\",\"isNew\":false,\"params\":{\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"}}},\"effects\":[],\"ledgerEntries\":[],\"meta\":{}}}"
    },
    {
      "uuid": "bd9de695-9b72-49c0-be98-ed0b1d5600b9",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v1/customer_sessions/TEST-SESSION-ID",
      "time": "2018-11-15T10:07:26.572Z",
      "requestPayload": "{\"profileId\":\"TEST-USER-ID\",\"total\":1400}",
      "responsePayload": "{\"session\":{\"integrationId\":\"TEST-SESSION-ID\",\"created\":\"2018-08-20T13:15:10.044841Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"coupon\":\"\",\"referral\":\"\",\"state\":\"open\",\"cartItems\":[{\"name\":\"Mountain bike\",\"sku\":\"B280LO9ZZ9\",\"quantity\":1,\"price\":1400,\"category\":\"mountainbikes\",\"weight\":11,\"position\":0,\"attributes\":{\"ItemBrand\":\"Trek\",\"color\":[\"brown\",\"yellow\"],\"image\":\"11.jpeg\",\"material\":\"aluminum\",\"size\":46}}],\"total\":1400,\"attributes\":{},\"firstSession\":true,\"discounts\":{\"Per item discount#0\":140.0}},\"profile\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-20T13:15:10.051903Z\",\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":[],\"lastActivity\":\"2018-11-15T10:03:13.872321Z\"},\"event\":{\"id\":4492,\"created\":\"2018-11-15T10:07:26.6380803Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"sessionId\":\"TEST-SESSION-ID\",\"type\":\"talon_session_updated\",\"attributes\":{\"integrationId\":\"TEST-SESSION-ID\",\"isNew\":false,\"params\":{\"profileId\":\"TEST-USER-ID\",\"total\":1400}},\"effects\":[[12,107,2,[\"setDiscountPerItem\",\"Per item discount#0\",140.0,0]]],\"ledgerEntries\":[],\"meta\":{\"campaigns\":{}}}}"
    },
    {
      "uuid": "df1148b2-5bc3-4fbe-a33b-c9845a7e1bef",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v1/customer_profiles/TEST-USER-ID",
      "time": "2018-11-15T10:03:13.805Z",
      "requestPayload": "{\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"}}",
      "responsePayload": "{\"session\":{\"integrationId\":\"\",\"created\":\"2018-11-15T10:03:13.8428726Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"coupon\":\"\",\"referral\":\"\",\"state\":\"open\",\"cartItems\":[],\"total\":0,\"attributes\":{},\"firstSession\":false,\"discounts\":{}},\"profile\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-20T13:15:10.051903Z\",\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":[],\"lastActivity\":\"2018-11-15T09:59:53.683825Z\"},\"event\":{\"id\":4491,\"created\":\"2018-11-15T10:03:13.8513522Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"sessionId\":\"\",\"type\":\"talon_profile_updated\",\"attributes\":{\"integrationId\":\"TEST-USER-ID\",\"isNew\":false,\"params\":{\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"}}},\"effects\":[],\"ledgerEntries\":[],\"meta\":{}}}"
    },
    {
      "uuid": "2863a400-cecb-4b7a-bc66-4c6e694bcc47",
      "status": 200,
      "method": "PUT",
      "requestUri": "/v1/customer_profiles/TEST-USER-ID",
      "time": "2018-11-15T09:59:53.590Z",
      "requestPayload": "{\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"}}",
      "responsePayload": "{\"session\":{\"integrationId\":\"\",\"created\":\"2018-11-15T09:59:53.6472088Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"coupon\":\"\",\"referral\":\"\",\"state\":\"open\",\"cartItems\":[],\"total\":0,\"attributes\":{},\"firstSession\":false,\"discounts\":{}},\"profile\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-20T13:15:10.051903Z\",\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":[],\"lastActivity\":\"2018-11-15T09:53:24.424494Z\"},\"event\":{\"id\":4490,\"created\":\"2018-11-15T09:59:53.6601022Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"sessionId\":\"\",\"type\":\"talon_profile_updated\",\"attributes\":{\"integrationId\":\"TEST-USER-ID\",\"isNew\":false,\"params\":{\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"}}},\"effects\":[],\"ledgerEntries\":[],\"meta\":{}}}"
    },
    {
      "uuid": "4e8a24c8-7c0f-4e04-b0bd-c22dc97f7f6e",
      "status": 201,
      "method": "POST",
      "requestUri": "/v1/events",
      "time": "2018-11-15T09:53:24.237Z",
      "requestPayload": "{\"sessionId\":\"TEST-USER-ID\",\"profileId\":\"TEST-USER-ID\",\"type\":\"pageview\",\"attributes\":{\"validate\":true}}",
      "responsePayload": "{\"session\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-22T07:50:41.126403Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"coupon\":\"\",\"referral\":\"\",\"state\":\"open\",\"cartItems\":[],\"total\":0,\"attributes\":{},\"firstSession\":false,\"discounts\":{}},\"profile\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-20T13:15:10.051903Z\",\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":[],\"lastActivity\":\"2018-11-15T09:52:04.342327Z\"},\"event\":{\"id\":4489,\"created\":\"2018-11-15T09:53:24.4098487Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"sessionId\":\"TEST-USER-ID\",\"type\":\"pageview\",\"attributes\":{\"validate\":true},\"effects\":[[12,107,0,[\"showNotification\",\"Misc\",\"priceadjustment\",\"{\\\"scope\\\":[\\\"manufacturer\\\",\\\"Cube\\\"],\\\"discount\\\": \\\"10%\\\"}\"]]],\"ledgerEntries\":[],\"meta\":{\"campaigns\":{}}}}"
    },
    {
      "uuid": "6a4a8730-e434-4e5f-9249-e75d210d039f",
      "status": 201,
      "method": "POST",
      "requestUri": "/v1/events",
      "time": "2018-11-15T09:52:03.958Z",
      "requestPayload": "{\"sessionId\":\"TEST-USER-ID\",\"profileId\":\"TEST-USER-ID\",\"type\":\"pageview\",\"attributes\":{\"validate\":true}}",
      "responsePayload": "{\"session\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-22T07:50:41.126403Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"coupon\":\"\",\"referral\":\"\",\"state\":\"open\",\"cartItems\":[],\"total\":0,\"attributes\":{},\"firstSession\":false,\"discounts\":{}},\"profile\":{\"integrationId\":\"TEST-USER-ID\",\"created\":\"2018-08-20T13:15:10.051903Z\",\"attributes\":{\"Gender\":\"female\",\"Language\":\"english\",\"ShippingCountry\":\"UK\"},\"accountId\":1,\"closedSessions\":0,\"totalSales\":0,\"loyaltyMemberships\":[],\"lastActivity\":\"2018-11-06T09:19:09.066786Z\"},\"event\":{\"id\":4488,\"created\":\"2018-11-15T09:52:04.2359832Z\",\"applicationId\":1,\"profileId\":\"TEST-USER-ID\",\"sessionId\":\"TEST-USER-ID\",\"type\":\"pageview\",\"attributes\":{\"validate\":true},\"effects\":[[12,107,0,[\"showNotification\",\"Misc\",\"priceadjustment\",\"{\\\"scope\\\":[\\\"manufacturer\\\",\\\"Cube\\\"],\\\"discount\\\": \\\"10%\\\"}\"]]],\"ledgerEntries\":[],\"meta\":{\"campaigns\":{}}}}"
    }
  ]
}
                            

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

                                No example request
                            
                                No example response
                            

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

                                {
  "url": "GET https://example.talon.one/v1/access_logs",
  "body": {
    "pageSize": 5
  }
}
                            
                                {
  "totalResultSize": 1179,
  "data": [
    {
      "uuid": "31451c63-ed08-41bf-901c-bcadc87eca74",
      "status": 200,
      "method": "GET",
      "requestUri": "/v1/applications/19/campaigns/36/rulesets",
      "time": "2018-11-15T13:54:16.998Z",
      "requestPayload": "",
      "responsePayload": "{\"data\":[{\"id\":128,\"created\":\"2018-11-15T12:41:26.174766Z\",\"campaignId\":36,\"userId\":1,\"rules\":[{\"title\":\"wdwefdewd\",\"condition\":[\"and\",[\"or\",[\"!\",\"systemEventOccurs\",\"talon_session_created\"]]],\"effects\":[[\"catch\",[\"noop\"],[\"setDiscount\",\"10% off\",[\"*\",[\".\",\"Session\",\"Total\"],[\"/\",10,100]]]]]}],\"rbVersion\":\"v2\",\"activatedAt\":\"2018-11-15T12:41:26.206833Z\"},{\"id\":130,\"created\":\"2018-11-15T13:19:10.529197Z\",\"campaignId\":36,\"userId\":1,\"rules\":[{\"title\":\"wdwefdewd\",\"condition\":[\"and\",[\"or\",[\"!\",\"systemEventOccurs\",\"talon_session_created\"]]],\"effects\":[[\"catch\",[\"noop\"],[\"setDiscount\",\"10% off\",[\"*\",[\".\",\"Session\",\"Total\"],[\"/\",10,100]]]]]},{\"title\":\"TEST\",\"condition\":[\"and\",[\"couponValid\"]],\"effects\":[[\"catch\",[\"noop\"],[\"setDiscount\",\"10% off\",[\"*\",[\".\",\"Session\",\"Total\"],[\"/\",10,100]]]]]}],\"rbVersion\":\"v2\",\"activatedAt\":\"2018-11-15T13:19:10.69637Z\"},{\"id\":131,\"created\":\"2018-11-15T13:20:42.170904Z\",\"campaignId\":36,\"userId\":1,\"rules\":[{\"title\":\"TEST\",\"condition\":[\"and\",[\"couponValid\"]],\"effects\":[[\"catch\",[\"noop\"],[\"setDiscount\",\"10% off\",[\"*\",[\".\",\"Session\",\"Total\"],[\"/\",10,100]]]]]}],\"rbVersion\":\"unspecified\"}],\"totalResultSize\":3}"
    },
    {
      "uuid": "c38fc7df-3fb8-403f-98a4-9d0afecfaac5",
      "status": 404,
      "method": "GET",
      "requestUri": "/v1/applications/17/campaigns/25/rulesets",
      "time": "2018-11-15T13:53:53.214Z",
      "requestPayload": "",
      "responsePayload": "{\"message\":\"application 17 not found\"}"
    },
    {
      "uuid": "9ac0634f-88f1-4adc-8602-d2ee2f1fcded",
      "status": 200,
      "method": "GET",
      "requestUri": "/v1/applications/1",
      "time": "2018-11-15T13:30:52.322Z",
      "requestPayload": "",
      "responsePayload": "{\"id\":1,\"created\":\"2018-04-11T07:56:51.517456Z\",\"modified\":\"2018-04-11T07:56:51.517456Z\",\"accountId\":1,\"name\":\"demoshop\",\"description\":\"demoshop\",\"key\":\"605ad878dd674900\",\"timezone\":\"Europe/Berlin\",\"currency\":\"EUR\",\"caseSensitivity\":\"sensitive\"}"
    },
    {
      "uuid": "fe3024be-8682-4660-a55f-52d2e9cdf078",
      "status": 200,
      "method": "POST",
      "requestUri": "/v1/applications/1/campaigns_search",
      "time": "2018-11-15T13:29:06.354Z",
      "requestPayload": "{\"attributes\":{\"test\":\"test\"}}",
      "responsePayload": "{\"data\":[],\"totalResultSize\":0}"
    },
    {
      "uuid": "aaeaaea7-7bfc-42ce-a21d-625ab5414344",
      "status": 200,
      "method": "POST",
      "requestUri": "/v1/applications/1/campaigns_search",
      "time": "2018-11-15T13:28:56.529Z",
      "requestPayload": "{\"attributes\":{\"test\":\"test\"}}",
      "responsePayload": "{\"data\":[],\"totalResultSize\":0}"
    }
  ]
}
                            

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

                                {
  "url": "GET https://demo.talon.one/v1/applications/19/campaigns/38/analytics",
  "body": {
    "granularity": "1 day",
    "rangeStart": "2018-11-11T13:54:23+00:00",
    "rangeEnd": "2018-11-12T13:54:23+00:00"
  }
}
                            
                                {
  "totalResultSize": 2,
  "data": [
    {
      "date": "2018-11-11T00:00:00.000Z",
      "campaignRevenue": 0,
      "totalCampaignRevenue": 0,
      "campaignDiscountCosts": 0,
      "totalCampaignDiscountCosts": 0,
      "couponRedemptions": 0,
      "totalCouponRedemptions": 0,
      "couponsCreated": 0,
      "totalCouponsCreated": 0
    },
    {
      "date": "2018-11-12T00:00:00.000Z",
      "campaignRevenue": 0,
      "totalCampaignRevenue": 0,
      "campaignDiscountCosts": 0,
      "totalCampaignDiscountCosts": 0,
      "couponRedemptions": 0,
      "totalCouponRedemptions": 0,
      "couponsCreated": 0,
      "totalCouponsCreated": 0
    }
  ]
}
                            

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

                                {
  "url": "GET https://demo.talon.one/v1/applications/19/customers",
  "body": {}
}
                            
                                {
  "totalResultSize": 0,
  "data": []
}
                            

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

                                No example request
                            
                                No example response
                            

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

                                No example request
                            
                                No example response
                            

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

#

List Customer Profiles

GET  /v1/customers/no_total

Example

                                No example request
                            
                                No example response
                            

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

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

                                No example request
                            
                                No example response
                            

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

                                {
  "url": "GET https://example.talon.one/v1/applications/1/customers/1",
  "body": {}
}
                            
                                {
  "id": 1,
  "created": "2018-04-11T08:01:55.485Z",
  "integrationId": "5acdc0f323a6ee49db506080",
  "attributes": {
    "Name": "5acdc0f323a6ee49db506080"
  },
  "accountId": 1,
  "closedSessions": 0,
  "totalSales": 0,
  "loyaltyMemberships": [],
  "lastActivity": "2018-04-11T08:01:55.489Z"
}
                            

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

GET  /v1/applications/{applicationId}/customer_activity_reports

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

Example

                                No example request
                            
                                No example response
                            

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

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/customer_activity_reports",
  "body": {
    "rangeStart": "2018-11-11T13:54:23+00:00",
    "rangeEnd": "2018-11-15T13:54:23+00:00"
  }
}
                            
                                {
  "totalResultSize": 2,
  "data": [
    {
      "integrationId": "TEST-USER-ID",
      "created": "2018-08-20T13:15:10.051Z",
      "name": "",
      "customerId": 136,
      "couponRedemptions": 0,
      "couponUseAttempts": 0,
      "couponFailedAttempts": 0,
      "accruedDiscounts": 0,
      "accruedRevenue": 0,
      "totalOrders": 0,
      "totalOrdersNoCoupon": 0,
      "campaignName": "Discount per item",
      "lastActivity": "2018-11-15T10:19:59.872Z"
    },
    {
      "integrationId": "TEST-USER-ID",
      "created": "2018-08-20T13:15:10.051Z",
      "name": "",
      "customerId": 136,
      "couponRedemptions": 0,
      "couponUseAttempts": 0,
      "couponFailedAttempts": 0,
      "accruedDiscounts": 0,
      "accruedRevenue": 0,
      "totalOrders": 0,
      "totalOrdersNoCoupon": 0,
      "campaignName": "-",
      "lastActivity": "2018-11-15T10:19:59.872Z"
    }
  ]
}
                            

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 Report for Single Customer

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

Fetch summary report for single application customer based on a time range

Example

                                {
  "url": "GET https://example.talon.one/v1/applications/1/customer_activity_reports/1",
  "body": {}
}
                            
                                {
  "integrationId": "",
  "created": "2001-01-01T00:00:00.000Z",
  "name": "",
  "customerId": 0,
  "couponRedemptions": 0,
  "couponUseAttempts": 0,
  "couponFailedAttempts": 0,
  "accruedDiscounts": 0,
  "accruedRevenue": 0,
  "totalOrders": 0,
  "totalOrdersNoCoupon": 0,
  "campaignName": ""
}
                            

Request Schema

URL Parameter

applicationId integer required
customerId 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.

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

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 Analytics Report for a Customer

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

Fetch analytics for single application customer

Example

                                No example request
                            
                                No example response
                            

Request Schema

URL Parameter

applicationId integer required
customerId 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

acceptedCouponsinteger

Total accepted coupons for this customer

createdCouponsinteger

Total created coupons for this customer

freeItemsinteger

Total free items given to this customer

totalOrdersinteger

Total orders made by this customer

totalDiscountedOrdersinteger

Total orders made by this customer that had a discount

totalRevenuenumber

Total Revenue across all closed sessions

totalDiscountsnumber

The sum of discounts that were given across all closed sessions

#

List Application Sessions

GET  /v1/applications/{applicationId}/sessions

Example

                                {
  "url": "GET https://example.talon.one/v1/applications/1/sessions",
  "body": {
    "pageSize": 2
  }
}
                            
                                {
  "totalResultSize": 898,
  "data": [
    {
      "id": 1,
      "created": "2018-04-11T08:02:30.690Z",
      "applicationId": 1,
      "integrationId": "5acdc0fdd2291cbeba9ca01e",
      "coupon": "",
      "referral": "",
      "state": "open",
      "cartItems": [
        {
          "name": "Prodcut 2",
          "sku": "B0006ZF55O",
          "quantity": 3,
          "price": 1500,
          "category": "productCategory2",
          "position": 0,
          "attributes": {
            "image": "8.jpeg"
          }
        }
      ],
      "discounts": {},
      "profileId": 2,
      "attributes": {}
    },
    {
      "id": 2,
      "created": "2018-04-11T08:03:42.962Z",
      "applicationId": 1,
      "integrationId": "5acdc15c9b11be5a85d9efb1",
      "coupon": "",
      "referral": "",
      "state": "open",
      "cartItems": [
        {
          "name": "Prodcut 2",
          "sku": "B0006ZF55O",
          "quantity": 3,
          "price": 1500,
          "category": "productCategory2",
          "position": 0,
          "attributes": {
            "image": "8.jpeg"
          }
        }
      ],
      "discounts": {},
      "profileId": 3,
      "attributes": {}
    }
  ]
}
                            

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.

profile string

Profile integration ID filter for sessions. Must be exact match.

state string
open,closed,cancelled

Filter by sessions with this state. Must be exact match.

coupon string

Filter by sessions with this coupon. Must be exact match.

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.

applicationIdinteger

The ID of the application that owns this entity.

profileIdinteger

The globally unique Talon.One ID of the customer that created this entity.

integrationIdstring
format: string

The ID used for this entity in the application system.

couponstring

Any coupon code entered.

referralstring

Any referral code entered.

statestring
open,closed,cancelled

Indicating if the customer session is in progress ("open"), "closed", or "cancelled".

cartItemsarray

Serialized JSON representation.

name string
minlength: 1

Serialized JSON representation.

sku string
minlength: 1

Serialized JSON representation.

quantity integer
format: 1

Serialized JSON representation.

price number

Serialized JSON representation.

category string

Serialized JSON representation.

weight number

Weight of item in mm

height number

Height of item in mm

width number

Width of item in mm

length number

Length of item in mm

position number

Position of the Cart Item in the Cart (calculated internally)

attributes object

Arbitrary properties associated with this item

adjustment array

Serialized JSON representation.

payFromLoyaltyProgram integer

Loyalty Program to be used for payment

pointPayment integer
format: 1

Amount of points to be spend

remainingPrice number

Remaining price in currency after payment in points has been made

discountsobject

A map of labelled discount values, in the same currency as the session.

totalnumber

The total sum of the session before any discounts applied.

attributesobject

Arbitrary properties associated with this item

#

Get Application Session

GET  /v1/applications/{applicationId}/sessions/{sessionId}

Example

                                {
  "url": "GET https://example.talon.one/v1/applications/1/sessions/1",
  "body": {}
}
                            
                                {
  "id": 1,
  "created": "2018-04-11T08:02:30.690Z",
  "applicationId": 1,
  "integrationId": "5acdc0fdd2291cbeba9ca01e",
  "coupon": "",
  "referral": "",
  "state": "open",
  "cartItems": [
    {
      "name": "Prodcut 2",
      "sku": "B0006ZF55O",
      "quantity": 3,
      "price": 1500,
      "category": "productCategory2",
      "position": 0,
      "attributes": {
        "image": "8.jpeg"
      }
    }
  ],
  "discounts": {},
  "profileId": 2,
  "attributes": {}
}
                            

Request Schema

URL Parameter

applicationId integer required
sessionId 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.

applicationIdinteger

The ID of the application that owns this entity.

profileIdinteger

The globally unique Talon.One ID of the customer that created this entity.

integrationIdstring
format: string

The ID used for this entity in the application system.

couponstring

Any coupon code entered.

referralstring

Any referral code entered.

statestring
open,closed,cancelled

Indicating if the customer session is in progress ("open"), "closed", or "cancelled".

cartItemsarray

Serialized JSON representation.

name string
minlength: 1

Serialized JSON representation.

sku string
minlength: 1

Serialized JSON representation.

quantity integer
format: 1

Serialized JSON representation.

price number

Serialized JSON representation.

category string

Serialized JSON representation.

weight number

Weight of item in mm

height number

Height of item in mm

width number

Width of item in mm

length number

Length of item in mm

position number

Position of the Cart Item in the Cart (calculated internally)

attributes object

Arbitrary properties associated with this item

adjustment array

Serialized JSON representation.

payFromLoyaltyProgram integer

Loyalty Program to be used for payment

pointPayment integer
format: 1

Amount of points to be spend

remainingPrice number

Remaining price in currency after payment in points has been made

discountsobject

A map of labelled discount values, in the same currency as the session.

totalnumber

The total sum of the session before any discounts applied.

attributesobject

Arbitrary properties associated with this item

#

List Applications Events

GET  /v1/applications/{applicationId}/events

Lists all events recorded for an application.

Example

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/events/no_total",
  "body": {
    "pageSize": 2
  }
}
                            
                                {
  "hasMore": true,
  "data": [
    {
      "id": 1,
      "created": "2018-04-11T08:01:55.485Z",
      "applicationId": 1,
      "type": "talon_profile_created",
      "attributes": {
        "integrationId": "5acdc0f323a6ee49db506080",
        "isNew": true,
        "params": {
          "attributes": {
            "Name": "5acdc0f323a6ee49db506080"
          }
        }
      },
      "effects": [],
      "profileId": 1
    },
    {
      "id": 2,
      "created": "2018-04-11T08:02:06.205Z",
      "applicationId": 1,
      "type": "talon_profile_created",
      "attributes": {
        "integrationId": "5acdc0fdd2291cbeba9ca01e",
        "isNew": true,
        "params": {
          "attributes": {
            "Name": "5acdc0fdd2291cbeba9ca01e"
          }
        }
      },
      "effects": [],
      "profileId": 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.

type string

Comma-separated list of types by which to filter events. Must be exact match(es).

createdBefore string
format: date-time

Only return events created before this date

createdAfter string
format: date-time

Only return events created after this date

session string

Session integration ID filter for events. Must be exact match.

profile string

Profile integration ID filter for events. Must be exact match.

customerName string
minlength: 2

Customer name filter for events. Will match substrings case-insensitively.

customerEmail string
minlength: 2

Customer e-mail address filter for events. Will match substrings case-insensitively.

effectsQuery string

Effects filter for events. Will perform a full-text search on the text content of the events effects, if any.

attributesQuery string

Attributes filter for events. Will perform a full-text search on the text content of the events attributes, both keys and values.

ruleQuery string

Rule name filter for events

campaignQuery string

Campaign name filter for events

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.

profileIdinteger

The globally unique Talon.One ID of the customer that created this entity.

sessionIdinteger

The globally unique Talon.One ID of the session that contains this event.

typestring

A string representing the event. Must not be a reserved event name.

attributesobject

Additional JSON serialized data associated with the event.

effectsarray

An array containing the effects that were applied as a result of this event.

effects array

An array containing the effects that were applied as a result of this event.

#

List Applications Events

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

Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only if there are more results.

Example

                                No example request
                            
                                No example response
                            

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.

type string

Comma-separated list of types by which to filter events. Must be exact match(es).

createdBefore string
format: date-time

Only return events created before this date

createdAfter string
format: date-time

Only return events created after this date

session string

Session integration ID filter for events. Must be exact match.

profile string

Profile integration ID filter for events. Must be exact match.

customerName string
minlength: 2

Customer name filter for events. Will match substrings case-insensitively.

customerEmail string
minlength: 2

Customer e-mail address filter for events. Will match substrings case-insensitively.

effectsQuery string

Effects filter for events. Will perform a full-text search on the text content of the events effects, if any.

attributesQuery string

Attributes filter for events. Will perform a full-text search on the text content of the events attributes, both keys and values.

ruleQuery string

Rule name filter for events

campaignQuery string

Campaign name filter for events

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.

profileIdinteger

The globally unique Talon.One ID of the customer that created this entity.

sessionIdinteger

The globally unique Talon.One ID of the session that contains this event.

typestring

A string representing the event. Must not be a reserved event name.

attributesobject

Additional JSON serialized data associated with the event.

effectsarray

An array containing the effects that were applied as a result of this event.

effects array

An array containing the effects that were applied as a result of this event.

#

List Applications Event Types

GET  /v1/applications/{applicationId}/event_types

Get all of the distinct values of the Event type property for events recorded in the application.

See also: Track an event

Example

                                {
  "url": "GET https://demo.talon.one/v1/applications/1/event_types",
  "body": {}
}
                            
                                {
  "totalResultSize": 6,
  "data": [
    "pageview",
    "talon_profile_created",
    "talon_profile_updated",
    "talon_session_closed",
    "talon_session_created",
    "talon_session_updated"
  ]
}
                            

Request Schema

URL Parameter

applicationId integer required

Get all of the distinct values of the Event type property for events recorded in the application.

See also: Track an event

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

#

Define a new custom attribute

POST  /v1/attributes

Defines a new custom attribute in this account. Custom attributes allow you to attach new fields to Talon.One domain objects like campaigns, coupons, customers and so on. These attributes can then be given values when creating / updating these objects, and these values can be used in your campaign rules. For example, you could define a zipCode field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes.

These attributes are shared across all applications in your account, and are never required.

Example

                                No example request
                            
                                No example response
                            

Request Schema

Body Parameter

entity string required
Account,Application,Campaign,CustomerProfile,CustomerSession,CartItem,Coupon,Event

The name of the entity that can have this attribute. When creating or updating the entities of a given type, you can include an attributes object with keys corresponding to the name of the custom attributes for that type.

eventType string

Defines a new custom attribute in this account. Custom attributes allow you to attach new fields to Talon.One domain objects like campaigns, coupons, customers and so on. These attributes can then be given values when creating / updating these objects, and these values can be used in your campaign rules. For example, you could define a zipCode field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes.

These attributes are shared across all applications in your account, and are never required.

name string required

The attribute name that will be used in API requests and Talang. E.g. if name == "region" then you would set the region attribute by including an attributes.region property in your request payload.

title string required

The human-readable name for the attribute that will be shown in the Campaign Manager. Like name, the combination of entity and title must also be unique.

type string required
string,number,boolean,time,(list string),(list number),(list time),location,(list location)

The data type of the attribute, a time attribute must be sent as a string that conforms to the RFC3339 timestamp format.

description string required

A description of this attribute.