Shop API
The Shop API allows App User to purchase/claim mascots, items and vouchers by using coins or experience. This set of APIs also allows App User to view and manage the purchasesd objects.
Endpoints
# Endpoints
Purchase mascot
This endpoint purchase a mascot.
Request (PurchaseMascotReqDTO)
POST /app/shop/mascots
{
"mascotEnum": 1,
"name": "my pet pet"
}
Response
{
"success": true,
"message": "",
"data": false
}
Rename mascot
This endpoint renames a mascot.
Request (RenameMascotReqDTO)
POST /app/shop/mascots/rename
{
"name": "my pet pet"
}
Response
{
"success": true,
"message": "",
"data": false
}
Get mascots
This endpoint returns a mascot.
Request
GET /app/shop/mascots
Response (ListMascotResDTO)
{
"success": true,
"message": "",
"data": [
{
"mascotEnum": 1,
"coin": 0
}
]
}
Get self mascots
This endpoint returns the user's mascot.
Request
GET /app/shop/mascots/mine
Response (ListSelfMascotResDTO)
{
"success": true,
"message": "",
"data": {
"mascotEnum": 1,
"name": "my pet",
"active": 1
}
}
Filter shop item
This endpoint filters the shop item.
Request (FilterShopItemReqDTO)
POST /app/shop/items/filter
{
"categoryId": 1,
"subcategoryId": 2
}
Response (FilterShopItemResDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "b2e745cb-4994-11ef-8cf0-7085c2d96f0d",
"name": "小耳",
"subcategoryId": 2,
"thumbnail": "https://jcci-test-media.aritaone.com/share/shop/伙伴角色/伙伴角色",
"riveInputName": "Character",
"riveInputValue": 0,
"coin": 0,
"isPurchased": false,
"isUsing": false,
"tag": null,
"purchasedAt": "2024-08-30T10:15:13.496221Z",
"birthdaySpecial": false,
"order": 10900,
"saleable": true,
"status": 1
}
]
}
Filter my shop item
This endpoint filters the user's shop item.
Request (FilterShopItemReqDTO)
POST /app/shop/items/mine/filter
{
"categoryId": 1,
"subcategoryId": 2
}
Response (FilterShopItemResDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "b2e745cb-4994-11ef-8cf0-7085c2d96f0d",
"name": "小耳",
"subcategoryId": 2,
"thumbnail": "https://jcci-test-media.aritaone.com/share/shop/伙伴角色/伙伴角色",
"riveInputName": "Character",
"riveInputValue": 0,
"coin": 0,
"isPurchased": false,
"isUsing": false,
"tag": null,
"purchasedAt": "2024-08-30T10:15:13.496221Z",
"birthdaySpecial": false,
"order": 10900,
"saleable": true,
"status": 1
}
]
}
Purchase shop item
This endpoint purchases a shop item
Request
POST /app/shop/items/{shop_item_id}/purchase
Response
{
"success": true,
"message": "",
"data": null
}
Use shop item
This endpoint uses a shop item
Request
POST /app/shop/items/{shop_item_id}/use
Response
{
"success": true,
"message": "",
"data": null
}
Get my using item
This endpoint gets the user's using items.
Request
GET /app/shop/items/mine
Response (FilterShopItemResDTO)
{
"success": true,
"message": "",
"data": [
{
"id": "b2e745cb-4994-11ef-8cf0-7085c2d96f0d",
"name": "小耳",
"subcategoryId": 2,
"thumbnail": "https://jcci-test-media.aritaone.com/share/shop/伙伴角色/伙伴角色",
"riveInputName": "Character",
"riveInputValue": 0,
"coin": 0,
"isPurchased": false,
"isUsing": false,
"tag": null,
"purchasedAt": "2024-08-30T10:15:13.496221Z",
"birthdaySpecial": false,
"order": 10900,
"saleable": true,
"status": 1
}
]
}
Get my wallet
This endpoint gets the user's wallet.
Request
GET /app/shop/wallet
Response (UserWalletDTO)
{
"success": true,
"message": "",
"data": {
"coin": 0,
"exp": 0,
"token": 0
}
}
Get my voucher
This endpoint gets the user's vouchers.
Request
GET /app/shop/vouchers/mine
Response (VoucherResDTO)
{
"success": true,
"message": "",
"data": [
{
"userVoucherId": "aaaad36e-ca51-44a9-938f-7096eca05f40",
"voucherId": "769c895c-4f27-11ef-986b-7085c2d96f0d",
"name": "Lv. 3 現金券兌換碼",
"purchasedAt": "2024-08-05T07:30:47.691050Z",
"redeemedAt": "2024-08-05T07:37:24.944765Z",
"validUtil": "2024-11-03T07:30:47.691050Z",
"redeemQRCode": "https://jcci-test-media.aritaone.com/share/user/084c69e3-988b-4aef-9604-c784ab61d6c2/voucher/490aeb5b-4c31-49c4-9e7f-7f5dc86d30fa",
"createdAt": "2024-08-05T07:22:17.373735Z",
"status": 2,
"isValid": true
}
]
}
Claim voucher
This endpoint claims the voucher.
Request
POST /app/shop/vouchers/{voucher_id}/claim
Response
{
"success": true,
"message": "",
"data": null
}
Get voucher reward
This endpoint gets voucher reward.
Request
POST /app/shop/vouchers/rewards
Response (VoucherRewardResDTO)
The data in the response body is not guaranteed. If there are no rewards, data will be null.
{
"success": true,
"message": "",
"data": {
"voucherId": "769c895c-4f27-11ef-986b-7085c2d96f0d",
"name": "Lv. 3 現金券兌換碼",
"level": 3,
"expiredAt": "2024-08-05T07:30:47.691050Z"
}
}
Resources
PurchaseMascotReqDTO
properties
The type of the mascot.
name
stringrequiredThe name of the mascot.
ListMascotResDTO
properties
The type of the mascot.
coin
numberrequiredThe price for the m.
ListSelfMascotResDTO
properties
The type of the mascot.
name
stringrequiredThe name of the mascot.
active
integerrequiredThis indicate if the mascot is chosen as the main mascot. If 1, it is the main mascot; otherwise, it is not
FilterShopItemReqDTO
properties
The category id of the shop item.
subcategoryId
The subcategory id of the shop item. If this is not given, all items in the category will be returned
FilterShopItemResDTO
properties
id
stringThe id of the shop item.
name
stringThe name id of the shop item.
The subcategory id of the shop item.
thumbnail
stringThe thumbnail url of the shop item.
riveInputName
stringThe rive input name of the shop item.
riveInputValue
numberThe rive input value of the shop item.
coin
numberThe coin needed to purchase the shop item.
isPurchased
BooleanIt indicates if the shop item has been purchased or not.
isUsing
BooleanIt indicates if the shop item is currently being used by the user.
tag
stringThe reserved tag for the shop item.
purchasedAt
datetimeThe purchased time.
birthdaySpecial
BooleanIt indicates if the shop item is exclusive to the user in the birthday.
order
numberIt is used by Backend for sorting.
saleable
booleanIt indicates if the item is saleable or not.
status
numberIt is the status of the item. It is used by Backend team only and it may be removed in the future.
UserWalletDTO
properties
coin
numberUser's coin.
exp
numberUser's experience
token
numberUser's token for checkin.
VoucherResDTO
properties
userVoucherId
stringThe id of the user's voucher.
voucherId
stringThe id of the voucher.
name
stringThe name of the voucher.
purchasedAt
datetimeThe time when the voucher is claimed.
redeemedAt
datetimeThe time when the voucher is redeemed.
validUtil
datetimeThe expired time of the voucher.
redeemQRCode
stringThe url of the redeem QR code.
createdAt
datetimeThe time when the voucher is rewarded.
status
The voucher redeem status.
isValid
booleanIt indicates if the voucher is allowed to be redeemed or not. If false, frontend should prevent the App user to open the QR code.
VoucherRewardResDTO
properties
voucherId
stringThe id of the voucher.
name
stringThe name of the voucher.
level
numberThe level required to reward the voucher.
expiredAt
datetimeThe time when the voucher is expired.
RenameMascotReqDTO
properties
name
stringrequiredThe name of the mascot.
MascotEnum
Name | Value |
---|---|
Sun | 1 |
Cat | 2 |
Rabbit | 3 |
Dog | 4 |
Category
Main Category
Name | Value |
---|---|
傢具 | 1 |
服飾 | 2 |
伙伴角色 | 3 |
Furniture Subcategory
Name | Value |
---|---|
牆紙 | 1 |
地板 | 2 |
窗口物件 | 3 |
地上玩具 | 4 |
碟 | 5 |
食物 | 6 |
床+大型物件 | 7 |
Costume Subcategory
Name | Value |
---|---|
套裝 | 1 |
Mascot Subcategory
Name | Value |
---|---|
⻆色 | 1 |
VoucherRedeemStatus
Name | Value |
---|---|
- | 0 |
待換領 | 1 |
已換領 | 2 |
已過期 | 3 |