> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morf.health/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoice

> Event payload details and trigger documentation for Invoice data from Intakeq

<img src="https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/intakeq.svg?fit=max&auto=format&n=EU2WCxuXGIUQcziR&q=85&s=191a6c088f13edff5cd7f23a84babb49" alt="images/intakeq.svg" width="40" height="40" data-path="images/intakeq.svg" />

# Events

## Triggering Webhook Types

The following event types are associated with the Invoice event payload from Intakeq.

* `Intakeq Invoice Issued`
* `Intakeq Invoice Paid`
* `Intakeq Invoice Payment Plan Charge Failed`
* `Intakeq Invoice Auto Charge Failed`
* `Intakeq Invoice Cancelled`
* `Intakeq Invoice Payment Refunded`

<RequestExample>
  ```json Example theme={null}
  {
    "additional_email_recipients": [
      "billing@example.com",
      "accounts@example.com"
    ],
    "amount_due": 100,
    "amount_paid": 175,
    "automated": true,
    "client_email": "john.doe@example.com",
    "client_id": "client_12345",
    "client_id_number": 12345,
    "client_name": "John Doe",
    "client_payment_plan_id": "plan_12345",
    "client_payment_plan_interval": 30,
    "created_at": "2023-01-10T00:00:00Z",
    "currency_iso": "USD",
    "discount_amount": 25.5,
    "discount_percent": 10,
    "discount_type": "Percentage",
    "due_date": "2023-02-15T00:00:00Z",
    "id": "inv_12345",
    "issue_date": "2023-01-15T00:00:00Z",
    "items": [
      {
        "appointment_id": "appt_12345",
        "date": "2023-01-15T00:00:00Z",
        "description": "Initial consultation",
        "is_copay": true,
        "price": 100,
        "product_id": "prod_12345",
        "service_code": "SVC001",
        "sub_items": [
          {
            "date": "2023-01-16T00:00:00Z",
            "description": "Follow-up session",
            "modifiers": [
              "Extended",
              "Emergency"
            ],
            "price": 50,
            "service_code": "SVC002",
            "units": 2,
            "units_decimal": 2
          }
        ],
        "taxes": [
          {
            "name": "Sales Tax",
            "percentage": 8.25
          }
        ],
        "taxes_included_in_price": false,
        "total_amount": 110,
        "total_tax_amount": 10,
        "units": 1,
        "units_decimal": 2
      }
    ],
    "note_to_client": "Thank you for your business",
    "number": 1001,
    "payments": [
      {
        "additional_info": "Customer requested partial refund",
        "amount": 100,
        "card_details": {
          "brand": "Visa",
          "card_id": "card_12345",
          "expiration_month": 12,
          "expiration_year": 2025,
          "last_digits": "4242"
        },
        "currency": "USD",
        "date": "2023-01-20T00:00:00Z",
        "method": "Credit Card",
        "processed_by": "Stripe",
        "processed_by_type": "Payment Processor",
        "refunded_amount": 25,
        "tip_amount": 15
      }
    ],
    "status": "Paid",
    "subtotal": 250,
    "tip_amount": 15,
    "total_amount": 275,
    "updated_at": "2023-01-12T00:00:00Z"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Description theme={null}
  {
    "additional_email_recipients": "Additional email addresses to receive the invoice",
    "amount_due": "Amount still due on the invoice",
    "amount_paid": "Amount already paid on the invoice",
    "automated": "Whether the invoice was automatically generated",
    "client_email": "Email address of the client",
    "client_id": "Client identifier",
    "client_id_number": "Numeric client identifier",
    "client_name": "Name of the client",
    "client_payment_plan_id": "Identifier for the client's payment plan",
    "client_payment_plan_interval": "Interval for the client's payment plan",
    "created_at": "Date when the invoice was created",
    "currency_iso": "ISO code for the currency",
    "discount_amount": "Discount amount applied to the invoice",
    "discount_percent": "Discount percentage applied to the invoice",
    "discount_type": "Type of discount applied",
    "due_date": "Date when the invoice is due",
    "id": "Unique identifier for the invoice",
    "issue_date": "Date when the invoice was issued",
    "items": {
      "appointment_id": "Identifier of the associated appointment",
      "date": "Date associated with the item",
      "description": "Description of the item",
      "is_copay": "Whether this item is a copay",
      "price": "Price per unit",
      "product_id": "Identifier of the product",
      "service_code": "Service code for this item",
      "sub_items": {
        "date": "Date associated with the sub-item",
        "description": "Description of the sub-item",
        "modifiers": "Modifiers applied to this sub-item",
        "price": "Price of the sub-item",
        "service_code": "Service code for this sub-item",
        "units": "Number of units, DEPRECATED: use units_decimal, this value might be truncated",
        "units_decimal": "Number of units"
      },
      "taxes": {
        "name": "Name of the tax",
        "percentage": "Percentage rate of the tax"
      },
      "taxes_included_in_price": "Whether taxes are included in the price",
      "total_amount": "Total amount for this item",
      "total_tax_amount": "Total tax amount for this item",
      "units": "Number of units, DEPRECATED: use units_decimal, this value might be truncated",
      "units_decimal": "Number of units"
    },
    "note_to_client": "Note included on the invoice for the client",
    "number": "Invoice number",
    "payments": {
      "additional_info": "Additional information about the payment",
      "amount": "Amount of the payment",
      "card_details": {
        "brand": "Brand of the card",
        "card_id": "Identifier for the card",
        "expiration_month": "Expiration month of the card",
        "expiration_year": "Expiration year of the card",
        "last_digits": "Last digits of the card number"
      },
      "currency": "Currency of the payment",
      "date": "Date of the payment",
      "method": "Payment method used",
      "processed_by": "Entity that processed the payment",
      "processed_by_type": "Type of entity that processed the payment",
      "refunded_amount": "Amount refunded from this payment",
      "tip_amount": "Tip amount included in the payment"
    },
    "status": "Current status of the invoice",
    "subtotal": "Subtotal amount before taxes and discounts",
    "tip_amount": "Tip amount included in the invoice",
    "total_amount": "Total amount of the invoice",
    "updated_at": "Date when the invoice was last modified"
  }
  ```
