Developer API

Public NexOTP REST API

Build automations, dashboards, and custom integrations with the versioned NexOTP API. Every response uses the same envelope, every request is authenticated with an API key, and v1 stays stable as future versions are added.

Base URL
https://visualtrinitystudio.xyz/wp-json/nexotp/v1/
Authentication
X-NexOTP-API-Key: YOUR_API_KEY
GET /account

Get account summary

Returns wallet balance, current API plan, and usage stats.

Rate bucket: GENERAL
cURL
curl -X GET \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account';
const options = {
  method: 'GET',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
GET /account/transactions?page=1&per_page=20

Get transaction history

Returns paginated wallet transaction history.

Rate bucket: GENERAL
Query Params
page Page number
per_page Items per page, max 100
cURL
curl -X GET \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account/transactions?page=1&per_page=20' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account/transactions?page=1&per_page=20';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account/transactions?page=1&per_page=20'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/account/transactions?page=1&per_page=20';
const options = {
  method: 'GET',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
GET /countries

List countries

Lists all available countries for the active supply network.

Rate bucket: GENERAL
cURL
curl -X GET \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/countries' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/countries';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/countries'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/countries';
const options = {
  method: 'GET',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
GET /services?country={country_code}

List services

Lists available services for a country code returned by /countries.

Rate bucket: GENERAL
Query Params
country Country code returned by /countries
cURL
curl -X GET \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/services?country=cty_SAMPLE' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/services?country=cty_SAMPLE';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/services?country=cty_SAMPLE'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/services?country=cty_SAMPLE';
const options = {
  method: 'GET',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
GET /price?service={service_id}&country={country_code}

Get price

Returns the current sell price for a service and country.

Rate bucket: GENERAL
Query Params
service Service ID returned by /services
country Country code returned by /countries
cURL
curl -X GET \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/price?service=svc_SAMPLE&country=cty_SAMPLE' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/price?service=svc_SAMPLE&country=cty_SAMPLE';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/price?service=svc_SAMPLE&country=cty_SAMPLE'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/price?service=svc_SAMPLE&country=cty_SAMPLE';
const options = {
  method: 'GET',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
POST /order

Place order

Places an OTP order and returns the created order data.

Rate bucket: ORDER
Body Fields
service Service ID returned by /services
country Country code returned by /countries
pool Optional pool identifier
pricing_option 0 for cheapest, 1 for best rate
max_price Optional max USD price
cURL
curl -X POST \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "service": "value",
    "country": "value",
    "pool": "value",
    "pricing_option": "value",
    "max_price": "value"
}'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY',
  'Content-Type: application/json'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
    "service": "value",
    "country": "value",
    "pool": "value",
    "pricing_option": "value",
    "max_price": "value"
}');
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}
payload = {
    "service": "value",
    "country": "value",
    "pool": "value",
    "pricing_option": "value",
    "max_price": "value"
}
response = requests.request('POST', url, headers=headers, json=payload)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order';
const options = {
  method: 'POST',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "service": "value",
    "country": "value",
    "pool": "value",
    "pricing_option": "value",
    "max_price": "value"
})
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
GET /order/{id}

Check order

Returns the current order state and OTP code once complete.

Rate bucket: POLL
cURL
curl -X GET \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1';
const options = {
  method: 'GET',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
POST /order/{id}/cancel

Cancel order

Cancels an active order when the session rules allow it.

Rate bucket: ORDER
cURL
curl -X POST \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/cancel' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/cancel';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY',
  'Content-Type: application/json'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/cancel'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}
payload = {}
response = requests.request('POST', url, headers=headers, json=payload)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/cancel';
const options = {
  method: 'POST',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({})
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
POST /order/{id}/resend

Resend order

Requests another code for the same number when supported.

Rate bucket: ORDER
cURL
curl -X POST \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/resend' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/resend';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY',
  'Content-Type: application/json'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/resend'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}
payload = {}
response = requests.request('POST', url, headers=headers, json=payload)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/order/1/resend';
const options = {
  method: 'POST',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({})
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
GET /webhooks

List webhooks

Lists registered outbound webhook endpoints for the authenticated user.

Rate bucket: GENERAL
cURL
curl -X GET \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks';
const options = {
  method: 'GET',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
POST /webhooks

Create webhook

Registers a webhook endpoint and returns its signing secret once.

Rate bucket: GENERAL
Body Fields
endpoint_url HTTPS endpoint URL
events Array of event names or comma-separated string
cURL
curl -X POST \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "endpoint_url": "value",
    "events": "value"
}'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY',
  'Content-Type: application/json'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
    "endpoint_url": "value",
    "events": "value"
}');
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}
payload = {
    "endpoint_url": "value",
    "events": "value"
}
response = requests.request('POST', url, headers=headers, json=payload)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks';
const options = {
  method: 'POST',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "endpoint_url": "value",
    "events": "value"
})
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));
DELETE /webhooks/{id}

Delete webhook

Deletes a previously registered webhook endpoint.

Rate bucket: GENERAL
cURL
curl -X DELETE \
  'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks/1' \
  -H 'X-NexOTP-API-Key: YOUR_API_KEY'
PHP
$url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks/1';
$headers = [
  'X-NexOTP-API-Key: YOUR_API_KEY'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
echo curl_exec($ch);
curl_close($ch);
Python
import requests

url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks/1'
headers = {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
}
payload = {}
response = requests.request('DELETE', url, headers=headers, json=payload)
print(response.json())
JavaScript / Node
const url = 'https://visualtrinitystudio.xyz/wp-json/nexotp/v1/webhooks/1';
const options = {
  method: 'DELETE',
  headers: {
    'X-NexOTP-API-Key': 'YOUR_API_KEY'
  }
};

fetch(url, options)
  .then((res) => res.json())
  .then((json) => console.log(json));