TanqoryDocs

appUsageRecordCreate

  • Mutation
  • Apps and platform

Records a usage charge on an active subscription's usage line item, refused if it would pass the capped amount. Reusing an idempotencyKey returns the earlier record instead of charging twice.

Arguments

ArgumentTypeRequiredDefault
descriptionString!Required
idempotencyKeyStringOptional
priceMoneyInput!Required
subscriptionLineItemIdID!Required

Returns

AppUsageRecordCreatePayload What appUsageRecordCreate returns: the new appUsageRecord and any userErrors.

FieldTypeDescription
appUsageRecordAppUsageRecord
userErrors[UserError!]!

Example request

A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.

Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).

curl
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
  -H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"mutation AppUsageRecordCreate($description: String!, $price: MoneyInput!, $subscriptionLineItemId: ID!) {\n  appUsageRecordCreate(description: $description, price: $price, subscriptionLineItemId: $subscriptionLineItemId) {\n    appUsageRecord { id }\n    userErrors {\n      field\n      message\n    }\n  }\n}","variables":{"description":"","price":{"amount":"","currencyCode":"AED"},"subscriptionLineItemId":"gid://tanqory/Type/id"}}'

Built from commit c0b3fb3fdef7 · API version 2026-10