Seven steps from an empty project to a working integration. Everything runs against Sandbox, so it is safe to experiment — one link, start to finish, takes about half an hour.
Before you start
| You need | Where to get it |
|---|---|
| A Smile account with Sandbox API keys | Developer Portal → API Keys |
| A backend you can run | Your own service — it mints the Link token |
| A Wink Template | Created in step 1 |
Step 1 — Create a Wink Template
The Wink Template holds the widget's settings: colours, the providers you expose, and the data sources it offers. Open Wink Templates in the Developer Portal, create one for your app, and copy its ID.
Expected result: a template ID such as wtpl-123abc456def789abc123def456abc78. You pass it to the widget in step 3.
Step 2 — Get a Link token from your server
The widget opens with a Link token: single-use, short-lived, and minted on your server so your API secret never reaches the client. There are two ways to get one.
First-time users — create the user, the token comes back in the response:
curl --request POST \
--url https://sandbox.smileapi.io/v1/users \
--header 'Authorization: Basic <base64(api-key:api-secret)>' \
--header 'Content-Type: application/json' \
--data '{}'{
"code": "OK",
"message": "Success",
"data": {
"user": { "id": "tenant-f482de95b2154985b65551c85095f886" },
"token": {
"accessToken": "<link-token>",
"expiresAt": "2026-12-02T10:00:00Z",
"mode": "SANDBOX"
}
}
}Returning users — refresh the token for the user you already stored:
curl --request POST \
--url "https://sandbox.smileapi.io/v1/tokens?userId=tenant-f482de95b2154985b65551c85095f886" \
--header 'Authorization: Basic <base64(api-key:api-secret)>'{
"code": "OK",
"message": "Success",
"data": {
"accessToken": "<link-token>",
"expiresAt": "2026-12-02T10:30:00Z",
"mode": "SANDBOX"
}
}Expected result: an accessToken your backend can hand to the client, and a userId worth storing — every later data call and refresh needs it.
Step 3 — Open the widget in your app
Add the widget script to your page, initialise it with the token and template ID from steps 1–2, and call open().
<script src="https://web.smileapi.io/v2/smile.v2.js"></script>
<script>
const smileLinkModal = new SmileLinkModal({
userToken: '<link-token>', // from step 2, minted per launch
templateId: '<wink-template-id>', // from step 1
onAccountConnected: ({ accountId, userId, providerId }) => {
console.log('Connected', accountId, userId, providerId);
},
onAccountError: ({ errorCode }) => console.error('Link failed', errorCode),
onClose: ({ reason }) => console.log('Widget closed', reason)
});
smileLinkModal.open();
</script>Expected result: the widget opens over your page and shows the provider list.
Step 4 — Link an account with a Sandbox user
Pick any provider and sign in with a Sandbox test account — never a real user's credentials:
| User Name | Full Name | Mobile Phone | Password | Verification Code | SS Number | |
|---|---|---|---|---|---|---|
| George | George Palomero Jr. | [email protected] | (+63) 9559991234 | 123456 | 1234 | 3300000008 |
| Ryan | Ryan Lestari | [email protected] | (+62) 8119994321 | 654321 | 1234 | N/A |
| Christina | Christina Tan | [email protected] | (+65) 99996789 | YGUS1 | 1234 | N/A |
| Anisha | Anisha Bhatia | [email protected] | (+91) 9511198765 | 123456 | 1234 | N/A |
The widget handles the provider's login, MFA and any document upload for you.
Expected result: the success screen appears, and your console logs Connected <accountId> … from onAccountConnected. Keep that accountId — step 6 uses it.
Step 5 — Configure the webhook
Smile notifies your server when a sync finishes, so you can react to TASK_FINISHED instead of polling. Sandbox and Production keep separate webhook lists — a webhook created in Sandbox never fires for Production traffic, so you configure it twice.
Option A — in the Developer Portal
Open portal.getsmileapi.com/developer/webhooks, switch to the mode you are testing, and add a webhook:
| Field | Value |
|---|---|
| Name | Anything you will recognise in the list |
| URL | Your public HTTPS endpoint, answering 2xx |
| Secret | The key Smile uses to sign each payload |
| Include payload | true, so TASK_FINISHED carries the datapoints |
| Events | TASK_FINISHED |
Option B — with the API
curl --request POST \
--url https://sandbox.smileapi.io/v1/webhooks \
--header 'Authorization: Basic <base64(api-key:api-secret)>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Wink data sync",
"url": "https://example.com/smile/webhook",
"eventTypes": ["TASK_FINISHED"],
"active": true,
"secret": "<webhook-secret>",
"includePayload": true
}'Expected result: the webhook appears in the portal for that mode (the API returns its id). Repeat it against https://open.smileapi.io/v1 with Production keys when you reach step 7.
Step 6 — Retrieve the data
Once the account is connected, pull its datapoints. Either let Smile push them with the TASK_FINISHED webhook (includePayload: true), or fetch them on demand:
curl --request GET \
--url "https://sandbox.smileapi.io/v1/accounts/<account-id>/payload" \
--header 'Authorization: Basic <base64(api-key:api-secret)>'Expected result: a 200 whose data contains the employment datapoints for the account. Data and Webhooks covers the webhook variant, retries and the retention rules.
Step 7 — Go live
When the Sandbox flow works end to end:
- Swap the host from
https://sandbox.smileapi.io/v1tohttps://open.smileapi.io/v1. - Replace the Sandbox key pair with your Production pair — a key only works in the mode it was issued for.
- Ask for Production access if you do not have it yet: contact Smile.
- Re-run one real link and confirm the data arrives.
Expected result: the same flow, on real users, with billing starting at the first successful CONNECTED account.
Next steps
| Page | What it covers |
|---|---|
| Sample Apps | The same flow in runnable Web, Android, iOS, React Native and Flutter samples |
| Widget Reference | Every embed option, all nine callbacks, and the widget versions |
| Data and Webhooks | Webhooks, the payload endpoint, and how long Smile keeps the data |

