ModernTax
Search…
Getting Started

Install the script

Install our script in the body of the page where you will launch ModernTax.
1
<script src="https://moderntax.s3.amazonaws.com/sdk.js"></script>
Copied!

Launch ModernTax

Call ModernTax.create(clientId, 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).
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.
1
ModernTax.create(
2
MODERNTAX_CLIENT_ID,
3
{
4
onSuccess: (taxpayerId) => console.log(
5
"saving tax payer id " + taxpayerId + " from ModernTax"
6
)
7
}
8
})
Copied!

Example

The ModernTax dialog can be launched from a button with a click handler:
1
<button id="moderntax">Connect Your IRS Account</button>
2
<script src="https://moderntax.s3.amazonaws.com/sdk.js"></script>
3
<script>
4
document.getElementById("moderntax").addEventListener('click', () => {
5
ModernTax.create(MODERNTAX_CLIENT_ID);
6
});
7
</script>
Copied!

Callbacks

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:
1
{ taxpayer_id: "cfbdcc84-eedb-4064-8656-db055f9d1d42" }
Copied!

Prefilling Taxpayer Data

Several taxpayer fields can be passed to the create function option to prefill them in the dialog.

Prefill Fields

  • firstName
  • lastName
  • email
  • birthdate - format yyyymmdd
  • ssn - format 999999999 (no dashes)
1
ModernTax.create(
2
MODERNTAX_CLIENT_ID,
3
{
4
taxpayerData: {
5
firstName: "Matthew",
6
lastName: "Parker",
7
8
birthdate: "19900415",
9
ssn: "123456789"
10
},
11
onSuccess: (taxpayerId) => console.log(
12
"saving tax payer id " + taxpayerId + " from ModernTax"
13
)
14
}
15
})
Copied!
Last modified 27d ago