> For the complete documentation index, see [llms.txt](https://help.orderdesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.orderdesk.com/api-documentation/v2-api-reference/shipments/update-shipment.md).

# Update Shipment

Replaces a shipment. This can be used to correct a tracking number, or to record a cost once the carrier has billed for it.

{% hint style="warning" %}
The complete shipment must be passed. Any fields left out will be updated as blank.
{% endhint %}

```json
{"openapi":"3.0.3","info":{"title":"Order Desk API","version":"2.0"},"tags":[{"name":"Shipments"}],"servers":[{"url":"https://app.orderdesk.me/api/v2","description":"Production"}],"security":[{"OrderDeskStoreId":[],"OrderDeskApiKey":[]}],"components":{"securitySchemes":{"OrderDeskStoreId":{"type":"apiKey","in":"header","name":"ORDERDESK-STORE-ID","description":"Your store ID, found under Store Settings on the API tab."}},"schemas":{"ShipmentWrite":{"allOf":[{"$ref":"#/components/schemas/ShipmentFields"}]},"ShipmentFields":{"type":"object","properties":{"tracking_number":{"type":"string","description":"Carrier-assigned tracking number. Use `n/a` if no tracking number is applicable.\n"},"carrier_code":{"type":"string","description":"Carrier code such as `USPS` or `FedEx`, when available."},"shipment_method":{"type":"string","description":"Shipping service name, such as `First Class International`."},"weight":{"type":"number","format":"double","description":"Final shipment weight."},"cost":{"type":"number","format":"double","description":"Your cost to send the shipment."},"status":{"type":"string","description":"Current shipment status, used by the EasyPost webhook."},"tracking_url":{"type":"string","description":"If omitted, Order Desk attempts to determine it from the tracking number format and\ncarrier code.\n"}}},"ResponseEnvelope":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["success","error"],"description":"Either `success` or `error`."},"message":{"type":"string","description":"Describes the result. Always present when an error occurs."},"execution_time":{"type":"string","description":"Time taken to process the request."}}}},"responses":{"BadRequest":{"description":"The request was rejected. `message` names the problem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseEnvelope"}}}},"Unauthorized":{"description":"Authentication failed. See the Authentication guide, and\nnote that an invalid store ID blocks your store rather than simply\nfailing the request.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseEnvelope"}}}},"NotFound":{"description":"No record matches that ID in your store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseEnvelope"}}}},"RateLimited":{"description":"You are sending too fast. Wait `X-Retry-After` seconds. See\nthe Rate Limits guide.\n","headers":{"X-Tokens-Remaining":{"description":"Number of request tokens currently available.","schema":{"type":"integer"}},"X-Retry-After":{"description":"Seconds to wait before requests can resume.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseEnvelope"}}}},"Error":{"description":"The request could not be completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseEnvelope"}}}}}},"paths":{"/orders/{order_id}/shipments/{shipment_id}":{"put":{"tags":["Shipments"],"summary":"Update Shipment","description":"Replaces a shipment. This can be used to correct a tracking number, or to record\na cost once the carrier has billed for it.\n\n{% hint style=\"warning\" %}\nThe complete shipment must be passed. Any fields left out will be updated as\nblank.\n{% endhint %}\n","operationId":"updateShipment","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentWrite"}}}},"responses":{"200":{"description":"The shipment was updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseEnvelope"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}}}}
```


---

# 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 dynamically by asking a question.

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

```
GET https://help.orderdesk.com/api-documentation/v2-api-reference/shipments/update-shipment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
