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

Wallet2 API (1.0)

Download OpenAPI specification:Download

OrderingStack wallet2 API

Authentication

oauth2

Standard token auth

Security Scheme Type OAuth2

oauth2-client

Internal authorization between microservices

Security Scheme Type OAuth2

wallet

getWallet

Get wallet for specific user. If it is not created - get 404.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_ROROLE_VIEWWALLET)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>

Responses

putWallet

Update wallet for logged user. If wallet was not there - it is created.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLET)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
property name*
string

Responses

Request samples

Content type
application/json
{
  • "property1": "string",
  • "property2": "string"
}

postWallet

Create wallet for specific user. If wallet is already there - attributes are overwritten if they are provided and not empty.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLET)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
property name*
string

Responses

Request samples

Content type
application/json
{
  • "property1": "string",
  • "property2": "string"
}

getMyWallet

Get wallet for logged user (reduced data). If it is not created - get 404.

Authorizations:

Responses

createMyWallet

Create wallet for logged user. If wallet is already there - nothing happens.

Authorizations:

Responses

alterMyWalletExtra

Alter wallet extra info for logged user.

Authorizations:
Request Body schema: application/json
property name*
string

Responses

Request samples

Content type
application/json
{
  • "property1": "string",
  • "property2": "string"
}

getMyWalletExtended

Get wallet for logged user with extended info. If it is not created - get 404.

Authorizations:

Responses

staff

getWallet

Get wallet for specific user. If it is not created - get 404.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_ROROLE_VIEWWALLET)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>

Responses

putWallet

Update wallet for logged user. If wallet was not there - it is created.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLET)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
property name*
string

Responses

Request samples

Content type
application/json
{
  • "property1": "string",
  • "property2": "string"
}

postWallet

Create wallet for specific user. If wallet is already there - attributes are overwritten if they are provided and not empty.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLET)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
property name*
string

Responses

Request samples

Content type
application/json
{
  • "property1": "string",
  • "property2": "string"
}

useVoucher

Use voucher on wallet - add points

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_VOUCHER)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
voucher
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "voucher": "f54d9d74-3755-45a8-b042-f5b2aefca818"
}

markCouponUsed

Mark coupon used.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
coupon
required
string [ 0 .. 16 ] characters [a-zA-Z0-9_-]+

Responses

Request samples

Content type
application/json
{
  • "coupon": "string"
}

revertUsedCoupon

Revert coupon marked used.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
coupon
required
string [ 0 .. 16 ] characters [a-zA-Z0-9_-]+

Responses

Request samples

Content type
application/json
{
  • "coupon": "string"
}

createOperation

New operation (usage of collected points)

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_OP)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
amount
required
number > 0
order
string [ 0 .. 64 ] characters
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "order": "string",
  • "venue": "string",
  • "extra": {
    }
}

revertOperation

Operation rollback (points are returned to batches they were collected from).

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_OP)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
operation
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "operation": "fc63ceec-84f0-4df1-a7e8-77c5f8c0b283"
}

createCoupon

Create new coupon.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
required
object (Details_Staff)
object (CouponData_Staff)
expires
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "details": {
    },
  • "data": {
    },
  • "expires": "2019-08-24T14:15:22Z"
}

addBatch

Create and add new batch of points. Batch can have expiration date and price for which points were bought..

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_BATCH)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
amount
required
number > 0
price
number > 0
expires
string <date-time>
order
string [ 0 .. 64 ] characters
description
string [ 0 .. 32 ] characters
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "price": 0,
  • "expires": "2019-08-24T14:15:22Z",
  • "order": "string",
  • "description": "string",
  • "venue": "string",
  • "extra": {
    }
}

addBatchSync

Create and add new batch of points (synchronous). Batch can have expiration date and price for which points were bought..

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_BATCH)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
amount
required
number > 0
price
number > 0
expires
string <date-time>
order
string [ 0 .. 64 ] characters
description
string [ 0 .. 32 ] characters
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "price": 0,
  • "expires": "2019-08-24T14:15:22Z",
  • "order": "string",
  • "description": "string",
  • "venue": "string",
  • "extra": {
    }
}

createVoucher

Create new voucher.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_VOUCHER)
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
expires
string <date-time>
pointsExpireInDays
integer <int32> >= 1
forWallet
string <uuid>
amount
required
number > 0
price
number > 0
object

Responses

Request samples

Content type
application/json
{
  • "expires": "2019-08-24T14:15:22Z",
  • "pointsExpireInDays": 1,
  • "forWallet": "1c596f49-6bbe-43f6-a405-e2f35389a324",
  • "amount": 0,
  • "price": 0,
  • "extra": {
    }
}

updateOperation

Update operation

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_OP)
path Parameters
wallet
required
string <uuid>
operation
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "venue": "string",
  • "extra": {
    }
}

