8th May 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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

modified
string format: date-time

The exact moment this entity was last modified.

accountId
integer

The ID of the account that owns this entity.

name
string minlength: 1

The name of this application.

description
string optional

A longer description of the application.

key
string minlength: 16

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

timezone
string minlength: 1

A string containing an IANA timezone descriptor.

currency
string minlength: 1

A string describing a default currency for new customer sessions.

caseSensitivity
string optional sensitive,insensitive-uppercase,insensitive-lowercase

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

loyaltyPrograms
array

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

id
integer required

The ID of loyalty program.

accountID
integer required

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

name
string required

The internal name for the Loyalty Program.

title
string required

The display title for the Loyalty Program.

description
string required

Description of our Loyalty Program.

subscribedApplications
array required

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

subscribedApplications
integer required

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

defaultValidity
string required

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

#

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-04-23T13:46:49.388Z",
  "modified": "2019-04-23T13:46:49.388Z",
  "accountId": 1,
  "name": "Braze-Test",
  "key": "92d3fd1f20c644cb",
  "timezone": "Europe/Berlin",
  "currency": "EUR",
  "description": "",
  "caseSensitivity": "sensitive"
}
                  

Request Schema

URL Parameter

applicationId
integer required

Get the application specified by the ID.

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

modified
string format: date-time

The exact moment this entity was last modified.

accountId
integer

The ID of the account that owns this entity.

name
string minlength: 1

The name of this application.

description
string optional

A longer description of the application.

key
string minlength: 16

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

timezone
string minlength: 1

A string containing an IANA timezone descriptor.

currency
string minlength: 1

A string describing a default currency for new customer sessions.

caseSensitivity
string optional sensitive,insensitive-uppercase,insensitive-lowercase

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

loyaltyPrograms
array

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

id
integer required

The ID of loyalty program.

accountID
integer required

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

name
string required

The internal name for the Loyalty Program.

title
string required

The display title for the Loyalty Program.

description
string required

Description of our Loyalty Program.

subscribedApplications
array required

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

subscribedApplications
integer required

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

defaultValidity
string required

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

#

Create a Campaign

POST  /v1/applications/{applicationId}/campaigns

Example

                    {
  "url": "POST https://example.talon.one/v1/applications/1/campaigns",
  "body": {
    "body": {
      "name": "My new campaign",
      "description": "my campaign description",
      "state": "disabled",
      "tags": [
        "campaign"
      ],
      "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": 19,
  "created": "2018-11-15T11:03:09.753Z",
  "applicationId": 1,
  "userId": 1,
  "name": "My new campaign",
  "description": "my campaign description",
  "state": "disabled",
  "tags": [
    "campaign"
  ],
  "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": {},
  "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
}
                  

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 required minlength: 1

A list of tags for the campaign.

features
array required

A list of features for the campaign.

features
string required

A list of features for the campaign.

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

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.

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

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.

limits
array required

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

userId
integer

The ID of the account that owns this entity.

name
string minlength: 1

A friendly name for this campaign.

description
string

A detailed description of the campaign.

startTime
string optional format: date-time

Datetime when the campaign will become active.

endTime
string optional format: date-time

Datetime when the campaign will become in-active.

attributes
object optional

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 optional

ID of Ruleset this campaign applies on customer session evaluation.

tags
array

A list of tags for the campaign.

tags
string minlength: 1

A list of tags for the campaign.

features
array

A list of features for the campaign.

features
string

A list of features for the campaign.

couponSettings
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

entities
string required

The entities that make the address of this limit

couponRedemptionCount
integer optional

Number of coupons redeemed in the campaign.

referralRedemptionCount
integer optional

Number of referral codes redeemed in the campaign.

discountCount
integer optional

Total amount of discounts redeemed in the campaign.

lastActivity
string optional format: date-time

Timestamp of the most recent event received by this campaign.

updated
string optional format: date-time

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

createdBy
string optional

Name of the user who created this campaign if available.

updatedBy
string optional

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.

integer

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.

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

userId
integer

The ID of the account that owns this entity.

name
string minlength: 1

A friendly name for this campaign.

description
string

A detailed description of the campaign.

startTime
string optional format: date-time

Datetime when the campaign will become active.

endTime
string optional format: date-time

Datetime when the campaign will become in-active.

attributes
object optional

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 optional

ID of Ruleset this campaign applies on customer session evaluation.

tags
array

A list of tags for the campaign.

tags
string minlength: 1

A list of tags for the campaign.

features
array

A list of features for the campaign.

features
string

A list of features for the campaign.

couponSettings
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

entities
string required

The entities that make the address of this limit

couponRedemptionCount
integer optional

Number of coupons redeemed in the campaign.

referralRedemptionCount
integer optional

Number of referral codes redeemed in the campaign.

discountCount
integer optional

Total amount of discounts redeemed in the campaign.

lastActivity
string optional format: date-time

Timestamp of the most recent event received by this campaign.

updated
string optional format: date-time

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

createdBy
string optional

Name of the user who created this campaign if available.

updatedBy
string optional

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 required

Indicates the node type

name
string required

Name of the set

operator
string required

How does the set operates on its elements

elements
array required

Child elements of this set

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

set
type
string required

Indicates the node type

name
string required

Name of the set

operator
string required

How does the set operates on its elements

elements
array required

Child elements of this set

type
string required

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

set
type
string required

Indicates the node type

name
string required

Name of the set

operator
string required

How does the set operates on its elements

elements
array required

Child elements of this set

type
string required

Child elements of this set

#

Get a Campaign

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

Example

                    {
  "url": "GET https://demo.talon.one/v1/applications/1/campaigns/1",
  "body": {}
}
                  
                    {
  "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
campaignId
integer required

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

userId
integer

The ID of the account that owns this entity.

name
string minlength: 1

A friendly name for this campaign.

description
string

A detailed description of the campaign.

startTime
string optional format: date-time

Datetime when the campaign will become active.

endTime
string optional format: date-time

Datetime when the campaign will become in-active.

attributes
object optional

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 optional

ID of Ruleset this campaign applies on customer session evaluation.

tags
array

A list of tags for the campaign.

tags
string minlength: 1

A list of tags for the campaign.

features
array

A list of features for the campaign.

features
string

A list of features for the campaign.

couponSettings
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

entities
string required

The entities that make the address of this limit

couponRedemptionCount
integer optional

Number of coupons redeemed in the campaign.

referralRedemptionCount
integer optional

Number of referral codes redeemed in the campaign.

discountCount
integer optional

Total amount of discounts redeemed in the campaign.

lastActivity
string optional format: date-time

Timestamp of the most recent event received by this campaign.

updated
string optional format: date-time

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

createdBy
string optional

Name of the user who created this campaign if available.

updatedBy
string optional

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 required minlength: 1

A list of tags for the campaign.

features
array required

A list of features for the campaign.

features
string required

A list of features for the campaign.

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

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.

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

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.

limits
array required

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

userId
integer

The ID of the account that owns this entity.

name
string minlength: 1

A friendly name for this campaign.

description
string

A detailed description of the campaign.

startTime
string optional format: date-time

Datetime when the campaign will become active.

endTime
string optional format: date-time

Datetime when the campaign will become in-active.

attributes
object optional

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 optional

ID of Ruleset this campaign applies on customer session evaluation.

tags
array

A list of tags for the campaign.

tags
string minlength: 1

A list of tags for the campaign.

features
array

A list of features for the campaign.

features
string

A list of features for the campaign.

couponSettings
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

entities
string required

The entities that make the address of this limit

couponRedemptionCount
integer optional

Number of coupons redeemed in the campaign.

referralRedemptionCount
integer optional

Number of referral codes redeemed in the campaign.

discountCount
integer optional

Total amount of discounts redeemed in the campaign.

lastActivity
string optional format: date-time

Timestamp of the most recent event received by this campaign.

updated
string optional format: date-time

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

createdBy
string optional

Name of the user who created this campaign if available.

updatedBy
string optional

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 required

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

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

userId
integer

The ID of the account that owns this entity.

name
string minlength: 1

A friendly name for this campaign.

description
string

A detailed description of the campaign.

startTime
string optional format: date-time

Datetime when the campaign will become active.

endTime
string optional format: date-time

Datetime when the campaign will become in-active.

attributes
object optional

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 optional

ID of Ruleset this campaign applies on customer session evaluation.

tags
array

A list of tags for the campaign.

tags
string minlength: 1

A list of tags for the campaign.

features
array

A list of features for the campaign.

features
string

A list of features for the campaign.

couponSettings
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

entities
string required

The entities that make the address of this limit

couponRedemptionCount
integer optional

Number of coupons redeemed in the campaign.

referralRedemptionCount
integer optional

Number of referral codes redeemed in the campaign.

discountCount
integer optional

Total amount of discounts redeemed in the campaign.

lastActivity
string optional format: date-time

Timestamp of the most recent event received by this campaign.

updated
string optional format: date-time

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

createdBy
string optional

Name of the user who created this campaign if available.

updatedBy
string optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

userId
integer

The ID of the account that owns this entity.

name
string minlength: 1

A friendly name for this campaign.

description
string

A detailed description of the campaign.

startTime
string optional format: date-time

Datetime when the campaign will become active.

endTime
string optional format: date-time

Datetime when the campaign will become in-active.

attributes
object optional

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 optional

ID of Ruleset this campaign applies on customer session evaluation.

tags
array

A list of tags for the campaign.

tags
string minlength: 1

A list of tags for the campaign.

features
array

A list of features for the campaign.

features
string

A list of features for the campaign.

couponSettings
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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
optional
validCharacters
array required optional

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

validCharacters
string required optional

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 optional 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

The set of limits that will operate for this campaign

action
string required

The limitable action to which this limit will be applied

limit
number required

The value to set for the limit

entities
array required

The entities that make the address of this limit

entities
string required

The entities that make the address of this limit

couponRedemptionCount
integer optional

Number of coupons redeemed in the campaign.

referralRedemptionCount
integer optional

Number of referral codes redeemed in the campaign.

discountCount
integer optional

Total amount of discounts redeemed in the campaign.

lastActivity
string optional format: date-time

Timestamp of the most recent event received by this campaign.

updated
string optional format: date-time

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

createdBy
string optional

Name of the user who created this campaign if available.

updatedBy
string optional

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/1/campaigns/2/rulesets",
  "body": {
    "body": {
      "rules": [
        {
          "title": "Adjustable Base and a Mattress for 20% Off Rule",
          "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"
                        ]
                      ]
                    ]
                  ]
                ]
              ]
            }
          ],
          "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"
                    ]
                  ]
                ]
              ]
            ]
          ]
        }
      ],
      "rbVersion": "v2"
    }
  }
}
                  
                    {
  "id": 3,
  "created": "2018-11-28T12:14:19.224Z",
  "campaignId": 2,
  "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": "v2"
}
                  

