TrulySmall API Documentation (1.0.0)

TrulySmall API Gateway (0.5.0)

Download OpenAPI specification:Download

API documentation for the TrulySmall platform.

Introduction

This document describes the TrulySmall Accounting API. This is the api used by the TrulySmall Invoicing, Expenses, and Ledger applications.

The api defines an accounting ledger and the additional features needed by the applications.

Getting Started

A TrulySmall user account is needed to use the api. The quickest way to get started is to sign up for a free trial with one of our applications. This will create an account for you, along with a user and a business. You can then use your credentials to obtain an authentication token and start using the api.

The ledger is centered around businesses, one of which will be created for you when you sign up for an account. Most endpoints accept a business id to identify who the operation is for. For example, a business will have its own contacts, taxes, transactions, accounts, and so on.

To allow for multi-user businesses, a user account is also assigned a user id. The user id can be associated with more than one business. The authentication token will only allow access to the business data for which the user has been granted access to. The user id is also used for user-specific operations such as purging a user account.

Subscriptions are centered around businesses. Each business must pay for its own subscription. A user can access any businesses that they have access to as long as the business is on an active subscription.

Authentication

API Authorization

TrulySmall allows for two categories of authentication: first-party and third-party. First-party authentication is for developers at TrulySmall who are building apps for the company. Third-party authentication is for external developers who wish to integrate with TrulySmall.

First-party Authentication

There are two ways to log the user in directly: either standard user-password login or through single-sign-on providers such as Google, Apple, or Facebook.

The endpoints for first-party authentication are under the /useraccount path. See that section below for more information.

When a login completes successfully, the api returns a bearer token and a refresh token. The response also includes the user account's user and business information needed for making subsequent calls. For example, a login call to POST /useraccount/login/tse will return the following:

