FAIR VALUE MEASUREMENTS - Schedule of financial assets and financial liabilities measured at fair value on a recurring basis (Details) - USD ($) $ in Thousands | Dec. 31, 2022 | Jun. 30, 2022 |
U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | $ 71,988 | $ 29,077 |
Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 180,774 | 110,863 |
Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 6,641 |
Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 14,862 | 19,453 |
Fair Value, Recurring | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 1,183,474 | 1,715,916 |
Fair Value, Recurring | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 71,988 | 29,077 |
Fair Value, Recurring | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 180,774 | 110,863 |
Fair Value, Recurring | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 6,641 |
Fair Value, Recurring | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 14,862 | 19,453 |
Fair Value, Recurring | Level 1 | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 917,349 | 1,549,882 |
Fair Value, Recurring | Level 1 | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 1 | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 1 | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 1 | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 1,499 | 0 |
Fair Value, Recurring | Level 2 | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 266,125 | 166,034 |
Fair Value, Recurring | Level 2 | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 71,988 | 29,077 |
Fair Value, Recurring | Level 2 | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 180,774 | 110,863 |
Fair Value, Recurring | Level 2 | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 6,641 |
Fair Value, Recurring | Level 2 | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 13,363 | 19,453 |
Fair Value, Recurring | Level 3 | | |
Funds held for clients—available-for-sale: | | |
Assets, fair value disclosure | 0 | 0 |
Fair Value, Recurring | Level 3 | U.S. Treasury and direct obligations of U.S. government agencies | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 3 | Corporate bonds | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 3 | Commercial paper | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Fair Value, Recurring | Level 3 | Other securities | | |
Funds held for clients—available-for-sale: | | |
Debt securities, available-for-sale | 0 | 0 |
Demand deposit accounts and other cash equivalents | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 915,850 | 1,549,882 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 915,850 | 1,549,882 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | Level 1 | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 915,850 | 1,549,882 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | Level 2 | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | 0 | 0 |
Demand deposit accounts and other cash equivalents | Fair Value, Recurring | Level 3 | | |
Funds held for clients—cash and cash equivalents: | | |
Demand deposit accounts and other cash equivalents | $ 0 | $ 0 |