> For the complete documentation index, see [llms.txt](https://fincart.gitbook.io/fincart-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fincart.gitbook.io/fincart-api/apis/add-pickup-location.md).

# Add Pickup Location

### Add Pickup Location

Adds a new pickup/warehouse location for a merchant, including contact information and address details.

***

#### Endpoint

```
POST /merchant/locations
```

**Base URL:** `http://api.dev.fincart.io`

***

#### Authentication

This endpoint requires an `Authorization` header using the merchant’s API token.

| Header          | Type     | Description                |
| --------------- | -------- | -------------------------- |
| `Authorization` | `string` | Merchant auth token        |
| `Content-Type`  | `string` | Must be `application/json` |

***

#### Request Body

**Content-Type:** `application/json`

| Field          | Type      | Required | Description                                                 |
| -------------- | --------- | -------- | ----------------------------------------------------------- |
| `name`         | `string`  | Yes      | Display name for the location (e.g. `“Warehouse Location”`) |
| `city`         | `string`  | Yes      | City where the location is based (e.g. `“Giza”`, `“Cairo”`) |
| `area`         | `string`  | Yes      | Specific area/district within the city                      |
| `address_line` | `string`  | Yes      | Full address line                                           |
| `is_default`   | `boolean` | Yes      | Whether this is the default pickup location                 |
| `contacts`     | `object`  | Yes      | Contact person details (see below)                          |

**`contacts` Object**

| Field        | Type      | Required | Description                         |
| ------------ | --------- | -------- | ----------------------------------- |
| `name`       | `string`  | Yes      | Contact person’s full name          |
| `phone`      | `string`  | Yes      | Contact person’s phone number       |
| `is_default` | `boolean` | Yes      | Whether this is the default contact |

***

#### Example Request

```json
{
    “name”: “Warehouse Location”,
    “city”: “Giza”,
    “area”: “6 October - District 02”,
    “address_line”: “Giza 6 October Location”,
    “is_default”: false,
    “contacts”: {
        “name”: “Dina Emad”,
        “phone”: “012xxxxxx”,
        “is_default”: false
    }
}
```

***

#### Responses

**`200 OK` — Location Created Successfully**

```json
{
    “status”: “success”,
    “msg”: “Merchant location info added”,
    “body”: {
        “_id”: “6a3bac4c4df82b733b1fbf74”
    }
}
```

| Field      | Type     | Description                             |
| ---------- | -------- | --------------------------------------- |
| `status`   | `string` | `“success”` on successful creation      |
| `msg`      | `string` | Human-readable confirmation message     |
| `body._id` | `string` | Unique ID of the newly created location |

***

#### Notes

* The `is_default` flag on the location determines whether this location is pre-selected when creating orders.
* The `contacts.is_default` flag marks the primary contact for this location.
* Multiple locations can be added; only one can be set as default at a time.

***

<br>
