diff --git a/docs/integrations/core-events.md b/docs/integrations/core-events.md index 6df4e83..fd54f94 100644 --- a/docs/integrations/core-events.md +++ b/docs/integrations/core-events.md @@ -62,6 +62,10 @@ All events include these fields: +### Grid + + + ### ERP Sync diff --git a/static/events/GridConnectionRequested.config.json b/static/events/GridConnectionRequested.config.json new file mode 100644 index 0000000..9b608d5 --- /dev/null +++ b/static/events/GridConnectionRequested.config.json @@ -0,0 +1,165 @@ +{ + "event_name": "GridConnectionRequested", + "event_title": "Grid Connection Request", + "event_description": "A grid connection request (new connection or change of an existing connection — electricity, gas, water, district heating, fibre) was submitted. Explicitly triggered by Automation once the journey mapping has created the opportunity, its orders, parties and uploaded documents.", + "event_version": "1.0", + "event_tags": [ + "builtin", + "grid", + "automation", + "opportunity", + "order", + "attachment", + "grid-connection" + ], + "schema_fields": { + "event_attachments": { + "json_schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entity_id": { + "type": "string", + "format": "uuid", + "description": "Entity ID of the file" + }, + "filename": { + "type": "string", + "description": "Name of the file" + }, + "mime_type": { + "type": "string", + "description": "MIME type of the file (e.g., application/pdf)" + }, + "size_bytes": { + "type": "integer", + "minimum": 0, + "description": "File size in bytes" + }, + "s3ref": { + "type": "object", + "properties": { + "bucket": { + "type": "string", + "description": "S3 bucket name" + }, + "key": { + "type": "string", + "description": "S3 object key" + } + }, + "required": [ + "bucket", + "key" + ], + "additionalProperties": false, + "description": "S3 reference for the file content" + }, + "version_index": { + "type": "integer", + "minimum": 0, + "description": "Latest version index of the file (versions[].length - 1, or 0 if no versions array)" + }, + "readable_size": { + "type": "string", + "description": "Human-readable file size (e.g., \"200 KB\")" + }, + "_tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags on the file entity (semantic labels set by uploader/automation)" + }, + "relation_tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags on the relation pointing at the file (journey upload block tags such as \"Lageplan\", plus a hidden journey step marker)" + }, + "category": { + "type": "string", + "description": "File category select value (e.g., \"address-suggestions\", \"unknown\")" + }, + "file_date": { + "type": "string", + "description": "User-provided file date" + }, + "_created_at": { + "type": "string", + "format": "date-time", + "description": "When the file entity was created — useful for time-window filtering" + } + }, + "required": [ + "entity_id", + "version_index" + ], + "additionalProperties": false + }, + "description": "Every file related to the opportunity — site plans, floor plans, route plans, land-register extracts, load balances, powers of attorney. Empty when the request carries none. Consumers identify a given upload via `relation_tags` (the journey upload block tags) / `_tags`." + }, + "required": true, + "graph_source": "[opportunity_files.{\"entity_id\": _id, \"filename\": filename, \"mime_type\": mime_type, \"size_bytes\": size_bytes, \"s3ref\": s3ref, \"version_index\": ($count(versions) > 0 ? $count(versions) - 1 : 0), \"readable_size\": readable_size, \"_tags\": _tags, \"relation_tags\": relation_tags, \"category\": category, \"file_date\": file_date, \"_created_at\": _created_at}]" + } + }, + "entity_graph": { + "nodes": [ + { + "id": "opportunity", + "schema": "opportunity", + "cardinality": "one" + }, + { + "id": "submission", + "schema": "submission", + "cardinality": "one", + "fields": [ + "!token_claims", + "!_historyIndexes", + "!_displayConditionsStatus", + "!_validation_warnings", + "!_fallback" + ] + }, + { + "id": "contacts", + "schema": "contact", + "cardinality": "many" + }, + { + "id": "orders", + "schema": "order", + "cardinality": "many" + }, + { + "id": "opportunity_files", + "schema": "file", + "cardinality": "many" + } + ], + "edges": [ + { + "from": "opportunity", + "to": "submission" + }, + { + "from": "opportunity", + "to": "contacts" + }, + { + "from": "opportunity", + "to": "orders" + }, + { + "from": "opportunity", + "to": "opportunity_files" + } + ] + }, + "automation_trigger": true, + "automation_trigger_only": true, + "automation_trigger_seed_node": "opportunity" +} \ No newline at end of file diff --git a/static/events/GridConnectionRequested.sample.json b/static/events/GridConnectionRequested.sample.json new file mode 100644 index 0000000..d75cc73 --- /dev/null +++ b/static/events/GridConnectionRequested.sample.json @@ -0,0 +1,326 @@ +{ + "_org_id": "123", + "_event_time": "1970-01-01T00:00:00.000Z", + "_event_id": "string", + "_event_name": "GridConnectionRequested", + "_event_version": "1.0", + "_event_source": "automation", + "_ack_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "_trigger_source_type": "automation", + "_trigger_source": "execution-id/action-id", + "_automation_chain": [ + "string" + ], + "_has_pending_changesets": true, + "_changeset_edit_modes": [ + "string" + ], + "_changeset_attributes": [ + "string" + ], + "_changeset_edit_modes_by_attribute": {}, + "event_attachments": [ + { + "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "filename": "string", + "mime_type": "string", + "size_bytes": 0, + "s3ref": { + "bucket": "string", + "key": "string" + }, + "version_index": 0, + "readable_size": "string", + "_tags": [ + "string" + ], + "relation_tags": [ + "string" + ], + "category": "string", + "file_date": "string", + "_created_at": "1970-01-01T00:00:00.000Z" + } + ], + "opportunity": { + "_schema": "opportunity", + "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "_org": "123", + "_title": "John Doe", + "_tags": [ + "family:label" + ], + "_purpose": {}, + "opportunity_title": "string", + "opportunity_number": "string", + "status": "open", + "due_date": "1970-01-01T00:00:00.000Z", + "description": "string", + "assignee": {}, + "source": {}, + "customer": {}, + "billing_address": {}, + "delivery_address": {}, + "address": {}, + "payment": {}, + "dates": [ + { + "_tags": [ + "string" + ], + "value": "1970-01-01T00:00:00.000Z" + } + ], + "items": {}, + "products": {}, + "workflows": {}, + "consents": {}, + "_files": {}, + "_created_at": "1970-01-01T00:00:00.000Z", + "_updated_at": "1970-01-01T00:00:00.000Z" + }, + "submission": { + "_schema": "submission", + "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "_org": "123", + "_title": "John Doe", + "_tags": [ + "family:label" + ], + "_purpose": {}, + "source": {}, + "mapped_entities": {}, + "workflows": {}, + "_files": {}, + "_created_at": "1970-01-01T00:00:00.000Z", + "_updated_at": "1970-01-01T00:00:00.000Z" + }, + "contacts": [ + { + "_schema": "contact", + "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "_org": "123", + "_title": "John Doe", + "_tags": [ + "family:label" + ], + "_purpose": {}, + "salutation": "null", + "title": "null", + "first_name": "string", + "last_name": "string", + "customer_number": "string", + "birthdate": "2025-01-01", + "email": [ + { + "_tags": [ + "string" + ], + "email": "user@example.com" + } + ], + "phone": [ + { + "_tags": [ + "string" + ], + "phone": "+491234567890" + } + ], + "communication_preference": "postal", + "address": [ + { + "_tags": [ + "billing" + ], + "street": "Hauptstraße", + "street_number": "123", + "postal_code": "50668", + "city": "Cologne", + "country": "DE", + "additional_info": "string", + "company_name": "string", + "first_name": "string", + "last_name": "string", + "salutation": "string", + "title": "string", + "coordinates": "50.948484, 6.943147", + "plot_of_land": "string", + "plot_area": "string", + "start_date": "1970-01-01", + "end_date": "1970-01-01" + } + ], + "payment": [ + { + "type": "payment_sepa", + "data": { + "bank_name": "Deutsche Bank", + "iban": "DE89370400440532013000", + "bic_number": "DEUTDEFF", + "fullname": "John Doe" + } + } + ], + "account": {}, + "marketing_permission": true, + "contact_owner": {}, + "consent_email_marketing": {}, + "consent_sms_marketing": {}, + "consent_phone_call": {}, + "consent_print_marketing": {}, + "portal_users": {}, + "opportunities": {}, + "orders": {}, + "contracts": {}, + "external_id": "string", + "workflows": {}, + "_files": {}, + "_created_at": "1970-01-01T00:00:00.000Z", + "_updated_at": "1970-01-01T00:00:00.000Z" + } + ], + "orders": [ + { + "_schema": "order", + "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "_org": "123", + "_title": "John Doe", + "_tags": [ + "family:label" + ], + "_purpose": {}, + "order_number": "string", + "status": "draft", + "expires_at": "2025-01-01", + "source": {}, + "payment_method": {}, + "customer": {}, + "billing_contact": {}, + "billing_first_name": "string", + "billing_last_name": "string", + "billing_email": "string", + "billing_phone": "string", + "billing_company_name": "string", + "billing_vat": "string", + "billing_address": [ + { + "_tags": [ + "billing" + ], + "street": "Hauptstraße", + "street_number": "123", + "postal_code": "50668", + "city": "Cologne", + "country": "DE", + "additional_info": "string", + "company_name": "string", + "first_name": "string", + "last_name": "string", + "salutation": "string", + "title": "string", + "coordinates": "50.948484, 6.943147", + "plot_of_land": "string", + "plot_area": "string", + "start_date": "1970-01-01", + "end_date": "1970-01-01" + } + ], + "delivery_address": [ + { + "_tags": [ + "billing" + ], + "street": "Hauptstraße", + "street_number": "123", + "postal_code": "50668", + "city": "Cologne", + "country": "DE", + "additional_info": "string", + "company_name": "string", + "first_name": "string", + "last_name": "string", + "salutation": "string", + "title": "string", + "coordinates": "50.948484, 6.943147", + "plot_of_land": "string", + "plot_area": "string", + "start_date": "1970-01-01", + "end_date": "1970-01-01" + } + ], + "additional_addresses": [ + { + "_tags": [ + "billing" + ], + "street": "Hauptstraße", + "street_number": "123", + "postal_code": "50668", + "city": "Cologne", + "country": "DE", + "additional_info": "string", + "company_name": "string", + "first_name": "string", + "last_name": "string", + "salutation": "string", + "title": "string", + "coordinates": "50.948484, 6.943147", + "plot_of_land": "string", + "plot_area": "string", + "start_date": "1970-01-01", + "end_date": "1970-01-01" + } + ], + "dates": [ + { + "_tags": [ + "string" + ], + "value": "1970-01-01T00:00:00.000Z" + } + ], + "memo": "string", + "footer_notes": "string", + "currency": "string", + "amount_total": 0, + "amount_subtotal": 0, + "amount_tax": 0, + "products": {}, + "prices": {}, + "workflows": {}, + "consents": {}, + "line_items": {}, + "total_details": {}, + "_files": {}, + "_created_at": "1970-01-01T00:00:00.000Z", + "_updated_at": "1970-01-01T00:00:00.000Z" + } + ], + "opportunity_files": [ + { + "_schema": "file", + "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "_org": "123", + "_title": "John Doe", + "_tags": [ + "family:label" + ], + "_purpose": {}, + "_thumbnail": {}, + "filename": "string", + "mime_type": "string", + "type": "document", + "readable_size": "string", + "language": "de", + "alt_text": "string", + "access_control": "private", + "public_url": "string", + "shared_with_end_customer": true, + "category": "address-suggestions", + "_files": {}, + "_created_at": "1970-01-01T00:00:00.000Z", + "_updated_at": "1970-01-01T00:00:00.000Z" + } + ] +} \ No newline at end of file diff --git a/static/events/GridConnectionRequested.schema.json b/static/events/GridConnectionRequested.schema.json new file mode 100644 index 0000000..d363f3d --- /dev/null +++ b/static/events/GridConnectionRequested.schema.json @@ -0,0 +1,2410 @@ +{ + "type": "object", + "properties": { + "_org_id": { + "type": "string", + "description": "epilot tenant/organization ID", + "example": "123" + }, + "_event_time": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when event occurred" + }, + "_event_id": { + "type": "string", + "description": "Unique event identifier (ULID)" + }, + "_event_name": { + "type": "string", + "description": "Event name from catalog", + "example": "GridConnectionRequested" + }, + "_event_version": { + "type": "string", + "description": "Schema version number", + "example": "1.0" + }, + "_event_source": { + "type": "string", + "description": "Source that triggered the event", + "enum": [ + "automation" + ], + "example": "automation" + }, + "_ack_id": { + "type": "string", + "format": "uuid", + "description": "Acknowledgement ID for tracking event delivery (UUID)" + }, + "_trigger_source_type": { + "type": "string", + "description": "The type of system that triggered the event. Examples: api, automation, operation, portal_user", + "enum": [ + "automation" + ], + "example": "automation" + }, + "_trigger_source": { + "type": "string", + "description": "Identifier of the specific trigger source. Examples: user ID, automation execution ID, activity ID, portal user email", + "minLength": 1, + "example": "execution-id/action-id" + }, + "_automation_chain": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 100, + "description": "Ordered automation flow ids that caused this event; propagated verbatim for automation loop prevention" + }, + "_has_pending_changesets": { + "type": "boolean", + "description": "True when the triggering entity (or meter counter) has at least one pending changeset" + }, + "_changeset_edit_modes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Distinct edit modes across the PENDING changesets — only \"external\" (synced from an external system) or \"approval\" (awaiting approval). A \"direct\" write is applied immediately, is not a pending changeset, and so never appears here." + }, + "_changeset_attributes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Keys identifying pending changesets. For attribute changesets these are attribute names (e.g. `billing_cycle`); for meter-reading changesets these are the changeset IDs from `meter._meter_readings_changeset`" + }, + "_changeset_edit_modes_by_attribute": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "not": {} + }, + { + "type": "string" + } + ] + }, + "description": "Per-key edit mode map; keys are a subset of _changeset_attributes (attribute names for entity changesets, changeset IDs for meter-reading changesets) — only those whose pending changeset has an \"external\" or \"approval\" mode. A \"direct\"/unrecognised mode is omitted here, though the key still appears in _changeset_attributes. Enables fine-grained webhook conditions such as `_changeset_edit_modes_by_attribute.billing_cycle equals approval`" + }, + "event_attachments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entity_id": { + "type": "string", + "format": "uuid", + "description": "Entity ID of the file" + }, + "filename": { + "type": "string", + "description": "Name of the file" + }, + "mime_type": { + "type": "string", + "description": "MIME type of the file (e.g., application/pdf)" + }, + "size_bytes": { + "type": "integer", + "minimum": 0, + "description": "File size in bytes" + }, + "s3ref": { + "type": "object", + "properties": { + "bucket": { + "type": "string", + "description": "S3 bucket name" + }, + "key": { + "type": "string", + "description": "S3 object key" + } + }, + "required": [ + "bucket", + "key" + ], + "additionalProperties": false, + "description": "S3 reference for the file content" + }, + "version_index": { + "type": "integer", + "minimum": 0, + "description": "Latest version index of the file (versions[].length - 1, or 0 if no versions array)" + }, + "readable_size": { + "type": "string", + "description": "Human-readable file size (e.g., \"200 KB\")" + }, + "_tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags on the file entity (semantic labels set by uploader/automation)" + }, + "relation_tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags on the relation pointing at the file (journey upload block tags such as \"Lageplan\", plus a hidden journey step marker)" + }, + "category": { + "type": "string", + "description": "File category select value (e.g., \"address-suggestions\", \"unknown\")" + }, + "file_date": { + "type": "string", + "description": "User-provided file date" + }, + "_created_at": { + "type": "string", + "format": "date-time", + "description": "When the file entity was created — useful for time-window filtering" + } + }, + "required": [ + "entity_id", + "version_index" + ], + "additionalProperties": false + }, + "description": "Every file related to the opportunity — site plans, floor plans, route plans, land-register extracts, load balances, powers of attorney. Empty when the request carries none. Consumers identify a given upload via `relation_tags` (the journey upload block tags) / `_tags`." + }, + "opportunity": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "_schema" + ], + "properties": { + "_schema": { + "readOnly": true, + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$", + "example": "opportunity", + "description": "URL-friendly identifier for the entity schema" + }, + "_id": { + "readOnly": true, + "type": "string", + "format": "uuid", + "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "description": "Unique identifier for the entity" + }, + "_org": { + "type": "string", + "description": "Organization Id the entity belongs to", + "readOnly": true, + "example": "123" + }, + "_title": { + "readOnly": true, + "type": "string", + "nullable": true, + "example": "John Doe", + "description": "Generated title for the entity based on schema title_template" + }, + "_tags": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + }, + "example": [ + "family:label" + ], + "description": "Entity Labels" + }, + "_purpose": { + "$ref": "#/definitions/PurposeAttribute", + "description": "Purposes" + }, + "opportunity_title": { + "type": "string", + "description": "Opportunity Title" + }, + "opportunity_number": { + "type": "string", + "description": "Opportunity Number" + }, + "status": { + "type": "string", + "enum": [ + "open", + "in_progress", + "closed", + "cancelled" + ], + "description": "Status" + }, + "due_date": { + "type": "string", + "format": "date-time", + "description": "Due Date" + }, + "description": { + "type": "string", + "description": "Description" + }, + "assignee": { + "$ref": "#/definitions/User", + "description": "Assignee" + }, + "source": { + "$ref": "#/definitions/LinkAttribute", + "description": "Source" + }, + "customer": { + "$ref": "#/definitions/BaseRelation", + "description": "Customer" + }, + "billing_address": { + "$ref": "#/definitions/BaseRelationRef", + "description": "Billing Address" + }, + "delivery_address": { + "$ref": "#/definitions/BaseRelationRef", + "description": "Delivery Address" + }, + "address": { + "$ref": "#/definitions/BaseRelationRef", + "description": "Additional Addresses" + }, + "payment": { + "$ref": "#/definitions/BaseRelationRef", + "description": "Payment Details" + }, + "dates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "value": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "value" + ] + }, + "description": "Dates" + }, + "items": { + "$ref": "#/definitions/BaseRelation", + "description": "Orders" + }, + "products": { + "$ref": "#/definitions/BaseRelation", + "description": "Products" + }, + "workflows": { + "$ref": "#/definitions/WorkflowOverview" + }, + "consents": { + "$ref": "#/definitions/LocalConsents" + }, + "_files": { + "$ref": "#/definitions/BaseRelation" + }, + "_created_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity creation" + }, + "_updated_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity last update" + } + }, + "description": "opportunity entity (hydrated from entity graph)" + }, + "submission": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "_schema" + ], + "properties": { + "_schema": { + "readOnly": true, + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$", + "example": "submission", + "description": "URL-friendly identifier for the entity schema" + }, + "_id": { + "readOnly": true, + "type": "string", + "format": "uuid", + "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "description": "Unique identifier for the entity" + }, + "_org": { + "type": "string", + "description": "Organization Id the entity belongs to", + "readOnly": true, + "example": "123" + }, + "_title": { + "readOnly": true, + "type": "string", + "nullable": true, + "example": "John Doe", + "description": "Generated title for the entity based on schema title_template" + }, + "_tags": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + }, + "example": [ + "family:label" + ], + "description": "Entity Labels" + }, + "_purpose": { + "$ref": "#/definitions/PurposeAttribute", + "description": "Purposes" + }, + "source": { + "$ref": "#/definitions/LinkAttribute", + "description": "Source" + }, + "mapped_entities": { + "$ref": "#/definitions/BaseRelation", + "description": "Entities" + }, + "workflows": { + "$ref": "#/definitions/WorkflowOverview" + }, + "_files": { + "$ref": "#/definitions/BaseRelation" + }, + "_created_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity creation" + }, + "_updated_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity last update" + } + }, + "description": "submission entity (hydrated from entity graph)" + }, + "contacts": { + "type": "array", + "description": "Array of contact entities (hydrated from entity graph)", + "items": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "_schema" + ], + "properties": { + "_schema": { + "readOnly": true, + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$", + "example": "contact", + "description": "URL-friendly identifier for the entity schema" + }, + "_id": { + "readOnly": true, + "type": "string", + "format": "uuid", + "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "description": "Unique identifier for the entity" + }, + "_org": { + "type": "string", + "description": "Organization Id the entity belongs to", + "readOnly": true, + "example": "123" + }, + "_title": { + "readOnly": true, + "type": "string", + "nullable": true, + "example": "John Doe", + "description": "Generated title for the entity based on schema title_template" + }, + "_tags": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + }, + "example": [ + "family:label" + ], + "description": "Entity Labels" + }, + "_purpose": { + "$ref": "#/definitions/PurposeAttribute", + "description": "Purposes" + }, + "salutation": { + "type": "string", + "enum": [ + "null", + "Mr.", + "Ms. / Mrs.", + "Company", + "Contact Person", + "Company/Contact Person", + "Spouse", + "Family", + "Ownership", + "Assembly", + "Other" + ], + "description": "Salutation" + }, + "title": { + "type": "string", + "enum": [ + "null", + "Dr.", + "Prof.", + "Prof. Dr." + ], + "description": "Title" + }, + "first_name": { + "type": "string", + "description": "First Name" + }, + "last_name": { + "type": "string", + "description": "Last Name" + }, + "customer_number": { + "type": "string", + "description": "Customer Number" + }, + "birthdate": { + "type": "string", + "format": "date", + "example": "2025-01-01", + "description": "Date of Birth" + }, + "email": { + "type": "array", + "items": { + "type": "object", + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "email": { + "type": "string", + "format": "email" + } + }, + "required": [ + "email" + ] + }, + "description": "Email" + }, + "phone": { + "type": "array", + "items": { + "type": "object", + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "phone": { + "type": "string", + "example": "+491234567890" + } + }, + "required": [ + "phone" + ] + }, + "description": "Phone" + }, + "communication_preference": { + "type": "string", + "enum": [ + "postal", + "portal" + ], + "description": "Standard communication method" + }, + "address": { + "type": "array", + "items": { + "type": "object", + "description": "Address attribute", + "additionalProperties": true, + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "billing" + ] + }, + "street": { + "type": "string", + "description": "The first line of the address. Typically the street address or PO Box number.", + "nullable": true, + "example": "Hauptstraße" + }, + "street_number": { + "type": "string", + "description": "The second line of the address. Typically the number of the apartment, suite, or unit.", + "nullable": true, + "example": "123" + }, + "postal_code": { + "type": "string", + "description": "The postal code for the address.", + "nullable": true, + "example": "50668" + }, + "city": { + "type": "string", + "description": "The name of the city, district, village, or town.", + "nullable": true, + "example": "Cologne" + }, + "country": { + "type": "string", + "description": "The two-letter code for the country of the address.", + "nullable": true, + "example": "DE" + }, + "additional_info": { + "type": "string", + "description": "An additional description for the address", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "the company name, usually used as extra delivery instructions", + "nullable": true + }, + "first_name": { + "type": "string", + "description": "the first name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "the last name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "salutation": { + "type": "string", + "description": "the salutation of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "title": { + "type": "string", + "description": "the title of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "coordinates": { + "type": "string", + "description": "Geographical coordinates (latitude, longitude)", + "nullable": true, + "example": "50.948484, 6.943147" + }, + "plot_of_land": { + "type": "string", + "description": "Plot of land information", + "nullable": true + }, + "plot_area": { + "type": "string", + "description": "Area of the plot", + "nullable": true + }, + "start_date": { + "type": "string", + "description": "Start date for the address", + "format": "date", + "nullable": true + }, + "end_date": { + "type": "string", + "description": "End date for the address", + "format": "date", + "nullable": true + } + } + }, + "description": "Address" + }, + "payment": { + "type": "array", + "items": { + "type": "object", + "description": "Payment method details", + "properties": { + "type": { + "type": "string", + "enum": [ + "payment_sepa", + "payment_invoice", + "payment_cash" + ], + "example": "payment_sepa" + }, + "data": { + "type": "object", + "properties": { + "bank_name": { + "type": "string", + "example": "Deutsche Bank" + }, + "iban": { + "type": "string", + "example": "DE89370400440532013000" + }, + "bic_number": { + "type": "string", + "example": "DEUTDEFF" + }, + "fullname": { + "type": "string", + "example": "John Doe" + } + } + } + } + }, + "description": "Payment" + }, + "account": { + "$ref": "#/definitions/BaseRelation", + "description": "Account" + }, + "marketing_permission": { + "type": "boolean", + "description": "Marketing Permission" + }, + "contact_owner": { + "$ref": "#/definitions/User", + "description": "Contact Owner" + }, + "consent_email_marketing": { + "$ref": "#/definitions/ConsentAttribute", + "description": "Email Marketing" + }, + "consent_sms_marketing": { + "$ref": "#/definitions/ConsentAttribute", + "description": "SMS Marketing" + }, + "consent_phone_call": { + "$ref": "#/definitions/ConsentAttribute", + "description": "Direct Phone Marketing" + }, + "consent_print_marketing": { + "$ref": "#/definitions/ConsentAttribute", + "description": "Print Marketing" + }, + "portal_users": { + "$ref": "#/definitions/BaseRelation", + "description": "Portal Users" + }, + "opportunities": { + "$ref": "#/definitions/BaseRelation", + "description": "Opportunities" + }, + "orders": { + "$ref": "#/definitions/BaseRelation", + "description": "Orders" + }, + "contracts": { + "$ref": "#/definitions/BaseRelation", + "description": "Contracts" + }, + "external_id": { + "type": "string", + "description": "External ID" + }, + "workflows": { + "$ref": "#/definitions/WorkflowOverview" + }, + "_files": { + "$ref": "#/definitions/BaseRelation" + }, + "_created_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity creation" + }, + "_updated_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity last update" + } + } + } + }, + "orders": { + "type": "array", + "description": "Array of order entities (hydrated from entity graph)", + "items": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "_schema", + "status" + ], + "properties": { + "_schema": { + "readOnly": true, + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$", + "example": "order", + "description": "URL-friendly identifier for the entity schema" + }, + "_id": { + "readOnly": true, + "type": "string", + "format": "uuid", + "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "description": "Unique identifier for the entity" + }, + "_org": { + "type": "string", + "description": "Organization Id the entity belongs to", + "readOnly": true, + "example": "123" + }, + "_title": { + "readOnly": true, + "type": "string", + "nullable": true, + "example": "John Doe", + "description": "Generated title for the entity based on schema title_template" + }, + "_tags": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + }, + "example": [ + "family:label" + ], + "description": "Entity Labels" + }, + "_purpose": { + "$ref": "#/definitions/PurposeAttribute", + "description": "Purposes" + }, + "order_number": { + "type": "string", + "description": "Order Number" + }, + "status": { + "type": "string", + "enum": [ + "draft", + "quote", + "placed", + "complete", + "cancelled", + "open_for_acceptance" + ], + "description": "Status" + }, + "expires_at": { + "type": "string", + "format": "date", + "example": "2025-01-01", + "description": "Expiration Date" + }, + "source": { + "$ref": "#/definitions/LinkAttribute", + "description": "Source" + }, + "payment_method": { + "$ref": "#/definitions/PaymentDetails", + "description": "Payment Details" + }, + "customer": { + "$ref": "#/definitions/BaseRelation", + "description": "Customer" + }, + "billing_contact": { + "$ref": "#/definitions/BaseRelation", + "description": "Billing Contact" + }, + "billing_first_name": { + "type": "string", + "description": "First Name" + }, + "billing_last_name": { + "type": "string", + "description": "Last Name" + }, + "billing_email": { + "type": "string", + "description": "Email" + }, + "billing_phone": { + "type": "string", + "description": "Phone" + }, + "billing_company_name": { + "type": "string", + "description": "Company name" + }, + "billing_vat": { + "type": "string", + "description": "Tax ID" + }, + "billing_address": { + "type": "array", + "items": { + "type": "object", + "description": "Address attribute", + "additionalProperties": true, + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "billing" + ] + }, + "street": { + "type": "string", + "description": "The first line of the address. Typically the street address or PO Box number.", + "nullable": true, + "example": "Hauptstraße" + }, + "street_number": { + "type": "string", + "description": "The second line of the address. Typically the number of the apartment, suite, or unit.", + "nullable": true, + "example": "123" + }, + "postal_code": { + "type": "string", + "description": "The postal code for the address.", + "nullable": true, + "example": "50668" + }, + "city": { + "type": "string", + "description": "The name of the city, district, village, or town.", + "nullable": true, + "example": "Cologne" + }, + "country": { + "type": "string", + "description": "The two-letter code for the country of the address.", + "nullable": true, + "example": "DE" + }, + "additional_info": { + "type": "string", + "description": "An additional description for the address", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "the company name, usually used as extra delivery instructions", + "nullable": true + }, + "first_name": { + "type": "string", + "description": "the first name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "the last name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "salutation": { + "type": "string", + "description": "the salutation of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "title": { + "type": "string", + "description": "the title of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "coordinates": { + "type": "string", + "description": "Geographical coordinates (latitude, longitude)", + "nullable": true, + "example": "50.948484, 6.943147" + }, + "plot_of_land": { + "type": "string", + "description": "Plot of land information", + "nullable": true + }, + "plot_area": { + "type": "string", + "description": "Area of the plot", + "nullable": true + }, + "start_date": { + "type": "string", + "description": "Start date for the address", + "format": "date", + "nullable": true + }, + "end_date": { + "type": "string", + "description": "End date for the address", + "format": "date", + "nullable": true + } + } + }, + "description": "Billing Address" + }, + "delivery_address": { + "type": "array", + "items": { + "type": "object", + "description": "Address attribute", + "additionalProperties": true, + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "billing" + ] + }, + "street": { + "type": "string", + "description": "The first line of the address. Typically the street address or PO Box number.", + "nullable": true, + "example": "Hauptstraße" + }, + "street_number": { + "type": "string", + "description": "The second line of the address. Typically the number of the apartment, suite, or unit.", + "nullable": true, + "example": "123" + }, + "postal_code": { + "type": "string", + "description": "The postal code for the address.", + "nullable": true, + "example": "50668" + }, + "city": { + "type": "string", + "description": "The name of the city, district, village, or town.", + "nullable": true, + "example": "Cologne" + }, + "country": { + "type": "string", + "description": "The two-letter code for the country of the address.", + "nullable": true, + "example": "DE" + }, + "additional_info": { + "type": "string", + "description": "An additional description for the address", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "the company name, usually used as extra delivery instructions", + "nullable": true + }, + "first_name": { + "type": "string", + "description": "the first name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "the last name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "salutation": { + "type": "string", + "description": "the salutation of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "title": { + "type": "string", + "description": "the title of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "coordinates": { + "type": "string", + "description": "Geographical coordinates (latitude, longitude)", + "nullable": true, + "example": "50.948484, 6.943147" + }, + "plot_of_land": { + "type": "string", + "description": "Plot of land information", + "nullable": true + }, + "plot_area": { + "type": "string", + "description": "Area of the plot", + "nullable": true + }, + "start_date": { + "type": "string", + "description": "Start date for the address", + "format": "date", + "nullable": true + }, + "end_date": { + "type": "string", + "description": "End date for the address", + "format": "date", + "nullable": true + } + } + }, + "description": "Delivery Address" + }, + "additional_addresses": { + "type": "array", + "items": { + "type": "object", + "description": "Address attribute", + "additionalProperties": true, + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "billing" + ] + }, + "street": { + "type": "string", + "description": "The first line of the address. Typically the street address or PO Box number.", + "nullable": true, + "example": "Hauptstraße" + }, + "street_number": { + "type": "string", + "description": "The second line of the address. Typically the number of the apartment, suite, or unit.", + "nullable": true, + "example": "123" + }, + "postal_code": { + "type": "string", + "description": "The postal code for the address.", + "nullable": true, + "example": "50668" + }, + "city": { + "type": "string", + "description": "The name of the city, district, village, or town.", + "nullable": true, + "example": "Cologne" + }, + "country": { + "type": "string", + "description": "The two-letter code for the country of the address.", + "nullable": true, + "example": "DE" + }, + "additional_info": { + "type": "string", + "description": "An additional description for the address", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "the company name, usually used as extra delivery instructions", + "nullable": true + }, + "first_name": { + "type": "string", + "description": "the first name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "the last name of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "salutation": { + "type": "string", + "description": "the salutation of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "title": { + "type": "string", + "description": "the title of the recipient, usually used as extra delivery instructions", + "nullable": true + }, + "coordinates": { + "type": "string", + "description": "Geographical coordinates (latitude, longitude)", + "nullable": true, + "example": "50.948484, 6.943147" + }, + "plot_of_land": { + "type": "string", + "description": "Plot of land information", + "nullable": true + }, + "plot_area": { + "type": "string", + "description": "Area of the plot", + "nullable": true + }, + "start_date": { + "type": "string", + "description": "Start date for the address", + "format": "date", + "nullable": true + }, + "end_date": { + "type": "string", + "description": "End date for the address", + "format": "date", + "nullable": true + } + } + }, + "description": "Additional Addresses" + }, + "dates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "value": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "value" + ] + }, + "description": "Dates" + }, + "memo": { + "type": "string", + "description": "Memo" + }, + "footer_notes": { + "type": "string", + "description": "Footer" + }, + "currency": { + "type": "string" + }, + "amount_total": { + "type": "number" + }, + "amount_subtotal": { + "type": "number" + }, + "amount_tax": { + "type": "number" + }, + "products": { + "$ref": "#/definitions/BaseRelation", + "description": "Products" + }, + "prices": { + "$ref": "#/definitions/BaseRelation", + "description": "Prices" + }, + "workflows": { + "$ref": "#/definitions/WorkflowOverview" + }, + "consents": { + "$ref": "#/definitions/LocalConsents" + }, + "line_items": { + "$ref": "#/definitions/LineItems" + }, + "total_details": { + "$ref": "#/definitions/TotalDetails" + }, + "_files": { + "$ref": "#/definitions/BaseRelation" + }, + "_created_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity creation" + }, + "_updated_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity last update" + } + } + } + }, + "opportunity_files": { + "type": "array", + "description": "Array of file entities (hydrated from entity graph)", + "items": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "_schema", + "filename", + "language" + ], + "properties": { + "_schema": { + "readOnly": true, + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$", + "example": "file", + "description": "URL-friendly identifier for the entity schema" + }, + "_id": { + "readOnly": true, + "type": "string", + "format": "uuid", + "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "description": "Unique identifier for the entity" + }, + "_org": { + "type": "string", + "description": "Organization Id the entity belongs to", + "readOnly": true, + "example": "123" + }, + "_title": { + "readOnly": true, + "type": "string", + "nullable": true, + "example": "John Doe", + "description": "Generated title for the entity based on schema title_template" + }, + "_tags": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + }, + "example": [ + "family:label" + ], + "description": "Entity Labels" + }, + "_purpose": { + "$ref": "#/definitions/PurposeAttribute", + "description": "Purposes" + }, + "_thumbnail": { + "$ref": "#/definitions/BaseRelation", + "description": "Thumbnail" + }, + "filename": { + "type": "string", + "description": "File Name" + }, + "mime_type": { + "type": "string", + "description": "MIME Type" + }, + "type": { + "type": "string", + "enum": [ + "document", + "document_template", + "text", + "image", + "video", + "audio", + "spreadsheet", + "presentation", + "font", + "archive", + "application", + "unknown" + ], + "description": "File Type" + }, + "readable_size": { + "type": "string", + "description": "Size" + }, + "language": { + "type": "string", + "enum": [ + "de", + "en" + ], + "description": "Language" + }, + "alt_text": { + "type": "string", + "description": "Alt text" + }, + "access_control": { + "type": "string", + "enum": [ + "private", + "public-read" + ], + "description": "Access Control" + }, + "public_url": { + "type": "string", + "description": "Public URL" + }, + "shared_with_end_customer": { + "type": "boolean", + "description": "Shared with End Customer" + }, + "category": { + "type": "string", + "enum": [ + "address-suggestions", + "unknown" + ], + "description": "Category" + }, + "_files": { + "$ref": "#/definitions/BaseRelation" + }, + "_created_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity creation" + }, + "_updated_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "nullable": true, + "description": "Timestamp of entity last update" + } + } + } + } + }, + "required": [ + "_org_id", + "_event_time", + "_event_id", + "_event_name", + "_event_version", + "_event_source", + "_ack_id", + "event_attachments", + "opportunity", + "_trigger_source_type", + "_trigger_source" + ], + "additionalProperties": true, + "definitions": { + "PurposeAttribute": { + "type": "array", + "description": "List of purpose ids", + "items": { + "type": "string" + }, + "example": [ + "7675dc56-fd1b-46ee-9c35-defe0667b32e" + ] + }, + "LinkAttribute": { + "type": "object", + "description": "Link with title and href", + "properties": { + "type": { + "type": "string", + "enum": [ + "link" + ] + }, + "title": { + "type": "string", + "example": "Visit Website" + }, + "href": { + "type": "string", + "format": "uri", + "example": "https://example.com" + } + } + }, + "BaseUUID": { + "type": "string", + "format": "uuid", + "example": "123e4567-e89b-12d3-a456-426614174000" + }, + "BaseTags": { + "type": "array", + "nullable": true, + "items": { + "type": "string" + }, + "example": [ + "example" + ] + }, + "BaseRelation": { + "type": "object", + "nullable": true, + "description": "Relation to another entity", + "properties": { + "$relation": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entity_id": { + "$ref": "#/definitions/BaseUUID" + }, + "_tags": { + "$ref": "#/definitions/BaseTags" + } + } + } + } + } + }, + "BaseRelationRef": { + "type": "object", + "nullable": true, + "description": "Reference to a specific property of another entity", + "properties": { + "$relation_ref": { + "type": "array", + "items": { + "type": "object", + "properties": { + "entity_id": { + "$ref": "#/definitions/BaseUUID" + }, + "path": { + "type": "string", + "example": "address", + "description": "The property of the entity (pointed by entity_id) to be used as the reference" + }, + "_tags": { + "$ref": "#/definitions/BaseTags" + }, + "_id": { + "type": "string", + "example": "xHcOoJCa07eysJ1GaQeSb" + } + } + } + } + } + }, + "UserId": { + "description": "User's unique identifier", + "type": "string", + "readOnly": true + }, + "OrganizationId": { + "description": "Organization unique identifier", + "type": "string", + "readOnly": true, + "example": "123" + }, + "User": { + "type": "object", + "description": "User information", + "properties": { + "id": { + "$ref": "#/definitions/UserId" + }, + "organization_id": { + "$ref": "#/definitions/OrganizationId" + }, + "email": { + "type": "string", + "format": "email", + "example": "user@example.com" + }, + "display_name": { + "type": "string", + "example": "John Doe", + "deprecated": true + }, + "name": { + "type": "string", + "example": "John Doe", + "deprecated": true + }, + "preferred_language": { + "type": "string", + "example": "de", + "description": "ISO 639-1 language code" + }, + "signature": { + "type": "string", + "example": "

