Skip to content

feat(admin): Add a modal to grant ledger credit - #129809

Draft
volokluev wants to merge 2 commits into
masterfrom
volo/admin-ledger-grant
Draft

volokluev wants to merge 2 commits into
masterfrom
volo/admin-ledger-grant

Conversation

@volokluev

@volokluev volokluev commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Backend: getsentry/getsentry#22915 (stacked on getsentry/getsentry#22897)

This adds a Grant Ledger Credit action to the customer details page in _admin. It requires billing admin.

The modal:

  • loads the current contract's credit-only line items from GET /_admin/customers/{org}/ledger-grants/ and shows each one's ledger balance in the picker
  • takes an amount in dollars and sends it in cents, with an optional ticket URL and notes
  • has an "I am providing multiple grants to this customer in one day" checkbox. Checking it shows a required Client Key field, which the backend adds to the grant's idempotency key. With the box unchecked, the client key is never sent.
  • shows the backend's message when a grant is rejected, such as a second grant for the same line item on the same day without a new client key (409)

Demo video (getsentry access needed): https://github.com/getsentry/getsentry/pull/22915#issuecomment-6617449155

Billing admins can grant free credit to a credit-only line item (such
as Seer credits) from the customer details actions. The modal lists the
current contract's credit-only line items with their ledger balances.

A grant is idempotent per line item per UTC day. To give a customer a
second grant on the same day, the admin checks "I am providing multiple
grants to this customer in one day", which reveals a client key field
that is appended to the idempotency key.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 3, 2026
Co-Authored-By: Claude <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — ec2e9615 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant