Skip to main content
This API allows you to view and manually create cryptocurrency transactions for your account.

The crypto transaction object

id
string
Unique identifier with trxn_ prefix (e.g., trxn_abc123def456).
object
string
Always "crypto_transaction".
amount
string
Transaction amount (string to preserve precision).
transaction_id
string
Blockchain transaction hash.
transaction_source
string
Source of the transaction: manual_entry or blockchain.
timestamp
string
When the transaction occurred (ISO 8601).
currency
string
Currency code (e.g., BTC, ETH).
from_address_id
string
Sending address ID. May be null.
from_address
string
Sending address. May be null.
to_address_id
string
Receiving address ID.
to_address
string
Receiving address.
allocations
array
Transaction allocations to invoices.
created_at
string
When the record was created (ISO 8601).
updated_at
string
When the record was last updated (ISO 8601).

List crypto transactions

GET /v1/crypto_transactions
Retrieves a paginated list of all crypto transactions in your account. Transactions are ordered by timestamp (newest first).
page
integer
default:"1"
Page number for pagination. Results are returned 25 items per page.
curl https://api.gettrxn.com/v1/crypto_transactions \
  -H "Authorization: Bearer $TRXN_TOKEN"
Response
{
  "crypto_transactions": [
    {
      "id": "trxn_abc123def456",
      "object": "crypto_transaction",
      "amount": "0.5",
      "transaction_id": "0x1234567890abcdef...",
      "transaction_source": "manual_entry",
      "timestamp": "2025-01-25T12:00:00Z",
      "currency": "BTC",
      "from_address_id": "addr_xyz789",
      "from_address": "bc1q...",
      "to_address_id": "addr_abc123",
      "to_address": "bc1q...",
      "allocations": [
        {
          "id": "alloc_123",
          "invoice_id": "inv_456",
          "amount_applied": "0.25",
          "created_at": "2025-01-25T12:30:00Z"
        }
      ],
      "created_at": "2025-01-25T12:00:00Z",
      "updated_at": "2025-01-25T12:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pages": 3,
    "count": 67
  }
}

Get crypto transaction

GET /v1/crypto_transactions/:id
Retrieves a specific crypto transaction by ID, including its allocations.
id
string
required
The transaction’s ID (e.g., trxn_abc123def456).
curl https://api.gettrxn.com/v1/crypto_transactions/trxn_abc123def456 \
  -H "Authorization: Bearer $TRXN_TOKEN"
Response
{
  "id": "trxn_abc123def456",
  "object": "crypto_transaction",
  "amount": "0.5",
  "transaction_id": "0x1234567890abcdef...",
  "transaction_source": "manual_entry",
  "timestamp": "2025-01-25T12:00:00Z",
  "currency": "BTC",
  "from_address_id": "addr_xyz789",
  "from_address": "bc1q...",
  "to_address_id": "addr_abc123",
  "to_address": "bc1q...",
  "allocations": [
    {
      "id": "alloc_123",
      "invoice_id": "inv_456",
      "amount_applied": "0.25",
      "created_at": "2025-01-25T12:30:00Z"
    }
  ],
  "created_at": "2025-01-25T12:00:00Z",
  "updated_at": "2025-01-25T12:00:00Z"
}

Create crypto transaction

POST /v1/crypto_transactions
Creates a new crypto transaction manually. This is useful for recording transactions that were not automatically detected by the system.
to_address_id
string
required
The receiving address ID (e.g., addr_abc123). Must belong to your account.
amount
string
required
The transaction amount (as a string to preserve precision).
currency_code
string
required
The currency code (e.g., BTC, ETH).
transaction_id
string
required
The blockchain transaction hash/ID.
timestamp
string
The transaction timestamp (ISO 8601 format). Defaults to current time.
from_address_id
string
The sending address ID (e.g., addr_xyz789).
curl -X POST https://api.gettrxn.com/v1/crypto_transactions \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to_address_id": "addr_abc123",
    "amount": "0.5",
    "currency_code": "BTC",
    "transaction_id": "0x1234567890abcdef...",
    "timestamp": "2025-01-25T12:00:00Z"
  }'
Response
{
  "id": "trxn_new123abc456",
  "object": "crypto_transaction",
  "amount": "0.5",
  "transaction_id": "0x1234567890abcdef...",
  "transaction_source": "manual_entry",
  "timestamp": "2025-01-25T12:00:00Z",
  "currency": "BTC",
  "from_address_id": null,
  "from_address": null,
  "to_address_id": "addr_abc123",
  "to_address": "bc1q...",
  "allocations": [],
  "created_at": "2025-01-25T14:30:00Z",
  "updated_at": "2025-01-25T14:30:00Z"
}

Error responses

Address not found
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "Crypto address not found",
    "param": "to_address_id"
  }
}
Unsupported currency
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "Currency not found: DOGE",
    "param": "currency_code"
  }
}

The allocation object

FieldTypeDescription
idstringUnique identifier for the allocation.
invoice_idstringInvoice ID this allocation applies to.
amount_appliedstringAmount applied to the invoice.
created_atstringWhen the allocation was created (ISO 8601).

Sandbox support

The API respects sandbox scoping. If your API token is associated with a sandbox, you can only access transactions created in that sandbox. Manually created transactions will be isolated from production data.