# Apply Unapplied Payment

> Perform Apply Unapplied Payment through Brightree.

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

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

- Handler: `brightree_apply_unapplied_payment`

- Connection type: `brightree`

## Use in a workflow

Copy this discovered node config, fill params from the input contract, and validate the complete graph. Integration results are available as {{node_id.default.field}}. Check business success before dependent writes; completion alone does not prove business success.

```json

{
  "_group": "Brightree",
  "params": {
    "dry_run": true
  },
  "handler": "brightree_apply_unapplied_payment"
}

```

[Action contracts](https://genhealth.ai/docs/workflows/action-contracts.md) · [Run recovery](https://genhealth.ai/docs/workflows/operations.md)

## Inputs

- `invoice_key` — Invoice Key (expression)
  Optional literal value or workflow expression.
- `unapplied_payment_key` — Unapplied Payment Key (expression)
  Optional literal value or workflow expression.
- `invoice_detail_key` — Invoice Detail Key (expression)
  Optional literal value or workflow expression.
- `amount` — Amount (expression)
  Optional literal value or workflow expression.
- `pay_date` — Pay Date (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
- `applied` — Applied
- `verified` — Verified
- `invoice_key` — Invoice Key
- `unapplied_payment_key` — Unapplied Payment Key
- `invoice_detail_key` — Invoice Detail Key
- `amount_applied` — Amount Applied
- `unapplied_balance` — Unapplied Balance
- `remaining_unapplied` — Remaining Unapplied
- `line_balance` — Line Balance
- `observed_balance` — Observed Balance
- `balance_after` — Balance After
- `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": {
    "amount": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "dry_run": {
      "type": "boolean",
      "default": true,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "pay_date": {
      "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"
    },
    "expected_balance": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "invoice_detail_key": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "unapplied_payment_key": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "applied": {},
    "dry_run": {},
    "message": {},
    "success": {},
    "verified": {},
    "gate_passed": {},
    "invoice_key": {},
    "line_balance": {},
    "balance_after": {},
    "amount_applied": {},
    "observed_balance": {},
    "unapplied_balance": {},
    "invoice_detail_key": {},
    "remaining_unapplied": {},
    "unapplied_payment_key": {}
  },
  "additionalProperties": true
}
```
