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

# Managing Company Locations

> Add locations to a company and retrieve the location IDs used by payment endpoints.

Company locations let you route payments to a specific branch, office, or practice. Use the company reference ID to add and list locations, then pass the returned location UUID to payment endpoints as `LocationId`.

## Prerequisites

* Obtain an access token from `/auth/token` using your `ClientId` and `ClientSecret`.
* Register the company and keep its `CompanyReferenceId`.

## Add a Location

Use `POST /Company/{companyReferenceId}/Locations` to add a location to an existing company.

### Endpoint

* **URL**: `https://api.synchpay.com/Company/{companyReferenceId}/Locations`
* **Method**: `POST`
* **Authorization**: `Bearer <AccessToken>`

### Path Parameter

| Parameter            | Type   | Description                                            | Required |
| -------------------- | ------ | ------------------------------------------------------ | -------- |
| `companyReferenceId` | string | External reference supplied when creating the company. | Yes      |

### Request Body

| Parameter             | Type   | Description                       | Required |
| --------------------- | ------ | --------------------------------- | -------- |
| `Name`                | string | Display name for the location.    | Yes      |
| `StreetNumberAndName` | string | Street number and name.           | Yes      |
| `ApartmentNumber`     | string | Suite, unit, or apartment number. | No       |
| `ZipCode`             | string | Postal code.                      | Yes      |
| `City`                | string | City.                             | Yes      |
| `State`               | string | State.                            | Yes      |

```json theme={null}
{
  "Name": "Downtown Office",
  "StreetNumberAndName": "123 Main St",
  "ApartmentNumber": "Suite 200",
  "ZipCode": "10001",
  "City": "New York",
  "State": "NY"
}
```

### Response

The response contains the UUID to use when creating payments for this location.

```json theme={null}
{
  "LocationId": "4d8ab11b-0322-4bf9-921f-39d753b0530c"
}
```

## List Locations

Use `GET /Company/{companyReferenceId}/Locations` to retrieve every location for a company.

### Endpoint

* **URL**: `https://api.synchpay.com/Company/{companyReferenceId}/Locations`
* **Method**: `GET`
* **Authorization**: `Bearer <AccessToken>`

```http theme={null}
GET /Company/company-001/Locations HTTP/1.1
Host: api.synchpay.com
Authorization: Bearer eyJhbGciOi...
```

### Response

| Field       | Type   | Description                                         |
| ----------- | ------ | --------------------------------------------------- |
| `Locations` | array  | Locations registered for the company.               |
| `Id`        | string | Location UUID.                                      |
| `Name`      | string | Location display name.                              |
| `Address`   | object | Street, city, ZIP code, state, and country details. |

```json theme={null}
{
  "Locations": [
    {
      "Id": "4d8ab11b-0322-4bf9-921f-39d753b0530c",
      "Name": "Downtown Office",
      "Address": {
        "StreetNumberAndName": "123 Main St",
        "ApartmentNumber": "Suite 200",
        "City": "New York",
        "ZipCode": "10001",
        "State": "NY",
        "Country": "US"
      }
    }
  ]
}
```

Use a returned `Id` as `LocationId` when you [create a payment request](/synchpay/make-payment), [create a recurring payment](/synchpay/create-recurring-payment), [authorize a card](/synchpay/authorize-card), or [charge a saved card](/synchpay/charge-saved-card).
