---
api: 'Merchant API'
---

# Create a location

Create a `Location` object. Supports `online` and `physical` location types.

:::note [Duplicate handling]
Location names, addresses, and geolocations must be unique across all locations. If the request duplicates an existing location, the API returns a `400` error with one of the following error codes: `duplicated_location_name`, `duplicated_location_address`, or `duplicated_location_geolocation` (physical locations).

If two identical requests are processed concurrently, one of them creates the location, and the other returns `201` with the already-created location.
:::

## Endpoint

POST `/api/locations`

## Request body

## Returns

### 201

Location created

## Error responses

| HTTP status code | Description |
| --- | --- |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 422 | Unprocessable entity |
| 500 | Internal Server Error |
