Components
Kind: view (fills its container) · Session key: salesInvoices · React: <FinBazeSalesInvoices />
Create the session#
mutation {
createEmbedSession(input: {
companyId: "…"
user: { externalUserId: "…" }
components: { salesInvoices: { enabled: true } }
}) { clientSecret }
}
Requirements#
The company must have these features effective: sales_invoices. A hidden feature makes createEmbedSession fail with FEATURE_DISABLED.
Component features#
Switch these off per session with components.salesInvoices.features.
| Feature | Default |
|---|---|
create | on |
send | on |
credit | on |
export | on |
Options#
Passed to instance.create("sales-invoices", options) or as props.
| Option | Type | |
|---|---|---|
status | "all" | "draft" | "open" | "overdue" | "paid" | Which invoices the list starts on. |
invoiceId | string | Open this invoice instead of the list. |
customerId | string | Only this customer's invoices. |
Every component also takes appearance and navigation ("internal" or "external").
Events#
| Event | React prop |
|---|---|
ready | onReady |
navigate | onNavigate |
error | onError |
invoice.sent | onInvoiceSent |
invoice.credited | onInvoiceCredited |
invoice.selected | onInvoiceSelected |
Use it#
import { FinBazeSalesInvoices } from "@finbaze/embed-react";
<FinBazeSalesInvoices />
const component = instance.create("sales-invoices");
component.mount("#finbaze");