POST
/
subscription
/
register
POST /subscription/register
curl --request POST \
  --url https://api.example.com/subscription/register \
  --header 'Content-Type: application/json' \
  --data '
{
  "tx_signature": "<string>",
  "tier": 123
}
'
{
  "400": {},
  "404": {},
  "success": true,
  "subscription": {},
  "tx_verified": true
}

Overview

Notify backend of subscription payment on Solana blockchain. Backend will verify the transaction and activate subscription.

Request

curl -X POST https://api.agentik.dev/api/subscription/register \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tx_signature": "5J7Zn8kQ...",
    "tier": 1
  }'

Body Parameters

tx_signature
string
required
Solana transaction signature for subscription payment
tier
number
required
Subscription tier: 0 (free), 1 (pro), or 2 (enterprise)

Response

{
  "success": true,
  "subscription": {
    "tier": "pro",
    "is_active": true,
    "expires_at": "2026-03-15T10:30:00Z"
  },
  "tx_verified": true
}
success
boolean
Whether registration was successful
subscription
object
Activated subscription details
tx_verified
boolean
Whether blockchain transaction was verified

Workflow

  1. User submits subscription transaction on Solana
  2. Transaction confirms on blockchain
  3. Frontend calls /subscription/register with tx signature
  4. Backend reads subscription PDA from blockchain
  5. Backend caches subscription in database (120s TTL)
  6. Subscription activated

Errors

400
error
Invalid transaction signature or tier
404
error
Transaction not found on blockchain