# Apply Invoice Payment

> Perform Apply Invoice Payment through Brightree.

Source: [https://genhealth.ai/docs/workflows/integrations/brightree/brightree_apply_invoice_payment](https://genhealth.ai/docs/workflows/integrations/brightree/brightree_apply_invoice_payment)

Integration: [Brightree](https://genhealth.ai/docs/workflows/integrations/brightree.md)

- Handler: `brightree_apply_invoice_payment`

- Connection type: `brightree`

## Inputs

- `deposit_key` — Deposit Key (expression)
  Optional literal value or workflow expression.
- `receipt_key` — Receipt Key (expression)
  Optional literal value or workflow expression.
- `invoice_key` — Invoice Key (expression)
  Optional literal value or workflow expression.
- `amount` — Amount (expression)
  Optional literal value or workflow expression.
- `proc_line_index` — Proc Line Index (expression)
  Optional literal value or workflow expression.
  Default: `"0"`
- `payment_type` — Payment Type (text)
  Optional text value.
  Default: `"7"`
- `reason` — Reason (text)
  Optional text value.
  Default: `"0"`
- `note` — Note (expression)
  Optional literal value or workflow expression.
- `expected_balance` — Expected Balance (expression)
  Optional literal value or workflow expression.
- `dry_run` — Dry Run (boolean)
  Optional true-or-false value.
  Default: `true`

## Outputs

- `success` — Success
- `dry_run` — Dry Run
- `invoice_key` — Invoice Key
- `invoice_number` — Invoice Number
- `payments_applied` — Payments Applied
- `observed_balance` — Observed Balance
- `gate_passed` — Gate Passed
- `message` — Message
- `error` — Error

Output schema completeness: `best_effort_declared`

## Safety

- External effect: `irreversible`
- Confirmation recommended: yes
- Retry safe: no
- Dry run supported: yes

## Schemas

These schemas are first-pass authoring guidance. Runtime validation remains authoritative.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "note": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "amount": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "reason": {
      "type": "string",
      "default": "0",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "dry_run": {
      "type": "boolean",
      "default": true,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "deposit_key": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "invoice_key": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "receipt_key": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "payment_type": {
      "type": "string",
      "default": "7",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "proc_line_index": {
      "default": "0",
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "expected_balance": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "dry_run": {},
    "message": {},
    "success": {},
    "gate_passed": {},
    "invoice_key": {},
    "invoice_number": {},
    "observed_balance": {},
    "payments_applied": {}
  },
  "additionalProperties": true
}
```
