Skip to main content

Billing API

Usage​

import { epilot } from '@epilot/sdk'

epilot.authorize(() => '<token>')
const { data } = await epilot.billing.getBillingEvents(...)

Tree-shakeable import​

import { getClient, authorize } from '@epilot/sdk/billing'

const billingClient = getClient()
authorize(billingClient, () => '<token>')
const { data } = await billingClient.getBillingEvents(...)

Operations​

Billing Events

Contracts

Pricing Information

Configuration History

Balance

Schemas

getBillingEvents​

Retrieve and filter billing events (Buchungssätze) such as installments (Abschlagszahlungen), payments (Zahlungseingänge), and reimbursements (Rückerstattungen).

GET /v1/billing/events

const { data } = await client.getBillingEvents({
from: 1,
size: 1,
entity_id: ['...'],
contact_id: 'example',
event_type: 'example',
date_after: 'example',
date_before: 'example',
})
Response
{
"hits": 42,
"results": [
{
"type": "installment",
"direction": "debit",
"note": "July power & gas installment payment",
"status": "open",
"booking_date": "2025-07-10",
"due_date": "2025-07-10",
"billing_amount": 5000,
"billing_amount_decimal": "50.00",
"billing_currency": "EUR"
}
]
}

createBillingEvent​

Create a new billing event (Buchungssatz) such as an installment (Abschlagszahlung), payment (Zahlungseingang), or reimbursement (Rückerstattung).

POST /v1/billing/events

const { data } = await client.createBillingEvent(
null,
{
type: 'installment',
direction: 'debit',
note: 'July power & gas installment payment',
status: 'open',
booking_date: '2025-07-10',
due_date: '2025-07-10',
billing_amount: 5000,
billing_amount_decimal: '50.00',
billing_currency: 'EUR'
},
)
Response
{
"type": "installment",
"direction": "debit",
"note": "July power & gas installment payment",
"status": "open",
"booking_date": "2025-07-10",
"due_date": "2025-07-10",
"billing_amount": 5000,
"billing_amount_decimal": "50.00",
"billing_currency": "EUR"
}

getBillingEvent​

Retrieve a single billing event (Buchungssatz) by its unique ID.

GET /v1/billing/events/{id}

const { data } = await client.getBillingEvent({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"type": "installment",
"direction": "debit",
"note": "July power & gas installment payment",
"status": "open",
"booking_date": "2025-07-10",
"due_date": "2025-07-10",
"billing_amount": 5000,
"billing_amount_decimal": "50.00",
"billing_currency": "EUR"
}

updateBillingEvent​

Update an existing billing event (Buchungssatz).

PATCH /v1/billing/events/{id}

const { data } = await client.updateBillingEvent(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
type: 'installment',
direction: 'debit',
billing_amount: 10000,
billing_amount_decimal: '100.00',
billing_currency: 'EUR',
external_id: 'SAP-54321',
contract: {
$relation: [
{
entity_id: 'f589786b-3024-43cd-9cb3-5a3c953f2896'
}
]
},
booking_date: '2025-06-15',
due_date: '2025-06-30',
paid_date: '2025-06-15T10:00:00Z',
status: 'closed',
related_event: 'd4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e',
external_link: {
href: 'https://billing.example.com/invoices/12345',
title: 'Invoice 12345'
},
attachments: {
$relation: [
{
entity_id: 'f589786b-3024-43cd-9cb3-5a3c953f2896'
}
]
},
note: 'Teilzahlung für Abschlag Juni',
internal_note: 'Rückmeldung von SAP: Betrag aus Zahlungsavis 2025-06-14 übernommen'
},
)
Response
{
"type": "installment",
"direction": "debit",
"note": "July power & gas installment payment",
"status": "open",
"booking_date": "2025-07-10",
"due_date": "2025-07-10",
"billing_amount": 5000,
"billing_amount_decimal": "50.00",
"billing_currency": "EUR"
}

deleteBillingEvent​

Delete an existing billing event (Buchungssatz).

DELETE /v1/billing/events/{id}

const { data } = await client.deleteBillingEvent({
id: '123e4567-e89b-12d3-a456-426614174000',
})

getBillingEventByExternalId​

Retrieve a billing event (Buchungssatz) by its external system identifier.

GET /v1/billing/external/{external_id}

