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
integer
default:"1"
Page number for pagination
integer
default:"50"
Number of items per page
string
Filter by status:
active, expired, scheduled, disabledstring
Search by discount code (partial, case-insensitive match)
Response
Returns the standard response envelope. Thedata object contains the
discount rows plus flat pagination counters.
integer
HTTP status code (e.g.
200)string
Response state:
success or errorstring
Human-readable message (
null on success)array
Array of discount objects
Show Discount Object
Show Discount Object
string
Unique discount ID (UUID)
string
Discount code (e.g., “SUMMER20”)
string
Discount type:
Percentage, Flat, FreeShipping, BuyXGetY, Freebiestring
Current status:
Active or Inactivenumber
Percentage value (set when
type is Percentage, otherwise null)number
Flat discount amount (set when
type is Flat, otherwise null)number
Minimum order total required for the discount to apply
integer
Maximum number of uses (
0 for unlimited)integer
Number of times the discount has been used
integer
Uses allowed per customer (
null for unlimited)array
Product IDs the discount is scoped to
string
Start date
string
End date (
null for no end date)string
Creation timestamp (ISO 8601)
string
Last update timestamp (ISO 8601)
integer
Total number of matching discounts
integer
Current page number
integer
Page size used for this request
Example Response
{
"status": 200,
"state": "success",
"message": null,
"data": {
"discounts": [
{
"couponId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"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
}