Przejdź do głównej zawartości

Get User Info

GET
/user/me/

Get information about the authenticated merchant account (tenant).

Authentication

Requires OAuth 2.0 authentication with read scope.

Example Request

curl -X GET https://api.cryptofuse.io/user/me/ \
-H "Authorization: Bearer your_access_token"

Response

Success Response (200 OK)

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Acme Corporation",
"schema_name": "tenant_acme",
"account_type": "business",
"status": "active",
"created_on": "2024-01-15",
"contact_email": "[email protected]",
"transaction_fee": "1.0",
"is_fee_paid_by_user": true,
"webhook_callback_url": "https://acme.com/webhook/cryptofuse",
"webhook_secret": "wh_secret_abc123...",
"is_ip_whitelist_enabled": false,
"ip_whitelist": [],
"api_usage": {
"requests_today": 342,
"requests_this_month": 8453,
"last_request": "2025-01-15T09:58:00Z"
},
"limits": {
"daily_payment_limit": "100000.00",
"daily_withdrawal_limit": "50000.00",
"max_payment_amount": "10000.00",
"max_withdrawal_amount": "5000.00"
},
"statistics": {
"total_payments": 1234,
"total_withdrawals": 456,
"total_volume_usd": "123456.78",
"active_currencies": 4
},
"features": {
"multi_wallet": true,
"instant_withdrawals": false,
"custom_fees": true,
"webhook_retry": true
}
}

Response Fields

FieldTypeDescription
iduuidUnique merchant identifier
namestringMerchant business name
schema_namestringDatabase schema name (tenant identifier)
account_typestringAccount type: "individual" or "business"
statusstringAccount status: "active", "suspended", "pending"
created_ondateAccount creation date
contact_emailstringPrimary contact email
transaction_feestringTransaction fee percentage
is_fee_paid_by_userbooleanWhether customers pay transaction fees
webhook_callback_urlstringDefault webhook URL
webhook_secretstringWebhook HMAC secret (first 12 chars shown)
is_ip_whitelist_enabledbooleanWhether IP whitelist is active
ip_whitelistarrayAllowed IP addresses
api_usageobjectAPI usage statistics
limitsobjectAccount limits
statisticsobjectAccount statistics
featuresobjectEnabled features

Account Status Values

StatusDescription
activeAccount is active and operational
suspendedAccount temporarily suspended (contact support)
pendingAccount pending verification
trialAccount in trial period

Usage Examples

Account Status Check

async function checkAccountStatus() {
const response = await fetch('https://api.cryptofuse.io/user/me/', {
headers: {
'Authorization': `Bearer ${accessToken}`
}
});

const account = await response.json();

// Check account status
if (account.status !== 'active') {
console.error(`Account ${account.status}: Operations may be limited`);
return false;
}

// Check API usage
const { requests_today, requests_this_month } = account.api_usage;
console.log(`API Usage: ${requests_today} today, ${requests_this_month} this month`);

// Check limits
console.log('Daily Limits:');
console.log(` Payments: $${account.limits.daily_payment_limit}`);
console.log(` Withdrawals: $${account.limits.daily_withdrawal_limit}`);

// Check features
if (account.features.multi_wallet) {
console.log('✓ Multi-wallet enabled');
}

return true;
}

Configuration Display

def display_account_config():
"""Display current account configuration."""

response = requests.get(
'https://api.cryptofuse.io/user/me/',
headers={'Authorization': f'Bearer {access_token}'}
)

if response.status_code == 200:
account = response.json()

print(f"Account: {account['name']}")
print(f"Status: {account['status']}")
print(f"Schema: {account['schema_name']}")

# Fee configuration
print(f"\nFee Configuration:")
print(f" Transaction Fee: {account['transaction_fee']}%")
print(f" Paid by: {'Customer' if account['is_fee_paid_by_user'] else 'Merchant'}")

# Webhook configuration
print(f"\nWebhook Configuration:")
print(f" URL: {account['webhook_callback_url'] or 'Not configured'}")
print(f" Secret: {account['webhook_secret'][:12]}...")

# Security
print(f"\nSecurity:")
print(f" IP Whitelist: {'Enabled' if account['is_ip_whitelist_enabled'] else 'Disabled'}")
if account['ip_whitelist']:
for ip in account['ip_whitelist']:
print(f" - {ip}")

# Statistics
stats = account['statistics']
print(f"\nStatistics:")
print(f" Total Payments: {stats['total_payments']}")
print(f" Total Volume: ${stats['total_volume_usd']}")
print(f" Active Currencies: {stats['active_currencies']}")

Error Responses

401 Unauthorized

{
"error": {
"code": "authentication_failed",
"message": "Invalid or missing authentication token"
}
}

403 Forbidden

{
"error": {
"code": "permission_denied",
"message": "Token does not have required scope",
"details": {
"required_scopes": ["read"],
"token_scopes": []
}
}
}

Important Notes

  • The schema_name identifies your tenant in the multi-tenant system
  • Webhook secret is partially masked for security (only first 12 characters shown)
  • API usage counters reset daily at midnight UTC
  • Account limits can be increased by contacting support
  • Some features may require account upgrades

Multi-Tenant Architecture

Cryptofuse uses a multi-tenant architecture where each merchant has:

  • Isolated Database Schema: Your data is completely separated
  • Custom Configuration: Fees, limits, and features per tenant
  • Independent Webhooks: Each tenant has its own webhook settings
  • Separate API Limits: Usage is tracked per tenant

Next Steps