const { data } = await client.getBillingEventByExternalId({
external_id: 'example',
})
Response
{
"type": "installment",
"direction": "debit",
"note": "July power & gas installment payment",
"status": "open",
"booking_date": "2025-07-10",
"due_date": "2025-07-10",
"billing_amount": 5000,
"billing_amount_decimal": "50.00",
"billing_currency": "EUR"
}

createContractEntity​

Create a new contract entity (Vertrag) for billing purposes.

POST /v1/billing/contracts

const { data } = await client.createContractEntity(
null,
{
_id: '5da0a718-c822-403d-9f5d-20d4584e0528',
_title: 'Abschlagszahlung Juli 2025',
_org: '123456',
_schema: 'billing_event',
_tags: ['billing', 'energy'],
_created_at: '2025-06-15T10:30:00Z',
_updated_at: '2025-06-15T14:45:00Z',
contract_name: 'Stromvertrag Haushalt',
contract_number: 'STR-2025-001234',
status: 'active',
description: 'Haushaltsstrom-Tarif mit 24 Monaten Preisgarantie',
account_number: 'KD-67890',
branch: 'power',
billing_address: 'Musterstraße 123, 50667 Köln',
delivery_address: 'Musterstraße 123, 50667 Köln',
additional_addresses: 'Postfach 456, 50668 Köln',
termination_date: '2025-12-31',
termination_reason: 'Kundenkündigung',
billing_period: 'monthly',
billing_duration_amount: 30,
renewal_duration_amount: 12,
renewal_duration_unit: 'months',
notice_time_amount: 30,
notice_time_unit: 'months',
start_date: '2025-01-01',
billing_due_day: 15,
installment_amount: 8500,
balance: 8990,
balance_currency: 'EUR'
},
)
Response
{
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "Abschlagszahlung Juli 2025",
"_org": "123456",
"_schema": "billing_event",
"_tags": ["billing", "energy"],
"_created_at": "2025-06-15T10:30:00Z",
"_updated_at": "2025-06-15T14:45:00Z",
"contract_name": "Stromvertrag Haushalt",
"contract_number": "STR-2025-001234",
"status": "active",
"description": "Haushaltsstrom-Tarif mit 24 Monaten Preisgarantie",
"account_number": "KD-67890",
"branch": "power",
"billing_address": "Musterstraße 123, 50667 Köln",
"delivery_address": "Musterstraße 123, 50667 Köln",
"additional_addresses": "Postfach 456, 50668 Köln",
"termination_date": "2025-12-31",
"termination_reason": "Kundenkündigung",
"billing_period": "monthly",
"billing_duration_amount": 30,
"renewal_duration_amount": 12,
"renewal_duration_unit": "months",
"notice_time_amount": 30,
"notice_time_unit": "months",
"start_date": "2025-01-01",
"billing_due_day": 15,
"installment_amount": 8500,
"balance": 8990,
"balance_currency": "EUR"
}

updateContractEntity​

Update an existing contract entity (Vertrag).

PATCH /v1/billing/contracts/{id}

const { data } = await client.updateContractEntity(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
_id: '5da0a718-c822-403d-9f5d-20d4584e0528',
_title: 'Abschlagszahlung Juli 2025',
_org: '123456',
_schema: 'billing_event',
_tags: ['billing', 'energy'],
_created_at: '2025-06-15T10:30:00Z',
_updated_at: '2025-06-15T14:45:00Z',
contract_name: 'Stromvertrag Haushalt',
contract_number: 'STR-2025-001234',
status: 'active',
description: 'Haushaltsstrom-Tarif mit 24 Monaten Preisgarantie',
account_number: 'KD-67890',
branch: 'power',
billing_address: 'Musterstraße 123, 50667 Köln',
delivery_address: 'Musterstraße 123, 50667 Köln',
additional_addresses: 'Postfach 456, 50668 Köln',
termination_date: '2025-12-31',
termination_reason: 'Kundenkündigung',
billing_period: 'monthly',
billing_duration_amount: 30,
renewal_duration_amount: 12,
renewal_duration_unit: 'months',
notice_time_amount: 30,
notice_time_unit: 'months',
start_date: '2025-01-01',
billing_due_day: 15,
installment_amount: 8500,
balance: 8990,
balance_currency: 'EUR'
},
)
Response
{
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "Abschlagszahlung Juli 2025",
"_org": "123456",
"_schema": "billing_event",
"_tags": ["billing", "energy"],
"_created_at": "2025-06-15T10:30:00Z",
"_updated_at": "2025-06-15T14:45:00Z",
"contract_name": "Stromvertrag Haushalt",
"contract_number": "STR-2025-001234",
"status": "active",
"description": "Haushaltsstrom-Tarif mit 24 Monaten Preisgarantie",
"account_number": "KD-67890",
"branch": "power",
"billing_address": "Musterstraße 123, 50667 Köln",
"delivery_address": "Musterstraße 123, 50667 Köln",
"additional_addresses": "Postfach 456, 50668 Köln",
"termination_date": "2025-12-31",
"termination_reason": "Kundenkündigung",
"billing_period": "monthly",
"billing_duration_amount": 30,
"renewal_duration_amount": 12,
"renewal_duration_unit": "months",
"notice_time_amount": 30,
"notice_time_unit": "months",
"start_date": "2025-01-01",
"billing_due_day": 15,
"installment_amount": 8500,
"balance": 8990,
"balance_currency": "EUR"
}

