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

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

Edit order

POST/admin/v1/stores/{store_id}/orders/{order_id}/edit
  • orders:write
  • يدعم Idempotency-Key

Change the items of an order: quantities of units not yet shipped, and new items at today's price for the order's address. Kept items keep the price, discount and tax they were sold at; stock follows. An unpaid order's pending payment takes the new total; a paid order's payments stay, and balance_due says what is owed: a refund owed is refunded at once unless refund_now is false, a balance due is collected on delivery when collect says so. Send dry_run: true to see the new totals first. (and orders:refund to refund).

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

  • store_idstringمطلوب

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

  • order_idstringمطلوب

    معرّف من نوع ord، مثل ord_01k8qs5s….

الترويسات

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

  • linesarray of objects
  • addarray of objects

    Items to add, at today's price for the order's address.

  • dry_runboolean

    Only compute the new totals.

  • refund_nowboolean

    For a paid order whose new total is lower: refund the difference now (default).

  • collectenum

    For a paid order whose new total is higher: collect the balance on delivery, or later.

    • later
    • on_delivery

ما يُرجعه

200 The edit (saved unless a dry run).

الأخطاء

  • 403forbiddenMissing permission.
  • 404not_foundNo such order.
  • 409Closed or refunded order (order_not_open, order_refunded), an order left empty (order_empty), not enough stock, no cash on delivery to collect with (no_cash_on_delivery).
  • 422validation_failedUnknown lines, shipped units removed, nothing changed.