[POST] Teklif oluşturma
Yapay Zekâ Özeti
Ürünler, bir koleksiyon veya tüm ürünler için teslimat, satışa devam etme ve ödeme ayarlarıyla ön sipariş teklifi oluşturan uç noktayı belgeler.
POST /shop-api/pre-order/createçağırın;offer_name,start_dateveapply_tozorunludur.productiçinproduct_idvevariant_idiçeren 1 ile 50 arasıproductsgönderin;collectioniçin mevcut bircollection_idgönderin.fulfillment_shipping_dateveyafulfillment_after_checkoutdeğerlerinden birini kullanın (en fazla 60 gün); kesin tarih önceliklidir.partial_payment_value0'dan büyük olduğunda kısmi ödeme açılır.- Yeni teklifler etkindir (
status = 1); ürün eşitleme ve satış planı kurulumu eşzamansız tamamlanabilir.
Yapay zekâ tarafından oluşturulan özet. Hata içerebilir; aşağıdaki kılavuzun tamamını kontrol edin.
* Kimlik doğrulama
Zorunlu Authorization Bearer •••••••••••
Sınır throttle:30,1
Uç nokta POST - /shop-api/pre-order/create
Üst bilgiler
| Üst bilgi | Zorunlu | Açıklama |
|---|---|---|
Authorization | Evet | Mağaza genel API anahtarı Bearer token |
Content-Type | Evet | application/json |
1. İstek payload’ı
Zorunlu alanlar
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
offer_name | string | Evet | Teklif adı (en fazla 255 karakter) |
start_date | date | Evet | Ön sipariş başlangıç tarihi/saati |
apply_to | string | Evet | Hedef kapsam: product, collection veya all |
products | array | apply_to = product | min:1 | max:50 öğe |
products.*.product_id | number | products ile birlikte | Shopify ürün kimliği |
products.*.variant_id | number | products ile birlikte | Shopify varyasyon kimliği |
products.*.limit | number | null | Hayır | min:1 |
collection_id | number | apply_to = collection | Shopify koleksiyon kimliği |
İsteğe bağlı alanlar
| Alan | Tür | Varsayılan / Notlar | Açıklama |
|---|---|---|---|
end_date | date | null | — | Belirtilirse start_date değerinden sonra olmalıdır |
countdown_before_preorder_start | boolean | false | Başlangıçtan önce geri sayımı göster |
countdown_before_preorder_end | boolean | false | Bitişten önce geri sayımı göster |
preorder_condition_inventory | string | now | Envanter tetikleyicisi: now, outofstock, instock |
fulfillment_status | string | — | ON_HOLD, UNFULFILLMENT, SCHEDULED |
fulfillment_shipping_date | date | — | Kesin gönderim/karşılama tarihi |
fulfillment_after_checkout | number | — | Ödemeden sonraki gün sayısı (en fazla 60) |
turn_on_continue_selling_when_preorder_start | boolean | false | Teklif başladığında satışa devam etmeyi otomatik etkinleştir |
turn_off_continue_selling_when_preorder_end | boolean | false | Teklif bittiğinde satışa devam etmeyi otomatik devre dışı bırak |
full_payment_discount_type | string | percentage | percentage veya fixed |
full_payment_discount_value | number | 0 | Türle birlikte zorunludur; en fazla 100 (percentage) veya 1000000 (fixed); gönderildiğinde en az 1 |
partial_payment_value | number | — | Kapora/kısmi tutar; > 0 olduğunda kısmi ödemeyi etkinleştirir |
partial_payment_type | string | — | Oluşturma doğrulama alanı: percentage veya fixed (aşağıdaki nota bakın) |
partial_payment_value_type | string | percentage | Selling plan'a eşlerken / yanıt yapısında kullanılır |
partial_payment_discount_type | string | percentage | percentage veya fixed |
partial_payment_discount_value | number | 0 | Kısmi ödemede indirim |
partial_payment_remaining_balance_charge_date | date | — | Kalan bakiyenin tahsil edileceği tarih (kesin zaman) |
Önemli kurallar
apply_toproduct→productsgönderin (1–50 öğe). Varyasyonlar Shopify’a karşı doğrulanır; yalnızca bulunan varyasyonlar tutulur.collection→collection_idgönderin (mevcut olmalıdır).all→products/collection_idgönderilmez.
- Karşılama zamanlaması karşılıklı olarak dışlayıcıdır:
fulfillment_shipping_dateayarlanmışsa → kesin tarihli karşılama.- Aksi halde
fulfillment_after_checkoutayarlanmışsa → ödemeden sonraki günlere göre karşılama.
- Herhangi bir kısmi ödeme alanı mevcutsa ve
partial_payment_value > 0ise kısmi ödeme etkinleşir. - Yeni teklifler
status = 1(etkin) ile oluşturulur. Ürün senkronizasyonu / selling plan kurulumu eşzamansız çalışabilir (processing).
Alan adı notu: Oluşturma doğrulaması şu anda
partial_payment_typekullanırken liste/alma/güncelleme ve dahili eşlemepartial_payment_value_typekullanır. Diğer uç noktalarla tutarlılık içinpartial_payment_value_typeile uyumlu olmanız tercih edilir.
Örnek — ürünlere uygulama
{ "status": 1, // 1 is active, 0 is draft "offer_name": "Summer Pre-order", "start_date": "2026-08-01 00:00:00", "end_date": "2026-09-30 23:59:59", "countdown_before_preorder_start": true, "countdown_before_preorder_end": false, "apply_to": "product", "products": [ {"product_id": 7890123456789,"variant_id": 4567890123456,"limit": 100} ], "preorder_condition_inventory": "outofstock", "fulfillment_status": "ON_HOLD", "fulfillment_shipping_date": "2026-10-15", "turn_on_continue_selling_when_preorder_start": true, "turn_off_continue_selling_when_preorder_end": true, "full_payment_discount_type": "percentage", "full_payment_discount_value": 10, "partial_payment_value": 30, "partial_payment_value_type": "percentage", "partial_payment_discount_type": "percentage", "partial_payment_discount_value": 5, "partial_payment_remaining_balance_charge_date": "2026-10-01"}Örnek — koleksiyona uygulama
{ "offer_name": "Collection Pre-order", "start_date": "2026-08-01", "apply_to": "collection", "collection_id": 123456789, "preorder_condition_inventory": "now"}Örnek — tüm ürünlere uygulama
{"offer_name": "Storewide Pre-order","start_date": "2026-08-01","apply_to": "all"}2. Başarılı yanıt 200
{"success": true,"message": "Pre-order offer created","data": { "id": 123, "offer_name": "Summer Pre-order", "start_date": "2026-08-01 00:00:00", "end_date": "2026-09-30 23:59:59", "countdown_before_preorder_start": true, "countdown_before_preorder_end": false, "apply_to": "product", "preorder_condition_inventory": "outofstock", "fulfillment_status": "ON_HOLD", "fulfillment_shipping_date": "2026-10-15", "turn_on_continue_selling_when_preorder_start": true, "turn_off_continue_selling_when_preorder_end": true, "status": 1, "products": [ { "product_id": 7890123456789, "variant_id": 4567890123456, "limit": 100 } ], "full_payment_discount_type": "percentage", "full_payment_discount_value": 10, "partial_payment_value": 30, "partial_payment_value_type": "percentage", "partial_payment_discount_value": 5, "partial_payment_discount_type": "percentage", "partial_payment_remaining_balance_charge_date": "2026-10-01" }}3. Yanıt anahtarları ve alanları
Üst düzey
| Anahtar | Tür | Açıklama |
|---|---|---|
success |
boolean | teklif oluşturulduğunda true |
message |
string | "Pre-order offer created" |
data |
object | Oluşturulan teklif (Teklif detayı / Liste öğesiyle aynı yapı) |
data teklif nesnesi
| Alan | Tür | Açıklama |
|---|---|---|
id |
integer | Yeni oluşturulan teklif kimliği |
offer_name |
string | Teklif adı |
start_date |
string | null | Başlangıç tarihi ve saati |
end_date |
string | null | Bitiş tarihi ve saati; ayarlanmamışsa null |
countdown_before_preorder_start |
boolean | Başlangıçtan önce geri sayım |
countdown_before_preorder_end |
boolean | Bitişten önce geri sayım |
apply_to |
string | product | collection | all |
preorder_condition_inventory |
string | now | outofstock | instock |
fulfillment_status |
string | null | ON_HOLD | UNFULFILLMENT | SCHEDULED |
fulfillment_shipping_date |
string | Kesin tarihli karşılama kullanıldığında bulunur |
fulfillment_after_checkout |
number | Ödemeden sonraki günler kullanıldığında bulunur |
turn_on_continue_selling_when_preorder_start |
boolean | Başlangıçta satışa devam etmeyi otomatik etkinleştir |
turn_off_continue_selling_when_preorder_end |
boolean | Bitişte satışa devam etmeyi otomatik kapat |
status |
integer | Yeni oluşturulan teklifler için 1 (etkin) |
products |
array | Yalnızca apply_to = product olduğunda |
collection_id |
integer | Yalnızca apply_to = collection olduğunda |
collection_name |
string | Koleksiyon başlığı (mevcutsa) |
full_payment_discount_type |
string | Tam ödeme indirim türü |
full_payment_discount_value |
number | Tam ödeme indirim değeri |
partial_payment_* |
mixed | Kısmi ödeme etkin olduğunda bulunur |
products[] öğesi
| Alan | Tür | Açıklama |
|---|---|---|
product_id |
integer | Shopify ürün kimliği |
variant_id |
integer | Shopify varyasyon kimliği |
limit |
integer | null | Ön sipariş adet sınırı |
4. Başarısız yanıt
Doğrulama hatası — HTTP 200
{ "success": false, "message": { "offer_name": ["The offer name field is required."], "apply_to": ["The selected apply to is invalid."], "end_date": ["The end date must be a date after start date."] }}| Koşul | Yanıt |
|---|---|
apply_to = product ancak ürünler boş |
{ "success": false, "message": "Products are required" } |
| Shopify’da hiçbir varyasyon yok | { "success": false, "message": "Product variants not found" } |
apply_to = collection ancak collection_id boş |
{ "success": false, "message": "Collection is required" } |
| Koleksiyon Shopify’da bulunamadı | { "success": false, "message": "Collection not found" } |
Beklenmeyen sunucu hatası — HTTP 200
{"success": false,"message": "Pre-order offer not created"}Bu sayfa yardımcı oldu mu?
Geri bildiriminiz için teşekkürler! Neyin eksik olduğunu bize söyleyin
Sorun bildir