{
"refreshToken": "refresh-token",
"token": "bearer-token",
"user": {
  "id": "95748954-6601-4eba-a230-b302ebb92c07",
  ... other user properties ...
},
"business": {
  "id": "ed7fd001-5330-43ff-9923-31ff9766d9f6",
  ... other business properties ...
}

The returned bearer token must be passed in within the Authorization header for each call, in the format Bearer bearer-token. When the token expires, a 401 response will be given, and the client app can use the refresh token to obtain a new bearer and refresh token. This is done with the call POST /useraccount/tokens/refresh.

Multi-factor Authentication

Users can enable multi-factor authentication (MFA) on their account. When MFA is enabled, the user must use another authentication method in addition to their password to complete their login and receive an authentication token. The api supports authenticator apps, email, and sms as second factor methods.

Third-party Authentication / OAuth

First-party login requires the user to enter their password, but we don't want users sharing their TrulySmall login information with any third parties. Instead, TrulySmall provides an OAuth2 server that allows third-parties to redirect users to TrulySmall to login and then redirects them back to the third party app with an access token. The third party can then use the access token to make api calls to TrulySmall on behalf of the user.

An explanation of OAuth2 is beyond the scope of this document. There are many resources online that explain the protocol, for example this one.

To get started, a third-party developer must register their app with TrulySmall. This is done manually and requires contacting TrulySmall and providing the redirect URLs for the OAuth flow. Once the app is registered, the developer will receive login and logout URLs to initiate the OAuth flow, as well as a client id and secret to use within it.

Here is a brief outline of the flow:

  1. A single page app (SPA) redirects the browser/user to the TrulySmall login URL, which includes the client id and the redirect URL as query parameters. The redirect URL must be one of the URLs registered with TrulySmall for the app.

    // client side code
    
    // generate a random CSRF token to prevent cross-site request forgery
    const csrfToken = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
    
    // store the state in the session storage so that we can validate it when we get the response
    sessionStorage.setItem('csrf-token', csrfToken)
    
    window.location.href = 'https://accounts.trulysmall.net/oauth2/authorize?' +
    'client_id=... the client id ...' +
    '&response_type=code' +
    '&scope=offline_access' +
    '&redirect_uri=... the redirect uri ...' +
    '&state=' + csrfToken
    
  2. The user logs in to TrulySmall on the OAuth server and is redirected back to the redirect URL with an authorization code.

    https://redirect-uri?code=... the authorization code ...&state=... the state ...

  3. The redirect URL should be handled by a server-side handler because it will need the client secret. It will use the authorization code and client secret to obtain an access token from TrulySmall.

    // server side code
    
    // send the following as form data
    let formData = new URLSearchParams()
    formData.append('code', ... received authorization code ...)
    formData.append('grant_type', 'authorization_code')
    formData.append('redirect_uri', ... the redirect uri ...')
    formData.append('client_id', ... the client id ...')
    formData.append('client_secret', ... the client secret ...')
    
    // make an axios call to the oauth server to exchange the code for an access token using form encoded data
    axios.post('https://accounts.trulysmall.com/oauth2/token', formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
        .then(response => {
            // parse the response data into token and user id
            this.token = response.data.access_token
            this.refreshToken = response.data.refresh_token
            this.expiresIn = response.data.expires_in
            this.tokenType = response.data.token_type
            this.userId = response.data.userId
    
  4. The server-side handler should redirect the browser back to the SPA with the access token, refresh token, and csrf cookie as http-only cookies.

  5. The SPA can now make api calls to TrulySmall on behalf of the user by passing the access token in the Authorization header.

OAuth Notes
  • This flow and documentation is still a work in progress. We have not had a reason to use it extensively yet, though the oauth server is production ready and tested.
  • The tokens currently have full access to the user's account. We will be adding scopes to the tokens in the future.

API Data Types

The api uses several data types that are worth documenting.

IDs

The object ids within the api are generally string version 4 UUIDs, for examplea6f573e7-39fb-4a6c-b010-81127b4ab7f7. The api assigns object ids on creation but the client can also provide them if it's helpful.

Amounts

Amounts are represented as whole number strings, for example "100" as $1.00. The amounts are whole numbers obtained by multiplying the real amounts by the currency base amount (which is 100 for USD). This is done to avoid any floating point arithmetic errors. Amounts are currently represented as strings due to a Google protobuf typing design decision. The api must represent amounts internally as 64-bit integers, but the JavaScript specification only supports 63-bit integers, hence protobuf encodes them as strings.

Currencies

Amounts are always paired with currency codes. These are three-letter codes defined in ISO 4217, for example 'USD'.

Dates and Times

Times are represented as RFC 3339 strings, for example 2021-08-12T12:34:56.789Z. Transactions can either be assigned dates with no time component, or full date-times. (Note that the api documentation shows dates as including a zero time component, but this is ignored by the api.) The date-times include time and timezone components, so they can be in UTC or in the user's local timezone.

Timezones

Transactions also accept timezones along with date-times. These are used to explicitly state where the user is entering the transaction irrespective of the timezone format used within the date-time. Timezones are those defined in the tz database, for example 'America/New_York'.

Enums

The api uses several enums, for example for transaction types and category accounts. These are represented as strings and follow protobuf naming conventions, for example TRANSACTION_TYPE_INCOME.

User Account

User account management for TrulySmall apps. Used for registering new users, logging in, and managing user settings.

Gets a user account

Get information about a User

query Parameters
userId
required
string

ID of the user

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "token": "auth-token",
  • "user": {
    }
}

Patches a user account

Patches a user account object. Updates only those properties which are not set.

query Parameters
userId
required
string

ID of the user

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

patch user request

required
object (api.TSUser)

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Resends the email-verification email

If the user loses their email verification email, or if their code expires, they can request a new one with this endpoint.

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Logs a user into TSE using a provider

Logs the user into TrulySmall Expenses using an SSO provider such as Google. Note that the standard login endpoint can also be used for this purpose.

Request Body schema: application/json
required

Provider login info

authorizationCode
string
identityProviderId
required
string
object (api.MfaLoginRequest)
redirectUri
string
token
required
string

Responses

Request samples

Content type
application/json
{
  • "authorizationCode": "auth-code",
  • "identityProviderId": "provider-id",
  • "mfaLogin": {
    },
  • "redirectUri": "https://example.com",
  • "token": "auth-token"
}

Response samples

Content type
application/json
{
  • "business": {
    },
  • "refreshToken": "refresh-token",
  • "token": "auth-token",
  • "user": {
    }
}

Logs a user into TSI using a provider

Logs the user into TrulySmall Invoices using an SSO provider such as Google. Note that the standard login endpoint can also be used for this purpose.

Request Body schema: application/json
required

Provider login info

authorizationCode
string
identityProviderId
required
string
object (api.MfaLoginRequest)
redirectUri
string
token
required
string

Responses

Request samples

Content type
application/json
{
  • "authorizationCode": "auth-code",
  • "identityProviderId": "provider-id",
  • "mfaLogin": {
    },
  • "redirectUri": "https://example.com",
  • "token": "auth-token"
}

Response samples

Content type
application/json
{
  • "business": {
    },
  • "refreshToken": "refresh-token",
  • "token": "auth-token",
  • "user": {
    }
}

Logs a user into TSE

Logs the user into TrulySmall Expenses using any type of login: basic email and password, provider login (such as Google), or to complete MFA. If the account has MFA enabled, this will return a 242 response and the user will have to call the endpoint again to complete an MFA login.

Request Body schema: application/json
required

User login details

anonymousUserId
string

If the user is in anonymous mode, this is the id that they have been using

email
string

The email of the user

object (api.MfaLoginRequest)
password
string

The password the user is logging in with

object (api.PostUserAccountLoginProviderTseRequest)
object (api.StandardLoginRequest)
object (api.TokenLoginRequest)

Responses

Request samples

Content type
application/json
{
  • "anonymousUserId": "12345678-1234-1234-1234-123456789012",
  • "email": "[email protected]",
  • "mfaLogin": {
    },
  • "password": "password",
  • "providerLogin": {
    },
  • "standardLogin": {},
  • "tokenLogin": {
    }
}

Response samples

Content type
application/json
{
  • "business": {
    },
  • "refreshToken": "refresh-token",
  • "token": "auth-token",
  • "user": {
    }
}

Logs a user into TSI

Logs the user into TrulySmall Invoices using any type of login: basic email and password, provider login (such as Google), or to complete MFA. If the account has MFA enabled, this will return a 242 response and the user will have to call the endpoint again to complete an MFA login.

Request Body schema: application/json
required

User login details

anonymousUserId
string

If the user is in anonymous mode, this is the id that they have been using

email
string

The email of the user

object (api.MfaLoginRequest)
password
string

The password the user is logging in with

object (api.PostUserAccountLoginProviderTseRequest)
object (api.StandardLoginRequest)
object (api.TokenLoginRequest)

Responses

Request samples

Content type
application/json
{
  • "anonymousUserId": "12345678-1234-1234-1234-123456789012",
  • "email": "[email protected]",
  • "mfaLogin": {
    },
  • "password": "password",
  • "providerLogin": {
    },
  • "standardLogin": {},
  • "tokenLogin": {
    }
}

Response samples

Content type
application/json
{
  • "business": {
    },
  • "refreshToken": "refresh-token",
  • "token": "auth-token",
  • "user": {
    }
}

Logs the user out

Logs the user out of the TrulySmall apps and invalidates the user's login tokens so that they can no longer be used.

Request Body schema: application/json
required

Log out request

refreshToken
required
string

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "string"
}

Response samples

Content type
application/json
{ }

Disables MFA for a user

Disables a single MFA method for a user account. If there are other methods, then MFA is still required to login. If this is the only method, then the account will no longer require MFA for logging in. Note that the user needs to provide a valid MFA code from the device or use a recovery code to disable MFA.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

enable mfa request

code
required
string
methodId
required
string

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "methodId": "string"
}

Response samples

Content type
application/json
{
  • "user": {
    }
}

Enables MFA for a user

To enable MFA, the user has to have a valid token and an mfa code from the device they wish to enable, If this is the case, mfa is enabled for the user using the associated method and will now be required for logging in. The success response includes a set of recovery codes that can be used to recover access if a user loses their mfa device. These codes are used in place of mfa codes from the device and can be used for both logging in and for disabling the mfa method. Each recovery code can only be used once.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

enable mfa request

code
required
string

The code received from the mfa device

email
string

Set appropriately when enabling email

method
required
string

The mfa method being enabled

mobilePhone
string

Set appropriately when enabling sms

secret
string

Set appropriately when enabling authenticator

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "email": "string",
  • "method": "string",
  • "mobilePhone": "string",
  • "secret": "string"
}

Response samples

Content type
application/json
{
  • "recoveryCodes": [
    ],
  • "user": {
    }
}

Generates an authenticator app secret

This is an optional method to generate the secret needed to create an authenticator app entry. This generates a single secret and returns it in three formats, any of which can be used. When enabling mfa with the authenticator method, the secret should then be provided to the enableMfa method.

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "authenticatorUrl": "string",
  • "secret": "string",
  • "secretBase32": "string"
}

Sends MFA code to user

Used for completing an MFA login. This can happen in two contexts and the request is different for each:

  1. Sending an MFA code to complete login. In this case, the login property is required.
  2. Sending an MFA code to enable or disable MFA or for step-up auth. In this case, the normal property and the auth header are required.
header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

MFA send code request

object (api.MfaSendCodeLoginRequest)
object (api.MfaSendCodeNormalRequest)

Responses

Request samples

Content type
application/json
{
  • "login": {
    },
  • "normal": {
    }
}

Response samples

Content type
application/json
{ }

Changes a user's password

Request Body schema: application/json
required

change password request

changePasswordId
required
string
password
required
string

Responses

Request samples

Content type
application/json
{
  • "changePasswordId": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "oneTimePassword": "string",
  • "state": { },
  • "statusCode": 0
}

Sends a reset password email

Sends a reset password email to the user's email address so that they can log in temporarily and change their password. It will only accept an email address.

Request Body schema: application/json
required

Password reset request

loginId
required
string

Responses

Request samples

Content type
application/json
{
  • "loginId": "string"
}

Response samples

Content type
application/json
{
  • "changePasswordId": "string"
}

Registers a new account for TSE

Creates a user account and registers it for using the TrulySmall Expenses application. If the user already exists, then they are just registered for the application.

Request Body schema: application/json
required

User sign-up data

email
required
string

The email the user will use

fullName
required
string

The user's full name

password
required
string

The password the user would like to set

userId
string

A uuid for the user. Can be provided by the client, but if not, one will be generated.

Responses

Request samples

Content type
application/json
{
  • "email": "[email protected]",
  • "fullName": "John Smith",
  • "password": "password",
  • "userId": "12345678-1234-1234-1234-123456789012"
}

Response samples

Content type
application/json
{
  • "business": {
    },
  • "refreshToken": "refresh-token",
  • "token": "auth-token",
  • "user": {
    }
}

Registers a new account for TSI

Creates a user account and registers it for using the TrulySmall Invoices application. If the user already exists, then they are just registered for the application.

Request Body schema: application/json
required

User sign-up data

email
required
string

The email the user will use

fullName
required
string

The user's full name

password
required
string

The password the user would like to set

userId
string

A uuid for the user. Can be provided by the client, but if not, one will be generated.

Responses

Request samples

Content type
application/json
{
  • "email": "[email protected]",
  • "fullName": "John Smith",
  • "password": "password",
  • "userId": "12345678-1234-1234-1234-123456789012"
}

Response samples

Content type
application/json
{
  • "business": {
    },
  • "refreshToken": "refresh-token",
  • "token": "auth-token",
  • "user": {
    }
}

Refreshes auth token

Allows the caller to obtain a new auth token using a refresh token. This is needed when an auth token expires and is rejected with a 401. If the refresh token is not valid, then the user will have to log in again.

Request Body schema: application/json
required

refresh token request

refreshToken
required
string
token
required
string

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "string",
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "refreshToken": "string",
  • "refreshTokenId": "string",
  • "token": "string"
}

Validates auth token

Validate a JWT auth token

Request Body schema: application/json
required

validate taken request

token
required
string

Responses

Request samples

Content type
application/json
{
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "jwt": {
    }
}

Deletes a user account

Deletes a user account. Since the data is shared across TS apps, the registration and data for all apps will be deleted.

query Parameters
id
required
string

ID of the user

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Provides an Activation Code for TSA Integration

Checks client token and provides an Activation Code for TSA Integration

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "activationCode": "string"
}

