> ## Documentation Index
> Fetch the complete documentation index at: https://exsited.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace an address

> Rewrites one address and returns the account.

Send the address under a singular `address`. `address_line_1` and `country` are required.

> [!NOTE]
>
> The SDK samples get their client from credentials your app registers once when it starts, as shown in [Authentication](https://exsited.mintlify.site/authentication.md#set-up-a-client). To try the call here, click **Try it**, set `host` to your Exsited API host name and paste an access token from [Get an access token](https://exsited.mintlify.site/api-reference/authentication/get-an-access-token.md). To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its `-d` payload.


## OpenAPI

````yaml PUT /accounts/{account_id}/addresses/{address_id}
openapi: 3.1.0
info:
  title: Exsited API
  version: v4
servers:
  - url: https://{host}/api/v4
    variables:
      host:
        default: your-api-host.example.com
        description: Your Exsited API host name, without https://.
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Accounts
  - name: Account emails
  - name: Account groups
  - name: Communications
  - name: Communication profiles
  - name: Orders
  - name: Quote orders
  - name: Express
  - name: Usages
  - name: Sales reps
  - name: Gift certificates
  - name: Invoices
  - name: Pro-forma invoices
  - name: Payments
  - name: Refunds
  - name: Credit notes
  - name: Credit note applications
  - name: Reconciliations
  - name: Items
  - name: Inventory adjustments
  - name: Units of measurement
  - name: Zones
  - name: Shipping packages
  - name: Shipping rules
  - name: Fulfillment profiles
  - name: Fulfillment terms
  - name: Item fulfillments
  - name: Item receipts
  - name: Bookings
  - name: Rental assets
  - name: Return merchandise authorisations
  - name: Purchase orders
  - name: Purchase invoices
  - name: Purchase payments
  - name: Purchase refunds
  - name: Purchase credit notes
  - name: Purchase credit note applications
  - name: Purchase express
  - name: Return vendor authorizations
  - name: ABA files
  - name: Receive terms
  - name: Labours
  - name: Tasks
  - name: Timesheets
  - name: Milestones
  - name: Employees
  - name: Departments
  - name: Designations
  - name: Teams
  - name: Time periods
  - name: Workflows
  - name: Workflow settings
  - name: Events
  - name: Custom events
  - name: System events
  - name: Approvals
  - name: Approval profiles
  - name: Approval user groups
  - name: Alerts
  - name: Alert responsibility settings
  - name: Alert responsibilities
  - name: Action scripts
  - name: Note groups
  - name: Note attachments
  - name: Instance settings
  - name: Accounting codes
  - name: Additional codes
  - name: Billing periods
  - name: Charging periods
  - name: Pricing periods
  - name: Invoice terms
  - name: Days of the month
  - name: Countries
  - name: Salutations
  - name: Document templates
  - name: Email templates
  - name: Roles
  - name: Operators
  - name: Operator groups
  - name: User settings
  - name: Custom attributes
  - name: Custom components
  - name: Custom features
  - name: Custom fields
  - name: Custom forms
  - name: Attribute attachments
  - name: Portal
  - name: Integration connections
  - name: External databases
  - name: Reports
  - name: Applications
  - name: Organisation
  - name: Child organisations
  - name: Webhooks
paths:
  /accounts/{account_id}/addresses/{address_id}:
    put:
      tags:
        - Accounts
      summary: Replace an address
      description: >-
        Send the address under a singular `address`. `address_line_1` and
        `country` are required.
      operationId: accounts_replace_account_address
      parameters:
        - name: account_id
          in: path
          required: true
          description: The account's `id`, such as `ACC0001`. Not its `uuid`.
          schema:
            type: string
        - name: address_id
          in: path
          required: true
          description: The address's `addr_` id.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - address
              properties:
                address:
                  type: object
                  required:
                    - address_line_1
                    - country
                  properties:
                    address_line_1:
                      type: string
                      description: The first address line.
                    address_line_2:
                      type: string
                    address_line_3:
                      type: string
                    address_line_4:
                      type: string
                    address_line_5:
                      type: string
                    city:
                      type: string
                    state:
                      type: string
                      description: The state's name, not an id.
                    country:
                      type: string
                      description: The country's name, not an id.
                    post_code:
                      type: string
                      description: The postcode. Reads back as `postal_code`.
                    default_billing:
                      type: boolean
                    default_shipping:
                      type: boolean
            example:
              address:
                address_line_1: 1 Example Street
                country: Australia
                city: Adelaide
                post_code: '5000'
      responses:
        '200':
          description: The account, under `account`, with the change applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountResponse'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -X PUT
            "$EXSITED_BASE_URL/api/v4/accounts/ACC0001/addresses/addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c"
            \
              -H "Authorization: Bearer $ACCESS_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "address": {
                  "address_line_1": "1 Example Street",
                  "country": "Australia",
                  "city": "Adelaide",
                  "post_code": "5000"
                }
              }'
        - lang: python
          label: Python
          source: |
            from exsited import build_client

            client = build_client()

            response = client.accounts.replace_account_address(
                "ACC0001",
                "addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c",
                {
                    "address": {
                        "address_line_1": "1 Example Street",
                        "country": "Australia",
                        "city": "Adelaide",
                        "post_code": "5000",
                    }
                },
            )
            print(response.data)
        - lang: javascript
          label: JavaScript
          source: >
            import {buildClient} from 'exsited';


            const client = await buildClient();


            const response = await
            client.accounts.replaceAccountAddress('ACC0001',
            'addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c', {
                address: {address_line_1: '1 Example Street', country: 'Australia', city: 'Adelaide', post_code: '5000'},
            });

            console.log(response.data);
        - lang: php
          label: PHP
          source: |
            use Exsited\Client\ClientRegistry;

            $client = ClientRegistry::buildClient();

            $response = $client->accounts->replaceAccountAddress(
                'ACC0001',
                'addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c',
                [
                    'address' => [
                        'address_line_1' => '1 Example Street',
                        'country' => 'Australia',
                        'city' => 'Adelaide',
                        'post_code' => '5000',
                    ],
                ],
            );
            print_r($response->data);
        - lang: java
          label: Java
          source: >
            import com.exsited.client.ApiResponse;

            import com.exsited.client.ClientRegistry;

            import com.exsited.client.ExsitedClient;

            import
            com.exsited.resources.accounts.accounts_dto.AccountsDto.Account;

            import java.util.Map;


            ExsitedClient client = ClientRegistry.buildClient();


            ApiResponse<Account> response =
            client.accounts().replaceAccountAddress(
                    "ACC0001",
                    "addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c",
                    Map.of(
                            "address", Map.of(
                                    "address_line_1", "1 Example Street",
                                    "country", "Australia",
                                    "city", "Adelaide",
                                    "post_code", "5000")));
            System.out.println(response.getMap());
        - lang: csharp
          label: .NET
          source: |
            using Exsited.Client;

            await using var client = ExsitedClient.BuildClient();

            var response = await client.Accounts.ReplaceAccountAddressAsync(
                "ACC0001",
                "addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c",
                new Dictionary<string, object?>
                {
                    ["address"] = new Dictionary<string, object?>
                    {
                        ["address_line_1"] = "1 Example Street",
                        ["country"] = "Australia",
                        ["city"] = "Adelaide",
                        ["post_code"] = "5000",
                    },
                });

            Console.WriteLine(response.Json);
        - lang: dart
          label: Dart
          source: |
            import 'package:exsited/exsited.dart';

            final client = buildClient();

            final response = await client.accounts.replaceAccountAddress(
              'ACC0001',
              'addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c',
              {
                'address': {
                  'address_line_1': '1 Example Street',
                  'country': 'Australia',
                  'city': 'Adelaide',
                  'post_code': '5000',
                },
              },
            );
            print(response.map);
        - lang: go
          label: Go
          source: "import (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\texsited \"github.com/exsited/exsited-sdk-go/v4\"\n)\n\nclient, err := exsited.BuildClient(nil)\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer client.Close()\n\nresponse, err := client.Accounts().ReplaceAccountAddress(context.Background(), \"ACC0001\", \"addr_2c9e7a1b4d6f4e8a9b3c5d7e1f2a4b6c\", map[string]any{\n\t\"address\": map[string]any{\n\t\t\"address_line_1\": \"1 Example Street\",\n\t\t\"country\":        \"Australia\",\n\t\t\"city\":           \"Adelaide\",\n\t\t\"post_code\":      \"5000\",\n\t},\n}, nil)\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Println(response.Map)\n"
