Z Zise Developers 简体中文

Earn subscription estimate: accrual start / maturity / estimated interest

POST /v1/earn/subscription-quotes scope: earn:read
On behalf of a member · x-on-behalf-of required

Do not recalculate from the annualized rate yourself. Accrual date, day count, and rounding positions are server-controlled. For fixed-term products, estimated_interest must equal the amount actually received at maturity; we recalculate and assert equality during settlement. Independent calculations will eventually differ after you have displayed them to users.

No records are created and no limits reserved.

── Different responses for the two product types ──

  • Flexible, kind: "flexible": value_at, accrual-start instant; estimated_daily_interest, estimated daily return; first_settle_date, first interest-payment date. ⚠ disclaimer is always "estimate". Flexible rates can change, so this is not a promise, only an estimate at today’s rate. Do not label it as a maturity entitlement.
  • Fixed-term, kind: "fixed": value_date, accrual-start date; maturity_date, maturity date; estimated_interest; total_at_maturity. The rate is snapshotted into the order at subscription, so this is the actual maturity amount.

⚠ Redemption before accrual earns no interest. Flexible redemption uses LIFO, consuming non-accruing funds first. Show value_at to users.

FieldTypeRequiredDescription
x-on-behalf-of string Required

Request Body

FieldTypeRequiredDescription
product_id string Required
amount string Required

Response

200OK
{
  "kind": "fixed",
  "asset": "USDT",
  "ledger_scale": 6,
  "value_date": "2026-08-15",
  "maturity_date": "2026-11-13",
  "estimated_interest": "12.328767",
  "total_at_maturity": "1012.328767",
  "apr": "5.00%",
  "term_days": 90,
  "disclaimer": "estimate"
}
400invalid_request: amount format. · invalid_fields: amount ≤ 0 or out of magnitude range. · limit_exceeded: below minimum subscription / above transaction maximum. · member_context_required
404not_found: product nonexistent or not available to you. Same response: an error must not reveal the existence of something you cannot see.
Request
curl -X POST 'https://api.zinfra.vip/v1/earn/subscription-quotes' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-on-behalf-of: $MEMBER_ID' \
  -H 'content-type: application/json' \
  -d '{
    "product_id": "ern_8c1d",
    "amount": "1000.00"
  }'
const res = await fetch("https://api.zinfra.vip/v1/earn/subscription-quotes", {
  method: "POST",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
    "x-on-behalf-of": "$MEMBER_ID",
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "product_id": "ern_8c1d",
    "amount": "1000.00"
  }),
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();
import requests

res = requests.post(
    "https://api.zinfra.vip/v1/earn/subscription-quotes",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-on-behalf-of": "$MEMBER_ID",
        "content-type": "application/json",
    },
    json={
      "product_id": "ern_8c1d",
      "amount": "1000.00"
    },
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()
req, _ := http.NewRequest("POST", "https://api.zinfra.vip/v1/earn/subscription-quotes",
    strings.NewReader(`{
  "product_id": "ern_8c1d",
  "amount": "1000.00"
}`))
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-on-behalf-of", "$MEMBER_ID")
req.Header.Set("content-type", "application/json")
res, err := http.DefaultClient.Do(req)
// Decode amount fields as string, not float64.
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zinfra.vip/v1/earn/subscription-quotes"))
    .header("x-auth-token", "Bearer $TOKEN")
    .header("x-on-behalf-of", "$MEMBER_ID")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "product_id": "ern_8c1d",
  "amount": "1000.00"
}
"""))
    .build();
// Use String / BigDecimal for amounts, not double.
$ch = curl_init('https://api.zinfra.vip/v1/earn/subscription-quotes');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
    'x-on-behalf-of: $MEMBER_ID',
    'content-type: application/json',
  ],
  CURLOPT_POSTFIELDS => <<<'JSON'
{
  "product_id": "ern_8c1d",
  "amount": "1000.00"
}
JSON,
]);
$res = curl_exec($ch);
// Use bcmath / strings for amounts, not floatval.
200
{
  "kind": "fixed",
  "asset": "USDT",
  "ledger_scale": 6,
  "value_date": "2026-08-15",
  "maturity_date": "2026-11-13",
  "estimated_interest": "12.328767",
  "total_at_maturity": "1012.328767",
  "apr": "5.00%",
  "term_days": 90,
  "disclaimer": "estimate"
}