Fetch Account Balance
The API fetches the account balance details of the user based on the program type of the business and different subscriptions if purchased by the user along with their benefits and discounts.
Note:
1. The net_balance, points_balance, net_debits, pending_points, total_credits, total_debits, and total_points_credits parameters are applicable if the program type is Points unlock redeemables.
2. The total_redeemable_visits, total_visits, and unredeemed_cards parameters are applicable if the program type is Visit-based.
3. The banked_rewards parameter is applicable if the program type is Points convert to currency.
4. The banked_currency and balance parameters are applicable if the program type is Points to Manual.
Headers
- Type: stringAuthorizationrequired
This is a combination of unique API key as well as business key (UUID) as the Authorization header.
Body
- Type: array of "subscription"enumdiscount
_type const:subscriptionType of discount for which discounts are returned in the response. The valid value for this parameter is ‘subscription’.
- Type: stringuser
_id System-generated unique ID of the user
Responses
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/pos/users/balance \
--header 'Authorization: Token token=LOCATION_KEY_GOES_HERE, btoken=BUSINESS_KEY_GOES_HERE' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "111111",
"discount_type": [
"subscription"
]
}'
{
"account_balance": {
"net_balance": 108,
"points_balance": 8,
"net_debits": 100,
"pending_points": 0,
"total_credits": 208,
"total_debits": "100.0",
"total_point_credits": 208
},
"subscriptions": [
{
"subscription_id": 39,
"benefits": [
{
"benefit_id": 1,
"benefit_type": "sku_discounting",
"discounts": [
{
"discount_id": 42,
"threshold": 2,
"discounted_value": "$0.00",
"discounted_quantity": 0,
"threshold_discount": 2,
"discount_type": "%_or_$_off"
}
]
}
]
}
]
}