این API برای تطبیق شماره موبایل ارسال شده با شماره …
POST
استعلام
Mobile Bill Inquiry API
This API allows you to inquire the outstanding bill for an Iranian mobile number (postpaid). It uses Sepal Yar's mobile bill inquiry service and returns bill id, payment id, amount and operator. On successful calls, the service tariff is deducted from the caller's wallet.
POST/api/services/mobile-bill-inquiry/
نیاز به احراز هویت
Token
100 requests/minute
مستندات
Overview
Overview
The Mobile Bill Inquiry API lets you retrieve the outstanding bill for a postpaid Iranian mobile number using Sepal Yar's VAS services.
On each successful call, the service:
Validates the mobile number format
Queries Sepal Yar's mobile bill inquiry service
Returns bill id, payment id, amount and operator
Deducts the configured tariff from your wallet
Returns a unique request reference for audit purposes
Authentication
Authentication
This API requires token-based authentication plus a unique code header.
Retrieve your API token and unique code from the admin panel.
When Sepal Yar returns validation errors, the original payload (including errors array) is exposed under the error field.
Best Practices
Best Practices
Validate the mobile number format on your side before calling the API.
Use the returned bill_id and pay_id for payment flows.
Store request_ref, ref_id and operation_time for auditing.
Monitor wallet balance to avoid 402 responses.
Implement retry logic with exponential backoff for transient 5xx errors.
پارامترهای درخواست
پارامتر
نوع
اجباری
توضیحات
مثال
mobile
String
اجباری
Postpaid mobile number in Iranian format (starting with 09) or international format (+98 or 0098). Spaces and dashes will be removed.
اعتبارسنجی: Must start with 09, +98 or 0098. Max length 20 characters. Only valid postpaid numbers are supported by upstream.
09131852730
midterm
Boolean
اختیاری
If true, inquires midterm bill (میاندوره). If false, may return final bill depending on operator rules. Default is true.
اعتبارسنجی: Boolean value; if omitted, defaults to true.
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Token YOUR_AUTH_TOKEN");
client.DefaultRequestHeaders.Add("X-Unique-Code", "YOUR_UNIQUE_CODE");
var payload = new
{
mobile = "09131852730",
midterm = true
};
var json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://inquiry.sepal.ir/api/services/mobile-bill-inquiry/",
content
);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"error": {
"code": "INVALID_PARAMETERS",
"details": {
"mobile": [
"شماره موبایل باید با 09 شروع شود یا فرمت بینالمللی داشته باشد."
]
},
"message": "پارامترهای ورودی نامعتبر است."
},
"success": false
}
401
خطا
Unauthorized - missing or invalid authentication headers.