Request Schema

URL Parameter

applicationId
integer required
campaignId
integer required

Body Parameter

rules
array required

Set of rules to apply.

title
string required

A short description of the rule.

description
string required

A longer, more detailed description of the rule.

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.

condition
array required

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

effects
array required

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

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

userId
integer

The ID of the account that owns this entity.

rules
array

Set of rules to apply.

title
string required

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 required

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

effects
array required

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

effects
array required

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

rbVersion
string optional

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

activate
boolean optional

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

activatedAt
string optional 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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

userId
integer

The ID of the account that owns this entity.

rules
array

Set of rules to apply.

title
string required

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 required

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

effects
array required

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

effects
array required

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

rbVersion
string optional

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

activate
boolean optional

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

activatedAt
string optional 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 required

A short description of the rule.

description
string required

A longer, more detailed description of the rule.

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.

condition
array required

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

effects
array required

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

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

userId
integer

The ID of the account that owns this entity.

rules
array

Set of rules to apply.

title
string required

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 required

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

effects
array required

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

effects
array required

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

rbVersion
string optional

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

activate
boolean optional

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

activatedAt
string optional 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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

userId
integer

The ID of the account that owns this entity.

rules
array

Set of rules to apply.

title
string required

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 required

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

effects
array required

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

effects
array required

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

rbVersion
string optional

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

activate
boolean optional

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

activatedAt
string optional 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 coupns can be created.

Example

                    {
  "url": "POST https://demo.talon.one/v1/applications/1/campaigns/1/coupons",
  "body": {
    "body": {
      "usageLimit": 1,
      "validCharacters": [
        "A",
        "B",
        "C"
      ],
      "couponPattern": "test_####",
      "numberOfCoupons": 1
    }
  }
}
                  
                    {
  "totalResultSize": -1,
  "data": [
    {
      "id": 4,
      "created": "2019-04-23T14:12:42.047Z",
      "campaignId": 1,
      "value": "test_ACCB",
      "usageLimit": 0,
      "usageCounter": 0,
      "attributes": {},
      "batchId": "yupavika"
    }
  ]
}
                  

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 coupns 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 required

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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/1/campaigns/1/coupons_search",
  "body": {
    "body": {
      "valid": "validNow",
      "recipientIntegrationId": "123",
      "attributes": {}
    }
  }
}
                  
                    {
  "totalResultSize": 3,
  "data": [
    {
      "id": 1,
      "created": "2018-12-05T08:31:44.036Z",
      "campaignId": 1,
      "value": "123",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {
        "couponattr": "123"
      },
      "batchId": "jufivecu"
    },
    {
      "id": 2,
      "created": "2018-12-05T08:40:53.657Z",
      "campaignId": 1,
      "value": "32343",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "recipientIntegrationId": "123",
      "batchId": "femuteqe"
    },
    {
      "id": 3,
      "created": "2018-12-05T08:42:14.291Z",
      "campaignId": 1,
      "value": "121313",
      "usageLimit": 1,
      "usageCounter": 0,
      "attributes": {},
      "recipientIntegrationId": "123",
      "batchId": "jipigaqu"
    }
  ]
}
                  

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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/9/coupons_search",
  "body": {
    "body": {
      "valid": "validNow",
      "usable": "true",
      "attributes": {}
    }
  }
}
                  
                    {
  "totalResultSize": 4,
  "data": [
    {
      "id": 29008,
      "created": "2018-11-20T14:51:28.658Z",
      "campaignId": 208,
      "value": "HBSUPER10",
      "usageLimit": 0,
      "usageCounter": 10543,
      "expiryDate": "2019-02-07T16:30:00.000Z",
      "attributes": {
        "appName": "pay",
        "cityID": 0,
        "description": "10% of the transaction value or Rs.100 Cashback which ever is lower",
        "hasuraID": "0",
        "listingOrder": 2,
        "longDescription": "Valid for HipBar Pay users only. 10% of the transaction value or Max. amt. - Rs.100 which ever is lower.  Subject to HipBar's T&C that can be changed/modified anytime without prior notice. Can be used only once a day for single transaction. Can be used only once every 7 days. Valid on transactions through \"search drinks\" options only.  Can be used in retail stores affiliated with HipBar. ",
        "orderType": "pay",
        "shortDescription": "10% CB promo code applied"
      },
      "batchId": "voxebuqe"
    },
    {
      "id": 29009,
      "created": "2018-11-20T14:55:57.699Z",
      "campaignId": 225,
      "value": "FIRST20",
      "usageLimit": 0,
      "usageCounter": 0,
      "expiryDate": "2019-02-07T16:30:00.000Z",
      "attributes": {
        "appName": "pay",
        "cityID": 0,
        "description": "20% CB for first time users",
        "hasuraID": "0",
        "listingOrder": 3,
        "longDescription": "Valid for HipBar Pay users only who are above the legal drinking age. Valid for first transaction only. Max. amt. - Rs.100.  Subject to HipBar's T&C that can be changed/modified anytime without prior notice. Valid on transactions through \"search drinks\" option only.  Can be used in retail stores affiliated with HipBar. Offer valid till 31st December 2018",
        "orderType": "pay",
        "shortDescription": "CB promo code applied"
      },
      "batchId": "gadigucu"
    },
    {
      "id": 29020,
      "created": "2018-12-10T11:37:15.358Z",
      "campaignId": 234,
      "value": "HBSUPER5",
      "usageLimit": 0,
      "usageCounter": 3664,
      "expiryDate": "2019-02-07T16:30:00.000Z",
      "attributes": {
        "appName": "pay",
        "cityID": 5,
        "description": "5% of the transaction value or Rs.100 Cashback which ever is lower.",
        "hasuraID": "0",
        "listingOrder": 1,
        "longDescription": "Valid for HipBar Pay users only. 5% of the transaction value or Max. amt. - Rs.100 which ever is lower.  Subject to HipBar's T&C that can be changed/modified anytime without prior notice. Can be used only once a day for single transaction. Valid on transactions through \"search drinks\" options only.  Can be used in retail stores affiliated with HipBar. You can use only one HipBar promo code per day.",
        "orderType": "pay",
        "shortDescription": "5% CB promo code applied"
      },
      "batchId": "hogabida"
    },
    {
      "id": 29039,
      "created": "2019-02-07T16:04:27.420Z",
      "campaignId": 252,
      "value": "HBSWEET15",
      "usageLimit": 0,
      "usageCounter": 1112,
      "startDate": "2019-02-08T03:30:00.000Z",
      "expiryDate": "2019-03-10T16:30:00.000Z",
      "attributes": {
        "appName": "pay",
        "cityID": 5,
        "description": "15% CB (Max. Rs. 100) on All Days",
        "hasuraID": "0",
        "listingOrder": 1,
        "longDescription": "Valid for HipBar Pay users only. Valid from MON-SUN only for single use per day. Max. cashback amt. - Rs.100. Not valid on multiple transactions. Subject to HipBar's T&C that can be changed/modified anytime without prior notice. Can be used only in retail stores affiliated with HipBar.",
        "orderType": "pay",
        "shortDescription": "15% CB promo code applied"
      },
      "batchId": "xujojizu"
    }
  ]
}
                  

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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

                    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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

