Skip to main content
Version: v2

Risk Management & Pre-screening

Risk management and compliance endpoints for trusted crypto providers.

Pre-screen Order Eligibility

Validate user data (IP, sender address, withdraw address, pair, and amounts) to determine eligibility for order creation. This endpoint performs risk assessment and compliance checks before an order is created.

Trusted Providers Only

This endpoint requires a trusted referral token header and is only available to approved crypto providers.

Request

curl -X POST "https://api.n.exchange/en/api/v2/pre_screening/" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "x-referral-token: your-trusted-referral-token" \
-H "Authorization: ApiKey api_key" \
-d '{
"ip": "192.168.1.1",
"sender_address": "0x1234567890abcdef1234567890abcdef12345678",
"withdraw_address": "0xabcdef1234567890abcdef1234567890abcdef12",
"pair": "BTCUSDC",
"withdraw_amount": "1.0"
}'

Required Headers:

HeaderRequiredDescription
x-referral-tokenYesTrusted referral token for identification and access

Request Parameters:

FieldTypeRequiredDescription
ipstringNoUser's IP address for geolocation and risk assessment (IPv4 format)
sender_addressstringNoCryptocurrency sender address for compliance checking
withdraw_addressstringNoUser's withdraw address for risk validation
pairstringNoTrading pair name (e.g., BTCUSDC, ETHBTC)
deposit_amountstringNo*Deposit amount (cannot be used with withdraw_amount)
withdraw_amountstringNo*Withdraw amount (cannot be used with deposit_amount)

*Either deposit_amount or withdraw_amount can be provided, but not both.

Example Request Bodies:

Full pre-screening with withdraw amount:

{
"ip": "192.168.1.1",
"sender_address": "0x1234567890abcdef1234567890abcdef12345678",
"withdraw_address": "0xabcdef1234567890abcdef1234567890abcdef12",
"pair": "BTCUSDC",
"withdraw_amount": "1.0"
}

Pre-screening with deposit amount:

{
"ip": "192.168.1.100",
"sender_address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"withdraw_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
"pair": "BTCUSDC",
"deposit_amount": "50000.0"
}

Partial pre-screening with minimal data:

{
"ip": "10.0.0.1",
"pair": "ETHBTC"
}

IP-only pre-screening:

{
"ip": "203.0.113.195"
}

Response

Pre-screening completed with status and message indicating the result.

Response Fields:

FieldTypeDescription
statusstringStatus of the pre-screening check ("success", "failed", "error", "unauthorized")
messagestringDetailed message about the pre-screening result

Example Responses:

Pre-screening passed:

{
"status": "success",
"message": "Pre-screening passed."
}

Partial pre-screening passed:

{
"status": "success",
"message": "Partial pre-screening passed. Provide all details for full pre-screen validation."
}

Pre-screening failed:

{
"status": "failed",
"message": "The country of the user's IP is blocked."
}

Key Changes from v1

Field Name Changes

  • amount_basewithdraw_amount
  • amount_quotedeposit_amount

Response Format

v2 uses structured response with status and message fields instead of simple detail messages:

v1 Response:

{
"detail": "The country of the user's IP is blocked."
}

v2 Response:

{
"status": "failed",
"message": "The country of the user's IP is blocked."
}

Risk Assessment Features

IP Geolocation Checking

Automatically validates user IP addresses against:

  • Blocked countries and regions
  • Sanctioned territories
  • High-risk jurisdictions

Address Validation

Sender and withdrawal addresses are screened against:

  • Sanctions lists (OFAC, EU, UN)
  • Known criminal addresses
  • Mixer and tumbler services
  • Darknet marketplace addresses

Transaction Monitoring

Validates trading parameters for:

  • Unusual transaction amounts
  • Suspicious patterns
  • AML/KYC compliance thresholds

Error Responses

400 Bad Request

Returned for invalid input data.

Example:

{
"status": "error",
"message": "Only one of deposit_amount or withdraw_amount can be provided"
}

401 Unauthorized

Returned when the referral token is missing or invalid.

Example:

{
"status": "unauthorized",
"message": "Pre-screening not applicable."
}

403 Forbidden

Returned when pre-screening fails due to compliance issues.

Example:

{
"detail": "The country of the user's IP is blocked."
}

404 Not Found

Returned when the endpoint is not found (missing referral token or configuration issue).

Example:

{
"detail": "Not found"
}

Integration Best Practices

  1. Always Pre-screen: Run pre-screening before showing exchange options
  2. Handle Failures Gracefully: Provide clear user messaging for blocked transactions
  3. Secure Tokens: Keep referral tokens confidential and rotate regularly
  4. Monitor Results: Track rejection rates for compliance reporting

Next Steps

  • Orders - Create orders after successful pre-screening
  • Rates - Get current exchange rates
  • Currencies - Learn about supported currencies