Skip to main content

Billing API

API to manage billing data for epilot contracts and orders.

Quick Start​

# List available operations
epilot billing

# Call an operation
epilot billing getBillingEvents

Common Flags​

FlagDescription
-p key=valueSet a named parameter
-d '{...}'Request body JSON
-H 'Key: Value'Custom header
-t, --token <token>Bearer token for authentication
--profile <name>Use a named profile
-s, --server <url>Override server base URL
-i, --includeInclude response headers in output
--jsonOutput raw JSON (no formatting)
-v, --verboseVerbose output (show request details)
--jsonata <expr>JSONata expression to transform response
--definition <file>Override OpenAPI spec file/URL
--guidedPrompt for all parameters interactively
--no-interactiveDisable interactive prompts

Operations​

Billing Events

  • getBillingEvents — Retrieve and filter billing events (Buchungssätze) such as installments (Abschlagszahlungen),
  • createBillingEvent — Create a new billing event (Buchungssatz) such as an installment (Abschlagszahlung),
  • getBillingEvent — Retrieve a single billing event (Buchungssatz) by its unique ID.
  • updateBillingEvent — Update an existing billing event (Buchungssatz).
  • deleteBillingEvent — Delete an existing billing event (Buchungssatz).
  • getBillingEventByExternalId — Retrieve a billing event (Buchungssatz) by its external system identifier.

Contracts

Pricing Information

Configuration History

Balance

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

getBillingEvents​

Retrieve and filter billing events (Buchungssätze) such as installments (Abschlagszahlungen),

GET /v1/billing/events

Parameters

NameInTypeRequiredDescription
fromquerynumberNoPagination offset - number of results to skip
sizequerynumberNoMaximum number of results to return per page
entity_idquerystring[]NoFilter billing events by one or more entity IDs (e.g., contract or order IDs)
contact_idquerystringNoFilter billing events by customer contact ID (Kundennummer)
event_typequery"installment" | "reimbursement"NoFilter by billing event type (Buchungsart):
  • installment: Abschlagszahlung (scheduled payment due)
  • reimbursement: Rückerstattung (refund to customer) | | date_after | query | string (date-time) | No | Filter billing events with booking date (Buchungsdatum) after this timestamp | | date_before | query | string (date-time) | No | Filter billing events with booking date (Buchungsdatum) before this timestamp |

Sample Call

epilot billing getBillingEvents

With JSONata filter:

epilot billing getBillingEvents --jsonata 'results[0]'
Sample 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),

POST /v1/billing/events

Request Body (required)

Sample Call

epilot billing createBillingEvent

With request body:

epilot billing createBillingEvent \
-d '{
"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"
}'

Using stdin pipe:

cat body.json | epilot billing createBillingEvent

With JSONata filter:

epilot billing createBillingEvent --jsonata '$'
Sample 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}

Parameters

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the billing event (Buchungssatz-ID)

Sample Call

epilot billing getBillingEvent \
-p id=5da0a718-c822-403d-9f5d-20d4584e0528

Using positional args for path parameters:

epilot billing getBillingEvent 5da0a718-c822-403d-9f5d-20d4584e0528

With JSONata filter:

epilot billing getBillingEvent -p id=5da0a718-c822-403d-9f5d-20d4584e0528 --jsonata '$'
Sample 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}

Parameters

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the billing event to update

Request Body (required)

Sample Call

epilot billing updateBillingEvent \
-p id=5da0a718-c822-403d-9f5d-20d4584e0528

With request body:

epilot billing updateBillingEvent \
-p id=5da0a718-c822-403d-9f5d-20d4584e0528 \
-d '{
"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"
}'

Using positional args for path parameters:

epilot billing updateBillingEvent 5da0a718-c822-403d-9f5d-20d4584e0528

Using stdin pipe:

cat body.json | epilot billing updateBillingEvent -p id=5da0a718-c822-403d-9f5d-20d4584e0528

With JSONata filter:

epilot billing updateBillingEvent -p id=5da0a718-c822-403d-9f5d-20d4584e0528 --jsonata '$'
Sample 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}

Parameters

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the billing event to delete

Sample Call

epilot billing deleteBillingEvent \
-p id=5da0a718-c822-403d-9f5d-20d4584e0528

Using positional args for path parameters:

epilot billing deleteBillingEvent 5da0a718-c822-403d-9f5d-20d4584e0528

With JSONata filter:

epilot billing deleteBillingEvent -p id=5da0a718-c822-403d-9f5d-20d4584e0528 --jsonata '$'

getBillingEventByExternalId​

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

GET /v1/billing/external/{external_id}

Parameters

NameInTypeRequiredDescription
external_idpathstringYesExternal system identifier for the billing event.

