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

# Providers

> Create and query providers

**Required permission:** `providers`

> [!NOTE]
>
> These endpoints use the legacy response format `{ success, data, message }`.

## List a branch's providers

```http theme={null}
GET /providers/branch/{branch_id}
```

Returns all active providers of the branch (not paginated).

## Create provider

```http theme={null}
POST /providers
```

> [!WARNING]
>
> The body must be sent **inside the `data` key**.

```json theme={null}
{
  "data": {
    "provider_name": "Distribuidora XYZ",
    "legal_name": "Distribuidora XYZ S.A. de C.V.",
    "register_number": "54321-0",
    "tax_number": "0614-000000-000-0",
    "address": "San Salvador",
    "country_id": "uuid",
    "state_id": "uuid",
    "city_id": "uuid",
    "phone": "2222-3333",
    "email": "ventas@xyz.com",
    "business_type": "legal",
    "branch_id": "uuid"
  }
}
```

| Field (inside `data`) | Required | Description |
| - | - | - |
| `provider_name` | Yes | Trade name. |
| `address` | Yes | Address. |
| `country_id` | Yes | Country. See [Catalogs](https://docs.filexpress.app/en/docs/api/facturacion/catalogos.md). |
| `state_id`, `city_id` | Yes (El Salvador) | Department and municipality from the catalog. Optional if the country is not El Salvador. |
| `state_name`, `city_name` | If the country is not El Salvador | Department or state and city or municipality as free text (maximum 120 characters). |
| `phone` | Yes | Phone. |
| `email` | Yes | Email. |
| `business_type` | Yes | `natural` or `legal`. |
| `branch_id` | Yes | Branch. |
| `legal_name` | No | Legal name. |
| `register_number` | No | NRC. |
| `tax_number` | No | NIT. |

> [!NOTE]
>
> **Location outside El Salvador.** If `country_id` is a country other than El Salvador, `state_id` and `city_id` are optional and `state_name` and `city_name` become required (free text, maximum 120 characters each). For El Salvador, `state_id` and `city_id` remain required.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.