# PATCH /opportunities/:id/products/:opportunityProductId

**Resource:** [Opportunities](./opportunities.md)  
**Scopes:** `opportunities:write`  
**Write operation:** yes

Update an opportunity product. Supports quantity, price, discount, deposit, and payment_status. Setting payment_status requires invoices:write scope -- returns 403 otherwise. Valid payment_status values: unpaid, deposit_invoiced, invoiced, paid. Legacy alias: PATCH /deals/:id/products/:dealProductId.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Opportunity ID |
| `opportunityProductId` | path | uuid | yes | Opportunity product ID (legacy: dealProductId) |
| `quantity` | body | number | no | New quantity |
| `unit_price` | body | number | no | New unit price |
| `discount_percent` | body | number | no | New discount % |
| `deposit_percent` | body | number | no | New deposit % |
| `payment_status` | body | string | no | Payment lifecycle stage. Requires invoices:write scope. Values: unpaid, deposit_invoiced, invoiced, paid. |

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`