Skip to content

Create usage record

POST/admin/v1/stores/{store_id}/apps/current/usage-records
  • Idempotency-Key supported

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.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • descriptionstringrequired
  • priceobjectrequired

    In the subscription's currency.

  • idempotency_keystringrequired

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

Returns

201 Recorded (or recorded before).

Errors

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