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

# Quickstart

> Create a project, create a transaction, and monitor the result

This quickstart shows the shortest useful path through the API: discover a network, create a project, create a transaction, and track the outcome.

## Before You Begin

Prepare these inputs:

* an environment-specific base URL, shown below as `<BASE_URL>`;
* a merchant wallet address for the target network;
* success, failure, and callback URLs for your application.

## 1. Check API Availability

```bash theme={null}
curl <BASE_URL>/api/health
```

The health endpoint returns service time and uptime, and is useful for smoke tests in CI or deployments.

## 2. Discover Networks and Currencies

```bash theme={null}
curl <BASE_URL>/api/networks
curl <BASE_URL>/api/networks/1/currencies
```

Choose a valid `network_id` and `currency_symbol` from these responses before creating a project.

## 3. Create a Project

```json theme={null}
{
  "project_name": "Demo Store",
  "currency_symbol": "TON",
  "network_id": 1,
  "wallet_address": "UQDemoWalletAddress",
  "merchant_url": "https://merchant.example",
  "min_amount": "1.00",
  "max_amount": "250.00",
  "finalization_time": 1800
}
```

Send the payload to `POST /api/projects`.

The successful response returns:

* `project.project_uid`, used in later requests;
* `secret_key`, returned once and required for signed transaction creation.

<Warning>
  Store `secret_key` securely at creation time. The docs do not assume it can be fetched again later.
</Warning>

## 4. Create a Transaction

For the protected flow, send a signed request to `POST /api/transaction`.

```json theme={null}
{
  "project_uid": "8f6f5d7c-9e7b-4f50-b72b-5c96a0bbf4fd",
  "amount": "10.50",
  "currency": "TON",
  "success_url": "https://merchant.example/success",
  "failed_url": "https://merchant.example/failed",
  "callback_url": "https://merchant.example/callback"
}
```

The response includes:

* `tx.id`, the transaction identifier;
* `tx.status`, which initially reflects the backend state;
* `frontend_link`, which can be opened or embedded in your flow.

## 5. Track the Outcome

Use these endpoints after creation:

| Goal                                | Endpoint                                                                    |
| ----------------------------------- | --------------------------------------------------------------------------- |
| List transactions for a project     | `GET /api/transactions` or `POST /api/transactions`                         |
| Read latest status                  | `GET /api/transaction/{id}/status`                                          |
| Read full transaction info          | `GET /api/transaction/{id}/info`                                            |
| Redirect a customer based on result | `GET /api/transaction/{id}/redirect`                                        |
| Trigger callbacks manually          | `POST /api/transaction/{id}/callback` or `POST /api/transactions/callbacks` |

## 6. Handle Status Changes

Transactions may move through these states:

* `pending`
* `confirmed`
* `failed`
* `reverted`

Use callbacks for asynchronous delivery, and keep status polling available as a fallback.

Continue with [Authentication and Signed Requests](/pay/signature) or [Transaction Lifecycle](/pay/transactions) for deeper integration details.