For example, a SAP document number or payment processor reference ID. |

Sample Call

epilot billing getBillingEventByExternalId \
-p external_id=SAP-54321

Using positional args for path parameters:

epilot billing getBillingEventByExternalId SAP-54321

With JSONata filter:

epilot billing getBillingEventByExternalId -p external_id=SAP-54321 --jsonata '$'
Sample 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

Request Body (required)

Sample Call

epilot billing createContractEntity

With request body:

epilot billing createContractEntity \
-d '{
"_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"
}'

Using stdin pipe:

cat body.json | epilot billing createContractEntity

With JSONata filter:

epilot billing createContractEntity --jsonata '$'
Sample 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}

Parameters

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the contract (Vertragsnummer)

Request Body (required)

Sample Call

epilot billing updateContractEntity \
-p id=f589786b-3024-43cd-9cb3-5a3c953f2896

With request body:

epilot billing updateContractEntity \
-p id=f589786b-3024-43cd-9cb3-5a3c953f2896 \
-d '{
"_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"
}'

Using positional args for path parameters:

epilot billing updateContractEntity f589786b-3024-43cd-9cb3-5a3c953f2896

Using stdin pipe:

cat body.json | epilot billing updateContractEntity -p id=f589786b-3024-43cd-9cb3-5a3c953f2896

With JSONata filter:

epilot billing updateContractEntity -p id=f589786b-3024-43cd-9cb3-5a3c953f2896 --jsonata '$'
Sample 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}

Parameters

NameInTypeRequiredDescription
idpathstringYesUnique identifier of the contract to delete

Sample Call

epilot billing deleteContractEntity \
-p id=f589786b-3024-43cd-9cb3-5a3c953f2896

Using positional args for path parameters:

epilot billing deleteContractEntity f589786b-3024-43cd-9cb3-5a3c953f2896

With JSONata filter:

epilot billing deleteContractEntity -p id=f589786b-3024-43cd-9cb3-5a3c953f2896 --jsonata '$'

getContractPricingInformation​

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

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

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the Contract entity
history_change_typesquerystringNoComma-separated billing configuration change types to return. When omitted, installment history is returned by default.
include_historyquerybooleanNoInclude recent configuration history in the pricing information response. Set to false when using the dedicated configuration history endpoint.

Sample Call

epilot billing getContractPricingInformation \
-p id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot billing getContractPricingInformation 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot billing getContractPricingInformation -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'entity_type'
Sample 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

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the Billing Account entity
history_change_typesquerystringNoComma-separated billing configuration change types to return. When omitted, installment history is returned by default.
include_historyquerybooleanNoInclude recent configuration history in the pricing information response. Set to false when using the dedicated configuration history endpoint.

Sample Call

epilot billing getBillingAccountPricingInformation \
-p id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot billing getBillingAccountPricingInformation 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot billing getBillingAccountPricingInformation -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'entity_type'
Sample 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

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the Contract entity
change_typequery"installment_amount_changed" | "contract_pricing_changed"NoBilling configuration change type to return.
history_change_typesquerystringNoComma-separated billing configuration change types to return. When omitted, installment history is returned by default.
fromquerynumberNoInitial offset for paginated results.
sizequerynumberNoMaximum number of results to return.

Sample Call

epilot billing getContractConfigurationHistory \
-p id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot billing getContractConfigurationHistory 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot billing getContractConfigurationHistory -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'history'
Sample 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

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the Billing Account entity
change_typequery"installment_amount_changed" | "contract_pricing_changed"NoBilling configuration change type to return.
history_change_typesquerystringNoComma-separated billing configuration change types to return. When omitted, installment history is returned by default.
fromquerynumberNoInitial offset for paginated results.
sizequerynumberNoMaximum number of results to return.

Sample Call

epilot billing getBillingAccountConfigurationHistory \
-p id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot billing getBillingAccountConfigurationHistory 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot billing getBillingAccountConfigurationHistory -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'history'
Sample 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

Parameters

NameInTypeRequiredDescription
idpathstringYesCustomer entity ID. This can be either a contact ID (Kontakt-ID) or

an account ID (Kundenkonto-ID). |

Sample Call

epilot billing getCustomerBalance \
-p id=1e3f0d58-69d2-4dbb-9a43-3ee63d862e8e

Using positional args for path parameters:

epilot billing getCustomerBalance 1e3f0d58-69d2-4dbb-9a43-3ee63d862e8e

With JSONata filter:

epilot billing getCustomerBalance -p id=1e3f0d58-69d2-4dbb-9a43-3ee63d862e8e --jsonata 'balance'
Sample Response
{
"balance": 8990,
"balance_decimal": "89.90",
"balance_currency": "EUR"
}