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

# Set default address

> Mark a shipping address as the shopper's default.

## Request

```http theme={null}
PATCH /user/address/{addressId}/default
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
```

## Path parameters

| Parameter   | Type   | Description                              |
| ----------- | ------ | ---------------------------------------- |
| `addressId` | string | The id of the address to set as default. |

<Note>
  Setting a new default automatically clears the previous default address.
</Note>

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Default address updated",
    "data": {
        "address": {
            "_id": "651f8a9b2c3d4e5f60718300",
            "name": "Jane Smith",
            "isDefault": true,
            "updatedAt": "2026-06-18T03:26:00.000Z"
        }
    }
}
```

## Error responses

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "\"addressId\" length must be 24 characters long",
    "data": {}
}
```

```json theme={null}
{
    "status": 404,
    "success": false,
    "message": "Address not found or unauthorized",
    "data": {}
}
```


## OpenAPI

````yaml PATCH /user/address/{addressId}/default
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /user/address/{addressId}/default:
    patch:
      summary: Set default shipping address
      description: >-
        Mark the given address as the shopper's default. Any previous default is
        cleared.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
        - name: addressId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Default address updated.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid address id.
        '404':
          description: Address not found.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````