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

Contracts

Balance

  • getCustomerBalance โ€” Get total balance across all contracts and orders of a customer entity.

getBillingEventsโ€‹

Get and filter billing events such as installments and reimbursements.

GET /v1/billing/events

Parameters

NameInTypeRequiredDescription
fromquerynumberNo
sizequerynumberNo
entity_idquerystring[]NoEntity ID to filter billing events by
event_typequery"installment" | "reimbursement"No
date_afterquerystring (date-time)No
date_beforequerystring (date-time)No

Sample Call

epilot billing getBillingEvents

With JSONata filter:

epilot billing getBillingEvents --jsonata 'results[0]'
Sample Response
{
"hits": 0,
"results": [
{
"billing_amount": 10050,
"billing_amount_decimal": "100.50",
"billing_currency": "EUR",
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
"contract": {
"$relation": [
{
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
}
]
},
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"type": "installment",
"due_date": "1970-01-01T00:00:00.000Z",
"paid_date": "1970-01-01T00:00:00.000Z"
}
]
}

createBillingEventโ€‹

Create a new billing event.

POST /v1/billing/events

Request Body (required)

Sample Call

epilot billing createBillingEvent

With request body:

epilot billing createBillingEvent \
-d '{
"billing_amount": 10050,
"billing_amount_decimal": "100.50",
"billing_currency": "EUR",
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
"contract": {
"$relation": [
{
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
}
]
},
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"type": "installment",
"due_date": "1970-01-01T00:00:00.000Z",
"paid_date": "1970-01-01T00:00:00.000Z"
}'

Using stdin pipe:

cat body.json | epilot billing createBillingEvent

With JSONata filter:

epilot billing createBillingEvent --jsonata '$'
Sample Response
{
"billing_amount": 10050,
"billing_amount_decimal": "100.50",
"billing_currency": "EUR",
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
"contract": {
"$relation": [
{
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
}
]
},
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"type": "installment",
"due_date": "1970-01-01T00:00:00.000Z",
"paid_date": "1970-01-01T00:00:00.000Z"
}

getBillingEventโ€‹

Get a single billing event by ID.

GET /v1/billing/events/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the billing event to get

Sample Call

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

Using positional args for path parameters:

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

With JSONata filter:

epilot billing getBillingEvent -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"billing_amount": 10050,
"billing_amount_decimal": "100.50",
"billing_currency": "EUR",
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
"contract": {
"$relation": [
{
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
}
]
},
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"type": "installment",
"due_date": "1970-01-01T00:00:00.000Z",
"paid_date": "1970-01-01T00:00:00.000Z"
}

updateBillingEventโ€‹

Update an existing billing event.

PATCH /v1/billing/events/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the billing event to update

Request Body (required)

Sample Call

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

With request body:

epilot billing updateBillingEvent \
-p id=123e4567-e89b-12d3-a456-426614174000 \
-d '{
"billing_amount": 10050,
"billing_amount_decimal": "100.50",
"billing_currency": "EUR",
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
"contract": {
"$relation": [
{
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
}
]
},
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"type": "installment",
"due_date": "1970-01-01T00:00:00.000Z",
"paid_date": "1970-01-01T00:00:00.000Z"
}'

Using positional args for path parameters:

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

Using stdin pipe:

cat body.json | epilot billing updateBillingEvent -p id=123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot billing updateBillingEvent -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"billing_amount": 10050,
"billing_amount_decimal": "100.50",
"billing_currency": "EUR",
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
"contract": {
"$relation": [
{
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
}
]
},
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"type": "installment",
"due_date": "1970-01-01T00:00:00.000Z",
"paid_date": "1970-01-01T00:00:00.000Z"
}

deleteBillingEventโ€‹

Delete an existing billing event.

DELETE /v1/billing/events/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the billing event to delete

Sample Call

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

Using positional args for path parameters:

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

With JSONata filter:

epilot billing deleteBillingEvent -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'

getBillingEventByExternalIdโ€‹

Get a single billing event by External ID.

GET /v1/billing/external/{external_id}

Parameters

NameInTypeRequiredDescription
external_idpathstringYesID of the billing event to get

Sample Call

epilot billing getBillingEventByExternalId \
-p external_id=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

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

With JSONata filter:

epilot billing getBillingEventByExternalId -p external_id=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"billing_amount": 10050,
"billing_amount_decimal": "100.50",
"billing_currency": "EUR",
"external_id": "d4fb2a4e-3f74-4fc4-8fba-6fdaaaa3b08e",
"contract": {
"$relation": [
{
"entity_id": "f589786b-3024-43cd-9cb3-5a3c953f2896"
}
]
},
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"type": "installment",
"due_date": "1970-01-01T00:00:00.000Z",
"paid_date": "1970-01-01T00:00:00.000Z"
}

