# Write Sales Order Margin Result

> Perform Write Sales Order Margin Result through Brightree Margin Review.

Source: [https://genhealth.ai/docs/workflows/integrations/brightree-margin-review/brightree_write_sales_order_margin_result](https://genhealth.ai/docs/workflows/integrations/brightree-margin-review/brightree_write_sales_order_margin_result)

Integration: [Brightree Margin Review](https://genhealth.ai/docs/workflows/integrations/brightree-margin-review.md)

- Handler: `brightree_write_sales_order_margin_result`

- Connection type: `brightree`

## Inputs

- `sales_order_key` — Sales Order Key (expression, required)
  Required literal value or workflow expression.
- `margin_percent` — Margin Percent (expression)
  Optional literal value or workflow expression.
- `dry_run` — Dry Run (boolean)
  Optional true-or-false value.
  Default: `false`

## Outputs

- `success` — Success
- `status` — Status
- `attempted` — Attempted
- `updated` — Updated
- `sales_order_key` — Sales Order Key
- `verified` — Verified
- `low_profit_margin` — Low Profit Margin
- `margin_percent` — Margin Percent
- `user_3_value` — User 3 Value
- `error` — Error
- `error_message` — Error Message

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"
  ],
  "properties": {
    "dry_run": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "margin_percent": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "sales_order_key": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "status": {},
    "success": {},
    "updated": {},
    "verified": {},
    "attempted": {},
    "user_3_value": {},
    "error_message": {},
    "margin_percent": {},
    "sales_order_key": {},
    "low_profit_margin": {}
  },
  "additionalProperties": true
}
```
