Preview a public server-calculated quote
POST
/v2/public/quotes/previewHeader parameters
x-request-idstringOptional caller-provided request correlation ID.
min length 1
Request body
requiredapplication/jsonlocatorstringrequiredmin length 1 · max length 160
offerIdstring<uuid>requiredformIdstring<uuid>customAmountHalalasintegermin 0 · max 9007199254740991
discountCodestringmax length 64 · matches ^[A-Z0-9_-]{1,64}$
Responses
200OK
quoteobject | anyrequiredShow propertiesHide properties
Any of:
object
offerIdstring<uuid>requiredofferTypestringrequiredAllowed:
one_timerecurringfreecustomcurrencyanyrequiredsubtotalHalalasintegerrequiredmin 0 · max 9007199254740991
discountHalalasintegerrequiredmin 0 · max 9007199254740991
taxableHalalasintegerrequiredmin 0 · max 9007199254740991
vatRateBpsintegerrequiredmin 0 · max 10000
vatHalalasintegerrequiredmin 0 · max 9007199254740991
totalHalalasintegerrequiredmin 0 · max 9007199254740991
customAmountHalalasinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyrecurringTermsobject | anyrequiredShow propertiesHide properties
Any of:
object
cadenceobjectrequiredShow propertiesHide properties
intervalUnitstringrequiredAllowed:
dayweekmonthyearintervalCountintegerrequiredmin -9007199254740991 · max 9007199254740991
trialDaysintegerrequiredmin 0 · max 365
regularTotalHalalasintegerrequiredmin 0 · max 9007199254740991
discountobject | anyrequiredShow propertiesHide properties
Any of:
object
durationstringrequiredAllowed:
onceforeverrepeatingrepeatingBillingCyclesinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyany
anyany
anypolicyFingerprintstringrequiredmatches ^[a-f0-9]{64}$
any
any404Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject422Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject429Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject500Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobjectRequest
curl -X POST "https://api.cipay.net/v2/public/quotes/preview" \
-H "Content-Type: application/json" \
-d '{
"locator": "string",
"offerId": "<uuid>",
"formId": "<uuid>",
"customAmountHalalas": 0,
"discountCode": "string"
}'const response = await fetch("https://api.cipay.net/v2/public/quotes/preview", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"locator": "string",
"offerId": "<uuid>",
"formId": "<uuid>",
"customAmountHalalas": 0,
"discountCode": "string"
})
});Response
{
"quote": {
"offerId": "<uuid>",
"offerType": "one_time",
"currency": "SAR",
"subtotalHalalas": 0,
"discountHalalas": 0,
"taxableHalalas": 0,
"vatRateBps": 0,
"vatHalalas": 0,
"totalHalalas": 0,
"customAmountHalalas": 0,
"recurringTerms": {
"cadence": {
"intervalUnit": "day",
"intervalCount": 0
},
"trialDays": 0,
"regularTotalHalalas": 0,
"discount": {
"duration": "once",
"repeatingBillingCycles": 0
}
},
"policyFingerprint": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}