TypeScript Types for APIs

In case you are working in a TypeScript environment (like Node.js or React) and you are calling our APIs directly, you can use our type files to make your development experience smoother.

Start by installing our type package:
Since this package contains only type files, it adds 0 kb to your final build files!

npm install aiprise-types

Then just annotate your API responses using our types:

import axios from 'axios';
import { BusinessVerificationRequest, AiPriseBusinessVerificationResponseV2 } from 'aiprise-types';

const requestData: BusinessVerificationRequest = {
  // TypeScript will now check for any errors in your request data
};

axios
  .post<AiPriseBusinessVerificationResponseV2>(
    'https://api-sandbox.aiprise.com/api/v1/verify/run_business_verification',
    requestData
  )
  .then(function (response) {
    // TypeScript will tell you the exact properties in the response.
    console.log(response.data.status);
    console.log(response.data.business_info.name);
    console.log(response.data.some_nonexistent_property); // TS Error!
  })
  .catch(function (e) {
    console.log(e);
  });