components:
  schemas:
    AccountResponse:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/Account'
      description: The account, under `account`.
    Account:
      type: object
      description: One account.
      properties:
        object:
          type: string
        id:
          type: string
          description: The short code every path takes, such as `ACC0001`.
        name:
          type: string
        status:
          type: string
          description: >-
            The account's status, in lower case, such as `active`, or `inactive`
            once cancelled.
        type:
          type: string
          description: >-
            The account type, in lower case, such as `customer`. It is written
            in upper case, such as `CUSTOMER`.
        display_name:
          type: string
        email_address:
          type: string
        description:
          type: string
        currency:
          $ref: '#/components/schemas/AccountCurrency'
          description: The account's currency. Written as a currency code.
        time_zone:
          $ref: '#/components/schemas/AccountTimeZone'
          description: The account's time zone. Written as a time zone name.
        tax:
          $ref: '#/components/schemas/AccountReference'
          description: The account's tax profile, or `null` when it has none.
        custom_form:
          $ref: '#/components/schemas/AccountCustomForm'
        parent_account_id:
          type: string
        image_url:
          description: >-
            `null` on the account read. Use Retrieve an account's image to get
            the image link.
        workflow_status:
          type: string
        social_links:
          $ref: '#/components/schemas/AccountSocialLinks'
        communication_preferences:
          type: array
          items:
            $ref: '#/components/schemas/AccountCommunicationPreference'
        invoice_parent_account:
          type: boolean
        portal_access:
          type: boolean
        origin:
          type: string
        group:
          $ref: '#/components/schemas/AccountReference'
        manager:
          $ref: '#/components/schemas/AccountReference'
        sales_rep:
          $ref: '#/components/schemas/AccountReference'
        user_team:
          $ref: '#/components/schemas/AccountReference'
        accounting_code:
          $ref: '#/components/schemas/AccountAccountingCode'
        pricing_level:
          $ref: '#/components/schemas/AccountReference'
        referral_tracking:
          type: string
        created_on:
          type: string
        last_updated_on:
          type: string
        created_by:
          $ref: '#/components/schemas/AccountUser'
        last_updated_by:
          $ref: '#/components/schemas/AccountUser'
        version:
          type: integer
        href:
          type: string
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/AccountAddress'
          description: >-
            The account's addresses. Retrieve an address returns one address
            object here instead of a list.
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/AccountContact'
          description: >-
            The account's contacts. Retrieve a contact by slot returns one
            contact object here instead of a list.
        payment_methods:
          type: array
          items:
            $ref: '#/components/schemas/AccountPaymentMethod'
        billing_preferences:
          $ref: '#/components/schemas/AccountBillingPreferences'
        custom_attributes:
          type: array
          items:
            $ref: '#/components/schemas/AccountCustomAttribute'
        custom_objects:
          type: array
          items:
            $ref: '#/components/schemas/AccountReference'
        inventories:
          type: array
          description: Returned by List an account's inventories.
        partial_invoices:
          type: array
          description: Returned by List an account's partial invoices from quotes.
        activity_logs:
          type: array
        payment_method:
          $ref: '#/components/schemas/AccountPaymentMethod'
          description: Returned by Retrieve a payment method.
        tax_id: {}
        tax_id_number: {}
    AccountCurrency:
      type: object
      properties:
        code:
          type: string
        href:
          type: string
        id:
          type: string
        name:
          type: string
        object:
          type: string
    AccountTimeZone:
      type: object
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        href:
          type: string
    AccountReference:
      type: object
      description: A link to another record.
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        code:
          type: string
        href:
          type: string
        rate:
          type: number
    AccountCustomForm:
      type: object
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        href:
          type: string
    AccountSocialLinks:
      type: object
      properties:
        website:
          type: string
        linkedin:
          type: string
        twitter:
          type: string
        facebook:
          type: string
    AccountCommunicationPreference:
      type: object
      properties:
        channel:
          type: string
        enabled:
          type: boolean
    AccountAccountingCode:
      type: object
      properties:
        account_receivable:
          type: string
    AccountUser:
      type: object
      description: The user who created or last changed a record.
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        email:
          type: string
        href:
          type: string
    AccountAddress:
      type: object
      description: An address as it reads back.
      properties:
        object:
          type: string
        id:
          type: string
        address_line_1:
          type: string
        address_line_2:
          type: string
        address_line_3:
          type: string
        address_line_4:
          type: string
        address_line_5:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          type: string
        postal_code:
          type: string
          description: The postcode. Written as `post_code`.
        default_billing:
          type: boolean
        default_shipping:
          type: boolean
        href:
          type: string
    AccountContact:
      type: object
      description: A contact as it reads back.
      properties:
        object:
          type: string
        id:
          type: string
        type:
          type: string
          description: >-
            What the contact's slot reads back as: `billing`, `shipping` or
            `primary`. A contact created in slot `CONTACT_1` reads back as
            `billing`.
        billing_contact:
          type: boolean
        shipping_contact:
          type: boolean
        receives_billing_information:
          type: boolean
        name:
          $ref: '#/components/schemas/AccountContactName'
          description: >-
            The contact's name, split into parts. Written flat as `first_name`,
            `middle_name` and `last_name`.
        email:
          $ref: '#/components/schemas/AccountContactEmail'
        phone:
          $ref: '#/components/schemas/AccountContactPhone'
        mobile:
          $ref: '#/components/schemas/AccountContactPhone'
        fax:
          $ref: '#/components/schemas/AccountContactPhone'
        address:
          $ref: '#/components/schemas/AccountContactAddress'
        custom_attributes:
          type: array
          items:
            $ref: '#/components/schemas/AccountContactCustomAttribute'
        created_on:
          type: string
        last_updated_on:
          type: string
        created_by:
          $ref: '#/components/schemas/AccountUser'
        last_updated_by:
          $ref: '#/components/schemas/AccountUser'
        version:
          type: integer
    AccountPaymentMethod:
      type: object
      description: A payment method as it reads back.
      properties:
        object:
          type: string
        id:
          type: string
        processor_type:
          type: string
        status:
          type: string
        default:
          type: boolean
          description: >-
            Whether this is the account's default method. The first method added
            to an account becomes its default.
        restricted_to_orders:
          type: boolean
        specified_order_ids: {}
        processor:
          $ref: '#/components/schemas/AccountPaymentProcessor'
        reference:
          type: string
        payment_count:
          type: integer
        last_used_at:
          type: string
          description: >-
            The time of the method's most recent charge, or `null` if it has
            never been charged.
        created_on:
          type: string
        last_updated_on:
          type: string
        created_by:
          $ref: '#/components/schemas/AccountUser'
        last_updated_by:
          $ref: '#/components/schemas/AccountUser'
        version:
          type: integer
    AccountBillingPreferences:
      type: object
      description: An account's billing preferences as they read back.
      properties:
        communication_profile:
          type: string
        invoice_mode:
          type: string
        invoice_term:
          type: string
        billing_period:
          type: string
        billing_start_date:
          type: string
          description: An option such as `DAY_OF_MONTH`, not a calendar date.
        billing_start_day_of_month:
          type: integer
        charges_aligned_to_billing:
          type: boolean
          description: >-
            Whether charges align to billing. This is the name the account read
            uses for the alignment setting.
        payment_processor:
          type: string
        payment_mode:
          type: string
        payment_term:
          type: string
        payment_term_alignment:
          type: string
        consolidate_invoice:
          type: boolean
        fulfillment_mode:
          type: string
        fulfillment_term:
          type: string
        proforma_properties: {}
        communication_group:
          type: string
        billing_mode:
          type: string
        charging_period:
          type: string
        charging_and_billing_alignment:
          type: string
          description: >-
            The alignment setting under its written name. Written as a boolean,
            read as a string.
        charging_start_date:
          type: string
        event_profile:
          type: string
    AccountCustomAttribute:
      type: object
      properties:
        href:
          type: string
        id:
          type: string
        name:
          type: string
        object:
          type: string
        type:
          type: string
        value: {}
    AccountContactName:
      type: object
      description: A contact's name as it reads back.
      properties:
        salutation:
          type: string
        first:
          type: string
        middle:
          type: string
        last:
          type: string
        designation:
          type: string
    AccountContactEmail:
      type: object
      properties:
        address:
          type: string
        do_not_email:
          type: boolean
        email_opted_out:
          type: boolean
    AccountContactPhone:
      type: object
      description: A phone, mobile or fax number. All three share this shape.
      properties:
        country_code:
          type: string
        area_code:
          type: string
        number:
          type: string
        do_not_call:
          type: boolean
        call_opted_out:
          type: boolean
        dialing_code:
          type: string
        formatted:
          type: string
    AccountContactAddress:
      type: object
      properties:
        city:
          type: string
        country:
          type: string
        country_code: {}
        line_1:
          type: string
        line_2:
          type: string
        postal_code:
          type: string
        state:
          type: string
    AccountContactCustomAttribute:
      type: object
      properties:
        name:
          type: string
        value: {}
    AccountPaymentProcessor:
      type: object
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        href:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An access token from `POST /api/v4/oauth2/token`. The SDKs get and renew
        it for you.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.