Tema
Kampanyalar ve kuponlar
Taban adres: https://api.winkwop.com/api/v1/integration/discounts (otomatik kampanyalar) ve https://api.winkwop.com/api/v1/integration/coupons (kod girilerek kullanılan kuponlar). İzinler: okuma uçları read_discounts, yazma uçları write_discounts ister — iki kaynak da aynı izni paylaşır.
Fark: kampanya (discounts) sepete otomatik uygulanır, müşteri bir kod girmez. Kupon (coupons) müşterinin checkout'ta girdiği bir koddur.
Kampanyaları listele
bash
curl https://api.winkwop.com/api/v1/integration/discounts \
-H "X-Api-Key: wk_sk_..."json
[
{
"id": "disc-uuid",
"name": "Yaz İndirimi",
"discount_type": "percentage",
"value": 15,
"min_subtotal": 200,
"is_active": true,
"is_running": true,
"used_count": 34,
"starts_at": "2026-06-01T00:00:00Z",
"ends_at": "2026-08-31T23:59:59Z"
}
]Kampanya oluştur
bash
curl -X POST https://api.winkwop.com/api/v1/integration/discounts \
-H "X-Api-Key: wk_sk_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Yaz İndirimi",
"discount_type": "percentage",
"value": 15,
"min_subtotal": 200,
"is_active": true
}'discount_type: percentage | fixed | free_shipping | buy_x_get_y. buy_x_get_y için ayrıca buy_quantity, get_quantity, get_discount_percent gönderilir. Belirli ürün/kategorilerle sınırlamak için product_ids / category_ids verin — boş bırakılırsa tüm katalogda geçerli olur.
Güncelleme PUT /integration/discounts/{id}, silme DELETE ile aynı gövde/yol deseniyle çalışır.
Kuponları listele
bash
curl https://api.winkwop.com/api/v1/integration/coupons \
-H "X-Api-Key: wk_sk_..."json
[
{
"id": "coup-uuid",
"code": "HOSGELDIN10",
"discount_type": "percentage",
"value": 10,
"usage_limit": 500,
"used_count": 112,
"is_active": true,
"is_usable": true
}
]Kupon oluştur
bash
curl -X POST https://api.winkwop.com/api/v1/integration/coupons \
-H "X-Api-Key: wk_sk_..." \
-H "Content-Type: application/json" \
-d '{
"code": "HOSGELDIN10",
"discount_type": "percentage",
"value": 10,
"usage_limit": 500,
"usage_limit_per_customer": 1,
"first_order_only": true
}'discount_type: percentage | fixed | free_shipping. usage_limit boş bırakılırsa sınırsız kullanım. code mağaza içinde benzersiz olmalı — çakışırsa 409 CONFLICT döner.
Güncelleme PUT /integration/coupons/{id}, silme DELETE ile aynı gövde/yol deseniyle çalışır.