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

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

Create purchase order

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

Draft a purchase order: what's ordered from a supplier, delivered to one location.

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

  • store_idstringمطلوب

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

الترويسات

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

  • supplier_idstringمطلوب

    TypeID with the supl prefix.

  • destination_idstringمطلوب

    Where the stock arrives; an active location.

  • linesarray of objectsمطلوب

    What's ordered, in order (1–250 different items).

  • currency_codestring · أو null

    Three letters; blank for the supplier's currency. Fixed once anything arrives.

  • referencestring · أو null

    The supplier's quote or invoice number (up to 100 characters).

  • notestring · أو null

    Up to 1,000 characters.

  • expected_ondate · أو null

    When it should arrive (YYYY-MM-DD).

  • adjustmentsarray of objects

    Shipping, customs, a discount (up to 10): a label and a signed amount.

ما يُرجعه

201 The draft.

الأخطاء

  • 403forbiddenMissing permission, or a location you don't work at.
  • 422validation_failedAn unknown or archived supplier, an inactive location, an unknown or uncounted item, or a bad quantity or cost.