## Mark a Proposal as Complete

### cURL Example

```bash
curl --request PUT \
  --url https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/proposals/{id}/complete/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Eco-Friendly Tumbler Set",
  "status": "draft",
  "source": "console",
  "proposal_type": "new_product",
  "return_reason_detail": "Incorrect pricing on listed item.",
  "push_to_shopify": true,
  "end_at": "2025-06-30T23:59:59Z",
  "item_skipped_count": 3,
  "has_price_changes": false,
  "target_live_date": "2025-07-01T00:00:00Z",
  "start_at": "2025-05-01T00:00:00Z",
  "expires_at": "2025-07-31T23:59:59Z",
  "draft_proposed_at": "2025-04-20T12:00:00Z",
  "acknowledged_at": "2025-04-22T09:00:00Z",
  "proposed_at": "2025-04-23T10:00:00Z",
  "archived_at": "2025-08-01T10:00:00Z",
  "revised_at": "2025-04-25T15:00:00Z",
  "approved_at": "2025-05-01T10:00:00Z",
  "declined_at": "2025-05-02T12:00:00Z",
  "pricing_approved_at": "2025-05-03T14:00:00Z",
  "completed_at": "2025-05-05T16:00:00Z",
  "withdrawn_at": "2025-05-06T09:30:00Z",
  "withdraw_reason": "Vendor no longer supports product line."
}
'
```

### Python Example

```python
import requests

url = "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/proposals/{id}/complete/"

payload = {
    "name": "Eco-Friendly Tumbler Set",
    "status": "draft",
    "source": "console",
    "proposal_type": "new_product",
    "return_reason_detail": "Incorrect pricing on listed item.",
    "push_to_shopify": True,
    "end_at": "2025-06-30T23:59:59Z",
    "item_skipped_count": 3,
    "has_price_changes": False,
    "target_live_date": "2025-07-01T00:00:00Z",
    "start_at": "2025-05-01T00:00:00Z",
    "expires_at": "2025-07-31T23:59:59Z",
    "draft_proposed_at": "2025-04-20T12:00:00Z",
    "acknowledged_at": "2025-04-22T09:00:00Z",
    "proposed_at": "2025-04-23T10:00:00Z",
    "archived_at": "2025-08-01T10:00:00Z",
    "revised_at": "2025-04-25T15:00:00Z",
    "approved_at": "2025-05-01T10:00:00Z",
    "declined_at": "2025-05-02T12:00:00Z",
    "pricing_approved_at": "2025-05-03T14:00:00Z",
    "completed_at": "2025-05-05T16:00:00Z",
    "withdrawn_at": "2025-05-06T09:30:00Z",
    "withdraw_reason": "Vendor no longer supports product line."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

### JavaScript (Fetch) Example

```javascript
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: 'Eco-Friendly Tumbler Set',
    status: 'draft',
    source: 'console',
    proposal_type: 'new_product',
    return_reason_detail: 'Incorrect pricing on listed item.',
    push_to_shopify: true,
    end_at: '2025-06-30T23:59:59Z',
    item_skipped_count: 3,
    has_price_changes: false,
    target_live_date: '2025-07-01T00:00:00Z',
    start_at: '2025-05-01T00:00:00Z',
    expires_at: '2025-07-31T23:59:59Z',
    draft_proposed_at: '2025-04-20T12:00:00Z',
    acknowledged_at: '2025-04-22T09:00:00Z',
    proposed_at: '2025-04-23T10:00:00Z',
    archived_at: '2025-08-01T10:00:00Z',
    revised_at: '2025-04-25T15:00:00Z',
    approved_at: '2025-05-01T10:00:00Z',
    declined_at: '2025-05-02T12:00:00Z',
    pricing_approved_at: '2025-05-03T14:00:00Z',
    completed_at: '2025-05-05T16:00:00Z',
    withdrawn_at: '2025-05-06T09:30:00Z',
    withdraw_reason: 'Vendor no longer supports product line.'
  })
};

fetch('https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/proposals/{id}/complete/', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Proposal Structure

- **name**: Title of the product proposal
- **status**: Current state of the proposal
- **source**: Proposal source
- **proposal_type**: Proposal category
- **return_reason_detail**: Explanation for return reason
- **push_to_shopify**: Flag for Shopify push
- **end_at**: End date of proposal
- **item_skipped_count**: Items skipped during processing
- **has_price_changes**: Price change flag
- **target_live_date**: Scheduled live date
- **start_at**: Active date of proposal
- **expires_at**: Expiry date
- **draft_proposed_at**: Draft submission timestamp
- **acknowledged_at**: Acknowledgment timestamp
- **proposed_at**: Proposal timestamp
- **archived_at**: Archive timestamp
- **revised_at**: Revision timestamp
- **approved_at**: Approval timestamp
- **declined_at**: Decline timestamp
- **pricing_approved_at**: Pricing approval timestamp
- **completed_at**: Completion timestamp
- **withdrawn_at**: Withdrawal timestamp
- **withdraw_reason**: Reason for withdrawal
