# Upload Document to Sales Order

> Perform Upload Document to Sales Order through Brightree.

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

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

- Handler: `brightree_upload_document_to_sales_order`

- 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": false
  },
  "handler": "brightree_upload_document_to_sales_order"
}

```

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

## Inputs

- `sales_order_key` — Sales Order Key (expression, required)
  Required literal value or workflow expression.
- `patient_key` — Patient Key (expression, required)
  Required literal value or workflow expression.
- `branch_key` — Branch Key (expression)
  Optional literal value or workflow expression.
- `document_id` — Document Id (expression, required)
  Required literal value or workflow expression.
- `document_type` — Document Type (text, required)
  Required text value.
- `batch_name` — Batch Name (text)
  Optional text value.
- `batch_id` — Batch Id (text)
  Optional text value.
- `file_name` — File Name (expression)
  Optional literal value or workflow expression.
- `notes` — Notes (textarea)
  Optional text value.
- `dry_run` — Dry Run (boolean)
  Optional true-or-false value.
  Default: `false`

## Outputs

- `success` — Success
- `dry_run` — Dry Run
- `sales_order_key` — Sales Order Key
- `patient_key` — Patient Key
- `branch_key` — Branch Key
- `branch_key_source` — Branch Key Source
- `uploaded_filename` — Uploaded Filename
- `message` — Message
- `error` — Error

Output schema completeness: `best_effort_declared`

## Safety

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

## Schemas

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

### Input schema

```json
{
  "type": "object",
  "required": [
    "sales_order_key",
    "patient_key",
    "document_id",
    "document_type"
  ],
  "properties": {
    "notes": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "textarea"
    },
    "dry_run": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "batch_id": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "file_name": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "batch_name": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "branch_key": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_id": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "patient_key": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_type": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "sales_order_key": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "dry_run": {},
    "message": {},
    "success": {},
    "branch_key": {},
    "patient_key": {},
    "sales_order_key": {},
    "branch_key_source": {},
    "uploaded_filename": {}
  },
  "additionalProperties": true
}
```
