> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lulacommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Order Issue

> Update an existing order issue with resolution notes, status changes, refund information, and other progress updates.

This endpoint allows you to update existing order issues as they progress through resolution. You can change status, add resolution notes, process refunds, update priority, and document the complete resolution process.

<Info>
  Issue updates maintain a complete audit trail of all changes, ensuring transparency and accountability in the resolution process.
</Info>

### Path Parameters

<ParamField path="order_id" type="string" required>
  The unique identifier of the order containing the issue
</ParamField>

<ParamField path="issue_id" type="string" required>
  The unique identifier of the issue to update
</ParamField>

### Request Body

<ParamField body="notes" type="string" optional>
  Additional notes or comments about the issue resolution progress
</ParamField>

<ParamField body="priority" type="string" optional>
  Updated priority level: "low", "medium", "high", "critical"
</ParamField>

<ParamField body="status" type="string" optional>
  Updated issue status: "open", "investigating", "in\_progress", "resolved", "closed", "escalated"
</ParamField>

<ParamField body="refund_amount" type="number" optional>
  Amount to refund to customer (if applicable)
</ParamField>

<ParamField body="refund_source" type="string" optional>
  Source of refund: "merchant", "platform", "insurance", "store\_credit"
</ParamField>

<ParamField body="resolution_description" type="string" optional>
  Detailed description of how the issue was resolved
</ParamField>

<ParamField body="customer_satisfied" type="boolean" optional>
  Whether the customer expressed satisfaction with the resolution
</ParamField>

<ParamField body="follow_up_required" type="boolean" optional>
  Whether additional follow-up is needed
</ParamField>

<ParamField body="follow_up_date" type="string" optional>
  Scheduled date for follow-up (ISO 8601 format)
</ParamField>

<ParamField body="assigned_to" type="string" optional>
  Employee ID of person now assigned to handle the issue
</ParamField>

<ParamField body="updated_by" type="string" required>
  Employee ID of person making this update
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the issue was successfully updated
</ResponseField>

<ResponseField name="message" type="string">
  Confirmation message or error details
</ResponseField>

<ResponseField name="issue_id" type="string">
  The ID of the updated issue
</ResponseField>

<ResponseField name="updated_fields" type="array">
  List of fields that were successfully updated
</ResponseField>

<ResponseField name="previous_status" type="string">
  Previous status before this update
</ResponseField>

<ResponseField name="new_status" type="string">
  Current status after this update
</ResponseField>

<ResponseField name="refund_processed" type="boolean">
  Whether a refund was processed as part of this update
</ResponseField>

<ResponseField name="timestamp" type="string">
  Timestamp when the update was applied
</ResponseField>

### Request Example

```json theme={null}
{
  "notes": "Customer contacted and confirmed wrong items received. Processing replacement order and refund for inconvenience.",
  "priority": "medium",
  "status": "resolved",
  "refund_amount": 15.50,
  "refund_source": "merchant",
  "resolution_description": "Issued full refund for incorrect items and sent replacement order at no charge. Customer very understanding and satisfied with resolution.",
  "customer_satisfied": true,
  "follow_up_required": true,
  "follow_up_date": "2024-01-22T10:00:00Z",
  "updated_by": "emp_cs_001"
}
```

### Response Example

```json theme={null}
{
  "success": true,
  "message": "Issue successfully updated and resolution recorded",
  "issue_id": "issue_123456789",
  "updated_fields": [
    "notes",
    "status",
    "refund_amount",
    "refund_source",
    "resolution_description",
    "customer_satisfied",
    "follow_up_required",
    "follow_up_date"
  ],
  "previous_status": "investigating",
  "new_status": "resolved",
  "refund_processed": true,
  "timestamp": "2024-01-15T16:45:00Z"
}
```