Provides necessary data to TSA for TSI Integration

Check permision and provides necessary data to integrate TSI into TSA

query Parameters
email
required
string

email of the user

code
string

Oauth code from fusionAuth

activationCode
string

Activation code from GetTsaActivationCode

redirectURI
string

Uri requesting the data

Responses

Response samples

Content type
application/json
{
  • "lastInvoiceSent": {
    },
  • "oldestInvoiceDate": "string",
  • "user": {
    }
}

Unban an IP or email address

Unban an IP or email address

query Parameters
key
string

IP or email address to unblock

Responses

Response samples

Content type
application/json
{
  • "unblocked": true
}

Subscription

Endpoints for managing subscriptions for a business. This is the subscription that the business has with TrulySmall and determines whether the business is allowed to use the TrulySmall apps.

Cancels a subscription

Cancels a subscription. Only works for the Google and Chargebee stores.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Cancel Subscription

cancelAt
string
endOfTerm
boolean
id
string

subscription ID

subscriberId
string

Responses

Request samples

Content type
application/json
{
  • "cancelAt": "2019-10-12T07:20:50.52Z",
  • "endOfTerm": true,
  • "id": "string",
  • "subscriberId": "string"
}

Response samples

Content type
application/json
{ }

Retrieves a subscription

Retrieves a particular subscription using a subscription ID.

query Parameters
id
string

ID of subscriptions

subscriberId
string

Subscriber ID / Business ID

subscriptionApplication
required
string

subscription application: SubscriptionApplication_ALL,SubscriptionApplication_INVOICE,SubscriptionApplication_ESTIMATE

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "subscription": {
    }
}

Creates a subscription

Creates a subscription for a business.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Create Subscription Request

appId
string
originalId
string
platformProductId
string
purchaseToken
string
purchasedExplicitlyInApp
boolean
store
required
string
subscriberId
string
subscriptionApplication
string
userEmail
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "appId": "string",
  • "originalId": "string",
  • "platformProductId": "string",
  • "purchaseToken": "string",
  • "purchasedExplicitlyInApp": true,
  • "store": "string",
  • "subscriberId": "string",
  • "subscriptionApplication": "string",
  • "userEmail": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "subscription": {
    }
}

Retrieves App Store rating

Retrieves the rating information of an app from the App Store.

query Parameters
appId
required
integer

App ID

Responses

Response samples

Content type
application/json
{
  • "resultCount": 0,
  • "results": [
    ]
}

Creates a Chargebee checkout window

Creates a Chargebee checkout window for launching the Chargebee checkout flow.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

New Checkout

couponId
Array of strings
object (serverpb.ChargeBeeCustomer)
subscriberId
required
string
subscriptionApplication
required
string
subscriptionPlanId
required
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "couponId": [
    ],
  • "customer": {
    },
  • "subscriberId": "string",
  • "subscriptionApplication": "string",
  • "subscriptionPlanId": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "checkoutInfo": [
    ],
  • "content": [
    ],
  • "createdAt": 0,
  • "embed": true,
  • "expiresAt": 0,
  • "failureReason": "string",
  • "id": "string",
  • "object": "string",
  • "passThruContent": "string",
  • "resourceVersion": 0,
  • "state": "string",
  • "type": "string",
  • "updatedAt": 0,
  • "url": "string"
}

Creates a Chargebee portal session

Creates a Chargebee portal session

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

New portal session

subscriptionId
string

Responses

Request samples

Content type
application/json
{
  • "subscriptionId": "string"
}

Response samples

Content type
application/json
{
  • "accessUrl": "string",
  • "createdAt": 0,
  • "customerId": "string",
  • "expiresAt": 0,
  • "id": "string",
  • "loginAt": 0,
  • "loginIpAddress": "string",
  • "logoutAt": 0,
  • "logoutIpAddress": "string",
  • "object": "string",
  • "redirectUrl": "string",
  • "status": "string",
  • "token": "string"
}

Lists all customer reviews for a specific app

Retrieves customer reviews for a specific app from the App Store Connect API.

path Parameters
appId
required
string

App ID

query Parameters
customerReviewResponses
string

Fields to return for customer review responses (comma-separated list). Possible Values: lastModifiedDate, responseBody, review, state

customerReviews
string

Fields to return for customer reviews (comma-separated list). Possible Values: body, createdDate, rating, response, reviewerNickname, territory, title

filterRating
string

Filter by ratings (comma-separated list). For example, filtering for 1,2,5 shows only reviews with ratings of 1, 2, or 5. The minimum numeric rating value is 1, and the maximum is 5.

include
string

Relationship data to include. Value: response

limit
integer

Number of resources to return (max: 200)

sort
string

Attributes by which to sort. Possible Values: createdDate, -createdDate, rating, -rating

filterTerritory
string

Filter by territories (comma-separated list). Possible Values: ABW, AFG, AGO, AIA, ALB, AND, ANT, ARE, ARG, ARM, ASM, ATG, AUS, AUT, AZE, BDI, BEL, BEN, BES, BFA, BGD, BGR, BHR, BHS, BIH, BLR, BLZ, BMU, BOL, BRA, BRB, BRN, BTN, BWA, CAF, CAN, CHE, CHL, CHN, CIV, CMR, COD, COG, COK, COL, COM, CPV, CRI, CUB, CUW, CXR, CYM, CYP, CZE, DEU, DJI, DMA, DNK, DOM, DZA, ECU, EGY, ERI, ESP, EST, ETH, FIN, FJI, FLK, FRA, FRO, FSM, GAB, GBR, GEO, GGY, GHA, GIB, GIN, GLP, GMB, GNB, GNQ, GRC, GRD, GRL, GTM, GUF, GUM, GUY, HKG, HND, HRV, HTI, HUN, IDN, IMN, IND, IRL, IRQ, ISL, ISR, ITA, JAM, JEY, JOR, JPN, KAZ, KEN, KGZ, KHM, KIR, KNA, KOR, KWT, LAO, LBN, LBR, LBY, LCA, LIE, LKA, LSO, LTU, LUX, LVA, MAC, MAR, MCO, MDA, MDG, MDV, MEX, MHL, MKD, MLI, MLT, MMR, MNE, MNG, MNP, MOZ, MRT, MSR, MTQ, MUS, MWI, MYS, MYT, NAM, NCL, NER, NFK, NGA, NIC, NIU, NLD, NOR, NPL, NRU, NZL, OMN, PAK, PAN, PER, PHL, PLW, PNG, POL, PRI, PRT, PRY, PSE, PYF, QAT, REU, ROU, RUS, RWA, SAU, SEN, SGP, SHN, SLB, SLE, SLV, SMR, SOM, SPM, SRB, SSD, STP, SUR, SVK, SVN, SWE, SWZ, SXM, SYC, TCA, TCD, TGO, THA, TJK, TKM, TLS, TON, TTO, TUN, TUR, TUV, TWN, TZA, UGA, UKR, UMI, URY, USA, UZB, VAT, VCT, VEN, VGB, VIR, VNM, VUT, WLF, WSM, YEM, ZAF, ZMB, ZWE

existsPublishedResponse
boolean

Filter by whether the review has a published response. A Boolean value that filters the reviews based on whether the review has a published response in the App Store. Use true to return the customer reviews that already have a published response in the App Store. Use false to return the customer reviews that don’t have a published response. Note that it’s possible that a review has a response that isn’t yet published.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Retrieves subscription entitlements

Retrieves subscription entitlements for a given store: apple app store, google play store, or chargebee.

query Parameters
store
string

Store; APP_STORE,PLAY_STORE,CHARGEBEE

Responses

Response samples

Content type
application/json
{
  • "entitlements": [
    ]
}

Retrieves multiple subscriptions

Retrieves all subscriptions for a business using either the subscriber ID or the user ID.

query Parameters
subscriberId
required
string

Subscriber ID / User ID

subscriptionApplication
required
string

subscription application: SubscriptionApplication_ALL,SubscriptionApplication_INVOICE,SubscriptionApplication_ESTIMATE

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "subscription": [
    ]
}

