Retrieve all promotions
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions', 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://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions",
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://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions"
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://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions")
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{
"message": "<string>",
"success": true,
"content": {
"promotions": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"redemption_count": 123,
"minimum_order_total": 0,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "<string>",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": [
"<string>"
]
},
"can_be_used_with_other_promotion": true
}
]
}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}Coupons & Promotions
Retrieve all promotions
All active promotions
GET
/
carts
/
available-promotions
Retrieve all promotions
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions', 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://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions",
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://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions"
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://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/carts/available-promotions")
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{
"message": "<string>",
"success": true,
"content": {
"promotions": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"redemption_limits": {
"total_redemptions": 123,
"per_customer_redemptions": 123,
"per_coupon_code_redemptions": 123
},
"redemption_count": 123,
"minimum_order_total": 0,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"details": {
"discount_type": "<string>",
"discount_percent": 123,
"maximum_discount_amount": 123,
"products": [
{
"product_id": "<string>",
"variant_id": "<string>",
"minimum_quantity": 123,
"maximum_quantity": 123,
"minimum_value": 123,
"maximum_value": 123
}
],
"category_id": [
"<string>"
]
},
"can_be_used_with_other_promotion": true
}
]
}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}Authorizations
Access token
Headers
This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned.
Was this page helpful?
⌘I