Main docs page Auth API Ordering API Menu API Venue API Inventory API Payment API Loyalty API Wallet API

Loyalty API (1.0)

Download OpenAPI specification:Download

OrderingStack loyalty API

Authentication

oauth2

Standard token auth

Security Scheme Type OAuth2

oauth2-client

Internal authorization between microservices

Security Scheme Type OAuth2

campaign

getCampaign

Get campaign by ID

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
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
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
path Parameters
campaign
required
string [ 1 .. 64 ] characters [a-zA-Z0-9_-]+
header Parameters
x-tenant
string
Request Body schema: application/json
pushId
required
string[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 (ROLE_SUROLE_LOYALTY)
query Parameters
required
object (CampaignFilter)

Responses

postCampaign

Create campaign. Works as upsert

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+
Request Body schema: application/json
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
path Parameters
campaign
required
string [ 1 .. 64 ] characters [a-zA-Z0-9_-]+
header Parameters
x-tenant
string
Request Body schema: application/json
string[a-zA-Z0-9_-]{1,32}

Responses

Request samples

Content type
application/json
"string"

previewCampaign

Preview matching accounts for campaign

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_CAMPAIGN)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_STATS)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_STATS)
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:
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:
query Parameters
coupon
required
string[a-zA-Z0-9_-]+

Responses

pushClick

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

Authorizations:
path Parameters
campaign
required
string[a-zA-Z0-9_-]+
Request Body schema: application/json
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:
path Parameters
campaign
required
string[a-zA-Z0-9_-]+

Responses

coupon Deprecated

DEPRECATED. Mark coupon received and proceed to next state

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

Responses

getMyAccount_1

Get my account

Authorizations:

Responses

setMyProfile

Set my profile

Authorizations:
Request Body schema: application/json
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:
Request Body schema: application/json
object
addTags
Array of strings [ 0 .. 16 ] items
removeTags
Array of strings [ 0 .. 16 ] items

Responses

Request samples

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

verifyArbitraryAccountCoupon

Verify if campaign coupon can be used for any account

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_COUPON)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_COUPON)
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:

Responses

export

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

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTY)
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:
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 (ROLE_SUROLE_LOYALTY)
query Parameters
required
object (AccountFilter)

Responses

getAccount

Get account

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTY)
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

Get my account

Authorizations:

Responses

getAccountByCard

Get account by card id

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

Responses

event

postEvent

Post new event(s)

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_EVENT)
header Parameters
x-tenant
string [ 3 .. 64 ] characters [a-zA-Z0-9_-]+
Request Body schema: application/json
Array ()
One of

Responses

Request samples

Content type
application/json
[
  • {
    }
]

stats

segmentStats

Get stats for segments

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_STATS)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_STATS)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_STATS)
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 (ROLE_SUROLE_LOYALTYROLE_LOYALTY_STATS)
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 (ROLE_SUROLE_LOYALTY)
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:
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 (ROLE_SUROLE_LOYALTY)
query Parameters
required
object (AccountFilter)

Responses