---
title: "Set a customer address as the default"
method: POST
path: "/customers/{customerId}/addresses/{id}/set-default"
tags: ["Admin Customers"]
---

# Set a customer address as the default

`POST /customers/{customerId}/addresses/{id}/set-default`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/customers/{customerId}/addresses/{id}/set-default`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/customers/:customerId/addresses/:id/set-default/post.ts> (a function with typed inputs; its response is checked against the schema)

Set a customer address as the default

## Path parameters

- `customerId` integer, required
- `id` integer, required

## Request body

- object

## Response `200`

The address is now the default; all other addresses for the customer are unset.

## Other responses

- `400`: Invalid input
- `403`: Address does not belong to the customer.
- `422`: Validation Error

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
