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

# Quickstart

> Get up and running with TRXN in 5 minutes.

This guide walks you through creating your first customer, product, and invoice using the TRXN API.

## Prerequisites

* A TRXN account ([sign up](https://gettrxn.com/users/sign_up))
* An API token (create one in **Settings > API Tokens**)

## 1. Authenticate

All API requests require a Bearer token in the `Authorization` header.

```bash theme={null}
export TRXN_TOKEN="your_api_token_here"
```

Test your token:

```bash theme={null}
curl https://api.gettrxn.com/v1/me \
  -H "Authorization: Bearer $TRXN_TOKEN"
```

## 2. Create a customer

```bash theme={null}
curl -X POST https://api.gettrxn.com/v1/customers \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "alice@example.com",
    "first_name": "Alice",
    "last_name": "Smith"
  }'
```

```json Response theme={null}
{
  "id": "cust_abc123def456",
  "email": "alice@example.com",
  "first_name": "Alice",
  "last_name": "Smith",
  "created_at": "2025-01-15T14:30:00Z",
  "updated_at": "2025-01-15T14:30:00Z"
}
```

Save the `id` — you'll need it for invoices.

## 3. Create a product and price

```bash theme={null}
curl -X POST https://api.gettrxn.com/v1/products \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Pro Plan"}'
```

Then create a price for the product:

```bash theme={null}
curl -X POST https://api.gettrxn.com/v1/prices \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "prod_abc123",
    "amount": 4900,
    "currency": "usd",
    "price_type": "one_time"
  }'
```

<Note>
  Amounts are in cents. `4900` = \$49.00 USD.
</Note>

## 4. Create an invoice

```bash theme={null}
curl -X POST https://api.gettrxn.com/v1/invoices \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cust_abc123def456",
    "line_items": [
      {
        "price_id": "price_xyz789",
        "quantity": 1
      }
    ]
  }'
```

```json Response theme={null}
{
  "id": "inv_def456ghi789",
  "customer_id": "cust_abc123def456",
  "status": "pending",
  "line_items": [
    {
      "price_id": "price_xyz789",
      "quantity": 1,
      "amount": 4900
    }
  ],
  "created_at": "2025-01-15T14:35:00Z"
}
```

## 5. Add a crypto address

Add a Bitcoin or Ethereum address to receive payments:

```bash theme={null}
curl -X POST https://api.gettrxn.com/v1/crypto_addresses \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "currency": "btc"
  }'
```

## 6. Receive and verify payments

When a customer sends crypto to your address, TRXN:

1. Detects the transaction on the blockchain
2. Looks up the historical price at the exact transaction time
3. Converts the crypto amount to fiat (USD)
4. Applies the [slippage margin](/guides/slippage-margin) tolerance
5. Allocates the payment to outstanding invoices

You can also [set up webhooks](/guides/webhooks) to receive real-time notifications when payments are verified.

## Next steps

<CardGroup cols={2}>
  <Card title="Subscriptions" icon="rotate" href="/guides/subscriptions">
    Set up recurring billing with multi-phase subscriptions.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/guides/webhooks">
    Get notified when payments arrive, invoices change, and more.
  </Card>

  <Card title="Sandbox mode" icon="flask" href="/guides/sandboxes">
    Test your integration without affecting production data.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/authentication">
    Explore the full API.
  </Card>
</CardGroup>
