-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathusps-addresses-v3r2_4.yaml
More file actions
866 lines (858 loc) · 32.4 KB
/
Copy pathusps-addresses-v3r2_4.yaml
File metadata and controls
866 lines (858 loc) · 32.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
openapi: 3.0.1
info:
title: Addresses
description: |
Contact Us: [USPS API Support](https://emailus.usps.com/s/usps-APIs) | [Terms of Service](https://about.usps.com/termsofuse.htm)
The Addresses API validates and corrects address information to improve package delivery service and pricing. This suite of APIs provides different utilities for addressing components. The ZIP Code™ lookup finds valid ZIP Code™(s) for a City and State. The City/State lookup provides the valid cities and states for a provided ZIP Code™. The Address Standardization API validates and standardizes USPS® domestic addresses, city and state names, and ZIP Code™ in accordance with USPS® addressing standards. The USPS® address standard includes the ZIP + 4®, signifying a USPS® delivery point, given a street address, a city and a state.
version: 3.2.3
servers:
- url: https://apis.usps.com/addresses/v3
description: Production Environment Endpoint
- url: https://apis-tem.usps.com/addresses/v3
description: Testing Environment Endpoint
paths:
/address:
get:
tags:
- Resources
summary: Returns the best standardized address for a given address.
description: |-
Standardizes street addresses including city and street abbreviations as well as providing missing information such as ZIP Code™ and ZIP + 4®.
Must specify a street address, a state, and either a city or a ZIP Code™.
operationId: get-address
parameters:
- name: firm
in: query
description: "Firm/business corresponding to the address."
schema:
type: string
maxLength: 50
minLength: 0
- name: streetAddress
in: query
description: The number of a building along with the name of the road or street on which it is located.
required: true
schema:
type: string
- name: secondaryAddress
in: query
description: "The secondary unit designator, such as apartment(APT) or suite(STE) number, defining the exact location of the address within a building. For more information please see [Postal Explorer](https://pe.usps.com/text/pub28/28c2_003.htm)."
required: false
schema:
type: string
- name: city
in: query
description: This is the city name of the address.
required: false
schema:
type: string
- name: state
in: query
description: The two-character state code of the address.
required: true
schema:
maxLength: 2
minLength: 2
pattern: ^(AA|AE|AL|AK|AP|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MP|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)$
type: string
- name: urbanization
in: query
description: This is the urbanization code relevant only for Puerto Rico addresses.
required: false
schema:
type: string
- name: ZIPCode
in: query
description: This is the 5-digit ZIP code.
required: false
schema:
pattern: "^\\d{5}$"
type: string
- name: ZIPPlus4
in: query
description: This is the 4-digit component of the ZIP+4 code. Using the correct ZIP+4 reduces the number of times your mail is handled and can decrease the chance of a misdelivery or error.
required: false
schema:
pattern: "^\\d{4}$"
type: string
responses:
"200":
description: Successful operation.
content:
application/json:
schema:
$ref: '#/components/schemas/AddressResponse'
application/xml:
schema:
$ref: '#/components/schemas/AddressResponse'
"400":
description: Bad Request. There is an error in the received request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"401":
description: Unauthorized request.
headers:
WWW-Authenticate:
$ref: '#/components/headers/WWWAuthenticate'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: Access is denied.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"404":
description: Address Not Found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
examples:
Address Not Found:
$ref: '#/components/examples/Address-Not-Found'
No Match:
$ref: '#/components/examples/No-Match'
Invalid State Code:
$ref: '#/components/examples/Invalid-State-Code'
Invalid City:
$ref: '#/components/examples/Invalid-City'
Unverifiable City and State:
$ref: '#/components/examples/Unverifiable-City-and-State'
Insufficient Address Data:
$ref: '#/components/examples/Insufficient-Adddress-Data'
Invalid Delivery Address:
$ref: '#/components/examples/Invalid-Delivery-Address'
Multiple Addresses Found:
$ref: '#/components/examples/Multiple-Addresses-Found'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"429":
description: Too Many Requests. Too many requests have been received from the client in a short amount of time.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"503":
description: Service is unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
default:
description: Other unanticipated errors that may occur.
content: {}
security:
- OAuth:
- addresses
/city-state:
get:
tags:
- Resources
summary: Returns the city and state for a given ZIP Code.
description: Returns the city and state corresponding to the given ZIP Code™.
operationId: get-city-state
parameters:
- name: ZIPCode
in: query
description: This is the 5-digit ZIP code.
required: true
schema:
pattern: "^\\d{5}$"
type: string
responses:
"200":
description: Successful operation.
content:
application/json:
schema:
$ref: '#/components/schemas/CityStateResponse'
application/xml:
schema:
$ref: '#/components/schemas/CityStateResponse'
"400":
description: A bad request was received.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"401":
description: Unauthorized request.
headers:
WWW-Authenticate:
$ref: '#/components/headers/WWWAuthenticate'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: Access is denied.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"429":
description: Too Many Requests. Too many requests have been received from the client in a short amount of time.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"503":
description: Service is unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
default:
description: Other unanticipated errors that may occur.
content: {}
security:
- OAuth:
- addresses
/zipcode:
get:
tags:
- Resources
summary: Returns the ZIP Code for a given address.
description: "Returns the ZIP Code™ and ZIP + 4® corresponding to the given address, city, and state (use USPS state abbreviations)."
operationId: get-ZIPCode
parameters:
- name: firm
in: query
description: "Firm/business corresponding to the address."
schema:
type: string
maxLength: 50
minLength: 0
- name: streetAddress
in: query
description: The number of a building along with the name of the road or street on which it is located.
required: true
schema:
type: string
- name: secondaryAddress
in: query
description: "The secondary unit designator, such as apartment(APT) or suite(STE) number, defining the exact location of the address within a building. For more information please see [Postal Explorer](https://pe.usps.com/text/pub28/28c2_003.htm)."
required: false
schema:
type: string
- name: city
in: query
description: This is the city name of the address.
required: true
schema:
type: string
- name: state
in: query
description: This is the two-character state code of the address.
required: true
schema:
maxLength: 2
minLength: 2
pattern: ^(AA|AE|AL|AK|AP|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MP|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)$
type: string
- name: ZIPCode
in: query
description: This is the 5-digit ZIP code.
required: false
schema:
pattern: "^\\d{5}$"
type: string
- name: ZIPPlus4
in: query
description: This is the 4-digit component of the ZIP+4 code. Using the correct ZIP+4 reduces the number of times your mail is handled and can decrease the chance of a misdelivery or error.
required: false
schema:
pattern: "^\\d{4}$"
type: string
responses:
"200":
description: Successful operation.
content:
application/json:
schema:
$ref: '#/components/schemas/ZIPCodeResponse'
application/xml:
schema:
$ref: '#/components/schemas/ZIPCodeResponse'
"400":
description: There is an error in the received request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"401":
description: Unauthorized request.
headers:
WWW-Authenticate:
$ref: '#/components/headers/WWWAuthenticate'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"403":
description: Access is denied.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"429":
description: Too Many Requests. Too many requests have been received from the client in a short amount of time.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
"503":
description: Service is unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
application/xml:
schema:
$ref: '#/components/schemas/ErrorMessage'
default:
description: Other unanticipated errors that may occur.
content: {}
security:
- OAuth:
- addresses
components:
schemas:
AddressResponse:
title: Address Response
type: object
properties:
firm:
maxLength: 50
minLength: 0
type: string
description: This is the firm/business name at the address.
address:
$ref: '#/components/schemas/DomesticAddress'
additionalInfo:
$ref: '#/components/schemas/AddressAdditionalInfo'
corrections:
$ref: '#/components/schemas/AddressCorrections'
matches:
$ref: '#/components/schemas/AddressMatches'
warnings:
type: array
xml:
wrapped: true
items:
type: string
xml:
name: warning
additionalProperties: false
description: "Standardizes street addresses including city and street abbreviations, and provides missing information such as ZIP Code™ and ZIP + 4®."
xml:
name: AddressValidateResponse
wrapped: true
CityAndState:
title: City And State
type: object
properties:
city:
maxLength: 28
minLength: 1
type: string
description: This is the city name of the address.
example: "Des Moines"
state:
maxLength: 2
minLength: 2
pattern: "\\w{2}"
type: string
description: This is two-character state code of the address.
example: IA
ZIPCode:
maxLength: 5
minLength: 5
type: string
description: This is the ZIP Code of the address.
example: "50314"
AddressCorrections:
title: Address Corrections
type: array
description: |
Codes that indicate how to improve the address input to get a better match.
Code `32` will indicate "Default address: The address you entered was found but more information is needed (such as an apartment, suite, or box number." The recommended change would be to add additional information, such as an apartment, suite, or box number, to match to a specific address.
Code `22` will indicate "Multiple addresses were found for the information you entered, and no default exists." The address could not be resolved as entered and more information would be needed to identify the address.
xml:
name: addressCorrections
wrapped: true
items:
type: object
properties:
code:
maxLength: 2
minLength: 1
pattern: "\\w{2}"
type: string
description: The code corresponding to the address correction.
xml:
name: code
text:
type: string
description: This is the description of the address correction.
xml:
name: text
additionalProperties: false
xml:
name: addressCorrection
AddressMatches:
title: Address Matches
type: array
description: |
Codes that indicate if an address is an exact match.
Code `31` will be returned "Single Response - exact match" indicating that the address was correctly matched to a ZIP+4 record.
xml:
name: addressMatches
wrapped: true
items:
type: object
properties:
code:
maxLength: 2
minLength: 1
pattern: "\\w{2}"
type: string
xml:
name: code
text:
type: string
xml:
name: text
additionalProperties: false
xml:
name: addressMatch
AddressAdditionalInfo:
title: Address Additional Information
type: object
properties:
deliveryPoint:
type: string
description: |-
A specific set of digits between 00 and 99 is assigned to every address that is combined with the ZIP + 4® Code to provide a unique identifier for every delivery address.
A street address does not necessarily represent a single delivery point because a street address such as one for an apartment building may have several delivery points.
carrierRoute:
maxLength: 5
minLength: 0
type: string
description: This is the carrier route code (values unspecified).
example: "C012"
DPVConfirmation:
type: string
description: |
The DPV Confirmation indicator identifies whether the address provided maps to a known USPS address record, whether the USPS delivers to the address or not. If the USPS does not deliver to the address, the USPS may deliver to a PO Box instead. `carrierRoute` values of `R777` and `R779`, for example, may require the shipper to ask the recipient where they receive their USPS mail, which may be different than their physical address.
* `Y` - Address was DPV confirmed for both primary and (if present) secondary numbers. A value of `Y` does not necessarily imply that USPS delivers to that address.
* `D` - Address was DPV confirmed for the primary number only, and the secondary number information was missing.
* `S` - Address was DPV confirmed for the primary number only, and the secondary number information was present but not confirmed.
* `N` - Both primary and (if present) secondary number information failed to DPV confirm.
enum:
- "Y"
- D
- S
- "N"
DPVCMRA:
type: string
description: |-
Indicates if the location is a [Commercial Mail Receiving Agency (CMRA)](https://faq.usps.com/s/article/Commercial-Mail-Receiving-Agency-CMRA).
* `Y` - Address was found in the CMRA table.
* `N` - Address was not found in the CMRA table.
enum:
- "Y"
- "N"
business:
type: string
description: |
Indicates whether this is a business address.
* `Y` - The address is a business address.
* `N` - The address is not a business address.
enum:
- "Y"
- "N"
centralDeliveryPoint:
type: string
description: |
Central Delivery is for all business office buildings and/or industrial/professional parks. This may include call windows, horizontal locked mail receptacles, and cluster box units.
* `Y` - The address is a central delivery point.
* `N` - The address is not a central delivery point.
enum:
- "Y"
- "N"
vacant:
type: string
description: |
Indicates whether the location designated by the address is occupied.
* `Y` - The address is not occupied.
* `N` - The address is occupied.
enum:
- "Y"
- "N"
additionalProperties: false
description: Extra information about the request.
xml:
name: addressAdditionalInfo
CityStateResponse:
title: City and State Response
description: The validated ZIP Code™ for a given city and state.
xml:
name: CityStateLookupResponse
wrapped: true
allOf:
- $ref: '#/components/schemas/CityAndState'
ZIPCodeResponse:
title: ZIP Code™ Response
type: object
properties:
firm:
maxLength: 50
minLength: 0
type: string
description: This is the firm/business name at the address.
address:
$ref: '#/components/schemas/DomesticAddress'
additionalProperties: false
description: The address to validate the ZIP Code™ for.
xml:
name: ZipCodeLookupResponse
wrapped: true
ErrorMessage:
title: Error
type: object
properties:
apiVersion:
type: string
description: The version of the API that was used and that raised the error.
error:
type: object
properties:
code:
type: string
description: The error status code that has been returned in response to the request.
message:
type: string
description: A human-readable message describing the error.
errors:
type: array
items:
type: object
properties:
status:
type: string
description: The status code response returned to the client.
code:
type: string
description: An internal subordinate code used for error diagnosis.
title:
type: string
description: A human-readable title that identifies the error.
detail:
type: string
description: A human-readable description of the error that occurred.
source:
type: object
properties:
parameter:
type: string
description: The input in the request which caused an error.
example:
type: string
description: An example of a valid value for the input parameter.
additionalProperties: true
description: The element that is suspected of originating the error. Helps to pinpoint the problem.
additionalProperties: true
additionalProperties: true
description: The high-level error that has occurred as indicated by the status code.
additionalProperties: true
description: Standard error message response.
DomesticAddress:
title: Domestic Address
additionalProperties: true
description: Address fields for US locations
allOf:
- $ref: '#/components/schemas/Address'
- type: object
properties:
city:
maxLength: 28
minLength: 1
type: string
description: This is the city name of the address.
state:
$ref: '#/components/schemas/State'
ZIPCode:
pattern: "\\d{5}"
type: string
description: This is the 5-digit ZIP code.
ZIPPlus4:
pattern: "\\d{4}"
type: string
description: This is the 4-digit component of the ZIP+4 code. Using the correct ZIP+4 reduces the number of times your mail is handled and can decrease the chance of a misdelivery or error.
nullable: true
urbanization:
maxLength: 96
type: string
description: "An area, sector, or residential development within a geographic area (typically used for addresses in Puerto Rico)."
additionalProperties: true
Address:
title: Address
type: object
properties:
streetAddress:
maxLength: 50
minLength: 1
type: string
description: The number of a building along with the name of the road or street on which it is located.
streetAddressAbbreviation:
maxLength: 50
minLength: 0
type: string
description: This is the abbreviation of the primary street address line for the address.
readOnly: true
secondaryAddress:
maxLength: 50
type: string
description: "The secondary unit designator, such as apartment(APT) or suite(STE) number, defining the exact location of the address within a building. For more information please see [Postal Explorer](https://pe.usps.com/text/pub28/28c2_003.htm)."
cityAbbreviation:
type: string
description: This is the abbreviation of the city name for the address.
readOnly: true
additionalProperties: true
description: Address fields standard to all locations.
xml:
name: Address
State:
maxLength: 2
minLength: 2
pattern: ^(AA|AE|AL|AK|AP|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MP|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)$
type: string
description: The two-character state code.
parameters:
StreetAddress-Required:
name: streetAddress
in: query
description: The number of a building along with the name of the road or street on which it is located.
required: true
schema:
type: string
SecondaryAddress:
name: secondaryAddress
in: query
description: "The secondary unit designator, such as apartment(APT) or suite(STE) number, defining the exact location of the address within a building. For more information please see [Postal Explorer](https://pe.usps.com/text/pub28/28c2_003.htm)."
required: false
schema:
type: string
City:
name: city
in: query
description: This is the city name of the address.
required: false
schema:
type: string
State-Required:
name: state
in: query
description: This is two-character state code of the address.
required: true
schema:
maxLength: 2
minLength: 2
pattern: ^(AA|AE|AL|AK|AP|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MP|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)$
type: string
Urbanization:
name: urbanization
in: query
description: This is the urbanization code relevant only for Puerto Rico addresses.
required: false
schema:
type: string
ZIPCode:
name: ZIPCode
in: query
description: This is the 5-digit ZIP code.
required: false
schema:
pattern: "^\\d{5}$"
type: string
ZIPPlus4:
name: ZIPPlus4
in: query
description: This is the 4-digit component of the ZIP+4 code. Using the correct ZIP+4 reduces the number of times your mail is handled and can decrease the chance of a misdelivery or error.
required: false
schema:
pattern: "^\\d{4}$"
type: string
ZIPCode-Required:
name: ZIPCode
in: query
description: This is the 5-digit ZIP code.
required: true
schema:
pattern: "^\\d{5}$"
type: string
City-Required:
name: city
in: query
description: This is the city name of the address.
required: true
schema:
type: string
examples:
Invalid-City:
summary: The city is missing or invalid.
description: The city is missing or invalid.
value:
apiVersion: v3
error:
code: "404"
message: The city in the request is missing or invalid.
errors: []
Invalid-State-Code:
summary: The two-letter state code is missing or invalid.
description: The two-letter state code is missing or invalid.
value:
apiVersion: v3
error:
code: "404"
message: The state code in the request is missing or invalid.
errors: []
Unverifiable-City-and-State:
summary: The city and state are missing or together unverifiable.
description: The city and state are missing or together unverifiable.
value:
apiVersion: v3
error:
code: "404"
message: The city and state are missing or together unverifiable.
errors: []
Insufficient-Adddress-Data:
summary: The address information in the request is insufficient to match.
description: The address information in the request is insufficient to match.
value:
apiVersion: v3
error:
code: "404"
message: The address information in the request is insufficient to match.
errors: []
Address-Not-Found:
summary: The address requested could not be found.
description: "There is no match for the specified address, try adding as much information as possible."
value:
apiVersion: v3
error:
code: "404"
message: There is no match for the address requested.
errors: []
No-Match:
summary: Could not find any matching address.
description: "There is no match for the specified address, try adding as much information as possible."
value:
apiVersion: v3
error:
code: "404"
message: There is no match for the address requested.
errors: []
Invalid-Delivery-Address:
summary: The address requested is an invalid delivery address.
description: The address requested is an invalid delivery address.
value:
apiVersion: v3
error:
code: "404"
message: The address requested is an invalid delivery address.
errors: []
Multiple-Addresses-Found:
summary: More than one address was found matching the requested address.
description: More than one address was found matching the requested address.
value:
apiVersion: v3
error:
code: "404"
message: More than one address was found matching the requested address.
errors: []
headers:
WWWAuthenticate:
description: Hint to the client application which security scheme to authorize a resource request.
required: false
schema:
type: string
example: "WWW-Authenticate: Bearer realm=\"https://api.usps.com\""
RetryAfter:
description: Indicate to the client application a time after which they can retry a resource request.
required: false
schema:
type: string
example: "Retry-After: 30"
securitySchemes:
OAuth:
type: oauth2
description: The specified APIs accept an access token formatted as a JSON Web Token. The relative path to the OAuth2 version 3 API which supplies this access token is provided below for reference.
flows:
clientCredentials:
tokenUrl: /oauth2/v3/token
scopes:
addresses: read-only access to all addresses endpoints
authorizationCode:
authorizationUrl: /oauth2/v3/authorize
tokenUrl: /oauth2/v3/token
scopes:
addresses: read-only access to all addresses endpoints