Skip to main content

Verify Access Token

Verify an access token and get the associated features.
curl -X POST "https://api-paygate.getaether.xyz/public/feature/verify" \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"accessToken": "ft_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"}'

Request Body

FieldTypeRequiredDescription
accessTokenstringYesAccess token to verify

Response (Valid)

{
  "valid": true,
  "features": [
    "pro_analytics",
    "pro_export",
    "pro_themes"
  ],
  "productId": "prod_pro123",
  "productTitle": "Pro Plan",
  "walletAddress": "7xK3abcdefghijklmnop",
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Response (Invalid)

{
  "valid": false,
  "error": "Token not found or revoked"
}

List Access Tokens

Get all access tokens for your products.
curl -X GET "https://api-paygate.getaether.xyz/public/feature/tokens" \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json"

Query Parameters

ParameterTypeDescription
productIdstringFilter by product ID
walletAddressstringFilter by wallet address
limitnumberMax results (default: 100)
offsetnumberPagination offset

Response

{
  "tokens": [
    {
      "accessToken": "ft_a1b2c3...",
      "productId": "prod_pro123",
      "productTitle": "Pro Plan",
      "features": ["pro_analytics", "pro_export"],
      "walletAddress": "7xK3abc...",
      "txHash": "5xyz...",
      "status": "active",
      "createdAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "total": 47,
  "limit": 100,
  "offset": 0
}

Revoke Access Token

Revoke an access token (permanently invalidates it).
curl -X POST "https://api-paygate.getaether.xyz/public/feature/revoke" \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"accessToken": "ft_token_to_revoke"}'

Request Body

FieldTypeRequiredDescription
accessTokenstringYesToken to revoke

Response

{
  "success": true,
  "message": "Token revoked successfully"
}

Error Response

{
  "success": false,
  "error": "Token not found"
}

Check Access

Check if a wallet has access to a product.
curl -X POST "https://api-paygate.getaether.xyz/public/access/check" \
  -H "X-API-Key: pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"productId": "prod_abc123", "walletAddress": "7xK3abc..."}'

Request Body

FieldTypeRequiredDescription
productIdstringYesProduct to check
walletAddressstringYesWallet to check

Response

{
  "hasAccess": true,
  "txHash": "5xyz...",
  "purchasedAt": "2024-01-15T10:30:00.000Z"
}

No Access Response

{
  "hasAccess": false,
  "paymentUrl": "https://paygate.getaether.xyz/pay/prod_abc123"
}