This API is used to fetch the user's latest gems balance and to issue gems to the user. It returns a promise that resolves with the result or rejects if an error occurs.
Fetch Gems Balance
| Path | /v1/mini-apps/users/gems/balance |
|---|---|
| Host | https://public-mini-app-merchants.gopayapi.com |
| Http Method | GET |
Request Headers:
Property | Data type | Required | Description |
|---|---|---|---|
Debug-Id | string | No | This is an identifier that is used for debugging purposes |
Request-Id | string | Yes | This is an identifier that is used for maintaining idempotency |
Authorization | string | Yes | Bearer Authorization header |
Response:
| Property | Data type | Description |
|---|---|---|
| success | boolean | It will be true if API call is successful and false in case of failure |
| data.balance | integer | User's gems balance. If success is false, this will be omitted |
| error | object | This object will be non-null only in case of failures |
| error.code | string | The error code |
| error.description | string | The description of the error |
Sample Response:
Success Response:
{
"data": {
"balance": 1000000
},
"success": true
}Error Response: With appropriate HTTP status codes. Only 5xx would be retriable
{
"success": false,
"error": {
"code": "159",
"description": "Payment option not found"
}
}Error codes:
| Error code | Description |
|---|---|
| 105 | User not found |
| 303 | Malformed Authorization |
| 900 | Unable to process |