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

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

Create usage record

POST/admin/v1/stores/{store_id}/apps/current/usage-records
  • يدعم Idempotency-Key

Charge metered use, within the cap of the store's plan for this period. Sending a record again with the same idempotency_key returns it without charging twice. App tokens only.

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

  • store_idstringمطلوب

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

الترويسات

  • Idempotency-Keystring

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

  • shop-api-versionYYYY-MM

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

الجسم

  • descriptionstringمطلوب
  • priceobjectمطلوب

    In the subscription's currency.

  • idempotency_keystringمطلوب

    Unique per record: sending it again returns the first record and charges nothing.

ما يُرجعه

201 Recorded (or recorded before).

الأخطاء

  • 409No subscription with usage terms (no_subscription, no_usage_terms), or the cap would be exceeded (usage_cap_exceeded).