Account Balance Codes
This endpoint provides a history of all data top-up codes (balance codes) that have been successfully redeemed by the authenticated network. It includes details on the amount of data granted, redemption time, and expiration status.
GET /account/balance-codes
Retrieve all redeemed balance codes for the network.
Request
GET /account/balance-codes
Headers:
{
"Host": "api.bringyour.com",
"Authorization": "Bearer YOUR_JWT_TOKEN",
"Accept": "application/json"
}Response
200 Success
Status: 200 OK
Content-Type: application/json
A successful response returns an object containing an array of redeemed codes.
{
"balance_codes": [
{
"balance_code_id": "uuid",
"balance_byte_count": 0,
"redeem_time": "string",
"end_time": "string",
"secret": "string"
}
],
"error": {
"message": "string"
}
}Fields
| Field | Type | Description |
|---|---|---|
balance_codes | array | List of codes associated with the network account. |
balance_codes[].balance_code_id | string | Unique identifier (UUID) for the balance record. |
balance_codes[].balance_byte_count | integer | Total amount of data granted by this code in bytes. |
balance_codes[].redeem_time | string | ISO 8601 timestamp of when the code was applied. |
balance_codes[].end_time | string | ISO 8601 timestamp indicating when this data allocation expires. |
balance_codes[].secret | string | The original alphanumeric secret used for redemption. |
error | object | Returned if the request failed. |
Example
HTTP Request
GET /account/balance-codes HTTP/1.1
Host: api.bringyour.com
Authorization: Bearer YOUR_JWT_TOKEN
Accept: application/jsonSuccessful HTTP Response
{
"balance_codes": [
{
"balance_code_id": "c73040c1-0000-4444-8888-000000000000",
"balance_byte_count": 10737418240,
"redeem_time": "2025-01-10T14:00:00Z",
"end_time": "2025-02-10T14:00:00Z",
"secret": "GIFT-10GB-XYZ"
}
]
}