curl -X GET "https://api.chariow.com/v1/discounts/dis_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
const response = await fetch('https://api.chariow.com/v1/discounts/dis_abc123', {
headers: {
'Authorization': 'Bearer sk_live_your_api_key'
}
});
const { data } = await response.json();
$ch = curl_init('https://api.chariow.com/v1/discounts/dis_abc123');
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/dis_abc123',
headers={'Authorization': 'Bearer sk_live_your_api_key'}
)
discount = response.json()['data']
{
"data": {
"id": "dis_abc123",
"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_and_learning",
"label": "Education and Learning"
},
"pricing": {
"type": "one_time",
"price": {
"value": 99,
"formatted": "$99.00",
"short": "99",
"currency": "USD"
},
"effective": {
"value": 99,
"formatted": "$99.00",
"short": "99",
"currency": "USD"
}
},
"bundle": null,
"metadata": null
}
],
"store": {
"id": "store_xyz789",
"name": "My Store",
"logo_url": "https://cdn.chariow.com/stores/xyz789/logo.png",
"url": "https://mystore.mychariow.com"
},
"customer_email": null,
"usage_limit": 100,
"usage_limit_per_customer": 1,
"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"
}
}
{
"message": "No query results for model [App\\Models\\Discount].",
"errors": []
}
{
"message": "Invalid API key. Please check again. Help: https://docs.chariow.com",
"errors": []
}
Discounts
Get Discount
Retrieve details of a specific discount code
curl -X GET "https://api.chariow.com/v1/discounts/dis_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
const response = await fetch('https://api.chariow.com/v1/discounts/dis_abc123', {
headers: {
'Authorization': 'Bearer sk_live_your_api_key'
}
});
const { data } = await response.json();
$ch = curl_init('https://api.chariow.com/v1/discounts/dis_abc123');
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/dis_abc123',
headers={'Authorization': 'Bearer sk_live_your_api_key'}
)
discount = response.json()['data']
{
"data": {
"id": "dis_abc123",
"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_and_learning",
"label": "Education and Learning"
},
"pricing": {
"type": "one_time",
"price": {
"value": 99,
"formatted": "$99.00",
"short": "99",
"currency": "USD"
},
"effective": {
"value": 99,
"formatted": "$99.00",
"short": "99",
"currency": "USD"
}
},
"bundle": null,
"metadata": null
}
],
"store": {
"id": "store_xyz789",
"name": "My Store",
"logo_url": "https://cdn.chariow.com/stores/xyz789/logo.png",
"url": "https://mystore.mychariow.com"
},
"customer_email": null,
"usage_limit": 100,
"usage_limit_per_customer": 1,
"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"
}
}
{
"message": "No query results for model [App\\Models\\Discount].",
"errors": []
}
{
"message": "Invalid API key. Please check again. Help: https://docs.chariow.com",
"errors": []
}
Retrieves detailed information about a specific discount code by its public ID, including type, value, usage statistics, validity period, and associated products.
Required scope:
discounts.read. A key without it receives a 403 error. See Authentication.Path Parameters
string
required
The unique discount identifier (e.g.,
dis_abc123)Response
object
Show properties
Show properties
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
Products this discount applies to (empty if it applies to all products)
Show product object
Show product object
string
Product public ID
string
Product name
string
Product type
object
thumbnail and cover image URLs (each null when not set)object
Category
value and labelobject
Pricing
type, price and effective amounts, in the product currencyobject | null
Bundle value and savings, or
null unless the product is a bundleobject | null
Custom metadata set on the product
object
Store information:
id, name, logo_url and urlstring | null
Email of the customer this discount is restricted to (
null if no restriction)integer | null
Maximum number of uses in total (
null if unlimited)integer | null
Maximum number of uses per customer (
null if unlimited)integer
Number of times the discount has been used
string | null
ISO 8601 timestamp when the discount becomes active (
null if no start restriction)string | null
ISO 8601 timestamp when the discount expires (
null if no expiration)boolean
Whether the discount was automatically generated by the system
string
ISO 8601 timestamp when the discount was created
string
ISO 8601 timestamp when the discount was last updated
curl -X GET "https://api.chariow.com/v1/discounts/dis_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
const response = await fetch('https://api.chariow.com/v1/discounts/dis_abc123', {
headers: {
'Authorization': 'Bearer sk_live_your_api_key'
}
});
const { data } = await response.json();
$ch = curl_init('https://api.chariow.com/v1/discounts/dis_abc123');
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/dis_abc123',
headers={'Authorization': 'Bearer sk_live_your_api_key'}
)
discount = response.json()['data']
{
"data": {
"id": "dis_abc123",
"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_and_learning",
"label": "Education and Learning"
},
"pricing": {
"type": "one_time",
"price": {
"value": 99,
"formatted": "$99.00",
"short": "99",
"currency": "USD"
},
"effective": {
"value": 99,
"formatted": "$99.00",
"short": "99",
"currency": "USD"
}
},
"bundle": null,
"metadata": null
}
],
"store": {
"id": "store_xyz789",
"name": "My Store",
"logo_url": "https://cdn.chariow.com/stores/xyz789/logo.png",
"url": "https://mystore.mychariow.com"
},
"customer_email": null,
"usage_limit": 100,
"usage_limit_per_customer": 1,
"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"
}
}
{
"message": "No query results for model [App\\Models\\Discount].",
"errors": []
}
{
"message": "Invalid API key. Please check again. Help: https://docs.chariow.com",
"errors": []
}
Was this page helpful?