Using JWT with of-v
What is JWT?
JWT (JSON Web Token) is a secure token we use to verify your identity when you access our API. It looks like a long string of letters and numbers.
Example:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Get Your JWT
We give you a JWT when you:
- Log in.
- Or manually request one via our dashboard or support
Use JWT in Your Example Request
When calling our API, you must include the JWT token in the Authorization header
- JavaScript example:
-
const jwtToken = "YOUR_JWT_TOKEN_HERE"; // Replace with your actual JWT token const paymentData = { sw_add: "0xabc123...", // Sender ETH Wallet Address (Must Match) ag_id: "user@example.com", // Your user ID or email in OF-V c_od: "Subscription July", // Your Order title am_t_v: 8.00 // Payment amount }; fetch("https://of-v.com:99/jwt/v1/pay", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${jwtToken}` }, body: JSON.stringify(paymentData) }) .then(res => res.json()) .then(result => { console.log("Payment response:", result); if (result.order_id && result.icode) { // Redirect to order page window.location.href = `https://of-v.com:99/o?io=${result.order_id}&ic=${result.icode}`; } else { alert("Unexpected response format."); } }) .catch(err => { console.error("Request failed:", err); alert("Payment request failed. Please try again."); });
Verify Success
If your JWT is valid and the request is successful, you'll receive a JSON response like this:
-
{ "message": "Order created successfully.", // Confirmation message "order_id": "abc123", // Unique order ID for this transaction "status": "Deposit Pending", // Payment status (usually Deposit Pending) "icode": "b500c10c005dd4e99064337cc7027..." // Internal tracking code for verification }
-
{ "error": "Invalid token claims" }
If the JWT is missing or invalid, you’ll get:
Keep Your Token Safe
- Do not share your token.
- Tokens expire automatically (e.g. after 365 days).
- Get a new token when expired.
For Frontend Integration (JavaScript):
Support
© 2025 Yuka.Nikin Coding Studio
Made with by Yuka.Nikin