> For the complete documentation index, see [llms.txt](https://dev.ropo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ropo.com/guides/general-add-ons/update-addresses-of-open-sales-invoices.md).

# Update addresses of open sales invoices

Update addresses for unpaid invoices using a customer number and order number or contract number

Send a `PATCH` request to `/jobs/opensalesinvoices`. Use `custnum` and `ordernumber` or `contractnum` as query parameters to identify the invoices.

[View the Swagger documentation](https://rc.ropo24.fi/swagger/#/jobs/patchOpenSalesInvoicesAction).

### Request

Send the new address in the `addaddress` array.

```json
{
  "addaddress": [
    {
      "address": "Kuninkaankatu 15",
      "city": "KUOPIO",
      "addressaddline1": "Johto",
      "addressaddline2": "PL 43",
      "addressaddline3": "C/O Mauno Mansikka",
      "addresstype": "1",
      "person": "Tauno Testaaja",
      "company": "Toiminimi Testaaja",
      "addresscountry": "FIN",
      "postcode": "70100",
      "custnum": "123456",
      "govid": "123456-7",
      "vatid": "FI1234567",
      "customertype": "1",
      "email": "name@domain.fi",
      "phone": "+3581234567",
      "sitecode": "123456",
      "contactperson": "Liisa Assistentti",
      "countryname": "Sweden"
    }
  ]
}
```

### Address fields

| Field                               | Required          | Description                                        |
| ----------------------------------- | ----------------- | -------------------------------------------------- |
| `address`                           | Yes               | Street address.                                    |
| `city`                              | Yes               | City or locality.                                  |
| `postcode`                          | Yes               | Postal code.                                       |
| `addresstype`                       | Yes when updating | Address type. Omit it to create a new address.     |
| `customertype`                      | Yes               | `1` for a company or `2` for a consumer.           |
| `company`                           | For companies     | Company name. Required when `customertype` is `1`. |
| `person`                            | For consumers     | Person name. Required when `customertype` is `2`.  |
| `addressaddline1`–`addressaddline3` | No                | Additional address lines.                          |
| `addresscountry`                    | No                | Three-letter ISO country code.                     |
| `custnum`                           | No                | Customer number.                                   |
| `govid`                             | No                | Business ID or personal identifier.                |
| `vatid`                             | No                | VAT identifier.                                    |
| `email`                             | No                | Email address.                                     |
| `phone`                             | No                | Phone number.                                      |
| `contactperson`                     | No                | Contact person.                                    |
| `countryname`                       | No                | Country name.                                      |

### Address types

| Value | Type                |
| ----- | ------------------- |
| `1`   | Mailing address     |
| `2`   | Delivery address    |
| `3`   | Invoicing address   |
| `4`   | C/O address         |
| `5`   | C/O debtor address  |
| `6`   | Other               |
| `7`   | Usage place address |

### Response

A successful update returns `200` and the affected invoices.

```json
{
  "opensalesinvoices": [
    {
      "jobid": "1258",
      "billnum": "887552"
    }
  ]
}
```

| Status | Meaning                                                        |
| ------ | -------------------------------------------------------------- |
| `200`  | Addresses were updated or added.                               |
| `204`  | The request was accepted, but no matching address was updated. |
| `400`  | Invalid request.                                               |
| `401`  | Authentication failed.                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dev.ropo.com/guides/general-add-ons/update-addresses-of-open-sales-invoices.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
