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[a-zA-Z0-9_-]+
header Parameters
x-tenant
string

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
Request Body schema: */*
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 objects (CampaignStateDefinition) [ 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 objects (AbstractCampaignNotification) [ 0 .. 3 ] items

Define push notification templates

Responses

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

Responses

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
Request Body schema: */*
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 objects (CampaignStateDefinition) [ 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 objects (AbstractCampaignNotification) [ 0 .. 3 ] items

Define push notification templates

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

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

Responses

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

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

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

account

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

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

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

getAccountByCard

Get account by card id

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

setMyProperties

Set my properties and tags

Authorizations:
Request Body schema: */*
object
addTags
Array of strings [ 0 .. 32 ] items
removeTags
Array of strings [ 0 .. 32 ] items

Responses

setMyProfile

Set my profile

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

Responses

getMyCampaigns

Get my campaigns and their state

Authorizations:

Responses

coupon

DEPRECATED. Mark coupon received and proceed to next state

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

Responses

message

Mark message received and proceed to next state

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

Responses

verifyCoupon

Verify if campaign coupon can be used

Authorizations:
query Parameters
coupon
required
string[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

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

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

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: */*
Array ()
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
id
required
string[a-zA-Z0-9_.-]+
doNotProcessSymmetry
boolean

Responses