</ResponseExample>

### Payload Field Details

<ResponseField name="Invoice" type="Event Payload">
  <Expandable title="fields" defaultOpen="true">
    <ResponseField name="id" type="string" required>
      Unique identifier for the invoice

      ```json CEL theme={null}
      id
      ```

      ```json Example theme={null}
      "inv_12345"
      ```
    </ResponseField>

    <ResponseField name="client_name" type="string">
      Name of the client

      ```json CEL theme={null}
      client_name
      ```

      ```json Example theme={null}
      "John Doe"
      ```
    </ResponseField>

    <ResponseField name="client_email" type="string">
      Email address of the client

      ```json CEL theme={null}
      client_email
      ```

      ```json Example theme={null}
      "john.doe@example.com"
      ```
    </ResponseField>

    <ResponseField name="client_id" type="string" required>
      Client identifier

      ```json CEL theme={null}
      client_id
      ```

      ```json Example theme={null}
      "client_12345"
      ```
    </ResponseField>

    <ResponseField name="client_id_number" type="int64">
      Numeric client identifier

      ```json CEL theme={null}
      client_id_number
      ```

      ```json Example theme={null}
      12345
      ```
    </ResponseField>

    <ResponseField name="number" type="int64">
      Invoice number

      ```json CEL theme={null}
      number
      ```

      ```json Example theme={null}
      1001
      ```
    </ResponseField>

    <ResponseField name="issue_date" type="timing.v1.Timestamp">
      Date when the invoice was issued

      ```json CEL theme={null}
      issue_date
      ```

      ```json Example theme={null}
      "2023-01-15T00:00:00Z"
      ```
    </ResponseField>

    <ResponseField name="status" type="string">
      Current status of the invoice

      ```json CEL theme={null}
      status
      ```

      ```json Example theme={null}
      "Paid"
      ```
    </ResponseField>

    <ResponseField name="due_date" type="timing.v1.Timestamp">
      Date when the invoice is due

      ```json CEL theme={null}
      due_date
      ```

      ```json Example theme={null}
      "2023-02-15T00:00:00Z"
      ```
    </ResponseField>

    <ResponseField name="currency_iso" type="string">
      ISO code for the currency

      ```json CEL theme={null}
      currency_iso
      ```

      ```json Example theme={null}
      "USD"
      ```
    </ResponseField>

    <ResponseField name="discount_percent" type="float64 (double)">
      Discount percentage applied to the invoice

      ```json CEL theme={null}
      discount_percent
      ```

      ```json Example theme={null}
      10
      ```
    </ResponseField>

    <ResponseField name="discount_amount" type="float64 (double)">
      Discount amount applied to the invoice

      ```json CEL theme={null}
      discount_amount
      ```

      ```json Example theme={null}
      25.5
      ```
    </ResponseField>

    <ResponseField name="discount_type" type="string">
      Type of discount applied

      ```json CEL theme={null}
      discount_type
      ```

      ```json Example theme={null}
      "Percentage"
      ```
    </ResponseField>

    <ResponseField name="subtotal" type="float64 (double)">
      Subtotal amount before taxes and discounts

      ```json CEL theme={null}
      subtotal
      ```

      ```json Example theme={null}
      250
      ```
    </ResponseField>

    <ResponseField name="total_amount" type="float64 (double)">
      Total amount of the invoice

      ```json CEL theme={null}
      total_amount
      ```

      ```json Example theme={null}
      275
      ```
    </ResponseField>

    <ResponseField name="amount_due" type="float64 (double)">
      Amount still due on the invoice

      ```json CEL theme={null}
      amount_due
      ```

      ```json Example theme={null}
      100
      ```
    </ResponseField>

    <ResponseField name="amount_paid" type="float64 (double)">
      Amount already paid on the invoice

      ```json CEL theme={null}
      amount_paid
      ```

      ```json Example theme={null}
      175
      ```
    </ResponseField>

    <ResponseField name="note_to_client" type="string">
      Note included on the invoice for the client

      ```json CEL theme={null}
      note_to_client
      ```

      ```json Example theme={null}
      "Thank you for your business"
      ```
    </ResponseField>

    <ResponseField name="tip_amount" type="float64 (double)">
      Tip amount included in the invoice

      ```json CEL theme={null}
      tip_amount
      ```

      ```json Example theme={null}
      15
      ```
    </ResponseField>

    <ResponseField name="automated" type="bool">
      Whether the invoice was automatically generated

      ```json CEL theme={null}
      automated
      ```

      ```json Example theme={null}
      true
      ```
    </ResponseField>

    <ResponseField name="additional_email_recipients" type="[]string" required>
      Additional email addresses to receive the invoice

      ```json CEL theme={null}
      additional_email_recipients
      ```

      ```json Example theme={null}
      [
      "billing@example.com",
      "accounts@example.com"
      ]
      ```
    </ResponseField>

    <ResponseField name="client_payment_plan_id" type="string">
      Identifier for the client's payment plan

      ```json CEL theme={null}
      client_payment_plan_id
      ```

      ```json Example theme={null}
      "plan_12345"
      ```
    </ResponseField>

    <ResponseField name="client_payment_plan_interval" type="int64">
      Interval for the client's payment plan

      ```json CEL theme={null}
      client_payment_plan_interval
      ```

      ```json Example theme={null}
      30
      ```
    </ResponseField>

    <ResponseField name="created_at" type="timing.v1.Timestamp">
      Date when the invoice was created

      ```json CEL theme={null}
      created_at
      ```

      ```json Example theme={null}
      "2023-01-10T00:00:00Z"
      ```
    </ResponseField>

    <ResponseField name="updated_at" type="timing.v1.Timestamp">
      Date when the invoice was last modified

      ```json CEL theme={null}
      updated_at
      ```

      ```json Example theme={null}
      "2023-01-12T00:00:00Z"
      ```
    </ResponseField>

    <ResponseField name="payments" type="[]object" required>
      Payments made against this invoice

      ```json CEL theme={null}
      payments
      ```

      ```json Example theme={null}
      [
      {
      "additional_info": "Customer requested partial refund",
      "amount": 100,
      "card_details": {
      "brand": "Visa",
      "card_id": "card_12345",
      "expiration_month": 12,
      "expiration_year": 2025,
      "last_digits": "4242"
      },
      "currency": "USD",
      "date": "2023-01-20T00:00:00Z",
      "method": "Credit Card",
      "processed_by": "Stripe",
      "processed_by_type": "Payment Processor",
      "refunded_amount": 25,
      "tip_amount": 15
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.date)" type="[]timing.v1.Timestamp" required>
      Mapped array of: Date of the payment

      ```json CEL theme={null}
      payments.map(x, x.date)
      ```

      ```json Example theme={null}
      [
      "2023-01-20T00:00:00Z"
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.amount)" type="[]float64 (double)" required>
      Mapped array of: Amount of the payment

      ```json CEL theme={null}
      payments.map(x, x.amount)
      ```

      ```json Example theme={null}
      [
      100
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.currency)" type="[]string" required>
      Mapped array of: Currency of the payment

      ```json CEL theme={null}
      payments.map(x, x.currency)
      ```

      ```json Example theme={null}
      [
      "USD"
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.method)" type="[]string" required>
      Mapped array of: Payment method used

      ```json CEL theme={null}
      payments.map(x, x.method)
      ```

      ```json Example theme={null}
      [
      "Credit Card"
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.processed_by)" type="[]string" required>
      Mapped array of: Entity that processed the payment

      ```json CEL theme={null}
      payments.map(x, x.processed_by)
      ```

      ```json Example theme={null}
      [
      "Stripe"
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.processed_by_type)" type="[]string" required>
      Mapped array of: Type of entity that processed the payment

      ```json CEL theme={null}
      payments.map(x, x.processed_by_type)
      ```

      ```json Example theme={null}
      [
      "Payment Processor"
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.tip_amount)" type="[]float64 (double)" required>
      Mapped array of: Tip amount included in the payment

      ```json CEL theme={null}
      payments.map(x, x.tip_amount)
      ```

      ```json Example theme={null}
      [
      15
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.refunded_amount)" type="[]float64 (double)" required>
      Mapped array of: Amount refunded from this payment

      ```json CEL theme={null}
      payments.map(x, x.refunded_amount)
      ```

      ```json Example theme={null}
      [
      25
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.additional_info)" type="[]string" required>
      Mapped array of: Additional information about the payment

      ```json CEL theme={null}
      payments.map(x, x.additional_info)
      ```

      ```json Example theme={null}
      [
      "Customer requested partial refund"
      ]
      ```
    </ResponseField>

    <ResponseField name="payments.map(x, x.card_details)" type="[]bool" required>
      Mapped array of: Details of the card used for payment

      ```json CEL theme={null}
      payments.map(x, x.card_details)
      ```

      ```json Example theme={null}
      [
      {
      "brand": "Visa",
      "card_id": "card_12345",
      "expiration_month": 12,
      "expiration_year": 2025,
      "last_digits": "4242"
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="items" type="[]object" required>
      Line items included in this invoice

      ```json CEL theme={null}
      items
      ```

      ```json Example theme={null}
      [
      {
      "appointment_id": "appt_12345",
      "date": "2023-01-15T00:00:00Z",
      "description": "Initial consultation",
      "is_copay": true,
      "price": 100,
      "product_id": "prod_12345",
      "service_code": "SVC001",
      "sub_items": [
      {
        "date": "2023-01-16T00:00:00Z",
        "description": "Follow-up session",
        "modifiers": [
          "Extended",
          "Emergency"
        ],
        "price": 50,
        "service_code": "SVC002",
        "units": 2,
        "units_decimal": 2
      }
      ],
      "taxes": [
      {
        "name": "Sales Tax",
        "percentage": 8.25
      }
      ],
      "taxes_included_in_price": false,
      "total_amount": 110,
      "total_tax_amount": 10,
      "units": 1,
      "units_decimal": 2
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.appointment_id)" type="[]string" required>
      Mapped array of: Identifier of the associated appointment

      ```json CEL theme={null}
      items.map(x, x.appointment_id)
      ```

      ```json Example theme={null}
      [
      "appt_12345"
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.product_id)" type="[]string" required>
      Mapped array of: Identifier of the product

      ```json CEL theme={null}
      items.map(x, x.product_id)
      ```

      ```json Example theme={null}
      [
      "prod_12345"
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.description)" type="[]string" required>
      Mapped array of: Description of the item

      ```json CEL theme={null}
      items.map(x, x.description)
      ```

      ```json Example theme={null}
      [
      "Initial consultation"
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.total_tax_amount)" type="[]float64 (double)" required>
      Mapped array of: Total tax amount for this item

      ```json CEL theme={null}
      items.map(x, x.total_tax_amount)
      ```

      ```json Example theme={null}
      [
      10
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.units)" type="[]int64" required>
      Mapped array of: Number of units, DEPRECATED: use units\_decimal, this value might be truncated

      ```json CEL theme={null}
      items.map(x, x.units)
      ```

      ```json Example theme={null}
      [
      1
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.price)" type="[]float64 (double)" required>
      Mapped array of: Price per unit

      ```json CEL theme={null}
      items.map(x, x.price)
      ```

      ```json Example theme={null}
      [
      100
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.date)" type="[]timing.v1.Timestamp" required>
      Mapped array of: Date associated with the item

      ```json CEL theme={null}
      items.map(x, x.date)
      ```

      ```json Example theme={null}
      [
      "2023-01-15T00:00:00Z"
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.taxes)" type="[]bool" required>
      Mapped array of: Taxes applied to this item

      ```json CEL theme={null}
      items.map(x, x.taxes)
      ```

      ```json Example theme={null}
      [
      [
      {
      "name": "Sales Tax",
      "percentage": 8.25
      }
      ]
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.taxes_included_in_price)" type="[]bool" required>
      Mapped array of: Whether taxes are included in the price

      ```json CEL theme={null}
      items.map(x, x.taxes_included_in_price)
      ```

      ```json Example theme={null}
      [
      false
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.is_copay)" type="[]bool" required>
      Mapped array of: Whether this item is a copay

      ```json CEL theme={null}
      items.map(x, x.is_copay)
      ```

      ```json Example theme={null}
      [
      true
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.total_amount)" type="[]float64 (double)" required>
      Mapped array of: Total amount for this item

      ```json CEL theme={null}
      items.map(x, x.total_amount)
      ```

      ```json Example theme={null}
      [
      110
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.service_code)" type="[]string" required>
      Mapped array of: Service code for this item

      ```json CEL theme={null}
      items.map(x, x.service_code)
      ```

      ```json Example theme={null}
      [
      "SVC001"
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.sub_items)" type="[]bool" required>
      Mapped array of: Sub-items included in this item

      ```json CEL theme={null}
      items.map(x, x.sub_items)
      ```

      ```json Example theme={null}
      [
      [
      {
      "date": "2023-01-16T00:00:00Z",
      "description": "Follow-up session",
      "modifiers": [
        "Extended",
        "Emergency"
      ],
      "price": 50,
      "service_code": "SVC002",
      "units": 2,
      "units_decimal": 2
      }
      ]
      ]
      ```
    </ResponseField>

    <ResponseField name="items.map(x, x.units_decimal)" type="[]float64 (double)" required>
      Mapped array of: Number of units

      ```json CEL theme={null}
      items.map(x, x.units_decimal)
      ```

      ```json Example theme={null}
      [
      2
      ]
      ```
    </ResponseField>
  </Expandable>
</ResponseField>
