Rehook Platform API provides resource oriented URLs to work with your business data. Our API uses JSON for request and response. API errors are returned using standard HTTP response codes.

Introduction

Get customer wallet API will enable you to fetch the wallet information of a given customer. you can call this API at applicable touch points on your application to show the wallet data on your application UI.

API details

API Endpoint: https://api.rehook.ai/wallets/customer/{source_id}

HTTP Method: GET

Prerequisites

  1. API Key and Secret Key for your application
  2. If you don't know the API key and secret key, please go to setting module on admin panel to view API details for your application. To know more about application settings, please visit Application setting
  3. API key and secret key are auto generated and cannot be changed.
  4. Custom wallet to be created for your application. To know more about how to create wallet, please visit Wallet setting

Authentication

You need to provide the API key and Secret of your application in every new request as Authorization. Rehook use Basic authentication method to authenticate the API calls.

AuthorizationValue
UsernameAPI Key of your application
PasswordSecret key of your application

Parameters

This API doesn't requires any query or body parameters. you have to provide the source_id as parameter in the path URL

ParameterInDefinitionexample
source_idPathrequired
Rehook Id or source id of a customer
KMN@123

Sample request and response

Path: https://api.rehook.ai/wallets/customer/krishna123

krishna123 is the source id in above URL path.

response

If source_id provided in path is valid, then rehook will return the wallet details of that customer in the response body.

[
  {
    "wallet_id": "waty_XbgBcerLwjoMhAGcmAHhZ",
    "wallet_name": "Krishna",
    "currency": "INR",
    "singular_unit_name": "point",
    "plural_unit_name": "points",
    "timezone": "Asia/Calcutta",
    "loyalty_points": 20
  }
]

Below table shows the definition of response body

Field nameDefinitionExample
wallet_idunique wallet id assigned by rehhok for a given wallet of your applicationwaty_XbgBcerLwjoMhAGcmAHhZ
wallet_namename of the walletSuper wallet
currencycurrency of the wallet for conversion of reward pointsINR
singular_unit_namesingular name of the reward pointsCoin
plural_unit_nameplural name of the reward pointsCoins
timezoneAll point transactions, points expirations, rewards will be logged as per the wallet timezone.Asia/calcutta
loyalty_pointscurrent wallet points hold by a given customer20 points

Error cases

If API call is failed, then Rehook will return the following HTTP success code with response body as given below:

HTTP CodeMessage
400bad request

error response body

field namedescriptionexample
CodeError code400
detailsError detailsGiven resource Id is wrong
messageerror messageResource Id not found
request_idAPI request Id assigned by Rehookabc_123

Sample error response

  1. When source_id in path is wrong
{
  "code": 404,
  "message": "resource not found",
  "details": "customer not found",
  "request_id": "d7469627-e559-989b-8a97-a3aef46ce1a6"
}
  1. When source_id is missing in the path
Cannot GET /wallets/customer
Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!