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

# Update

> Update a shipping address.

### Headers

<ParamField header="authorization" type="string" required>
  Your API key for authorization.
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  The ID of the shipping address to update.
</ParamField>

### Body Parameters

<ParamField body="shipping_address" type="object" required>
  <Expandable title="Shipping Address Object">
    <ParamField body="first_name" type="string" required>
      First name of the recipient.
    </ParamField>

    <ParamField body="last_name" type="string" required>
      Last name of the recipient.
    </ParamField>

    <ParamField body="email" type="string" required>
      Email address of the recipient.
    </ParamField>

    <ParamField body="phone" type="string" required>
      Phone number of the recipient.
    </ParamField>

    <ParamField body="address_1" type="string" required>
      Primary address line.
    </ParamField>

    <ParamField body="address_2" type="string">
      Secondary address line (optional).
    </ParamField>

    <ParamField body="city" type="string" required>
      City name.
    </ParamField>

    <ParamField body="country_code" type="string" required>
      Country code (e.g., US, CA).
    </ParamField>

    <ParamField body="province_code" type="string" required>
      Province or state code.
    </ParamField>

    <ParamField body="postal_code" type="string" required>
      Postal or ZIP code.
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the operation was successful.
</ResponseField>

<ResponseField name="shipping" type="object">
  The updated shipping address object containing:

  <Expandable title="Shipping address properties">
    <ResponseField name="id" type="string">
      The unique identifier for the shipping address.
    </ResponseField>

    <ResponseField name="first_name" type="string">
      First name of the recipient.
    </ResponseField>

    <ResponseField name="last_name" type="string">
      Last name of the recipient.
    </ResponseField>

    <ResponseField name="email" type="string">
      Email address of the recipient.
    </ResponseField>

    <ResponseField name="phone" type="string">
      Phone number of the recipient.
    </ResponseField>

    <ResponseField name="address_1" type="string">
      Primary address line.
    </ResponseField>

    <ResponseField name="address_2" type="string">
      Secondary address line (if provided).
    </ResponseField>

    <ResponseField name="city" type="string">
      City name.
    </ResponseField>

    <ResponseField name="country_code" type="string">
      Country code (e.g., US, CA).
    </ResponseField>

    <ResponseField name="province_code" type="string">
      Province or state code.
    </ResponseField>

    <ResponseField name="postal_code" type="string">
      Postal or ZIP code.
    </ResponseField>

    <ResponseField name="profile_id" type="string">
      The ID of the profile this shipping address is attached to.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Timestamp when the shipping address was created.
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      Timestamp when the shipping address was last updated.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="code" type="string">
  A code indicating the result of the operation. Possible values:

  * `SHIPPING_UPDATED`: Shipping address updated successfully
  * `SHIPPING_UPDATE_FAILED`: Failed to update shipping address
</ResponseField>

<ResponseField name="error" type="string">
  Error message if the request fails.
</ResponseField>

<Note>
  When updating a shipping address, you need to provide the complete shipping address object with all fields, even those that haven't changed.
</Note>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "shipping": {
      "id": "ship_12345",
      "first_name": "John",
      "last_name": "Smith",
      "email": "john.smith@example.com",
      "phone": "+1234567890",
      "address_1": "456 Park Ave",
      "address_2": "Suite 789",
      "city": "New York",
      "country_code": "US",
      "province_code": "NY",
      "postal_code": "10022",
      "profile_id": "prof_67890",
      "updated_at": "2023-09-16T10:15:22Z"
    },
    "id": "ship_12345",
    "code": "SHIPPING_UPDATED"
  }
  ```
</ResponseExample>
