curl -X POST https://api2.ecomailapp.cz/coupons/import \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"folderId": 1,
"codes": ["code1", "code2", "code3", "code4"],
"valid_until": "2025-12-31",
"type": "percentual",
"value": 15,
"currency": "CZK",
"min_spend": 1000,
"shipping_price": "free"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/coupons/import');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'folderId' => 1,
'codes' => ['code1', 'code2', 'code3', 'code4'],
'valid_until' => '2025-12-31',
'type' => 'percentual',
'value' => 15,
'currency' => 'CZK',
'min_spend' => 1000,
'shipping_price' => 'free',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"imported": 4,
"duplicated": 0,
"updated": 0,
"totalCount": 4
}
{
"errors": {
"update_existing": ["The update_existing flag cannot be combined with discount metadata. Use PUT /coupons/import to overwrite existing coupons."]
}
}
Discount coupons
Import discount coupons
Import discount coupons into a default or specific folder.
POST
/
coupons
/
import
curl -X POST https://api2.ecomailapp.cz/coupons/import \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"folderId": 1,
"codes": ["code1", "code2", "code3", "code4"],
"valid_until": "2025-12-31",
"type": "percentual",
"value": 15,
"currency": "CZK",
"min_spend": 1000,
"shipping_price": "free"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/coupons/import');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'folderId' => 1,
'codes' => ['code1', 'code2', 'code3', 'code4'],
'valid_until' => '2025-12-31',
'type' => 'percentual',
'value' => 15,
'currency' => 'CZK',
'min_spend' => 1000,
'shipping_price' => 'free',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"imported": 4,
"duplicated": 0,
"updated": 0,
"totalCount": 4
}
{
"errors": {
"update_existing": ["The update_existing flag cannot be combined with discount metadata. Use PUT /coupons/import to overwrite existing coupons."]
}
}
A code that already exists in the target folder is skipped and counted in
duplicated. Its stored fields do not change. To overwrite existing coupons, use PUT /coupons/import.Array of coupon code strings, up to 50,000 codes. Each code can have up to 255 characters.
Discount value, greater than
0. The maximum is 100 for percentual and 99999999.99 for fixed. Required when type is set.Three-letter currency code, for example
CZK. Required when type is fixed or when min_spend is set.Deprecated. Use
PUT /coupons/import instead. When true, only valid_until of the existing coupons is updated and the updated coupons are counted in both duplicated and updated. The request fails with 422 when update_existing is combined with type, value, currency, min_spend, or shipping_price.curl -X POST https://api2.ecomailapp.cz/coupons/import \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"folderId": 1,
"codes": ["code1", "code2", "code3", "code4"],
"valid_until": "2025-12-31",
"type": "percentual",
"value": 15,
"currency": "CZK",
"min_spend": 1000,
"shipping_price": "free"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/coupons/import');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'folderId' => 1,
'codes' => ['code1', 'code2', 'code3', 'code4'],
'valid_until' => '2025-12-31',
'type' => 'percentual',
'value' => 15,
'currency' => 'CZK',
'min_spend' => 1000,
'shipping_price' => 'free',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"imported": 4,
"duplicated": 0,
"updated": 0,
"totalCount": 4
}
{
"errors": {
"update_existing": ["The update_existing flag cannot be combined with discount metadata. Use PUT /coupons/import to overwrite existing coupons."]
}
}