Skip to main content
POST
/
api
/
discount
/
wallet-points
Wallet & Points
curl --request POST \
  --url https://api.example.com/api/discount/wallet-points \
  --header 'Content-Type: application/json' \
  --data '
{
  "state": true,
  "tss_points_status": true
}
'
{
  "products": {
    "items": [
      {
        "prod_id": 12345,
        "product": "Classic T-Shirt",
        "price": 799,
        "quantity": 2,
        "sub_total": 1598
      }
    ]
  },
  "meta": {
    "items": [
      {
        "name": "reward_points",
        "used_points": 500,
        "total_points": 1250
      },
      {
        "name": "tss_money",
        "used_tss_money": 500,
        "total_tss_money": 1250
      },
      {
        "name": "tss_points",
        "used_tss_points": 200,
        "total_tss_points": 850
      },
      {
        "name": "calculations",
        "sub_total": 1598,
        "used_tss_money": 500,
        "used_tss_points": 200,
        "total": 898
      }
    ]
  }
}
This endpoint allows users to apply or remove TSS Money (wallet balance) and TSS Points (reward points) to their cart.

Authentication

Requires user authentication token.

Request Body

state
boolean
Enable/disable TSS Money usage (true to apply, false to remove)
tss_points_status
boolean
Enable/disable TSS Points usage (true to apply, false to remove)

Response

Returns the updated cart with wallet/points applied.
products
object
Products in cart with updated pricing
meta
object
Cart metadata including wallet and points information
meta.items
array
Array containing reward_points, tss_money, and tss_points metadata

TSS Money (Wallet Balance)

How it Works

  1. User’s available TSS Money balance is fetched from their account
  2. The amount applied is the minimum of:
    • Cart total
    • Available TSS Money balance
  3. Applied TSS Money reduces the cart total

Restrictions

  • Cannot be applied to gift vouchers only carts
  • Requires minimum TSS Money balance
  • Applied automatically up to cart total

Response Fields

used_points
number
Amount of wallet balance used (for reward_points)
total_points
number
Total available wallet balance
used_tss_money
number
Amount of TSS Money applied
total_tss_money
number
Total TSS Money available in wallet

TSS Points (Reward Points)

How it Works

  1. User’s available TSS Points balance is fetched
  2. Points can cover a percentage of the cart subtotal (configured in settings)
  3. Applied points reduce the cart total

Restrictions

  • Cannot be used with coupons
  • Cannot be used with app discount
  • Cannot be applied to gift vouchers
  • Cannot be used for donation products (SAVE_THE_SOUL_PRODUCT)
  • Limited to a percentage of cart subtotal

Response Fields

used_tss_points
number
Amount of TSS Points applied
total_tss_points
number
Total TSS Points available in account
{
  "products": {
    "items": [
      {
        "prod_id": 12345,
        "product": "Classic T-Shirt",
        "price": 799,
        "quantity": 2,
        "sub_total": 1598
      }
    ]
  },
  "meta": {
    "items": [
      {
        "name": "reward_points",
        "used_points": 500,
        "total_points": 1250
      },
      {
        "name": "tss_money",
        "used_tss_money": 500,
        "total_tss_money": 1250
      },
      {
        "name": "tss_points",
        "used_tss_points": 200,
        "total_tss_points": 850
      },
      {
        "name": "calculations",
        "sub_total": 1598,
        "used_tss_money": 500,
        "used_tss_points": 200,
        "total": 898
      }
    ]
  }
}

Error Responses

title
string
Error title
description
string
Detailed error message

Common Errors

{
  "title": "Bad Request",
  "description": "Insufficient TSS Money"
}
{
  "title": "Bad Request",
  "description": "TSS Money can't be applied on Gift Vouchers"
}
{
  "title": "Bad Request",
  "description": "Sorry! TSS points and coupons can not be used together"
}
{
  "title": "Bad Request",
  "description": "TSS Points can't be used for donation"
}

Usage Example

Apply TSS Money

POST /api/discount/wallet-points

{
  "state": true
}

Apply TSS Points

POST /api/discount/wallet-points

{
  "tss_points_status": true
}

Remove TSS Money and Points

POST /api/discount/wallet-points

{
  "state": false,
  "tss_points_status": false
}

Calculation Priority

  1. Product prices and quantities
  2. Coupon discounts (if no TSS Points)
  3. TSS Points (if no coupons)
  4. TSS Money (wallet balance)
  5. Final total calculation

Build docs developers (and LLMs) love