Returns the wallet information for the specified customer ID.
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
- API Key and Secret Key for your application
- 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
- API key and secret key are auto generated and cannot be changed.
- 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.
Authorization | Value |
---|---|
Username | API Key of your application |
Password | Secret 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
Parameter | In | Definition | example |
---|---|---|---|
source_id | Path | required 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 name | Definition | Example |
---|---|---|
wallet_id | unique wallet id assigned by rehhok for a given wallet of your application | waty_XbgBcerLwjoMhAGcmAHhZ |
wallet_name | name of the wallet | Super wallet |
currency | currency of the wallet for conversion of reward points | INR |
singular_unit_name | singular name of the reward points | Coin |
plural_unit_name | plural name of the reward points | Coins |
timezone | All point transactions, points expirations, rewards will be logged as per the wallet timezone. | Asia/calcutta |
loyalty_points | current wallet points hold by a given customer | 20 points |
Error cases
If API call is failed, then Rehook will return the following HTTP success code with response body as given below:
HTTP Code | Message |
---|---|
400 | bad request |
error response body
field name | description | example |
---|---|---|
Code | Error code | 400 |
details | Error details | Given resource Id is wrong |
message | error message | Resource Id not found |
request_id | API request Id assigned by Rehook | abc_123 |
Sample error response
- When source_id in path is wrong
{
"code": 404,
"message": "resource not found",
"details": "customer not found",
"request_id": "d7469627-e559-989b-8a97-a3aef46ce1a6"
}
- When source_id is missing in the path
Cannot GET /wallets/customer