Best regards,
John Doe

", + "description": "HTML email signature" + }, + "roles": { + "type": "array", + "items": { + "type": "string", + "example": "Owner" + }, + "deprecated": true, + "description": "Deprecated! Please use Permissions API instead" + }, + "image_uri": { + "type": "object", + "additionalProperties": true, + "properties": { + "original": { + "type": "string", + "format": "uri", + "example": "https://account-profile-images.epilot.cloud/1/avatar.png" + }, + "thumbnail_32": { + "type": "string", + "format": "uri", + "example": "https://account-profile-images.epilot.cloud/1/avatar_32x32.png" + } + }, + "nullable": true + }, + "properties": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "profileImageName" + }, + "value": { + "type": "string", + "example": "avatar.png" + } + }, + "required": [ + "name", + "value" + ] + } + } + }, + "required": [ + "id", + "organization_id", + "email", + "name", + "preferred_language", + "roles", + "properties" + ] + }, + "LocalConsents": { + "type": "object", + "description": "Consent management", + "properties": { + "_isValid": { + "type": "boolean", + "example": true, + "description": "Whether all required consents are valid" + } + }, + "additionalProperties": { + "type": "object", + "properties": { + "agreed": { + "type": "boolean", + "example": true + }, + "topic": { + "type": "string", + "example": "privacy_policy" + }, + "text": { + "type": "string", + "example": "I agree to the privacy policy" + }, + "time": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "agreed", + "topic", + "text", + "time" + ] + }, + "required": [ + "_isValid" + ] + }, + "WorkflowStatus": { + "type": "string", + "enum": [ + "STARTED", + "DONE", + "CLOSED" + ] + }, + "StepType": { + "type": "string", + "enum": [ + "MANUAL", + "AUTOMATION" + ] + }, + "StepStatus": { + "type": "string", + "enum": [ + "UNASSIGNED", + "ASSIGNED", + "COMPLETED", + "SKIPPED", + "IN_PROGRESS" + ] + }, + "PhaseInEntity": { + "type": "object", + "description": "Workflow phase information", + "properties": { + "phase_id": { + "type": "string" + }, + "phase_name": { + "type": "string" + }, + "phase_progress": { + "type": "number" + } + }, + "required": [ + "phase_id", + "phase_name", + "phase_progress" + ] + }, + "WorkflowInEntity": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "definition_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/WorkflowStatus" + }, + "assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "progress": { + "type": "number" + }, + "phases_in_progress": { + "type": "array", + "items": { + "$ref": "#/definitions/PhaseInEntity" + } + }, + "last_update_time": { + "type": "string", + "format": "date-time" + }, + "upcoming_tasks_assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_id": { + "type": "string" + }, + "task_name": { + "type": "string" + }, + "task_assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_duedate": { + "type": "string", + "format": "date-time" + }, + "task_execution_type": { + "$ref": "#/definitions/StepType" + }, + "task_status": { + "$ref": "#/definitions/StepStatus" + }, + "phase_id": { + "type": "string" + }, + "phase_name": { + "type": "string" + }, + "phase_assignees": { + "type": "array", + "items": { + "type": "string" + } + }, + "phase_progress": { + "type": "number" + } + }, + "required": [ + "id", + "definition_id", + "name", + "status", + "assignees", + "last_update_time" + ] + }, + "WorkflowOverview": { + "type": "object", + "properties": { + "primary": { + "$ref": "#/definitions/WorkflowInEntity" + } + }, + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowInEntity" + } + } + }, + "ConsentAttribute": { + "type": "object", + "description": "Consent Management", + "properties": { + "type": { + "type": "string", + "enum": [ + "consent" + ] + }, + "topic": { + "type": "string" + }, + "identifiers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "type", + "topic" + ] + }, + "PaymentDetails": { + "type": "object", + "description": "Payment method details", + "properties": { + "type": { + "type": "string", + "enum": [ + "payment_sepa", + "payment_invoice", + "payment_cash" + ], + "example": "payment_sepa" + }, + "data": { + "type": "object", + "properties": { + "bank_name": { + "type": "string", + "example": "Deutsche Bank" + }, + "iban": { + "type": "string", + "example": "DE89370400440532013000" + }, + "bic_number": { + "type": "string", + "example": "DEUTDEFF" + }, + "fullname": { + "type": "string", + "example": "John Doe" + } + } + } + } + }, + "TaxBreakdownInfo": { + "type": "object", + "properties": { + "rate": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "VAT", + "GST", + "Custom" + ] + }, + "_id": { + "type": "string" + } + } + }, + "TaxAmountBreakdown": { + "type": "object", + "description": "A tax amount associated with a specific tax rate.", + "readOnly": true, + "properties": { + "amount": { + "type": "integer" + }, + "rate": { + "type": "string", + "description": "The tax rate applied. With the release of the tax manager feature this field is being deprecated in favor of the tax field.", + "deprecated": true + }, + "rateValue": { + "type": "number", + "description": "The tax rate value applied. With the release of the tax manager feature this field is being deprecated in favor of the tax field.", + "deprecated": true + }, + "tax": { + "$ref": "#/definitions/TaxBreakdownInfo" + } + } + }, + "Amounts": { + "type": "object", + "properties": { + "amount_subtotal": { + "type": "integer" + }, + "amount_subtotal_decimal": { + "type": "string" + }, + "amount_total": { + "type": "integer" + }, + "amount_total_decimal": { + "type": "string" + } + } + }, + "Currency": { + "type": "string", + "description": "Three-letter ISO currency code, in lowercase. Must be a supported currency.", + "example": "EUR" + }, + "RecurrenceAmount": { + "type": "object", + "description": "An amount associated with a specific recurrence.", + "readOnly": true, + "allOf": [ + { + "$ref": "#/definitions/Amounts" + } + ], + "properties": { + "type": { + "type": "string" + }, + "billing_period": { + "type": "string", + "enum": [ + "weekly", + "monthly", + "every_quarter", + "every_6_months", + "yearly" + ] + }, + "unit_amount_gross": { + "type": "integer" + }, + "unit_amount_net": { + "type": "integer" + }, + "amount_tax": { + "type": "integer" + }, + "currency": { + "$ref": "#/definitions/Currency" + } + }, + "required": [ + "amount_subtotal", + "amount_total", + "amount_subtotal_decimal", + "amount_total_decimal" + ] + }, + "RecurrenceAmountWithTax": { + "type": "object", + "description": "An amount associated with a specific recurrence.", + "properties": { + "type": { + "type": "string" + }, + "billing_period": { + "type": "string", + "enum": [ + "weekly", + "monthly", + "every_quarter", + "every_6_months", + "yearly" + ] + }, + "amount_total": { + "type": "integer" + }, + "amount_subtotal": { + "type": "integer" + }, + "amount_tax": { + "type": "integer" + }, + "tax": { + "$ref": "#/definitions/TaxAmountBreakdown" + } + }, + "required": [ + "amount_subtotal", + "amount_total" + ] + }, + "TotalDetails": { + "type": "object", + "description": "The total details with tax (and discount) aggregated totals.", + "readOnly": true, + "properties": { + "amount_shipping": { + "type": "integer", + "description": "This is the sum of all the price item shipping amounts." + }, + "amount_tax": { + "type": "integer", + "description": "This is the sum of all the price item tax amounts." + }, + "breakdown": { + "type": "object", + "description": "Breakdown of individual tax (and discount) amounts that add up to the totals.", + "properties": { + "taxes": { + "type": "array", + "description": "The aggregated price items tax amount per rate.", + "items": { + "$ref": "#/definitions/TaxAmountBreakdown" + } + }, + "recurrences": { + "type": "array", + "description": "The aggregated price items tax amount per rate.", + "items": { + "$ref": "#/definitions/RecurrenceAmount" + } + }, + "recurrencesByTax": { + "type": "array", + "description": "The aggregated price items recurrences by tax rate", + "items": { + "$ref": "#/definitions/RecurrenceAmountWithTax" + } + } + } + } + } + }, + "LineItems": { + "type": "array", + "items": { + "type": "object", + "properties": { + "price_id": { + "$ref": "#/definitions/BaseUUID" + }, + "product_id": { + "$ref": "#/definitions/BaseUUID" + }, + "quantity": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "unit_amount": { + "type": "integer" + }, + "unit_amount_decimal": { + "type": "string" + }, + "pricing_model": { + "type": "string", + "enum": [ + "per_unit" + ] + }, + "_price": { + "type": "object", + "properties": { + "_id": { + "$ref": "#/definitions/BaseUUID" + }, + "_title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "unit_amount": { + "type": "integer" + }, + "unit_amount_decimal": { + "type": "string" + }, + "unit_amount_currency": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "sales_tax": { + "type": "string" + }, + "tax_behavior": { + "type": "string" + }, + "price_display_in_journeys": { + "type": "string" + }, + "type": { + "type": "string" + }, + "billing_period": { + "type": "string" + }, + "billing_duration_unit": { + "type": "string" + }, + "notice_time_unit": { + "type": "string" + }, + "termination_time_unit": { + "type": "string" + }, + "renewal_duration_unit": { + "type": "string" + }, + "internal_description": { + "type": "string" + }, + "pricing_model": { + "type": "string" + }, + "is_tax_inclusive": { + "type": "boolean" + }, + "headline": { + "type": "string" + }, + "subHeadline": { + "type": "string" + }, + "group": { + "type": "string" + } + } + }, + "_product": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "product" + ] + }, + "_title": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "price_options": { + "type": "array", + "items": { + "type": "object", + "properties": { + "_id": { + "$ref": "#/definitions/BaseUUID" + }, + "_title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "unit_amount": { + "type": "integer" + }, + "unit_amount_decimal": { + "type": "string" + }, + "unit_amount_currency": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "_schema": { + "type": "string" + }, + "_org": { + "type": "string" + }, + "_created_at": { + "type": "string", + "format": "date-time" + }, + "_updated_at": { + "type": "string", + "format": "date-time" + }, + "sales_tax": { + "type": "string" + }, + "tax_behavior": { + "type": "string" + }, + "price_display_in_journeys": { + "type": "string" + }, + "type": { + "type": "string" + }, + "billing_period": { + "type": "string" + }, + "billing_duration_unit": { + "type": "string" + }, + "notice_time_unit": { + "type": "string" + }, + "termination_time_unit": { + "type": "string" + }, + "renewal_duration_unit": { + "type": "string" + }, + "internal_description": { + "type": "string" + }, + "_owners": { + "type": "array", + "items": { + "type": "object", + "properties": { + "org_id": { + "type": "string" + } + } + } + }, + "pricing_model": { + "type": "string" + }, + "is_tax_inclusive": { + "type": "boolean" + }, + "_acl": { + "type": "object", + "properties": { + "view": { + "type": "array", + "items": { + "type": "string" + } + }, + "edit": { + "type": "array", + "items": { + "type": "string" + } + }, + "delete": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "$relation": { + "type": "object", + "properties": { + "entity_id": { + "$ref": "#/definitions/BaseUUID" + }, + "_schema": { + "type": "string" + }, + "_tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "_id": { + "$ref": "#/definitions/BaseUUID" + } + } + }, + "taxes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "rate": { + "type": "string" + }, + "rateValue": { + "type": "integer" + }, + "amount": { + "type": "integer" + } + } + } + }, + "currency": { + "type": "string" + }, + "unit_amount_net": { + "type": "integer" + }, + "unit_amount_net_decimal": { + "type": "string" + }, + "unit_amount_gross": { + "type": "integer" + }, + "unit_amount_gross_decimal": { + "type": "string" + }, + "amount_subtotal": { + "type": "integer" + }, + "amount_total": { + "type": "integer" + }, + "amount_tax": { + "type": "integer" + }, + "is_tax_inclusive": { + "type": "boolean" + }, + "amount_subtotal_decimal": { + "type": "string" + }, + "amount_total_decimal": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file