# Update delivery

Endpoint to update delivery details, including the address and contact information of the delivery point, as well as other properties such as packages, tags, COD (cash on delivery), reference identifier, among others.

## Edit delivery data

> Endpoint that allows editing the data of one or multiple deliveries.

```json
{"openapi":"3.0.0","info":{"title":"Shippify Api","version":"1.0.0"},"servers":[{"url":"https://api.shippify.co","description":"Development server"}],"security":[{"Basic_Auth":[]}],"components":{"securitySchemes":{"Basic_Auth":{"type":"http","scheme":"basic"}},"schemas":{"editDropoff":{"successfulResponse":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"data":{"type":"object","description":"Information of additional processes created (if the delivery belongs to a route)","properties":{"jobs":{"description":"Identifier of the external process created","type":"string"}}}}},"request":{"type":"object","required":["deliveryIds","deliveryChanges"],"properties":{"deliveryIds":{"description":"List of delivery identifiers to be edited, up to 10 deliveries can be edited in a single request","type":"array","items":{"type":"string"}},"referenceIds":{"description":"List of reference identifiers of orders to be edited, up to 10 deliveries can be edited in a single request. If this property is used, do not include deliveryIds ","type":"array","items":{"type":"string"}},"deliveryChanges":{"description":"Changes to be made in the task","type":"object","properties":{"location":{"$ref":"#/components/schemas/delivery/location"},"contact":{"$ref":"#/components/schemas/delivery/contact"},"packages":{"description":"Packages information.","type":"array","items":{"$ref":"#/components/schemas/delivery/package"}},"cod":{"description":"Cash on delivery payment","type":"number","minimum":0},"referenceId":{"description":"External identifier of the delivery, can be the order number","type":"string","maxLength":40},"addTags":{"description":"Ids of digital tags to be added to the delivery","type":"array","items":{"type":"integer","minimum":1}},"removeTags":{"description":"Ids of digital tags to be removed from the delivery","type":"array","items":{"type":"integer","minimum":1}}}},"recalculatePrice":{"description":"Indicates whether to recalculate the price after modification (recommended)","type":"boolean"},"reorderRoute":{"description":"Indicates whether to reorder the route (if the delivery belongs to a route) after modification (recommended)","type":"boolean"},"recalculateCity":{"description":"Indicates whether to recalculate the city after modification (recommended)","type":"boolean"}}}},"Unauthenticated":{"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"delivery":{"location":{"description":"Address information of the pickup location of the delivery packages.","type":"object","required":["address"],"properties":{"address":{"description":"Delivery address.","type":"string"},"instructions":{"description":"Extra information about the address.","type":"string"},"lat":{"description":"Latitude of the pickup point.","type":"string"},"lng":{"description":"Longitude of the pickup point.","type":"string"}}},"contact":{"description":"Contact information of the person responsible for delivering the packages at the pickup warehouse.","type":"object","required":["name","email"],"properties":{"name":{"description":"Name of the responsible person.","type":"string"},"email":{"description":"Email of the responsible person.","type":"string","format":"email"},"phonenumber":{"description":"Phone number of the responsible person.","type":"string"}}},"package":{"type":"object","required":["name","qty","size"],"properties":{"id":{"type":"string","description":"Package identifier"},"name":{"type":"string","description":"Package name"},"qty":{"description":"Number of packages in the order (not the number of products inside the package).","type":"integer","minimum":0},"weight":{"description":"Unit weight * quantity in Kg","type":"number","minimum":0},"size":{"description":"Package size","type":"string","enum":["xs","s","m","l","xl"]},"price":{"description":"Unit price * quantity in the currency of the company","type":"number","minimum":0}}}}}},"paths":{"/v1/deliveries/dropoff":{"patch":{"tags":["Edit delivery"],"summary":"Edit delivery data","description":"Endpoint that allows editing the data of one or multiple deliveries.","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/editDropoff/successfulResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthenticated"}}}}},"requestBody":{"description":"Here goes the description","content":{"application/json":{"schema":{"$ref":"#/components/schemas/editDropoff/request"}}}}}}}}
```

