--- title: "Get City By Zip" slug: "get-city-by-zip" tags: ["USPS", "module", "City", "zip"] updated: 2025-08-21T14:49:14Z published: 2025-08-21T14:49:14Z canonical: "documentation.decisions.com/get-city-by-zip" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Get City By Zip | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 8.1.0 | | **Location** | Integration > USPS | The **Get City By Zip** step returns the city of the specified zip code. ### Prerequisites This step requires the USPS module to be [installed](https://documentation.decisions.com/docs/installing-modules-decisions) before it will be available in the toolbox. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | Zip5 | The desired 5-digit zip code. | String | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Output | The city name of the desired zip code. | String | ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-08-21_10h02_18.png) --- ## Example Inputs and Outputs | Zip5 | Output | | --- | --- | | 23462 | VIRGINIA BEACH | | 23325 | CHESAPEAKE | | 2325 | EXCEPTION MESSAGE | | Null | [] | | Empty | EXCEPTION MESSAGE | --- ## Common Errors ### ZIPCode must be 5 characters If the zip code has fewer than 5 characters, the step will cause an error. To correct this, ensure that the correct number of characters is mapped or entered. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get City By Zip 1[GetCityByZip] in flow [Flow 1]: Exception invoking method GetCityByZip on class USPSSteps ---> DecisionsFramework.LoggedException: Exception invoking method GetCityByZip on class USPSSteps ---> Decisions.USPS.USPSException: ZIPCode must be 5 characters at Decisions.USPS.USPSSteps.GetCityByZip(String zip5) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` ### Incorrect Parameter Count, Data Not Mapped Correctly If the zip code is empty, the step will cause an error. To correct this, ensure that the correct number of characters is mapped or entered. #### Exception Message: ```csharp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get City By Zip 1[GetCityByZip] in flow [Flow 1]: Incorrect Parmater Count, Data Not Mapped Correctly ---> DecisionsFramework.LoggedException: Incorrect Parmater Count, Data Not Mapped Correctly ---> System.Reflection.TargetParameterCountException: Parameter count mismatch. at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data) --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` --- Related Information Forum Posts: [USPS Module Example: Get City & State By Zip](https://support.decisions.com/forum/topic29233-usps-module-example-get-city--state-by-zip.aspx) [USPS Address Verification Service](https://support.decisions.com/forum/topic1802-usps-address-verification-service.aspx) [Get State From Zip](https://support.decisions.com/forum/topic3107-usps-integration-get-state-from-zip.aspx) ## Related - [Get Cities By Zips](/get-cities-by-zips.md) - [Get Zip By City](/get-zip-by-city.md) - [Is Zip Valid For City](/is-zip-valid-for-city.md)