listCoupons

List coupons in wallet.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>

Responses

reward

getReward

Get single reward data

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
path Parameters
id
required
string <uuid>
Example: 9cbe650a-1fb7-4b06-912b-cead8a013e8b

Responses

upsertReward

Update reward data

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
path Parameters
id
required
string <uuid>
Example: 9cbe650a-1fb7-4b06-912b-cead8a013e8b
Request Body schema: application/json
name
required
string [ 3 .. 128 ] characters [\p{L}\p{N}_. -]+
visible
boolean

Visible in catalog and allowed to exchange for points by users themselves

object (Details)
availableFrom
string <date-time>
availableTo
string <date-time>
points
required
number > 0
maxCount
integer <int32> >= 1
priority
integer <int32> >= 0
required
object (CouponData)
tags
Array of strings [ 0 .. 16 ] items
object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "visible": true,
  • "details": {
    },
  • "availableFrom": "2019-08-24T14:15:22Z",
  • "availableTo": "2019-08-24T14:15:22Z",
  • "points": 0,
  • "maxCount": 1,
  • "priority": 0,
  • "data": {
    },
  • "tags": [
    ],
  • "extra": {
    }
}

deleteReward

Delete reward. Be careful as this is not reversible.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
path Parameters
id
required
string <uuid>
Example: 9cbe650a-1fb7-4b06-912b-cead8a013e8b

Responses

getRewardsList_1

Get paginated list of rewards for administrative purposes. This endpoint is compatible with React AdminOnRest framework to provide DataSource.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
query Parameters
required
object (RewardsFilter)

Responses

createReward

Create new reward

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
Request Body schema: application/json
name
required
string [ 3 .. 128 ] characters [\p{L}\p{N}_. -]+
visible
boolean

Visible in catalog and allowed to exchange for points by users themselves

object (Details)
availableFrom
string <date-time>
availableTo
string <date-time>
points
required
number > 0
maxCount
integer <int32> >= 1
priority
integer <int32> >= 0
required
object (CouponData)
tags
Array of strings [ 0 .. 16 ] items
object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "visible": true,
  • "details": {
    },
  • "availableFrom": "2019-08-24T14:15:22Z",
  • "availableTo": "2019-08-24T14:15:22Z",
  • "points": 0,
  • "maxCount": 1,
  • "priority": 0,
  • "data": {
    },
  • "tags": [
    ],
  • "extra": {
    }
}

getRewardsList

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

Authorizations:
query Parameters
required
object (RewardsFilter)

Responses

admin

getReward

Get single reward data

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
path Parameters
id
required
string <uuid>
Example: 9cbe650a-1fb7-4b06-912b-cead8a013e8b

Responses

upsertReward

Update reward data

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
path Parameters
id
required
string <uuid>
Example: 9cbe650a-1fb7-4b06-912b-cead8a013e8b
Request Body schema: application/json
name
required
string [ 3 .. 128 ] characters [\p{L}\p{N}_. -]+
visible
boolean

Visible in catalog and allowed to exchange for points by users themselves

object (Details)
availableFrom
string <date-time>
availableTo
string <date-time>
points
required
number > 0
maxCount
integer <int32> >= 1
priority
integer <int32> >= 0
required
object (CouponData)
tags
Array of strings [ 0 .. 16 ] items
object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "visible": true,
  • "details": {
    },
  • "availableFrom": "2019-08-24T14:15:22Z",
  • "availableTo": "2019-08-24T14:15:22Z",
  • "points": 0,
  • "maxCount": 1,
  • "priority": 0,
  • "data": {
    },
  • "tags": [
    ],
  • "extra": {
    }
}

deleteReward

Delete reward. Be careful as this is not reversible.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
path Parameters
id
required
string <uuid>
Example: 9cbe650a-1fb7-4b06-912b-cead8a013e8b

Responses

getRewardsList_1

Get paginated list of rewards for administrative purposes. This endpoint is compatible with React AdminOnRest framework to provide DataSource.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
query Parameters
required
object (RewardsFilter)

Responses

createReward

Create new reward

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REWARDS)
Request Body schema: application/json
name
required
string [ 3 .. 128 ] characters [\p{L}\p{N}_. -]+
visible
boolean

Visible in catalog and allowed to exchange for points by users themselves

object (Details)
availableFrom
string <date-time>
availableTo
string <date-time>
points
required
number > 0
maxCount
integer <int32> >= 1
priority
integer <int32> >= 0
required
object (CouponData)
tags
Array of strings [ 0 .. 16 ] items
object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "visible": true,
  • "details": {
    },
  • "availableFrom": "2019-08-24T14:15:22Z",
  • "availableTo": "2019-08-24T14:15:22Z",
  • "points": 0,
  • "maxCount": 1,
  • "priority": 0,
  • "data": {
    },
  • "tags": [
    ],
  • "extra": {
    }
}