## Use cases

<details>

<summary>Update delivery by its deliveryId</summary>

```json
{
    "deliveryIds": [
        "t-pruaas-4973"
    ],
    "reorderRoute": true,
    "recalculatePrice": true,
    "recalculateCity": false,
    "deliveryChanges": {
        "location": {
            "address": "av. echeñique 8861, 7860169 la reina, región metropolitana, chile",
            "instructions": "CLIENT PICKS UP THE PACKAGE AT DOOR 2",
            "lat": -23.557166,
            "lng": -46.664559
        },
        "contact": {
            "name": "Juan Perez",
            "email": "example@shippify.co"
        },
        "packages": [
            {
                "id": "SSSTP002",
                "name": "XIAOMI REDMI 10S",
                "size": 2,
                "price": 0,
                "weight": 5,
                "qty": 1
            }
        ],
        "cod": 10,
        "referenceId": "0987837468",
        "addTags":[1003],
        "removeTags": [],
        "extraData": [{"name":"Billing", "value":"0000-123-334"}]
    }
}
```

</details>

<details>

<summary>Update delivery by its referenceId</summary>

```json
{
    "referenceIds": [
        "0987837468"
    ],
    "reorderRoute": true,
    "recalculatePrice": true,
    "recalculateCity": false,
    "deliveryChanges": {
        "location": {
            "address": "av. echeñique 8861, 7860169 la reina, región metropolitana, chile",
            "instructions": "CLIENT PICKS UP THE PACKAGE AT DOOR 2",
            "lat": -23.557166,
            "lng": -46.664559
        },
        "contact": {
            "name": "Juan Perez",
            "email": "example@shippify.co"
        },
        "packages": [
            {
                "id": "SSSTP002",
                "name": "XIAOMI REDMI 10S",
                "size": 2,
                "price": 0,
                "weight": 5,
                "qty": 1
            }
        ],
        "cod": 10,
        "referenceId": "0987837468",
        "addTags":[1003],
        "removeTags": [],
        "extraData": [{"name":"Billing", "value":"0000-123-334"}]
    }
}
```

</details>

<details>

<summary>Update recipient details</summary>

```json
{
    "deliveryIds": [
        "t-pruaas-4973"
    ],
    "deliveryChanges": {
        "contact": {
            "name": "Juan Perez",
            "email": "example@shippify.co"
        }
    }
}
```

</details>

<details>

<summary>Update delivery address</summary>

```json
{
    "deliveryIds": [
        "t-pruaas-4973"
    ],
    "deliveryChanges": {
        "location": {
            "address": "av. echeñique 8861, 7860169 la reina, región metropolitana, chile",
            "instructions": "CLIENTE RETIRA PRODUCTOS EN POLICENTRO 2",
            "lat": -23.557166,
            "lng": -46.664559
        }
    }
}
```

</details>

<details>

<summary>Update tags</summary>

```json
{
    "deliveryIds": [
        "t-pruaas-4973"
    ],
    "deliveryChanges": {
        "addTags":[1003],
        "removeTags": []
    }
}
```

</details>

<details>

<summary>Update referenceId</summary>

```json
{
    "deliveryIds": [
        "t-pruaas-4973"
    ],
    "deliveryChanges": {
        "referenceId": "0987837468"
    }
}
```

</details>

<details>

<summary>Update delivery packages</summary>

```json
{
    "deliveryIds": [
        "t-pruaas-4973"
    ],
    "deliveryChanges": {
       "packages": [
            {
                "id": "SSSTP002",
                "name": "XIAOMI REDMI 10S",
                "size": 2,
                "price": 0,
                "weight": 5,
                "qty": 1
            }
        ]
    }
}
```

</details>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shippify.co/developers/en/shippify-api/deliveries/update-delivery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
