@epilot/sdk 2.1.0-rc.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/app.json +38 -0
- package/definitions/automation.json +2 -37
- package/definitions/blueprint-manifest-runtime.json +1 -1
- package/definitions/blueprint-manifest.json +115 -1
- package/definitions/customer-portal-runtime.json +1 -1
- package/definitions/customer-portal.json +279 -42
- package/definitions/data-management.json +10 -0
- package/definitions/email-template.json +25 -3
- package/definitions/entity.json +205 -3
- package/definitions/erp-integration-runtime.json +1 -1
- package/definitions/erp-integration.json +472 -13
- package/definitions/journey.json +257 -12
- package/definitions/kanban.json +630 -78
- package/definitions/organization-runtime.json +1 -1
- package/definitions/organization.json +614 -51
- package/definitions/workflow.json +40 -0
- package/dist/README-VG67PX4R.js +7 -0
- package/dist/README-W4B35MRN.cjs +7 -0
- package/dist/_index-AMVZBT2K.cjs +99 -0
- package/dist/_index-S6LFD3ER.js +99 -0
- package/dist/access-token-6BJDZSFE.cjs +7 -0
- package/dist/access-token-GSQZLDXR.js +7 -0
- package/dist/address-HA4RMRNQ.cjs +7 -0
- package/dist/address-QVJUGMOG.js +7 -0
- package/dist/address-suggestions-74244BAJ.js +7 -0
- package/dist/address-suggestions-IUQMYF27.cjs +7 -0
- package/dist/ai-agents-IZWFEUSH.js +7 -0
- package/dist/ai-agents-PWHKNRCX.cjs +7 -0
- package/dist/apis/access-token.cjs +10 -13
- package/dist/apis/access-token.js +7 -10
- package/dist/apis/address-suggestions.cjs +10 -13
- package/dist/apis/address-suggestions.js +7 -10
- package/dist/apis/address.cjs +10 -13
- package/dist/apis/address.js +7 -10
- package/dist/apis/ai-agents.cjs +10 -13
- package/dist/apis/ai-agents.js +7 -10
- package/dist/apis/app.cjs +10 -13
- package/dist/apis/app.js +7 -10
- package/dist/apis/audit-logs.cjs +10 -13
- package/dist/apis/audit-logs.js +7 -10
- package/dist/apis/automation.cjs +10 -13
- package/dist/apis/automation.js +7 -10
- package/dist/apis/billing.cjs +10 -13
- package/dist/apis/billing.js +7 -10
- package/dist/apis/blueprint-manifest.cjs +10 -13
- package/dist/apis/blueprint-manifest.js +7 -10
- package/dist/apis/consent.cjs +10 -13
- package/dist/apis/consent.js +7 -10
- package/dist/apis/customer-portal.cjs +10 -13
- package/dist/apis/customer-portal.js +7 -10
- package/dist/apis/dashboard.cjs +10 -13
- package/dist/apis/dashboard.js +7 -10
- package/dist/apis/data-management.cjs +10 -13
- package/dist/apis/data-management.js +7 -10
- package/dist/apis/deduplication.cjs +10 -13
- package/dist/apis/deduplication.js +7 -10
- package/dist/apis/design.cjs +10 -13
- package/dist/apis/design.js +7 -10
- package/dist/apis/document.cjs +10 -13
- package/dist/apis/document.js +7 -10
- package/dist/apis/email-settings.cjs +10 -13
- package/dist/apis/email-settings.js +7 -10
- package/dist/apis/email-template.cjs +10 -13
- package/dist/apis/email-template.js +7 -10
- package/dist/apis/entity-mapping.cjs +10 -13
- package/dist/apis/entity-mapping.js +7 -10
- package/dist/apis/entity.cjs +10 -13
- package/dist/apis/entity.js +7 -10
- package/dist/apis/environments.cjs +10 -13
- package/dist/apis/environments.js +7 -10
- package/dist/apis/erp-integration.cjs +10 -13
- package/dist/apis/erp-integration.js +7 -10
- package/dist/apis/event-catalog.cjs +10 -13
- package/dist/apis/event-catalog.js +7 -10
- package/dist/apis/file.cjs +10 -13
- package/dist/apis/file.js +7 -10
- package/dist/apis/iban.cjs +10 -13
- package/dist/apis/iban.js +7 -10
- package/dist/apis/journey.cjs +10 -13
- package/dist/apis/journey.js +7 -10
- package/dist/apis/kanban.cjs +10 -13
- package/dist/apis/kanban.js +7 -10
- package/dist/apis/message.cjs +10 -13
- package/dist/apis/message.js +7 -10
- package/dist/apis/metering.cjs +10 -13
- package/dist/apis/metering.js +7 -10
- package/dist/apis/notes.cjs +10 -13
- package/dist/apis/notes.js +7 -10
- package/dist/apis/notification.cjs +10 -13
- package/dist/apis/notification.js +7 -10
- package/dist/apis/organization.cjs +10 -13
- package/dist/apis/organization.d.cts +2 -2
- package/dist/apis/organization.d.ts +2 -2
- package/dist/apis/organization.js +7 -10
- package/dist/apis/partner-directory.cjs +10 -13
- package/dist/apis/partner-directory.js +7 -10
- package/dist/apis/permissions.cjs +10 -13
- package/dist/apis/permissions.js +7 -10
- package/dist/apis/pricing-tier.cjs +10 -13
- package/dist/apis/pricing-tier.js +7 -10
- package/dist/apis/pricing.cjs +10 -13
- package/dist/apis/pricing.js +7 -10
- package/dist/apis/purpose.cjs +10 -13
- package/dist/apis/purpose.js +7 -10
- package/dist/apis/sandbox.cjs +10 -13
- package/dist/apis/sandbox.js +7 -10
- package/dist/apis/submission.cjs +10 -13
- package/dist/apis/submission.js +7 -10
- package/dist/apis/targeting.cjs +10 -13
- package/dist/apis/targeting.js +7 -10
- package/dist/apis/template-variables.cjs +10 -13
- package/dist/apis/template-variables.js +7 -10
- package/dist/apis/user.cjs +10 -13
- package/dist/apis/user.js +7 -10
- package/dist/apis/validation-rules.cjs +10 -13
- package/dist/apis/validation-rules.js +7 -10
- package/dist/apis/webhooks.cjs +10 -13
- package/dist/apis/webhooks.js +7 -10
- package/dist/apis/workflow-definition.cjs +10 -13
- package/dist/apis/workflow-definition.js +7 -10
- package/dist/apis/workflow.cjs +10 -13
- package/dist/apis/workflow.js +7 -10
- package/dist/app-IKHWU222.cjs +7 -0
- package/dist/app-VLM3SWKA.js +7 -0
- package/dist/audit-logs-5VXHOQ7S.js +7 -0
- package/dist/audit-logs-D2LFUA2R.cjs +7 -0
- package/dist/automation-3HGCK725.cjs +7 -0
- package/dist/automation-72VGEJCY.js +7 -0
- package/dist/billing-DUWDISHP.cjs +7 -0
- package/dist/billing-IPALEAG2.js +7 -0
- package/dist/blueprint-manifest-CXSCRQ5X.js +7 -0
- package/dist/blueprint-manifest-SHNZPK5O.cjs +7 -0
- package/dist/chunk-2HOJWFQ4.js +14 -0
- package/dist/chunk-372VUPHN.js +14 -0
- package/dist/chunk-3HJEWWPS.cjs +14 -0
- package/dist/chunk-3N67SSL3.js +14 -0
- package/dist/chunk-3XEP56SV.cjs +204 -0
- package/dist/chunk-3ZZ57K3S.cjs +14 -0
- package/dist/chunk-4SWC43JO.cjs +14 -0
- package/dist/chunk-4VFQTSJQ.js +14 -0
- package/dist/chunk-57QIBYDN.js +14 -0
- package/dist/chunk-5SNJAD6F.cjs +14 -0
- package/dist/chunk-73H6TVKN.js +14 -0
- package/dist/chunk-A6JOROUC.cjs +14 -0
- package/dist/chunk-AJKH25H2.cjs +14 -0
- package/dist/chunk-ARWMTXJV.cjs +14 -0
- package/dist/chunk-B3ZGAG7B.js +14 -0
- package/dist/chunk-BH5ZXK4J.cjs +14 -0
- package/dist/chunk-BWFXLUK5.cjs +14 -0
- package/dist/chunk-C6UTZEHH.js +14 -0
- package/dist/chunk-CPKBR34V.js +14 -0
- package/dist/chunk-CWSHYFVZ.js +14 -0
- package/dist/chunk-DJKSULPK.js +14 -0
- package/dist/chunk-DNJ54L2G.js +14 -0
- package/dist/chunk-DY2D2IW5.cjs +14 -0
- package/dist/chunk-E26ZO7QM.cjs +14 -0
- package/dist/chunk-EBCHCYUO.js +14 -0
- package/dist/chunk-EPAIOB5U.cjs +14 -0
- package/dist/chunk-EQZMT2HF.cjs +14 -0
- package/dist/chunk-F376L6PP.cjs +14 -0
- package/dist/chunk-F472YLJG.cjs +14 -0
- package/dist/chunk-FXOX3X7E.cjs +14 -0
- package/dist/chunk-G2REP2VZ.cjs +14 -0
- package/dist/chunk-GLO477NZ.js +14 -0
- package/dist/chunk-H4VSK4KF.js +14 -0
- package/dist/chunk-HPSGM6QP.js +14 -0
- package/dist/chunk-HPYHWTTA.cjs +14 -0
- package/dist/chunk-IH4CMOML.js +14 -0
- package/dist/chunk-IMT3IE5M.cjs +14 -0
- package/dist/chunk-IP2WWEOU.js +14 -0
- package/dist/chunk-IS2VB342.js +14 -0
- package/dist/chunk-ITX53XAZ.js +14 -0
- package/dist/chunk-JXBXDTFG.cjs +14 -0
- package/dist/chunk-K62XK7KU.js +14 -0
- package/dist/chunk-KA3TGFJP.js +14 -0
- package/dist/chunk-KBOVBUBM.js +14 -0
- package/dist/chunk-KPGC2D6E.js +14 -0
- package/dist/chunk-KSXTBGIV.js +14 -0
- package/dist/chunk-LCIJ4TJ4.cjs +14 -0
- package/dist/chunk-LQOLYXGQ.cjs +14 -0
- package/dist/chunk-LSIWCIQV.js +14 -0
- package/dist/chunk-MHNSZ4HE.js +14 -0
- package/dist/chunk-MKX4CKAB.cjs +14 -0
- package/dist/chunk-MRTAFRO7.js +14 -0
- package/dist/chunk-MRZ7LGKZ.js +14 -0
- package/dist/chunk-MSASBR2Y.js +14 -0
- package/dist/chunk-NAWLLC3T.cjs +14 -0
- package/dist/chunk-NJK5F5TF.cjs +21 -0
- package/dist/chunk-NLSZVGHK.cjs +14 -0
- package/dist/chunk-O4LRVGOY.js +14 -0
- package/dist/chunk-OG2DMGU6.cjs +14 -0
- package/dist/chunk-OGQKJTXF.js +14 -0
- package/dist/chunk-PETLAONH.js +14 -0
- package/dist/chunk-PVSS2WPM.cjs +14 -0
- package/dist/chunk-PXITFTJA.cjs +14 -0
- package/dist/chunk-QDVPPRWI.cjs +14 -0
- package/dist/chunk-QKERXNJJ.cjs +14 -0
- package/dist/chunk-QLML3IP5.cjs +14 -0
- package/dist/chunk-QVAJ5JP4.js +14 -0
- package/dist/chunk-RD7E4OSJ.cjs +14 -0
- package/dist/chunk-RWSA3LXE.cjs +14 -0
- package/dist/chunk-RXSS67VI.cjs +14 -0
- package/dist/chunk-S3ZNESMC.cjs +14 -0
- package/dist/chunk-S7NDMDRX.js +14 -0
- package/dist/chunk-SK3VYIZ6.cjs +14 -0
- package/dist/chunk-SMGHAG5C.cjs +14 -0
- package/dist/chunk-T46LODOF.js +14 -0
- package/dist/chunk-TIJWJVKZ.js +14 -0
- package/dist/chunk-TLWCYLNA.js +14 -0
- package/dist/chunk-TRJLYZHD.js +14 -0
- package/dist/chunk-UKKJMCNH.js +14 -0
- package/dist/chunk-ULBEEHG4.js +204 -0
- package/dist/chunk-VGTUK3QD.cjs +14 -0
- package/dist/chunk-VQ7R36AC.js +14 -0
- package/dist/chunk-VVQB5W7U.cjs +14 -0
- package/dist/chunk-VVVATFGK.cjs +14 -0
- package/dist/chunk-WMTYO5OX.cjs +14 -0
- package/dist/chunk-WOSSSFXB.js +14 -0
- package/dist/chunk-WOXXNKTE.js +14 -0
- package/dist/chunk-XKI2OAYV.cjs +14 -0
- package/dist/chunk-XR4QF6KQ.cjs +14 -0
- package/dist/chunk-XYHTQ523.cjs +14 -0
- package/dist/chunk-XZYZLSUO.cjs +14 -0
- package/dist/chunk-YPSWSI3M.js +21 -0
- package/dist/chunk-YYBIU5BQ.js +14 -0
- package/dist/chunk-YZA5WZUS.js +14 -0
- package/dist/chunk-Z4LUE424.cjs +14 -0
- package/dist/chunk-ZV6XYUXS.js +14 -0
- package/dist/consent-CS2ZBZX4.cjs +7 -0
- package/dist/consent-NNYHF2N4.js +7 -0
- package/dist/customer-portal-D3SLPAHZ.js +7 -0
- package/dist/customer-portal-UR3GN4VU.cjs +7 -0
- package/dist/dashboard-UHYR5RTY.cjs +7 -0
- package/dist/dashboard-UTPGXFW5.js +7 -0
- package/dist/data-management-QH2IJ5QV.js +7 -0
- package/dist/data-management-TEFRLGSU.cjs +7 -0
- package/dist/deduplication-ECVAZVVA.cjs +7 -0
- package/dist/deduplication-GYIST22B.js +7 -0
- package/dist/design-KUVXMFFK.cjs +7 -0
- package/dist/design-YKBXRW5C.js +7 -0
- package/dist/document-CY2A2OE7.js +7 -0
- package/dist/document-RYQ7MF6U.cjs +7 -0
- package/dist/email-settings-TQ5GGDYG.js +7 -0
- package/dist/email-settings-TQC34GST.cjs +7 -0
- package/dist/email-template-M2VVL4TI.cjs +7 -0
- package/dist/email-template-WYROV3UG.js +7 -0
- package/dist/entity-FA6PZX6S.js +7 -0
- package/dist/entity-IX5NSHPX.cjs +7 -0
- package/dist/entity-mapping-7J3IAGKQ.js +7 -0
- package/dist/entity-mapping-ZNMFCUKK.cjs +7 -0
- package/dist/environments-E3X6NYGX.js +7 -0
- package/dist/environments-P2JS4F5N.cjs +7 -0
- package/dist/erp-integration-EP2XFEH5.js +7 -0
- package/dist/erp-integration-NNV72VFI.cjs +7 -0
- package/dist/event-catalog-C45ISVMP.cjs +7 -0
- package/dist/event-catalog-D7VJ7WRS.js +7 -0
- package/dist/file-UOWBTDIU.cjs +7 -0
- package/dist/file-XSN3NAVZ.js +7 -0
- package/dist/iban-24GHLFDB.cjs +7 -0
- package/dist/iban-LDKYDVQV.js +7 -0
- package/dist/index.cjs +199 -58
- package/dist/index.d.cts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +197 -56
- package/dist/journey-7CKX67M7.js +7 -0
- package/dist/journey-EUZ6MVHG.cjs +7 -0
- package/dist/kanban-CHTH2ZSY.cjs +7 -0
- package/dist/kanban-HI6LL5WY.js +7 -0
- package/dist/message-3XZLJR6R.cjs +7 -0
- package/dist/message-ZNMCS5YH.js +7 -0
- package/dist/metering-DZNZPPY6.cjs +7 -0
- package/dist/metering-KOSCPPKB.js +7 -0
- package/dist/notes-3AO5GXIT.js +7 -0
- package/dist/notes-MPWOQC5J.cjs +7 -0
- package/dist/notification-PZOCUYD5.cjs +7 -0
- package/dist/notification-VWDZRSFZ.js +7 -0
- package/dist/organization-RARYYG2E.cjs +7 -0
- package/dist/organization-ZERPH2IH.js +7 -0
- package/dist/{organization.d-Bd2Hmk8v.d.cts → organization.d-DqwnNxMg.d.cts} +34 -7
- package/dist/{organization.d-Bd2Hmk8v.d.ts → organization.d-DqwnNxMg.d.ts} +34 -7
- package/dist/partner-directory-2XMPQWWX.js +7 -0
- package/dist/partner-directory-WHNTKQ5E.cjs +7 -0
- package/dist/permissions-4T3GFNB4.js +7 -0
- package/dist/permissions-FGBIJNN7.cjs +7 -0
- package/dist/pricing-4Z4TOETA.cjs +7 -0
- package/dist/pricing-C65DTZSX.js +7 -0
- package/dist/pricing-tier-NI35WOUP.cjs +7 -0
- package/dist/pricing-tier-VUOFK5Q7.js +7 -0
- package/dist/purpose-AKOEUHZ4.cjs +7 -0
- package/dist/purpose-RBRV3AQZ.js +7 -0
- package/dist/sandbox-2KN4X66E.cjs +7 -0
- package/dist/sandbox-L2SOOGGR.js +7 -0
- package/dist/submission-7BISSPO6.js +7 -0
- package/dist/submission-Q24BU4GS.cjs +7 -0
- package/dist/targeting-EYGYZD6M.cjs +7 -0
- package/dist/targeting-GEJTJN5Z.js +7 -0
- package/dist/template-variables-OAYS2E3G.cjs +1148 -0
- package/dist/template-variables-VKDJJZUT.js +1148 -0
- package/dist/user-EIEOI3OG.js +7 -0
- package/dist/user-NJJ7XVKB.cjs +7 -0
- package/dist/validation-rules-P6F5P73P.js +7 -0
- package/dist/validation-rules-VDU3CIZV.cjs +7 -0
- package/dist/webhooks-I7JWU34X.cjs +7 -0
- package/dist/webhooks-WPLEHVPX.js +7 -0
- package/dist/workflow-3LLURW3H.js +7 -0
- package/dist/workflow-RAGQDYXT.cjs +7 -0
- package/dist/workflow-definition-B6ELOZUR.cjs +7 -0
- package/dist/workflow-definition-D24CRCK2.js +7 -0
- package/docs/access-token.md +440 -0
- package/docs/address-suggestions.md +256 -0
- package/docs/address.md +284 -0
- package/docs/ai-agents.md +1891 -0
- package/docs/app.md +3388 -0
- package/docs/audit-logs.md +242 -0
- package/docs/automation.md +4044 -0
- package/docs/billing.md +783 -0
- package/docs/blueprint-manifest.md +3234 -0
- package/docs/consent.md +213 -0
- package/docs/customer-portal.md +11399 -0
- package/docs/dashboard.md +640 -0
- package/docs/data-management.md +883 -0
- package/docs/deduplication.md +135 -0
- package/docs/design.md +1273 -0
- package/docs/document.md +590 -0
- package/docs/email-settings.md +1544 -0
- package/docs/email-template.md +1197 -0
- package/docs/entity-mapping.md +2864 -0
- package/docs/entity.md +9595 -0
- package/docs/environments.md +259 -0
- package/docs/erp-integration.md +4572 -0
- package/docs/event-catalog.md +835 -0
- package/docs/file.md +1453 -0
- package/docs/iban.md +61 -0
- package/docs/journey.md +2268 -0
- package/docs/kanban.md +882 -0
- package/docs/message.md +2122 -0
- package/docs/metering.md +1431 -0
- package/docs/notes.md +670 -0
- package/docs/notification.md +1207 -0
- package/docs/organization.md +733 -0
- package/docs/partner-directory.md +1197 -0
- package/docs/permissions.md +1047 -0
- package/docs/pricing-tier.md +81 -0
- package/docs/pricing.md +5923 -0
- package/docs/purpose.md +283 -0
- package/docs/sandbox.md +389 -0
- package/docs/submission.md +195 -0
- package/docs/targeting.md +959 -0
- package/docs/template-variables.md +1141 -0
- package/docs/user.md +2555 -0
- package/docs/validation-rules.md +1597 -0
- package/docs/webhooks.md +996 -0
- package/docs/workflow-definition.md +3842 -0
- package/docs/workflow.md +4465 -0
- package/package.json +3 -2
- package/dist/chunk-XE25WERA.js +0 -125
- package/dist/chunk-XEQMAKGA.cjs +0 -125
package/docs/billing.md
ADDED
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
# Billing API
|
|
2
|
+
|
|
3
|
+
- **Base URL:** `https://billing.sls.epilot.io`
|
|
4
|
+
- **Full API Docs:** [https://docs.epilot.io/api/billing](https://docs.epilot.io/api/billing)
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { epilot } from '@epilot/sdk'
|
|
10
|
+
|
|
11
|
+
epilot.authorize(() => '<token>')
|
|
12
|
+
const { data } = await epilot.billing.getBillingEvents(...)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Tree-shakeable import
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { getClient, authorize } from '@epilot/sdk/billing'
|
|
19
|
+
|
|
20
|
+
const billingClient = getClient()
|
|
21
|
+
authorize(billingClient, () => '<token>')
|
|
22
|
+
const { data } = await billingClient.getBillingEvents(...)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Operations
|
|
26
|
+
|
|
27
|
+
**Billing Events**
|
|
28
|
+
- [`getBillingEvents`](#getbillingevents)
|
|
29
|
+
- [`createBillingEvent`](#createbillingevent)
|
|
30
|
+
- [`getBillingEvent`](#getbillingevent)
|
|
31
|
+
- [`updateBillingEvent`](#updatebillingevent)
|
|
32
|
+
- [`deleteBillingEvent`](#deletebillingevent)
|
|
33
|
+
- [`getBillingEventByExternalId`](#getbillingeventbyexternalid)
|
|
34
|
+
|
|
35
|
+
**Contracts**
|
|
36
|
+
- [`createContractEntity`](#createcontractentity)
|
|
37
|
+
- [`updateContractEntity`](#updatecontractentity)
|
|
38
|
+
- [`deleteContractEntity`](#deletecontractentity)
|
|
39
|
+
|
|
40
|
+
**Balance**
|
|
41
|
+
- [`getCustomerBalance`](#getcustomerbalance)
|
|
42
|
+
|
|
43
|
+
**Schemas**
|
|
44
|
+
- [`BaseEntity`](#baseentity)
|
|
45
|
+
- [`EntityId`](#entityid)
|
|
46
|
+
- [`EntitySlug`](#entityslug)
|
|
47
|
+
- [`EntityRelationItem`](#entityrelationitem)
|
|
48
|
+
- [`BaseBillingEvent`](#basebillingevent)
|
|
49
|
+
- [`InstallmentEvent`](#installmentevent)
|
|
50
|
+
- [`ReimbursementEvent`](#reimbursementevent)
|
|
51
|
+
- [`BillingEvent`](#billingevent)
|
|
52
|
+
- [`Contract`](#contract)
|
|
53
|
+
- [`ContractItem`](#contractitem)
|
|
54
|
+
- [`Balance`](#balance)
|
|
55
|
+
- [`Currency`](#currency)
|
|
56
|
+
|
|
57
|
+
### `getBillingEvents`
|
|
58
|
+
|
|
59
|
+
Get and filter billing events such as installments and reimbursements.
|
|
60
|
+
|
|
61
|
+
`GET /v1/billing/events`
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
const { data } = await client.getBillingEvents({
|
|
65
|
+
from: 1,
|
|
66
|
+
size: 1,
|
|
67
|
+
entity_id: ['...'],
|
|
68
|
+
event_type: 'example',
|
|
69
|
+
date_after: 'example',
|
|
70
|
+
date_before: 'example',
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
<details>
|
|
75
|
+
<summary>Response</summary>
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"hits": 0,
|
|
80
|
+
"results": [
|
|
81
|
+
{
|
|
82
|
+
"billing_amount": 10050,
|
|
83
|
+
"billing_amount_decimal": "100.50",
|
|
84
|
+
"billing_currency": "EUR",
|
|
85
|
+
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
|
|
86
|
+
"contract": {
|
|
87
|
+
"$relation": [
|
|
88
|
+
{
|
|
89
|
+
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
|
|
94
|
+
"_title": "string",
|
|
95
|
+
"_org": "string",
|
|
96
|
+
"_schema": "contact",
|
|
97
|
+
"_tags": ["string"],
|
|
98
|
+
"_created_at": "string",
|
|
99
|
+
"_updated_at": "string",
|
|
100
|
+
"type": "installment",
|
|
101
|
+
"due_date": "1970-01-01T00:00:00.000Z",
|
|
102
|
+
"paid_date": "1970-01-01T00:00:00.000Z"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
</details>
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### `createBillingEvent`
|
|
113
|
+
|
|
114
|
+
Create a new billing event.
|
|
115
|
+
|
|
116
|
+
`POST /v1/billing/events`
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
const { data } = await client.createBillingEvent(
|
|
120
|
+
null,
|
|
121
|
+
{
|
|
122
|
+
billing_amount: 10050,
|
|
123
|
+
billing_amount_decimal: '100.50',
|
|
124
|
+
billing_currency: 'EUR',
|
|
125
|
+
external_id: 'd4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e',
|
|
126
|
+
contract: {
|
|
127
|
+
$relation: [
|
|
128
|
+
{
|
|
129
|
+
entity_id: 'f589786b-3024-43cd-9cb3-5a3c953f2896'
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
_id: '5da0a718-c822-403d-9f5d-20d4584e0528',
|
|
134
|
+
_title: 'string',
|
|
135
|
+
_org: 'string',
|
|
136
|
+
_schema: 'contact',
|
|
137
|
+
_tags: ['string'],
|
|
138
|
+
_created_at: 'string',
|
|
139
|
+
_updated_at: 'string',
|
|
140
|
+
type: 'installment',
|
|
141
|
+
due_date: '1970-01-01T00:00:00.000Z',
|
|
142
|
+
paid_date: '1970-01-01T00:00:00.000Z'
|
|
143
|
+
},
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
<details>
|
|
148
|
+
<summary>Response</summary>
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"billing_amount": 10050,
|
|
153
|
+
"billing_amount_decimal": "100.50",
|
|
154
|
+
"billing_currency": "EUR",
|
|
155
|
+
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
|
|
156
|
+
"contract": {
|
|
157
|
+
"$relation": [
|
|
158
|
+
{
|
|
159
|
+
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
|
|
164
|
+
"_title": "string",
|
|
165
|
+
"_org": "string",
|
|
166
|
+
"_schema": "contact",
|
|
167
|
+
"_tags": ["string"],
|
|
168
|
+
"_created_at": "string",
|
|
169
|
+
"_updated_at": "string",
|
|
170
|
+
"type": "installment",
|
|
171
|
+
"due_date": "1970-01-01T00:00:00.000Z",
|
|
172
|
+
"paid_date": "1970-01-01T00:00:00.000Z"
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
</details>
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### `getBillingEvent`
|
|
181
|
+
|
|
182
|
+
Get a single billing event by ID.
|
|
183
|
+
|
|
184
|
+
`GET /v1/billing/events/{id}`
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
const { data } = await client.getBillingEvent({
|
|
188
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
189
|
+
})
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
<details>
|
|
193
|
+
<summary>Response</summary>
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"billing_amount": 10050,
|
|
198
|
+
"billing_amount_decimal": "100.50",
|
|
199
|
+
"billing_currency": "EUR",
|
|
200
|
+
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
|
|
201
|
+
"contract": {
|
|
202
|
+
"$relation": [
|
|
203
|
+
{
|
|
204
|
+
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
|
|
209
|
+
"_title": "string",
|
|
210
|
+
"_org": "string",
|
|
211
|
+
"_schema": "contact",
|
|
212
|
+
"_tags": ["string"],
|
|
213
|
+
"_created_at": "string",
|
|
214
|
+
"_updated_at": "string",
|
|
215
|
+
"type": "installment",
|
|
216
|
+
"due_date": "1970-01-01T00:00:00.000Z",
|
|
217
|
+
"paid_date": "1970-01-01T00:00:00.000Z"
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
</details>
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### `updateBillingEvent`
|
|
226
|
+
|
|
227
|
+
Update an existing billing event.
|
|
228
|
+
|
|
229
|
+
`PATCH /v1/billing/events/{id}`
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
const { data } = await client.updateBillingEvent(
|
|
233
|
+
{
|
|
234
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
billing_amount: 10050,
|
|
238
|
+
billing_amount_decimal: '100.50',
|
|
239
|
+
billing_currency: 'EUR',
|
|
240
|
+
external_id: 'd4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e',
|
|
241
|
+
contract: {
|
|
242
|
+
$relation: [
|
|
243
|
+
{
|
|
244
|
+
entity_id: 'f589786b-3024-43cd-9cb3-5a3c953f2896'
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
_id: '5da0a718-c822-403d-9f5d-20d4584e0528',
|
|
249
|
+
_title: 'string',
|
|
250
|
+
_org: 'string',
|
|
251
|
+
_schema: 'contact',
|
|
252
|
+
_tags: ['string'],
|
|
253
|
+
_created_at: 'string',
|
|
254
|
+
_updated_at: 'string',
|
|
255
|
+
type: 'installment',
|
|
256
|
+
due_date: '1970-01-01T00:00:00.000Z',
|
|
257
|
+
paid_date: '1970-01-01T00:00:00.000Z'
|
|
258
|
+
},
|
|
259
|
+
)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
<details>
|
|
263
|
+
<summary>Response</summary>
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"billing_amount": 10050,
|
|
268
|
+
"billing_amount_decimal": "100.50",
|
|
269
|
+
"billing_currency": "EUR",
|
|
270
|
+
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
|
|
271
|
+
"contract": {
|
|
272
|
+
"$relation": [
|
|
273
|
+
{
|
|
274
|
+
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
|
|
279
|
+
"_title": "string",
|
|
280
|
+
"_org": "string",
|
|
281
|
+
"_schema": "contact",
|
|
282
|
+
"_tags": ["string"],
|
|
283
|
+
"_created_at": "string",
|
|
284
|
+
"_updated_at": "string",
|
|
285
|
+
"type": "installment",
|
|
286
|
+
"due_date": "1970-01-01T00:00:00.000Z",
|
|
287
|
+
"paid_date": "1970-01-01T00:00:00.000Z"
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
</details>
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
### `deleteBillingEvent`
|
|
296
|
+
|
|
297
|
+
Delete an existing billing event.
|
|
298
|
+
|
|
299
|
+
`DELETE /v1/billing/events/{id}`
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
const { data } = await client.deleteBillingEvent({
|
|
303
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
304
|
+
})
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### `getBillingEventByExternalId`
|
|
310
|
+
|
|
311
|
+
Get a single billing event by External ID.
|
|
312
|
+
|
|
313
|
+
`GET /v1/billing/external/{external_id}`
|
|
314
|
+
|
|
315
|
+
```ts
|
|
316
|
+
const { data } = await client.getBillingEventByExternalId({
|
|
317
|
+
external_id: 'example',
|
|
318
|
+
})
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
<details>
|
|
322
|
+
<summary>Response</summary>
|
|
323
|
+
|
|
324
|
+
```json
|
|
325
|
+
{
|
|
326
|
+
"billing_amount": 10050,
|
|
327
|
+
"billing_amount_decimal": "100.50",
|
|
328
|
+
"billing_currency": "EUR",
|
|
329
|
+
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
|
|
330
|
+
"contract": {
|
|
331
|
+
"$relation": [
|
|
332
|
+
{
|
|
333
|
+
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
},
|
|
337
|
+
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
|
|
338
|
+
"_title": "string",
|
|
339
|
+
"_org": "string",
|
|
340
|
+
"_schema": "contact",
|
|
341
|
+
"_tags": ["string"],
|
|
342
|
+
"_created_at": "string",
|
|
343
|
+
"_updated_at": "string",
|
|
344
|
+
"type": "installment",
|
|
345
|
+
"due_date": "1970-01-01T00:00:00.000Z",
|
|
346
|
+
"paid_date": "1970-01-01T00:00:00.000Z"
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
</details>
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
### `createContractEntity`
|
|
355
|
+
|
|
356
|
+
Create a new contract entity.
|
|
357
|
+
|
|
358
|
+
`POST /v1/billing/contracts`
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
const { data } = await client.createContractEntity(
|
|
362
|
+
null,
|
|
363
|
+
{
|
|
364
|
+
_id: '5da0a718-c822-403d-9f5d-20d4584e0528',
|
|
365
|
+
_title: 'string',
|
|
366
|
+
_org: 'string',
|
|
367
|
+
_schema: 'contact',
|
|
368
|
+
_tags: ['string'],
|
|
369
|
+
_created_at: 'string',
|
|
370
|
+
_updated_at: 'string',
|
|
371
|
+
contract_name: 'Grid Contract',
|
|
372
|
+
contract_number: '12345',
|
|
373
|
+
status: 'approved',
|
|
374
|
+
description: 'This contract is for the supply of widgets.',
|
|
375
|
+
account_number: '67890',
|
|
376
|
+
branch: 'power',
|
|
377
|
+
billing_address: '123 Main St, Anytown',
|
|
378
|
+
delivery_address: '456 Elm St, Anytown',
|
|
379
|
+
additional_addresses: '789 Oak St, Anytown',
|
|
380
|
+
termination_date: '2022-01-01',
|
|
381
|
+
termination_reason: 'Non-payment',
|
|
382
|
+
billing_period: 'monthly',
|
|
383
|
+
billing_duration_amount: 30,
|
|
384
|
+
renewal_duration_amount: 365,
|
|
385
|
+
renewal_duration_unit: 'years',
|
|
386
|
+
notice_time_amount: 30,
|
|
387
|
+
notice_time_unit: 'months',
|
|
388
|
+
start_date: '2021-01-01',
|
|
389
|
+
billing_due_day: 2,
|
|
390
|
+
installment_amount: 10050,
|
|
391
|
+
balance: 8990,
|
|
392
|
+
balance_currency: 'EUR'
|
|
393
|
+
},
|
|
394
|
+
)
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
<details>
|
|
398
|
+
<summary>Response</summary>
|
|
399
|
+
|
|
400
|
+
```json
|
|
401
|
+
{
|
|
402
|
+
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
|
|
403
|
+
"_title": "string",
|
|
404
|
+
"_org": "string",
|
|
405
|
+
"_schema": "contact",
|
|
406
|
+
"_tags": ["string"],
|
|
407
|
+
"_created_at": "string",
|
|
408
|
+
"_updated_at": "string",
|
|
409
|
+
"contract_name": "Grid Contract",
|
|
410
|
+
"contract_number": "12345",
|
|
411
|
+
"status": "approved",
|
|
412
|
+
"description": "This contract is for the supply of widgets.",
|
|
413
|
+
"account_number": "67890",
|
|
414
|
+
"branch": "power",
|
|
415
|
+
"billing_address": "123 Main St, Anytown",
|
|
416
|
+
"delivery_address": "456 Elm St, Anytown",
|
|
417
|
+
"additional_addresses": "789 Oak St, Anytown",
|
|
418
|
+
"termination_date": "2022-01-01",
|
|
419
|
+
"termination_reason": "Non-payment",
|
|
420
|
+
"billing_period": "monthly",
|
|
421
|
+
"billing_duration_amount": 30,
|
|
422
|
+
"renewal_duration_amount": 365,
|
|
423
|
+
"renewal_duration_unit": "years",
|
|
424
|
+
"notice_time_amount": 30,
|
|
425
|
+
"notice_time_unit": "months",
|
|
426
|
+
"start_date": "2021-01-01",
|
|
427
|
+
"billing_due_day": 2,
|
|
428
|
+
"installment_amount": 10050,
|
|
429
|
+
"balance": 8990,
|
|
430
|
+
"balance_currency": "EUR"
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
</details>
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
### `updateContractEntity`
|
|
439
|
+
|
|
440
|
+
Update an existing contract entity.
|
|
441
|
+
|
|
442
|
+
`PATCH /v1/billing/contracts/{id}`
|
|
443
|
+
|
|
444
|
+
```ts
|
|
445
|
+
const { data } = await client.updateContractEntity(
|
|
446
|
+
{
|
|
447
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
_id: '5da0a718-c822-403d-9f5d-20d4584e0528',
|
|
451
|
+
_title: 'string',
|
|
452
|
+
_org: 'string',
|
|
453
|
+
_schema: 'contact',
|
|
454
|
+
_tags: ['string'],
|
|
455
|
+
_created_at: 'string',
|
|
456
|
+
_updated_at: 'string',
|
|
457
|
+
contract_name: 'Grid Contract',
|
|
458
|
+
contract_number: '12345',
|
|
459
|
+
status: 'approved',
|
|
460
|
+
description: 'This contract is for the supply of widgets.',
|
|
461
|
+
account_number: '67890',
|
|
462
|
+
branch: 'power',
|
|
463
|
+
billing_address: '123 Main St, Anytown',
|
|
464
|
+
delivery_address: '456 Elm St, Anytown',
|
|
465
|
+
additional_addresses: '789 Oak St, Anytown',
|
|
466
|
+
termination_date: '2022-01-01',
|
|
467
|
+
termination_reason: 'Non-payment',
|
|
468
|
+
billing_period: 'monthly',
|
|
469
|
+
billing_duration_amount: 30,
|
|
470
|
+
renewal_duration_amount: 365,
|
|
471
|
+
renewal_duration_unit: 'years',
|
|
472
|
+
notice_time_amount: 30,
|
|
473
|
+
notice_time_unit: 'months',
|
|
474
|
+
start_date: '2021-01-01',
|
|
475
|
+
billing_due_day: 2,
|
|
476
|
+
installment_amount: 10050,
|
|
477
|
+
balance: 8990,
|
|
478
|
+
balance_currency: 'EUR'
|
|
479
|
+
},
|
|
480
|
+
)
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
<details>
|
|
484
|
+
<summary>Response</summary>
|
|
485
|
+
|
|
486
|
+
```json
|
|
487
|
+
{
|
|
488
|
+
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
|
|
489
|
+
"_title": "string",
|
|
490
|
+
"_org": "string",
|
|
491
|
+
"_schema": "contact",
|
|
492
|
+
"_tags": ["string"],
|
|
493
|
+
"_created_at": "string",
|
|
494
|
+
"_updated_at": "string",
|
|
495
|
+
"contract_name": "Grid Contract",
|
|
496
|
+
"contract_number": "12345",
|
|
497
|
+
"status": "approved",
|
|
498
|
+
"description": "This contract is for the supply of widgets.",
|
|
499
|
+
"account_number": "67890",
|
|
500
|
+
"branch": "power",
|
|
501
|
+
"billing_address": "123 Main St, Anytown",
|
|
502
|
+
"delivery_address": "456 Elm St, Anytown",
|
|
503
|
+
"additional_addresses": "789 Oak St, Anytown",
|
|
504
|
+
"termination_date": "2022-01-01",
|
|
505
|
+
"termination_reason": "Non-payment",
|
|
506
|
+
"billing_period": "monthly",
|
|
507
|
+
"billing_duration_amount": 30,
|
|
508
|
+
"renewal_duration_amount": 365,
|
|
509
|
+
"renewal_duration_unit": "years",
|
|
510
|
+
"notice_time_amount": 30,
|
|
511
|
+
"notice_time_unit": "months",
|
|
512
|
+
"start_date": "2021-01-01",
|
|
513
|
+
"billing_due_day": 2,
|
|
514
|
+
"installment_amount": 10050,
|
|
515
|
+
"balance": 8990,
|
|
516
|
+
"balance_currency": "EUR"
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
</details>
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
### `deleteContractEntity`
|
|
525
|
+
|
|
526
|
+
Delete an existing contract entity.
|
|
527
|
+
|
|
528
|
+
`DELETE /v1/billing/contracts/{id}`
|
|
529
|
+
|
|
530
|
+
```ts
|
|
531
|
+
const { data } = await client.deleteContractEntity({
|
|
532
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
533
|
+
})
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
### `getCustomerBalance`
|
|
539
|
+
|
|
540
|
+
Get total balance across all contracts and orders of a customer entity.
|
|
541
|
+
|
|
542
|
+
`GET /v1/billing/customers/{id}/balance`
|
|
543
|
+
|
|
544
|
+
```ts
|
|
545
|
+
const { data } = await client.getCustomerBalance({
|
|
546
|
+
id: '123e4567-e89b-12d3-a456-426614174000',
|
|
547
|
+
})
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
<details>
|
|
551
|
+
<summary>Response</summary>
|
|
552
|
+
|
|
553
|
+
```json
|
|
554
|
+
{
|
|
555
|
+
"balance": 8990,
|
|
556
|
+
"balance_decimal": "89.90",
|
|
557
|
+
"balance_currency": "EUR"
|
|
558
|
+
}
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
</details>
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
## Schemas
|
|
566
|
+
|
|
567
|
+
### `BaseEntity`
|
|
568
|
+
|
|
569
|
+
```ts
|
|
570
|
+
type BaseEntity = {
|
|
571
|
+
_id?: string
|
|
572
|
+
_title?: string
|
|
573
|
+
_org?: string
|
|
574
|
+
_schema?: "contact" | "contract" | "file" | "order" | "opportunity" | "product" | "price" | "meter" | "meter_counter" | "billing_event"
|
|
575
|
+
_tags?: string[]
|
|
576
|
+
_created_at?: string
|
|
577
|
+
_updated_at?: string
|
|
578
|
+
}
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### `EntityId`
|
|
582
|
+
|
|
583
|
+
Entity ID
|
|
584
|
+
|
|
585
|
+
```ts
|
|
586
|
+
type EntityId = string
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
### `EntitySlug`
|
|
590
|
+
|
|
591
|
+
URL-friendly identifier for the entity schema
|
|
592
|
+
|
|
593
|
+
```ts
|
|
594
|
+
type EntitySlug = "contact" | "contract" | "file" | "order" | "opportunity" | "product" | "price" | "meter" | "meter_counter" | "billing_event"
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### `EntityRelationItem`
|
|
598
|
+
|
|
599
|
+
```ts
|
|
600
|
+
type EntityRelationItem = {
|
|
601
|
+
entity_id?: string
|
|
602
|
+
}
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
### `BaseBillingEvent`
|
|
606
|
+
|
|
607
|
+
A base billing event to be inherited by all billing events.
|
|
608
|
+
|
|
609
|
+
```ts
|
|
610
|
+
type BaseBillingEvent = {
|
|
611
|
+
_id?: string
|
|
612
|
+
_title?: string
|
|
613
|
+
_org?: string
|
|
614
|
+
_schema?: "contact" | "contract" | "file" | "order" | "opportunity" | "product" | "price" | "meter" | "meter_counter" | "billing_event"
|
|
615
|
+
_tags?: string[]
|
|
616
|
+
_created_at?: string
|
|
617
|
+
_updated_at?: string
|
|
618
|
+
}
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
### `InstallmentEvent`
|
|
622
|
+
|
|
623
|
+
An entity that describes an installment billing event.
|
|
624
|
+
|
|
625
|
+
```ts
|
|
626
|
+
type InstallmentEvent = {
|
|
627
|
+
billing_amount: number
|
|
628
|
+
billing_amount_decimal: string
|
|
629
|
+
billing_currency: string
|
|
630
|
+
external_id?: string
|
|
631
|
+
contract: {
|
|
632
|
+
$relation?: Array<{
|
|
633
|
+
entity_id?: { ... }
|
|
634
|
+
}>
|
|
635
|
+
}
|
|
636
|
+
type: "installment"
|
|
637
|
+
due_date: string // date-time
|
|
638
|
+
paid_date?: string // date-time
|
|
639
|
+
}
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### `ReimbursementEvent`
|
|
643
|
+
|
|
644
|
+
An entity that describes a reimbursement billing event.
|
|
645
|
+
|
|
646
|
+
```ts
|
|
647
|
+
type ReimbursementEvent = {
|
|
648
|
+
billing_amount: number
|
|
649
|
+
billing_amount_decimal: string
|
|
650
|
+
billing_currency: string
|
|
651
|
+
external_id?: string
|
|
652
|
+
contract: {
|
|
653
|
+
$relation?: Array<{
|
|
654
|
+
entity_id?: { ... }
|
|
655
|
+
}>
|
|
656
|
+
}
|
|
657
|
+
type: "reimbursement"
|
|
658
|
+
paid_date?: string // date-time
|
|
659
|
+
}
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
### `BillingEvent`
|
|
663
|
+
|
|
664
|
+
An entity that describes a billing event such as a future installment or a reimbursement back to the customer.
|
|
665
|
+
|
|
666
|
+
```ts
|
|
667
|
+
type BillingEvent = {
|
|
668
|
+
billing_amount: number
|
|
669
|
+
billing_amount_decimal: string
|
|
670
|
+
billing_currency: string
|
|
671
|
+
external_id?: string
|
|
672
|
+
contract: {
|
|
673
|
+
$relation?: Array<{
|
|
674
|
+
entity_id?: { ... }
|
|
675
|
+
}>
|
|
676
|
+
}
|
|
677
|
+
type: "installment"
|
|
678
|
+
due_date: string // date-time
|
|
679
|
+
paid_date?: string // date-time
|
|
680
|
+
} | {
|
|
681
|
+
billing_amount: number
|
|
682
|
+
billing_amount_decimal: string
|
|
683
|
+
billing_currency: string
|
|
684
|
+
external_id?: string
|
|
685
|
+
contract: {
|
|
686
|
+
$relation?: Array<{
|
|
687
|
+
entity_id?: { ... }
|
|
688
|
+
}>
|
|
689
|
+
}
|
|
690
|
+
type: "reimbursement"
|
|
691
|
+
paid_date?: string // date-time
|
|
692
|
+
}
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
### `Contract`
|
|
696
|
+
|
|
697
|
+
```ts
|
|
698
|
+
type Contract = {
|
|
699
|
+
_id?: string
|
|
700
|
+
_title?: string
|
|
701
|
+
_org?: string
|
|
702
|
+
_schema?: "contact" | "contract" | "file" | "order" | "opportunity" | "product" | "price" | "meter" | "meter_counter" | "billing_event"
|
|
703
|
+
_tags?: string[]
|
|
704
|
+
_created_at?: string
|
|
705
|
+
_updated_at?: string
|
|
706
|
+
contract_name?: string
|
|
707
|
+
contract_number?: string
|
|
708
|
+
status?: "draft" | "in_approval_process" | "approved" | "active" | "deactivated" | "revoked" | "terminated" | "expired"
|
|
709
|
+
description?: string
|
|
710
|
+
account_number?: string
|
|
711
|
+
branch?: "power" | "gas" | "water" | "waste_water" | "district_heating"
|
|
712
|
+
billing_address?: string
|
|
713
|
+
delivery_address?: string
|
|
714
|
+
additional_addresses?: string
|
|
715
|
+
termination_date?: string
|
|
716
|
+
termination_reason?: string
|
|
717
|
+
billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly"
|
|
718
|
+
billing_duration_amount?: number
|
|
719
|
+
renewal_duration_amount?: number
|
|
720
|
+
renewal_duration_unit?: "weeks" | "months" | "years"
|
|
721
|
+
notice_time_amount?: number
|
|
722
|
+
notice_time_unit?: "weeks" | "months" | "years"
|
|
723
|
+
start_date?: string
|
|
724
|
+
billing_due_day?: number
|
|
725
|
+
installment_amount?: number
|
|
726
|
+
balance?: number
|
|
727
|
+
balance_currency?: string
|
|
728
|
+
}
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
### `ContractItem`
|
|
732
|
+
|
|
733
|
+
```ts
|
|
734
|
+
type ContractItem = {
|
|
735
|
+
_id?: string
|
|
736
|
+
_title?: string
|
|
737
|
+
_org?: string
|
|
738
|
+
_schema?: "contact" | "contract" | "file" | "order" | "opportunity" | "product" | "price" | "meter" | "meter_counter" | "billing_event"
|
|
739
|
+
_tags?: string[]
|
|
740
|
+
_created_at?: string
|
|
741
|
+
_updated_at?: string
|
|
742
|
+
contract_name?: string
|
|
743
|
+
contract_number?: string
|
|
744
|
+
status?: "draft" | "in_approval_process" | "approved" | "active" | "deactivated" | "revoked" | "terminated" | "expired"
|
|
745
|
+
description?: string
|
|
746
|
+
account_number?: string
|
|
747
|
+
branch?: "power" | "gas" | "water" | "waste_water" | "district_heating"
|
|
748
|
+
billing_address?: string
|
|
749
|
+
delivery_address?: string
|
|
750
|
+
additional_addresses?: string
|
|
751
|
+
termination_date?: string
|
|
752
|
+
termination_reason?: string
|
|
753
|
+
billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly"
|
|
754
|
+
billing_duration_amount?: number
|
|
755
|
+
renewal_duration_amount?: number
|
|
756
|
+
renewal_duration_unit?: "weeks" | "months" | "years"
|
|
757
|
+
notice_time_amount?: number
|
|
758
|
+
notice_time_unit?: "weeks" | "months" | "years"
|
|
759
|
+
start_date?: string
|
|
760
|
+
billing_due_day?: number
|
|
761
|
+
installment_amount?: number
|
|
762
|
+
balance?: number
|
|
763
|
+
balance_currency?: string
|
|
764
|
+
}
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
### `Balance`
|
|
768
|
+
|
|
769
|
+
```ts
|
|
770
|
+
type Balance = {
|
|
771
|
+
balance?: number
|
|
772
|
+
balance_decimal?: string
|
|
773
|
+
balance_currency?: string
|
|
774
|
+
}
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
### `Currency`
|
|
778
|
+
|
|
779
|
+
Currency code in ISO 4217 format
|
|
780
|
+
|
|
781
|
+
```ts
|
|
782
|
+
type Currency = string
|
|
783
|
+
```
|