GoPay Gems

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
Hosthttps://public-mini-app-merchants.gopayapi.com
Http MethodGET

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
This is the token you would receive in the apply token API

Response:

PropertyData typeDescription
successbooleanIt will be true if API call is successful and false in case of failure
data.balanceintegerUser's gems balance. If success is false, this will be omitted
errorobjectThis object will be non-null only in case of failures
error.codestringThe error code
error.descriptionstringThe 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 codeDescription
105User not found
303Malformed Authorization
900Unable to process