Coupons
Coupons are used to provide discounts and special offers to customers. These coupons can be applied to a subscription at any time.
Attribute
one_time, duration, forever.active, inactive, expired or maxed_outflat or percentage.discount_by, it can be flat discount or a percentage value. Discount will be deducted from the plans/addons the coupon is associated with.maxed_out once this limit is reached.type=forever already applied to subscriptions can still be redeemed.all, none or select.apply_to_plans is set to be selected. Only the plan codes of the plans that need to be associated with the coupon are required.all_addons, all_recurring,all_onetime, none or select.apply_to_addons is set to be selected. Only the addon codes of the addons that need to be associated with the coupon are required.{
    "coupon_code": "THANKSGIVING20",
    "name": "Thanksgiving 20 percent offer",
    "description": "Twenty percent offer for thanks giving.",
    "type": "duration",
    "duration": 2,
    "status": "active",
    "discount_by": "percentage",
    "discount_value": 20,
    "product_id": "903000000045027",
    "max_redemption": 50,
    "redemption_count": 10,
    "expiry_at": "2016-08-28",
    "apply_to_plans": "select",
    "plans": [
        {
            "plan_code": "basic-monthly",
            "name": "Basic"
        }
    ],
    "apply_to_addons": "select",
    "addons": [
        {
            "addon_code": "Email-basic",
            "name": "Email Basic"
        }
    ],
    "created_time": "2016-06-05T18:02:26-0700",
    "updated_time": "2016-06-05T18:02:26-0700"
}
          Create an coupon
            Create a new coupon.
              
              OAuth Scope : ZohoSubscriptions.coupons.CREATE
          
Arguments
one_time, duration, forever.flat or percentage.discount_by, it can be flat discount or a percentage value. Discount will be deducted from the plans/addons the coupon is associated with.maxed_out once this limit is reached.type=forever already applied to subscriptions can still be redeemed.all, none or select. apply_to_plans  is selected
            apply_to_plans is set to be selected. Only the plan codes of the plans that need to be associated with the coupon are required.all_addons, all_recurring,all_onetime, none or select. apply_to_addons  is selected
            apply_to_addons is set to be selected. Only the addon codes of the addons that need to be associated with the coupon are required.Headers
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/coupons"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
              OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
  .url("https://www.zohoapis.com/billing/v1/coupons")
  .post(body)
  .addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();
