Skip to content

Notifications

Preview
  • Your Japan eSIM is ready to install20 Nov, 08:10
  • You have used 80% of your France data19 Nov, 17:45
  • Referral reward approved17 Nov, 12:00
  • New sign-in from Chrome on Windows15 Nov, 21:03
  • Your plan expires in 3 days12 Nov, 09:00
View all

Preview identity. Real sessions arrive in Phase 2.

Switch workspace Settings Log out
Frontend preview. Figures, records and charts on this page are generated preview data, not real activity. Actions that need the backend show what they will do in Phase 2.

Build

SDK examples

Copy-paste examples for common languages. Official SDKs are planned; these use plain HTTP clients.

Create an order

curl -X POST https://sandbox.api.nesvra.com/api/v1/orders \
  -H "Authorization: Bearer $NESVRA_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"product":"japan-10gb-30d","quantity":1}],"customer":{"email":"traveller@example.com"}}'

Create an order (PHP, Guzzle)

$client = new GuzzleHttp\Client(['base_uri' => 'https://sandbox.api.nesvra.com/api/v1/']);
$res = $client->post('orders', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('NESVRA_KEY'),
        'Idempotency-Key' => bin2hex(random_bytes(16)),
    ],
    'json' => ['items' => [['product' => 'japan-10gb-30d', 'quantity' => 1]], 'customer' => ['email' => 'traveller@example.com']],
]);
$order = json_decode((string) $res->getBody(), true)['data'];

Create an order (Node.js 18+)

const res = await fetch('https://sandbox.api.nesvra.com/api/v1/orders', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.NESVRA_KEY}`,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ items: [{ product: 'japan-10gb-30d', quantity: 1 }], customer: { email: 'traveller@example.com' } }),
});
const { data: order } = await res.json();

Create an order (Python, requests)

import os, uuid, requests
res = requests.post(
    'https://sandbox.api.nesvra.com/api/v1/orders',
    headers={'Authorization': f"Bearer {os.environ['NESVRA_KEY']}", 'Idempotency-Key': str(uuid.uuid4())},
    json={'items': [{'product': 'japan-10gb-30d', 'quantity': 1}], 'customer': {'email': 'traveller@example.com'}},
    timeout=15,
)
order = res.json()['data']