Skip to content

GST Management

The GST section helps manage Goods and Services Tax (GST) information, including the automatic retrieval of state names based on the state code from a valid GSTIN.

When adding or editing a B2B customer or supplier, you can enter a valid GSTIN (Goods and Services Tax Identification Number). The system will automatically fill in the State field for you.

How It Works:

  1. Enter the GSTIN: Input a valid GSTIN.
  2. Automatic State Name Fill: The system extracts the two-digit state code and retrieves the corresponding state name.
  3. State Field Update: The state name is auto-filled in the State field.

Example:

  • GSTIN: Enter 03ABCDE1234F2Z5, and the system extracts 03 as the state code.
  • State Field: Automatically fills with PUNJAB.

Reduce error due to manual work

No need to manually find the state name; the system does it for you.

Note for developers

This section provides details on how the system automatically retrieves and fills the state name.

GST API for State Name Retrieval

  • API Endpoint: http://localhost:8000/gst/get-state-name?code=<two-digit-numeric-state-code-here>

  • Example: Request: http://127.0.0.1:8000/gst/get-state-name?code=03 Response: json { "stateName": "PUNJAB" }

Example JavaScript Code to fetch state name from state code

Use the following JavaScript code to fetch the state name:

fetch(`/gst/get-state-name?code=${stateCode}`)
    .then(response => response.json())
    .then(data => {
        if (data.stateName) {
            stateField.value = data.stateName;
        } else {
            console.error('State name not found:', data);
        }
    })
    .catch(error => console.error('Error fetching state name:', error));

Tips for implementation of GST state name API

API Integration: Make sure the API is correctly configured.
Error Handling: Ensure proper handling for missing state names or API errors.
Performance: Optimize the API call to minimize delays.
This ensures the correct state is selected, reducing manual errors and improving accuracy.