انتقل إلى المحتوى

لم يُكتب وصف هذه العملية بالعربية بعد، فأوصافها بالإنجليزية.

Adjust stock

POST/admin/v1/stores/{store_id}/inventory/adjustments
  • يدعم Idempotency-Key

Change stock levels: add or remove units (delta) or set an exact count (on_hand), for one level or many at once. Every change lands in the history with the reason.

معاملات المسار

  • store_idstringمطلوب

    معرّف من نوع store، مثل store_01k8qs5s…. يصل إلى التطبيق مع التثبيت، في رابط OAuth وفي رد رمز الوصول.

الترويسات

  • Idempotency-Keystring

    أرسل المفتاح نفسه لإعادة المحاولة بأمان: تُعاد الإجابة الأولى لمدة ٢٤ ساعة.

  • shop-api-versionYYYY-MM

    الإصدار الذي تُكتب به الإجابة. بدونه يُستخدم الإصدار المثبّت لتطبيقك، وإلا الأحدث.

الجسم

  • changesarray of objectsمطلوب

    1–250 changes, each level at most once.

  • reasonenumمطلوب

    Why stock changed. sale and reservation are recorded by orders and checkouts only.

    • received
    • correction
    • damaged
    • shrinkage
    • sale
    • return
    • restock
    • reservation
    • transfer_out
    • transfer_in
    • unavailable
  • notestring · أو null

    Shown in the variant's history. Up to 500 characters.

ما يُرجعه

200 The levels after the change.

الأخطاء

  • 403forbiddenMissing permission.
  • 422validation_failedUnknown variant or location, inactive location, or a count below zero.