Delete a coupon
curl --request DELETE \
--url https://core.nozle.app/api/v1/coupons/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://core.nozle.app/api/v1/coupons/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.nozle.app/api/v1/coupons/{code}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://core.nozle.app/api/v1/coupons/{code}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://core.nozle.app/api/v1/coupons/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.nozle.app/api/v1/coupons/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://core.nozle.app/api/v1/coupons/{code}")
.header("Authorization", "Bearer <token>")
.asString();{
"coupon": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "Startup Deal",
"code": "startup_deal",
"coupon_type": "fixed_amount",
"reusable": true,
"limited_plans": true,
"limited_features": false,
"frequency": "recurring",
"expiration": "time_limit",
"created_at": "2022-04-29T08:59:51Z",
"description": "I am a coupon description",
"amount_cents": 5000,
"amount_currency": "USD",
"plan_codes": [
"startup_plan"
],
"feature_codes": [],
"percentage_rate": null,
"frequency_duration": 6,
"expiration_at": "2022-08-08T23:59:59Z",
"terminated_at": "2022-08-08T23:59:59Z"
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}Coupons
Delete a coupon
This endpoint is used to delete a coupon.
DELETE
/
coupons
/
{code}
Delete a coupon
curl --request DELETE \
--url https://core.nozle.app/api/v1/coupons/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://core.nozle.app/api/v1/coupons/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.nozle.app/api/v1/coupons/{code}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://core.nozle.app/api/v1/coupons/{code}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://core.nozle.app/api/v1/coupons/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.nozle.app/api/v1/coupons/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://core.nozle.app/api/v1/coupons/{code}")
.header("Authorization", "Bearer <token>")
.asString();{
"coupon": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "Startup Deal",
"code": "startup_deal",
"coupon_type": "fixed_amount",
"reusable": true,
"limited_plans": true,
"limited_features": false,
"frequency": "recurring",
"expiration": "time_limit",
"created_at": "2022-04-29T08:59:51Z",
"description": "I am a coupon description",
"amount_cents": 5000,
"amount_currency": "USD",
"plan_codes": [
"startup_plan"
],
"feature_codes": [],
"percentage_rate": null,
"frequency_duration": 6,
"expiration_at": "2022-08-08T23:59:59Z",
"terminated_at": "2022-08-08T23:59:59Z"
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}