# Getting started

## Registration

To use our services, you need to first have an API account. An API account is a specific type of
account that
can access our Third-Party endpoints and receive our event callbacks.

In order to create an account and discuss the basic terms and financial details of our services,
you can reach our sales
team at
[02191009282](tel:02191009282) Ext. 3, they will provide us with the required information
to create your
account.
After registration, you'll be given a string called **Token**.

:::caution

Your token is our only way to make sure requests are coming from you, so keep it safe.

:::

:::note

Authenticate process is further discussed in the [Authentication](/getting-started#authentication)

:::

## Environments

Miare has two sets of servers.

### Staging

Sandbox servers -usually referred to as **Staging**- are the playground for development teams to
test integration of
their application with ours.
In the staging servers, your account will be given 10 concurrencies in each of our areas and all
trips are free of
charge.

:::note

There is no active courier on the staging so your trips will never be assigned to a courier, delivered, or ended so you have to cancel your trips to avoid reaching the concurrency limit.

:::

:::note

The main url part for staging server is `staging.miare.ir` according to the production servers which is `miare.ir`.

:::

### Production

Main servers -usually referred to as **Production**- are the main product's servers for real-world
use.
In production servers, your concurrency should be purchased through the sales team and trips have
normal rates applied
to them.

:::note

You should only start using our production server after all technical and non-technical major integration issues are resolved.

:::

## Authentication

Each client has a specific API key called **Token** for each of our servers. The token is the sole
representative of an
account on a server as well as its trips, courses, and financial transactions.
The sales team will provide you with the staging token after the **registration** process and the
production token after
the **test** process.

:::note

At this moment, there is no automatic process for resetting your token, but you can ask the sales team to reset it for you at any time.

:::

:::note

Note that staging and production tokens are in no way related to each other and their accounts are two separate accounts on two sets of servers.

:::

> To authorize, pass the authorization token among headers and prefix it with `Token `:

```shell
curl "api_endpoint_here" \
  --header "Authorization: Token <Your Token>"
```

```python
import requests

requests.post(
    "api_endpoint_here",
    headers={"Authorization": "Token <Your Token>"}
)
```

> Make sure to replace `<Your Token>` with your API Token.

Miare uses API Tokens to allow access to the API.

Miare API expects for the token to be included in **ALL** API requests to the server in
an `Authorization` header that
looks like the following:

`Authorization: Token <Your Token>`

:::note

You must replace `&#60;Your Token&#62;` with your personal API key.

:::

## Service URLs

| Service | Staging | Production |
| --- | --- | --- |
| Delivery | `https://ws.staging.miare.ir/trip-management/third-party-api/v2` | `https://ws.miare.ir/trip-management/third-party-api/v2` |
| Support | `https://ws.staging.miare.ir/support/third-party-api/v2` | `https://ws.miare.ir/support/third-party-api/v2` |
| Areas | `https://ws.staging.miare.ir/area/third-party-api/v2` | `https://ws.miare.ir/area/third-party-api/v2` |
| Accounting | `https://www.staging.miare.ir/api/accounting` | `https://www.miare.ir/api/accounting` |

Your integration token authorizes API calls. The sign-in button on this documentation site is for Miare staff references and does not issue an integration token.

Continue with the [quickstart](/quickstart), [core concepts](/concepts), or [REST reference](/api/public).
