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

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

Replace media

POST/admin/v1/stores/{store_id}/media/{media_id}/replacement
  • products:write
  • content:write
  • يدعم Idempotency-Key

Reserve new bytes under the same media ID, so everything that uses the file shows the new one. Send the file to the files edge as upload says, then call …/replacement/complete with the edge's receipt. The new file must be the same kind.

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

  • store_idstringمطلوب

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

  • media_idstringمطلوب

    معرّف من نوع med، مثل med_01k8qs5s….

الترويسات

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

  • filenamestringمطلوب
  • content_typestringمطلوب
  • size_bytesintegerمطلوب

ما يُرجعه

201 Replacement slot created.

الأخطاء

  • 404not_foundNo such media.
  • 409The file isn't uploaded yet.
  • 422validation_failedUnsupported type, size or name, or another kind of file.