On this page

    1. Home
    2. API
    3. API Reference
    4. Account
    5. Account Balance Codes

    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

    FieldTypeDescription
    balance_codesarrayList of codes associated with the network account.
    balance_codes[].balance_code_idstringUnique identifier (UUID) for the balance record.
    balance_codes[].balance_byte_countintegerTotal amount of data granted by this code in bytes.
    balance_codes[].redeem_timestringISO 8601 timestamp of when the code was applied.
    balance_codes[].end_timestringISO 8601 timestamp indicating when this data allocation expires.
    balance_codes[].secretstringThe original alphanumeric secret used for redemption.
    errorobjectReturned 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/json

    Successful 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"
        }
      ]
    }


    Powered by Sudoc v2.5.0
    Hide table of contents