# Update shipment address PUT https://sandbox-api.shipbob.com/2025-07/shipments/{shipmentId}:updateAddress Content-Type: application/json Updates the shipping address for a specific shipment. Reference: https://developer-stage.shipbob.dev/2025-07/api/shipments/update-shipment-address ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: api-2025-07 version: 1.0.0 paths: /2025-07/shipments/{shipmentId}:updateAddress: put: operationId: update-shipment-address summary: | Update shipment address description: | Updates the shipping address for a specific shipment. tags: - subpackage_shipments parameters: - name: shipmentId in: path description: '' required: true schema: type: integer - name: Authorization in: header description: Authentication using Personal Access Token (PAT) token required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Shipments.ShipmentApiResponse' requestBody: content: application/json: schema: $ref: '#/components/schemas/Shipments.UpdateAddressRequest' servers: - url: https://sandbox-api.shipbob.com components: schemas: Shipments.UpdateAddressRequest: type: object properties: city: type: string description: City of customer address company_name: type: - string - 'null' description: Company name (optional) country_code: type: - string - 'null' description: Country code of customer address email: type: - string - 'null' description: Customer's email address phone_number: type: - string - 'null' description: Phone number of Recipient address recipient_name: type: - string - 'null' description: Name of customer state: type: - string - 'null' description: State of customer address street_address1: type: string description: Street Address 1 street_address2: type: - string - 'null' description: Street Address 2 zip_code: type: - string - 'null' description: Zipcode of customer address required: - city - street_address1 title: Shipments.UpdateAddressRequest Shipments.ErrorCode: type: string enum: - INVALID_PARAMETER - VALIDATION_ERROR - DATABASE_UPDATE_ERROR - REPROCESSING_ERROR - DEALLOCATE_ERROR - NOT_FOUND - CONFLICT title: Shipments.ErrorCode Shipments.ErrorResponse: type: object properties: code: $ref: '#/components/schemas/Shipments.ErrorCode' message: type: - string - 'null' title: Shipments.ErrorResponse Shipments.ShipmentApiResponse: type: object properties: error: $ref: '#/components/schemas/Shipments.ErrorResponse' id: type: integer format: int64 is_success: type: boolean title: Shipments.ShipmentApiResponse securitySchemes: PAT: type: http scheme: bearer description: Authentication using Personal Access Token (PAT) token OAuth2: type: http scheme: bearer description: OAuth2 authentication using JWT tokens ``` ## SDK Code Examples ```python Shipments_updateShipmentAddress_example import requests url = "https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress" payload = { "city": "string", "street_address1": "string", "company_name": "string", "country_code": "string", "email": "string", "phone_number": "string", "recipient_name": "string", "state": "string", "street_address2": "string", "zip_code": "string" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Shipments_updateShipmentAddress_example const url = 'https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress'; const options = { method: 'PUT', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"city":"string","street_address1":"string","company_name":"string","country_code":"string","email":"string","phone_number":"string","recipient_name":"string","state":"string","street_address2":"string","zip_code":"string"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Shipments_updateShipmentAddress_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress" payload := strings.NewReader("{\n \"city\": \"string\",\n \"street_address1\": \"string\",\n \"company_name\": \"string\",\n \"country_code\": \"string\",\n \"email\": \"string\",\n \"phone_number\": \"string\",\n \"recipient_name\": \"string\",\n \"state\": \"string\",\n \"street_address2\": \"string\",\n \"zip_code\": \"string\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Shipments_updateShipmentAddress_example require 'uri' require 'net/http' url = URI("https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"city\": \"string\",\n \"street_address1\": \"string\",\n \"company_name\": \"string\",\n \"country_code\": \"string\",\n \"email\": \"string\",\n \"phone_number\": \"string\",\n \"recipient_name\": \"string\",\n \"state\": \"string\",\n \"street_address2\": \"string\",\n \"zip_code\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```java Shipments_updateShipmentAddress_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"city\": \"string\",\n \"street_address1\": \"string\",\n \"company_name\": \"string\",\n \"country_code\": \"string\",\n \"email\": \"string\",\n \"phone_number\": \"string\",\n \"recipient_name\": \"string\",\n \"state\": \"string\",\n \"street_address2\": \"string\",\n \"zip_code\": \"string\"\n}") .asString(); ``` ```php Shipments_updateShipmentAddress_example request('PUT', 'https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress', [ 'body' => '{ "city": "string", "street_address1": "string", "company_name": "string", "country_code": "string", "email": "string", "phone_number": "string", "recipient_name": "string", "state": "string", "street_address2": "string", "zip_code": "string" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Shipments_updateShipmentAddress_example using RestSharp; var client = new RestClient("https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress"); var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"city\": \"string\",\n \"street_address1\": \"string\",\n \"company_name\": \"string\",\n \"country_code\": \"string\",\n \"email\": \"string\",\n \"phone_number\": \"string\",\n \"recipient_name\": \"string\",\n \"state\": \"string\",\n \"street_address2\": \"string\",\n \"zip_code\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Shipments_updateShipmentAddress_example import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "city": "string", "street_address1": "string", "company_name": "string", "country_code": "string", "email": "string", "phone_number": "string", "recipient_name": "string", "state": "string", "street_address2": "string", "zip_code": "string" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.shipbob.com/2025-07/shipments/1:updateAddress")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```