# Prepare Consignment Write Payload

> Perform Prepare Consignment Write Payload through Consignment Intake.

Source: [https://genhealth.ai/docs/workflows/integrations/consignment-intake/prepare_consignment_write_payload](https://genhealth.ai/docs/workflows/integrations/consignment-intake/prepare_consignment_write_payload)

Integration: [Consignment Intake](https://genhealth.ai/docs/workflows/integrations/consignment-intake.md)

- Handler: `prepare_consignment_write_payload`

## Inputs

- `order_mapping` — Order Mapping (json, required)
  Required JSON value.
- `extracted_fields` — Extracted Fields (json, required)
  Required JSON value.
- `document_text` — Document Text (expression)
  Optional literal value or workflow expression.
- `packet_context` — Packet Context (json, required)
  Required JSON value.
- `billing_location_resolution` — Billing Location Resolution (json, required)
  Required JSON value.
- `policyholder_resolution` — Policyholder Resolution (json)
  Optional JSON value.
- `as_of_date` — As Of Date (date)
  Optional date in YYYY-MM-DD format.
- `existing_patient_id` — Existing Patient Id (text)
  Optional text value.
- `salesperson_name` — Salesperson Name (expression)
  Optional literal value or workflow expression.
- `clean_path_mode` — Clean Path Mode (select)
  Optional selected identifier or value.
  Default: `"review_for_billing"`
  Options: Review for billing ("review_for_billing"), Submitted (explicit opt-in) ("submitted")
- `patient_name_format` — Patient Name Format (select)
  Optional selected identifier or value.
  Options: Given name then family name ("given_family"), Given Family or Family, Given ("given_family_or_family_comma_given")

## Outputs

- `success` — Success
- `ready_for_patient_insurance_write` — Ready For Patient Insurance Write
- `payload_not_ready_reason` — Payload Not Ready Reason
- `review_required` — Review Required
- `review_reason` — Review Reason
- `review_reasons` — Review Reasons
- `review_details` — Review Details
- `patient_data` — Patient Data
- `patient_name_resolved_from_fallback` — Patient Name Resolved From Fallback
- `patient_name_resolved_from_configured_format` — Patient Name Resolved From Configured Format
- `policy_data` — Policy Data
- `billing_location_ids` — Billing Location Ids
- `billing_location_resolution` — Billing Location Resolution
- `billing_location` — Billing Location
- `patient_state` — Patient State
- `payer_plan` — Payer Plan
- `payer_card_state` — Payer Card State
- `payer_name_truncated` — Payer Name Truncated
- `card_insurance_type` — Card Insurance Type
- `member_number` — Member Number
- `insurance_sequence` — Insurance Sequence
- `packet_context` — Packet Context
- `guarantor_data` — Guarantor Data
- `guarantor_write_required` — Guarantor Write Required
- `guarantor_first_name` — Guarantor First Name
- `guarantor_last_name` — Guarantor Last Name
- `guarantor_relationship_id` — Guarantor Relationship Id
- `guarantor_date_of_birth` — Guarantor Date Of Birth
- `accident_details` — Accident Details
- `existing_patient_id` — Existing Patient Id
- `patient_write_mode` — Patient Write Mode
- `clean_path_mode` — Clean Path Mode
- `error` — Error
- `error_kind` — Error Kind

Output schema completeness: `best_effort_declared`

## Safety

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

## Schemas

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

### Input schema

```json
{
  "type": "object",
  "required": [
    "order_mapping",
    "extracted_fields",
    "packet_context",
    "billing_location_resolution"
  ],
  "properties": {
    "as_of_date": {
      "type": "string",
      "format": "date",
      "description": "Optional date in YYYY-MM-DD format.",
      "x-workflow-field-type": "date"
    },
    "document_text": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "order_mapping": {
      "description": "Required JSON value.",
      "x-workflow-field-type": "json"
    },
    "packet_context": {
      "description": "Required JSON value.",
      "x-workflow-field-type": "json"
    },
    "clean_path_mode": {
      "enum": [
        "review_for_billing",
        "submitted"
      ],
      "type": "string",
      "default": "review_for_billing",
      "description": "Optional selected identifier or value.",
      "x-workflow-field-type": "select"
    },
    "extracted_fields": {
      "description": "Required JSON value.",
      "x-workflow-field-type": "json"
    },
    "salesperson_name": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "existing_patient_id": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "patient_name_format": {
      "enum": [
        "given_family",
        "given_family_or_family_comma_given"
      ],
      "type": "string",
      "description": "Optional selected identifier or value.",
      "x-workflow-field-type": "select"
    },
    "policyholder_resolution": {
      "description": "Optional JSON value.",
      "x-workflow-field-type": "json"
    },
    "billing_location_resolution": {
      "description": "Required JSON value.",
      "x-workflow-field-type": "json"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "success": {},
    "error_kind": {},
    "payer_plan": {},
    "policy_data": {},
    "patient_data": {},
    "member_number": {},
    "patient_state": {},
    "review_reason": {},
    "guarantor_data": {},
    "packet_context": {},
    "review_details": {},
    "review_reasons": {},
    "clean_path_mode": {},
    "review_required": {},
    "accident_details": {},
    "billing_location": {},
    "payer_card_state": {},
    "insurance_sequence": {},
    "patient_write_mode": {},
    "card_insurance_type": {},
    "existing_patient_id": {},
    "guarantor_last_name": {},
    "billing_location_ids": {},
    "guarantor_first_name": {},
    "payer_name_truncated": {},
    "guarantor_date_of_birth": {},
    "guarantor_write_required": {},
    "payload_not_ready_reason": {},
    "guarantor_relationship_id": {},
    "billing_location_resolution": {},
    "ready_for_patient_insurance_write": {},
    "patient_name_resolved_from_fallback": {},
    "patient_name_resolved_from_configured_format": {}
  },
  "additionalProperties": true
}
```
