On this page

    1. Home
    2. API
    3. API Reference
    4. Subscription
    5. Check Balance Code

    Check Balance Code

    This endpoint allows you to inspect a data balance code before redeeming it. It provides information about how much data the code contains and its expiration window.


    POST /subscription/check-balance-code

    Check the validity and data volume of a balance secret.

    Request

    POST /subscription/check-balance-code

    Headers:

    {
      "Host": "api.bringyour.com",
      "Content-Type": "application/json",
      "Authorization": "Bearer YOUR_JWT_TOKEN"
    }

    Body:

    {
      "secret": "string"
    }
    FieldTypeDescription
    secretstringRequired. The alphanumeric secret code to check.

    Response

    200 Success

    Status: 200 OK

    Content-Type: application/json

    {
      "balance": {
        "start_time": "string",
        "end_time": "string",
        "balance_byte_count": 0
      },
      "error": {
        "message": "string"
      }
    }

    Fields

    FieldTypeDescription
    balanceobjectDetails of the data credit in the code.
    balance.balance_byte_countintegerTotal bytes that will be added upon redemption.
    balance.start_timestringISO 8601 timestamp of when the code becomes active.
    balance.end_timestringISO 8601 timestamp of when the code expires.
    errorobjectPresent if the code is invalid or already used.

    Example

    HTTP Request

    POST /subscription/check-balance-code HTTP/1.1
    Host: api.bringyour.com
    Content-Type: application/json
    Authorization: Bearer YOUR_JWT_TOKEN
     
    {
      "secret": "GIFT-10GB-XYZ"
    }

    Successful HTTP Response

    {
      "balance": {
        "balance_byte_count": 10737418240,
        "start_time": "2025-01-01T00:00:00Z",
        "end_time": "2025-12-31T23:59:59Z"
      }
    }


    Powered by Sudoc v2.5.0
    Hide table of contents