usps-ruby-client 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +1 -1
- data/lib/data/api/{address-information-api.htm → address-information-api.html} +0 -0
- data/lib/data/api/{domestic-mail-service-standards-api.htm → domestic-mail-service-standards-api.html} +2482 -2195
- data/lib/data/api/{evs-international-label-api.htm → evs-international-label-api.html} +4546 -2118
- data/lib/data/api/{evs-label-api.htm → evs-label-api.html} +9223 -4626
- data/lib/data/api/expressmail-api-retirement-transition-guide.html +3167 -0
- data/lib/data/api/general-api-developer-guide.html +4668 -0
- data/lib/data/api/{hold-for-pickup-facilities-lookup-api.htm → hold-for-pickup-facilities-lookup-api.html} +0 -0
- data/lib/data/api/{package-pickup-api.htm → package-pickup-api.html} +0 -0
- data/lib/data/api/{rate-calculator-api.htm → rate-calculator-api.html} +5765 -2680
- data/lib/data/api/{scan-api.htm → scan-api.html} +0 -0
- data/lib/data/api/service-delivery-calculator-get-locations-api.html +10522 -0
- data/lib/data/api/sunday-holiday-api.html +5905 -0
- data/lib/data/api/{track-and-confirm-api.htm → track-and-confirm-api.html} +840 -342
- data/lib/data/api/{uspsreturnslabel-api.htm → uspsreturnslabel-api.html} +3686 -4084
- data/lib/tasks/api.rake +4 -3
- data/lib/usps/api/endpoints/carrier_pickup_schedule.rb +1 -1
- data/lib/usps/api/endpoints/city_state_lookup.rb +1 -1
- data/lib/usps/api/endpoints/e_vs_express_mail_intl.rb +12 -5
- data/lib/usps/api/endpoints/e_vs_first_class_mail_intl.rb +12 -10
- data/lib/usps/api/endpoints/e_vs_priority_mail_intl.rb +9 -7
- data/lib/usps/api/endpoints/e_vsgxg_get_label.rb +6 -6
- data/lib/usps/api/endpoints/e_vsi_cancel.rb +8 -7
- data/lib/usps/api/endpoints/hfp_facility_info.rb +1 -1
- data/lib/usps/api/endpoints/intl_rate_v2.rb +13 -11
- data/lib/usps/api/endpoints/pts_email.rb +1 -1
- data/lib/usps/api/endpoints/pts_pod.rb +1 -1
- data/lib/usps/api/endpoints/pts_rre.rb +1 -1
- data/lib/usps/api/endpoints/ptst_pod.rb +1 -1
- data/lib/usps/api/endpoints/rate_v4.rb +13 -9
- data/lib/usps/api/endpoints/scan.rb +1 -1
- data/lib/usps/api/endpoints/sunday_holiday_availability.rb +46 -0
- data/lib/usps/api/endpoints/track_v2.rb +1 -1
- data/lib/usps/api/endpoints/usps_returns_label.rb +55 -15
- data/lib/usps/api/endpoints/verify.rb +1 -1
- data/lib/usps/api/endpoints/zip_code_lookup.rb +1 -1
- data/lib/usps/api/endpoints.rb +3 -0
- data/lib/usps/api/templates/method.erb +1 -1
- data/lib/usps/version.rb +1 -1
- data/usps-ruby-client.gemspec +2 -2
- metadata +16 -14
- data/lib/data/api/service-delivery-calculator-get-locations-api.htm +0 -12548
- data/usps-ruby-client-0.1.0.gem +0 -0
- data/usps-ruby-client-0.1.2.gem +0 -0
data/lib/tasks/api.rake
CHANGED
@@ -33,7 +33,7 @@ namespace :usps do
|
|
33
33
|
|
34
34
|
def standardize_table_hash_array(arr)
|
35
35
|
arr.map do |option|
|
36
|
-
next if option['Tag Name'].split('/').pop.strip.casecmp('userid').zero?
|
36
|
+
next if option['Tag Name'].blank? || option['Tag Name'].split('/').pop.strip.casecmp('userid').zero?
|
37
37
|
|
38
38
|
{
|
39
39
|
type: option['Type'],
|
@@ -163,7 +163,8 @@ namespace :usps do
|
|
163
163
|
#{title}
|
164
164
|
#{xml}
|
165
165
|
XML
|
166
|
-
elsif subsection[:title] == 'Response Descriptions' || subsection[:title]
|
166
|
+
elsif subsection[:title] == 'Response Descriptions' || subsection[:title].match?(/Request (Tag )*Descriptions/) # Some documents have Tag, some don't
|
167
|
+
subsection[:title] = 'Request Descriptions' if subsection[:title] == 'Request Tag Descriptions'
|
167
168
|
columns, *rows = content_node.search('tr').map do |tr|
|
168
169
|
next if tr.ancestors('table').length > 1
|
169
170
|
|
@@ -227,7 +228,7 @@ namespace :usps do
|
|
227
228
|
end
|
228
229
|
|
229
230
|
failed_docs = []
|
230
|
-
Dir.glob('lib/data/api/*.
|
231
|
+
Dir.glob('lib/data/api/*.html').each do |f|
|
231
232
|
ap f
|
232
233
|
# begin
|
233
234
|
parse_doc(f)
|
@@ -31,7 +31,7 @@ module Usps
|
|
31
31
|
# * *:package_location* (required, String) — Enter one of the following values: Note: "Other" requires information in the value for the <SpecialInstructions> tag. For example: <PackageLocation>Front Door</PackageLocation>
|
32
32
|
# * *:special_instructions* (String) — Value Required when PackageLocation is “Other”. Only alpha, numeric, commas, periods, apostrophes, _, &, -, ( ), ?, #, / +, @ and space characters may be used. For example: <SpecialInstructions>Packages are behind the screen door.</SpecialInstructions>
|
33
33
|
# * *:email_address* (String) — If provided, email notifications will be sent confirming package pickup, or request changes and cancellations. Maximum characters allowed: 50. For example: <EmailAddress>cpapple@email.com</EmailAddress>
|
34
|
-
def carrier_pickup_schedule(options = {})
|
34
|
+
def carrier_pickup_schedule(options = {})
|
35
35
|
throw ArgumentError.new('Required arguments :carrier_pickup_schedule_request missing') if options[:carrier_pickup_schedule_request].nil?
|
36
36
|
throw ArgumentError.new('Required arguments :carrier_pickup_schedule_request, :first_name missing') if options[:carrier_pickup_schedule_request][:first_name].nil?
|
37
37
|
throw ArgumentError.new('Required arguments :carrier_pickup_schedule_request, :last_name missing') if options[:carrier_pickup_schedule_request][:last_name].nil?
|
@@ -12,7 +12,7 @@ module Usps
|
|
12
12
|
# @option options [required, Hash] city_state_lookup_request API= CityStateLookupRequest
|
13
13
|
# * *:zip_code* (required, Hash) —
|
14
14
|
# * *:zip5* (required, Integer) —
|
15
|
-
def city_state_lookup(options = {})
|
15
|
+
def city_state_lookup(options = {})
|
16
16
|
throw ArgumentError.new('Required arguments :city_state_lookup_request missing') if options[:city_state_lookup_request].nil?
|
17
17
|
throw ArgumentError.new('Required arguments :city_state_lookup_request, :zip_code missing') if options[:city_state_lookup_request][:zip_code].nil?
|
18
18
|
throw ArgumentError.new('Required arguments :city_state_lookup_request, :zip_code, :zip5 missing') if options[:city_state_lookup_request][:zip_code][:zip5].nil?
|
@@ -85,10 +85,10 @@ module Usps
|
|
85
85
|
# * *:hold_for_manifest* (String) — Restricted use. Holds manifest record for possible inclusion in SCAN request.
|
86
86
|
# * *:eelpfc* (String) — Exemption and Exclusion Legend or PFC Code. Please refer to the International Mail Manual for further information: http://pe.usps.gov/text/imm/immc5_007.htm. For example: <EELPFC>30.37a</EELPFC>
|
87
87
|
# * *:price_options* (String) — Indicates if commercial-base price should be returned. For commercial-base price eligibility, please reference the Domestic Mail Manual at http://pe.usps.com/.
|
88
|
-
# * *:length* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
89
|
-
# * *:width* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
90
|
-
# * *:height* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
91
|
-
# * *:girth* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
88
|
+
# * *:length* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
89
|
+
# * *:width* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
90
|
+
# * *:height* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
91
|
+
# * *:girth* (String) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
92
92
|
# * *:label_time* (String) — Available if <Revision>= 2. LabelTime is used in conjunction with LabelDate to determine the Guarantee
|
93
93
|
# * *:meter_payment_flag* (String) — Meter payment indicator
|
94
94
|
# * *:action_code* (String) — Used to specify the action code.Value is passed to Shipping Partner Event file via the shipment manifest. · M0 – Mailer Owner · S0 – Service Provider For example: <ActionCode>M0</ActionCode>
|
@@ -116,7 +116,10 @@ module Usps
|
|
116
116
|
# * *:sender_zip5* (String) — Sender ZIP code. For example: <SenderZip5>20212</SenderZip5> Required when <ePostageMailerReporting>=1
|
117
117
|
# * *:sender_phone* (String) — Sender Phone #. 10 digits Required (including area code), with no punctuation. For example: <SenderPhone>2125551234</SenderPhone> Required when <ePostageMailerReporting>=1
|
118
118
|
# * *:sender_email* (String) — E-mail Address of Sender. Valid e-mail addresses must be used. For example: <SenderEMail>cpapple@email.com</SenderEMail> Required when <ePostageMailerReporting>=1
|
119
|
-
|
119
|
+
# * *:extra_services* (Hash) — Groups extra services elements
|
120
|
+
# * *:extra_service* (Service Name) — [{"Service Name"=>"Scan Retention", "Service ID"=>"181"}, {"Service Name"=>"Scan + Signature Retention", "Service ID"=>"182"}]
|
121
|
+
# * *:tracking_retention_period* (ServiceID) — [{"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“0.5” (6 Months)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“1” (1 Year)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}]
|
122
|
+
def e_vs_express_mail_intl(options = {})
|
120
123
|
throw ArgumentError.new('Required arguments :e_vs_express_mail_intl_request missing') if options[:e_vs_express_mail_intl_request].nil?
|
121
124
|
|
122
125
|
request = build_request(:e_vs_express_mail_intl, options)
|
@@ -238,6 +241,10 @@ def e_vs_express_mail_intl(options = {})
|
|
238
241
|
tag_unless_blank(xml, 'SenderZip5', options[:e_vs_express_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:sender_zip5])
|
239
242
|
tag_unless_blank(xml, 'SenderPhone', options[:e_vs_express_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:sender_phone])
|
240
243
|
tag_unless_blank(xml, 'SenderEmail', options[:e_vs_express_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:sender_email])
|
244
|
+
xml.tag!('ExtraServices') do
|
245
|
+
tag_unless_blank(xml, 'ExtraService', options[:e_vs_express_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:extra_service])
|
246
|
+
tag_unless_blank(xml, 'TrackingRetentionPeriod', options[:e_vs_express_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:tracking_retention_period])
|
247
|
+
end if options[:e_vs_express_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services].present?
|
241
248
|
end if options[:e_vs_express_mail_intl_request][:image_parameters][:shipping_contents][:item_detail].present?
|
242
249
|
end
|
243
250
|
end if options[:e_vs_express_mail_intl_request][:image_parameters].present?
|
@@ -57,7 +57,7 @@ module Usps
|
|
57
57
|
# * *:postage* (String Decimal) — Use this tag for entering a postage amount, if known. If the tag is present, but the value is blank, the postage will be automatically calculated. For example: <Postage></Postage>
|
58
58
|
# * *:gross_pounds* (required, Integer) — Gross pounds and ounces together represent the total package weight, including packing material. For example, a package weighing 3 lbs 8 ounces would have "3" entered here and "8" entered with the "GrossOunces" tag. The Web Tool will check for maximum shipping weight of 70 pounds. Allowable weight may change based on the service used to send package and the destination country. For example: <GrossPounds>4</GrossPounds>
|
59
59
|
# * *:gross_ounces* (required, Integer) — Enter the ounces component of the total package weight with this tag. For example: <GrossOunces>0</GrossOunces>
|
60
|
-
# * *:machinable* (Boolean) — Indicates whether or not the item is machinable. A surcharge is applied to a First-Class Mail International item if it has one or more non-machinable characteristics. See International Mail Manual (IMM) Section 241 for more information.
|
60
|
+
# * *:machinable* (Boolean) — Indicates whether or not the item is machinable. A surcharge is applied to a First-Class Mail International item if it has one or more non-machinable characteristics. For example: <Machinable>false</Machinable> See International Mail Manual (IMM) Section 241 for more information.
|
61
61
|
# * *:content_type* (required, String) — Specifies the content of the package or envelope. For example: <ContentType>DOCUMENTS</ContentType>
|
62
62
|
# * *:content_type_other* (String) — Required when FirstClassMailIntlRequest[ContentType='OTHER'].
|
63
63
|
# * *:agreement* (required, String) — Indicates the requestor's agreement to terms and conditions of mailing. Requires a value of Y to print and in Signature Box along with Current Date (Central Time USA). Any other value returns an error.
|
@@ -72,20 +72,20 @@ module Usps
|
|
72
72
|
# * *:po_zip_code* (String) — ZIP Code of Post Office or collection box where item is mailed. May be different than FromZip5. This tag will take precedence over FromZip5 when provided. For example: <POZipCode>00962</POZipCode>
|
73
73
|
# * *:label_date* (String) — Date the mail will enter the mail stream. No more than three days in the future. Default is day of request. For example: <LabelDate>09/28/2010</LabelDate>
|
74
74
|
# * *:hold_for_manifest* (String) — Restricted use. Holds manifest record for possible inclusion in SCAN request.
|
75
|
-
# * *:eelpfc* (String) — Exemption and Exclusion Legend or PFC Code. Currently Optional, in the future it may be Required for use. Please refer to the International Mail Manual for further information - http://pe.usps.gov/text/imm/immc5_007.htm.
|
76
|
-
# * *:container* (String) —
|
77
|
-
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
78
|
-
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
79
|
-
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
80
|
-
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
75
|
+
# * *:eelpfc* (String) — Exemption and Exclusion Legend or PFC Code. Currently Optional, in the future it may be Required for use. To activate check boxes use ”30.37a” or “30.37h”. For example: <EELPFC>30.37a</EELPFC> Please refer to the International Mail Manual for further information - http://pe.usps.gov/text/imm/immc5_007.htm.
|
76
|
+
# * *:container* (String) — Used to indicate package is a roll. When package is a roll, integrators should pass <Container>= “ROLL” in XML request. If package is not a roll, integrators should not populate – label response will assume package is not a roll. Note: When <Container>= “ROLL”, errors will return if dimensions provided in XML request do not meet IMM 251.22 requirements. https://pe.usps.com/text/imm/immc2_021.htm.
|
77
|
+
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
78
|
+
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
79
|
+
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
80
|
+
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
81
81
|
# * *:extra_services* (Hash) — Groups extra services elements
|
82
|
-
# * *:extra_service* (Extra Service Name) — [{"Extra Service Name"=>"e-USPS Delivery Confirmation International", "Service ID"=>"109"}]
|
82
|
+
# * *:extra_service* (Extra Service Name) — [{"Extra Service Name"=>"e-USPS Delivery Confirmation International", "Service ID"=>"109"}, {"Extra Service Name"=>"Scan Retention", "Service ID"=>"181"}, {"Extra Service Name"=>"Scan + Signature Retention", "Service ID"=>"182"}, {"Extra Service Name"=>"", "Service ID"=>""}]
|
83
83
|
# * *:price_options* (String) — Indicates if retail, commercial base or commercial plus pricing should be returned. For example: <PriceOptions>COMMERCIAL BASE</PriceOptions>
|
84
84
|
# * *:action_code* (String) — Passed to SPE file via the shipment manifest.
|
85
85
|
# * *:opt_out_of_spe* (boolean) — Allows a customer to opt out of SPE file creation. “false” WILL create a SPE file. Note: This request tag is case sensitive.
|
86
86
|
# * *:permit_number* (String) — Number associated with a mailing permit. The permit is permission to use a certain postage payment method for bulk and commercial mailings
|
87
87
|
# * *:account_zip_code* (String) — ZIP of Account Post Office where mailed if different from <FromZip5/>. Written to Postal Manifest Detail record. Must be valid ZIP Code. For example: <AccountZipCode>00962</AccountZipCode>
|
88
|
-
# * *:machinable* (boolean) — Indicates whether or not the item is machinable. A surcharge is applied to a First-Class Mail International item if it has one or more non-machinable characteristics. See International Mail Manual (IMM) Section 241 for more information.
|
88
|
+
# * *:machinable* (boolean) — Indicates whether or not the item is machinable. A surcharge is applied to a First-Class Mail International item if it has one or more non-machinable characteristics. For example: <Machinable>false</Machinable> See International Mail Manual (IMM) Section 241 for more information.
|
89
89
|
# * *:destination_rate_indicator* (required, String) — Required for destination entry packages · I = International Service Center (ISC) · N = None
|
90
90
|
# * *:mid* (String) — Mailer ID (MID), Represents Mail Owner MID. Located in position #13 in the Detail 1 record of the Shipping Services File v2.0. For example: <MID>847654321</ MID>
|
91
91
|
# * *:logistics_manager_mid* (String) — The MID of the company that manages the mailing. Located in position #12 in the Detail 1 record of the Shipping Services File v2.0. Note: If LogisticsManagerMID is populated, either CRID or MID must also be populated. For example: <LogisticsManagerMID>489001</LogisticsManagerMID>
|
@@ -104,7 +104,8 @@ module Usps
|
|
104
104
|
# * *:sender_email* (String) — E-mail Address of Sender. Valid e-mail addresses must be used. For example: <SenderEMail>cpapple@email.com</ SenderEMail> Required when <ePostageMailerReporting>=1
|
105
105
|
# * *:remaining_barcodes* (required, String) — This contains the number of remaining barcodes that can be generated for this particular request.
|
106
106
|
# * *:chargeback_code* (String) — Used in Shipping Services File v2.0 for G-10 labels. Contact your Technical Integration Specialist for details.
|
107
|
-
|
107
|
+
# * *:tracking_retention_period* (ServiceID) — [{"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“0.5” (6 Months)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“1” (1 Year)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}]
|
108
|
+
def e_vs_first_class_mail_intl(options = {})
|
108
109
|
throw ArgumentError.new('Required arguments :e_vs_first_class_mail_intl_request missing') if options[:e_vs_first_class_mail_intl_request].nil?
|
109
110
|
throw ArgumentError.new('Required arguments :e_vs_first_class_mail_intl_request, :revision missing') if options[:e_vs_first_class_mail_intl_request][:revision].nil?
|
110
111
|
|
@@ -214,6 +215,7 @@ def e_vs_first_class_mail_intl(options = {})
|
|
214
215
|
tag_unless_blank(xml, 'SenderEmail', options[:e_vs_first_class_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_email])
|
215
216
|
xml.tag!('RemainingBarcodes', options[:e_vs_first_class_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:remaining_barcodes])
|
216
217
|
tag_unless_blank(xml, 'ChargebackCode', options[:e_vs_first_class_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:chargeback_code])
|
218
|
+
tag_unless_blank(xml, 'TrackingRetentionPeriod', options[:e_vs_first_class_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:tracking_retention_period])
|
217
219
|
end if options[:e_vs_first_class_mail_intl_request][:image_parameters][:shipping_contents][:item_detail][:extra_services].present?
|
218
220
|
end if options[:e_vs_first_class_mail_intl_request][:image_parameters][:shipping_contents][:item_detail].present?
|
219
221
|
end
|
@@ -83,14 +83,14 @@ module Usps
|
|
83
83
|
# * *:po_zip_code* (String) — ZIP Code of Post Office or collection box where item is mailed. May be different than FromZip5. This tag will take precedence over FromZip5 when provided. For example: <POZipCode>00962</POZipCode>
|
84
84
|
# * *:label_date* (String) — Date the mail will enter the mail stream. No more than 3 days in the future. Default is day of request. For example: <LabelDate>09/28/2010</LabelDate>
|
85
85
|
# * *:hold_for_manifest* (String) — Restricted use. Holds manifest record for possible inclusion in SCAN request.
|
86
|
-
# * *:eelpfc* (String) — Exemption and Exclusion Legend or PFC Code. Use in conjunction with Revision tag with value of 1 to indicate and trigger new functionality.
|
86
|
+
# * *:eelpfc* (String) — Exemption and Exclusion Legend or PFC Code. Use in conjunction with Revision tag with value of 1 to indicate and trigger new functionality. To activate check boxes use ”30.37a” or “30.37h”. For example: <EELPFC>30.37a</EELPFC> Please refer to the International Mail Manual for further information http://pe.usps.gov/text/imm/immc5_007.htm.
|
87
87
|
# * *:price_options* (String) — Price option for package.
|
88
|
-
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
89
|
-
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
90
|
-
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
91
|
-
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages.
|
88
|
+
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
89
|
+
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
90
|
+
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
91
|
+
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
92
92
|
# * *:extra_services* (Hash) — Groups extra services elements
|
93
|
-
# * *:extra_service* (Extra Service Name) — [{"Extra Service Name"=>"e-USPS Return Receipt", "Service ID"=>"105"}]
|
93
|
+
# * *:extra_service* (Extra Service Name) — [{"Extra Service Name"=>"e-USPS Return Receipt", "Service ID"=>"105"}, {"Extra Service Name"=>"Scan Retention", "Service ID"=>"181"}, {"Extra Service Name"=>"Scan + Signature Retention", "Service ID"=>"182"}]
|
94
94
|
# * *:action_code* (String) — Used to specify the action code. Value is included in the Shipping Partner Event file for customers who have chose to have a Shipping Partner Event file submitted to USPS on their behalf. M0 – Mailer Owner S0 – Service Provider For example: <ActionCode>M0</ActionCode>
|
95
95
|
# * *:opt_out_of_spe* (Boolean) — Allows a customer to opt out of SPE file creation. “false” WILL create a SPE file. Note: This request tag is case sensitive.
|
96
96
|
# * *:permit_number* (String) — Number associated with a mailing permit. The permit is permission to use a certain postage payment method for bulk and commercial mailings
|
@@ -117,7 +117,8 @@ module Usps
|
|
117
117
|
# * *:sender_phone* (String) — Sender Phone #. 10 digits Required (including area code), with no punctuation. For example: <SenderPhone>2125551234</ SenderPhone> Required when <ePostageMailerReporting>=1
|
118
118
|
# * *:sender_email* (String) — E-mail Address of Sender. Valid e-mail addresses must be used. For example: <SenderEMail>cpapple@email.com</ SenderEMail> Required when <ePostageMailerReporting>=1
|
119
119
|
# * *:chargeback_code* (String) — Used in Shipping Services File v2.0 for G-10 labels. Contact your Technical Integration Specialist for details.
|
120
|
-
|
120
|
+
# * *:tracking_retention_period* (ServiceID) — [{"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“0.5” (6 Months)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“1” (1 Year)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}]
|
121
|
+
def e_vs_priority_mail_intl(options = {})
|
121
122
|
throw ArgumentError.new('Required arguments :e_vs_priority_mail_int_request missing') if options[:e_vs_priority_mail_int_request].nil?
|
122
123
|
throw ArgumentError.new('Required arguments :e_vs_priority_mail_int_request, :revision missing') if options[:e_vs_priority_mail_int_request][:revision].nil?
|
123
124
|
|
@@ -241,6 +242,7 @@ def e_vs_priority_mail_intl(options = {})
|
|
241
242
|
tag_unless_blank(xml, 'SenderPhone', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_phone])
|
242
243
|
tag_unless_blank(xml, 'SenderEmail', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_email])
|
243
244
|
tag_unless_blank(xml, 'ChargebackCode', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:chargeback_code])
|
245
|
+
tag_unless_blank(xml, 'TrackingRetentionPeriod', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:tracking_retention_period])
|
244
246
|
end if options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services].present?
|
245
247
|
end if options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail].present?
|
246
248
|
end
|
@@ -66,11 +66,11 @@ module Usps
|
|
66
66
|
# * *:insured_value* (Decimal) — If specified, InsuredValue is used to calculate the Insurance Fee. For example: <InsuredValue>180.00</InsuredValue>
|
67
67
|
# * *:gross_pounds* (Decimal) — GrossPounds + (GrossOunces/16) must be less than 70. For example: <GrossPounds>40</GrossPounds>
|
68
68
|
# * *:gross_ounces* (Decimal) — GrossPounds + (GrossOunces/16) must be less than 70. For example: <GrossOunces>5</GrossOunces>
|
69
|
-
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required for non-rectangular package.
|
70
|
-
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required for non-rectangular
|
71
|
-
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required for non-rectangular package.
|
72
|
-
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required for non-rectangular package.
|
73
|
-
# * *:shape* (String) —
|
69
|
+
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
70
|
+
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
71
|
+
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
72
|
+
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
73
|
+
# * *:shape* (String) — Shape, plus the package's physical dimensions, help determine whether the scale weight or the dimensional weight is used to calculate the shipping cost. For example: <Shape>RECTANGULAR</Shape>
|
74
74
|
# * *:ci_required* (boolean) — Indicates if Commercial Invoice is Required. When CIRequired=” true”, commercial invoice image will be generated. For example: <CIRequired>true</CIRequired>
|
75
75
|
# * *:invoice_date* () — Invoice date. Required when CommercialShipment=” true”. For example: <InvoiceDate>01/01/2012</InvoiceDate>
|
76
76
|
# * *:invoice_number* (String) — Invoice number. Required when CommercialShipment=” true”. For example: <InvoiceNumber>20120101</InvoiceNumber>
|
@@ -114,7 +114,7 @@ module Usps
|
|
114
114
|
# * *:vendor_product_version_number* (String) — Shipping software’s product version number. Located in position #16 in the Detail 1 record of the Shipping Services File v2.0. For example: <VendorProductVersionNumber>5.02.1B</ VendorProductVersionNumber>
|
115
115
|
# * *:override_mid* (String) —
|
116
116
|
# * *:chargeback_code* (String) — Used in Shipping Services File v2.0 for G-10 labels. Contact your Technical Integration Specialist for details.
|
117
|
-
def e_vsgxg_get_label(options = {})
|
117
|
+
def e_vsgxg_get_label(options = {})
|
118
118
|
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request missing') if options[:e_vsgxg_get_label_request].nil?
|
119
119
|
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :option missing') if options[:e_vsgxg_get_label_request][:option].nil?
|
120
120
|
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :image_parameters missing') if options[:e_vsgxg_get_label_request][:image_parameters].nil?
|
@@ -8,17 +8,18 @@ module Usps
|
|
8
8
|
module EVSICancel
|
9
9
|
# The eVS
|
10
10
|
# International Cancel request allows an eVS label to be removed from processing
|
11
|
-
# if the request is made prior to 11:59 PM Central Time on the day of label creation.This functionality is
|
12
|
-
# label has been held for manifest (i.e.
|
13
|
-
# is included in eVS International
|
14
|
-
# File v2.0 has not yet been
|
15
|
-
#
|
16
|
-
#
|
11
|
+
# if the request is made prior to 11:59 PM Central Time on the day of label creation.This functionality is
|
12
|
+
# available only if the eVS International label has been held for manifest (i.e.
|
13
|
+
# <HoldForManifest>=”Y” is included in eVS International
|
14
|
+
# label XML request) and the Shipping Services File v2.0 has not yet been
|
15
|
+
# created. Depending on customer profile setup, this transmission could occur for
|
16
|
+
# created labels every 15 minutes, at the end of the shipping day, or when a SCAN
|
17
|
+
# Form is manually triggered by the customer.
|
17
18
|
# @param [Hash] options
|
18
19
|
# @option options [required, Hash] e_vsi_cancel_request
|
19
20
|
# * *:barcode_number* (required, ) — BarcodeNumber of original label. Length of 22, 30 or 34 numbers.
|
20
21
|
# * *:e_vsi_cancel_request* (required, ) —
|
21
|
-
def e_vsi_cancel(options = {})
|
22
|
+
def e_vsi_cancel(options = {})
|
22
23
|
throw ArgumentError.new('Required arguments :e_vsi_cancel_request missing') if options[:e_vsi_cancel_request].nil?
|
23
24
|
throw ArgumentError.new('Required arguments :e_vsi_cancel_request, :barcode_number missing') if options[:e_vsi_cancel_request][:barcode_number].nil?
|
24
25
|
throw ArgumentError.new('Required arguments :e_vsi_cancel_request, :e_vsi_cancel_request missing') if options[:e_vsi_cancel_request][:e_vsi_cancel_request].nil?
|
@@ -24,7 +24,7 @@ module Usps
|
|
24
24
|
# * *:pickup_zip* (required, String) — Either City/State or ZIP code must be specified. When PickupZIP provided without PickupZIP4, all pickup facilities that service that ZIP code are returned. For example: <PickupZIP>02111</PickupZIP>
|
25
25
|
# * *:pickup_zip4* (required, String) — If PickupZIP is specified, then PickupZIP4 may also be specified. This will match to a single pickup facility with the given nine-digit ZIP code. For example: <PickupZIP4>9998</PickupZIP4>
|
26
26
|
# * *:service* (String) — For future use. May be omitted.
|
27
|
-
def hfp_facility_info(options = {})
|
27
|
+
def hfp_facility_info(options = {})
|
28
28
|
throw ArgumentError.new('Required arguments :hfp_facility_info_request missing') if options[:hfp_facility_info_request].nil?
|
29
29
|
throw ArgumentError.new('Required arguments :hfp_facility_info_request, :pickup_city missing') if options[:hfp_facility_info_request][:pickup_city].nil?
|
30
30
|
throw ArgumentError.new('Required arguments :hfp_facility_info_request, :pickup_state missing') if options[:hfp_facility_info_request][:pickup_state].nil?
|
@@ -10,8 +10,8 @@ module Usps
|
|
10
10
|
# IntlRateV2 API lets customers calculate the rate for international packages and
|
11
11
|
# envelopes given the weight and dimensions of the item. The IntlRateV2 API
|
12
12
|
# limits the data requested to twenty-five (25) packages per transaction. For
|
13
|
-
# specifications such as package dimensions, delivery information, etc, please
|
14
|
-
# http://pe.usps.com/.
|
13
|
+
# specifications such as package dimensions, delivery information, etc, please
|
14
|
+
# refer to the International Mail Manual (IMM) at http://pe.usps.com/.
|
15
15
|
# @param [Hash] options
|
16
16
|
# @option options [required, Hash] intl_rate_v2_request API=IntlRateV2 This API returns the current international USPS postage corresponding to the parameters given.
|
17
17
|
# * *:revision* (String) — Set this value to “2” to return all currently documented response fields. For example: <Revision>2</Revsion>
|
@@ -20,29 +20,30 @@ module Usps
|
|
20
20
|
# * *:pounds* (required, Integer) — Value must be numeric. Package weight generally cannot exceed 70 pounds. Maximum Decimal places are 8. Refer to the International Mail Manual (IMM) for weight requirements per country and mail service. The IMM can be found at the Postal Explorer web site. For example: <Pounds>2</Pounds> <Pounds>2.12345678</Pounds>
|
21
21
|
# * *:ounces* (required, Decimal) — Value must be numeric. Package weight generally cannot exceed 70 pounds. Maximum Decimal places are 8. Refer to the International Mail Manual (IMM) for weight requirements per country and mail service. The IMM can be found at the Postal Explorer web site. For example: <Ounces>4</Ounces> <Ounces>4.12345678</Ounces>
|
22
22
|
# * *:machinable* (Boolean) — Indicates whether or not the item is machinable. A surcharge is applied to a First-Class Mail International item if it has one or more non-machinable characteristics. See International Mail Manual (IMM) Section 241.217 for more information. For example: <Machinable>True</Machinable>
|
23
|
-
# * *:mail_type* (required, String) — Package type being shipped. For example: <MailType>Package</MailType>
|
23
|
+
# * *:mail_type* (required, String) — Package type being shipped. For example: <MailType>Package</MailType> Note: Airmail M-Bag prices will return for retail pricing when available including when <MailType>=“ALL.” Reference https://pe.usps.com/text/imm/immc2_026.htm for M-Bag pricing details. Note: When <MailType>= “ALL” is indicated in XML request and a <TrackingRetentionPeriod> value is not specified, the lowest tracking retention period values (i.e., “0.5” (6 months) for ServiceID=“181” and “3” (3 years) for ServiceID=“182”) will be used to return available USPS Tracking Plus extra service options for supported mail services.
|
24
24
|
# * *:gxg* (Hash) — If GXG rate is desired, then this group must be specified. Note that if this data precludes delivery, due to size or availability of service at the destination, then GXG rates simply will not be returned (not an error condition.)
|
25
25
|
# * *:po_box_flag* (required, String) — Specify as "Y" if the destination is a post office box. For example: <POBoxFlag>Y</POBoxFlag>
|
26
26
|
# * *:gift_flag* (required, String) — Specify as "Y" if the package contains a gift. For example: <GiftFlag>Y</GiftFlag>
|
27
27
|
# * *:value_of_contents* (required, String) — If specified, used to compute Insurance fee (if insurance is available for service and destination). For example: <ValueOfContents>103.00</ValueOfContents>
|
28
28
|
# * *:country* (required, String) — Entries must be from the USPS list of valid countries from the International Country Listings. To access the International Country Listings, go to the Index of Countries and Localities. For example: <Country>Albania</Country>
|
29
|
-
# * *:container* (String) —
|
29
|
+
# * *:container* (String) — Used to specify a container. When package is a roll, integrators should pass <Container>= “ROLL” in XML request. If package is not a roll, integrators should not populate – label response will assume package is not a roll. Note: When <Container>= “ROLL”, errors will return if dimensions provided in XML request do not meet IMM 251.22 requirements. https://pe.usps.com/text/imm/immc2_021.htm.
|
30
30
|
# * *:size* (String) — Note: This tag has been deprecated <Size> tag and any values within the <Size> tag will not result in an error response and will not impact rates that are returned.
|
31
|
-
# * *:width* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
32
|
-
# * *:length* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
33
|
-
# * *:height* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
34
|
-
# * *:girth* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
35
|
-
# * *:origin_zip* (String) — Available when
|
31
|
+
# * *:width* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
32
|
+
# * *:length* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
33
|
+
# * *:height* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
34
|
+
# * *:girth* (Integer) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference IMM https://pe.usps.com/text/imm/welcome.htm
|
35
|
+
# * *:origin_zip* (String) — Available when Revision= “2”. Origin ZIP Code is required to determine Priority Mail International price to Canadian destinations and is used to determine mail-ability of Global Express Guaranteed. When provided, the response will return a list of Post Office locations where GXG is accepted. The Origin ZIP Code must be valid. For example: <OriginZip>20770</OriginZip>
|
36
36
|
# * *:commercial_flag* (String) — Returns commercial base postage. For example: <CommercialFlag>Y<CommercialFlag>
|
37
37
|
# * *:commercial_plus_flag* (String) — Returns commercial plus postage. For example: <CommercialPlusFlag>Y<CommercialPlusFlag>
|
38
38
|
# * *:extra_services* (Hash) — Available when IntlRateV2Request[Revision='2']. Groups the ExtraService elements.
|
39
|
-
# * *:extra_service* (Extra Service Name) — [{"Extra Service Name"=>"Registered Mail", "ServiceID"=>"103"}, {"Extra Service Name"=>"Insurance – Global Express Guaranteed", "ServiceID"=>"106"}, {"Extra Service Name"=>"Insurance – Priority Mail International", "ServiceID"=>"108"}, {"Extra Service Name"=>"Return Receipt", "ServiceID"=>"105"}, {"Extra Service Name"=>"Certificate of Mailing", "ServiceID"=>"100"}, {"Extra Service Name"=>"Electronic USPS Delivery Confirmation International", "ServiceID"=>"109"}]
|
39
|
+
# * *:extra_service* (Extra Service Name) — [{"Extra Service Name"=>"Registered Mail", "ServiceID"=>"103"}, {"Extra Service Name"=>"Insurance – Global Express Guaranteed", "ServiceID"=>"106"}, {"Extra Service Name"=>"Insurance – Priority Mail International", "ServiceID"=>"108"}, {"Extra Service Name"=>"Return Receipt", "ServiceID"=>"105"}, {"Extra Service Name"=>"Certificate of Mailing", "ServiceID"=>"100"}, {"Extra Service Name"=>"Electronic USPS Delivery Confirmation International", "ServiceID"=>"109"}, {"Extra Service Name"=>"Scan Retention", "ServiceID"=>"181"}, {"Extra Service Name"=>"Scan + Signature Retention", "ServiceID"=>"182"}]
|
40
40
|
# * *:acceptance_date_time* (DateTime) — Available when IntlRateV2Request[Revision='2']. Date and Time the package is accepted by USPS. The AcceptanceDateTime tag along with the DestinationPostalCode and OriginZip is used to calculate the GuaranteeAvailability and also GuaranteeAvailability response tag for PMEI services in Kahala countries. ISO 8601 formatted date. YYYY-MM-DDThh:mm:ss+/-hh:mm For example, 2014-01-22T14:30:51-06:00
|
41
41
|
# * *:destination_postal_code* (String) — Available when IntlRateV2Request[Revision='2']. Destination Postal Code The AcceptanceDateTime tag along with the DestinationPostalCode and OriginZip is used to calculate the GuaranteeAvailability and also GuaranteeAvailability response tag for PMEI services in Kahala countries.
|
42
42
|
# * *:content* (Hash) — Used to describe the contents of the package.
|
43
43
|
# * *:content_type* (String) — Contains the enumerated description of the items in the package. “NonnegotiableDocument” and “Documents” both signify mailable non-negotiable documents and are insured automatically for up to $100, though Insurance will not be returned as an extra service. Additional Insurance cannot be purchased. Any non-document ContentType values are insured automatically for up to $200 and Insurance will be returned as an explicit extra service in the response. Additional Insurance can be purchased for values $200 and greater.
|
44
44
|
# * *:content_description* (String) — For future use
|
45
|
-
|
45
|
+
# * *:tracking_retention_period* (ServiceID) — [{"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“0.5” (6 Months)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“1” (1 Year)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}]
|
46
|
+
def intl_rate_v2(options = {})
|
46
47
|
throw ArgumentError.new('Required arguments :intl_rate_v2_request missing') if options[:intl_rate_v2_request].nil?
|
47
48
|
|
48
49
|
request = build_request(:intl_rate_v2, options)
|
@@ -87,6 +88,7 @@ def intl_rate_v2(options = {})
|
|
87
88
|
xml.tag!('Content') do
|
88
89
|
tag_unless_blank(xml, 'ContentType', options[:intl_rate_v2_request][:package][:gxg][:extra_services][:content][:content_type])
|
89
90
|
tag_unless_blank(xml, 'ContentDescription', options[:intl_rate_v2_request][:package][:gxg][:extra_services][:content][:content_description])
|
91
|
+
tag_unless_blank(xml, 'TrackingRetentionPeriod', options[:intl_rate_v2_request][:package][:gxg][:extra_services][:content][:tracking_retention_period])
|
90
92
|
end if options[:intl_rate_v2_request][:package][:gxg][:extra_services][:content].present?
|
91
93
|
end if options[:intl_rate_v2_request][:package][:gxg][:extra_services].present?
|
92
94
|
end if options[:intl_rate_v2_request][:package][:gxg].present?
|
@@ -26,7 +26,7 @@ module Usps
|
|
26
26
|
# * *:email1* (required, String)
|
27
27
|
# * *:email2* (String)
|
28
28
|
# * *:email3* (String)
|
29
|
-
def pts_email(options = {})
|
29
|
+
def pts_email(options = {})
|
30
30
|
throw ArgumentError.new('Required arguments :pts_email_request missing') if options[:pts_email_request].nil?
|
31
31
|
throw ArgumentError.new('Required arguments :pts_email_request, :track_id missing') if options[:pts_email_request][:track_id].nil?
|
32
32
|
throw ArgumentError.new('Required arguments :pts_email_request, :mp_suffix missing') if options[:pts_email_request][:mp_suffix].nil?
|
@@ -36,7 +36,7 @@ module Usps
|
|
36
36
|
# * *:verify_address* (Boolean)
|
37
37
|
# * *:table_code* (required, String)
|
38
38
|
# * *:cust_reg_id* (String)
|
39
|
-
def pts_pod(options = {})
|
39
|
+
def pts_pod(options = {})
|
40
40
|
request = build_request(:pts_pod, options)
|
41
41
|
get('https://secure.shippingapis.com/ShippingAPI.dll', {
|
42
42
|
API: 'PTSPod',
|
@@ -21,7 +21,7 @@ module Usps
|
|
21
21
|
# * *:email3* (String)
|
22
22
|
# * *:table_code* (required, String)
|
23
23
|
# * *:cust_reg_id* (String)
|
24
|
-
def pts_rre(options = {})
|
24
|
+
def pts_rre(options = {})
|
25
25
|
throw ArgumentError.new('Required arguments :pts_rre_request missing') if options[:pts_rre_request].nil?
|
26
26
|
throw ArgumentError.new('Required arguments :pts_rre_request, :track_id missing') if options[:pts_rre_request][:track_id].nil?
|
27
27
|
throw ArgumentError.new('Required arguments :pts_rre_request, :mp_suffix missing') if options[:pts_rre_request][:mp_suffix].nil?
|
@@ -22,7 +22,7 @@ module Usps
|
|
22
22
|
# * *:table_code* (required, String)
|
23
23
|
# * *:client_ip* (String)
|
24
24
|
# * *:source_id* (String)
|
25
|
-
def ptst_pod(options = {})
|
25
|
+
def ptst_pod(options = {})
|
26
26
|
throw ArgumentError.new('Required arguments :ptst_pod_request missing') if options[:ptst_pod_request].nil?
|
27
27
|
throw ArgumentError.new('Required arguments :ptst_pod_request, :track_id missing') if options[:ptst_pod_request][:track_id].nil?
|
28
28
|
throw ArgumentError.new('Required arguments :ptst_pod_request, :mp_suffix missing') if options[:ptst_pod_request][:mp_suffix].nil?
|
@@ -14,22 +14,22 @@ module Usps
|
|
14
14
|
# @option options [required, Hash] rate_v4_request API=RateV4 This API returns the current USPS postage corresponding to the parameters given.
|
15
15
|
# * *:revision* (String) — Set this value to “2” to return all currently documented response fields. For example: <Revision>2</Revsion>
|
16
16
|
# * *:package* (Hash) — See the RateV4 Service Request chart for valid combinations of the following tags.
|
17
|
-
# * *:service* (required,
|
17
|
+
# * *:service* (required, <Service>) — [{"<Service>"=>"<All>", "Description"=>"When <Service> = “ALL”, all eligible retail products will return in the API response."}, {"<Service>"=>"<Online>", "Description"=>"When <Service> = “ONLINE”, all eligible retail and commercial base products will return in the API response."}, {"<Service>"=>"<Plus>", "Description"=>"When <Service> = “PLUS”, all eligible retail, commercial base, and commercial plus products will return in the API response."}]
|
18
18
|
# * *:first_class_mail_type* (String) — Required when: RateV4Request[Service='FIRST CLASS'] or RateV4Request[Service='FIRST CLASS COMMERCIAL’], or RateV4Request[Service='FIRST CLASS HFP COMMERCIAL’] Example: <FirstClassMailType>LETTER</FirstClassMailType> Note: The <FirstClassMailType> tag is returned only if the <ServiceType> submitted is “First Class”. If any other <ServiceType> is returned (Including “First Class Commercial”) the <Container> tag is used. Note: Flats are also known as Large Envelopes
|
19
19
|
# * *:zip_origination* (required, String) — ZIP code must be valid. For example: <ZipOrigination>20770</ZipOrigination>
|
20
20
|
# * *:zip_destination* (required, String) — ZIP code must be valid. For example: <ZipDestination>54324</ZipDestination>
|
21
21
|
# * *:pounds* (required, String) — Value must be numeric. Package weight cannot exceed 70 pounds. For example: <Pounds>2</Pounds> <Pounds>2.12345678</Pounds>
|
22
22
|
# * *:ounces* (required, String) — Value must be numeric. Package weight cannot exceed 70 pounds (1120 ounces). For example: <Ounces>0</Ounces> <Ounces>0.12345678</Ounces>
|
23
|
-
# * *:container* (required, String) — Use to specify container attributes that may affect postage; otherwise, leave blank. Note: The <FirstClassMailType> tag is used instead of the <Container> tag only if the <ServiceType> submitted is “First Class”. Note: “Cubic Soft Pack” and “Cubic Parcels” are only valid containers for service “Priority Mail Cubic”. Dimensions Length and Height are required when requesting Cubic Soft Pack. Dimensions Length, Height, and Width are required when requesting Cubic Parcels. Note: “VARIABLE” is used to denote that a customer is using packaging other than a USPS-produced Flat Rate Box/Envelope or Regional Rate Box”.
|
23
|
+
# * *:container* (required, String) — Use to specify container attributes that may affect postage; otherwise, leave blank. Note: The <FirstClassMailType> tag is used instead of the <Container> tag only if the <ServiceType> submitted is “First Class”. Note: “Cubic Soft Pack” and “Cubic Parcels” are only valid containers for service “Priority Mail Cubic”. Dimensions Length and Height are required when requesting Cubic Soft Pack. Dimensions Length, Height, and Width are required when requesting Cubic Parcels. Note: “VARIABLE” is used to denote that a customer is using packaging other than a USPS-produced Flat Rate Box/Envelope or Regional Rate Box”. Note: <Container> enumerations: “SM FLAT RATE BAG”, “LG FLAT RATE BAG”, “FLAT RATE BOX” only applicable when <Service>=“Connect Local.”
|
24
24
|
# * *:size* (String) — Note: This tag has been deprecated. <Size> tag and any values within the <Size> tag will not result in an error response and will not impact rates that are returned.
|
25
|
-
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
26
|
-
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
27
|
-
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
28
|
-
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing
|
25
|
+
# * *:width* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference DMM https://pe.usps.com/text/dmm300/index.htm
|
26
|
+
# * *:length* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference DMM https://pe.usps.com/text/dmm300/index.htm
|
27
|
+
# * *:height* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference DMM https://pe.usps.com/text/dmm300/index.htm
|
28
|
+
# * *:girth* (Decimal) — Value must be numeric. Units are inches. If partial dimensions are provided, an error response will return. Length, Width, Height are required for accurate pricing of a rectangular package when any dimension of the item exceeds 12 inches. In addition, Girth is required only for a non-rectangular package in addition to Length, Width, Height when any dimension of the package exceeds 12 inches. For rectangular packages, the Girth dimension must be left blank as this dimension is to only be used for non-rectangular packages. For more details on dimensional weight pricing or dimension validation reference DMM https://pe.usps.com/text/dmm300/index.htm
|
29
29
|
# * *:value* (String) — Available when RateV4Request [Revision='2']. Package value. Used to determine availability and cost of extra services. For example: <Value>150.00</Value>
|
30
30
|
# * *:amount_to_collect* (String) — Available when RateV4Request [Revision='2']. Collect on delivery amount. Used to determine availability and cost of extra services. For example: <AmountToCollect>150.00</AmountToCollect>
|
31
31
|
# * *:special_services* (Hash) — Available when RateV4Request [Revision='2']. Groups the SpecialServices elements. Special Services prices and availability will not be returned when Service = “ALL”, “ONLINE”, or “PLUS”
|
32
|
-
# * *:special_service* (Special Service Name) — [{"Special Service Name"=>"Insurance", "ServiceID"=>"100"}, {"Special Service Name"=>"Insurance – Priority Mail Express", "ServiceID"=>"101"}, {"Special Service Name"=>"Return Receipt", "ServiceID"=>"102"}, {"Special Service Name"=>"Collect on Delivery", "ServiceID"=>"103"}, {"Special Service Name"=>"Certificate of Mailing (Form 3665)", "ServiceID"=>"104"}, {"Special Service Name"=>"Certified Mail", "ServiceID"=>"105"}, {"Special Service Name"=>"USPS Tracking", "ServiceID"=>"106"}, {"Special Service Name"=>"Signature Confirmation", "ServiceID"=>"108"}, {"Special Service Name"=>"Registered Mail", "ServiceID"=>"109"}, {"Special Service Name"=>"Return Receipt Electronic", "ServiceID"=>"110"}, {"Special Service Name"=>"Registered mail COD collection Charge", "ServiceID"=>"112"}, {"Special Service Name"=>"Return Receipt – Priority Mail Express", "ServiceID"=>"118"}, {"Special Service Name"=>"Adult Signature Required", "ServiceID"=>"119"}, {"Special Service Name"=>"Adult Signature Restricted Delivery", "ServiceID"=>"120"}, {"Special Service Name"=>"Insurance – Priority Mail", "ServiceID"=>"125"}, {"Special Service Name"=>"USPS Tracking Electronic", "ServiceID"=>"155"}, {"Special Service Name"=>"Signature Confirmation Electronic", "ServiceID"=>"156"}, {"Special Service Name"=>"Certificate of Mailing (Form 3817)", "ServiceID"=>"160"}, {"Special Service Name"=>"
|
32
|
+
# * *:special_service* (Special Service Name) — [{"Special Service Name"=>"Insurance", "ServiceID"=>"100"}, {"Special Service Name"=>"Insurance – Priority Mail Express", "ServiceID"=>"101"}, {"Special Service Name"=>"Return Receipt", "ServiceID"=>"102"}, {"Special Service Name"=>"Collect on Delivery", "ServiceID"=>"103"}, {"Special Service Name"=>"Certificate of Mailing (Form 3665)", "ServiceID"=>"104"}, {"Special Service Name"=>"Certified Mail", "ServiceID"=>"105"}, {"Special Service Name"=>"USPS Tracking", "ServiceID"=>"106"}, {"Special Service Name"=>"Signature Confirmation", "ServiceID"=>"108"}, {"Special Service Name"=>"Registered Mail", "ServiceID"=>"109"}, {"Special Service Name"=>"Return Receipt Electronic", "ServiceID"=>"110"}, {"Special Service Name"=>"Registered mail COD collection Charge", "ServiceID"=>"112"}, {"Special Service Name"=>"Return Receipt – Priority Mail Express", "ServiceID"=>"118"}, {"Special Service Name"=>"Adult Signature Required", "ServiceID"=>"119"}, {"Special Service Name"=>"Adult Signature Restricted Delivery", "ServiceID"=>"120"}, {"Special Service Name"=>"Insurance – Priority Mail", "ServiceID"=>"125"}, {"Special Service Name"=>"USPS Tracking Electronic", "ServiceID"=>"155"}, {"Special Service Name"=>"Signature Confirmation Electronic", "ServiceID"=>"156"}, {"Special Service Name"=>"Certificate of Mailing (Form 3817)", "ServiceID"=>"160"}, {"Special Service Name"=>"Certified Mail Restricted Delivery", "ServiceID"=>"170"}, {"Special Service Name"=>"Certified Mail Adult Signature Required", "ServiceID"=>"171"}, {"Special Service Name"=>"Certified Mail Adult Signature Restricted Delivery", "ServiceID"=>"172"}, {"Special Service Name"=>"Signature Confirm. Restrict. Delivery", "ServiceID"=>"173"}, {"Special Service Name"=>"Signature Confirmation Electronic Restricted Delivery", "ServiceID"=>"174"}, {"Special Service Name"=>"Collect on Delivery Restricted Delivery", "ServiceID"=>"175"}, {"Special Service Name"=>"Registered Mail Restricted Delivery", "ServiceID"=>"176"}, {"Special Service Name"=>"Insurance Restricted Delivery", "ServiceID"=>"177"}, {"Special Service Name"=>"Insurance Restrict. Delivery – Priority Mail", "ServiceID"=>"179"}, {"Special Service Name"=>"Insurance Restrict. Delivery – Priority Mail Express", "ServiceID"=>"178"}, {"Special Service Name"=>"Insurance Restrict. Delivery (Bulk Only)", "ServiceID"=>"180"}, {"Special Service Name"=>"Scan Retention", "ServiceID"=>"181"}, {"Special Service Name"=>"Scan + Signature Retention", "ServiceID"=>"182"}, {"Special Service Name"=>"Special Handling - Fragile", "ServiceID"=>"190"}, {"Special Service Name"=>"USPS Connect Sunday Delivery", "ServiceID"=>"447"}]
|
33
33
|
# * *:content* (Group) — Available when RateV4Request[Revision='2']. Groups the ContentType and ContentDescription elements.
|
34
34
|
# * *:content_type* (String) — Available when RateV4Request [Revision=’2’]. Defines the type of content of the package.
|
35
35
|
# * *:content_description* (String) — Available when RateV4Request[Revision=’2’]. Describes the content of the package. Optional but required for ContentType ‘LIVES’.
|
@@ -42,8 +42,10 @@ module Usps
|
|
42
42
|
# * *:ship_date* (String) — Date Package Will Be Mailed. Ship date may be today plus 0 to 3 days in advance. Enter the date in format: yyyy-mm-dd, such as 2013-07-28. Inclusion of Ship Date will result in <CommitmentName> and <CommitmentDate> in the response for Priority Mail and Priority Mail Express variants For example: <ShipDate Option="HFP">2013-07-28</ShipDate>
|
43
43
|
# * *:option* (String) — The value of this attribute specifies how the RateV4Response will structure the Priority Express Mail Commitment data elements.
|
44
44
|
# * *:return_dimensional_weight* (Boolean) — This tag must be explicitly set to “true” for dimensional weight to be returned in the xml response.
|
45
|
-
# * *:tracking_retention_period* (
|
46
|
-
|
45
|
+
# * *:tracking_retention_period* (ServiceID) — [{"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“0.5” (6 Months)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“1” (1 Year)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"181", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“3” (3 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“5” (5 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“7” (7 Years)"}, {"ServiceID"=>"182", "<TrackingRetentionPeriod>"=>"“10” (10 Years)"}]
|
46
|
+
# * *:sortation_level* (Sortation) — [{"Sortation"=>"3D", "Description"=>"3-Digit"}, {"Sortation"=>"5D", "Description"=>"5-Digit"}, {"Sortation"=>"BAS", "Description"=>"Basic"}, {"Sortation"=>"CR", "Description"=>"Carrier Route"}, {"Sortation"=>"MIX", "Description"=>"Mixed NDC"}, {"Sortation"=>"NDC", "Description"=>"NDC"}, {"Sortation"=>"NONE", "Description"=>"None"}, {"Sortation"=>"PST", "Description"=>"Presort"}, {"Sortation"=>"SCF", "Description"=>"SCG"}, {"Sortation"=>"TBE", "Description"=>"EMM Tray Box"}, {"Sortation"=>"TBF", "Description"=>"Full Tray Box"}, {"Sortation"=>"TBH", "Description"=>"Half Tray Box"}, {"Sortation"=>"TBT", "Description"=>"Full Tub Tray Box"}]
|
47
|
+
# * *:destination_entry_facility_type* (Destination Type) — [{"Destination Type"=>"Destination Delivery Unit", "Value"=>"DDU"}, {"Destination Type"=>"Destination Network Distribution Unit", "Value"=>"DNDC"}, {"Destination Type"=>"Destination Sectional Center Facility", "Value"=>"DSCF"}]
|
48
|
+
def rate_v4(options = {})
|
47
49
|
throw ArgumentError.new('Required arguments :rate_v4_request missing') if options[:rate_v4_request].nil?
|
48
50
|
|
49
51
|
request = build_request(:rate_v4, options)
|
@@ -91,6 +93,8 @@ def rate_v4(options = {})
|
|
91
93
|
tag_unless_blank(xml, 'Option', options[:rate_v4_request][:package][:special_services][:option])
|
92
94
|
tag_unless_blank(xml, 'ReturnDimensionalWeight', options[:rate_v4_request][:package][:special_services][:return_dimensional_weight])
|
93
95
|
tag_unless_blank(xml, 'TrackingRetentionPeriod', options[:rate_v4_request][:package][:special_services][:tracking_retention_period])
|
96
|
+
tag_unless_blank(xml, 'SortationLevel', options[:rate_v4_request][:package][:special_services][:sortation_level])
|
97
|
+
tag_unless_blank(xml, 'DestinationEntryFacilityType', options[:rate_v4_request][:package][:special_services][:destination_entry_facility_type])
|
94
98
|
end if options[:rate_v4_request][:package][:special_services].present?
|
95
99
|
end if options[:rate_v4_request][:package].present?
|
96
100
|
xml.target!
|
@@ -36,7 +36,7 @@ module Usps
|
|
36
36
|
# * *:image_type* (required, String) — The form image format desired. Enter one of the valid entries: Example: <ImageType>TIF</ImageType>
|
37
37
|
# * *:customer_ref_no* (String) — Arbitrary number for customers own tracking or inventory systems, does not print to form or manifest with Product Tracking. May be any combination of alpha and numeric characters, up to a maximum of 30. Example: <CustomerRefNo>123456</CustomerRefNo>
|
38
38
|
# * *:carrier_pickup* (Boolean) — FOR FUTURE USE.
|
39
|
-
def scan(options = {})
|
39
|
+
def scan(options = {})
|
40
40
|
throw ArgumentError.new('Required arguments :scan_request missing') if options[:scan_request].nil?
|
41
41
|
|
42
42
|
request = build_request(:scan, options)
|