voucher

useVoucher

Use voucher on wallet - add points

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_VOUCHER)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
voucher
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "voucher": "f54d9d74-3755-45a8-b042-f5b2aefca818"
}

createVoucher

Create new voucher.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_VOUCHER)
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
expires
string <date-time>
pointsExpireInDays
integer <int32> >= 1
forWallet
string <uuid>
amount
required
number > 0
price
number > 0
object

Responses

Request samples

Content type
application/json
{
  • "expires": "2019-08-24T14:15:22Z",
  • "pointsExpireInDays": 1,
  • "forWallet": "1c596f49-6bbe-43f6-a405-e2f35389a324",
  • "amount": 0,
  • "price": 0,
  • "extra": {
    }
}

useVoucherOnMyWallet

Use voucher on my wallet - add points

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_VOUCHER)
Request Body schema: application/json
voucher
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "voucher": "f54d9d74-3755-45a8-b042-f5b2aefca818"
}

coupon

markCouponUsed

Mark coupon used.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
coupon
required
string [ 0 .. 16 ] characters [a-zA-Z0-9_-]+

Responses

Request samples

Content type
application/json
{
  • "coupon": "string"
}

revertUsedCoupon

Revert coupon marked used.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
coupon
required
string [ 0 .. 16 ] characters [a-zA-Z0-9_-]+

Responses

Request samples

Content type
application/json
{
  • "coupon": "string"
}

createCoupon

Create new coupon.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
required
object (Details_Staff)
object (CouponData_Staff)
expires
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "details": {
    },
  • "data": {
    },
  • "expires": "2019-08-24T14:15:22Z"
}

couponFromReward

Create coupon from reward.

Authorizations:
Request Body schema: application/json
reward
string <uuid>
count
integer <int32> [ 1 .. 99 ]

Responses

Request samples

Content type
application/json
{
  • "reward": "a3f4bca9-57c1-45b4-aed0-25e6d494e5cd",
  • "count": 1
}

listCoupons

List coupons in wallet.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_COUPONS)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>

Responses

activateCoupon

Get coupons.

Authorizations:

Responses

operation

createOperation

New operation (usage of collected points)

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_OP)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
amount
required
number > 0
order
string [ 0 .. 64 ] characters
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "order": "string",
  • "venue": "string",
  • "extra": {
    }
}

revertOperation

Operation rollback (points are returned to batches they were collected from).

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_OP)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
operation
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "operation": "fc63ceec-84f0-4df1-a7e8-77c5f8c0b283"
}

updateOperation

Update operation

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_OP)
path Parameters
wallet
required
string <uuid>
operation
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "venue": "string",
  • "extra": {
    }
}

batch

addBatch

Create and add new batch of points. Batch can have expiration date and price for which points were bought..

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_BATCH)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
amount
required
number > 0
price
number > 0
expires
string <date-time>
order
string [ 0 .. 64 ] characters
description
string [ 0 .. 32 ] characters
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "price": 0,
  • "expires": "2019-08-24T14:15:22Z",
  • "order": "string",
  • "description": "string",
  • "venue": "string",
  • "extra": {
    }
}

addBatchSync

Create and add new batch of points (synchronous). Batch can have expiration date and price for which points were bought..

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_BATCH)
path Parameters
wallet
required
string <uuid>
header Parameters
x-tenant
string <uuid>
Request Body schema: application/json
amount
required
number > 0
price
number > 0
expires
string <date-time>
order
string [ 0 .. 64 ] characters
description
string [ 0 .. 32 ] characters
venue
string [ 0 .. 255 ] characters
object

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "price": 0,
  • "expires": "2019-08-24T14:15:22Z",
  • "order": "string",
  • "description": "string",
  • "venue": "string",
  • "extra": {
    }
}

expiringPoints

Points expiring in near future.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REPORT)
header Parameters
x-tenant
string <uuid>

Responses

expiredPaidBatches

Expired paid batches in period.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REPORT)
query Parameters
year
required
integer <int32>
month
required
integer <int32>
header Parameters
x-tenant
string <uuid>

Responses

stats

getWalletReport

Create wallet report

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_STATS)
query Parameters
from
required
string <date>
to
required
string <date>
venues
Array of strings
header Parameters
x-tenant
string <uuid>

Responses

report

expiringPoints

Points expiring in near future.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REPORT)
header Parameters
x-tenant
string <uuid>

Responses

expiredPaidBatches

Expired paid batches in period.

Authorizations:
oauth2-clientoauth2 (ROLE_SUROLE_WALLETROLE_WALLET_REPORT)
query Parameters
year
required
integer <int32>
month
required
integer <int32>
header Parameters
x-tenant
string <uuid>

Responses