Loyalty API (1.0)

Download OpenAPI specification:Download

OrderingStack loyalty API

campaign

getCampaign

Get campaign by ID

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

putCampaign

Update campaign by ID. Works as upsert

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+
Request Body schema: application/json
required
id
required
string [ 0 .. 64 ] characters [a-zA-Z0-9_-]+
type
required
string
Enum: "STANDARD" "BIRTHDAY"
name
required
string [ 3 .. 128 ] characters

Name of a campaign

activeFrom
string <date-time>
activeTo
string <date-time>
required
Array of objects (Constraint) [ 1 .. 16 ] items

Constraints are rules that specify which accounts fall info the campaign.

required
Array of AccountStateDefinition (object) or CouponStateDefinition (object) or MessageStateDefinition (object) or OrderStateDefinition (object) or WalletStateDefinition (object) [ 1 .. 10 ] items

States define flow of campaign

dynamic
boolean

Flag that determine if campaign can be dynamically joined upon account change or only initially assigned accounts take part in campaign.

Array of CouponExpirationCampaignNotification (object) or DynamicJoinCampaignNotification (object) or SpecificTimeCampaignNotification (object) [ 0 .. 3 ] items

Define push notification templates

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "type": "STANDARD",
  • "name": "string",
  • "activeFrom": "2019-08-24T14:15:22Z",
  • "activeTo": "2019-08-24T14:15:22Z",
  • "constraints": [
    ],
  • "states": [
    ],
  • "dynamic": true,
  • "notifications": [
    ]
}

deleteCampaign

Delete campaign by ID. Be careful as this is irreversible operation.

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

registerPushV2

Register push for campaign

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string [ 1 .. 64 ] characters [a-zA-Z0-9_-]+
header Parameters
x-tenant
string
Request Body schema: application/json
required
pushId
required
string non-empty [a-zA-Z0-9_-]{1,32}
title
string

Responses

Request samples

Content type
application/json
{
  • "pushId": "string",
  • "title": "string"
}

getCampaigns

Get paginated list of campaigns. This endpoint is compatible with React AdminOnRest framework to provide DataSource.

Authorizations:
oauth2
query Parameters
required
object (CampaignFilter)

Responses

postCampaign

Create campaign. Works as upsert

Authorizations:
oauth2-clientoauth2
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+
Request Body schema: application/json
required
id
required
string [ 0 .. 64 ] characters [a-zA-Z0-9_-]+
type
required
string
Enum: "STANDARD" "BIRTHDAY"
name
required
string [ 3 .. 128 ] characters

Name of a campaign

activeFrom
string <date-time>
activeTo
string <date-time>
required
Array of objects (Constraint) [ 1 .. 16 ] items

Constraints are rules that specify which accounts fall info the campaign.

required
Array of AccountStateDefinition (object) or CouponStateDefinition (object) or MessageStateDefinition (object) or OrderStateDefinition (object) or WalletStateDefinition (object) [ 1 .. 10 ] items

States define flow of campaign

dynamic
boolean

Flag that determine if campaign can be dynamically joined upon account change or only initially assigned accounts take part in campaign.

Array of CouponExpirationCampaignNotification (object) or DynamicJoinCampaignNotification (object) or SpecificTimeCampaignNotification (object) [ 0 .. 3 ] items

Define push notification templates

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "type": "STANDARD",
  • "name": "string",
  • "activeFrom": "2019-08-24T14:15:22Z",
  • "activeTo": "2019-08-24T14:15:22Z",
  • "constraints": [
    ],
  • "states": [
    ],
  • "dynamic": true,
  • "notifications": [
    ]
}

registerPush

Register push for campaign

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string [ 1 .. 64 ] characters [a-zA-Z0-9_-]+
header Parameters
x-tenant
string
Request Body schema: application/json
required
string[a-zA-Z0-9_-]{1,32}

Responses

Request samples

Content type
application/json
"string"

previewCampaign

Preview matching accounts for campaign

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

initializeCampaign

Initialize campaign

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

finalizeCampaign

Initialize campaign

Authorizations:
oauth2-clientoauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

globalCampaignStats

Get global stats for campaign

