Skip to main content

State List

A request to the following endpoint returns a list of all State Objects currently registed in our system

Request​

GET - {{url}}/api/public/merchant/state

Headers
{
"Accept": "application/json",
"Authorization": "Bearer {{ token }}",
"Content-Type": "application/json",
"X-tenant": "{{ tenant }}",
}

Allowed Filters And Attributes​

  • filter[name] : String - Filters a list of states by their name
  • filter[country_id] : Integer - Filters a list of states by their country ID
  • paginate : Integer - Specifies the pagination to use for the response object
  • noPagination - Ignores pagination and return a list of all states

Response​

Status - 200 - OK

Sample Response Object
{
"data": [
{
"id": 1,
"ref_no": "ST-0001",
"name": "Colombo",
"country_id": 1,
"created_at": "2022-02-03T08:21:36.000000Z",
"updated_at": "2022-02-03T08:21:36.000000Z",
"has_child": true
},
{
"id": 2,
"ref_no": "ST-0002",
"name": "Colombo Suburbs",
"country_id": 1,
"created_at": "2022-02-03T08:21:36.000000Z",
"updated_at": "2022-02-03T08:21:36.000000Z",
"has_child": true
},
{
"id": 3,
"ref_no": "ST-0003",
"name": "Greater Colombo",
"country_id": 1,
"created_at": "2022-02-03T08:21:37.000000Z",
"updated_at": "2022-02-03T08:21:37.000000Z",
"has_child": true
},
{
"id": 4,
"ref_no": "ST-0004",
"name": "Ampara",
"country_id": 1,
"created_at": "2022-02-03T08:21:38.000000Z",
"updated_at": "2022-02-03T08:21:38.000000Z",
"has_child": true
},
{
"id": 5,
"ref_no": "ST-0005",
"name": "Anuradhapura",
"country_id": 1,
"created_at": "2022-02-03T08:21:39.000000Z",
"updated_at": "2022-02-03T08:21:39.000000Z",
"has_child": true
},
{
"id": 6,
"ref_no": "ST-0006",
"name": "Badulla",
"country_id": 1,
"created_at": "2022-02-03T08:21:43.000000Z",
"updated_at": "2022-02-03T08:21:43.000000Z",
"has_child": true
},
{
"id": 7,
"ref_no": "ST-0007",
"name": "Batticaloa",
"country_id": 1,
"created_at": "2022-02-03T08:21:48.000000Z",
"updated_at": "2022-02-03T08:21:48.000000Z",
"has_child": true
},
{
"id": 8,
"ref_no": "ST-0008",
"name": "Galle",
"country_id": 1,
"created_at": "2022-02-03T08:21:51.000000Z",
"updated_at": "2022-02-03T08:21:51.000000Z",
"has_child": true
},
{
"id": 9,
"ref_no": "ST-0009",
"name": "Gampaha",
"country_id": 1,
"created_at": "2022-02-03T08:21:54.000000Z",
"updated_at": "2022-02-03T08:21:54.000000Z",
"has_child": true
},
{
"id": 10,
"ref_no": "ST-0010",
"name": "Hambantota",
"country_id": 1,
"created_at": "2022-02-03T08:22:01.000000Z",
"updated_at": "2022-02-03T08:22:01.000000Z",
"has_child": true
},
{
"id": 11,
"ref_no": "ST-0011",
"name": "Jaffna",
"country_id": 1,
"created_at": "2022-02-03T08:22:04.000000Z",
"updated_at": "2022-02-03T08:22:04.000000Z",
"has_child": true
},
{
"id": 12,
"ref_no": "ST-0012",
"name": "Kalutara",
"country_id": 1,
"created_at": "2022-02-03T08:22:08.000000Z",
"updated_at": "2022-02-03T08:22:08.000000Z",
"has_child": true
},
{
"id": 13,
"ref_no": "ST-0013",
"name": "Kandy",
"country_id": 1,
"created_at": "2022-02-03T08:22:13.000000Z",
"updated_at": "2022-02-03T08:22:13.000000Z",
"has_child": true
},
{
"id": 14,
"ref_no": "ST-0014",
"name": "Kegalle",
"country_id": 1,
"created_at": "2022-02-03T08:22:20.000000Z",
"updated_at": "2022-02-03T08:22:20.000000Z",
"has_child": true
},
{
"id": 15,
"ref_no": "ST-0015",
"name": "Kilinochchi",
"country_id": 1,
"created_at": "2022-02-03T08:22:25.000000Z",
"updated_at": "2022-02-03T08:22:25.000000Z",
"has_child": true
}
],
"links": {
"first": "http://v1.api.curfox.com/api/public/merchant/state?page=1",
"last": "http://v1.api.curfox.com/api/public/merchant/state?page=2",
"prev": null,
"next": "http://v1.api.curfox.com/api/public/merchant/state?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://v1.api.curfox.com/api/public/merchant/state?page=1",
"label": "1",
"active": true
},
{
"url": "http://v1.api.curfox.com/api/public/merchant/state?page=2",
"label": "2",
"active": false
},
{
"url": "http://v1.api.curfox.com/api/public/merchant/state?page=2",
"label": "Next »",
"active": false
}
],
"path": "http://v1.api.curfox.com/api/public/merchant/state",
"per_page": 15,
"to": 15,
"total": 27
}
}

ERRORS​

Invalid Bearer Token
{
"message": "Unauthenticated."
}