deleteContractEntity​

Delete an existing contract entity (Vertrag).

DELETE /v1/billing/contracts/{id}

const { data } = await client.deleteContractEntity({
id: '123e4567-e89b-12d3-a456-426614174000',
})

getContractPricingInformation​

Get current pricing information and recent configuration history for a Contract.

GET /v1/billing/contracts/{id}/pricing_information

const { data } = await client.getContractPricingInformation({
id: '123e4567-e89b-12d3-a456-426614174000',
history_change_types: 'example',
include_history: true,
})
Response
{
"entity_type": "contract",
"entity_id": "string",
"title": "string",
"current_installment_amount": {
"amount": 10050,
"amount_decimal": "100.50",
"currency": "EUR"
},
"context": {
"base_price": {
"price_id": "string",
"price_title": "string",
"tariff_type": "string",
"pricing_model": "string",
"unit_amount_gross_decimal": "string",
"unit_amount_net_decimal": "string",
"before_discount_unit_amount_gross_decimal": "string",
"before_discount_unit_amount_net_decimal": "string",
"unit_discount_amount_decimal": "string",
"unit_discount_amount_net_decimal": "string",
"currency": "EUR",
"billing_period": "string",
"unit": "string",
"has_discount": true,
"is_dynamic_tariff": true,
"dynamic_tariff": {}
},
"base_prices": [
{}
],
"working_price": {
"price_id": "string",
"price_title": "string",
"tariff_type": "string",
"pricing_model": "string",
"unit_amount_gross_decimal": "string",
"unit_amount_net_decimal": "string",
"before_discount_unit_amount_gross_decimal": "string",
"before_discount_unit_amount_net_decimal": "string",
"unit_discount_amount_decimal": "string",
"unit_discount_amount_net_decimal": "string",
"currency": "EUR",
"billing_period": "string",
"unit": "string",
"has_discount": true,
"is_dynamic_tariff": true,
"dynamic_tariff": {}
},
"working_prices": [
{}
]
},
"balance": {
"amount": 8990,
"amount_decimal": "89.90",
"currency": "EUR"
},
"schedule": {
"billing_due_day": 0,
"billing_period": "weekly",
"installments_per_year": 0,
"inferred": true
},
"pending_installment_change": true,
"history": [
{
"event_id": "string",
"org_id": "string",
"entity_type": "contract",
"entity_id": "string",
"schema_version": 1,
"effective_at": "1970-01-01T00:00:00.000Z",
"changed_at": "1970-01-01T00:00:00.000Z",
"created_at": "1970-01-01T00:00:00.000Z",
"source": "portal",
"source_label": "string",
"source_system": "string",
"source_reference": "string",
"change_type": "installment_amount_changed",
"previous_value": {},
"new_value": {},
"context": {}
}
]
}

getBillingAccountPricingInformation​

Get current pricing information for the active Contracts linked to a Billing Account.

GET /v1/billing/billing_accounts/{id}/pricing_information

const { data } = await client.getBillingAccountPricingInformation({
id: '123e4567-e89b-12d3-a456-426614174000',
history_change_types: 'example',
include_history: true,
})
Response
{
"entity_type": "billing_account",
"entity_id": "string",
"title": "string",
"balance": {
"amount": 8990,
"amount_decimal": "89.90",
"currency": "EUR"
},
"contracts": [
{
"entity_type": "contract",
"entity_id": "string",
"title": "string",
"current_installment_amount": {},
"context": {},
"balance": {},
"schedule": {},
"pending_installment_change": true,
"history": []
}
]
}

getContractConfigurationHistory​