Authorizations:
oauth2-clientoauth2
query Parameters
name
required
string[a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

campaignStats

Get stats for campaign

Authorizations:
oauth2-clientoauth2
query Parameters
name
required
string[a-zA-Z0-9_-]+
from
string <date>
to
string <date>
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

contactExport

Export contact information for accounts matching criteria. Export ignores paging in request and always returns all data.

Authorizations:
oauth2-clientoauth2
query Parameters
required
object (AccountFilter)
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

account

verifyCoupon

Verify if campaign coupon can be used

Authorizations:
oauth2
query Parameters
coupon
required
string[a-zA-Z0-9_-]+

Responses

pushClick

Register push click in campaign. This updated stats for push in campaign.

Authorizations:
oauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+
Request Body schema: application/json
required
string[a-zA-Z0-9_-]{1,32}

Responses

Request samples

Content type
application/json
"string"

message

Mark message received and proceed to next state

Authorizations:
oauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+

Responses

coupon Deprecated

DEPRECATED. Mark coupon received and proceed to next state

Authorizations:
oauth2
path Parameters
campaign
required
string[a-zA-Z0-9_-]+

Responses

getMyAccount

Get my account

Authorizations:
oauth2

Responses

setMyProfile

Set my profile

Authorizations:
oauth2
Request Body schema: application/json
required
firstName
string [ 0 .. 128 ] characters
lastName
string [ 0 .. 128 ] characters
birthdate
string <date>
sex
string
Enum: "MALE" "FEMALE" "OTHER"

Responses

Request samples

Content type
application/json
{
  • "firstName": "string",
  • "lastName": "string",
  • "birthdate": "2019-08-24",
  • "sex": "MALE"
}

setMyProperties

Set my properties and tags

Authorizations:
oauth2
Request Body schema: application/json
required
object
addTags
Array of strings [ 0 .. 16 ] items [ items [ 0 .. 64 ] characters my_([a-zA-Z0-9_.-]+) ]
removeTags
Array of strings [ 0 .. 16 ] items [ items [ 0 .. 64 ] characters my_([a-zA-Z0-9_.-]+) ]

Responses

Request samples

Content type
application/json
{
  • "properties": {
    },
  • "addTags": [
    ],
  • "removeTags": [
    ]
}

verifyArbitraryAccountCoupon

Verify if campaign coupon can be used for any account

Authorizations:
oauth2-clientoauth2
query Parameters
coupon
required
string[a-zA-Z0-9_-]+
account
required
string [ 3 .. 64 ] characters [a-zA-Z0-9._-]+
lock
boolean
Default: false
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

unlockArbitraryAccountCoupon

Unlock coupon manually for any account

Authorizations:
oauth2-clientoauth2
query Parameters
coupon
required
string[a-zA-Z0-9_-]+
account
required
string [ 3 .. 64 ] characters [a-zA-Z0-9._-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

getMyCampaigns

Get my campaigns and their state

Authorizations:
oauth2

Responses

export

Export accounts matching criteria. Export ignores paging in request and always returns all data.

Authorizations:
oauth2-clientoauth2
query Parameters
required
object (AccountFilter)
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

contactExport

Export contact information for accounts matching criteria. Export ignores paging in request and always returns all data.

Authorizations:
oauth2-clientoauth2
query Parameters
required
object (AccountFilter)
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

getAccounts

Get paginated list of accounts. This endpoint is compatible with React AdminOnRest framework to provide DataSource.

Authorizations:
oauth2
query Parameters
required
object (AccountFilter)

Responses

getAccount

Get account

Authorizations:
oauth2-clientoauth2
path Parameters
account
required
string [ 3 .. 64 ] characters [a-zA-Z0-9._-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

getMyAccount_1

Get my account

Authorizations:
oauth2

Responses

getAccountByCard

Get account by card id

Authorizations:
oauth2-clientoauth2
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

event

postEvent

Post new event(s)

Authorizations:
oauth2-clientoauth2
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+
Request Body schema: application/json
required
Array
One of
account
string [ 3 .. 64 ] characters [a-zA-Z0-9._-]+
card
string [ 3 .. 64 ] characters [a-zA-Z0-9._-]+
object (Consents)
ts
string <date-time>
type
required
string
Enum: "INVITED_BY" "INVITED" "FRIEND" "UNKNOWN"
id
required
string[a-zA-Z0-9_.-]+
doNotProcessSymmetry
boolean

Responses

Request samples

Content type
application/json
[
  • {
    }
]

stats

segmentStats

Get stats for segments

Authorizations:
oauth2-clientoauth2
query Parameters
from
string <date>
to
string <date>
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

globalCampaignStats

Get global stats for campaign

Authorizations:
oauth2-clientoauth2
query Parameters
name
required
string[a-zA-Z0-9_-]+
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

campaignStats

Get stats for campaign

Authorizations:
oauth2-clientoauth2
query Parameters
name
required
string[a-zA-Z0-9_-]+
from
string <date>
to
string <date>
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

segments

segmentStats

Get stats for segments

Authorizations:
oauth2-clientoauth2
query Parameters
from
string <date>
to
string <date>
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

export

export

Export accounts matching criteria. Export ignores paging in request and always returns all data.

Authorizations:
oauth2-clientoauth2
query Parameters
required
object (AccountFilter)
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

contactExport

Export contact information for accounts matching criteria. Export ignores paging in request and always returns all data.

Authorizations:
oauth2-clientoauth2
query Parameters
required
object (AccountFilter)
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+

Responses

react-admin-list-controller

getAccountsCount

Get count of accounts. This endpoint is compatible with React AdminOnRest framework to provide DataSource.

Authorizations:
oauth2
query Parameters
required
object (AccountFilter)

Responses