> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Update Sale

- Component: `appmixer.superoffice.core.UpdateSale`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.superoffice 1.2.0](https://connectors.appmixer.com/connector/appmixer.superoffice/1.2.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.superoffice/1.2.0/component/appmixer.superoffice.core.UpdateSale>

Update a sale. Only the fields you fill in are changed.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Sale ID (`saleId`) | text | The ID of the sale. Use Find Sales to look it up. |
| Heading (`heading`) | text | Short description of the sale. |
| Company ID (`companyId`) | text | The ID of the company (SuperOffice contact). Use Find Companies to look it up. |
| Person ID (`personId`) | text | The contact person of the sale. Use Find Persons to look it up. |
| Project ID (`projectId`) | text | The project the sale belongs to. Use Find Projects to look it up. |
| Amount (`amount`) | number | Total sale amount. |
| Sale Date (`saleDate`) | date-time | Expected (or won/lost) date of the sale. |
| Probability (`probability`) | number | Probability in percent, 0 to 100. |
| Sale Type (`saleTypeId`) | text | Pick a sale type, or type its ID. |
| Status (`status`) | select | Change the status of the sale. |
| Description (`description`) | textarea | Text describing the sale. |
| Time Zone (`timeZone`) | text | Optional. The time zone of your SuperOffice tenant, for example Europe/Oslo. SuperOffice keeps date-times in the local time of the tenant; the time zone is detected automatically (reliably for European tenants) and this setting overrides it. Date-times the component returns are always in UTC. |

## Output ports

### Port `out`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.superoffice.core.UpdateSale",
  "label": "Update Sale",
  "description": "Update a sale. Only the fields you fill in are changed.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:superoffice"
  },
  "quota": {
    "manager": "appmixer:superoffice",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "saleId": {
            "type": "string"
          },
          "heading": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "personId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "saleDate": {
            "type": "string",
            "format": "date-time"
          },
          "probability": {
            "type": "integer"
          },
          "saleTypeId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "Open",
              "Sold",
              "Lost",
              "Stalled"
            ]
          },
          "description": {
            "type": "string"
          },
          "timeZone": {
            "type": "string"
          }
        },
        "required": [
          "saleId"
        ]
      },
      "inspector": {
        "inputs": {
          "saleId": {
            "type": "text",
            "index": 1,
            "label": "Sale ID",
            "tooltip": "The ID of the sale. Use Find Sales to look it up."
          },
          "heading": {
            "type": "text",
            "index": 2,
            "label": "Heading",
            "tooltip": "Short description of the sale."
          },
          "companyId": {
            "type": "text",
            "index": 3,
            "label": "Company ID",
            "tooltip": "The ID of the company (SuperOffice contact). Use Find Companies to look it up."
          },
          "personId": {
            "type": "text",
            "index": 4,
            "label": "Person ID",
            "tooltip": "The contact person of the sale. Use Find Persons to look it up."
          },
          "projectId": {
            "type": "text",
            "index": 5,
            "label": "Project ID",
            "tooltip": "The project the sale belongs to. Use Find Projects to look it up."
          },
          "amount": {
            "type": "number",
            "index": 6,
            "label": "Amount",
            "tooltip": "Total sale amount."
          },
          "saleDate": {
            "type": "date-time",
            "index": 7,
            "label": "Sale Date",
            "tooltip": "Expected (or won/lost) date of the sale."
          },
          "probability": {
            "type": "number",
            "index": 8,
            "label": "Probability",
            "tooltip": "Probability in percent, 0 to 100."
          },
          "saleTypeId": {
            "type": "text",
            "index": 9,
            "label": "Sale Type",
            "tooltip": "Pick a sale type, or type its ID.",
            "source": {
              "url": "/component/appmixer/superoffice/core/ListListItems?outPort=out",
              "data": {
                "properties": {
                  "isSource": true,
                  "listName": "SaleType"
                },
                "transform": "./ListListItems#toSelectArray"
              }
            }
          },
          "status": {
            "type": "select",
            "index": 10,
            "label": "Status",
            "tooltip": "Change the status of the sale.",
            "options": [
              {
                "label": "Open",
                "value": "Open"
              },
              {
                "label": "Sold",
                "value": "Sold"
              },
              {
                "label": "Lost",
                "value": "Lost"
              },
              {
                "label": "Stalled",
                "value": "Stalled"
              }
            ]
          },
          "description": {
            "type": "textarea",
            "index": 11,
            "label": "Description",
            "tooltip": "Text describing the sale."
          },
          "timeZone": {
            "type": "text",
            "index": 12,
            "label": "Time Zone",
            "tooltip": "Optional. The time zone of your SuperOffice tenant, for example Europe/Oslo. SuperOffice keeps date-times in the local time of the tenant; the time zone is detected automatically (reliably for European tenants) and this setting overrides it. Date-times the component returns are always in UTC.",
            "source": {
              "url": "/component/appmixer/superoffice/core/ListTimeZones?outPort=out",
              "data": {
                "transform": "./ListTimeZones#toSelectArray"
              }
            }
          }
        }
      }
    }
  ],
  "outPorts": [
    "out"
  ],
  "icon": "(data URI omitted)"
}
```
