List discounts
curl --request GET \
--url https://sandboxapi.kelviq.com/api/v1/discount/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandboxapi.kelviq.com/api/v1/discount/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandboxapi.kelviq.com/api/v1/discount/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.kelviq.com/api/v1/discount/",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.kelviq.com/api/v1/discount/"
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))
}HttpResponse<String> response = Unirest.get("https://sandboxapi.kelviq.com/api/v1/discount/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.kelviq.com/api/v1/discount/")
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{
"count": 123,
"next": "<string>",
"previous": "<string>",
"results": [
{
"id": "b3f1a2c4-5d6e-4f7a-8b9c-0d1e2f3a4b5c",
"discountType": "PERCENTAGE",
"amountOff": "10.00",
"percentageOff": 20,
"currency": "usd",
"currencySymbol": "$",
"name": "Summer Sale",
"code": "SUMMER20",
"duration": "ONCE",
"durationInMonths": 123,
"redeemBy": "2023-11-07T05:31:56Z",
"maxRedemptions": 123,
"timesRedeemed": 123,
"appliesTo": [
{
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"plans": [
{
"identifier": "<string>",
"name": "<string>"
}
]
}
],
"isActive": true
}
]
}Discounts
List discounts
Returns a paginated list of active, non-archived discounts for the authenticated organization, newest first.
GET
/
discount
/
List discounts
curl --request GET \
--url https://sandboxapi.kelviq.com/api/v1/discount/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandboxapi.kelviq.com/api/v1/discount/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandboxapi.kelviq.com/api/v1/discount/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.kelviq.com/api/v1/discount/",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.kelviq.com/api/v1/discount/"
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))
}HttpResponse<String> response = Unirest.get("https://sandboxapi.kelviq.com/api/v1/discount/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.kelviq.com/api/v1/discount/")
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{
"count": 123,
"next": "<string>",
"previous": "<string>",
"results": [
{
"id": "b3f1a2c4-5d6e-4f7a-8b9c-0d1e2f3a4b5c",
"discountType": "PERCENTAGE",
"amountOff": "10.00",
"percentageOff": 20,
"currency": "usd",
"currencySymbol": "$",
"name": "Summer Sale",
"code": "SUMMER20",
"duration": "ONCE",
"durationInMonths": 123,
"redeemBy": "2023-11-07T05:31:56Z",
"maxRedemptions": 123,
"timesRedeemed": 123,
"appliesTo": [
{
"product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"plans": [
{
"identifier": "<string>",
"name": "<string>"
}
]
}
],
"isActive": true
}
]
}Click the base URL in the API playground and select the Sandbox host for test data or the Production host for live data. Use credentials from the same environment.
Authorizations
The Server API Key obtained from the kelviq application. Pass as a Bearer token in the Authorization header. Example: 'Authorization: Bearer YOUR_API_KEY'
Query Parameters
Free-text search across the discount's name and code.
Number of results per page. Defaults to 10, maximum 100.
Required range:
1 <= x <= 100Page number to return.
Required range:
x >= 1