Call ModernTax.create (clientId, settingsId, options) to launch the ModernTax dialog. You can find your Client ID in the API Keys page of your ModernTax dashboard (https://app.moderntax.io/api-keys).
You can retrieve "SettingsId" by calling the "Invite" API. Otherwise, you can use the value 'default'. This value is required and it defines the set of needed data to be fetched through ModernTax API.
The onSuccess callback will be triggered once the taxpayer has successfully connected their IRS account to ModernTax by logging in to their IRS account. Use the returned taxpayerId to make API requests.
ModernTax.create(
MODERNTAX_CLIENT_ID,
SETTINGS_ID,
{
onSuccess: (taxpayerId) => console.log(
"saving tax payer id " + taxpayerId + " from ModernTax"
)
}
})
Example
The ModernTax dialog can be launched from a button with a click handler:
<button id="moderntax">Connect Your IRS Account</button>
Once the taxpayer has connected their IRS account, you can receive a notification in two ways.
OnSuccess callback
The ModernTax.create() method takes an onSuccess callback as shown in the example.
Webhook
A webhook can be configured in the dashboard, accessible in the sidebar navigation. Once taxpayer data is synced, the webhook url will receive POST request in the format: