List all coupons
curl --request GET \
--url https://core.nozle.app/api/v1/coupons \
--header 'Authorization: Bearer <token>'import requests
url = "https://core.nozle.app/api/v1/coupons"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.nozle.app/api/v1/coupons', 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"
req, _ := http.NewRequest("GET", 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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.get("https://core.nozle.app/api/v1/coupons")
.header("Authorization", "Bearer <token>")
.asString();{
"meta": {
"current_page": 2,
"total_pages": 4,
"total_count": 70,
"next_page": 3,
"prev_page": 1
},
"coupons": [
{
"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"
}Coupons
List all coupons
This endpoint is used to list all existing coupons.
GET
/
coupons
List all coupons
curl --request GET \
--url https://core.nozle.app/api/v1/coupons \
--header 'Authorization: Bearer <token>'import requests
url = "https://core.nozle.app/api/v1/coupons"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.nozle.app/api/v1/coupons', 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"
req, _ := http.NewRequest("GET", 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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.get("https://core.nozle.app/api/v1/coupons")
.header("Authorization", "Bearer <token>")
.asString();{
"meta": {
"current_page": 2,
"total_pages": 4,
"total_count": 70,
"next_page": 3,
"prev_page": 1
},
"coupons": [
{
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Page number.
Example:
1
Number of records per page.
Example:
20