All URIs are relative to https://shipping-api-sandbox.pitneybowes.com/shippingservices
Method | HTTP request | Description |
---|---|---|
VerifyAddress | POST /v1/addresses/verify | Address validation |
VerifyAndSuggestAddress | POST /v1/addresses/verify-suggest | Address Suggestion |
Address VerifyAddress (Address address, bool? xPBUnifiedErrorStructure = null, bool? minimalAddressValidation = null)
Address validation
Address validation verifies and cleanses postal addresses within the United States to help ensure packages are rated accurately and shipments arrive at their final destinations on time.
using System.Collections.Generic;
using System.Diagnostics;
using shippingapi.Api;
using shippingapi.Client;
using shippingapi.Model;
namespace Example
{
public class VerifyAddressExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://shipping-api-sandbox.pitneybowes.com/shippingservices";
// Configure OAuth2 access token for authorization: oAuth2ClientCredentials
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new AddressValidationApi(Configuration.Default);
var address = new Address(); // Address | Address object that needs to be validated.
var xPBUnifiedErrorStructure = true; // bool? | Set this to true to use the standard [error object](https://shipping.pitneybowes.com/reference/error-object.html#standard-error-object) if an error occurs. (optional) (default to true)
var minimalAddressValidation = true; // bool? | When set to true, the complete address (delivery line and last line) is validated but only the last line (city, state, and postal code) would be changed by the validation check. (optional)
try
{
// Address validation
Address result = apiInstance.VerifyAddress(address, xPBUnifiedErrorStructure, minimalAddressValidation);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AddressValidationApi.VerifyAddress: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
address | Address | Address object that needs to be validated. | |
xPBUnifiedErrorStructure | bool? | Set this to true to use the standard error object if an error occurs. | [optional] [default to true] |
minimalAddressValidation | bool? | When set to true, the complete address (delivery line and last line) is validated but only the last line (city, state, and postal code) would be changed by the validation check. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
405 | Invalid input | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AddressSuggestionResponse VerifyAndSuggestAddress (string returnSuggestions, AddressVerifySuggest addressVerifySuggest, bool? xPBUnifiedErrorStructure = null)
Address Suggestion
This operation returns suggested addresses. Use this if the Address Validation API call has returned an error.
using System.Collections.Generic;
using System.Diagnostics;
using shippingapi.Api;
using shippingapi.Client;
using shippingapi.Model;
namespace Example
{
public class VerifyAndSuggestAddressExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://shipping-api-sandbox.pitneybowes.com/shippingservices";
// Configure OAuth2 access token for authorization: oAuth2ClientCredentials
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new AddressValidationApi(Configuration.Default);
var returnSuggestions = returnSuggestions_example; // string | To return suggested addresses, set this to true. (default to "true")
var addressVerifySuggest = new AddressVerifySuggest(); // AddressVerifySuggest | Address object that needs to be validated.
var xPBUnifiedErrorStructure = true; // bool? | Set this to true to use the standard [error object](https://shipping.pitneybowes.com/reference/error-object.html#standard-error-object) if an error occurs. (optional) (default to true)
try
{
// Address Suggestion
AddressSuggestionResponse result = apiInstance.VerifyAndSuggestAddress(returnSuggestions, addressVerifySuggest, xPBUnifiedErrorStructure);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AddressValidationApi.VerifyAndSuggestAddress: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
returnSuggestions | string | To return suggested addresses, set this to true. | [default to "true"] |
addressVerifySuggest | AddressVerifySuggest | Address object that needs to be validated. | |
xPBUnifiedErrorStructure | bool? | Set this to true to use the standard error object if an error occurs. | [optional] [default to true] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
405 | Invalid input | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]