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

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

Create upload

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

Reserve a file and get the permission to upload it. Send the bytes to the files edge as upload says, then call POST /media/{media_id}/complete with the edge's receipt.

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

  • store_idstringمطلوب

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

الترويسات

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

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

    JPEG, PNG, WebP, GIF, AVIF (≤ 20 MB), MP4, WebM (≤ 500 MB) or PDF (≤ 25 MB).

  • size_bytesintegerمطلوب
  • altstring · أو null

ما يُرجعه

201 Upload slot created.

الأخطاء

  • 403forbiddenMissing permission.
  • 422validation_failedUnsupported type, size or name.