Pauses a subscription

Pauses a subscription. Only works for the Google and Chargebee stores.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Pause a Subscription

id
string

subscription ID

pauseOption
integer
specificDate
string
subscriberId
string

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "pauseOption": 0,
  • "specificDate": "2019-10-12T07:20:50.52Z",
  • "subscriberId": "string"
}

Response samples

Content type
application/json
{ }

Retrieves a store's plan

Retrieves a subscription store's plan using a subscription application.

query Parameters
store
required
string

Store; APP_STORE,PLAY_STORE,CHARGEBEE

Responses

Response samples

Content type
application/json
{
  • "subscriptionPlans": [
    ]
}

Refunds a subscription

Refunds a subscription. Only works with Google.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Refund Subscription

id
string

subscription ID

subscriberId
string

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "subscriberId": "string"
}

Response samples

Content type
application/json
{ }

Resumes a subscription

Resumes a paused subscription. Only works with Chargebee

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Resume Subscription

id
string

subscription ID

resumeOption
string
specificDate
string
subscriberId
string

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "resumeOption": "string",
  • "specificDate": "2019-10-12T07:20:50.52Z",
  • "subscriberId": "string"
}

Response samples

Content type
application/json
{ }

Validates a chargebee coupon code

Validates a chargee coupon code

query Parameters
couponId
string

Chargebee coupon code

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "valid": true
}

Account

Endpoints for managing business accounts and viewing their journal entries. Accounts are automatically created for a business based on their chart of accounts. The user can modify their accounts using these endpoints to suit their needs.

Deletes an account

Deletes an existing account for a business.

query Parameters
id
string

ID of account

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves accounts

Retrieves an account by ID or all of a business's accounts by business ID.

query Parameters
id
string

ID of Account

businessId
string

ID of Business to retrieve Accounts for

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "accounts": [
    ]
}

Creates an account

Creates a new account for a business. The business will already start with a chart of accounts so this endpoint is only used to create additional accounts.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Account to create

required
object (ledgerpb.Account)
businessId
required
string

Responses

Request samples

Content type
application/json
{
  • "account": {
    },
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Response samples

Content type
application/json
{
  • "account": {
    }
}

Updates an account

Updates an existing account for a business.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Account to update

required
object (ledgerpb.Account)

Responses

Request samples

Content type
application/json
{
  • "account": {
    }
}

Response samples

Content type
application/json
{
  • "account": {
    }
}

Retrieves account balance

Retrieves the balance of an account on a given day. This is returned as an array of amounts because the account may have multiple currencies. In most cases, it will be a single amount in the primary currency.

query Parameters
id
required
string

Id of account to retrieve balance for

asOf
string

Date to retrieve balance for. If not provided, will use current date.

timezone
string

Timezone to use for asOf date

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "balances": [
    ]
}

Retrieves all balances

Retrieves the balance of all accounts on a given day. Each account will have an array of amounts because the account may have multiple currencies.

query Parameters
businessId
required
string

Id of business to retrieve balance for

asOf
string

Date to retrieve balances for. If not provided, will use current date.

timezone
string

Timezone to use for asOf date

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "balances": [
    ]
}

Retrieves journal entries

Retrieves the journal entries that have been made against an account.

query Parameters
id
string

ID of account

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "journalEntries": [
    ]
}

Budget

Endpoints for managing a business's budgets on expense categories. A budget object applies to a specific expense category over a period of a month. They are just used for expenses.

Deletes a budget

Deletes an existing Budget for a business.

query Parameters
id
string

ID of budget

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves budgets

Retrieves a budget by ID or all of a business's budgets by business ID.

query Parameters
id
string

ID of budget

businessId
string

Retrieve Budget by Business ID

transactionGroupType
string

Group type of budgets

demo
string

Flag to request demo business data

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "budgets": [
    ]
}

Creates a budget

Creates a budget for a business. The budget is for a specific category over a monthly period.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Budget to create

required
object (ledgerpb.Budget)
businessId
required
string

Responses

Request samples

Content type
application/json
{
  • "budget": {
    },
  • "businessId": "xxxx-xxxx-xxxx-xxxx"
}

Response samples

Content type
application/json
{
  • "budget": {
    }
}

Updates a budget

Updates an existing budget for a business.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Budget to update

required
object (ledgerpb.Budget)

Responses

Request samples

Content type
application/json
{
  • "budget": {
    }
}

Response samples

Content type
application/json
{
  • "budget": {
    }
}

Calculates budgets by category report

Calculates the expenses and budgets for each category for a business

query Parameters
businessId
required
string

Business ID

period
required
string

period to calculate

timezone
required
string

Time zone to calculate in

dateTime
string

Date & time to calculate in. If missing, uses the end of the current day in the specified time zone

startDate
string

For custom periods, the start date & time of the period

endDate
string

For custom periods, the end date & time of the period. It can also specify the end date of preset periods.

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "expenseBudgets": [
    ]
}

Calculates budget totals report

Calculates the total expenses and budgets for a business.

query Parameters
businessId
required
string

Business ID

period
required
string

period to calculate

timezone
required
string

Time zone to calculate in

dateTime
string

Date & time to calculate in. If missing, uses the end of the current day in the specified time zone

startDate
string

For custom periods, the start date & time of the period

endDate
string

For custom periods, the end date & time of the period. It can also specify the end date of preset periods.

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "budgetTotal": "230",
  • "expenseTotal": "100"
}

Business

Endpoints for managing businesses. Businesses are the main entity within the ledger. A user can have multiple businesses. Each business has its own set of accounts, transactions, contacts, etc.

Deletes a business

Deletes an existing business.

query Parameters
id
string

ID of business

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves businesses

Retrieves a business by ID or all of a user's businesses by user ID.

query Parameters
id
string

ID of Business

userId
string

ID of User

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "businesses": [
    ]
}

Patches a business

Updates individual business properties. Only those properties with non-empty values will be changed by the operation. If any properties need to be cleared, use the Put endpoint instead.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Business to patch

required
object (ledgerpb.Business)

Responses

Request samples

Content type
application/json
{
  • "business": {
    }
}

Response samples

Content type
application/json
{
  • "business": {
    }
}

Creates a business

Creates a new business. Users must then be added to the business for access. In general, the register endpoint should be used instead.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Business to create

required
object (ledgerpb.Business)

Responses

Request samples

Content type
application/json
{
  • "business": {
    }
}

Response samples

Content type
application/json
{
  • "business": {
    }
}

Puts a business

Updates all the business properties

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Business to put

required
object (ledgerpb.Business)

Responses

Request samples

Content type
application/json
{
  • "business": {
    }
}

Response samples

Content type
application/json
{
  • "business": {
    }
}

Deletes user access from a business

Removes a user's access to a business.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

User to delete

businessId
string
userIds
Array of strings

Responses

Request samples

Content type
application/json
{
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "userIds": [
    ]
}

Response samples

Content type
application/json
{ }

Gives user access to a business

Gives a user access to a business. This is required after creating a business o that the User can access the business when logging in.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

User to add

businessId
string
userIds
Array of strings

Responses

Request samples

Content type
application/json
{
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "userIds": [
    ]
}

Response samples

Content type
application/json
{ }

Payment Method

Endpoints for managing payment methods to pay for expenses. These are used by the TSE app as a more user-friendly abstraction than a source account. They are essentially synonyms for accounts however and are optional.

Deletes a payment method

Deletes an existing payment method for a business.

query Parameters
id
string

ID of PaymentMethod

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves payment methods

Retrieves payment methods either by payment method id, business id, or user id.

query Parameters
id
string

ID of PaymentMethod

businessId
string

Query PaymentMethod for a specific business

userId
string

Query PaymentMethod for a specific FA user

demo
string

Flag to request demo business data

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "paymentMethods": [
    ]
}

Creates a payment method

Creates a payment method for a business.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Payment method to create

businessId
required
string
required
object (ledgerpb.PaymentMethod)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "paymentMethod": {
    }
}

Response samples

Content type
application/json
{
  • "paymentMethod": {
    }
}

Updates a payment method

Updates an existing payment method.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Payment method to update

businessId
required
string
required
object (ledgerpb.PaymentMethod)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "paymentMethod": {
    }
}