<Accordion title="Issue Status Workflow">
  **Status Progression:**

  1. **open**: Issue newly created, awaiting initial review
  2. **investigating**: Issue under investigation, gathering information
  3. **in\_progress**: Active resolution efforts underway
  4. **resolved**: Issue resolved, waiting for confirmation
  5. **closed**: Issue fully resolved and confirmed
  6. **escalated**: Issue escalated to higher authority

  **Status Change Rules:**

  * Issues can move forward or backward in the workflow
  * Certain status changes trigger automatic notifications
  * Closed issues require manager approval to reopen
  * Escalated issues follow special handling procedures
</Accordion>

<Note>
  **Refund Processing**: When refund\_amount is specified, the system initiates the refund process automatically. Processing time depends on the refund\_source and payment method.
</Note>

<Tip>
  **Customer Communication**: Always update the issue when you communicate with the customer. This maintains a complete record of all interactions and helps other team members understand the situation.
</Tip>

### Update Tracking

<Accordion title="Audit Trail Features">
  When an issue is updated, the system automatically tracks:

  1. **Change History**: All field changes with before/after values
  2. **User Attribution**: Who made each change and when
  3. **Status Timeline**: Complete progression through resolution stages
  4. **Communication Log**: Record of all customer interactions
  5. **Resolution Metrics**: Time to resolution and satisfaction scores
  6. **Pattern Analysis**: Data for identifying recurring issues
</Accordion>

### Use Cases

<Accordion title="Common Update Scenarios">
  **Status Updates**

  * Move issue through resolution workflow
  * Track progress and milestones
  * Communicate current state to stakeholders

  **Resolution Documentation**

  * Record final resolution details
  * Document customer satisfaction
  * Plan follow-up activities

  **Refund Processing**

  * Process partial or full refunds
  * Track refund sources and amounts
  * Document financial resolution

  **Escalation Management**

  * Escalate complex issues
  * Reassign to specialists
  * Update priority based on severity

  **Quality Improvement**

  * Add detailed resolution notes
  * Identify process improvements
  * Document lessons learned
</Accordion>

### Error Responses

<Accordion title="Common Error Scenarios">
  **Issue Not Found**

  ```json theme={null}
  {
    "success": false,
    "message": "Issue not found",
    "error_code": "ISSUE_NOT_FOUND",
    "issue_id": "invalid-issue-id"
  }
  ```

  **Invalid Status Transition**

  ```json theme={null}
  {
    "success": false,
    "message": "Invalid status transition",
    "error_code": "INVALID_STATUS_TRANSITION",
    "current_status": "closed",
    "attempted_status": "investigating"
  }
  ```

  **Refund Processing Error**

  ```json theme={null}
  {
    "success": false,
    "message": "Unable to process refund",
    "error_code": "REFUND_FAILED",
    "refund_amount": 15.50,
    "reason": "Payment method no longer valid"
  }
  ```

  **Permission Denied**

  ```json theme={null}
  {
    "success": false,
    "message": "Insufficient permissions to update this issue",
    "error_code": "PERMISSION_DENIED",
    "required_role": "customer_service_manager"
  }
  ```
</Accordion>

<Warning>
  **Status Restrictions**: Certain status changes may require manager approval or special permissions. Ensure you have appropriate access before attempting status changes to "closed" or "escalated".
</Warning>

### Field Validation

<Accordion title="Update Validation Rules">
  **notes**

  * Maximum length: 2000 characters
  * Required when changing status to "resolved" or "closed"
  * Cannot be empty string

  **priority**

  * Must be one of: "low", "medium", "high", "critical"
  * Critical priority issues trigger immediate notifications
  * Priority increases require justification in notes

  **status**

  * Must follow valid status transition rules
  * Some transitions require manager approval
  * Cannot skip required workflow steps

  **refund\_amount**

  * Must be positive number
  * Cannot exceed original order amount
  * Requires refund\_source when specified

  **refund\_source**

  * Must be one of: "merchant", "platform", "insurance", "store\_credit"
  * Required when refund\_amount is specified
  * Different sources have different processing times
</Accordion>
