# Edit an existing address

> Edit an existing address on the shopper's account. This does not edit addresses that are already associated with other resources, such as transactions or shipments.

Source: https://help.boltapp.com/api-reference/embeddable-checkout-v3/account/accountaddressedit

`PUT /account/addresses/{id}`

## OpenAPI definition

This endpoint as it appears in the OpenAPI document, with every schema it references included.

```json
{
  "openapi": "3.2.0",
  "info": {
    "version": "3.3.22",
    "title": "Bolt API Reference",
    "description": "A comprehensive Bolt API reference for interacting with Accounts, Payments, Orders and more.",
    "termsOfService": "https://www.boltapp.com/end-user-terms",
    "contact": {
      "name": "Bolt",
      "email": "merchantsupport@boltapp.com",
      "url": "https://help.boltapp.com/api-bolt/"
    }
  },
  "servers": [
    {
      "url": "https://{environment}.boltapp.com/v3",
      "variables": {
        "environment": {
          "enum": [
            "api",
            "api-sandbox"
          ],
          "default": "api-sandbox"
        }
      }
    }
  ],
  "paths": {
    "/account/addresses/{id}": {
      "put": {
        "summary": "Edit an existing address",
        "operationId": "accountAddressEdit",
        "x-speakeasy-name-override": "UpdateAddress",
        "description": "Edit an existing address on the shopper's account. This does not edit addresses that are already associated with other resources, such as transactions or shipments.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "oauth": [
              "bolt.account.manage"
            ],
            "api-key": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/x-publishable-key"
          },
          {
            "$ref": "#/components/parameters/x-merchant-client-id"
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "examples": [
                "D4g3h5tBuVYK9"
              ]
            },
            "required": true,
            "description": "The ID of the address to edit"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/address-listing"
              },
              "examples": {
                "address-all-fields": {
                  "$ref": "#/components/examples/address-all-fields"
                },
                "address-some-fields": {
                  "$ref": "#/components/examples/address-some-fields"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The address was successfully edited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/address-listing"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/response-address-error"
          },
          "default": {
            "$ref": "#/components/responses/response-default"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "x-publishable-key": {
        "description": "The publicly shareable identifier used to identify your Bolt merchant division.",
        "in": "header",
        "name": "X-Publishable-Key",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "x-merchant-client-id": {
        "description": "A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with `Bolt.state.merchantClientId` in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics.",
        "in": "header",
        "name": "X-Merchant-Client-Id",
        "required": false,
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "address-listing": {
        "type": "object",
        "description": "An address saved on an account, i.e. a physical address plus any additional account-specific metadata.",
        "required": [
          "first_name",
          "last_name",
          "street_address1",
          "locality",
          "postal_code",
          "country_code"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "id",
            "description": "The address's unique identifier.",
            "readOnly": true,
            "x-order": 1,
            "examples": [
              "D4g3h5tBuVYK9"
            ]
          },
          "first_name": {
            "type": "string",
            "description": "The first name of the person associated with this address.",
            "x-order": 2,
            "examples": [
              "Alice"
            ]
          },
          "last_name": {
            "type": "string",
            "description": "The last name of the person associated with this address.",
            "x-order": 3,
            "examples": [
              "Baker"
            ]
          },
          "company": {
            "type": "string",
            "description": "The company associated with this address.",
            "x-order": 4,
            "examples": [
              "ACME Corporation"
            ]
          },
          "street_address1": {
            "type": "string",
            "description": "The street address associated with this address.",
            "x-order": 5,
            "examples": [
              "535 Mission St, Ste 1401"
            ]
          },
          "street_address2": {
            "type": "string",
            "description": "Any additional, optional, street address information associated with this address.",
            "x-order": 6,
            "examples": [
              "c/o Shipping Department"
            ]
          },
          "locality": {
            "type": "string",
            "description": "The locality (e.g. city, town, etc...) associated with this address.",
            "x-order": 7,
            "examples": [
              "San Francisco"
            ]
          },
          "postal_code": {
            "type": "string",
            "description": "The postal code associated with this address.",
            "x-order": 8,
            "examples": [
              "94105"
            ]
          },
          "region": {
            "type": "string",
            "description": "The region or administrative area (e.g. state, province, county, etc...) associated with this address.",
            "x-order": 9,
            "examples": [
              "CA"
            ]
          },
          "country_code": {
            "$ref": "#/components/schemas/country-code"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The email address associated with this address.",
            "x-order": 11,
            "examples": [
              "alice@example.com"
            ]
          },
          "phone": {
            "type": "string",
            "format": "phone",
            "description": "The phone number associated with this address.",
            "x-oapi-codegen-extra-tags": {
              "validate": "phone=strict"
            },
            "x-order": 12,
            "examples": [
              "+14155550199"
            ]
          },
          "is_default": {
            "type": "boolean",
            "description": "Whether or not this is the default address saved.",
            "readOnly": true,
            "examples": [
              true
            ]
          }
        }
      },
      "country-code": {
        "type": "string",
        "description": "The country (in its ISO 3166 alpha-2 format) associated with this address.",
        "enum": [
          "AF",
          "AX",
          "AL",
          "DZ",
          "AS",
          "AD",
          "AO",
          "AI",
          "AQ",
          "AG",
          "AR",
          "AM",
          "AW",
          "AU",
          "AT",
          "AZ",
          "BH",
          "BS",
          "BD",
          "BB",
          "BY",
          "BE",
          "BZ",
          "BJ",
          "BM",
          "BT",
          "BO",
          "BQ",
          "BA",
          "BW",
          "BV",
          "BR",
          "IO",
          "BN",
          "BG",
          "BF",
          "BI",
          "KH",
          "CM",
          "CA",
          "CV",
          "KY",
          "CF",
          "TD",
          "CL",
          "CN",
          "CX",
          "CC",
          "CO",
          "KM",
          "CG",
          "CD",
          "CK",
          "CR",
          "CI",
          "HR",
          "CU",
          "CW",
          "CY",
          "CZ",
          "DK",
          "DJ",
          "DM",
          "DO",
          "EC",
          "EG",
          "SV",
          "GQ",
          "ER",
          "EE",
          "ET",
          "FK",
          "FO",
          "FJ",
          "FI",
          "FR",
          "GF",
          "PF",
          "TF",
          "GA",
          "GM",
          "GE",
          "DE",
          "GH",
          "GI",
          "GR",
          "GL",
          "GD",
          "GP",
          "GU",
          "GT",
          "GG",
          "GN",
          "GW",
          "GY",
          "HT",
          "HM",
          "VA",
          "HN",
          "HK",
          "HU",
          "IS",
          "IN",
          "ID",
          "IR",
          "IQ",
          "IE",
          "IM",
          "IL",
          "IT",
          "JM",
          "JP",
          "JE",
          "JO",
          "KZ",
          "KE",
          "KI",
          "KP",
          "KR",
          "KW",
          "KG",
          "LA",
          "LV",
          "LB",
          "LS",
          "LR",
          "LY",
          "LI",
          "LT",
          "LU",
          "MO",
          "MK",
          "MG",
          "MW",
          "MY",
          "MV",
          "ML",
          "MT",
          "MH",
          "MQ",
          "MR",
          "MU",
          "YT",
          "MX",
          "FM",
          "MD",
          "MC",
          "MN",
          "ME",
          "MS",
          "MA",
          "MZ",
          "MM",
          "NA",
          "NR",
          "NP",
          "NL",
          "NC",
          "NZ",
          "NI",
          "NE",
          "NG",
          "NU",
          "NF",
          "MP",
          "NO",
          "OM",
          "PK",
          "PW",
          "PS",
          "PA",
          "PG",
          "PY",
          "PE",
          "PH",
          "PN",
          "PL",
          "PT",
          "PR",
          "QA",
          "RE",
          "RO",
          "RU",
          "RW",
          "BL",
          "SH",
          "KN",
          "LC",
          "MF",
          "PM",
          "VC",
          "WS",
          "SM",
          "ST",
          "SA",
          "SN",
          "RS",
          "SC",
          "SL",
          "SG",
          "SX",
          "SK",
          "SI",
          "SB",
          "SO",
          "ZA",
          "GS",
          "SS",
          "ES",
          "LK",
          "SD",
          "SR",
          "SJ",
          "SZ",
          "SE",
          "CH",
          "SY",
          "TW",
          "TJ",
          "TZ",
          "TH",
          "TL",
          "TG",
          "TK",
          "TO",
          "TT",
          "TN",
          "TR",
          "TM",
          "TC",
          "TV",
          "UG",
          "UA",
          "AE",
          "GB",
          "US",
          "UM",
          "UY",
          "UZ",
          "VU",
          "VE",
          "VN",
          "VG",
          "VI",
          "WF",
          "EH",
          "YE",
          "ZM",
          "ZW"
        ],
        "x-oapi-codegen-extra-tags": {
          "validate": "country,required"
        },
        "x-order": 11,
        "examples": [
          "US"
        ]
      },
      "error": {
        "type": "object",
        "required": [
          ".tag",
          "message"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "unauthorized",
              "forbidden",
              "unprocessable_request",
              "not_found"
            ],
            "description": "The type of error returned",
            "examples": [
              "unprocessable_request"
            ]
          },
          "message": {
            "type": "string",
            "description": "A human-readable error message, which might include information specific to the request that was made.",
            "examples": [
              "We were unable to process your request."
            ]
          }
        }
      },
      "field-error": {
        "type": "object",
        "description": "An error that pertains to validation of a specific field in the request.",
        "required": [
          ".tag",
          "message",
          "field"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "invalid_input_parameter"
            ],
            "description": "The type of error returned",
            "examples": [
              "invalid_input_parameter"
            ]
          },
          "message": {
            "type": "string",
            "description": "A human-readable error message, which might include information specific to the request that was made.",
            "examples": [
              "We were unable to process your request."
            ]
          },
          "field": {
            "type": "string",
            "description": "The field (in its hierarchical form) that is failing validation.",
            "examples": [
              "address.phone"
            ]
          }
        }
      }
    },
    "examples": {
      "address-all-fields": {
        "summary": "A sample address where all fields, including optional fields, are set",
        "value": {
          "first_name": "Alice",
          "last_name": "Baker",
          "company": "ACME Corporation",
          "street_address1": "535 Mission St, Ste 1401",
          "street_address2": "c/o Shipping Department",
          "locality": "San Francisco",
          "postal_code": "94105",
          "region": "CA",
          "country_code": "US",
          "email": "alice@example.com",
          "phone": "+14155550199",
          "is_default": true
        }
      },
      "address-some-fields": {
        "summary": "A sample address where only required fields are set",
        "value": {
          "first_name": "Jean",
          "last_name": "Blanc",
          "street_address1": "77 Rue Frédéric Chopin",
          "locality": "Versailles",
          "postal_code": "78000",
          "country_code": "FR"
        }
      }
    },
    "responses": {
      "response-address-error": {
        "description": "The address is invalid and cannot be added, or some other error has occurred",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/error"
                },
                {
                  "$ref": "#/components/schemas/field-error"
                }
              ]
            },
            "examples": {
              "missing-input": {
                "summary": "A required field is missing",
                "value": {
                  ".tag": "invalid_input_parameter",
                  "field": "country_code",
                  "message": "country_code must be populated"
                }
              },
              "invalid-input": {
                "summary": "A field has a malformed value that does not conform to the schema",
                "value": {
                  ".tag": "invalid_input_parameter",
                  "field": "country_code",
                  "message": "country_code format is invalid"
                }
              },
              "invalid-postal-code": {
                "summary": "The postal code is invalid",
                "value": {
                  ".tag": "invalid_input_parameter",
                  "field": "postal_code",
                  "message": "postal code 94404 is invalid for country CA"
                }
              },
              "invalid-region": {
                "summary": "The region is missing or is invalid",
                "value": {
                  ".tag": "invalid_input_parameter",
                  "field": "region",
                  "message": "region BC is invalid for country US"
                }
              }
            }
          }
        }
      },
      "response-default": {
        "description": "An error has occurred, and no further details are provided (e.g. 5xx errors)"
      }
    },
    "securitySchemes": {
      "api-key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "oauth": {
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "/v1/oauth/authorize",
            "refreshUrl": "/v1/oauth/token",
            "tokenUrl": "/v1/oauth/token",
            "scopes": {
              "bolt.account.manage": "This scope grants permissions to perform read/edit/delete actions on Bolt Account data",
              "bolt.account.view": "This scope grants permissions to perform read only actions on Bolt Account data",
              "openid": "This scope grants permissions that enable Bolt Single Sign-On (SSO) by granting a JSON Web Token (JWT) that stores account data."
            }
          }
        },
        "type": "oauth2"
      }
    }
  }
}
```
