Skip to main content

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
  • mascotEnum
    MascotEnum
    required
    The type of the mascot.
  • name
    string
    required
    The name of the mascot.

ListMascotResDTO

properties
  • mascotEnum
    MascotEnum
    required
    The type of the mascot.
  • coin
    number
    required
    The price for the m.

ListSelfMascotResDTO

properties
  • mascotEnum
    MascotEnum
    required
    The type of the mascot.
  • name
    string
    required
    The name of the mascot.
  • active
    integer
    required
    This indicate if the mascot is chosen as the main mascot. If 1, it is the main mascot; otherwise, it is not

FilterShopItemReqDTO

properties
  • categoryId
    Category
    required
    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
    string
    The id of the shop item.
  • name
    string
    The name id of the shop item.
  • subcategoryId
    Category
    required
    The subcategory id of the shop item.
  • thumbnail
    string
    The thumbnail url of the shop item.
  • riveInputName
    string
    The rive input name of the shop item.
  • riveInputValue
    number
    The rive input value of the shop item.
  • coin
    number
    The coin needed to purchase the shop item.
  • isPurchased
    Boolean
    It indicates if the shop item has been purchased or not.
  • isUsing
    Boolean
    It indicates if the shop item is currently being used by the user.
  • tag
    string
    The reserved tag for the shop item.
  • purchasedAt
    datetime
    The purchased time.
  • birthdaySpecial
    Boolean
    It indicates if the shop item is exclusive to the user in the birthday.
  • order
    number
    It is used by Backend for sorting.
  • saleable
    boolean
    It indicates if the item is saleable or not.
  • status
    number
    It is the status of the item. It is used by Backend team only and it may be removed in the future.

UserWalletDTO

properties
  • coin
    number
    User's coin.
  • exp
    number
    User's experience
  • token
    number
    User's token for checkin.

VoucherResDTO

properties
  • userVoucherId
    string
    The id of the user's voucher.
  • voucherId
    string
    The id of the voucher.
  • name
    string
    The name of the voucher.
  • purchasedAt
    datetime
    The time when the voucher is claimed.
  • redeemedAt
    datetime
    The time when the voucher is redeemed.
  • validUtil
    datetime
    The expired time of the voucher.
  • redeemQRCode
    string
    The url of the redeem QR code.
  • createdAt
    datetime
    The time when the voucher is rewarded.
  • status
    VoucherRedeemStatus
    The voucher redeem status.
  • isValid
    boolean
    It 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
    string
    The id of the voucher.
  • name
    string
    The name of the voucher.
  • level
    number
    The level required to reward the voucher.
  • expiredAt
    datetime
    The time when the voucher is expired.

RenameMascotReqDTO

properties
  • name
    string
    required
    The name of the mascot.


MascotEnum

NameValue
Sun1
Cat2
Rabbit3
Dog4

Category

Main Category

NameValue
傢具1
服飾2
伙伴角色3

Furniture Subcategory

NameValue
牆紙1
地板2
窗口物件3
地上玩具4
5
食物6
床+大型物件7

Costume Subcategory

NameValue
套裝1

Mascot Subcategory

NameValue
⻆色1

VoucherRedeemStatus

NameValue
-0
待換領1
已換領2
已過期3