Promo kodunu doğrula
POST
/api/website/promo/validate
const url = 'https://api.petanqueai.com/api/website/promo/validate';const options = { method: 'POST', headers: { 'x-storefront-token': '<x-storefront-token>', 'Content-Type': 'application/json' }, body: '{"code":"example","lines":[{"productId":"example","quantity":1}],"email":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.petanqueai.com/api/website/promo/validate \ --header 'Content-Type: application/json' \ --header 'x-storefront-token: <x-storefront-token>' \ --data '{ "code": "example", "lines": [ { "productId": "example", "quantity": 1 } ], "email": "example" }'Sepetinizin indirimi sipariş oluşturulmadan gösterebilmesi için sepeti bir promo koduyla fiyatlar. Her zaman 200 döner: ya her satır, indirim, kargo ve toplamla birlikte valid: true, ya da bir reason (NOT_FOUND, EXPIRED, USED_UP, MIN_BASKET, …) ve gösterebileceğiniz bir mesajla valid: false.
Hiçbir şey ayrılmaz: sipariş oluşturulurken kod yeniden kontrol edilir. Müşteri başına tek kullanım sınırını uygulamak için email gönderin.
Yetkilendirmeler
Bölüm başlığı “Authorizations”İstek gövdesizorunlu
Bölüm başlığı “Request Bodyrequired”object
code
zorunlu
string
lines
zorunlu
Array<object>
object
productId
zorunlu
string
quantity
zorunlu
integer
email
string
Example generated
{ "code": "example", "lines": [ { "productId": "example", "quantity": 1 } ], "email": "example"}object
code
zorunlu
string
lines
zorunlu
Array<object>
object
productId
zorunlu
string
quantity
zorunlu
integer
email
string
Example generated
code=example&lines=%7B%22productId%22%3A%22example%22%2C%22quantity%22%3A1%7D&email=exampleobject
code
zorunlu
string
lines
zorunlu
Array<object>
object
productId
zorunlu
string
quantity
zorunlu
integer
email
string