Skip to content

Node.js SDK

Coming Soon

The official Node.js SDK is under development. Use fetch or axios for direct integration.

Direct integration with fetch

javascript
// Step 1: Get access token
const authResponse = await fetch("https://api.api4business.com/oauth/v1/token", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams({
    grant_type: "client_credentials",
    client_id: "YOUR_CLIENT_ID",
    client_secret: "YOUR_CLIENT_SECRET"
  })
});
const { access_token } = await authResponse.json();

// Step 2: Call any endpoint
const response = await fetch("https://api.api4business.com/vas-api/pan-validation-v1", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${access_token}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ pan: "ABCDE1234F" })
});
console.log(await response.json());

Released under the API4Business Terms of Service