The ID of the campaign that owns this entity.

value
string minlength: 4

The actual coupon code.

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 optional format: date-time

Timestamp at which point the coupon becomes valid.

expiryDate
string optional format: date-time

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

usageCounter
integer

The number of times this coupon has been successfully used.

attributes
object optional

Arbitrary properties associated with this item

referralId
integer optional

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

recipientIntegrationId
string optional

The integration ID of a referred customer profile.

importId
integer optional

The ID of the Import which created this coupon.

batchId
string optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

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

advocateProfileIntegrationId
string

The Integration Id of the Advocate's Profile

friendProfileIntegrationId
string optional

An optional Integration ID of the Friend's Profile

startDate
string optional format: date-time

Timestamp at which point the referral code becomes valid.

expiryDate
string optional format: date-time

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

code
string minlength: 4

The actual referral code.

usageCounter
integer

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

usageLimit
integer

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

campaignId
integer

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

advocateProfileIntegrationId
string

The Integration Id of the Advocate's Profile

friendProfileIntegrationId
string optional

An optional Integration ID of the Friend's Profile

startDate
string optional format: date-time

Timestamp at which point the referral code becomes valid.

expiryDate
string optional format: date-time

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

code
string minlength: 4

The actual referral code.

usageCounter
integer

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

usageLimit
integer

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

id
integer required

The ID of loyalty program.

accountID
integer required

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

name
string required

The internal name for the Loyalty Program.

title
string required

The display title for the Loyalty Program.

description
string required

Description of our Loyalty Program.

subscribedApplications
array required

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

subscribedApplications
integer required

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

subscribedApplications
integer required

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

defaultValidity
string required

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

#

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

id
integer required

The ID of loyalty program.

accountID
integer required

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

name
string required

The internal name for the Loyalty Program.

title
string required

The display title for the Loyalty Program.

description
string required

Description of our Loyalty Program.

subscribedApplications
array required

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

subscribedApplications
integer required

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

subscribedApplications
integer required

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

defaultValidity
string required

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

#

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

total
number

The current balance in the program.

transactions
array
created
string required format: date-time
programID
integer required
customerProfileID
string required
customerSessionID
string
eventID
integer
type
string required
amount
number required
expiryDate
string format: date-time
name
string required

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

loyaltyProgramId
integer optional

The ID of the loyalty program this ledger belongs to.

loyaltyProgramName
string optional

The name of the loyalty program this ledger belongs to.

#

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

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

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

method
string get,put,post,delete,patch

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

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.

integer

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

uuid
string

UUID reference of request

status
integer

HTTP status code of response

method
string

HTTP method of request

requestUri
string

target URI of request

time
string format: date-time

timestamp of request

requestPayload
string

payload of request

responsePayload
string

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

method
string get,put,post,delete,patch

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

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.

integer

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

uuid
string

UUID reference of request

status
integer

HTTP status code of response

method
string

HTTP method of request

requestUri
string

target URI of request

time
string format: date-time

timestamp of request

requestPayload
string

payload of request

responsePayload
string

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

method
string get,put,post,delete,patch

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

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.

integer

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

uuid
string

UUID reference of request

status
integer

HTTP status code of response

method
string

HTTP method of request

requestUri
string

target URI of request

time
string format: date-time

timestamp of request

requestPayload
string

payload of request

responsePayload
string

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

The identifier for the application

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

date
string format: date-time
campaignRevenue
number

Amount of revenue in this campaign.