Response samples

Content type
application/json
{
  • "paymentMethod": {
    }
}

Report

Endpoints for reports on transaction data. These compute reports based on a business's transaction data.

Calculates the budget spending report

Creates a report for the budgets that the business has set on transaction categories. For every category with a budget set on it, the total amount of expenses for that time period is calculated. The monthly budget amount is also converted to an amount for the requested period. The overall transaction amount for the budgeted categories and their budgeted amount is returned as well.

query Parameters
businessId
required
string

Business ID

demo
string

Flag to request demo business data

period
required
string

Period for calculation

transactionGroupType
string

Group type of budgets

timezone
required
string

Time zone to calculate in

startDate
string

For custom periods, the start date & time of the period. This boundary is inclusive (>=).

endDate
string

For custom periods, the end date & time of the period. This boundary is inclusive (<=). It can also specify the end date of preset periods.

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "budgetTotal": "string",
  • "endDate": "2019-10-12T07:20:50.52Z",
  • "expenseBudgets": [
    ],
  • "expenseTotal": "string",
  • "startDate": "2019-10-12T07:20:50.52Z"
}

Calculates spending over all categories

Calculates a time series of amounts for every category as well as aggregate statistics such as total amount of transactions, the sum, avg, min, and max of the amounts. The results can be filtered to only business or only personal categories.

query Parameters
businessId
required
string

Business ID

demo
string

Flag to request demo business data

period
required
string

Period for calculation

transactionGroupType
string

Group type of transactions

timezone
required
string

Time zone to calculate in

startDate
string

For custom periods, the start date & time of the period. This boundary is inclusive (>=).

endDate
string

For custom periods, the end date & time of the period. This boundary is inclusive (<=). It can also specify the end date of preset periods.

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Calculates detailed spending on a category

Calculates a report of the expenses and budgets for a particular category for a business

query Parameters
businessId
required
string

Business ID

category
required
string

Account category

demo
string

Flag to request demo business data

period
required
string

Period for calculation

timezone
required
string

Time zone to calculate in

startDate
string

For custom periods, the start date & time of the period. This boundary is inclusive (>=).

endDate
string

For custom periods, the end date & time of the period. This boundary is inclusive (<=). It can also specify the end date of preset periods.

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "historicData": {
    }
}

Calculates transaction amounts on a time series

Calculates a time series of amounts for all transactions as well as aggregate statistics such as total amount of transactions, the sum, avg, min, and max of the amounts. The results can be filtered to only business or only personal categories.

query Parameters
businessId
required
string

Business ID

demo
string

Flag to request demo business data

period
required
string

Period for calculation

transactionGroupType
string

Group type of transactions

timezone
required
string

Time zone to calculate in

startDate
string

For custom periods, the start date & time of the period. This boundary is inclusive (>=).

endDate
string

For custom periods, the end date & time of the period. This boundary is inclusive (<=). It can also specify the end date of preset periods.

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Exports transactions to a file

Used for exporting all or a subset of business transactions to a file. The request is synchronous and will return a CSV file with the transactions.

query Parameters
businessId
required
string

Business ID

demo
string

Flag to use demo business data for the export

period
required
string

Period for the export

transactionGroupType
string

Group type of transactions

timezone
required
string

Time zone to calculate in

startDate
string

For custom periods, the start date & time of the period. This boundary is inclusive (>=).

endDate
string

For custom periods, the end date & time of the period. This boundary is inclusive (<=). It can also specify the end date of preset periods.

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Tax

Endpoints for managing taxes for a business.

Retrieve taxes

Retrieve one or more taxes by ID, by rate ID, or all of a business's taxes by business ID.

query Parameters
id
string

Comma separated list of tax ids

businessId
string

Business ID to get taxes for

rateId
string

Comma separated list of tax rade ids

demo
string

Flag to request demo business data

archived
string

Flag to filter by archived or not archived taxes

page
integer

Page Number: 1 is the first page

pageSize
integer

Number of results per page

search
string

search term to search for taxes

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "taxes": [
    ]
}

Create a tax

Create a tax for a business. The tax can have multiple rates. Ids can be empty strings.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Tax to create

businessId
required
string
required
object (ledgerpb.Tax)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "tax": {
    }
}

Response samples

Content type
application/json
{
  • "tax": {
    }
}

Update a tax

Update an existing tax for a business. Most tax properties (like name) are immutable and cannot be updated. Some like description and registrationNumber can. This endpoint is also used to add new rates to a tax. The new rates can have empty string ids.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Tax to update

businessId
required
string
required
object (ledgerpb.Tax)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "tax": {
    }
}

Response samples

Content type
application/json
{
  • "tax": {
    }
}

Transaction

Endpoints for managing transactions for a business.

Performs an action on an estimate.

Allows the user to perform an action on an estimate. Actions are things like marking as viewed, accepted, or void.

Request Body schema: application/json
required

Action request

action
required
string
businessId
string
id
required
string

The id of the estimate to perform the action on

Responses

Request samples

Content type
application/json
{
  • "action": "TRANSACTION_ACTION_SET_ACCEPTED",
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "id": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Response samples

Content type
application/json
{
  • "transaction": {
    }
}

post-estimate-reminder

Sends a reminder for an estimate to the client.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Reminder Request

businessId
string
contactInfo
string
customMessage
string
documentId
required
string
type
integer

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "contactInfo": "string",
  • "customMessage": "string",
  • "documentId": "string",
  • "type": 0
}

Response samples

Content type
application/json
{ }

Deletes transactions

Deletes existing transactions for a business.

query Parameters
id
required
string

IDs of Transactions with a comma

userId
string

User ID when anonymous

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves transactions

Retrieves transactions either by one or more transaction ids, an account id, or a business id. THe transactions returned can be of any type, or a type filter can be specified.

query Parameters
ids
string

Comma separated list of transaction IDs to retrieve

businessId
string

Business ID

userId
string

User ID to get transactions for when anonymous

accountId
string

Account ID

category
string

Category filter

demo
string

Flag to request demo business data

transactionGroupType
string

Group type of transactions

paymentMethodId
string

Payment Method id of transactions

type
string

Transaction type filter

page
integer

Page Number: 1 is the first page

pageSize
integer

Number of results per page

period
string

Period filter

fromDate
string

Transaction start date

toDate
string

Transaction start date

search
string

Query tern for searching through transactions

filter
string

Filter term for searching through transactions

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "totalTransactions": 0,
  • "transactions": [
    ]
}

Creates transactions

Creates one or more transactions for a business.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Transaction to create

businessId
required
string
required
Array of objects (ledgerpb.Transaction)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "transactions": [
    ]
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Updates transactions

Updates one or more existing transactions for a business.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Transactions to update

businessId
required
string
required
Array of objects (ledgerpb.Transaction)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "transactions": [
    ]
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Performs an action on a transaction.

Allows the user to perform an action on a transaction. Actions are things like requesting email previews or sending a payment reminder.

Request Body schema: application/json
required

Action request

action
required
string
businessId
string
id
string

The id of the transaction to perform the action on.

object (ledgerpb.Transaction)

Responses

Request samples

Content type
application/json
{
  • "action": "TRANSACTION_ACTION_PREVIEW",
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "id": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "transaction": {
    }
}

Response samples

Content type
application/json
{
  • "transaction": {
    }
}

Retrieves expenses

Retrieves expenses and/or bills either by one or more transaction ids, or a business id. This endpoint is mostly a synonym of GET /transactions but it only returns expenses and bills and has query params specific to these transaction types.

query Parameters
ids
string

Comma separated list of expense IDs to retrieve

businessId
string

Business ID

userId
string

User ID to retrieve expenses for when anonymous

accountId
string

Account ID

category
string

Category filter

demo
string

Flag to request demo business data

transactionGroupType
string

Group type of transactions

paymentMethodId
string

Payment Method id of transactions

page
integer

Page Number: 1 is the first page

pageSize
integer

Number of results per page

period
string

Period filter

fromDate
string

Transaction start date

toDate
string

Transaction start date

search
string

Query tern for searching through expenses

filter
string

Filter term for searching through expenses

billOnly
boolean

