Developer Integration Guide

Everything you need to know to integrate AgeWallet's API into your platform.

Integration Overview

AgeWallet enables secure, anonymous age verification using user-generated tokens. Website owners can verify these tokens using our simple API.

Step 1: Collect Token

Ask users to enter their AgeWallet token in your site's age gate or login page.

Step 2: Make API Call

Send the token to the AgeWallet API endpoint using your API key and a POST request.

Step 3: Receive Response

Our API will respond with age status, verification date, expiry, and method used.

Step 4: Grant Access

If verified, grant the user access to your age-restricted content or services.

API Endpoint & Request Format

POST Endpoint
https://api.agewallet.io/verify
Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Request Body
{
  "token": "user_token_here"
}
Example Success Response
{
  "over_18": true,
  "over_21": true,
  "verification_date": "2025-07-01 12:34:56",
  "expiry": "2026-07-01 12:34:56",
  "verification_method": "Vouched"
}

Note: Tokens are valid for one year. If the token is expired or invalid, an error will be returned.

PHP Example

Sample Integration Code
<?php
$apiUrl = "https://api.agewallet.io/verify";
$apiKey = "YOUR_API_KEY";
$userToken = "user_token_here";

$data = [
	"token" => $userToken
];

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
	"Authorization: Bearer $apiKey",
	"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
	$result = json_decode($response, true);
	if ($result['over_18']) {
		echo "User is over 18";
	}
	if ($result['over_21']) {
		echo " and over 21";
	}
} else {
	echo "Verification failed: $response";
}
?>

JavaScript Example

Using fetch()
fetch("https://api.agewallet.io/verify", {
  method: "POST",
  headers: {
	"Authorization": "Bearer YOUR_API_KEY",
	"Content-Type": "application/json"
  },
  body: JSON.stringify({
	token: "user_token_here"
  })
})
  .then(response => response.json())
  .then(data => {
	if (data.over_18) {
	  console.log("User is over 18");
	}
	if (data.over_21) {
	  console.log("User is over 21");
	}
  })
  .catch(error => console.error("Verification error:", error));

Security & Privacy

  • All API requests must use HTTPS.
  • Tokens contain no personally identifiable information.
  • No activity or browsing data is associated with tokens.
  • API usage is logged for billing and abuse protection only.

Ready to Integrate?

Register your website and get your API key to begin verifying users today.

Register Your Site