Skip to content

Quick Start

Make your first API call in under 10 minutes.

Step 1 — Get your credentials

Sign up at developers.api4business.com to get your OAuth2 client credentials (client ID and client secret). See our step-by-step signup guide for the full walkthrough.

Sandbox available

Sandbox credentials are available immediately after signup. Use them to test without affecting production data.

Step 2 — Get an access token

Exchange your client credentials for an access token:

bash
curl -X POST https://api.api4business.com/oauth/v1/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"
python
import requests

response = requests.post(
  "https://api.api4business.com/oauth/v1/token",
  data={
    "grant_type": "client_credentials",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
  }
)
token = response.json()["access_token"]
print(f"Token: {token}")
javascript
const response = 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 response.json();
console.log("Token:", access_token);
java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create("https://api.api4business.com/oauth/v1/token"))
  .header("Content-Type", "application/x-www-form-urlencoded")
  .POST(HttpRequest.BodyPublishers.ofString(
    "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
  ))
  .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

Step 3 — Make your first API call

Verify a PAN number:

bash
curl -X POST https://api.api4business.com/vas-api/pan-validation-v1 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pan": "ABCDE1234F"}'
python
import requests

response = requests.post(
  "https://api.api4business.com/vas-api/pan-validation-v1",
  headers={
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json"
  },
  json={"pan": "ABCDE1234F"}
)
print(response.json())
javascript
const result = 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 result.json());
java
HttpRequest apiRequest = HttpRequest.newBuilder()
  .uri(URI.create("https://api.api4business.com/vas-api/pan-validation-v1"))
  .header("Authorization", "Bearer " + accessToken)
  .header("Content-Type", "application/json")
  .POST(HttpRequest.BodyPublishers.ofString("{\"pan\": \"ABCDE1234F\"}"))
  .build();
HttpResponse<String> apiResponse = client.send(apiRequest, HttpResponse.BodyHandlers.ofString());
System.out.println(apiResponse.body());

Step 4 — Check the response

A successful response looks like:

json
{
  "ok": true,
  "responseCode": 200,
  "message": "Transmission OK",
  "body": {
    "panName": "SAMPLE ENTERPRISE PRIVATE LIMITED",
    "panNumber": "ABCDE1234F",
    "panStatus": "Active"
  }
}

Response headers

Every successful response includes an x-request-id header. Save this for debugging and support requests.

What's next

Released under the API4Business Terms of Service