Skip to main content

Invoices

Creating a Session Token

You can create a session token for this web component by using the request template below with the Salable API.

const response = await fetch('https://api.salable.app/sessions', {
method: "POST",
headers: {
"x-api-key": "YOUR_SALABLE_API_TOKEN",
version: "v2",
},
body: JSON.stringify({
scope: 'web-components:invoices',
metadata: {
subscriptionUuid: 'YOUR_SUBSCRIPTION_UUID'
}
})
})

const { sessionToken } = await response.json()

See the entire API docs for creating sessions for web components.

Examples

<!doctype html>
<head>
<title>Salable Invoices Web Component Example</title>
<script type="module">
import { defineCustomElements } from 'https://cdn.jsdelivr.net/npm/@salable/web-components@latest/loader/index.es2017.js';
defineCustomElements();
</script>
</head>
<body>
<salable-invoices class="theme" session-token="YOUR_SESSION_TOKEN" subscription-uuid="YOUR_SUBSCRIPTION_UUID" limit="3"></salable-invoices>
</body>
</html>

Properties

PropertyAttributeDescriptionTypeDefault
sessionToken (required)session-tokenThe generated token for this sessionstringundefined
subscriptionUuid (required)subscription-uuidThe uuid of the subscription that you want to display invoices for.stringundefined
limitlimitThe number of rows to display per pagenumber25