Price breakdown for a period and optional discount code, in the caller's currency (currency field, amounts in its minor
unit). An invalid code is not an error: code_valid:false + code_message. A fixed-amount code (amount_off) in another
currency → code_valid:false, «این کد برای پرداخت با این واحد پول نیست.» ("This code is not valid for payments in this
currency."); percent codes work in every currency.
The code's duration is counted per account (successful and refunded payments of the caller with this code):
duration
Per account
code_message when valid (fa)
first_payment
once
«با این کد، پرداخت اول {percent} درصد تخفیف دارد. از تمدید بعدی، مبلغ بدون کد حساب میشود.»
first_n
the first duration_n payments
«این کد روی {n} پرداخت اول هر حساب {percent} درصد تخفیف دارد؛ {left} پرداخت با این کد برای شما مانده است.»
forever
every payment with the code
«با این کد، این پرداخت و هر تمدیدی که با همین کد بپردازید {percent} درصد تخفیف دارد.»
A code this account has used up → code_valid:false, code_message «این حساب سهم خود از این کد را استفاده کرده است.»
("This account has already used its share of this code."). max_uses counts successful and refunded payments with the
code by customer accounts (test accounts, team accounts and the admin panel test payments are not counted); an account that already
used the code (first_n, forever) is not blocked by max_uses. Reached cap → «ظرفیت استفاده از این کد پر شده است.»
Without a code, a user who signed up with an invite link and has no successful payment gets the referral first-payment
discount (referral_discount_percent) only while referral_gift_enabled is on; code_message then reads
«چون با لینک دعوت آمدهاید، پرداخت اول {percent} درصد تخفیف دارد.»
بدنه درخواست
فیلد
نوع
توضیح
period*
string
active period key: monthly | quarterly | yearly
code
string | null
max 40
نمونهjson
{"period":"quarterly","code":"FOUNDERS30"}
پاسخها
200— Quote
فیلد
نوع
توضیح
period
string
currency
string
Currency code, e.g. USD, EUR or IRT.
base_amount
integer
period_discount
integer
code_discount
integer
subtotal
integer
vat
integer
total
integer
code
string
Machine-readable code.
code_valid
boolean
code_message
string
period_start
string
period_end
string
json
{"period":"quarterly","currency":"IRT","base_amount":5400000,"period_discount":540000,"code_discount":1260000,"subtotal":3600000,"vat":360000,"total":3960000,"code":"FOUNDERS30","code_valid":true,"code_message":"با این کد، پرداخت اول ۳۰ درصد تخفیف دارد. از تمدید بعدی، مبلغ بدون کد حساب میشود.","period_start":"2026-11-25T09:53:44Z","period_end":"2027-02-25T09:53:44Z"}
401— Missing/invalid token, or a token of the wrong owner (admin token on a user route or vice versa): {"message":"…","code":"unauthenticated"} (message in the request language)
فیلد
نوع
message*
string
code
string
json
{"message":"Please sign in to continue; your session has ended or is not valid.","code":"unauthenticated"}