Skip to content

Cost Control: Managing Balance and Refund Logic in TG Validator Integrations #33

Description

@aiagentchat

Troubleshooting Balance and Refund Logic for Telegram Registration Checks

When integrating high-volume Telegram registration checks into your application, maintaining a stable balance and understanding how the system handles unsuccessful requests is critical for operational efficiency. This guide outlines how to interpret response signals and manage your account state when processing batches.

Understanding the Refund Mechanism

TG Validator operates on a pay-per-check model where balance is deducted for each request. However, the system is designed to handle edge cases automatically. If a check cannot be completed—specifically if it returns a non-zero business code indicating an undetermined state or a failure—the system automatically triggers a refund for that specific check.

Because the API is synchronous, you receive the result for your request in the same HTTP response. When submitting a batch of up to 100 identifiers, the service processes the batch as a whole. You should design your integration to inspect the response envelope for each item. If an item returns a non-zero business code, you can safely assume the cost associated with that specific identifier will be handled by the automated refund logic.

Validating Inputs to Prevent Unnecessary Errors

To ensure your balance is used effectively, perform client-side validation before sending requests. As with any API integration, JSON structure and data formats are paramount. Before submitting a request, ensure your identifiers are strictly formatted in E.164. Sending malformed data can lead to immediate rejection, which consumes development time and integration resources.

Managing API Limits and Concurrency

When scaling your integration, be aware that the API has rate limits that restrict requests per minute and that concurrency is also limited. These limits are in place to ensure service stability. If your application exceeds these thresholds, the API will return a rejection. Crucially, these rejected requests are not charged and do not create a check result, meaning they have no impact on your account balance.

For the most current information regarding specific request-rate and concurrency thresholds, please consult the official API documentation.

Troubleshooting Checklist

If you find that your balance is depleting faster than expected or you are encountering unexpected results, follow these diagnostic steps:

  1. Verify E.164 Compliance: Ensure every identifier in your batch is correctly formatted. Invalid phone number formats are a common source of failed requests.
  2. Inspect Response Envelopes: Always parse the code, msg, and data fields in the response. A non-zero code indicates an undetermined check that triggers the refund process.
  3. Monitor Concurrency: If your integration is highly parallelized, ensure you are not hitting the concurrency limit. You can check your usage reports and recent check history in your dashboard to identify patterns in your request volume.
  4. Check Account Balance: Use the dashboard to monitor your spend and 7-day trends. If you require higher throughput for sustained high-volume operations, contact support to discuss an enterprise plan.

Final Takeaway

The TG Validator API provides a predictable, synchronous workflow where failed or undetermined checks are automatically refunded. By validating your E.164 inputs and monitoring your response codes, you can maintain a robust integration that respects API limits and optimizes your account balance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions