> ## 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.

# Crypto addresses

> Create and manage cryptocurrency addresses for receiving payments. Addresses are validated by currency and belong to wallets.

This API allows you to create and manage cryptocurrency addresses for receiving payments.

## The crypto address object

<ResponseField name="id" type="string">
  Unique identifier with `addr_` prefix (e.g., `addr_abc123def456`).
</ResponseField>

<ResponseField name="object" type="string">
  Always `"crypto_address"`.
</ResponseField>

<ResponseField name="address" type="string">
  The cryptocurrency address.
</ResponseField>

<ResponseField name="currency" type="string">
  Currency code (e.g., `BTC`, `ETH`).
</ResponseField>

<ResponseField name="wallet_id" type="string">
  The wallet ID this address belongs to.
</ResponseField>

<ResponseField name="explorer" type="object">
  Blockchain explorer information.

  <Expandable title="explorer properties">
    <ResponseField name="explorer.name" type="string">
      Name of the blockchain explorer (e.g., `Blockchain.com`, `Etherscan`).
    </ResponseField>

    <ResponseField name="explorer.url" type="string">
      URL to view the address on the explorer.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="created_at" type="string">
  When the address was created (ISO 8601).
</ResponseField>

<ResponseField name="updated_at" type="string">
  When the address was last updated (ISO 8601).
</ResponseField>

## List crypto addresses

```
GET /v1/crypto_addresses
```

Retrieves a paginated list of all crypto addresses in your account. Addresses are ordered by creation date (newest first).

<ParamField query="page" type="integer" default="1">
  Page number for pagination. Results are returned 25 items per page.
</ParamField>

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

```json Response theme={null}
{
  "crypto_addresses": [
    {
      "id": "addr_abc123def456",
      "object": "crypto_address",
      "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
      "currency": "BTC",
      "wallet_id": "wall_xyz789",
      "explorer": {
        "name": "Blockchain.com",
        "url": "https://www.blockchain.com/explorer/addresses/btc/bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
      },
      "created_at": "2025-01-25T12:00:00Z",
      "updated_at": "2025-01-25T12:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pages": 3,
    "count": 67
  }
}
```

## Get crypto address

```
GET /v1/crypto_addresses/:id
```

Retrieves a specific crypto address by ID.

<ParamField path="id" type="string" required>
  The address's ID (e.g., `addr_abc123def456`).
</ParamField>

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

```json Response theme={null}
{
  "id": "addr_abc123def456",
  "object": "crypto_address",
  "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "currency": "BTC",
  "wallet_id": "wall_xyz789",
  "explorer": {
    "name": "Blockchain.com",
    "url": "https://www.blockchain.com/explorer/addresses/btc/bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
  },
  "created_at": "2025-01-25T12:00:00Z",
  "updated_at": "2025-01-25T12:00:00Z"
}
```

## Create crypto address

```
POST /v1/crypto_addresses
```

Creates a new crypto address in a wallet. The wallet can be either an account wallet or a customer wallet.

<ParamField body="wallet_id" type="string" required>
  The wallet's ID (e.g., `wall_xyz789`). Must belong to your account.
</ParamField>

<ParamField body="currency_code" type="string" required>
  The currency code (e.g., `BTC`, `ETH`). Must be a supported currency.
</ParamField>

<ParamField body="address" type="string" required>
  The cryptocurrency address. Validated based on the currency format.
</ParamField>

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

```json Response theme={null}
{
  "id": "addr_new123abc456",
  "object": "crypto_address",
  "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "currency": "BTC",
  "wallet_id": "wall_xyz789",
  "explorer": {
    "name": "Blockchain.com",
    "url": "https://www.blockchain.com/explorer/addresses/btc/bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
  },
  "created_at": "2025-01-25T14:30:00Z",
  "updated_at": "2025-01-25T14:30:00Z"
}
```

### Error responses

```json Wallet not found theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "Wallet not found",
    "param": "wallet_id"
  }
}
```

```json Unsupported currency theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "Currency not found: DOGE",
    "param": "currency_code"
  }
}
```

```json Duplicate address theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_invalid",
    "message": "Address is already in use for this currency in your account",
    "param": "address"
  }
}
```

## Delete crypto address

```
DELETE /v1/crypto_addresses/:id
```

Deletes a crypto address from your account.

<Warning>
  Deleting an address will also delete any associated payment claims and transaction records.
</Warning>

<ParamField path="id" type="string" required>
  The address's ID (e.g., `addr_abc123def456`).
</ParamField>

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

Returns `204 No Content` on successful deletion.

## Address validation

Addresses are validated based on their currency:

* **BTC**: Validates Bitcoin address formats (legacy, SegWit, native SegWit).
* **ETH**: Validates Ethereum address format (`0x` followed by 40 hex characters).

## Supported currencies

| Currency | Explorer       |
| -------- | -------------- |
| `BTC`    | Blockchain.com |
| `ETH`    | Etherscan      |

## Sandbox support

<Note>
  The API respects sandbox scoping. If your API token is associated with a sandbox, you can only access addresses created in that sandbox. Address uniqueness is enforced separately within each sandbox.
</Note>