createContractEntityโ€‹

Create a new contract entity.

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": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"contract_name": "Grid Contract",
"contract_number": "12345",
"status": "approved",
"description": "This contract is for the supply of widgets.",
"account_number": "67890",
"branch": "power",
"billing_address": "123 Main St, Anytown",
"delivery_address": "456 Elm St, Anytown",
"additional_addresses": "789 Oak St, Anytown",
"termination_date": "2022-01-01",
"termination_reason": "Non-payment",
"billing_period": "monthly",
"billing_duration_amount": 30,
"renewal_duration_amount": 365,
"renewal_duration_unit": "years",
"notice_time_amount": 30,
"notice_time_unit": "months",
"start_date": "2021-01-01",
"billing_due_day": 2,
"installment_amount": 10050,
"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": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"contract_name": "Grid Contract",
"contract_number": "12345",
"status": "approved",
"description": "This contract is for the supply of widgets.",
"account_number": "67890",
"branch": "power",
"billing_address": "123 Main St, Anytown",
"delivery_address": "456 Elm St, Anytown",
"additional_addresses": "789 Oak St, Anytown",
"termination_date": "2022-01-01",
"termination_reason": "Non-payment",
"billing_period": "monthly",
"billing_duration_amount": 30,
"renewal_duration_amount": 365,
"renewal_duration_unit": "years",
"notice_time_amount": 30,
"notice_time_unit": "months",
"start_date": "2021-01-01",
"billing_due_day": 2,
"installment_amount": 10050,
"balance": 8990,
"balance_currency": "EUR"
}

updateContractEntityโ€‹

Update an existing contract entity.

PATCH /v1/billing/contracts/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the contract entity to update

Request Body (required)

Sample Call

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

With request body:

epilot billing updateContractEntity \
-p id=123e4567-e89b-12d3-a456-426614174000 \
-d '{
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"contract_name": "Grid Contract",
"contract_number": "12345",
"status": "approved",
"description": "This contract is for the supply of widgets.",
"account_number": "67890",
"branch": "power",
"billing_address": "123 Main St, Anytown",
"delivery_address": "456 Elm St, Anytown",
"additional_addresses": "789 Oak St, Anytown",
"termination_date": "2022-01-01",
"termination_reason": "Non-payment",
"billing_period": "monthly",
"billing_duration_amount": 30,
"renewal_duration_amount": 365,
"renewal_duration_unit": "years",
"notice_time_amount": 30,
"notice_time_unit": "months",
"start_date": "2021-01-01",
"billing_due_day": 2,
"installment_amount": 10050,
"balance": 8990,
"balance_currency": "EUR"
}'

Using positional args for path parameters:

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

Using stdin pipe:

cat body.json | epilot billing updateContractEntity -p id=123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot billing updateContractEntity -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"_id": "5da0a718-c822-403d-9f5d-20d4584e0528",
"_title": "string",
"_org": "string",
"_schema": "contact",
"_tags": ["string"],
"_created_at": "string",
"_updated_at": "string",
"contract_name": "Grid Contract",
"contract_number": "12345",
"status": "approved",
"description": "This contract is for the supply of widgets.",
"account_number": "67890",
"branch": "power",
"billing_address": "123 Main St, Anytown",
"delivery_address": "456 Elm St, Anytown",
"additional_addresses": "789 Oak St, Anytown",
"termination_date": "2022-01-01",
"termination_reason": "Non-payment",
"billing_period": "monthly",
"billing_duration_amount": 30,
"renewal_duration_amount": 365,
"renewal_duration_unit": "years",
"notice_time_amount": 30,
"notice_time_unit": "months",
"start_date": "2021-01-01",
"billing_due_day": 2,
"installment_amount": 10050,
"balance": 8990,
"balance_currency": "EUR"
}

deleteContractEntityโ€‹

Delete an existing contract entity.

DELETE /v1/billing/contracts/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesID of the contract entity to delete

Sample Call

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

Using positional args for path parameters:

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

With JSONata filter:

epilot billing deleteContractEntity -p id=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'

getCustomerBalanceโ€‹

Get total balance across all contracts and orders of a customer entity.

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

Parameters

NameInTypeRequiredDescription
idpathstringYesCustomer entity ID (contact or account)

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"
}