QuickStart

How to use Taiki

Step 1: Account set up

Email Alan (alan@taiki.online) from the Taiki team for account setup. Provide your desired webhook URL to receive the documents retrieved from Taiki's provided platforms. We will provide you with the api_key and api_secret for the next steps.

Step 2: Initialize JWT Token

(For in-depth details: Initialize JWT Token)

Generate a temporary Access Token (JWT) on your server which is used for secure connections between the Taiki App and Taiki's servers. The access token expires in 1 hour.

Send the JWT to your frontend for QuickStart.

Important:

  • This must be generated on your servers and sent to your front end to the Taiki App.

  • A JWT token must be generated every time you open the Taiki App.

const tokenResponse = await fetch("/api/token", {
    method: 'POST', 
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'api_key': 'YOUR_API_KEY',
        'api_secret': 'YOUR_API_SECRET', // can be regenerated via the dashboard.
        'taiki_user_id': '(OPTIONAL) TAIKI_USER_ID'
    }),
});

const data = await tokenResponse.json(); // Added 'await' to ensure the promise resolves properly

// For client to open the Taiki App
const ACCESS_TOKEN = data.access_token;
// To associate the user's login credentials with a unique ID
const TAIKI_USER_ID = data.taiki_user_id;

Step 3: Invoke the Taiki App

(For in-depth details: Invoke the Taiki App)

Send the JWT token from your backend to your frontend then Invoke the Taiki App.

There are two ways to trigger the Taiki App.

Step 4: Receive Data

Upon successful data retrieval, Taiki servers will hit your provided webhook URL above. The payload looks like below. Taiki will retrieve all bank statements and tax-related documents such as various 1099s from the user's accounts. These documents will be accessible via a download URL.

Note: the download link expires within 15 minutes for security reasons.

POST /{YOUR_WEBHOOK_URL}
Content-Type: application/json

{
  "status": "success", 
  "data": {
    "id": 123, 
    "client_id": "a6f2f489-8cc9-4385-9649-efeabdfbe41b",
    "metadata": {YOUR_METADATA},
    "created_at": "2023-03-12T21:30:00Z" 
  },
  "files": [{ 
      "status": "success",
      "file_name": "1099_INT.pdf",
      "download_url": "example.com",
      "total_size_bytes": 9.34
  }]
}

Last updated