Skip to content
A Subscription Authority is the PDA that the program uses as the SPL Token delegate for a user’s token account. Close it when the user no longer has active fixed delegations, recurring delegations, or subscription delegations for that mint. Closing returns the account’s rent to its funder (the user, or whichever payer funded it). Close any active delegations first. Closing does not clear the SPL Token delegate approval. Once the PDA is gone the approval is inert, but it stays on the token account until revoked — see Revoke The Delegate Approval. To run these snippets on a local network, first set up a local environment.

​Close The Authority

​Revoke The Delegate Approval

RevokeSubscriptionAuthority clears the delegate approval from the user’s token account by calling the token program’s Revoke, signed by the user. If the Subscription Authority is still open, it also closes it and returns its rent (pass receiver when a sponsor funded it). That decides the order:
  • To shut everything down, send CloseSubscriptionAuthority first and RevokeSubscriptionAuthority second, in separate transactions or in one transaction in that order.
  • Sending RevokeSubscriptionAuthority on its own also closes the Subscription Authority. Do that only when the user has no active delegations or subscriptions on the mint, because they stop working once it is gone.
  • Never send CloseSubscriptionAuthority after RevokeSubscriptionAuthority. The account is already closed, so the close fails with an invalid account owner error.
Pass the token program that owns the mint: TOKEN_PROGRAM_ADDRESS for SPL Token mints, or TOKEN_2022_PROGRAM_ADDRESS (from @solana-program/token-2022) for Token-2022 mints.

​Notes

  • The user signs the close transaction.
  • If a sponsor funded the Subscription Authority, pass that sponsor account as receiver so rent returns to the recorded payer.
  • Close fixed, recurring, and subscription delegation PDAs before closing the Subscription Authority.
  • If the user creates a new delegation later, initialize a new Subscription Authority for the same mint.
  • Closing does not clear the token delegate approval. Send RevokeSubscriptionAuthority after the close to remove it from the user’s token account.