Skip to main content
GET
/
v1
/
discounts
/
search
Search discounts
curl --request GET \
  --url https://api.creem.io/v1/discounts/search \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.creem.io/v1/discounts/search"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.creem.io/v1/discounts/search', 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.creem.io/v1/discounts/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

$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.creem.io/v1/discounts/search"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<api-key>")

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.creem.io/v1/discounts/search")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.creem.io/v1/discounts/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "id": "<string>",
      "object": "discount",
      "status": "active",
      "name": "Holiday Sale",
      "code": "HOLIDAY2024",
      "type": "percentage",
      "amount": 20,
      "currency": "USD",
      "percentage": 15,
      "expiry_date": "2024-12-31T23:59:59Z",
      "max_redemptions": 100,
      "duration": "repeating",
      "duration_in_months": 6,
      "applies_to_products": [
        "prod_123",
        "prod_456"
      ],
      "redeem_count": 15
    }
  ],
  "pagination": {
    "total_records": 0,
    "total_pages": 0,
    "current_page": 1,
    "next_page": 2,
    "prev_page": null
  }
}

Authorizations

x-api-key
string
header
required

API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.

Query Parameters

page_number
number
default:1

The page number for pagination.

Example:

1

page_size
number
default:10

The number of items per page.

Example:

10

product_id
string

Filter discounts that apply to a specific product.

Example:

"prod_1234567890"

status
enum<string>

Filter by discount status.

Available options:
active,
deleted
type
enum<string>

Filter by discount type.

Available options:
percentage,
fixed
created_after
string

Filter discounts created after this date.

Example:

"2024-01-01T00:00:00Z"

created_before
string

Filter discounts created before this date.

Example:

"2024-12-31T23:59:59Z"

Response

Successfully retrieved the list of discounts

items
object[]
required

List of discount items

pagination
object
required

Pagination details for the list