UI SDK

Space Invoices provides a front-end SDK that allows loading different subpages in client facing applications.

The SDK provides additinal customization options like showing and hiding side and top menus, and an option to use a custom white label UI provided by Space Invoices.

Load SDK script in your website

<script src="https://sdk.spaceinvoices.com/sdk.js"></script>

Init the SDK

SpaceSDK.init({
  accessToken: 'ACCESS_TOKEN',
  organizationId: 'ORGANIZATION_ID',
  targetDivId: 'sdk',
});

Availabe options

accessToken
Account Access Token

organizationId
Id of Organization to load|

accessToken
Html div element id to load the iframe in|

whiteLabelDomain
Optional, use custom white label domain for the UI provided by Space Invoices. Contact us at support@spaceinvoices.com for further information.

hideHeadMenu
Optional, defaults is false. Option to hide the head menu on loaded page.

showSideMenu
Optional, default is false. Option to show side menu navigation.

disableAutoHeight
Optional, default is false. Disable auto iframe height adjustment.

Render a page

SpaceSDK.loadDashboard();

Availabel pages

SpaceSDK.loadDashboard()
Load dashboard page

SpaceSDK.loadListInvoices()
Load page with list of invoices

SpaceSDK.loadListEstimates()
Load page with list of estimates

SpaceSDK.loadListCreditNotes()
Load page with list of credit notes

SpaceSDK.loadListAdvances()
Load page with list of advances

SpaceSDK.loadCreateInvoice()
Load the create invoice page

SpaceSDK.loadCreateEstimate()
Load the create estimate page

SpaceSDK.loadCreateCreditNote()
Load the create credit note page

SpaceSDK.loadCreateAdvance()
Load the create advance page

SpaceSDK.loadViewDocument(id: string)
Load the view document by id page

Add a page event listener (optional)

SpaceSDK.addDocumentCreateListener((event) => {
  console.log('Document create event:', event);
});

Available listeners

SpaceSDK.addCreateDocumentListener()
Add listener for the create document page. Returned event contains created document data including document type.

Next: Changelog >