totalCampaignRevenue
number

Amount of revenue in this campaign since it began.

campaignDiscountCosts
number

Amount of cost caused by discounts given in the campaign.

totalCampaignDiscountCosts
number

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

campaignFreeItems
integer

Amount of free items given in the campaign.

totalCampaignFreeItems
integer

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

couponRedemptions
integer

Number of coupon redemptions in the campaign (only accepted referrals on sessions that were closed are considered).

totalCouponRedemptions
integer

Number of coupon redemptions in the campaign since it began.

referralRedemptions
integer

Number of referral redemptions in the campaign.

totalReferralRedemptions
integer

Number of referral redemptions in the campaign since it began.

couponsCreated
integer

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

totalCouponsCreated
integer

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

referralsCreated
integer

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

totalReferralsCreated
integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

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

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributes
object required

Arbitrary properties associated with this item

accountId
integer

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

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

closedSessions
integer required

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

totalSales
number required

Sum of all purchases made by this customer

loyaltyMemberships
array required

A list of loyalty programs joined by the customer

joined
string required format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId
integer required

The ID of the loyalty program belonging to this entity.

lastActivity
string required 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 cusomer 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.

integer

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 cusomer 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 cusomer 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 cusomer 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 cusomer 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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

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

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributes
object required

Arbitrary properties associated with this item

accountId
integer

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

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

closedSessions
integer required

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

totalSales
number required

Sum of all purchases made by this customer

loyaltyMemberships
array required

A list of loyalty programs joined by the customer

joined
string required format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId
integer required

The ID of the loyalty program belonging to this entity.

lastActivity
string required 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 cusomer 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 cusomer 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 cusomer 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 cusomer 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 cusomer 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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

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

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributes
object required

Arbitrary properties associated with this item

accountId
integer

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

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

closedSessions
integer required

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

totalSales
number required

Sum of all purchases made by this customer

loyaltyMemberships
array required

A list of loyalty programs joined by the customer

joined
string required format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId
integer required

The ID of the loyalty program belonging to this entity.

lastActivity
string required 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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

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

The ID used for this entity in the application system.

The ID used for this entity in the application system.
attributes
object required

Arbitrary properties associated with this item

accountId
integer

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

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

closedSessions
integer required

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

totalSales
number required

Sum of all purchases made by this customer

loyaltyMemberships
array required

A list of loyalty programs joined by the customer

joined
string required format: date-time

The moment in which the loyalty program was joined.

loyaltyProgramId
integer required

The ID of the loyalty program belonging to this entity.

lastActivity
string required 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.

integer

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

integrationId
string format: string

The ID used for this entity in the application system.

created
string format: date-time

The exact moment this entity was created.

name
string

The name for this customer profile.

customerId
integer

The internal Talon.One ID of the customer.

lastActivity
string optional format: date-time

The last activity of the customer.

couponRedemptions
integer

Number of coupon redemptions in all customer campaigns.

couponUseAttempts
integer

Number of coupon use attempts in all customer campaigns.

couponFailedAttempts
integer

Number of failed coupon use attempts in all customer campaigns.

accruedDiscounts
number

Number of accrued discounts in all customer campaigns.

accruedRevenue
number

Amount of accrued revenue in all customer campaigns.

totalOrders
integer

Number of orders in all customer campaigns.

totalOrdersNoCoupon
integer

Number of orders without coupon used in all customer campaigns.

campaignName
string

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.

integer

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

integrationId
string format: string

The ID used for this entity in the application system.

created
string format: date-time

The exact moment this entity was created.

name
string

The name for this customer profile.

customerId
integer

The internal Talon.One ID of the customer.

lastActivity
string optional format: date-time

The last activity of the customer.

couponRedemptions
integer

Number of coupon redemptions in all customer campaigns.

couponUseAttempts
integer

Number of coupon use attempts in all customer campaigns.

couponFailedAttempts
integer

Number of failed coupon use attempts in all customer campaigns.

accruedDiscounts
number

Number of accrued discounts in all customer campaigns.

accruedRevenue
number

Amount of accrued revenue in all customer campaigns.

totalOrders
integer

Number of orders in all customer campaigns.

totalOrdersNoCoupon
integer

Number of orders without coupon used in all customer campaigns.

campaignName
string

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.

integer

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

integrationId
string format: string

The ID used for this entity in the application system.

created
string format: date-time

The exact moment this entity was created.

name
string

The name for this customer profile.

customerId
integer

The internal Talon.One ID of the customer.

lastActivity
string optional format: date-time

The last activity of the customer.

couponRedemptions
integer

Number of coupon redemptions in all customer campaigns.

couponUseAttempts
integer

Number of coupon use attempts in all customer campaigns.

couponFailedAttempts
integer

Number of failed coupon use attempts in all customer campaigns.

accruedDiscounts
number

Number of accrued discounts in all customer campaigns.

accruedRevenue
number

Amount of accrued revenue in all customer campaigns.

totalOrders
integer

Number of orders in all customer campaigns.

totalOrdersNoCoupon
integer

Number of orders without coupon used in all customer campaigns.

campaignName
string

The name of the campaign this customer belongs to.

#

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.

integer

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.

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created. The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

profileId
integer optional

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

integrationId
string format: string

The ID used for this entity in the application system.

coupon
string

Any coupon code entered.

referral
string

Any referal code entered.

state
string open,closed,cancelled

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

cartItems
array

