---
title: "Update a specific deal"
description: "PUT /deals/{deal_id} — Updates a deal. contact_id cannot be changed — a deal stays with its contact. expected_close_date applies to pending deals; close_date is set when the deal becomes won or lost."
canonical_url: https://developer.onepagecrm.com/api/reference/deals/put-deals-deal_id/
source: Markdown mirror of https://developer.onepagecrm.com/api/reference/deals/put-deals-deal_id/
---

`PUT /deals/{deal_id}`

Updates a deal. contact_id cannot be changed — a deal stays with its contact. expected_close_date applies to pending deals; close_date is set when the deal becomes won or lost.

Resource: [Deals](https://developer.onepagecrm.com/api/reference/deals/) · [API Reference](https://developer.onepagecrm.com/api/reference/)

## Request

```bash
curl -X PUT "https://app.onepagecrm.com/api/v3/deals/{deal_id}" \
  -u $user_id:$api_key \
  -H "Content-Type: application/json" \
  -d '{
    "contact_id": "5aaa9b059007ba08c9ebaf58",
    "owner_id": "5aba31e99007ba0f570c12f7",
    "pipeline_id": "5cfa87a4849d7873db082f98",
    "sales_pipeline_id": "5cfa87a4849d7873db082f98",
    "name": "Solar panels",
    "text": "Fingers crossed!",
    "stage": 50,
    "status": "pending",
    "expected_close_date": "2018-04-15",
    "close_date": "2018-04-15",
    "date": "2018-04-15",
    "amount": 99.99,
    "months": 1,
    "cost": 0,
    "commission_base": "amount",
    "commission_type": "none",
    "commission": 0,
    "commission_percentage": 0,
    "deal_fields": [
      {
        "deal_field": {
          "id": "5aad9b039007ba28c9ebad56"
        },
        "value": "Large"
      }
    ],
    "has_deal_items": true,
    "deal_items": [
      {
        "name": "Solar panels",
        "description": "Photovoltaic solar panels (2019 model)",
        "cost": 95,
        "price": 149.99,
        "qty": 2,
        "predefined_item_id": "5c6abf565481dd28ff1bc6a8"
      }
    ]
  }'
```

Authentication is HTTP Basic — `user_id` as username, `api_key` as password.
See https://developer.onepagecrm.com/api/authentication/.

## Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `deal_id` | string | Deal ID |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contact_id` | string (bson-id) |  | ID of the contact, to whom the deal belongs |
| `owner_id` | string (bson-id) |  | ID of the user, to whom the deal belongs. Defaults to the logged API user's ID. |
| `pipeline_id` | string (bson-id) |  | ID of a pipeline the deal belongs to |
| `sales_pipeline_id` | string (bson-id) |  | ID of a sales pipeline the deal belongs to |
| `name` | string |  | Name of the deal |
| `text` | string |  | Extra notes related to the deal (supports `[b]bold[/b]` and `[i]italic[/i]` formatting) |
| `stage` | integer (int32) |  | A numerical representation of the progress of a pending deal (number ranging from 0 to 100 exclusive) |
| `status` | string |  | Status of the deal |
| `expected_close_date` | string (date) |  | The date the deal is expected to close (status should be `pending`). Defaults to today's date. |
| `close_date` | string (date) |  | The date the deal actually closed (status should be `won` or `lost`). Defaults to today's date. |
| `date` | string (date) |  | Creation date of the deal. Defaults to today's date. |
| `amount` | number (float) |  | The monitary value of the deal (per month, if multi-month deal) |
| `months` | integer (int32) |  | Number of months the deal is to be paid for (1 for regular deals, 2+ for multi-month) |
| `cost` | number (float) |  | The monitary cost of the deal |
| `commission_base` | string |  | Base used to calculate the commission of the deal |
| `commission_type` | string |  | Type of commission for the deal |
| `commission` | number (float) |  | Commission payable for the deal |
| `commission_percentage` | number (float) |  | Commission percentage for the deal |
| `deal_fields` | array<object> |  | Extra user-configurable data fields for Deals. Only editable by admins. |
| `has_deal_items` | boolean |  | Must to be `true` to create or keep deal items (if `false`, deal items will be removed) |
| `deal_items` | array<object> |  | List of deal items associated with the deal |

## Responses

### 200

OK

```json
{
  "status": 0,
  "message": "OK",
  "timestamp": 1528373119,
  "data": {
    "deal": {
      "id": "5aaa9b059007ba08c9ebaf58",
      "contact_id": "5aaa9b059007ba08c9ebaf58",
      "owner_id": "5aba31e99007ba0f570c12f7",
      "pipeline_id": "5cfa87a4849d7873db082f98",
      "sales_pipeline_id": "5cfa87a4849d7873db082f98",
      "name": "Solar panels",
      "text": "Fingers crossed!",
      "stage": 50,
      "status": "pending",
      "expected_close_date": "2018-04-15",
      "close_date": "2018-04-15",
      "date": "2018-04-15",
      "amount": 99.99,
      "months": 1,
      "cost": 0,
      "margin": 99.99,
      "total_amount": 99.99,
      "total_cost": 0,
      "commission_base": "amount",
      "commission_type": "none",
      "commission": 0,
      "commission_percentage": 0,
      "reason_lost_id": "5aaa9b059007ba08c9ebaf58",
      "deal_fields": [
        {
          "deal_field": {
            "id": "5aad9b039007ba28c9ebad56",
            "name": "Deal size",
            "type": "select_box",
            "position": 2,
            "choices": [
              "Small",
              "Medium",
              "Large"
            ]
          },
          "value": "Large"
        }
      ],
      "has_deal_items": true,
      "deal_items": [
        {
          "id": "5c7973019007ba3f7519e86a",
          "name": "Solar panels",
          "description": "Photovoltaic solar panels (2019 model)",
          "cost": 95,
          "price": 149.99,
          "amount": 299.98,
          "qty": 2,
          "deal_id": "5aaa9b059007ba08c9ebaf58",
          "predefined_item_id": "5c6abf565481dd28ff1bc6a8",
          "position": 1,
          "created_at": "2019-03-01T17:59:29Z",
          "modified_at": "2019-03-01T17:59:29Z"
        }
      ],
      "author": "Jane D.",
      "has_related_notes": true,
      "attachments": [
        {
          "id": "5afc1ea9d556730b780096db",
          "filename": "mario.jpg",
          "custom_filename": "another_mario.jpg",
          "pinned": true,
          "pinned_at": "2022-01-24T10:42:39Z",
          "size": 3841,
          "storage_provider": "amazon",
          "url": "https://{foo.bar}/mario.jpg",
          "url_expires_at": "2018-05-16T13:06:53Z",
          "thumbnail": {
            "url": "https://{foo.bar}/mario-thumbnail.jpg"
          }
        }
      ],
      "contact_info": {
        "contact_name": "Joe Bloggs",
        "company": "Big Company Inc."
      },
      "owner": {
        "id": "5aba31e99007ba0f570c12f7",
        "name": "Joe Bloggs",
        "email": "joe.bloggs@example.com"
      },
      "previous_pipeline_stages": {
        "5da7b67a849d78737812437c": 40
      },
      "created_at": "2018-03-15T16:10:45Z",
      "modified_at": "2018-03-15T16:10:45Z",
      "linked_contacts": [
        {
          "id": "68b5edd78b3ee61b685c8692",
          "contact_name": "Sajed Almorsy",
          "company": "OnePageCRM",
          "photo_url": ""
        }
      ]
    }
  }
}
```

Standard error responses: 400, 401, 403, 404, 409, 500 — shared across the API. See https://developer.onepagecrm.com/api/errors/.

## Related guides

- [Authentication](https://developer.onepagecrm.com/api/authentication/)
- [Errors](https://developer.onepagecrm.com/api/errors/)
- [Rate limits](https://developer.onepagecrm.com/api/rate-limits/)
- [Partial updates](https://developer.onepagecrm.com/api/partial-updates/)
