POST

Customer.Appointments.Coupons

List appointment coupons for the logged-in customer (Apply Coupon modal). Same query as dashboard get_customer_coupon_for_appointment for this cust_id.

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 Customer.Appointments.Coupons 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

  • Requires Customer.Login token. Only returns coupons where cust_id = JWT c_id.
  • Use status=unused to show only apply-able coupons. Then call Customer.Appointments.ApplyCoupon / AppointmentCoupon.Apply with selected ids.
  • Add/Edit/Delete: Customer.Appointments.Coupon.Add, .Edit, .Delete (cust_id from JWT). Staff remains AppointmentCoupon.*.

Required Parameters

No body parameters are required for this function.

Optional Parameters

NameTypeSampleWhat it gives
status
post
stringunusedOptional. unused|used or 0|1. Alias: coupon_status.
lang
post
stringenOptional insurance name language.

Authentication

Send the bearer token returned by Login in the request header.

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Customer.Appointments.Coupons",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "status": "unused"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Customer.Appointments.Coupons",
    "url_domain": "https:\/\/{domain}\/app\/Customer.Appointments.Coupons"
}

Endpoint

POST /app/Customer.Appointments.Coupons
POST https://{user}.bull36.com/app/Customer.Appointments.Coupons
POST https://{domain}/app/Customer.Appointments.Coupons

Sample Output

{
    "success": 1,
    "count": 1,
    "data": [
        {
            "id": 388,
            "coupon_code": "12345",
            "amount": "100",
            "left_amount": "50",
            "status_label": "unused",
            "can_apply": true,
            "can_edit": true,
            "can_delete": true
        }
    ]
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('status', 'unused');

const res = await fetch('/app/Customer.Appointments.Coupons', {
  method: 'POST',
  headers: { Authorization: `Bearer ${token}` },
  body
});
const data = await res.json();
console.log(data);

Error Example

{
    "success": 0,
    "error": "customer_login_required"
}