FORK_backend_docs

Stamp API

Table of Contents


GET : get stamp-book by query

URL

/api/stamps

Request Format

Location Field Name Data Type Required Description
query user int - unique id of user which is the stamp-book owner
query facility int - unique id of facility to which the stamp-book belongs

Response Format

Key Description
status success
data array of stampbook rows

POST : create stamp-book

URL

/api/stamps/create

Request Format

Location Field Name Data Type Required Description
body userId int O unique id of user which is the stamp-book owner
body facilityId int O unique id of facility to which the stamp-book belongs

Response Format

Key Description
status success
data the created stampbook object

POST : stamp transaction

URL

/api/stamps/transaction

Request Format

Location Field Name Data Type Required Description
body buyerId int O unique id of user which is the stamp-book owner / stamp recipient
body facilityId int O unique id of facility
body sellerId int O unique id of user which is the stamp giver / facility manager for facilityId
body type int O transaction type, which is one of - 0: redeem(-amount), 1: give(+amount)
body amount int O amount of stamps traded

Response Format

Key Description
status success
data the updated stampbook object