İçeriğe geç

Sipariş oluştur

POST
/api/website/orders
curl --request POST \
--url https://api.petanqueai.com/api/website/orders \
--header 'Content-Type: application/json' \
--header 'x-storefront-token: <x-storefront-token>' \
--data '{ "lines": [ { "productId": "example", "quantity": 1 } ], "customer": { "name": "example", "email": "hello@example.com", "phone": "example" }, "shipping": { "fullName": "example", "phone": "example", "email": "hello@example.com", "city": "example", "district": "example", "addressLine": "example", "postalCode": "example" }, "billing": { "fullName": "example", "phone": "example", "email": "hello@example.com", "city": "example", "district": "example", "addressLine": "example", "postalCode": "example" }, "promoCode": "example" }'

Verilen sepet, alıcı ve teslimat adresi için bir sipariş oluşturur. Fiyatları Petanque AI belirler, isteğiniz değil. billing varsayılan olarak teslimat adresidir; promoCode isteğe bağlıdır.

Mağazanız kartla ödeme alıyorsa sipariş AWAITING_PAYMENT olarak döner: Ödemeyi başlat ile devam edin. Aksi halde PENDING_APPROVAL olur ve ekibiniz onu Petanque AI’da onaylar.

Kargo sabit ₺150’dir; indirimden sonra ₺2.000 ve üzeri ürün tutarında ücretsizdir. Stok burada ayrılmaz; sipariş onaylandığında düşülür. Körü körüne tekrar denemeyin: her çağrı yeni bir sipariş oluşturur.

Bir ürün, adres ya da promo kodu sorunu, alanı error.details.field ile belirten 422 alır.

object
lines
zorunlu
Array<object>
>= 1 öğe
object
productId
zorunlu
string
>= 1 karakter
quantity
zorunlu
integer
>= 1
customer
zorunlu
object
name
zorunlu
string
>= 2 karakter <= 120 karakter
email
zorunlu
string biçim: email
<= 200 karakter
phone
string
>= 7 karakter <= 30 karakter
shipping
zorunlu
object
fullName
zorunlu
string
>= 5 karakter <= 120 karakter
phone
zorunlu
string
>= 10 karakter <= 20 karakter
email
string biçim: email
<= 254 karakter
city
zorunlu
string
>= 2 karakter <= 60 karakter
district
zorunlu
string
>= 2 karakter <= 60 karakter
addressLine
zorunlu
string
>= 10 karakter <= 250 karakter
postalCode
string
<= 10 karakter
billing
object
fullName
zorunlu
string
>= 5 karakter <= 120 karakter
phone
zorunlu
string
>= 10 karakter <= 20 karakter
email
string biçim: email
<= 254 karakter
city
zorunlu
string
>= 2 karakter <= 60 karakter
district
zorunlu
string
>= 2 karakter <= 60 karakter
addressLine
zorunlu
string
>= 10 karakter <= 250 karakter
postalCode
string
<= 10 karakter
promoCode
string
>= 1 karakter <= 40 karakter

Example generated

{
"lines": [
{
"productId": "example",
"quantity": 1
}
],
"customer": {
"name": "example",
"email": "hello@example.com",
"phone": "example"
},
"shipping": {
"fullName": "example",
"phone": "example",
"email": "hello@example.com",
"city": "example",
"district": "example",
"addressLine": "example",
"postalCode": "example"
},
"billing": {
"fullName": "example",
"phone": "example",
"email": "hello@example.com",
"city": "example",
"district": "example",
"addressLine": "example",
"postalCode": "example"
},
"promoCode": "example"
}