On this page

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

    Redeem Balance Code

    This endpoint allows you to redeem a data balance code (gift card or top-up code) to add a specified amount of data transfer volume to your network. Once redeemed, the data balance is credited to your account and remains active until the specified end time.


    POST /subscription/redeem-balance-code

    Redeem a secret alphanumeric code for a data balance allocation.

    Request

    POST /subscription/redeem-balance-code

    Headers:

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

    Body:

    {
      "secret": "string"
    }
    FieldTypeDescription
    secretstringRequired. The unique, alphanumeric secret code providing the data balance.

    Response

    200 Success

    Status: 200 OK

    Content-Type: application/json

    A successful response returns the details of the newly credited transfer balance.

    {
      "transfer_balance": {
        "transfer_balance_id": "udid",
        "start_time": "string",
        "end_time": "string",
        "balance_byte_count": 0
      },
      "error": {
        "message": "string"
      }
    }

    Fields

    FieldTypeDescription
    transfer_balanceobjectDetails of the data balance added to the account.
    transfer_balance.transfer_balance_idstringUnique identifier (UDID) for this balance record.
    transfer_balance.start_timestringISO 8601 timestamp of when this balance became active.
    transfer_balance.end_timestringISO 8601 timestamp of when this balance will expire.
    transfer_balance.balance_byte_countintegerThe total number of bytes granted by the code.
    errorobjectDetails if the redemption failed (can be null).
    error.messagestringHuman-readable explanation of the error.

    Example

    HTTP Request

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

    Successful HTTP Response

    {
      "transfer_balance": {
        "transfer_balance_id": "c73040c1-0000-4444-8888-000000000000",
        "start_time": "2025-01-20T12:00:00Z",
        "end_time": "2025-02-20T12:00:00Z",
        "balance_byte_count": 10737418240
      },
      "error": null
    }


    Powered by Sudoc v2.5.0
    Hide table of contents