POST
AppointmentCoupon.InsuranceAmount
When both appointment type and insurance company are selected, returns the configured insurance_price (Amount) and insurance_customer_price (Left Amount) from doctor_appointments_type.insurance_company_price JSON. Works with staff and Customer.Login tokens.
Permissions
- User must be logged in with a valid bearer token.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Runs the AppointmentCoupon.InsuranceAmount function and returns JSON.
Push Service
No push is sent because this function only reads data or returns helper information.
Automation
No automation is run for this function.
Special Instructions
- Customer.Login tokens are allow-listed for this read-only route. Customer portal alias: Customer.Appointments.InsuranceAmount.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
appointment_type_idpost | int | 697 | doctor_appointments_type id. Aliases: coupon_appo_type_id, appo_type_id. |
insurancepost | int | 2 | appointment_insurance_company id. Aliases: coupon_insurance_company, insurance_id. |
Optional Parameters
No optional body parameters are defined for this function.
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/AppointmentCoupon.InsuranceAmount",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"appointment_type_id": "697",
"insurance": "2"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/AppointmentCoupon.InsuranceAmount",
"url_domain": "https:\/\/{domain}\/app\/AppointmentCoupon.InsuranceAmount"
}Endpoint
POST /app/AppointmentCoupon.InsuranceAmount
POST https://{user}.bull36.com/app/AppointmentCoupon.InsuranceAmount
POST https://{domain}/app/AppointmentCoupon.InsuranceAmountSample Output
{
"success": 1,
"message": "Success",
"amount": 100,
"left_amount": 50,
"data": {
"insurance_id": 2,
"insurance_price": 100,
"insurance_customer_price": 50,
"amount": 100,
"left_amount": 50
}
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ appointment_type_id: '697', insurance: '2' });
const res = await fetch('/app/AppointmentCoupon.InsuranceAmount', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());Error Example
{
"success": 0,
"message": "No insurance price configured for this appointment type"
}