Serialized JSON representation.

name
string required minlength: 1

Serialized JSON representation.

sku
string required minlength: 1

Serialized JSON representation.

quantity
integer required format: 1

Serialized JSON representation.

price
number required

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 required

Loyalty Program to be used for payment

pointPayment
integer required format: 1

Amount of points to be spend

remainingPrice
number

Remaining price in currency after payment in points has been made

discounts
object

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

attributes
object optional

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created. The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

profileId
integer optional

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

integrationId
string format: string

The ID used for this entity in the application system.

coupon
string

Any coupon code entered.

referral
string

Any referal code entered.

state
string open,closed,cancelled

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

cartItems
array

Serialized JSON representation.

name
string required minlength: 1

Serialized JSON representation.

sku
string required minlength: 1

Serialized JSON representation.

quantity
integer required format: 1

Serialized JSON representation.

price
number required

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 required

Loyalty Program to be used for payment

pointPayment
integer required format: 1

Amount of points to be spend

remainingPrice
number

Remaining price in currency after payment in points has been made

discounts
object

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

attributes
object optional

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

profileId
integer optional

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

sessionId
integer optional

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

type
string

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

attributes
object

Additional JSON serialized data associated with the event.

effects
array

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

applicationId
integer

The ID of the application that owns this entity.

profileId
integer optional

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

sessionId
integer optional

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

type
string

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

attributes
object

Additional JSON serialized data associated with the event.

effects
array

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.

integer

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

#

Get a custom attribute

GET  /v1/attributes/{attributeId}

Returns custom attribute for the account by its id.

Example

                    {
  "url": "GET https://demo.talon.one/v1/attributes/54",
  "body": {}
}
                  
                    {
  "id": 54,
  "created": "2018-04-25T13:38:55.504Z",
  "modified": "2001-01-01T00:00:00.000Z",
  "accountId": 1,
  "entity": "CustomerProfile",
  "name": "store_referral",
  "title": "store_referral",
  "type": "string",
  "description": "store_referral",
  "tags": [],
  "suggestions": [],
  "editable": true,
  "locked": false,
  "usedAt": [],
  "eventType": ""
}
                  

Request Schema

URL Parameter

attributeId
integer required

Returns custom attribute for the account by its id.

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

accountId
integer

The ID of the account that owns this entity.

entity
string 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 optional
name
string

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

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 string,number,boolean,time,(list string),(list number),(list time)

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

description
string

A description of this attribute.

tags
array

A list of tags for the attribute.

tags
string minlength: 1

A list of tags for the attribute.

suggestions
array

A list of suggestions for the attribute.

suggestions
string minlength: 1

A list of suggestions for the attribute.

editable
boolean

Whether or not this attribute can be edited.

locked
boolean

Indicates whether this attribute is in use. If in use only title can be changed and other operations are prohibited.

usedAt
array

array of rulesets where the attribute is used

usedAt
string

array of rulesets where the attribute is used

#

List Webhooks

GET  /v1/webhooks

Example

                    {
  "url": "GET https://demo.talon.one/v1/webhooks",
  "body": {}
}
                  
                    {
  "totalResultSize": 1,
  "data": [
    {
      "id": 1,
      "created": "2018-04-12T10:18:39.448Z",
      "modified": "2001-01-01T00:00:00.000Z",
      "applicationIds": [
        1
      ],
      "title": "Send Email",
      "verb": "POST",
      "url": "https://995e71b7c7b5cb3649f901dcdedf48e3:9ef81d6d0192fbe7793a22a5e577373c@api.mailjet.com/v3.1/send",
      "headers": [
        "Content-Type: application/json"
      ],
      "params": [
        {
          "type": "string",
          "description": "",
          "title": "FromEmail",
          "ui": {}
        },
        {
          "type": "string",
          "description": "",
          "title": "FromName",
          "ui": {}
        },
        {
          "type": "string",
          "description": "",
          "title": "Subject",
          "ui": {}
        },
        {
          "type": "string",
          "description": "",
          "title": "Recipients",
          "ui": {}
        }
      ],
      "enabled": true,
      "usedAt": [
        "/v1/applications/25/campaigns/17/rulesets/111#/rules/0/effects/0",
        "/v1/applications/1/campaigns/10/rulesets/97#/rules/0/effects/1"
      ],
      "payload": "{\"Messages\":[\n    {\n    \"From\": {\n            \"Email\": \"moeckel@talon.one\",\n            \"Name\": \"Me\"\n    },\n    \"To\": [\n            {\n                    \"Email\": \"${$Recipients}\",\n                    \"Name\":  \"${$FromName}\"\n            }\n    ],\n    \"Subject\": \"${$Subject}\",\n    \"TextPart\": \"\"\n    }\n]}"
    }
  ]
}
                  

Request Schema

Query Parameter

applicationIds
string

Filter by one or more application ids separated by comma

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.

pageSize
integer

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

integer

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

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

modified
string format: date-time

The exact moment this entity was last modified.

applicationIds
array

The IDs of the applications that are related to this entity. The IDs of the applications that are related to this entity.

applicationIds
integer
title
string

Friendly title for this webhook

verb
string POST,PUT,GET,DELETE,PATCH

API method for this webhook

url
string

API url (supports templating using parameters) for this webhook

headers
array

List of API HTTP headers for this webhook

headers
string

List of API HTTP headers for this webhook

payload
string optional

API payload (supports templating using parameters) for this webhook

params
array

Array of template argument definitions

type
string required minlength: 1

The type of value this argument expects.

description
string required

A campaigner-friendly description of the argument, this will also be shown in the rule editor.

title
string required minlength: 1

A campaigner friendly name for the argument, this will be shown in the rule editor.

ui
object required

Arbitrary metadata that may be used to render an input for this argument.

enabled
boolean

Enables or disables webhook from showing in rule builder

usedAt
array

array of rulesets where webhook is used

usedAt
string

array of rulesets where webhook is used

#

Get Webhook

GET  /v1/webhooks/{webhookId}

Returns an webhook by its id.

Example

                    {
  "url": "GET https://demo.talon.one/v1/webhooks/1",
  "body": {}
}
                  
                    {
  "id": 1,
  "created": "2018-04-12T10:18:39.448Z",
  "modified": "2001-01-01T00:00:00.000Z",
  "applicationIds": [
    1
  ],
  "title": "Send Email",
  "verb": "POST",
  "url": "https://995e71b7c7b5cb3649f901dcdedf48e3:9ef81d6d0192fbe7793a22a5e577373c@api.mailjet.com/v3.1/send",
  "headers": [
    "Content-Type: application/json"
  ],
  "params": [
    {
      "type": "string",
      "description": "",
      "title": "FromEmail",
      "ui": {}
    },
    {
      "type": "string",
      "description": "",
      "title": "FromName",
      "ui": {}
    },
    {
      "type": "string",
      "description": "",
      "title": "Subject",
      "ui": {}
    },
    {
      "type": "string",
      "description": "",
      "title": "Recipients",
      "ui": {}
    }
  ],
  "enabled": true,
  "usedAt": [
    "/v1/applications/25/campaigns/17/rulesets/111#/rules/0/effects/0",
    "/v1/applications/1/campaigns/10/rulesets/97#/rules/0/effects/1"
  ],
  "payload": "{\"Messages\":[\n    {\n    \"From\": {\n            \"Email\": \"moeckel@talon.one\",\n            \"Name\": \"Me\"\n    },\n    \"To\": [\n            {\n                    \"Email\": \"${$Recipients}\",\n                    \"Name\":  \"${$FromName}\"\n            }\n    ],\n    \"Subject\": \"${$Subject}\",\n    \"TextPart\": \"\"\n    }\n]}"
}
                  

Request Schema

URL Parameter

webhookId
integer required

Returns an webhook by its id.

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

modified
string format: date-time

The exact moment this entity was last modified.

applicationIds
array

The IDs of the applications that are related to this entity. The IDs of the applications that are related to this entity.

applicationIds
integer
title
string

Friendly title for this webhook

verb
string POST,PUT,GET,DELETE,PATCH

API method for this webhook

url
string

API url (supports templating using parameters) for this webhook

headers
array

List of API HTTP headers for this webhook

headers
string

List of API HTTP headers for this webhook

payload
string optional

API payload (supports templating using parameters) for this webhook

params
array

Array of template argument definitions

type
string required minlength: 1

The type of value this argument expects.

description
string required

A campaigner-friendly description of the argument, this will also be shown in the rule editor.

title
string required minlength: 1

A campaigner friendly name for the argument, this will be shown in the rule editor.

ui
object required

Arbitrary metadata that may be used to render an input for this argument.

enabled
boolean

Enables or disables webhook from showing in rule builder

usedAt
array

array of rulesets where webhook is used

usedAt
string

array of rulesets where webhook is used

#

List Webhook activation Log Entries

GET  /v1/webhook_activation_logs

Webhook activation log entries would be created as soon as an integration request triggered an effect with a webhook

Example

                    {
  "url": "GET https://example.talon.one/v1/webhook_activation_logs",
  "body": {}
}
                  
                    {
  "totalResultSize": 0,
  "data": []
}
                  

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.

integer

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.

integrationRequestUuid
string

Filter results by integration request UUID.

webhookId
number

Filter results by Webhook.

applicationId
number

Webhook activation log entries would be created as soon as an integration request triggered an effect with a webhook

campaignId
number

Filter results by campaign.

createdBefore
string format: date-time

Only return events created before this date.

createdAfter
string format: date-time

Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string.

Response Schema

integrationRequestUuid
string

UUID reference of the integration request that triggered the effect with the webhook

webhookId
integer

ID of the webhook that triggered the request

applicationId
integer

ID of the application that triggered the webhook

campaignId
integer

ID of the campaign that triggered the webhook

created
string format: date-time

Timestamp of request

#

List Webhook Log Entries

GET  /v1/webhook_logs

Example

                    {
  "url": "GET https://example.talon.one/v1/webhook_logs",
  "body": {}
}
                  
                    {
  "totalResultSize": 0,
  "data": []
}
                  

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.

integer

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.

status
string success,error

Filter results by HTTP status codes.

webhookId
number

Filter results by Webhook.

applicationId
number
campaignId
number

Filter results by campaign.

requestUuid
string

Filter results by request UUID.

createdBefore
string format: date-time

Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string.

createdAfter
string format: date-time

Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string.

Response Schema

id
string

UUID reference of the webhook request

integrationRequestUuid
string

UUID reference of the integration request linked to this webhook request

webhookId
integer

ID of the webhook that triggered the request

applicationId
integer optional

ID of the application that triggered the webhook

url
string

Target url of request

request
string

Request message

response
string optional

Response message

status
integer optional

HTTP status code of response