Flag to return only bills (and exclude expenses)

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "totalTransactions": 0,
  • "transactions": [
    ]
}

Generates SVGs based on provided template variables

Generates SVGs using parameters such as id, color, isDarkMode, and svgAttributes. The response is an array of SVG strings.

query Parameters
id
string

ID

color
required
string

Color

isDarkMode
boolean

Is Dark Mode

svgAttributes
string

SVG Attributes

Responses

Response samples

Content type
application/json
{
  • "svgs": [
    ]
}

Retrieves incomes

Retrieves incomes and/or invoices either by one or more transaction ids, or a business id. This endpoint is mostly a synonym of GET /transactions but it only returns incomes and invoices and has query params specific to these transaction types.

query Parameters
ids
string

Comma separated list of transaction IDs to retrieve

businessId
string

Business ID to retrieve all business incomes

userId
string

User ID to retrieve incomes for when anonymous

page
integer

Page number. 1 is the first page

pageSize
integer

Number of results per page

fromDate
string

Earliest date that returned incomes should have

toDate
string

Latest date that returned incomes should have

search
string

Query tern for searching through incomes

filter
string

Filter term for searching through incomes

statuses
string

Comma separated list of income statuses to filter by

invoiceOnly
boolean

Flag to return only invoices (and exclude incomes)

header Parameters
Authorization
string

Bearer token authorization header

Responses

Response samples

Content type
application/json
{
  • "totalTransactions": 0,
  • "transactions": [
    ]
}

post-transaction-reminder

Sends a reminder for a transaction to the client.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Reminder Request

businessId
string
contactInfo
string
customMessage
string
documentId
required
string
type
integer

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "contactInfo": "string",
  • "customMessage": "string",
  • "documentId": "string",
  • "type": 0
}

Response samples

Content type
application/json
{ }

Attachment

Provides uploads and downloads of data such as attachments, logos, and so on. Namespace is one of attachments | downloads. Download blobs are auto-expiring.

Deletes all attachments for a business.

Delete every attachment/file that a business has uploaded. This is to clean up their data.

path Parameters
businessId
required
string

id of business

header Parameters
Authorization
required
string

Example: foo

Responses

Uploads multiple attachments

Uploads one or more attachments/files for a particular business, given a namespace and businessId. The uuids are returned in the response in the same order that the blobs were uploaded.

path Parameters
namespace
required
string

the namespace of the blobs

businessId
required
string

id of business

header Parameters
Authorization
required
string

Example: foo

Request Body schema: multipart/form-data
required
file
required
string <binary>

Blob

Responses

Deletes an attachment

Delete an attachment/file, given a namespace, businessId and uuid

path Parameters
namespace
required
string

the namespace of the blob

businessId
required
string

id of business

uuid
required
string

id of the blob

header Parameters
Authorization
required
string

Example: foo

Responses

Download an attachment

Returns an attachment/file given a namespace, businessId and uuid

path Parameters
namespace
required
string

the namespace of the blob

businessId
required
string

id of business

uuid
required
string

id of the blob

Responses

Gets attachment metadata

Returns the attachment's/file's metadata given a namespace, businessId and uuid. This is useful for getting the attachemnt's mime type, filename, or size.

path Parameters
namespace
required
string

the namespace of the blob

businessId
required
string

id of business

uuid
required
string

id of the blob

Responses

Uploads an attachment to a particular id

Uploads an attachment/file to a particular uuid, given a namespace, businessId and uuid

path Parameters
namespace
required
string

the namespace of the blob

businessId
required
string

id of business

uuid
required
string

id of the blob

header Parameters
Authorization
required
string

Example: foo

Request Body schema: multipart/form-data
required
file
required
string <binary>

Blob

Responses

Updates an attachment

Upload an attachment/file to a particular uuid, given a namespace, businessId and uuid

path Parameters
namespace
required
string

the namespace of the blob

businessId
required
string

id of business

uuid
required
string

id of the blob

header Parameters
Authorization
required
string

Example: foo

Request Body schema: multipart/form-data
required
file
required
string <binary>

Blob

Responses

Bank Feed

Endpoints for adding bank connections via Plaid. This allows for automatic import of bank transactions into a business ledger.

Deletes a bank feed

Deletes an existing bank feed for a business.

query Parameters
businessId
required
string

ID of Business that the feed belongs to

bankFeedId
required
string

ID of bank feed

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves bank feeds

Retrieves a bank feed by ID or all of a business's bank feeds by business ID.

query Parameters
businessId
required
string

ID of Business to retrieve Bank Feeds for

id
string

ID of Bank Feed

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "bankFeeds": [
    ]
}

Updates bank feed account connections.

Updates the connections between a bank feed and its ledger accounts. This is needed to associate a bank feed account with a ledger account so that transactions can be ingested into the business's ledger.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Bank Feeds to update

required
object (serverpb.BankFeed)
businessId
required
string

Responses

Request samples

Content type
application/json
{
  • "bankFeed": {
    },
  • "businessId": "string"
}

Response samples

Content type
application/json
{
  • "bankFeed": {
    }
}

Creates Plaid link token for adding

Call this endpoint to create the token needed to launch Plaid Link for a business so that they can add a new bank connection. This info should be passed to the Plaid Link js library to launch their UI. The response, if successful, should be passed to the response endpoint to complete set-up.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Plaid Link add request

androidPackageName
string
businessId
required
string
customizationName
string
language
string
locales
Array of strings
redirectUrl
string

Responses

Request samples

Content type
application/json
{
  • "androidPackageName": "string",
  • "businessId": "string",
  • "customizationName": "string",
  • "language": "string",
  • "locales": [
    ],
  • "redirectUrl": "string"
}

Response samples

Content type
application/json
{
  • "businessId": "string",
  • "expiration": "2019-10-12T07:20:50.52Z",
  • "linkToken": "string"
}

Post Plaid Link response

Call this endpoint with the response returned by Plaid Link to complete a new bank connection for a business. If successful, a corresponding Bank Feed object will be created for the business.

Request Body schema: application/json
required

Plaid Link response request

businessId
required
string
publicToken
required
string
timezone
required
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "publicToken": "string",
  • "timezone": "string"
}

Response samples

Content type
application/json
{
  • "bankFeed": {
    }
}

Creates Plaid link token for update

Call this endpoint to create the token needed to launch Plaid Link for a business so that they can update an existing bank connection. This info should be passed to the Plaid Link js library to launch their UI. The response, if successful, should be passed to the response endpoint to complete set-up.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Plaid Link add request

androidPackageName
string
bankFeedId
required
string
businessId
required
string
customizationName
string
language
string
locales
Array of strings
redirectUrl
string

Responses

Request samples

Content type
application/json
{
  • "androidPackageName": "string",
  • "bankFeedId": "string",
  • "businessId": "string",
  • "customizationName": "string",
  • "language": "string",
  • "locales": [
    ],
  • "redirectUrl": "string"
}

Response samples

Content type
application/json
{
  • "expiration": "2019-10-12T07:20:50.52Z",
  • "linkToken": "string"
}

Refreshes a bank feed

Refreshes a bank feed to get the latest transactions. There is an option to refresh the feed with just the bank feed provider (like Plaid), to synchronize with their database, or to ask the provider to refresh with the bank itself.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Refresh request

bankFeedId
required
string
businessId
required
string
refreshWithBank
required
boolean

Responses

Request samples

Content type
application/json
{
  • "bankFeedId": "string",
  • "businessId": "string",
  • "refreshWithBank": true
}

Response samples

Content type
application/json
{ }

Categorization Rule

Endpoints for managing categorization rules for transactions. Categorization rules are used to automatically categorize transactions imported from bank feed providers. They take the suggestions provided by the bank feed provider and map them to category accounts. The business is able to refine these rules to suit their purposes.

Deletes a rule

Deletes a categorization rule for a business.

query Parameters
businessId
required
string

ID of Business that the feed belongs to

category
required
string

category for the rule

merchant
string

merchant for the rule

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves rules

Retrieves a business's categorization rules by business ID.

query Parameters
businessId
required
string

ID of Business to retrieve rules for

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "rules": [
    ]
}

Updates a rule

