List Discounts
curl --request GET \
--url https://api.launchmystore.io/api/v1/discounts.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/discounts.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/discounts.json', 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://api.launchmystore.io/api/v1/discounts.json",
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://api.launchmystore.io/api/v1/discounts.json"
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://api.launchmystore.io/api/v1/discounts.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/discounts.json")
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{
"status": 123,
"state": "<string>",
"message": "<string>",
"data.discounts": [
{
"couponId": "<string>",
"code": "<string>",
"type": "<string>",
"status": "<string>",
"discountPercentage": 123,
"discountAmount": 123,
"minOrderTotal": 123,
"totalCoupons": 123,
"usedCount": 123,
"usesPerCustomer": 123,
"applyOnProducts": [
{}
],
"startDate": "<string>",
"endDate": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"data.total": 123,
"data.page": 123,
"data.limit": 123
}Discounts
List Discounts
Retrieve a list of discount codes
GET
/
api
/
v1
/
discounts.json
List Discounts
curl --request GET \
--url https://api.launchmystore.io/api/v1/discounts.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/discounts.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/discounts.json', 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://api.launchmystore.io/api/v1/discounts.json",
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://api.launchmystore.io/api/v1/discounts.json"
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://api.launchmystore.io/api/v1/discounts.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/discounts.json")
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{
"status": 123,
"state": "<string>",
"message": "<string>",
"data.discounts": [
{
"couponId": "<string>",
"code": "<string>",
"type": "<string>",
"status": "<string>",
"discountPercentage": 123,
"discountAmount": 123,
"minOrderTotal": 123,
"totalCoupons": 123,
"usedCount": 123,
"usesPerCustomer": 123,
"applyOnProducts": [
{}
],
"startDate": "<string>",
"endDate": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"data.total": 123,
"data.page": 123,
"data.limit": 123
}List Discounts
Returns a paginated list of discount codes in the store.Request
curl -X GET "https://api.launchmystore.io/api/v1/discounts.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Parameters
Page number for pagination
Number of items per page
Filter by status:
active, expired, scheduled, disabledSearch by discount code (partial, case-insensitive match)
Response
Returns the standard response envelope. Thedata object contains the
discount rows plus flat pagination counters.
HTTP status code (e.g.
200)Response state:
success or errorHuman-readable message (
null on success)Array of discount objects
Show Discount Object
Show Discount Object
Unique discount ID (UUID)
Discount code (e.g., “SUMMER20”)
Discount type:
Percentage, Flat, FreeShipping, BuyXGetY, FreebieCurrent status:
Active or InactivePercentage value (set when
type is Percentage, otherwise null)Flat discount amount (set when
type is Flat, otherwise null)Minimum order total required for the discount to apply
Maximum number of uses (
0 for unlimited)Number of times the discount has been used
Uses allowed per customer (
null for unlimited)Product IDs the discount is scoped to
Start date
End date (
null for no end date)Creation timestamp (ISO 8601)
Last update timestamp (ISO 8601)
Total number of matching discounts
Current page number
Page size used for this request
Example Response
{
"status": 200,
"state": "success",
"message": null,
"data": {
"discounts": [
{
"couponId": "f73049dc-b4d4-4f85-99c2-681a5e351a8a",
"code": "SUMMER20",
"type": "Percentage",
"status": "Active",
"discountPercentage": 20,
"discountAmount": null,
"minOrderTotal": 50,
"totalCoupons": 500,
"usedCount": 145,
"usesPerCustomer": 1,
"applyOnProducts": [],
"startDate": "2024-06-01T00:00:00Z",
"endDate": "2024-08-31T23:59:59Z",
"createdAt": "2024-05-15T10:00:00Z",
"updatedAt": "2024-07-01T14:30:00Z"
},
{
"couponId": "a912c0de-1f44-4c0a-9b2e-2f1d77c3e110",
"code": "FREESHIP",
"type": "FreeShipping",
"status": "Active",
"discountPercentage": null,
"discountAmount": null,
"minOrderTotal": 75,
"totalCoupons": 0,
"usedCount": 89,
"usesPerCustomer": null,
"applyOnProducts": [],
"startDate": "2024-01-01T00:00:00Z",
"endDate": null,
"createdAt": "2024-01-01T08:00:00Z",
"updatedAt": "2024-01-01T08:00:00Z"
}
],
"total": 15,
"page": 1,
"limit": 50
},
"count": null,
"pagination": null
}
Error Response
Errors return the same envelope with anerror state and the message under
message:
{
"status": 500,
"state": "error",
"message": "Something went wrong",
"data": null
}
⌘I