İçeriğe geç

Promo kodunu doğrula

POST
/api/website/promo/validate
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.

object
code
zorunlu
string
>= 1 karakter <= 40 karakter
lines
zorunlu
Array<object>
>= 1 öğe <= 50 öğe
object
productId
zorunlu
string
>= 1 karakter
quantity
zorunlu
integer
>= 1
email
string

Example generated

{
"code": "example",
"lines": [
{
"productId": "example",
"quantity": 1
}
],
"email": "example"
}