Updates a specific categorization rule to change how it is used to categorize transactions. This endpoint is used to allow users to edit existing rules in a rules editor ui.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Categorization Rule to update

businessId
required
string
required
object (serverpb.CategorizationRule)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "rule": {
    }
}

Response samples

Content type
application/json
{ }

Categorizes a transaction

Categorizes the transaction according to the categorization rules. This is used when the user changes the category of a transaction. The result should be compared against the user's chosen category and, if they're different, the user can be prompted about whether they want to update the categorization rules.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Categorization Rule to update

businessId
required
string
transactionId
required
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "transactionId": "string"
}

Response samples

Content type
application/json
{
  • "transaction": {
    }
}

Updates rules from a transaction

Creates a new categorization rule or updates an existing one from a transaction. This is used when the user wants to change the category of an existing transaction.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Categorization Rule to update

accountCategory
integer

The category that should be used for this rule. Can be NONE if accountId is set instead.

accountId
string

The account that should be used for this rule. Can be empty if a category is set instead.

businessId
required
string
merchant
string

The merchant that should be used for this rule. Should be either the transaction merchant, or empty.

taxes
Array of strings

The taxes that should be used for this rule.

transactionId
required
string

Responses

Request samples

Content type
application/json
{
  • "accountCategory": 0,
  • "accountId": "string",
  • "businessId": "string",
  • "merchant": "string",
  • "taxes": [
    ],
  • "transactionId": "string"
}

Response samples

Content type
application/json
{ }

Contact

TSI and TSE

Deletes a contact

Deletes a contact based on the ContactID

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

DeleteContactRequest

businessId
string
id
required
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "id": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{ }

Retrieves contacts

Retrieves contacts for a business using several possible filters such as user ID, business ID, name, and emails.

query Parameters
id
string

ID(s) of contacts

userId
string

User ID

businessId
string

Business ID

name
string

Name of contact

emails
string

Emails of contacts

page
integer

Page Number: 1 is the first page

archived
string

Flag to filter by archived or not archived contacts

pageSize
integer

Number of results per page

search
string

Search contacts using meilisearch

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "contact": [
    ],
  • "totalContacts": 0
}

Creates a contact

Creates a new contact for a business.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

CreateContactRequest

required
Array of objects (serverpb.Contact)
namespace
string

An optional namespace for the contact to allow for multiple contact lists

Responses

Request samples

Content type
application/json
{
  • "contact": [
    ],
  • "namespace": "string"
}

Response samples

Content type
application/json
{
  • "contact": [
    ]
}

Updates a contact

Updates a contact for a business.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

UpdateContactRequest

required
object (serverpb.Contact)
namespace
string

Responses

Request samples

Content type
application/json
{
  • "contact": {
    },
  • "namespace": "string"
}

Response samples

Content type
application/json
{
  • "contact": {
    }
}

OCR

Endpoints for performing optical character recognition (OCR) on source documents such as images or pdfs of receipts.

Process a file using OCR

Uploads a file to temporary storage and runs OCR on it. A transaction object is returned giving the fields that were processed.

path Parameters
businessId
required
string

id of business

header Parameters
Authorization
string

Example: foo

Request Body schema: multipart/form-data
required
currency
string

suggested currency code

file
required
string <binary>

Blob

timezone
required
string

suggested timezone

transactionGroupType
string

suggested transaction Group Type, default is TRANSACTION_GROUP_TYPE_BUSINESS

transactionType
string

suggested transaction type, default is TRANSACTION_TYPE_EXPENSE

Responses

Response samples

Content type
application/json
{
  • "createdTaxes": [
    ],
  • "suggestedPaymentMethod": {
    },
  • "transaction": {
    }
}

Payment

Endpoints for managing payment processors for a business. These are used to accept payments from clients.

Disconnects a business from Stripe

Removes the connection of a Stripe account from a business. This means that online payments can no longer be accepted for invoices.

query Parameters
businessId
string

Business to disconnect from Stripe

userId
string

User to disconnect from Stripe

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves payment account info

Returns all the information about the business's Stripe payment account including the currency and capabilities. If the business has not onboarded, returns a 204 No Content

query Parameters
businessId
string

Business ID

userId
string

User ID

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "account": {
    }
}

Creates an onboarding link for Stripe Connect.

Begins the onboarding process for Stripe Connect and returns a Stripe url for the user to complete the process.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

OnBoardRequest

accountType
string
object (serverpb.Address)
businessId
string

The id of the business that the stripe account is being created for.

email
string
fullName
string
phone
string
refreshUrl
string
returnUrl
string
userId
string

This field is deprecated. Use businessId instead.

Responses

Request samples

Content type
application/json
{
  • "accountType": "string",
  • "address": {
    },
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "email": "string",
  • "fullName": "string",
  • "phone": "string",
  • "refreshUrl": "string",
  • "returnUrl": "string",
  • "userId": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Response samples

Content type
application/json
{
  • "accountId": "string",
  • "accountLinkUrl": "string",
  • "onboarded": true
}

Associates a bank with a customer

Associates a bank (token) with a customer of a business, allowing them to pay invoices with ACH.

Request Body schema: application/json
required

StripeBankTokenRequest

email
string
invoiceId
string
token
string

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "invoiceId": "string",
  • "token": "string"
}

Response samples

Content type
application/json
{ }

Verifies a customer's bank

Verifies a customers bank with micro amounts

Request Body schema: application/json
required

StripeBankVerificationRequest

amounts
Array of integers
email
string
invoiceId
string

Responses

Request samples

Content type
application/json
{
  • "amounts": [
    ],
  • "email": "string",
  • "invoiceId": "string"
}

Response samples

Content type
application/json
{
  • "status": "string"
}

Creates a checkout session for paying an invoice

Returns the information needed to launch Stripe to pay for an invoice.

Request Body schema: application/json
required

CheckoutSessionsRequest

cancelUrl
string
email
string
invoiceId
string
paymentRequestId
string

A string id referring to the invoice that is being paid. This would have been generated by the user and sent to the client.

successUrl
string

Responses

Request samples

Content type
application/json
{
  • "cancelUrl": "string",
  • "email": "string",
  • "invoiceId": "string",
  • "paymentRequestId": "string",
  • "successUrl": "string"
}

Response samples

Content type
application/json
{
  • "sessionAlipayId": "string",
  • "sessionCardId": "string"
}

Retrieves payment methods

Returns the payment methods available when paying an invoice for a business. This information is required to display the payment options and fees to the invoice client.

query Parameters
businessId
string

Business ID

userId
string

User ID

Responses

Response samples

Content type
application/json
{
  • "account": {
    }
}

Updates a payment method on a Stripe account.

This is used for updating properties on the payment method, such as the convenience fee and whether it is enabled.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

UpdatePaymentMethodRequest

businessId
string

The id of the business that the payment method is being updated for.

object (serverpb.PaymentMethod)
userId
string

This field is deprecated. Use businessId instead.

Responses

Request samples

Content type
application/json
{
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "paymentMethod": {
    },
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "paymentMethod": {
    }
}

Retrieves invoice for a payment request

Returns all the information needed to display a payable invoice and make an online payment for it. This is part of the payment process for clients. The request is identified by the unique id returned when the payment request was created (and this id is shared with the client).

query Parameters
paymentRequestID
string

Payment Request ID

Responses

Response samples

Content type
application/json
{
  • "invoice": {
    },
  • "payable": true
}

Creates a payment request

Creates a request to receive online payments for an invoice using the payment service. This stores the info needed to accept payments for the invoice and returns a unique id to share with the client.

Request Body schema: application/json
required

CreatePaymentRequestRequest

businessId
required
string

The business that created the invoice

invoiceId
required
string

The invoice that needs to be paid

Responses

Request samples

Content type
application/json
{
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "invoiceId": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Response samples

Content type
application/json
{
  • "paymentRequestId": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Estimate

TSI

Deletes an estimate

Deletes an estimate. This is only available for draft estimates. Estimates that have already been sent cannot be deleted.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Delete request

businessId
string
id
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "id": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{ }

Retrieves estimates

Retrieves one or more estimates, either by user id, or by a comma separated list of estimate ids.

query Parameters
id
string

ID(s) of Estimates

businessId
string

Business ID to get estimates for

userId
string

User ID to get estimates for

uid
string

ID of user when viewing as a client

status
string

comma separated list of estimate statuses to filter by

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "estimate": [
    ]
}

Creates an estimate

Creates an estimate for the business.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

CreateEstimateRequest

businessId
string
object (serverpb.Estimate)
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "estimate": {
    },
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "estimate": {
    }
}

