OpenAPI Specification
openapi: 3.0.3
info:
title: UPS Shipping Address Validation API
description: The UPS Shipping API enables developers to create and manage shipments, generate shipping labels, validate addresses, retrieve rates, track packages, schedule pickups, manage returns, and access time-in-transit information. UPS uses OAuth 2.0 with client credentials for authentication.
version: v1
contact:
name: UPS Developer Support
url: https://developer.ups.com/
termsOfService: https://www.ups.com/us/en/help-center/legal-terms-conditions/developer-terms-of-service.page
servers:
- url: https://onlinetools.ups.com/api
description: UPS Production API
- url: https://wwwcie.ups.com/api
description: UPS Customer Integration Environment (CIE - Testing)
security:
- BearerAuth: []
tags:
- name: Address Validation
description: Address validation and standardization
paths:
/addressvalidation/v1/1:
post:
operationId: validateAddressStreetLevel
summary: Validate Address Street Level
description: Validate and standardize a street-level address. Returns whether the address is valid, standardized formatting, and residential/commercial classification.
tags:
- Address Validation
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AddressValidationRequest'
responses:
'200':
description: Address validation response
content:
application/json:
schema:
$ref: '#/components/schemas/AddressValidationResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
components:
responses:
Unauthorized:
description: OAuth token missing or expired
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
BadRequest:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
schemas:
AddressValidationRequest:
type: object
required:
- AddressValidationRequest
properties:
AddressValidationRequest:
type: object
properties:
Request:
type: object
properties:
RequestOption:
type: string
enum:
- '1'
- '2'
- '3'
description: 1=Address Validation, 2=Address Classification, 3=Both
AddressKeyFormat:
type: object
required:
- CountryCode
properties:
ConsigneeName:
type: string
AddressLine:
type: array
items:
type: string
PoliticalDivision2:
type: string
description: City
PoliticalDivision1:
type: string
description: State/Province
PostcodePrimaryLow:
type: string
description: ZIP/Postal code
CountryCode:
type: string
AddressValidationResponse:
type: object
properties:
AddressValidationResponse:
type: object
properties:
Response:
type: object
AddressClassification:
type: object
properties:
Code:
type: string
enum:
- '0'
- '1'
- '2'
description: 0=Unknown, 1=Commercial, 2=Residential
Description:
type: string
AddressKeyFormat:
type: object
properties:
AddressLine:
type: array
items:
type: string
PoliticalDivision2:
type: string
PoliticalDivision1:
type: string
PostcodePrimaryLow:
type: string
PostcodeExtendedLow:
type: string
CountryCode:
type: string
ErrorResponse:
type: object
properties:
response:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: string
message:
type: string
securitySchemes:
OAuth2:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://onlinetools.ups.com/api/security/v1/oauth/token
scopes: {}
BearerAuth:
type: http
scheme: bearer
description: OAuth 2.0 bearer token from /security/v1/oauth/token