Get Balance
Obtain user's current Marketspace Wallet balance.
In order to obtain the user's current Marketspace Wallet balance using Centili Marketspace Wallet API v1, you need to send an HTTP GET request with a user reference and a Marketspace domain.
Before initiating a get balance request you will need to obtain an access token
GET Balance request
URL to which a request should be sent
https://{domain}/marketspace-balance/v1/reference/{reference}/
https://{domain}/marketspace-balance/v1/reference/{reference}/
Host: {domain}:443
Authorization: bearer token
Request parameters
Parameter | Description | Example | Required as |
---|---|---|---|
domain | A Marketspace domain name for which the user balance is being obtained | store-demo.centili.com | mandatory |
reference | Identifier of the end user | d02873b9-4726-4c57-a5fa-1483254bfa7b | mandatory |
GET Balance response
200
Obtained user balance for a Marketspace domain and a user reference
Response example
{
"reference":"d02873b9-4726-4c57-a5fa-1483254bfa7b",
"amount":15,
"currency":"GP",
"marketspaceCode":"SF_DEMO"
}
Response parameters
Parameter | Description | Example |
---|---|---|
reference | End user identifier | d02873b9-4726-4c57-a5fa-1483254bfa7b |
amount | Amount of balance in the wallet | 15 |
currency | Balance currency | GP |
marketspaceCode | Marketspace identifier | SF_DEMO |
4xx client error / 5xx server error
400 - Mandatory request parameters not present
401 - Invalid credentials
404 - User not found
500 - Request can not be processed at the current time
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"message": "Authorization failed",
"code": "AUTH_FAILED"
}
Parameter | Description | Example |
---|---|---|
code | Error response code | AUTH_FAILED |
message | Error response message | Authorization failed |
Updated over 1 year ago