Response response = client.newCall(request).execute();
              const options = {
  method: 'POST',
  headers: {
    'X-com-zoho-subscriptions-organizationid': '10234695',
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/billing/v1/coupons', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
              import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
    'X-com-zoho-subscriptions-organizationid': "10234695",
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }
conn.request("POST", "/billing/v1/coupons", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
              const http = require("https");
const options = {
  "method": "POST",
  "hostname": "www.zohoapis.com",
  "port": null,
  "path": "/billing/v1/coupons",
  "headers": {
    "X-com-zoho-subscriptions-organizationid": "10234695",
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    "content-type": "application/json"
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
              curl --request POST \
  --url https://www.zohoapis.com/billing/v1/coupons \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'X-com-zoho-subscriptions-organizationid: 10234695' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
              {
    "coupon_code": "THANKSGIVING20",
    "name": "Thanksgiving 20 percent offer",
    "description": "Twenty percent offer for thanks giving.",
    "type": "duration",
    "duration": 2,
    "discount_by": "percentage",
    "discount_value": 20,
    "product_id": "903000000045027",
    "max_redemption": 50,
    "expiry_at": "2016-08-28",
    "apply_to_plans": "select",
    "plans": [
        {
            "plan_code": "basic-monthly"
        }
    ],
    "apply_to_addons": "select",
    "addons": [
        {
            "addon_code": "Email-basic"
        }
    ]
}
            {
    "code": 0,
    "message": "The coupon has been created",
    "coupon": {
        "coupon_code": "THANKSGIVING20",
        "name": "Thanksgiving 20 percent offer",
        "description": "Twenty percent offer for thanks giving.",
        "type": "duration",
        "duration": 2,
        "status": "active",
        "discount_by": "percentage",
        "discount_value": 20,
        "product_id": "903000000045027",
        "max_redemption": 50,
        "redemption_count": 10,
        "expiry_at": "2016-08-28",
        "apply_to_plans": "select",
        "plans": [
            {
                "plan_code": "basic-monthly",
                "name": "Basic"
            }
        ],
        "apply_to_addons": "select",
        "addons": [
            {
                "addon_code": "Email-basic",
                "name": "Email Basic"
            }
        ],
        "created_time": "2016-06-05T18:02:26-0700",
        "updated_time": "2016-06-05T18:02:26-0700"
    }
}
                List all coupons
            List of all coupons.
              
              OAuth Scope : ZohoSubscriptions.coupons.READ
          
Query Parameters
filter_by. The allowed values for filter_by are CouponStatus.(All, ACTIVE, INACTIVE and EXPIRED).product_id.Headers
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/coupons"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
              OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
  .url("https://www.zohoapis.com/billing/v1/coupons")
  .get()
  .addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();
Response response = client.newCall(request).execute();
              const options = {
  method: 'GET',
  headers: {
    'X-com-zoho-subscriptions-organizationid': '10234695',
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};
fetch('https://www.zohoapis.com/billing/v1/coupons', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
              import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
    'X-com-zoho-subscriptions-organizationid': "10234695",
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
    }
conn.request("GET", "/billing/v1/coupons", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
              const http = require("https");
const options = {
  "method": "GET",
  "hostname": "www.zohoapis.com",
  "port": null,
  "path": "/billing/v1/coupons",
  "headers": {
    "X-com-zoho-subscriptions-organizationid": "10234695",
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.end();
              curl --request GET \
  --url https://www.zohoapis.com/billing/v1/coupons \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'X-com-zoho-subscriptions-organizationid: 10234695'
              {
    "code": 0,
    "message": "success",
    "coupons": [
        {
            "coupon_code": "THANKSGIVING20",
            "name": "Thanksgiving 20 percent offer",
            "description": "Twenty percent offer for thanks giving.",
            "type": "duration",
            "status": "active",
            "discount_by": "percentage",
            "discount_value": 20,
            "product_id": "903000000045027",
            "max_redemption": 50,
            "redemption_count": 10,
            "expiry_at": "2016-08-28",
            "created_time": "2016-06-05T18:02:26-0700",
            "updated_time": "2016-06-05T18:02:26-0700"
        },
        {...},
        {...}
    ]
}
                Update a coupon
            Update details of an existing coupon.
              
              OAuth Scope : ZohoSubscriptions.coupons.UPDATE
          
Arguments
maxed_out once this limit is reached.type=forever already applied to subscriptions can still be redeemed.Path Parameters
Headers
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
              OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
  .url("https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20")
  .put(body)
  .addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();
Response response = client.newCall(request).execute();
              const options = {
  method: 'PUT',
  headers: {
    'X-com-zoho-subscriptions-organizationid': '10234695',
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
              import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
    'X-com-zoho-subscriptions-organizationid': "10234695",
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }
conn.request("PUT", "/billing/v1/coupons/THANKSGIVING20", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
              const http = require("https");
const options = {
  "method": "PUT",
  "hostname": "www.zohoapis.com",
  "port": null,
  "path": "/billing/v1/coupons/THANKSGIVING20",
  "headers": {
    "X-com-zoho-subscriptions-organizationid": "10234695",
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    "content-type": "application/json"
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
              curl --request PUT \
  --url https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20 \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'X-com-zoho-subscriptions-organizationid: 10234695' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
              {
    "name": "Thanksgiving 20 percent offer",
    "description": "Twenty percent offer for thanks giving.",
    "max_redemption": 50,
    "expiry_at": "2016-08-28"
}
            {
    "code": 0,
    "message": "The coupon details have been updated.",
    "coupon": {
        "coupon_code": "THANKSGIVING20",
        "name": "Thanksgiving 20 percent offer",
        "description": "Twenty percent offer for thanks giving.",
        "type": "duration",
        "duration": 2,
        "status": "active",
        "discount_by": "percentage",
        "discount_value": 20,
        "product_id": "903000000045027",
        "max_redemption": 50,
        "redemption_count": 10,
        "expiry_at": "2016-08-28",
        "apply_to_plans": "select",
        "plans": [
            {
                "plan_code": "basic-monthly",
                "name": "Basic"
            }
        ],
        "apply_to_addons": "select",
        "addons": [
            {
                "addon_code": "Email-basic",
                "name": "Email Basic"
            }
        ],
        "created_time": "2016-06-05T18:02:26-0700",
        "updated_time": "2016-06-05T18:02:26-0700"
    }
}
                Retrieve a coupon
            Details of an existing coupon.
              
              OAuth Scope : ZohoSubscriptions.coupons.READ
          
Path Parameters
Headers
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
              OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
  .url("https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20")
  .get()
  .addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();
Response response = client.newCall(request).execute();
              const options = {
  method: 'GET',
  headers: {
    'X-com-zoho-subscriptions-organizationid': '10234695',
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};
fetch('https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
              import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
    'X-com-zoho-subscriptions-organizationid': "10234695",
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
    }
conn.request("GET", "/billing/v1/coupons/THANKSGIVING20", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
              const http = require("https");
const options = {
  "method": "GET",
  "hostname": "www.zohoapis.com",
  "port": null,
  "path": "/billing/v1/coupons/THANKSGIVING20",
  "headers": {
    "X-com-zoho-subscriptions-organizationid": "10234695",
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.end();
              curl --request GET \
  --url https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20 \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'X-com-zoho-subscriptions-organizationid: 10234695'
              {
    "code": 0,
    "message": "success",
    "coupon": {
        "coupon_code": "THANKSGIVING20",
        "name": "Thanksgiving 20 percent offer",
        "description": "Twenty percent offer for thanks giving.",
        "type": "duration",
        "duration": 2,
        "status": "active",
        "discount_by": "percentage",
        "discount_value": 20,
        "product_id": "903000000045027",
        "max_redemption": 50,
        "redemption_count": 10,
        "expiry_at": "2016-08-28",
        "apply_to_plans": "select",
        "plans": [
            {
                "plan_code": "basic-monthly",
                "name": "Basic"
            }
        ],
        "apply_to_addons": "select",
        "addons": [
            {
                "addon_code": "Email-basic",
                "name": "Email Basic"
            }
        ],
        "created_time": "2016-06-05T18:02:26-0700",
        "updated_time": "2016-06-05T18:02:26-0700"
    }
}
                Delete a coupon
            Delete an existing coupon.
              
              OAuth Scope : ZohoSubscriptions.coupons.DELETE
          
Path Parameters
Headers
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20"
type: DELETE
headers: headers_data
connection: <connection_name>
];
info response;
              OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
  .url("https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20")
  .delete(null)
  .addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();
Response response = client.newCall(request).execute();
              const options = {
  method: 'DELETE',
  headers: {
    'X-com-zoho-subscriptions-organizationid': '10234695',
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};
fetch('https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
              import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
    'X-com-zoho-subscriptions-organizationid': "10234695",
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
    }
conn.request("DELETE", "/billing/v1/coupons/THANKSGIVING20", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
              const http = require("https");
const options = {
  "method": "DELETE",
  "hostname": "www.zohoapis.com",
  "port": null,
  "path": "/billing/v1/coupons/THANKSGIVING20",
  "headers": {
    "X-com-zoho-subscriptions-organizationid": "10234695",
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.end();
              curl --request DELETE \
  --url https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20 \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'X-com-zoho-subscriptions-organizationid: 10234695'
              {
    "code": 0,
    "message": "The coupon has been deleted."
}
                Mark as active
            status of the coupon will be changed to active.
              
              OAuth Scope : ZohoSubscriptions.coupons.CREATE
          
Path Parameters
Headers
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasactive"
type: POST
headers: headers_data
connection: <connection_name>
];
info response;
              OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
  .url("https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasactive")
  .post(null)
  .addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();
Response response = client.newCall(request).execute();
              const options = {
  method: 'POST',
  headers: {
    'X-com-zoho-subscriptions-organizationid': '10234695',
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};
fetch('https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasactive', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
              import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
    'X-com-zoho-subscriptions-organizationid': "10234695",
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
    }
conn.request("POST", "/billing/v1/coupons/THANKSGIVING20/markasactive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
              const http = require("https");
const options = {
  "method": "POST",
  "hostname": "www.zohoapis.com",
  "port": null,
  "path": "/billing/v1/coupons/THANKSGIVING20/markasactive",
  "headers": {
    "X-com-zoho-subscriptions-organizationid": "10234695",
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.end();
              curl --request POST \
  --url https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasactive \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'X-com-zoho-subscriptions-organizationid: 10234695'
              {
    "code": 0,
    "message": "The coupon has been marked as active."
}
                Mark as inactive
            status of the coupon will be changed to inactive.
              
              OAuth Scope : ZohoSubscriptions.coupons.CREATE
          
Path Parameters
Headers
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasinactive"
type: POST
headers: headers_data
connection: <connection_name>
];
info response;
              OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
  .url("https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasinactive")
  .post(null)
  .addHeader("X-com-zoho-subscriptions-organizationid", "10234695")
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();
Response response = client.newCall(request).execute();
              const options = {
  method: 'POST',
  headers: {
    'X-com-zoho-subscriptions-organizationid': '10234695',
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};
fetch('https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasinactive', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
              import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
    'X-com-zoho-subscriptions-organizationid': "10234695",
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
    }
conn.request("POST", "/billing/v1/coupons/THANKSGIVING20/markasinactive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
              const http = require("https");
const options = {
  "method": "POST",
  "hostname": "www.zohoapis.com",
  "port": null,
  "path": "/billing/v1/coupons/THANKSGIVING20/markasinactive",
  "headers": {
    "X-com-zoho-subscriptions-organizationid": "10234695",
    "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
  }
};
const req = http.request(options, function (res) {
  const chunks = [];
  res.on("data", function (chunk) {
    chunks.push(chunk);
  });
  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});
req.end();
              curl --request POST \
  --url https://www.zohoapis.com/billing/v1/coupons/THANKSGIVING20/markasinactive \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'X-com-zoho-subscriptions-organizationid: 10234695'
              {
    "code": 0,
    "message": "The coupon has been marked as inactive."
}