GeoPaySwitch routes transactions through optimal virtual regions to beat fees and limits. AI-driven. Instant.
Every cross-border transaction burns money. We fixed it.
We analyze the card origin and route it through a local processor instead of an international one.
Transaction failed? Our AI instantly retries through the next best route. Your user never sees an error.
Access 23 regions immediately. US, EU, UK, Singapore, Japan, and more without new entities.
Type-safe SDK. Full TypeScript support.
import { GeoPaySwitch } from "geopay-switch";
const client = new GeoPaySwitch({
layer403: {
apiKey: process.env.API_KEY,
},
routing: {
mode: "auto",
fallback: { enabled: true }
}
});
// Automatic routing optimization
const result = await client.pay({
amount: 99.99,
currency: "EUR",
cardToken: "tok_visa_4242",
userCountry: "DE"
});
console.log(`Saved: $${result.costSaved}`);
Complete REST API for integrating GeoPay payment routing in any language. Built for developers who demand speed, reliability, and global coverage.
https://geopay403.xyz/api
All API requests require authentication via headers. Include these with every request:
X-GeoPay-Key: gp_live_xxxxx
X-GeoPay-Timestamp: 2024-01-15T12:00:00.000Z
X-GeoPay-Nonce: unique_random_string
X-GeoPay-Signature: hmac_sha256_signature
// Sandbox API Key (no real charges)
API Key: gp_live_test123456789
Secret: sk_test_secret
{
"success": true,
"data": { ... },
"requestId": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
/api/regions
Returns a list of all available payment regions with their supported currencies, payment methods, fee structures, and current health metrics.
| Parameter | Type | Description |
|---|---|---|
active | boolean | Filter by active status. Default: true |
{
"success": true,
"data": [
{
"code": "EU",
"name": "European Union",
"countries": ["DE", "FR", "ES", "IT", ...],
"currencies": ["EUR"],
"methods": ["card", "sepa", "apple_pay", "google_pay"],
"active": true,
"limits": {
"min": 0.50,
"max": 100000,
"perTransaction": 50000
},
"baseFees": {
"percentFee": 1.4,
"fixedFee": 0.25,
"fxFee": 0
},
"successRate": 0.987,
"avgLatencyMs": 180
}
],
"requestId": "req_abc123",
"timestamp": "2024-01-15T12:00:00.000Z"
}
/api/regions/:code
Returns detailed information for a specific region by its code (e.g., EU, US, UK).
/api/quote
Get optimized payment quotes across all regions. Returns fee breakdowns, success rates, and the recommended route for your payment intent.
{
"intent": {
"amount": 99.99,
"currency": "EUR",
"paymentMethod": "card",
"userCountry": "DE", // optional
"cardToken": "tok_visa_4242", // optional
"customerEmail": "user@example.com"
},
"regions": ["EU", "US"], // optional filter
"includeUnavailable": false // optional
}
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Payment amount in specified currency |
currency | string | Yes | ISO 4217 currency code (EUR, USD, GBP...) |
paymentMethod | string | Yes | One of: card, sepa, ach, pix, boleto, apple_pay, google_pay, bank_transfer, wallet |
userCountry | string | No | ISO 3166-1 alpha-2 country code |
cardToken | string | No | Tokenized card from your PSP |
customerEmail | string | No | Customer email for receipts |
metadata | object | No | Custom key-value pairs |
{
"success": true,
"data": {
"quotes": [
{
"region": "EU",
"routerId": "router_eu_a1b2c3",
"routerName": "European Union Gateway",
"totalCost": 1.65,
"feeBreakdown": {
"percentFee": 1.4,
"fixedFee": 0.25,
"fxFee": 0,
"crossBorderFee": 0
},
"successRate": 0.987,
"latencyMs": 185,
"score": 98.2,
"available": true,
"validForSec": 300
}
],
"recommended": { ... },
"totalRegions": 5
}
}
/api/pay
Execute a payment through the specified region. Supports idempotency keys for safe retries.
| Header | Description |
|---|---|
X-GeoPay-Region | Target region code (e.g., EU, US) |
X-Idempotency-Key | Unique key for request deduplication |
{
"intent": {
"amount": 99.99,
"currency": "EUR",
"paymentMethod": "card",
"cardToken": "tok_visa_4242",
"customerEmail": "customer@example.com",
"description": "Order #12345",
"returnUrl": "https://yoursite.com/success",
"webhookUrl": "https://yoursite.com/webhooks/geopay"
},
"region": "EU",
"routerId": "router_eu_a1b2c3",
"idempotencyKey": "order_12345_attempt_1"
}
{
"success": true,
"data": {
"intentId": "pi_abc123def456",
"status": "succeeded",
"regionUsed": "EU",
"routerId": "router_eu_a1b2c3",
"providerPaymentId": "ch_xyz789",
"costApplied": 1.65,
"amountCharged": 99.99,
"currencyCharged": "EUR",
"processedAt": "2024-01-15T12:00:00.000Z",
"receiptUrl": "https://geopay403.xyz/receipts/pi_abc123",
"authCode": "A1B2C3"
}
}
| Status | Description |
|---|---|
succeeded | Payment completed successfully |
failed | Payment was declined |
pending | Payment is being processed asynchronously |
requires_action | 3D Secure or redirect required |
processing | Payment is in progress |
cancelled | Payment was cancelled |
For payments over €100, the API may return requires_action with a nextAction object containing a redirect URL.
Your customer must complete 3DS authentication before the payment can proceed.
/api/refund
Process a full or partial refund for a completed payment. Supports idempotency for safe retries.
{
"refundIntent": {
"paymentIntentId": "pi_abc123def456",
"providerPaymentId": "ch_xyz789",
"amount": 50.00, // optional, full refund if omitted
"reason": "requested_by_customer",
"metadata": {
"refund_ticket": "TICKET-789"
}
},
"region": "EU",
"idempotencyKey": "refund_pi_abc123_1"
}
| Code | Description |
|---|---|
requested_by_customer | Customer requested the refund |
duplicate | Duplicate charge |
fraudulent | Fraudulent transaction |
product_not_received | Product was not delivered |
product_unacceptable | Product quality issues |
other | Other reason |
{
"success": true,
"data": {
"paymentIntentId": "pi_abc123def456",
"refundId": "re_xyz789",
"status": "succeeded",
"amount": 50.00,
"currency": "EUR",
"regionUsed": "EU",
"processedAt": "2024-01-15T14:00:00.000Z"
}
}
GeoPay sends webhook events to notify your application about payment status changes. All webhooks are signed with HMAC-SHA256 for security.
{
"id": "evt_abc123",
"type": "payment.succeeded",
"created": "2024-01-15T12:00:00.000Z",
"data": {
"intentId": "pi_abc123def456",
"providerPaymentId": "ch_xyz789",
"amount": 99.99,
"currency": "EUR",
"region": "EU",
"routerId": "router_eu_a1b2c3",
"metadata": {}
}
}
| Event | Description |
|---|---|
payment.succeeded | Payment completed successfully |
payment.failed | Payment was declined or failed |
payment.pending | Payment is processing asynchronously |
payment.refunded | Payment was refunded |
refund.succeeded | Refund completed successfully |
refund.failed | Refund processing failed |
const crypto = require('crypto');
function verifyWebhook(payload, signature, timestamp, secret) {
const signedPayload = `${timestamp}.${payload}`;
const expected = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
All errors follow a consistent format with machine-readable codes and human-readable messages.
{
"success": false,
"error": {
"code": "PAYMENT_DECLINED",
"message": "The payment was declined by the processor",
"details": {
"decline_code": "insufficient_funds"
}
},
"requestId": "req_abc123",
"timestamp": "2024-01-15T12:00:00.000Z"
}
| Code | HTTP | Description |
|---|---|---|
PAYMENT_DECLINED | 400 | Payment was declined by processor |
INSUFFICIENT_FUNDS | 400 | Card has insufficient funds |
CARD_EXPIRED | 400 | Card has expired |
INVALID_CARD | 400 | Card number is invalid |
FRAUD_DETECTED | 400 | Transaction flagged as fraudulent |
AUTHENTICATION_REQUIRED | 400 | 3DS authentication needed |
AUTHENTICATION_FAILED | 400 | 3DS authentication failed |
| Code | HTTP | Description |
|---|---|---|
REGION_NOT_FOUND | 404 | Specified region does not exist |
REGION_NOT_ALLOWED | 403 | Region is not available for your account |
NO_AVAILABLE_REGIONS | 400 | No regions support this payment |
REGION_LIMIT_EXCEEDED | 400 | Amount exceeds region limits |
METHOD_NOT_SUPPORTED | 400 | Payment method not supported in region |
| Code | HTTP | Description |
|---|---|---|
AUTHENTICATION_ERROR | 401 | Invalid API credentials |
RATE_LIMITED | 429 | Too many requests |
TIMEOUT | 504 | Request timed out |
SERVICE_UNAVAILABLE | 503 | Service temporarily unavailable |
INTERNAL_ERROR | 500 | Internal server error |
const GeoPay = require('geopay-switch');
const geopay = new GeoPay({
apiKey: 'gp_live_test123456789',
secret: 'sk_test_secret',
baseUrl: 'https://geopay403.xyz/api'
});
// Get optimized quotes
const quotes = await geopay.quote({
amount: 99.99,
currency: 'EUR',
paymentMethod: 'card',
userCountry: 'DE'
});
// Execute payment with best route
const payment = await geopay.pay({
intent: {
amount: 99.99,
currency: 'EUR',
paymentMethod: 'card',
cardToken: 'tok_visa_4242'
},
region: quotes.recommended.region,
routerId: quotes.recommended.routerId
});
console.log(`Payment ${payment.status}: ${payment.intentId}`);
import requests
BASE_URL = "https://geopay403.xyz/api"
API_KEY = "gp_live_test123456789"
headers = {
"Content-Type": "application/json",
"X-GeoPay-Key": API_KEY
}
# Get optimized quotes
quote_resp = requests.post(
f"{BASE_URL}/quote",
headers=headers,
json={
"intent": {
"amount": 99.99,
"currency": "EUR",
"paymentMethod": "card",
"userCountry": "DE"
}
}
)
quotes = quote_resp.json()
# Execute payment
pay_resp = requests.post(
f"{BASE_URL}/pay",
headers={**headers, "X-GeoPay-Region": "EU"},
json={
"intent": {
"amount": 99.99,
"currency": "EUR",
"paymentMethod": "card",
"cardToken": "tok_visa_4242"
},
"region": quotes["data"]["recommended"]["region"]
}
)
print(pay_resp.json())
# Get payment quotes
curl -X POST https://geopay403.xyz/api/quote \
-H "Content-Type: application/json" \
-H "X-GeoPay-Key: gp_live_test123456789" \
-d '{
"intent": {
"amount": 99.99,
"currency": "EUR",
"paymentMethod": "card",
"userCountry": "DE"
}
}'
# Execute payment
curl -X POST https://geopay403.xyz/api/pay \
-H "Content-Type: application/json" \
-H "X-GeoPay-Key: gp_live_test123456789" \
-H "X-GeoPay-Region: EU" \
-H "X-Idempotency-Key: order_12345" \
-d '{
"intent": {
"amount": 99.99,
"currency": "EUR",
"paymentMethod": "card",
"cardToken": "tok_visa_4242"
},
"region": "EU",
"routerId": "router_eu_a1b2c3"
}'
Test the API directly from your browser. Results are displayed in real-time.
Click "Send Request" to test...
Our journey to autonomous global finance.
Release of the NPM library v1.0. Deployment of 23 global edge nodes. Smart Routing Engine initial release.
Merchant Analytics Dashboard beta. Webhooks V2 with auto-retries. Python and Go SDK development.
Crypto-to-Fiat instant settlement layer. Mobile SDK for iOS and Android. Decentralized governance voting.
We are building this for you. Feature requests and feedback are welcome.
Common questions about GeoPay