curl -X GET "https://api.chariow.com/v1/discounts?status=active&per_page=20" \
-H "Authorization: Bearer sk_live_your_api_key"
const response = await fetch('https://api.chariow.com/v1/discounts?status=active&per_page=20', {
headers: {
'Authorization': 'Bearer sk_live_your_api_key'
}
});
const { message, data } = await response.json();
$ch = curl_init('https://api.chariow.com/v1/discounts?status=active&per_page=20');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_live_your_api_key'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
import requests
response = requests.get(
'https://api.chariow.com/v1/discounts',
params={'status': 'active', 'per_page': 20},
headers={'Authorization': 'Bearer sk_live_your_api_key'}
)
data = response.json()['data']
{
"message": "success",
"data": {
"data": [
{
"id": "dis_abc123xyz",
"name": "Summer Sale",
"code": "SUMMER20",
"type": "percentage",
"status": "active",
"value_off": {
"raw": 20,
"formatted": "20%"
},
"products": [
{
"id": "prd_def456",
"name": "Premium Course",
"type": "course",
"pictures": {
"thumbnail": "https://cdn.chariow.com/thumb.jpg",
"cover": "https://cdn.chariow.com/cover.jpg"
},
"category": {
"value": "education",
"label": "Education"
},
"pricing": {
"type": "one_time",
"price": {
"value": 9999,
"formatted": "$99.99",
"short": "100",
"currency": "USD"
}
},
"bundle": null
}
],
"store": {
"id": "str_xyz789",
"name": "My Store"
},
"customer_email": null,
"usage_limit": 100,
"usage_count": 15,
"start_date": "2025-01-01T00:00:00+00:00",
"end_date": "2025-12-31T23:59:59+00:00",
"is_auto_generated": false,
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-15T10:30:00+00:00"
},
{
"id": "dis_def456abc",
"name": "VIP Discount",
"code": "VIP50",
"type": "fixed",
"status": "active",
"value_off": {
"raw": 50,
"formatted": "$50.00"
},
"products": [],
"store": {
"id": "str_xyz789",
"name": "My Store"
},
"customer_email": "vip@example.com",
"usage_limit": 1,
"usage_count": 0,
"start_date": null,
"end_date": null,
"is_auto_generated": false,
"created_at": "2025-01-10T08:00:00+00:00",
"updated_at": "2025-01-10T08:00:00+00:00"
}
],
"pagination": {
"next_cursor": "eyJpZCI6NTB9",
"prev_cursor": null,
"has_more": true
}
},
"errors": []
}
Discounts
List Discounts
Retrieve all discount codes from your store
curl -X GET "https://api.chariow.com/v1/discounts?status=active&per_page=20" \
-H "Authorization: Bearer sk_live_your_api_key"
const response = await fetch('https://api.chariow.com/v1/discounts?status=active&per_page=20', {
headers: {
'Authorization': 'Bearer sk_live_your_api_key'
}
});
const { message, data } = await response.json();
$ch = curl_init('https://api.chariow.com/v1/discounts?status=active&per_page=20');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_live_your_api_key'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
import requests
response = requests.get(
'https://api.chariow.com/v1/discounts',
params={'status': 'active', 'per_page': 20},
headers={'Authorization': 'Bearer sk_live_your_api_key'}
)
data = response.json()['data']
{
"message": "success",
"data": {
"data": [
{
"id": "dis_abc123xyz",
"name": "Summer Sale",
"code": "SUMMER20",
"type": "percentage",
"status": "active",
"value_off": {
"raw": 20,
"formatted": "20%"
},
"products": [
{
"id": "prd_def456",
"name": "Premium Course",
"type": "course",
"pictures": {
"thumbnail": "https://cdn.chariow.com/thumb.jpg",
"cover": "https://cdn.chariow.com/cover.jpg"
},
"category": {
"value": "education",
"label": "Education"
},
"pricing": {
"type": "one_time",
"price": {
"value": 9999,
"formatted": "$99.99",
"short": "100",
"currency": "USD"
}
},
"bundle": null
}
],
"store": {
"id": "str_xyz789",
"name": "My Store"
},
"customer_email": null,
"usage_limit": 100,
"usage_count": 15,
"start_date": "2025-01-01T00:00:00+00:00",
"end_date": "2025-12-31T23:59:59+00:00",
"is_auto_generated": false,
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-15T10:30:00+00:00"
},
{
"id": "dis_def456abc",
"name": "VIP Discount",
"code": "VIP50",
"type": "fixed",
"status": "active",
"value_off": {
"raw": 50,
"formatted": "$50.00"
},
"products": [],
"store": {
"id": "str_xyz789",
"name": "My Store"
},
"customer_email": "vip@example.com",
"usage_limit": 1,
"usage_count": 0,
"start_date": null,
"end_date": null,
"is_auto_generated": false,
"created_at": "2025-01-10T08:00:00+00:00",
"updated_at": "2025-01-10T08:00:00+00:00"
}
],
"pagination": {
"next_cursor": "eyJpZCI6NTB9",
"prev_cursor": null,
"has_more": true
}
},
"errors": []
}
Retrieves a cursor-paginated list of all discount codes in your store with optional filtering and search capabilities.
Query Parameters
integer
default:"15"
Number of discounts to return per page (max 100)
string
Cursor for pagination. Use the
next_cursor from the previous response.string
Filter by status (
active, expired)string
Search by discount code, name, or public ID
string
Filter discounts created from this date (Y-m-d format, e.g.,
2025-01-01)string
Filter discounts created until this date (Y-m-d format, e.g.,
2025-01-31)Response
object
Show properties
Show properties
array
Array of discount objects
Show discount object
Show discount object
string
Unique discount identifier (e.g.,
dis_abc123)string
Display name of the discount
string
The discount code customers use at checkout
string
Discount type (
percentage or fixed)string
Discount status (
active or expired)object
array
Array of products this discount applies to (empty if applies to all products)
object
Store information (simplified)
string
Email of customer this discount is restricted to (null if no restriction)
integer
Maximum number of uses (null if unlimited)
integer
Number of times the discount has been used
string
ISO 8601 timestamp when discount becomes active (null if no start restriction)
string
ISO 8601 timestamp when discount expires (null if no expiration)
boolean
Whether the discount was automatically generated by the system
string
ISO 8601 timestamp when discount was created
string
ISO 8601 timestamp when discount was last updated
curl -X GET "https://api.chariow.com/v1/discounts?status=active&per_page=20" \
-H "Authorization: Bearer sk_live_your_api_key"
const response = await fetch('https://api.chariow.com/v1/discounts?status=active&per_page=20', {
headers: {
'Authorization': 'Bearer sk_live_your_api_key'
}
});
const { message, data } = await response.json();
$ch = curl_init('https://api.chariow.com/v1/discounts?status=active&per_page=20');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_live_your_api_key'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
import requests
response = requests.get(
'https://api.chariow.com/v1/discounts',
params={'status': 'active', 'per_page': 20},
headers={'Authorization': 'Bearer sk_live_your_api_key'}
)
data = response.json()['data']
{
"message": "success",
"data": {
"data": [
{
"id": "dis_abc123xyz",
"name": "Summer Sale",
"code": "SUMMER20",
"type": "percentage",
"status": "active",
"value_off": {
"raw": 20,
"formatted": "20%"
},
"products": [
{
"id": "prd_def456",
"name": "Premium Course",
"type": "course",
"pictures": {
"thumbnail": "https://cdn.chariow.com/thumb.jpg",
"cover": "https://cdn.chariow.com/cover.jpg"
},
"category": {
"value": "education",
"label": "Education"
},
"pricing": {
"type": "one_time",
"price": {
"value": 9999,
"formatted": "$99.99",
"short": "100",
"currency": "USD"
}
},
"bundle": null
}
],
"store": {
"id": "str_xyz789",
"name": "My Store"
},
"customer_email": null,
"usage_limit": 100,
"usage_count": 15,
"start_date": "2025-01-01T00:00:00+00:00",
"end_date": "2025-12-31T23:59:59+00:00",
"is_auto_generated": false,
"created_at": "2025-01-01T00:00:00+00:00",
"updated_at": "2025-01-15T10:30:00+00:00"
},
{
"id": "dis_def456abc",
"name": "VIP Discount",
"code": "VIP50",
"type": "fixed",
"status": "active",
"value_off": {
"raw": 50,
"formatted": "$50.00"
},
"products": [],
"store": {
"id": "str_xyz789",
"name": "My Store"
},
"customer_email": "vip@example.com",
"usage_limit": 1,
"usage_count": 0,
"start_date": null,
"end_date": null,
"is_auto_generated": false,
"created_at": "2025-01-10T08:00:00+00:00",
"updated_at": "2025-01-10T08:00:00+00:00"
}
],
"pagination": {
"next_cursor": "eyJpZCI6NTB9",
"prev_cursor": null,
"has_more": true
}
},
"errors": []
}
Was this page helpful?
⌘I