-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathusps-webtools-api.yml
More file actions
3617 lines (3581 loc) · 182 KB
/
usps-webtools-api.yml
File metadata and controls
3617 lines (3581 loc) · 182 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
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
version: '1.0'
title: 'USPS Web Tools API'
description: 'This site is an open source effort to improve the experience for developers utilizing the <a href="https://www.usps.com/business/web-tools-apis/" target="_blank">USPS Web Tools APIs</a>. <br><br>Documentation is generated using [Redoc](https://github.com/Redocly/redoc) and an [OpenAPI 3.0](https://spec.openapis.org/oas/v3.0.0) spec created from the USPS official [documentation](https://www.usps.com/business/web-tools-apis/documentation-updates.htm") (PDF format). <br><br>We have corrected errors and made UX improvements but welcome your feedback on how to improve this site in the future. Contact us at <a href="mailto: lob-openapi@lob.com?subject=USPSWebTools docs" target="_blank">lob-openapi@lob.com</a>'
servers:
- url: 'http://production.shippingapis.com'
tags:
- name: Who is Lob?
x-traitTag: true
description: |
Lob offers Direct Mail APIs Designed for Developers.
<br>
<br>
<ul>
<li><a href=" https://docs.lob.com/#tag/Postcards" target="_blank">Print & Mail APIs</a></li>
<li><a href=" https://docs.lob.com/#tag/US-Verifications" target="_blank">Address Verification APIs</a></li>
<li><a href=" https://docs.lob.com/#tag/Getting-Started" target="_blank">Get Started with Lob.</a></li>
</ul>
<p>
Transform outdated, manual print & mail processes with Lob’s
easy-to-integrate APIs. Trigger on-demand postcards, letters, and
checks directly from your CRM or custom applications.
</p>
<br>
<p>
Improve your mail deliverability by adding address autocomplete on
the front-end, and correct, standardize, and cleanse address data
for assured delivery across 240+ countries and territories.
</p>
<br>
<p>
Meet compliance requirements by deploying webhooks to automatically
track production and delivery for each piece of mail.
Send HIPAA-compliant mailings that properly protect healthcare
data and report on real-time and historic mail statuses for
compliance audits.
</p>
- name: Web Tools Authentication
x-traitTag: true
description: |
USPS Web Tools API are accessible using your Web Tools User ID. To authenticate a request add
the USERID attribute to the outermost XML element and set the value equal to your Web Tools User ID.
<br><br>
For example, `<AddressValidateRequest USERID="{WEB_TOOLS_USER_NAME}">`
<br><br>
[Register](https://www.usps.com/business/web-tools-apis/) on the USPS Web Tools API Portal for your Web Tools ID.
<br><br>
You'll receive an email with your Web Tools username (This is your USERID)
<br><br>
<img src="images/webtools-email-username.png">
<br><br>
USPS official [Developers Guide]("https://www.usps.com/business/web-tools-apis/documentation-updates.htm") - PDF format.
<br><br>
<em>Note: USPS Web Tools API does not follow standard OAuth, OpenID or Basic Authentication patterns. For this reason,
securitySchemes have been omitted in the OpenAPI specification used to generate this documentation. </em>
### Important Notice: User ID
The Web Tools User ID provided is for you and your company to use when requesting data via the Internet from the U.S. Postal Service API servers. As per the Terms and Conditions of Use Agreement you agreed to during the Web Tools registration process, you are responsible to maintain the confidentiality of your User ID as specified. You may not package any APIs with your User ID for resale or distribution to others. The U.S. Postal Service does not prohibit the reuse and/or distribution of the API documentation (User's Guide) with sample code in order to generate awareness, encourage use or provide ease-of-use to customers or affiliates.
<br><br>
<strong>Warning</strong> - If the U.S. Postal Service discovers use of the same User ID from more than one web site, all users will be subject to loss of access to the USPS production server and/or termination of the licenses granted under the Terms and Conditions of Use.
- name: Postman
x-traitTag: true
description: |
We've created a Postman public workspace for developers to explore the
USPS Web Tools APIs. You will need your own Web Tools UserID to use this
collection. [See Authentication](#tag/Authentication)
### Address Verification
<div class="postman-run-button" data-postman-action="collection/fork" data-postman-var-1="16169677-e6373072-8748-4ea1-9fa7-bbe3f50b53ca"
data-postman-collection-url="entityId=16169677-e6373072-8748-4ea1-9fa7-bbe3f50b53ca&entityType=collection&workspaceId=a1340f6a-f0e3-4f1d-b724-0a96e695f12c"></div>
<script type="text/javascript">
(function (p,o,s,t,m,a,n) {
!p[s] && (p[s] = function () { (p[t] || (p[t] = [])).push(arguments); });
!o.getElementById(s+t) && o.getElementsByTagName("head")[0].appendChild((
(n = o.createElement("script")),
(n.id = s+t), (n.async = 1), (n.src = m), n
));
}(window, document, "_pm", "PostmanRunObject", "https://run.pstmn.io/button.js"));
</script>
### Domestic Mail Service
<div class="postman-run-button"
data-postman-action="collection/fork"
data-postman-var-1="16169677-32a26398-5c84-4628-81cc-1bad9859d093"
data-postman-collection-url="entityId=16169677-32a26398-5c84-4628-81cc-1bad9859d093&entityType=collection&workspaceId=a1340f6a-f0e3-4f1d-b724-0a96e695f12c"></div>
<script type="text/javascript">
(function (p,o,s,t,m,a,n) {
!p[s] && (p[s] = function () { (p[t] || (p[t] = [])).push(arguments); });
!o.getElementById(s+t) && o.getElementsByTagName("head")[0].appendChild((
(n = o.createElement("script")),
(n.id = s+t), (n.async = 1), (n.src = m), n
));
}(window, document, "_pm", "PostmanRunObject", "https://run.pstmn.io/button.js"));
</script>
### Track & Confirm Package
<div class="postman-run-button"
data-postman-action="collection/fork"
data-postman-var-1="16169677-1af62154-f1a6-4a66-8e99-8538164e5fcf"
data-postman-collection-url="entityId=16169677-1af62154-f1a6-4a66-8e99-8538164e5fcf&entityType=collection&workspaceId=a1340f6a-f0e3-4f1d-b724-0a96e695f12c"></div>
<script type="text/javascript">
(function (p,o,s,t,m,a,n) {
!p[s] && (p[s] = function () { (p[t] || (p[t] = [])).push(arguments); });
!o.getElementById(s+t) && o.getElementsByTagName("head")[0].appendChild((
(n = o.createElement("script")),
(n.id = s+t), (n.async = 1), (n.src = m), n
));
}(window, document, "_pm", "PostmanRunObject", "https://run.pstmn.io/button.js"));
</script>
- name: Address Verification APIs
x-traitTag: false
description: |
The Address Validation APIs can be used in conjunction with USPS
SHIPPING OR MAILING SERVICES ONLY. The Address API must only be
used on an individual transactional basis, i.e. not batch processing
or cleansing of a database, but as a customer enters the information
into a form on a website. Failure to comply with these terms and
conditions can result in termination of USPS API access without prior
notice.
- name: Address
x-traitTag: false
description: |
The Address/Standardization "Verify" API, which corrects errors in street addresses, including
abbreviations and missing information, and supplies ZIP Codes and ZIP Codes + 4. The Verify API
supports up to five lookups per transaction. By eliminating address errors, you will improve
overall package delivery service.
- name: City & State
x-traitTag: false
description: |
City/State Lookup API returns the city and state corresponding to the given ZIP Code.
The CityStateLookup API processes up to five lookups per request.
- name: ZIP Code
x-traitTag: false
description: |
The ZipCodeLookup API, which returns the ZIP Code and ZIP Code + 4 corresponding to the given
address, city, and state (use USPS state abbreviations). The ZipCodeLookup API processes up to
five lookups per request.
- name: Domestic Mail Service
x-traitTag: true
description: |
Domestic Mail Service Standards
- name: Priority Mail
x-traitTag: false
description: |
The Priority Mail Service Standards API receives requests and returns the number of days (on average) it will
take a Priority Mail package to arrive at its destination. Ensure that end-users understand that these are service
standards and not guaranteed commitments. The Priority Mail Service Standards API processes a single request
- name: StandardB
x-traitTag: false
description: |
The Package Services “StandardB” API receives requests and returns the average number of days it will take a
package to arrive at its destination. There are four types of Package Services: Standard Post, Bound Printed
Matter, Library Mail, and Media Mail. The Package Services “StandardB” API processes a single request. Ensure
that end-users understand that these are service standards and not guaranteed commitments.
- name: First Class Mail
x-traitTag: false
description: |
The First Class Mail Service Standards API receives requests and returns the average number of days it will take
a package to arrive at its destination. The First Class Mail Service Standards API processes a single request.
Ensure that end-users understand that these are service standards and not guaranteed commitments.
- name: Express Mail Commitment
x-traitTag: false
description: |
The Express Mail Service Commitments API provides delivery commitments for Express Mail packages for the
given Zip Codes to include package drop-off information. A user provides an origination and a destination Zip
Code and an optional current or future date that the package will be shipped.
- name: Package Track & Confirm
x-traitTag: true
description: |
To obtain Package Tracking API (API=TrackV2) access, users will need to contact the USPS Web Tools
Program Office to request access and supply additional information for customer verification.
Note: This applies to both TrackV2 API simplified track requests (i.e., “TrackRequest”) and
TrackV2 API detailed track requests (i.e., “TrackFieldRequest”). Users should follow these
steps to submit a request for Tracking APIs access:
Navigate to: https://usps.force.com/emailus/s/web-tools-inquiry and provide user
name (Web Tools User ID), select “Tracking APIs”, select “Track API” and submit the
request with the following information below in the “Additional Information” text box:
<br><br>
<ul>
<li>Web Tools UserID</li>
<li>Mailer ID (MID)</li>
<li>Company Name</li>
<li>Requester First and Last Name</li>
<li>Requester Email</li>
<li>Requester Phone number</li>
<li>Mailing Address</li>
<li>Mailing City</li>
<li>Mailing State</li>
<li>Mailing Zip Code</li>
<li>PROD Registration Date</li>
<li>API access requested: Package Tracking (API=TrackV2)</li>
<li>Anticipated volume</li>
<li>Any additional information from the customer</li>
</ul>
Four service APIs are offered in conjunction with “Revision=1” of the Package Tracking “Fields” API: Track and Confirm by Email, Proof of Delivery, Tracking Proof of Delivery, and Return Receipt Electronic. The response data from Track/Confirm Fields request determines which services are available for a tracking ID. Each request input to the Web Tools server for the tracking service APIs is limited to one tracking ID. These APIs require additional permissions from the Web Tools Program Office in order to gain
USPS Web Tools User Guide
access. When you request access for these APIs, please identify your anticipated API volume, mailer ID, and how you will be utilizing this API. A mailer identification number (MID) is a 6 or 9-digit number assigned to a customer through the USPS Business Customer Gateway (BCG). Please refer to the following links for help:
* https://gateway.usps.com/eAdmin/view/knowledge?securityId=MID • https://postalpro.usps.com/mailing/mailer-id
- name: Package Tracking
x-traitTag: false
description: |
The Track/Confirm Web Tools API provides tracking status and delivery information for USPS packages. The Track/Confirm
API limits the data requested to thirty-five (35) packages per transaction.
<br><br>
Note: The data returned by the Package Track Web Tools API is intended for display only. The content or sequence of the String
data returned by the API may change. Consequently, if you desire to apply any kind of logic against the tracking data, then
you will need to use the Track/Confirm fields.
<br><br>
The Package Tracking “Fields” API is similar to the Package Track API except for the request fields, API name, and
the return information. Data returned still contains the detail and summary information, but this information is
broken down into fields instead of having only one line of text. Up to 10 tracking IDs may be contained in each
API request to the Web Tools server.
- name: Track & Confirm by Email
x-traitTag: false
description: |
The Track and Confirm by Email API allows the customer to submit their
email address to be notified of current or future tracking activity.
When you request access for this API, please identify your anticipated
API volume, mailer ID and how you will be utilizing this API.
A mailer identification number (MID) is a 6 or 9-digit number assigned
to a customer through the USPS Business Customer Gateway (BCG).
Please refer to the following links for help:
* https://gateway.usps.com/eAdmin/view/knowledge?securityId=MID
* https://postalpro.usps.com/mailing/mailer-id
- name: Proof of Delivery
x-traitTag: false
description: |
Proof of Delivery is a letter that includes the recipient's name and a
copy of their signature. The Proof of Delivery API allows the customer
to request proof of delivery notification via email. When you request
access for this API, please identify your anticipated API volume,
mailer ID and how you will be utilizing this API. A mailer identification
number (MID) is a 6 or 9-digit number assigned to a customer through
the USPS Business Customer Gateway (BCG). Please refer to the following
links for help:
* https://gateway.usps.com/eAdmin/view/knowledge?securityId=MID
* https://postalpro.usps.com/mailing/mailer-id
- name: Return Receipt Electronic
x-traitTag: false
description: |
The Return Receipt Electronic API allows the customer to request a copy
of the proof of delivery record via email. When you request access for
this API, please identify your anticipated API volume, mailer ID and
how you will be utilizing this API. A mailer identification number (MID)
is a 6 or 9-digit number assigned to a customer through the USPS Business
Customer Gateway (BCG). Please refer to the following links for help:
* https://gateway.usps.com/eAdmin/view/knowledge?securityId=MID
* https://postalpro.usps.com/mailing/mailer-id
- name: Track Proof of Delivery
x-traitTag: false
description: |
Track Proof of Delivery is a letter that includes the recipient's name
and a copy of their signature. The Track Proof of Delivery API allows
the customer to request proof of delivery notification via email.
When you request access for this API, please identify your anticipated
API volume, mailer ID and how you will be utilizing this API.
A mailer identification number (MID) is a 6 or 9-digit number
assigned to a customer through the USPS Business Customer Gateway
(BCG). Please refer to the following links for help:
* https://gateway.usps.com/eAdmin/view/knowledge?securityId=MID
* https://postalpro.usps.com/mailing/mailer-id
- name: Rate Calculation
x-traitTag: true
description: |
USPS Web Tools - Domestic Rate Calculator
- name: Domestic
x-traitTag: false
description: |
The Track/Confirm Web Tools API provides tracking status and delivery information for USPS packages. The Track/Confirm
API limits the data requested to thirty-five (35) packages per transaction.
<br><br>
Note: The data returned by the Package Track Web Tools API is intended for display only. The content or sequence of the String
data returned by the API may change. Consequently, if you desire to apply any kind of logic against the tracking data, then
you will need to use the Track/Confirm fields.
<br><br>
The Package Tracking “Fields” API is similar to the Package Track API except for the request fields, API name, and
the return information. Data returned still contains the detail and summary information, but this information is
broken down into fields instead of having only one line of text. Up to 10 tracking IDs may be contained in each
API request to the Web Tools server.
x-tagGroups:
- name: Overview
tags:
- Who is Lob?
- Web Tools Authentication
- Postman
- Address Verification APIs
- Address
- City & State
- ZIP Code
- Domestic Mail Service
- Priority Mail
- StandardB
- First Class Mail
- Express Mail Commitment
- Package Track & Confirm
- Package Tracking
- Track & Confirm by Email
- Proof of Delivery
- Return Receipt Electronic
- Track Proof of Delivery
- Rate Calculation
- Domestic
paths:
/ShippingAPI.dll?API=CityStateLookup":
get:
summary: 'Lookup City & State'
operationId: city_state_lookup
tags:
- City & State
parameters:
- name: API
in: query
description: This query parameter defines the resource you are accessing. For city & state lookup your API query param value must equal `CityStateLookup`.
required: true
schema:
type: string
default: CityStateLookup
- name: XML
in: query
description: This query parameter defines the XML payload and it can not be passed in the body<br><br><div class="code"><p id="isPasted"><CityStateLookupRequest USERID="XXXXXX"><br> <ZipCode><br> <Zip5>94107</Zip5><br> </ZipCode><br></CityStateLookupRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/CityStateLookupRequest'
x-example: '<CityStateLookupRequest USERID="{WEB_TOOLS_USER_NAME}">
<ZipCode>
<Zip5>94107</Zip5>
</ZipCode>
</CityStateLookupRequest>'
responses:
'200':
description: response to City State lookup'
content:
text/xml:
schema:
$ref: '#/components/schemas/CityStateLookupResponse'
example: '<CityStateLookupResponse>
<ZipCode>
<Zip5>94556</Zip5>
<City>MORAGA</City>
<State>CA</State>
</ZipCode>
</CityStateLookupResponse>'
/ShippingAPI.dll?API=Verify:
get:
summary: 'Verify a US address'
operationId: verify
tags:
- Address
parameters:
- name: API
in: query
description: This query parameter defines the resource you are accessing. For address verification your API query param value must equal `Verify`.
required: true
schema:
type: string
default: Verify
- name: XML
in: query
description: This query parameter defines the XML payload and can not be passed in the body<br><br><div class="code"><AddressValidateRequest USERID="XXXXXX"><br> <Revision>1</Revision><br> <Address><br> <Address1>Suite 6100</Address1><br> <Address2>185 Berry St</Address2><br> <City>San Francisco</City><br> <State>CA</State><br> <Zip5>94556</Zip5><br> <Zip4></Zip4><br> </Address><br></AddressValidateRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/AddressValidateRequest'
example: '<AddressValidateRequest USERID="{WEB_TOOLS_USER_NAME}">
<Revision>1</Revision>
<Address>
<Address1>Suite 6100</Address1>
<Address2>185 Berry St</Address2>
<City>San Francisco</City>
<State>CA</State>
<Zip5>94556</Zip5>
<Zip4></Zip4>
</Address>
</AddressValidateRequest>'
responses:
'200':
description: response to Address verification'
content:
text/xml:
schema:
$ref: '#/components/schemas/AddressValidateResponse'
example: '<AddressValidateResponse>
<Address>
<Address1>STE 6100</Address1>
<Address2>185 BERRY ST</Address2>
<City>SAN FRANCISCO</City>
<State>CA</State>
<Zip5>94107</Zip5>
<Zip4>1741</Zip4>
<DeliveryPoint>25</DeliveryPoint>
<CarrierRoute>C001</CarrierRoute>
<Footnotes>AN</Footnotes>
<DPVConfirmation>Y</DPVConfirmation>
<DPVCMRA>N</DPVCMRA>
<DPVFootnotes>AABB</DPVFootnotes>
<Business>Y</Business>
<CentralDeliveryPoint>N</CentralDeliveryPoint>
<Vacant>N</Vacant>
</Address>
</AddressValidateResponse>'
/ShippingAPI.dll?API=ZipCodeLookup:
get:
summary: 'Lookup a ZIP Code'
operationId: zipcode_lookup
tags:
- ZIP Code
parameters:
- name: API
in: query
description: This query parameter defines the resource you are accessing. For ZIP Code lookup your API query param value must equal `ZipCodeLookup`.
required: true
schema:
type: string
default: ZipCodeLookup
- name: XML
in: query
description: This query parameter defines the XML payload. and it can not be passed in the body<br><br><div class="code"><ZipCodeLookupRequest USERID="XXXXXX"><br> <Address><br> <Address1>Suite 6100</Address1><br> <Address2>185 Berry St</Address2><br> <City>San Francisco</City><br> <State>CA</State><br> </Address><br></ZipCodeLookupRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/ZipCodeLookupRequest'
example: '<ZipCodeLookupRequest USERID="{WEB_TOOLS_USER_NAME}">
<Address>
<Address1>Suite 6100</Address1>
<Address2>185 Berry St</Address2>
<City>San Francisco</City>
<State>CA</State>
</Address>
</ZipCodeLookupRequest>'
responses:
'200':
description: response to ZIP Code lookup'
content:
text/xml:
schema:
$ref: '#/components/schemas/ZipCodeLookupResponse'
example: '<ZipCodeLookupResponse>
<Address>
<Address1>STE 6100</Address1>
<Address2>185 BERRY ST</Address2>
<City>SAN FRANCISCO</City>
<State>CA</State>
<Zip5>94107</Zip5>
<Zip4>1741</Zip4>
</Address>
</ZipCodeLookupResponse>'
/ShippingAPI.dll?API=PriorityMail:
get:
summary: 'Priority Mail Service'
operationId: priority_mail
tags:
- Priority Mail
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: PriorityMail
- name: XML
in: query
description: XML payload <br><br><div class="code"><PriorityMailRequest USERID=”XXXXXXXXXXXX”><br> <OriginZip>90201</OriginZip><br> <DestinationZip>21114</DestinationZip><br></PriorityMailRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/PriorityMailRequest'
example: '<PriorityMailRequest USERID=”XXXXXXXXXXXX”>
<OriginZip>90201</OriginZip>
<DestinationZip>21114</DestinationZip>
</PriorityMailRequest>'
responses:
'200':
description: response to Priority Mail'
content:
text/xml:
schema:
$ref: '#/components/schemas/PriorityMailResponse'
example: '<PriorityMailResponse>
<OriginZip>90210</OriginZip>
<DestinationZip>94556</DestinationZip>
<Days>4</Days>
<EffectiveAcceptanceDate>2022-02-24</EffectiveAcceptanceDate>
<ScheduledDeliveryDate>2022-02-28</ScheduledDeliveryDate>
</PriorityMailResponse>'
/ShippingAPI.dll?API=StandardB:
get:
summary: 'Standard B Service'
operationId: standardb
tags:
- StandardB
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: StandardB
- name: XML
in: query
description: XML payload<br><br><div class="code"><StandardBRequest USERID=”XXXXXXXXXXXX”><br> <OriginZip>90201</OriginZip><br> <DestinationZip>21114</DestinationZip><br></StandardBRequest><br></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/StandardBRequest'
example: '<StandardBRequest USERID=”XXXXXXXXXXXX”>
<OriginZip>90201</OriginZip>
<DestinationZip>21114</DestinationZip>
</StandardBRequest>'
responses:
'200':
description: response to StandardB mail'
content:
text/xml:
schema:
$ref: '#/components/schemas/StandardBResponse'
example: '<StandardBResponse>
<OriginZip>90201</OriginZip>
<DestinationZip>21114</DestinationZip>
<Days>7</Days>
</StandardBResponse>'
/ShippingAPI.dll?API=FirstClassMail:
get:
summary: 'First Class Mail Service'
operationId: first_class_mail
tags:
- First Class Mail
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: FirstClassMail
- name: XML
in: query
description: XML payload<br><br><div class="code"><FirstClassMailRequest USERID=”XXXXXXXXXXXX”><br> <OriginZip>90201</OriginZip><br> <DestinationZip>21114</DestinationZip><br></FirstClassMailRequest><br></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/FirstClassMailRequest'
example: '<FirstClassMailRequest USERID=”XXXXXXXXXXXX”>
<OriginZip>90201</OriginZip>
<DestinationZip>21114</DestinationZip>
</FirstClassMailRequest>'
responses:
'200':
description: response to First Class Mail'
content:
text/xml:
schema:
$ref: '#/components/schemas/FirstClassMailResponse'
example: '<FirstClassMailResponse>
<OriginZip>90201</OriginZip>
<DestinationZip>21114</DestinationZip>
<Days>3</Days>
</FirstClassMailResponse>'
/ShippingAPI.dll?API=ExpressMailCommitment:
get:
summary: 'Express Mail Commitment Service'
operationId: express_mail_commitment
tags:
- Express Mail Commitment
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: ExpressMailCommitment
- name: XML
in: query
description: XML payload<br><br><div class="code"><ExpressMailCommitmentRequest USERID="XXXXXXXXXXXXX"><br> <OriginZIP>63123</OriginZIP><br> <DestinationZIP>89301</DestinationZIP><br> <Date>05-26-2021</Date><br> <DropOffTime>09:00</DropOffTime><br> <ReturnDates>true</ReturnDates><br> <PMGuarantee>Y</PMGuarantee><br></ExpressMailCommitmentRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/ExpressMailCommitmentRequest'
example: '<ExpressMailCommitmentRequest USERID="{WEB_TOOLS_USER_NAME}">
<OriginZIP>63123</OriginZIP>
<DestinationZIP>89301</DestinationZIP>
<Date>05-26-2021</Date>
<DropOffTime>09:00</DropOffTime>
<ReturnDates>true</ReturnDates>
<PMGuarantee>Y</PMGuarantee>
</ExpressMailCommitmentRequest>'
responses:
'200':
description: response to Priority Mail'
content:
text/xml:
schema:
$ref: '#/components/schemas/ExpressMailCommitmentResponse'
example: '<ExpressMailCommitmentResponse>
<OriginZIP>63123</OriginZIP>
<OriginCity>SAINT LOUIS</OriginCity>
<OriginState>MO</OriginState>
<DestinationZIP>89301</DestinationZIP>
<DestinationCity>ELY</DestinationCity>
<DestinationState>NV</DestinationState>
<Date>26-May-2021</Date>
<Time>9:00AM</Time>
<EffectiveAcceptanceDate>2021-05-26</EffectiveAcceptanceDate>
<Commitment>
<CommitmentName>2-Day</CommitmentName>
<CommitmentTime>6:00 PM</CommitmentTime>
<CommitmentSequence>A0218</CommitmentSequence>
<Location>
<ScheduledDeliveryDate>2021-05-28</ScheduledDeliveryDate>
<CutOff>5:30 PM</CutOff>
<Facility>POST OFFICE</Facility>
<Street>55 GRASSO PLZ</Street>
<City>SAINT LOUIS</City>
<State>MO</State>
<Zip>63123</Zip>
</Location>
</Commitment>
<Commitment>
<CommitmentName>2-Day</CommitmentName>
<CommitmentTime>6:00 PM</CommitmentTime>
<CommitmentSequence>B0218</CommitmentSequence>
<Location>
<ScheduledDeliveryDate>2021-05-28</ScheduledDeliveryDate>
<CutOff>5:30 PM</CutOff>
<Facility>POST OFFICE</Facility>
<Street>55 GRASSO PLZ</Street>
<City>SAINT LOUIS</City>
<State>MO</State>
<Zip>63123</Zip>
</Location>
</Commitment>
</ExpressMailCommitmentResponse>'
/ShippingAPI.dll?API=PTSTPod:
get:
summary: 'Track Proof of Delivery'
operationId: track_proof_of_delivery
tags:
- Track Proof of Delivery
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: PTSTPod
- name: XML
in: query
description: XML payload<br><br><div class="code"><PTSTPodRequest USERID="XXXXXXXXXXXX"><br> <TrackId>XXXXXXXXXXX</TrackId ><br> <MpSuffix>9402</MpSuffix><br> <MpDate>2009-07-02 00:42:23.35744</MpDate><br> <RequestType>Email</RequestType><br> <FirstName>John</FirstName><br> <LastName>Doe</LastName><br> <Email1>cpapple@email.com </Email1><br> <Email2></Email2><br> <Email3></Email3><br> <CustRegID>1234567890</CustRegID><br> <TableCode>T</TableCode><br> <ClientIp>127.0.0.1</ClientIp><br> <SourceId>IVR</SourceId><br></PTSTPodRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSTPodRequest'
example: '<PTSTPodRequest USERID="{WEB_TOOLS_USER_NAME}">
<TrackId>XXXXXXXXXXX</TrackId >
<MpSuffix>9402</MpSuffix>
<MpDate>2009-07-02 00:42:23.35744</MpDate>
<RequestType>Email</RequestType>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<Email1>cpapple@email.com </Email1>
<Email2></Email2>
<Email3></Email3>
<CustRegID>1234567890</CustRegID>
<TableCode>T</TableCode>
<ClientIp>127.0.0.1</ClientIp>
<SourceId>IVR</SourceId>
</PTSTPodRequest>'
responses:
'200':
description: response to package tracking'
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSTPodResult'
example: '<PTSTPODRESULT>
<ResultText>Your Proof of Delivery record is complete and will be processed shortly.</ResultText>
<ReturnCode>0</ReturnCode>
</PTSTPODRESULT>'
/ShippingAPI.dll?API=PTSRre:
get:
summary: 'Return Receipt Electronic'
operationId: return_receipt_electronic
tags:
- Return Receipt Electronic
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: PTSRre
- name: XML
in: query
description: XML payload<br><br><div class="code"><PTSRreRequest USERID="XXXXXXXXXXXX"> <br> <TrackId>XXXXXXXXXXX</TrackId > <br> <ClientIp>127.0.0.1</ClientIp><br> <SourceId>XYZ Corp</SourceId><br> <MpSuffix>9402</MpSuffix><br> <MpDate>2009-07-02 00:42:23.35744</MpDate><br> <FirstName>John</FirstName><br> <LastName>Doe</LastName><br> <Email1>cpapple@email.com</Email1><br> <Email2></Email2><br> <Email3></Email3><br> <TableCode>T</TableCode><br> <CustRegID>1234567890</CustRegID><br></PTSRreRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSRreRequest'
example: '<PTSRreRequest USERID="{WEB_TOOLS_USER_NAME}">
<TrackId>XXXXXXXXXXX</TrackId >
<ClientIp>127.0.0.1</ClientIp>
<SourceId>XYZ Corp</SourceId>
<MpSuffix>9402</MpSuffix>
<MpDate>2009-07-02 00:42:23.35744</MpDate>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<Email1>cpapple@email.com</Email1>
<Email2></Email2>
<Email3></Email3>
<TableCode>T</TableCode>
<CustRegID>1234567890</CustRegID>
</PTSRreRequest>'
responses:
'200':
description: response to package tracking'
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSRreResult'
example: '<PTSRRERESULT>
<ResultText>Your Proof of Delivery record is complete and will be processed shortly</ResultText>
<ReturnCode>0</ReturnCode>
</PTSRRERESULT>'
/ShippingAPI.dll?API=PTSPod:
get:
summary: 'Proof of Delivery'
operationId: proof_of_delivery
tags:
- Proof of Delivery
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: PTSPod
- name: XML
in: query
description: XML payload<br><br><div class="code"><PTSPodRequest USERID="XXXXXXXXXXXX"> <br> <TrackId>XXXXXXXXXXX</TrackId ><br> <ClientIp>127.0.0.1</ClientIp><br> <SourceId>XXXXXX</SourceId><br> <MpSuffix>9402</MpSuffix><br> <MpDate>2009-07-02 00:42:23.35744</MpDate><br> <RequestType>Email</RequestType><br> <FirstName>John</FirstName><br> <LastName>Doe</LastName><br> <Email1>test@email.com </Email1><br> <Email2></Email2><br> <Email3></Email3> <br> <TableCode>T</TableCode><br> <CustRegID>1234567890</CustRegID><br></PTSPodRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSPodRequest'
example: '<PTSPodRequest USERID="{WEB_TOOLS_USER_NAME}">
<TrackId>XXXXXXXXXXX</TrackId >
<ClientIp>127.0.0.1</ClientIp>
<SourceId>XXXXXX</SourceId>
<MpSuffix>9402</MpSuffix>
<MpDate>2009-07-02 00:42:23.35744</MpDate>
<RequestType>Email</RequestType>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<Email1>test@email.com </Email1>
<Email2></Email2>
<Email3></Email3>
<TableCode>T</TableCode>
<CustRegID>1234567890</CustRegID>
</PTSPodRequest>'
responses:
'200':
description: response to package tracking'
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSPodResponse'
example: '<PTSPODRESULT>
<ResultText>Your Proof of Delivery record is complete and will be processed shortly.</ResultText> <ReturnCode>0</ReturnCode>
</PTSPODRESULT>'
/ShippingAPI.dll?API=PTSEmail:
get:
summary: 'Track & Confirm by Email'
operationId: track_confirm_by_email
tags:
- Track & Confirm by Email
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: PTSEmail
- name: XML
in: query
description: XML payload<br><br><div class="code"><PTSEmailRequest USERID="XXXXXXXXXXXX"> <br> <TrackId>XXXXXXXXXXX</TrackId > <br> <ClientIp>127.2.0.1</ClientIp><br> <SourceId>XYZ Corp</SourceId><br> <MpSuffix >9402</MpSuffix><br> <MpDate >2021-07-02 00:42:23.35744</MpDate> <br> <RequestType>EN</RequestType> <br> <FirstName>John</FirstName><br> <LastName >Doe</LastName> <br> <Email1>test@email.com</Email1> <br> <Email2></Email2><br> <Email3></Email3><br></PTSEmailRequest></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSEmailRequest'
example: '<PTSEmailRequest USERID="{WEB_TOOLS_USER_NAME}"> <TrackId>XXXXXXXXXXX</TrackId > <ClientIp>127.2.0.1</ClientIp>
<SourceId>XYZ Corp</SourceId>
<MpSuffix >9402</MpSuffix>
<MpDate >2009-07-02 00:42:23.35744</MpDate> <RequestType>EN</RequestType> <FirstName>John</FirstName>
<LastName >Doe</LastName> <Email1>test@email.com</Email1> <Email2></Email2>
<Email3></Email3>
</PTSEmailRequest>'
responses:
'200':
description: response to package tracking'
content:
text/xml:
schema:
$ref: '#/components/schemas/PTSEmailResponse'
example: '<PTSEMAILRESULT>
<ResultText>Your request for all activity to-date will be processed within four hours. Any future activity will be processed whenever there is new delivery related event activity.</ResultText> <ReturnCode>0</ReturnCode>
</PTSEMAILRESULT>'
/ShippingAPI.dll?API=TrackV2:
get:
summary: 'Package Tracking'
operationId: package_tracking
tags:
- Package Tracking
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: TrackV2
- name: XML
in: query
description: XML payload<br><br><div class="code"><TrackRequest USERID="XXXXXXXXXXXX"><br> <TrackID ID="XXXXXXXXXXX1"></TrackID><br> <TrackID ID="XXXXXXXXXXX2"></TrackID><br></TrackRequest><br></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/TrackRequest'
example: '<TrackRequest USERID="{WEB_TOOLS_USER_NAME}">
<TrackID ID="XXXXXXXXXXX1"></TrackID>
<TrackID ID="XXXXXXXXXXX2"></TrackID>
</TrackRequest>'
responses:
'200':
description: response to package tracking'
content:
text/xml:
schema:
$ref: '#/components/schemas/TrackResponse'
example: '<TrackResponse>
<TrackInfo ID="XXXXXXXXXXX1">
<TrackSummary> Your item was delivered at 6:50 am on February 6 in BARTOW FL33830.</TrackSummary>
<TrackDetail>February 6 6:49 am NOTICE LEFT BARTOW FL 33830</TrackDetail>
<TrackDetail>February 6 6:48 am ARRIVAL AT UNIT BARTOW FL 33830</TrackDetail>
<TrackDetail>February 6 3:49 am ARRIVAL AT UNIT LAKELAND FL 33805</TrackDetail>
<TrackDetail>February 5 7:28 pm ENROUTE 33699</TrackDetail>
<TrackDetail>February 5 7:18 pm ACCEPT OR PICKUP 33699</TrackDetail>
</TrackInfo>
</TrackResponse>'
post:
summary: 'Package Tracking Fields'
operationId: package_tracking_fields
tags:
- Package Tracking
parameters:
- name: API
in: query
description: API type
required: true
schema:
type: string
default: TrackV2
- name: XML
in: query
description: XML payload<br><br><div class="code"><TrackFieldRequest USERID="XXXXXXXXXXXX"><br> <Revision>1</Revision> <br> <ClientIp>122.3.3</ClientIp><br> <SourceId>XYZ Corp</SourceId><br> <TrackID ID="XXXXXXXXXXXXXXXX"/> <br></TrackFieldRequest><br></div>
required: true
content:
text/xml:
schema:
$ref: '#/components/schemas/TrackFieldRequest'
example: '<TrackFieldRequest USERID="{WEB_TOOLS_USER_NAME}">
<Revision>1</Revision>
<ClientIp>122.3.3</ClientIp>
<SourceId>XYZ Corp</SourceId>
<TrackID ID="XXXXXXXXXXXXXXXX"/>
</TrackFieldRequest>'
responses:
'200':
description: response to package tracking fields'
content:
text/xml:
schema:
type: object
xml:
name: 'TrackResponse'
required:
- TrackInfo
properties:
TrackInfo:
type: object
xml:
name: 'TrackInfo'
required:
- ID
- TrackSummary
- TrackDetail
description: 'Integer value used to return of all available response fields. Set this value to 1 to return all currently documented response fields.'
properties:
ID:
type: string
default: 826ADISY3274
description: ' This attribute specifies your Web Tools ID. (aka your API KEY) See the [Developers Guide]("https://www.usps.com/business/web-tools-apis/documentation-updates.htm") for information on obtaining your USERID.'
xml:
attribute: true
GuaranteedDeliveryDate:
type: string
format: 'date'
description: 'Global Express Mail only: certain countries provide a guarantee delivery.'
example: 'March 5, 2022'
TrackSummary:
type: object
required:
- EventTime
- EventDate
- Event
- EventCity
- EventState
- EventZIPCode
description: 'Tracking Summary Information'
properties:
EventTime:
type: string
description: 'The time of the event'
example: '12:49 pm'
EventDate:
type: string
description: 'The date of the event'
example: 'March 5, 2022'
Event:
type: string
description: 'The event type'
example: 'USPS in possession of item'
EventCity:
type: string
description: 'City where the event occurred'
example: 'MORAGA'
EventState:
type: string
description: 'State where the event occurred'
example: 'CA'
EventZIPCode:
type: string
description: 'ZIP Code of the event.'
example: '94556'
EventCountry:
type: string
description: 'Country where the event occurred'
example: 'US'
FirmName:
type: string
description: 'Company name if delivered to a company'