curl -X POST https://api2.ecomailapp.cz/coupons/import \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"folderId": 1,
"codes": ["kod1", "kod2", "kod3", "kod4"],
"valid_until": "2025-12-31",
"update_existing": false
}'
$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' => ['kod1', 'kod2', 'kod3', 'kod4'],
'valid_until' => '2025-12-31',
'update_existing' => false,
]));
$response = curl_exec($ch);
curl_close($ch);
{
"imported": 4,
"duplicated": 0,
"totalCount": 4
}
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": ["kod1", "kod2", "kod3", "kod4"],
"valid_until": "2025-12-31",
"update_existing": false
}'
$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' => ['kod1', 'kod2', 'kod3', 'kod4'],
'valid_until' => '2025-12-31',
'update_existing' => false,
]));
$response = curl_exec($ch);
curl_close($ch);
{
"imported": 4,
"duplicated": 0,
"totalCount": 4
}
Folder ID. If not provided, coupons are imported into the default folder.
Array of coupon code strings.
Expiration date in
YYYY-MM-DD format.Update existing coupons if they already exist.
curl -X POST https://api2.ecomailapp.cz/coupons/import \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"folderId": 1,
"codes": ["kod1", "kod2", "kod3", "kod4"],
"valid_until": "2025-12-31",
"update_existing": false
}'
$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' => ['kod1', 'kod2', 'kod3', 'kod4'],
'valid_until' => '2025-12-31',
'update_existing' => false,
]));
$response = curl_exec($ch);
curl_close($ch);
{
"imported": 4,
"duplicated": 0,
"totalCount": 4
}
⌘I