Get billing configuration history for a Contract.

GET /v1/billing/contracts/{id}/configuration_history

const { data } = await client.getContractConfigurationHistory({
id: '123e4567-e89b-12d3-a456-426614174000',
change_type: 'example',
history_change_types: 'example',
from: 1,
size: 1,
})
Response
{
"history": [
{
"event_id": "string",
"org_id": "string",
"entity_type": "contract",
"entity_id": "string",
"schema_version": 1,
"effective_at": "1970-01-01T00:00:00.000Z",
"changed_at": "1970-01-01T00:00:00.000Z",
"created_at": "1970-01-01T00:00:00.000Z",
"source": "portal",
"source_label": "string",
"source_system": "string",
"source_reference": "string",
"change_type": "installment_amount_changed",
"previous_value": {},
"new_value": {},
"context": {}
}
],
"total": 0
}

getBillingAccountConfigurationHistory​

Get merged billing configuration history for active Contracts linked to a Billing Account.

GET /v1/billing/billing_accounts/{id}/configuration_history

const { data } = await client.getBillingAccountConfigurationHistory({
id: '123e4567-e89b-12d3-a456-426614174000',
change_type: 'example',
history_change_types: 'example',
from: 1,
size: 1,
})
Response
{
"history": [
{
"event_id": "string",
"org_id": "string",
"entity_type": "contract",
"entity_id": "string",
"schema_version": 1,
"effective_at": "1970-01-01T00:00:00.000Z",
"changed_at": "1970-01-01T00:00:00.000Z",
"created_at": "1970-01-01T00:00:00.000Z",
"source": "portal",
"source_label": "string",
"source_system": "string",
"source_reference": "string",
"change_type": "installment_amount_changed",
"previous_value": {},
"new_value": {},
"context": {}
}
],
"total": 0
}

getCustomerBalance​

Retrieve the total balance (Kontostand) across all contracts and orders for a customer.

GET /v1/billing/customers/{id}/balance

