Subscription countdown
Displays time remaining in ASB free trial
Demo
API
Tag
Name | Description |
<aui-subscription-countdown>
|
Custom element |
Attributes
Name | Value | Required | Description |
obligations |
Stringified array of obligation objects |
Stringified JSON array of obligations retrieved from
|
|
user |
String |
Stringified JSON of user object, see Guidelines below. |
|
halfwidth |
Boolean attribute |
Use if the component will be embedded in a container that does not span the full width of the screen. |
|
xswidth |
Boolean attribute |
Use if the component will be embedded in a narrow container. |
|
emitupgradeevents |
Boolean attribute |
Indicates the component should emit an |
|
upgradereturnurl |
String |
After upgrade, the user will be redirected to this URL. NOTE:
|
Properties
Name | Value | Required | Description |
---|---|---|---|
obligations |
Array of obligation objects |
Array of obligations retrieved from
|
|
user |
JSON |
Set this to user object JSON, see Guidelines below. |
|
halfWidth |
Boolean attribute |
Use if the component will be embedded in a container that does not span the full width of the screen. |
|
xsWidth |
Boolean attribute |
Use if the component will be embedded in a narrow container. |
|
emitUpgradeEvents |
Boolean attribute |
Indicates the component should emit an |
|
upgradeReturnUrl |
String |
After upgrade, the user will be redirected to this URL. NOTE:
|
Events
Name | Detail | Description |
---|---|---|
s-upgrade |
The clicked upgrade button's |
Fired after an upgrade button is clicked, if the |
s-expire |
The trial product's |
Fired when obligations data indicate the ASB free trial has expired. See guidelines for more details. |
Demo
API
Tag
Name |
<AuiSubscriptionCountdown>
|
Props
Name | Value | Required | Description |
obligations |
Array of obligation objects |
|
Array of obligations retrieved from
|
user |
JSON |
Set this to user object JSON, see Guidelines. |
|
halfWidth |
Boolean |
Use if the component will be embedded in a container that does not span the full width of the screen. |
|
xsWidth |
Boolean |
Use if the component will be embedded in a narrow container. |
|
emitUpgradeEvents |
Boolean |
Indicates the component should emit an |
|
upgradeReturnUrl |
String |
After upgrade, the user will be redirected to this URL. NOTE:
|
|
onSUpgrade |
Function |
Handles the The clicked upgrade button's |
|
onSExpire |
Function |
Handles the The trial product's |
Skylab React links
Typescript
Exported types
Guidelines
Avalara for Small Business
This component currently only checks for ASB free trial subscriptions. It is visible on the page starting with 60 days left in the trial.
User object
If your app doesn't already have access to the Avalara Identity user data, then use AUI Identity to get it. API for <aui-subscription-countdown>
user data is
provided below.
or data can be assigned as attribute using stringified JSON
Obligations object
This component works with two different obligations objects for now. See examples below.
The endpoint https://api.biztech.avalara.com/business-activity/customer-accounts/:id/obligations?includeFuture=true
returns an object like this:
The endpoint https://api.auth1.avalara.com/ws/rest/obligations/customer/:customerId
returns an object like this:
The s-expire event
This component currently calculates the time left in the user's ASB free trial, and emits the s-expire
event when the trial has expired and
the aui-subscription-expiration
component should be displayed (and user access to the app should be blocked). In the future, information about time remaining in the
free trial should be available via an API call, and listening for the s-expire
event may no longer be necessary.
Design
Design resources can be found on the Skylab design documentation site: skylab.avalara.com