1. Master
VasyOpenAPI
  • Branch
    • Branch List
      GET
  • Department
    • department
      GET
  • Category
    • category
      GET
    • subCategory
      GET
  • Brand
    • Brand
      GET
    • SubBrand
      GET
  • Contact
    • Get Customer List W Branch Id
      GET
    • Get Contact By Id
      GET
    • Get Contact By Mobile No
      GET
    • contactSave
      POST
    • Supplier(Party)
      GET
  • GST
    • Verify GST
      POST
  • Master
    • Get Country List
      GET
    • Get State List
      GET
    • Get City List
      GET
    • Get Tax List
      GET
    • Get Additional Charge List
      GET
  • Product
    • Get Product List
      GET
    • Get Product By ID
      GET
    • products with inventory
      GET
    • product details with Inventory By Product ID
      GET
    • Product Variant List ID & Name
      GET
    • Variant Details By Variant ID
      GET
  • Recipe
    • Get All Recipe
  • User
    • Created By
  • Report
    • Get Sales Item Register Data
    • Purchase Item Register Report
    • Stock Summary Report
    • Stock Transfer Item Register Report
    • Consumption Production Report
  • Sales
    • Get All Sales Data
    • Get Sales Data By Id
    • Order Create
    • Order Status
    • Shipping Details
    • Update Due Date
    • Update Order Status
  1. Master

Get State List

GET
/api/v1/master/location/state

State List#

Purpose#

Retrieve the list of states available for a specific country in VasyERP.

Why would you use this?#

Use this API when your system needs state master data for customer management, supplier management, address validation, tax calculations, or location-based operations.

Information Required#

FieldRequiredDescription
api-tokenYesAuthentication token provided by VasyERP
countryCodeYesCountry code for which states need to be retrieved (e.g., IN for India)

Information Returned#

This API returns state master information including:
State ID
State Code
State Name
Associated Country Code

Example Use Case#

A customer registration form requires users to select a state after selecting a country.
The application can first fetch the list of countries using the Country List API and then use this API to retrieve the available states for the selected country.

Important Notes#

A valid Country Code is required to retrieve state information.
State IDs should be stored and used when referencing states in other APIs.
State information is country-specific.
It is recommended to fetch the latest state data rather than maintaining static state lists.

Common Mistakes#

āŒ Passing an invalid Country Code

Request

Query Params

Header Params

Responses

🟢200
application/json
Bodyapplication/json

🟠403Unauthorized
🟠429Too Many Request
Request Request Example
Shell
JavaScript
Java
Swift
curl --location '/api/v1/master/location/state?countryCode=IN' \
--header 'api-token: {{.in-api-token}}'
Response Response Example
200 - Example 1
{
    "status": true,
    "message": "State List",
    "code": "200",
    "response": [
        {
            "stateId": 1,
            "stateCode": "35",
            "stateName": "Andaman and Nicobar Islands",
            "countryCode": "IN"
        },
        {
            "stateId": 3,
            "stateCode": "12",
            "stateName": "Arunachal Pradesh",
            "countryCode": "IN"
        }
    ]
}
Previous
Get Country List
Next
Get City List
Built with