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

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

Create collection

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

Create a manual collection (optionally with its first products) or a smart one with rules.

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

  • store_idstringمطلوب

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

الترويسات

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

  • titlestringمطلوب
  • kindenumمطلوب

    How a collection decides its products.

    • manual
    • smart
  • handlestring · أو null

    Derived from the title when omitted.

  • description_htmlstring · أو null
  • rulesobject · أو null

    Required for smart collections; refused for manual ones.

  • sort_orderenum · أو null

    Default: manual for manual collections, created_desc for smart ones.

    • manual
    • title_asc
    • title_desc
    • price_asc
    • price_desc
    • created_desc
    • created_asc
  • image_media_idstring · أو null

    An uploaded image from the media library.

  • seoobject · أو null

ما يُرجعه

201 Collection created.

الأخطاء

  • 403forbiddenMissing permission.
  • 409Handle already used.
  • 422validation_failedValidation failed.