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.
  • The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
  • 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.
  • On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
  • 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

NameTypeSampleWhat it gives
coupon_code
post
stringCPN-100Filter by coupon code (LIKE).
cust_name
post
stringnidhiFilter by customer name. Alias: customer_name, search.
customer_id
post
int123Filter by customer id. Aliases: cust_id, data_c_id.
appointment_type_id
post
int5Filter by doctor_appointments_type id.
coupon_status
post
stringunusedused, unused, 0, or 1.
coupon_insurance
post
int2Insurance company id. Alias: insurance.
from_amt
post
number0Minimum coupon amount.
to_amt
post
number500Maximum coupon amount.
from_left_amt
post
number0Minimum left amount.
to_left_amt
post
number100Maximum left amount.
page_id
post
int11-based page.
limit
post
int10Page size, capped at 25.

Authentication

Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).

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.List

Sample 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"
}