### Get States API Response (JSON) Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 This is an example of a successful JSON response when retrieving states. It includes a success message, message code, and a data object containing an array of state objects, each with an ID and name. ```json { "message": "Operation successful.", "messageCode": "00", "data": { "states": [ { "id": 0, "name": "string" } ] } } ``` -------------------------------- ### Get Cities by State API Response (JSON) Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 An example of a successful JSON response when retrieving cities by state. The response contains a success message, message code, and a data object with an array of city objects, each having an ID and name. ```json { "message": "Operation successful.", "messageCode": "00", "data": { "cities": [ { "id": 0, "name": "string" } ] } } ``` -------------------------------- ### GET /admin/locations/states Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 Retrieves a list of all available states. This endpoint is useful for populating dropdowns or lists where users need to select a state. ```APIDOC ## GET /admin/locations/states ### Description Retrieves a list of all available states. This endpoint is useful for populating dropdowns or lists where users need to select a state. ### Method GET ### Endpoint https://{{serverNameCommerceApi}}/admin/locations/states ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location -g 'https://{{serverNameCommerceApi}}/admin/locations/states' \ --header 'Authorization: Bearer MTcxMTEyMjM4NjQwNCQyYiQxMCR4dFJwOGJia0FpUW8zWXBpQ1BYcjJ1c0ZNUDNaVDdZUzNZdjcuSy8zNi9EaXA0RmZXak5yM***' ``` ### Response #### Success Response (200) - **message** (string) - A message indicating the success of the operation. - **messageCode** (string) - A code representing the status of the operation. - **data** (object) - Contains additional response data. - **states** (array) - An array of objects, where each object represents a state. - **id** (integer) - The unique identifier for the state. - **name** (string) - The name of the state. #### Response Example ```json { "message": "Operation successful.", "messageCode": "00", "data": { "states": [ { "id": 0, "name": "string" } ] } } ``` ``` -------------------------------- ### Get States API Request (curl) Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 This snippet demonstrates how to retrieve a list of states using a curl command. It requires an Authorization header with a Bearer token and hits the /admin/locations/states endpoint. ```curl curl --location -g 'https://{{serverNameCommerceApi}}/admin/locations/states' \ --header 'Authorization: Bearer MTcxMTEyMjM4NjQwNCQyYiQxMCR4dFJwOGJia0FpUW8zWXBpQ1BYcjJ1c0ZNUDNaVDdZUzNZdjcuSy8zNi9EaXA0RmZXak5yM***' ``` -------------------------------- ### GET /admin/locations/cities/:stateId Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 Retrieves a list of cities for a specific state. This endpoint is crucial for location-based filtering or selection processes. ```APIDOC ## GET /admin/locations/cities/:stateId ### Description Retrieves a list of cities for a specific state. This endpoint is crucial for location-based filtering or selection processes. ### Method GET ### Endpoint https://{{serverNameCommerceApi}}/admin/locations/cities/:stateId ### Parameters #### Path Parameters - **stateId** (number) - Required - The unique identifier of the state for which to retrieve cities. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location -g 'https://{{serverNameCommerceApi}}/admin/locations/cities/:stateId' \ --header 'Authorization: Bearer MTcxMTEyMjM4NjQwNCQyYiQxMCR4dFJwOGJia0FpUW8zWXBpQ1BYcjJ1c0ZNUDNaVDdZUzNZdjcuSy8zNi9EaXA0RmZXak5yM***' ``` ### Response #### Success Response (200) - **message** (string) - A message indicating the success of the operation. - **messageCode** (string) - A code representing the status of the operation. - **data** (object) - Contains additional response data. - **cities** (array) - An array of objects, where each object represents a city. - **id** (integer) - The unique identifier for the city. - **name** (string) - The name of the city. #### Response Example ```json { "message": "Operation successful.", "messageCode": "00", "data": { "cities": [ { "id": 0, "name": "string" } ] } } ``` ``` -------------------------------- ### Get Cities by State API Request (curl) Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 This snippet shows how to fetch cities for a specific state using curl. It requires an Authorization header and a stateId in the path parameters, targeting the /admin/locations/cities/:stateId endpoint. ```curl curl --location -g 'https://{{serverNameCommerceApi}}/admin/locations/cities/:stateId' \ --header 'Authorization: Bearer MTcxMTEyMjM4NjQwNCQyYiQxMCR4dFJwOGJia0FpUW8zWXBpQ1BYcjJ1c0ZNUDNaVDdZUzNZdjcuSy8zNi9EaXA0RmZXak5yM***' ``` -------------------------------- ### GET /admin/locations/states Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 Retrieves a list of all available states. This endpoint is typically used to fetch state data, which can then be used to query for cities within a specific state via the /locations/cities/{stateId} endpoint. ```APIDOC ## GET /admin/locations/states ### Description Get all states, then you can search cities by state id in the /locations/cities/{stateId} service ### Method GET ### Endpoint {{protocol}}://{{serverNameCommerceApi}}/admin/locations/states ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body This endpoint does not require a request body. ### Request Example None ### Response #### Success Response (200) - **stateName** (string) - The name of the state. - **stateId** (string) - The unique identifier for the state. #### Response Example ```json [ { "stateName": "Example State", "stateId": "EXS123" } ] ``` ``` -------------------------------- ### POST /admin/update-balance Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 Allows for the transfer of funds from a main user's balance to another user's balance. Requires the beneficiary's user token and the amount to be transferred. ```APIDOC ## POST /admin/update-balance ### Description It allows you to transfer funds from the main users money bag to the bag of the user who is being added. The token of the user who will be the beneficiary and the amount must be added. ### Method POST ### Endpoint {{protocol}}://{{serverNameCommerceApi}}/admin/update-balance ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **userToken** (string, required): The user token for which the balance will be updated - **amount** (number, required): Amount to be updated ### Request Example ```json { "userToken": "MTcyNDY4NjE1MDY3OSQyYiQxMCRLeXZWVS9zdkF0ZzhPNTdoa1Z0dXVlME9mTHlVOWNacWREY1llUDIyL0k4N2hpazdKVmZFU***", "amount": 500 } ``` ### Response #### Success Response (200) - **message** (string) - String containing a message about the operation result (required) - **messageCode** (string) - String code indicating the operation result (required) - **data** (object) - Object containing additional response data. #### Response Example ```json { "message": "Operation successful.", "messageCode": "00" } ``` ``` -------------------------------- ### Update Balance in Commerce API (cURL) Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 This snippet shows how to call the update-balance endpoint of the Commerce API using cURL. It includes the necessary headers for authorization and the JSON payload for the request body. Ensure you replace placeholders like {{serverNameCommerceApi}} and {{tokenLogin}} with actual values. ```curl curl --location -g 'https://{{serverNameCommerceApi}}/admin/update-balance' \ --header 'Authorization: Bearer {{tokenLogin}}' \ --data '{ "userToken": "MTcyNDY4NjE1MDY3OSQyYiQxMCRLeXZWVS9zdkF0ZzhPNTdoa1Z0dXVlME9mTHlVOWNacWREY1llUDIyL0k4N2hpazdKVmZFU***", "amount": 500 }' ``` -------------------------------- ### Update Balance in Commerce API (JSON) Source: https://documenter.getpostman.com/view/35146358/2sA3QpDEFA#5d550a5e-15c1-4514-a3b7-1779ec527243/index_5d550a5e-15c1-4514-a3b7-1779ec527243 This snippet demonstrates how to update a user's balance in the Commerce API using a JSON request body. It requires the beneficiary's user token and the amount to be updated. The API expects a POST request to the /admin/update-balance endpoint. ```json { "userToken": "MTcyNDY4NjE1MDY3OSQyYiQxMCRLeXZWVS9zdkF0ZzhPNTdoa1Z0dXVlME9mTHlVOWNacWREY1llUDIyL0k4N2hpazdKVmZFU***", "amount": 500 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.