const { data } = await client.getCustomerBalance({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"balance": 8990,
"balance_decimal": "89.90",
"balance_currency": "EUR"
}

Schemas​

Error​

Standard error response format

type Error = {
error: string
message: string
}

BaseEntity​

Base schema for all epilot entities with common system fields

type BaseEntity = {
_id?: string
_title?: string
_org?: string
_schema?: string
_tags?: string[]
_created_at?: string // date-time
_updated_at?: string // date-time
}

EntityId​

Unique entity identifier (UUID format)

type EntityId = string

EntitySlug​

URL-friendly identifier for the entity schema (Schema-Slug)

type EntitySlug = string

EntityRelationItem​

Reference to a related entity

type EntityRelationItem = {
entity_id?: string
}

BaseBillingEvent​

Represents a single financial transaction entry (Buchungssatz) in the billing ledger. Each entry is either a debit or a credit, following double-entry accounting principles. Common types include Abschlagszahlung (installment), Zahlungseingang (payment), Rückerstattung (reimbursement), etc.

type BaseBillingEvent = {
_id?: string
_title?: string
_org?: string
_schema?: string
_tags?: string[]
_created_at?: string // date-time
_updated_at?: string // date-time
type: string
direction?: "debit" | "credit"
billing_amount: number
billing_amount_decimal: string
billing_currency: string
external_id?: string
contract: {
$relation?: Array<{
entity_id?: { ... }
}>
}
booking_date: string // date
due_date?: string // date
paid_date?: string // date-time
status?: "closed" | "open"
related_event?: string
external_link?: {
href?: string // uri
title?: string
}
attachments?: {
$relation?: Array<{
entity_id?: { ... }
}>
}
note?: string
internal_note?: string
}

BillingEvent​

Collection of supported billing event types (Buchungsarten). Each type represents a different kind of financial transaction that affects the customer's balance.

type BillingEvent = {
type?: "installment"
} | {
type?: "payment"
} | {
type?: "reimbursement"
} | {
type?: "dunning_fee"
} | {
type?: "invoice"
} | {
type?: "final_bill"
} | {
type?: "bonus"
} | {
type?: "correction"
} | {
type?: string
}

BillingEventUpdate​

Fields to update on an existing billing event.

type BillingEventUpdate = {
type?: string
direction?: "debit" | "credit"
billing_amount?: number
billing_amount_decimal?: string
billing_currency?: string
external_id?: string
contract?: {
$relation?: Array<{
entity_id?: { ... }
}>
}
booking_date?: string // date
due_date?: string // date
paid_date?: string // date-time
status?: "closed" | "open"
related_event?: string
external_link?: {
href?: string // uri
title?: string
}
attachments?: {
$relation?: Array<{
entity_id?: { ... }
}>
}
note?: string
internal_note?: string
}

InstallmentEvent​

Installment billing event (Abschlagszahlung). Represents a scheduled partial payment that the customer owes, typically billed monthly for utilities like electricity or gas.

type InstallmentEvent = {
type?: "installment"
}

PaymentEvent​

Payment received event (Zahlungseingang). Represents money received from the customer, reducing their balance. This is a credit transaction.

type PaymentEvent = {
type?: "payment"
}

ReimbursementEvent​

Reimbursement event (Rückerstattung). Represents a refund to the customer, typically after overpayment or billing correction. This is a credit transaction.

type ReimbursementEvent = {
type?: "reimbursement"
}

DunningFeeEvent​

Dunning fee event (Mahngebühr). Represents a late payment fee charged to the customer after a payment reminder has been sent. This is a debit transaction.

type DunningFeeEvent = {
type?: "dunning_fee"
}

InvoiceEvent​

type InvoiceEvent = {
type?: "invoice"
}

FinalBillEvent​

Final bill event (Endabrechnung/Schlussrechnung). Represents the final settlement when a contract ends, accounting for actual consumption vs. paid installments. Can be either debit (customer owes more) or credit (customer overpaid).

type FinalBillEvent = {
type?: "final_bill"
}

BonusEvent​

Bonus/credit event (Gutschrift/Bonus). Represents a promotional credit or bonus applied to the customer's account, such as welcome bonuses or loyalty rewards. This is a credit transaction.

type BonusEvent = {
type?: "bonus"
}

CorrectionEvent​

Correction event (Korrekturbuchung). Represents an adjustment to a previous billing entry, such as correcting an overcharge or undercharge. Can be either debit or credit depending on the correction.

type CorrectionEvent = {
type?: "correction"
}

CustomEvent​

Custom billing event (Benutzerdefinierte Buchung). Allows for organization-specific billing event types not covered by the standard types. Use a descriptive type name.

type CustomEvent = {
type?: string
}

Contract​

Represents a customer contract (Vertrag) for billing purposes. Contracts are the parent entities for billing events and contain billing configuration such as installment amounts and billing cycles.

type Contract = {
_id?: string
_title?: string
_org?: string
_schema?: string
_tags?: string[]
_created_at?: string // date-time
_updated_at?: string // date-time
contract_name?: string
contract_number?: string
status?: "draft" | "in_approval_process" | "approved" | "active" | "deactivated" | "revoked" | "terminated" | "expired"
description?: string
account_number?: string
branch?: "power" | "gas" | "water" | "waste_water" | "district_heating"
billing_address?: string
delivery_address?: string
additional_addresses?: string
termination_date?: string // date
termination_reason?: string
billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly"
billing_duration_amount?: number
renewal_duration_amount?: number
renewal_duration_unit?: "weeks" | "months" | "years"
notice_time_amount?: number
notice_time_unit?: "weeks" | "months" | "years"
start_date?: string // date
billing_due_day?: number
installment_amount?: number
balance?: number
balance_currency?: string
}

ContractItem​

Contract entity with all required system fields populated

type ContractItem = {
_id?: string
_title?: string
_org?: string
_schema?: string
_tags?: string[]
_created_at?: string // date-time
_updated_at?: string // date-time
contract_name?: string
contract_number?: string
status?: "draft" | "in_approval_process" | "approved" | "active" | "deactivated" | "revoked" | "terminated" | "expired"
description?: string
account_number?: string
branch?: "power" | "gas" | "water" | "waste_water" | "district_heating"
billing_address?: string
delivery_address?: string
additional_addresses?: string
termination_date?: string // date
termination_reason?: string
billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly"
billing_duration_amount?: number
renewal_duration_amount?: number
renewal_duration_unit?: "weeks" | "months" | "years"
notice_time_amount?: number
notice_time_unit?: "weeks" | "months" | "years"
start_date?: string // date
billing_due_day?: number
installment_amount?: number
balance?: number
balance_currency?: string
}

InstallmentAmountValue​

type InstallmentAmountValue = {
amount?: number
amount_decimal?: string
currency?: string
}

PriceContext​

type PriceContext = {
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
unit_discount_amount_decimal?: string
unit_discount_amount_net_decimal?: string
currency?: string
billing_period?: string
unit?: string
has_discount?: boolean
is_dynamic_tariff?: boolean
dynamic_tariff?: {
mode?: string
interval?: string
average_price_decimal?: string
markup_amount_decimal?: string
markup_amount_net_decimal?: string
markup_amount_gross_decimal?: string
market_price_decimal?: string
market_price_currency?: string
market?: string
bidding_zone?: string
timestamp?: string
}
}

DynamicTariffPriceContext​

type DynamicTariffPriceContext = {
mode?: string
interval?: string
average_price_decimal?: string
markup_amount_decimal?: string
markup_amount_net_decimal?: string
markup_amount_gross_decimal?: string
market_price_decimal?: string
market_price_currency?: string
market?: string
bidding_zone?: string
timestamp?: string
}

ConfigurationHistoryContext​

type ConfigurationHistoryContext = {
base_price?: {
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
unit_discount_amount_decimal?: string
unit_discount_amount_net_decimal?: string
currency?: string
billing_period?: string
unit?: string
has_discount?: boolean
is_dynamic_tariff?: boolean
dynamic_tariff?: {
mode?: { ... }
interval?: { ... }
average_price_decimal?: { ... }
markup_amount_decimal?: { ... }
markup_amount_net_decimal?: { ... }
markup_amount_gross_decimal?: { ... }
market_price_decimal?: { ... }
market_price_currency?: { ... }
market?: { ... }
bidding_zone?: { ... }
timestamp?: { ... }
}
}
base_prices?: Array<{
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
unit_discount_amount_decimal?: string
unit_discount_amount_net_decimal?: string
currency?: string
billing_period?: string
unit?: string
has_discount?: boolean
is_dynamic_tariff?: boolean
dynamic_tariff?: {
mode?: { ... }
interval?: { ... }
average_price_decimal?: { ... }
markup_amount_decimal?: { ... }
markup_amount_net_decimal?: { ... }
markup_amount_gross_decimal?: { ... }
market_price_decimal?: { ... }
market_price_currency?: { ... }
market?: { ... }
bidding_zone?: { ... }
timestamp?: { ... }
}
}>
working_price?: {
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
unit_discount_amount_decimal?: string
unit_discount_amount_net_decimal?: string
currency?: string
billing_period?: string
unit?: string
has_discount?: boolean
is_dynamic_tariff?: boolean
dynamic_tariff?: {
mode?: { ... }
interval?: { ... }
average_price_decimal?: { ... }
markup_amount_decimal?: { ... }
markup_amount_net_decimal?: { ... }
markup_amount_gross_decimal?: { ... }
market_price_decimal?: { ... }
market_price_currency?: { ... }
market?: { ... }
bidding_zone?: { ... }
timestamp?: { ... }
}
}
working_prices?: Array<{
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
// ...
}

ContractTariffContext​

type ContractTariffContext = {
product_id?: string
product_title?: string
}

ContractPricingContext​

type ContractPricingContext = {
base_price?: {
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
unit_discount_amount_decimal?: string
unit_discount_amount_net_decimal?: string
currency?: string
billing_period?: string
unit?: string
has_discount?: boolean
is_dynamic_tariff?: boolean
dynamic_tariff?: {
mode?: { ... }
interval?: { ... }
average_price_decimal?: { ... }
markup_amount_decimal?: { ... }
markup_amount_net_decimal?: { ... }
markup_amount_gross_decimal?: { ... }
market_price_decimal?: { ... }
market_price_currency?: { ... }
market?: { ... }
bidding_zone?: { ... }
timestamp?: { ... }
}
}
base_prices?: Array<{
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
unit_discount_amount_decimal?: string
unit_discount_amount_net_decimal?: string
currency?: string
billing_period?: string
unit?: string
has_discount?: boolean
is_dynamic_tariff?: boolean
dynamic_tariff?: {
mode?: { ... }
interval?: { ... }
average_price_decimal?: { ... }
markup_amount_decimal?: { ... }
markup_amount_net_decimal?: { ... }
markup_amount_gross_decimal?: { ... }
market_price_decimal?: { ... }
market_price_currency?: { ... }
market?: { ... }
bidding_zone?: { ... }
timestamp?: { ... }
}
}>
working_price?: {
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
unit_discount_amount_decimal?: string
unit_discount_amount_net_decimal?: string
currency?: string
billing_period?: string
unit?: string
has_discount?: boolean
is_dynamic_tariff?: boolean
dynamic_tariff?: {
mode?: { ... }
interval?: { ... }
average_price_decimal?: { ... }
markup_amount_decimal?: { ... }
markup_amount_net_decimal?: { ... }
markup_amount_gross_decimal?: { ... }
market_price_decimal?: { ... }
market_price_currency?: { ... }
market?: { ... }
bidding_zone?: { ... }
timestamp?: { ... }
}
}
working_prices?: Array<{
price_id?: string
price_title?: string
tariff_type?: string
pricing_model?: string
unit_amount_gross_decimal?: string
unit_amount_net_decimal?: string
before_discount_unit_amount_gross_decimal?: string
before_discount_unit_amount_net_decimal?: string
// ...
}

ConfigurationHistoryRowBase​

type ConfigurationHistoryRowBase = {
event_id: string
org_id: string
entity_type: "contract" | "billing_account"
entity_id: string
schema_version: number
effective_at?: string // date-time
changed_at: string // date-time
created_at: string // date-time
source: "portal" | "epilot" | "erp" | "system" | "api" | "external" | "journey" | "automation" | "unknown"
source_label?: string
source_system?: string
source_reference?: string
}

InstallmentAmountChangedHistoryRow​

type InstallmentAmountChangedHistoryRow = {
event_id: string
org_id: string
entity_type: "contract" | "billing_account"
entity_id: string
schema_version: number
effective_at?: string // date-time
changed_at: string // date-time
created_at: string // date-time
source: "portal" | "epilot" | "erp" | "system" | "api" | "external" | "journey" | "automation" | "unknown"
source_label?: string
source_system?: string
source_reference?: string
change_type: "installment_amount_changed"
previous_value?: {
amount?: number
amount_decimal?: string
currency?: string
}
new_value: {
amount?: number
amount_decimal?: string
currency?: string
}
context?: {
base_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
base_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
working_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
working_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
}
}

ContractPricingChangedHistoryRow​

type ContractPricingChangedHistoryRow = {
event_id: string
org_id: string
entity_type: "contract" | "billing_account"
entity_id: string
schema_version: number
effective_at?: string // date-time
changed_at: string // date-time
created_at: string // date-time
source: "portal" | "epilot" | "erp" | "system" | "api" | "external" | "journey" | "automation" | "unknown"
source_label?: string
source_system?: string
source_reference?: string
change_type: "contract_pricing_changed"
previous_context: {
base_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
base_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
working_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
working_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
tariff?: {
product_id?: { ... }
product_title?: { ... }
}
tariffs?: Array<{
product_id?: { ... }
product_title?: { ... }
}>
}
new_context: {
base_price?: {
price_id?: { ... }
price_title?: { ... }
// ...
}

ConfigurationHistoryRow​

type ConfigurationHistoryRow = {
event_id: string
org_id: string
entity_type: "contract" | "billing_account"
entity_id: string
schema_version: number
effective_at?: string // date-time
changed_at: string // date-time
created_at: string // date-time
source: "portal" | "epilot" | "erp" | "system" | "api" | "external" | "journey" | "automation" | "unknown"
source_label?: string
source_system?: string
source_reference?: string
change_type: "installment_amount_changed"
previous_value?: {
amount?: number
amount_decimal?: string
currency?: string
}
new_value: {
amount?: number
amount_decimal?: string
currency?: string
}
context?: {
base_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
base_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
working_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
working_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
}
} | {
event_id: string
// ...
}

ConfigurationHistoryResponse​

type ConfigurationHistoryResponse = {
history: Array<{
event_id: string
org_id: string
entity_type: "contract" | "billing_account"
entity_id: string
schema_version: number
effective_at?: string // date-time
changed_at: string // date-time
created_at: string // date-time
source: "portal" | "epilot" | "erp" | "system" | "api" | "external" | "journey" | "automation" | "unknown"
source_label?: string
source_system?: string
source_reference?: string
change_type: "installment_amount_changed"
previous_value?: {
amount?: { ... }
amount_decimal?: { ... }
currency?: { ... }
}
new_value: {
amount?: { ... }
amount_decimal?: { ... }
currency?: { ... }
}
context?: {
base_price?: { ... }
base_prices?: { ... }
working_price?: { ... }
working_prices?: { ... }
}
} | {
event_id: string
org_id: string
entity_type: "contract" | "billing_account"
entity_id: string
schema_version: number
effective_at?: string // date-time
changed_at: string // date-time
created_at: string // date-time
source: "portal" | "epilot" | "erp" | "system" | "api" | "external" | "journey" | "automation" | "unknown"
source_label?: string
source_system?: string
source_reference?: string
change_type: "contract_pricing_changed"
previous_context: {
base_price?: { ... }
base_prices?: { ... }
working_price?: { ... }
working_prices?: { ... }
tariff?: { ... }
tariffs?: { ... }
}
new_context: {
base_price?: { ... }
base_prices?: { ... }
working_price?: { ... }
working_prices?: { ... }
tariff?: { ... }
tariffs?: { ... }
}
changed_fields: "tariff" | "base_price" | "working_price" | "discount" | "dynamic_tariff_configuration"[]
installment_amount?: {
amount?: { ... }
amount_decimal?: { ... }
currency?: { ... }
}
}>
total: number
}

PricingInformationBalance​

type PricingInformationBalance = {
amount?: number
amount_decimal?: string
currency?: string
}

ContractPricingSchedule​

type ContractPricingSchedule = {
billing_due_day?: number
billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly"
installments_per_year?: number
inferred: boolean
}

ContractPricingInformation​

type ContractPricingInformation = {
entity_type: "contract"
entity_id: string
title?: string
current_installment_amount?: {
amount?: number
amount_decimal?: string
currency?: string
}
context?: {
base_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
base_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
working_price?: {
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}
working_prices?: Array<{
price_id?: { ... }
price_title?: { ... }
tariff_type?: { ... }
pricing_model?: { ... }
unit_amount_gross_decimal?: { ... }
unit_amount_net_decimal?: { ... }
before_discount_unit_amount_gross_decimal?: { ... }
before_discount_unit_amount_net_decimal?: { ... }
unit_discount_amount_decimal?: { ... }
unit_discount_amount_net_decimal?: { ... }
currency?: { ... }
billing_period?: { ... }
unit?: { ... }
has_discount?: { ... }
is_dynamic_tariff?: { ... }
dynamic_tariff?: { ... }
}>
}
balance?: {
amount?: number
amount_decimal?: string
currency?: string
}
schedule?: {
billing_due_day?: number
billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly"
installments_per_year?: number
inferred: boolean
}
pending_installment_change?: boolean
history: Array<{
event_id: string
org_id: string
entity_type: "contract" | "billing_account"
entity_id: string
// ...
}

BillingAccountPricingInformation​

type BillingAccountPricingInformation = {
entity_type: "billing_account"
entity_id: string
title?: string
balance?: {
amount?: number
amount_decimal?: string
currency?: string
}
contracts: Array<{
entity_type: "contract"
entity_id: string
title?: string
current_installment_amount?: {
amount?: { ... }
amount_decimal?: { ... }
currency?: { ... }
}
context?: {
base_price?: { ... }
base_prices?: { ... }
working_price?: { ... }
working_prices?: { ... }
}
balance?: {
amount?: { ... }
amount_decimal?: { ... }
currency?: { ... }
}
schedule?: {
billing_due_day?: { ... }
billing_period?: { ... }
installments_per_year?: { ... }
inferred: { ... }
}
pending_installment_change?: boolean
history: Array<{
event_id: { ... }
org_id: { ... }
entity_type: { ... }
entity_id: { ... }
schema_version: { ... }
effective_at?: { ... }
changed_at: { ... }
created_at: { ... }
source: { ... }
source_label?: { ... }
source_system?: { ... }
source_reference?: { ... }
change_type: { ... }
previous_value?: { ... }
new_value: { ... }
context?: { ... }
} | {
event_id: { ... }
org_id: { ... }
entity_type: { ... }
entity_id: { ... }
schema_version: { ... }
effective_at?: { ... }
changed_at: { ... }
created_at: { ... }
source: { ... }
source_label?: { ... }
source_system?: { ... }
source_reference?: { ... }
change_type: { ... }
previous_context: { ... }
new_context: { ... }
changed_fields: { ... }
installment_amount?: { ... }
}>
}>
}

Balance​

Customer balance summary (Kontostandübersicht). Represents the aggregated balance across all contracts and orders for a customer.

type Balance = {
balance?: number
balance_decimal?: string
balance_currency?: string
}

Currency​

Currency code in ISO 4217 format (Währungscode). Common values: EUR (Euro), CHF (Swiss Franc)

type Currency = string