billing

POST /v1/subscriptions/{subscriptionId}/prepay

Create the order to pay for several billing periods at once.

تمام billing اینڈ پوائنٹس

تمام ڈویلپر دستاویزات

توثيقِ شناخت

ایک بیرر ٹوکن کے طور پر ایک API کی بھیجیں۔ کی کے پاس billing.payment.manage اجازت ہونی چاہیے؛ اس کے بغیر کی کو 404 کے بجائے 403 کے ساتھ مسترد کر دیا جاتا ہے۔

یہ اینڈ پوائنٹ کوئی آرگنائزیشن آئی ڈی نہیں لیتا۔ آپ کی کلید پہلے ہی اس آرگنائزیشن کی شناخت کرتی ہے جس سے یہ تعلق رکھتی ہے، اور اس کا جواب اسی کے مطابق محدود ہوتا ہے۔

آزمائیں

کوئی بھی چیز جو زاویہ دار قوسین میں ہو اسے اپنی اقدار سے بدلیں، اور کلیدی پلیس ہولڈر کو اپنے ڈیش بورڈ کی کسی کلید سے بدلیں۔

curl -X POST https://api.zinndigital.com/v1/subscriptions/{subscriptionId}/prepay \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "periods": <integer> }'

لاگ ان ہیں؟ آپ کے ڈیش بورڈ میں موجود API کنسول آپ کی حقیقی تنظیم کی آئی ڈی اور آپ کی اپنی کلید خود بخود پُر کر دیتا ہے، اور لائیو API پر درخواست چلاتا ہے تاکہ آپ اصل ردعمل دیکھ سکیں۔ اس اینڈ پوائنٹ کو API کنسول میں کھولیں

تفصیلات

Mints an unpaid order for N whole billing periods. ⛔⛔ No money is taken here. The client then settles that order through POST /v1/orders/{orderId}/pay, which already knows how to pay from account balance, from a gateway, or from both. That separation is the point rather than an implementation detail: it is what lets a customer with no chargeable mandate use this at all — somebody paying in crypto, or in a market whose regulator forbids an off-session charge. They top up once and pay six months from their balance, with no card anywhere in the flow. Replaying the same request returns the same order rather than a second one, so a double-clicked button cannot bill twice. Asking for a different number of periods supersedes the earlier unpaid prepay order and mints a fresh one — a customer changing their mind is not a collision. An unpaid order against this subscription that is not a prepayment (a plan change, say) is refused with ORDER_IN_FLIGHT instead, and is never cancelled on the customer's behalf. Requires billing.payment.manage. 422 carries a code in its details: TOO_FEW / TOO_MANY (outside the allowed range), NOT_PREPAYABLE (ended, comped or free), RAIL_NOT_SUPPORTED (billed by PayPal on its own schedule), or ORDER_IN_FLIGHT.

پیرامیٹرز

نامقسملازمییہ کیا ہے
subscriptionId (path)UuidہاںThe subscription to pay ahead on.

درخواست کا باڈی

نامقسملازمییہ کیا ہے
periodsintegerہاںHow many whole billing periods to pay for now.

جواب

نامقسملازمییہ کیا ہے
order_idUuidہاںUUIDv7 identifier — sortable by creation time (docs/02 §8).
order_numberstringہاں
periodsintegerہاں
total_amount_minorintegerہاںIncluding tax.
currencystringہاں
statusstringہاں

وہ خرابیان جو یہ اینڈ پوائنٹ واپس کر سکتا ہے

401 · 403 · 404 · 422 · 429