requestTime
string format: date-time

Timestamp of request

responseTime
string optional format: date-time

Timestamp of response

#

Import coupons via CSV file.

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

Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data.

Example

                    No example request
                  
                    No example response
                  

Request Schema

URL Parameter

applicationId
integer required

The identifier for the application

campaignId
integer required

Body Parameter

upfile
file

The file with the information about the coupons that should be imported.

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

accountId
integer

The ID of the account that owns this entity.

userId
integer

The ID of the account that owns this entity.

entity
string Coupon,Effect,CustomerSession

The name of the entity that was exported.

filter
object

Map of keys and values that were used to filter the exported rows

#

Export Coupons to a CSV file.

GET  /v1/applications/{applicationId}/export_coupons

Download a file with the coupons that match the given attributes.

Example

                    No example request
                  
                    No example response
                  

Request Schema

URL Parameter

applicationId
integer required

The identifier for the application

Query Parameter

campaignId
number

Filter results by campaign.

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

dateFormat
string excel,ISO8601

Determines the format of dates in the export document.

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

Filter results by the state of the campaign.

Response Schema

#

Export triggered Effects to a CSV file.

GET  /v1/applications/{applicationId}/export_effects

Download a file with the triggered effects that match the given attributes.

Example

                    No example request
                  
                    No example response
                  

Request Schema

URL Parameter

applicationId
integer required

The identifier for the application

Query Parameter

campaignId
number

Filter results by campaign.

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.

dateFormat
string excel,ISO8601

Determines the format of dates in the export document.

Response Schema

#

List Users in your account

GET  /v1/users

Retrieve all users in your account.

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.

integer

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

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

modified
string format: date-time

The exact moment this entity was last modified.

string format: email

The email address associated with your account.

accountId
integer

The ID of the account that owns this entity.

inviteToken
string

Invite token, empty if the user as already accepted their invite.

state
string invited,active,deactivated

Current user state.

name
string

Full name

policy
string format: acl

A blob of ACL JSON

releaseUpdate
boolean

Update the user via email

latestFeature
string optional

Latest feature the user has been notified.

roles
array optional

Contains a list of all roles a user is a memeber of

roles
integer optional

Contains a list of all roles a user is a memeber of

#

Get a single User

GET  /v1/users/{userId}

Retrieves the data (including an invitation code) for a user. Non-admin users can only get themselves.

Example

                    No example request
                  
                    No example response
                  

Request Schema

URL Parameter

userId
integer required

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

modified
string format: date-time

The exact moment this entity was last modified.

string format: email

The email address associated with your account.

accountId
integer

The ID of the account that owns this entity.

inviteToken
string

Invite token, empty if the user as already accepted their invite.

state
string invited,active,deactivated

Current user state.

name
string

Full name

policy
string format: acl

A blob of ACL JSON

releaseUpdate
boolean

Update the user via email

latestFeature
string optional

Latest feature the user has been notified.

roles
array optional

Contains a list of all roles a user is a memeber of

roles
integer optional

Contains a list of all roles a user is a memeber of

#

Request a password reset

POST  /v1/password_recovery_emails

Sends an email with a password recovery link to the email of an existing account.

Example

                    {
  "url": "POST https://demo.talon.one/v1/password_recovery_emails",
  "body": {
    "body": {
      "email": "moeckel@talon.one"
    }
  }
}
                  
                    null
                  

Request Schema

Body Parameter

string required minlength: 1 format: email

Sends an email with a password recovery link to the email of an existing account.

Response Schema

string minlength: 1 format: email
#

Reset password

POST  /v1/reset_password

Consumes the supplied password reset token and updates the password for the associated account.

Example

                    No example request
                  
                    No example response
                  

Request Schema

Body Parameter

password
string required

The new password for your account.

resetToken
string required minlength: 1

Consumes the supplied password reset token and updates the password for the associated account.

Response Schema

password
string

The new password for your account.

resetToken
string minlength: 1
#

Get Account Details

GET  /v1/accounts/{accountId}

Return the details of your companies Talon.One account.

Example

                    {
  "url": "GET https://demo.talon.one/v1/accounts/1",
  "body": {}
}
                  
                    {
  "id": 1,
  "created": "2018-04-11T07:49:04.194Z",
  "modified": "2018-04-11T07:49:04.194Z",
  "companyName": "talon.one",
  "domainName": "",
  "state": "active",
  "billingEmail": "demo@talon.one",
  "planName": "",
  "applicationLimit": 0,
  "userLimit": 0,
  "campaignLimit": 0,
  "apiLimit": 0,
  "applicationCount": 6,
  "userCount": 1,
  "campaignsActiveCount": 4,
  "campaignsInactiveCount": 14
}
                  

Request Schema

URL Parameter

accountId
integer required

Response Schema

id
integer

Unique ID for this entity.

created
string format: date-time

The exact moment this entity was created.

modified
string format: date-time

The exact moment this entity was last modified.

companyName
string minlength: 1
domainName
string

Subdomain Name for yourcompany.talon.one

state
string trial,active,trial_expired

State of the account (trial, active, trial_expired)

billingEmail
string format: email

The billing email address associated with your company account.

planName
string optional

The name of your booked plan.

planExpires
string optional format: date-time

The point in time at which your current plan expires.

applicationLimit
integer optional

The maximum number of Applications covered by your plan.

userLimit
integer optional

The maximum number of Campaign Manager Users covered by your plan.

campaignLimit
in