Quick Start

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 needWhere to get it
A Smile account with Sandbox API keysDeveloper Portal → API Keys
A backend you can runYour own service — it mints the Link token
A Wink TemplateCreated in step 1

Quickstart


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 NameFull NameEmailMobile PhonePasswordVerification CodeSS Number
GeorgeGeorge Palomero Jr.[email protected](+63) 955999123412345612343300000008
RyanRyan Lestari[email protected](+62) 81199943216543211234N/A
ChristinaChristina Tan[email protected](+65) 99996789YGUS11234N/A
AnishaAnisha Bhatia[email protected](+91) 95111987651234561234N/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:

FieldValue
NameAnything you will recognise in the list
URLYour public HTTPS endpoint, answering 2xx
SecretThe key Smile uses to sign each payload
Include payloadtrue, so TASK_FINISHED carries the datapoints
EventsTASK_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:

  1. Swap the host from https://sandbox.smileapi.io/v1 to https://open.smileapi.io/v1.
  2. Replace the Sandbox key pair with your Production pair — a key only works in the mode it was issued for.
  3. Ask for Production access if you do not have it yet: contact Smile.
  4. 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


Next steps

PageWhat it covers
Sample AppsThe same flow in runnable Web, Android, iOS, React Native and Flutter samples
Widget ReferenceEvery embed option, all nine callbacks, and the widget versions
Data and WebhooksWebhooks, the payload endpoint, and how long Smile keeps the data