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.
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:
| Header | Required | Description |
|---|---|---|
x-referral-token | Yes | Trusted referral token for identification and access |
Request Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
ip | string | No | User's IP address for geolocation and risk assessment (IPv4 format) |
sender_address | string | No | Cryptocurrency sender address for compliance checking |
withdraw_address | string | No | User's withdraw address for risk validation |
pair | string | No | Trading pair name (e.g., BTCUSDC, ETHBTC) |
deposit_amount | string | No* | Deposit amount (cannot be used with withdraw_amount) |
withdraw_amount | string | No* | 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:
| Field | Type | Description |
|---|---|---|
status | string | Status of the pre-screening check ("success", "failed", "error", "unauthorized") |
message | string | Detailed 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_base→withdraw_amountamount_quote→deposit_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
- Always Pre-screen: Run pre-screening before showing exchange options
- Handle Failures Gracefully: Provide clear user messaging for blocked transactions
- Secure Tokens: Keep referral tokens confidential and rotate regularly
- 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