Updates an estimate

Updates an estimate, for example to note that the target client has accepted it.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

EstimateUpdatedRequest

businessId
string
Array of objects (serverpb.Estimate)
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "estimate": [
    ],
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "estimate": [
    ]
}

Delete an estimate

Delete an estimate. This is only available for draft estimates. Estimates that have already been sent cannot be deleted.

query Parameters
id
required
string

estimate id

businessId
required
string

business id

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{ }

Retrieves estimates

Retrieves one or more estimates, either by business id, or by a comma separated list of estimate ids.

query Parameters
ids
string

Comma separated list of estimate ids

businessId
string

Business ID to get estimates for

statuses
string

comma separated list of estimate statuses to filter by

search
string

Query tern for searching through estimates

page
integer

Page Number: 1 is the first page

pageSize
integer

Number of results per page

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "totalTransactions": 0,
  • "transactions": [
    ]
}

Creates estimates

Creates one or more estimates for the business.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Estimates to create

businessId
required
string
required
Array of objects (ledgerpb.Transaction)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "transactions": [
    ]
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Updates estimates

Updates one or more estimate, for example to note that the target client has accepted it.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Estimates to update

businessId
required
string
required
Array of objects (ledgerpb.Transaction)

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "transactions": [
    ]
}

Response samples

Content type
application/json
{
  • "transactions": [
    ]
}

Invoice

TSI

Deletes an invoice.

Deletes an invoice for a user. This is only available for draft invoices. Invoices sent to clients cannot be deleted.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Draft Invoice object to be deleted

businessId
string
id
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "id": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{ }

Retrieves invoices

Retrieves one or more invoices, either by user id, or by a comma separated list of invoice ids.

query Parameters
id
string

ID(s) of invoices, separated by commas

businessId
string

Business ID to get invoices for

userId
string

User ID to get invoices for

verifypayment
boolean

set to indicate that a client is viewing the invoice

viewing
boolean

set to indicate that a client is viewing the invoice

status
string

comma separated list of invoice statuses to filter by

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "invoice": [
    ]
}

Creates an invoice

Creates an invoice for a user.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

CreateInvoiceRequest

businessId
string
businessName
string
estimateId
string
object (serverpb.Invoice)
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "businessName": "string",
  • "estimateId": "string",
  • "invoice": {
    },
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "invoice": {
    }
}

Updates an invoice

Updates an existing invoice for a user.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

InvoiceUpdatedRequest

businessId
string
businessName
string
Array of objects (serverpb.Invoice)
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "businessName": "string",
  • "invoice": [
    ],
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "invoice": [
    ]
}

Sends an invoice preview email

Allows a user to preview what an invoice and invoice email will look like before creating an actual invoice. The invoice is not saved and is not real yet, but the user can see what it will look like.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Invoice Preview Request

businessId
string
object (serverpb.Invoice)
previewEmail
required
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "invoice": {
    },
  • "previewEmail": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "url": "string"
}

Invoice Tax

Endpoints for managing taxes for TS Invoicing businesses. These taxes are specific to that application and not shared with the ledger.

Deletes a tax

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Tax object to be deleted

businessId
string
id
required
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "businessId": "string",
  • "id": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{ }

Retrieves taxes

query Parameters
id
string

Ids of taxes to get

businessId
string

Business ID to get taxes for

userId
string

User ID to get taxes for

search
string

Search transactions using meilisearch

header Parameters
Authorization
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "taxes": [
    ]
}

Creates a tax

Creates a TSI tax for a business or user to use for estimates and invoices.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Tax object to be added

required
Array of objects (serverpb.Tax)

Responses

Request samples

Content type
application/json
{
  • "tax": [
    ]
}

Response samples

Content type
application/json
{
  • "tax": [
    ]
}

Updates a tax

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Tax object to be modified

required
object (serverpb.Tax)

Responses

Request samples

Content type
application/json
{
  • "tax": {
    }
}

Response samples

Content type
application/json
{
  • "tax": {
    }
}

User

User related settings and storage that is needed for the TSI application.

Deletes document settings

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

DocumentSetting object to be deleted

businessId
string

The id of the business to delete settings for

id
string
userId
string

The id of the user to delete settings for

Responses

Request samples

Content type
application/json
{
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "id": "string",
  • "userId": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Response samples

Content type
application/json
{ }

Retrieves document settings

query Parameters
id
string

ID(s)

businessId
string

Business ID

userId
string

User ID

header Parameters
Authorization
required
string

Example: Bearer foo

Responses

Response samples

Content type
application/json
{
  • "documentSettings": {
    }
}

Creates document settings

These are the default settings used to populate new invoices in TSI.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

DocumentSetting object to be added

businessId
string

The id of the business that the settings belong to

object (serverpb.DocumentSettings)
userId
string

The id of the user that the settings belong to

Responses

Request samples

Content type
application/json
{
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "documentSettings": {
    },
  • "userId": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Response samples

Content type
application/json
{
  • "documentSettings": {
    }
}

Updates document settings

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

DocumentSetting object to be modified

businessId
string

The id of the business to update the settings for

object (serverpb.DocumentSettings)
userId
string

The id of the user to update the settings for

Responses

Request samples

Content type
application/json
{
  • "businessId": "815b81c1-1650-4750-95b4-c6933e6df705",
  • "documentSettings": {
    },
  • "userId": "815b81c1-1650-4750-95b4-c6933e6df705"
}

Response samples

Content type
application/json
{
  • "documentSettings": {
    }
}

Indicates that user has hit the paywall

This endpoint is used to indicate that the user has hit the marketing paywall. This allows the backend to track the event.

Request Body schema: application/json
required

email and last invoice id

email
string
os
string

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "os": "string"
}

Response samples

Content type
application/json
{ }

Removes FCM token for mobile push notifications

This endpoint is used to remove the FCM token for mobile push notifications. Once removed, the user will no longer receive push notifications.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Delete FCM token request

sandbox
boolean
token
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "sandbox": true,
  • "token": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{ }

Stores FCM token for mobile push notifications

This endpoint is used to store the FCM token for mobile push notifications. Once stored, the user will receive push notifications for invoices and other events.

header Parameters
Authorization
string

Example: Bearer foo

Request Body schema: application/json
required

Add FCM token request

sandbox
boolean
token
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "sandbox": true,
  • "token": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{ }

Websocket

Websocket used for receiving notifications about a business. Currently only used by TSI on both web and mobile. Allows the client to receive notifications about subscriptions, invoices, and so on.

Opens a websocket

Opens a websocket that subscribes to subscription, payment, estimate, and invoice notifications. Use topics 'subscription', 'estimate', 'invoice', and 'payment' to subscribe to the different streams. The websocket protocol should be a comma separated value with three properties: application enum, business id, and the user's auth token. The client app needs to ACK each message with the msgID.

header Parameters
Sec-WebSocket-Protocol
required
string

Protocol. Includes the app, business id, and auth token

Request Body schema: application/json
required

WsRequest

msgId
string
topic
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "msgId": "string",
  • "topic": "string",
  • "userId": "string"
}

Response samples

Content type
application/json
{
  • "data": { },
  • "msgId": "string",
  • "type": "string"
}

Feature Toggles

Feature toggle implementation for TS.

Retrieves enabled feature toggles

Returns a list of the feature toggles that are currently enabled in the environment. These are represented as an array of strings.

Responses

Response samples

Content type
application/json
{
  • "toggles": [
    ]
}

Sets the feature toggles

Used to set all the feature toggles that should be enabled on the environment.

header Parameters
Authorization
required
string

Example: Bearer foo

Request Body schema: application/json
required

Toggles to enable

toggles
Array of strings

Responses

Request samples

Content type
application/json
{
  • "toggles": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "detail": "string",
  • "id": "string",
  • "status": "string"
}