POST
AppointmentCouponReport.List
List appointment coupons for the logged-in organization (Advance → Appointment Coupon Report). Returns structured rows with customer name, appointment type, insurance, amounts, status, and document PDF URL. Filters match the dashboard coupon report.
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
- Returns AppointmentCouponReport rows as JSON.
- Supports the documented filters and paging fields.
- List responses are capped at 25 rows per call.
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
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- Send parameters as POST body fields exactly as documented.
- For paging, do not request more than 25 rows.
- For total rows, call the matching Count function with the same filters.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
coupon_codepost | string | CPN-100 | Filter by coupon code (LIKE). |
cust_namepost | string | nidhi | Filter by customer name. Alias: customer_name, search. |
customer_idpost | int | 123 | Filter by customer id. Aliases: cust_id, data_c_id. |
appointment_type_idpost | int | 5 | Filter by doctor_appointments_type id. |
coupon_statuspost | string | unused | used, unused, 0, or 1. |
coupon_insurancepost | int | 2 | Insurance company id. Alias: insurance. |
from_amtpost | number | 0 | Minimum coupon amount. |
to_amtpost | number | 500 | Maximum coupon amount. |
from_left_amtpost | number | 0 | Minimum left amount. |
to_left_amtpost | number | 100 | Maximum left amount. |
page_idpost | int | 1 | 1-based page. |
limitpost | int | 10 | Page size, capped at 25. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/AppointmentCouponReport.List",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"coupon_status": "unused",
"page_id": "1",
"limit": "10"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/AppointmentCouponReport.List",
"url_domain": "https:\/\/{domain}\/app\/AppointmentCouponReport.List"
}Endpoint
POST /app/AppointmentCouponReport.List
POST https://{user}.bull36.com/app/AppointmentCouponReport.List
POST https://{domain}/app/AppointmentCouponReport.ListSample Output
{
"success": 1,
"count": 1,
"recordsTotal": 12,
"data": [
{
"id": 388,
"coupon_code": "CPN-100",
"customer_name": "nidhi",
"appointment_type_name": "Consultation",
"amount": "100",
"left_amount": "50",
"status_label": "unused"
}
]
}Count Only
Use the matching count route with the same filters when the UI only needs total rows for paging.
{
"url": "\/app\/AppointmentCouponReport.Count",
"url_user": "https:\/\/{user}.bull36.com\/app\/AppointmentCouponReport.Count",
"url_domain": "https:\/\/{domain}\/app\/AppointmentCouponReport.Count",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"coupon_status": "unused"
},
"sample_output": {
"success": 1,
"count": 123
},
"notes": {
"count": "Use the matching count route when available, or count returned rows.",
"max_limit": 25
}
}Count JavaScript
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('coupon_status', 'unused');
const res = await fetch('https://{domain}/app/AppointmentCouponReport.Count', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data.count);JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ coupon_status: 'unused', limit: '10' });
const res = await fetch('/app/AppointmentCouponReport.List', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());Error Example
{
"success": "0",
"error": "bearer_token_required",
"message": "Authorization bearer token is required. Send header: Authorization: Bearer YOUR TOKEN"
}