usps-ruby-client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitattributes +2 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +41 -0
- data/.rubocop_todo.yml +0 -0
- data/.travis.yml +6 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +77 -0
- data/Rakefile +9 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/data/api/address-information-api.htm +8229 -0
- data/lib/data/api/domestic-mail-service-standards-api.htm +11016 -0
- data/lib/data/api/evs-international-label-api.htm +33291 -0
- data/lib/data/api/evs-label-api.htm +18895 -0
- data/lib/data/api/hold-for-pickup-facilities-lookup-api.htm +5530 -0
- data/lib/data/api/package-pickup-api.htm +19157 -0
- data/lib/data/api/rate-calculator-api.htm +16355 -0
- data/lib/data/api/scan-api.htm +5934 -0
- data/lib/data/api/service-delivery-calculator-get-locations-api.htm +12548 -0
- data/lib/data/api/track-and-confirm-api.htm +21288 -0
- data/lib/data/api/uspsreturnslabel-api.htm +9474 -0
- data/lib/helpers/erubis_helper.rb +10 -0
- data/lib/tasks/api.rake +246 -0
- data/lib/usps-ruby-client.rb +30 -0
- data/lib/usps/api/endpoints.rb +70 -0
- data/lib/usps/api/endpoints/carrier_pickup_schedule.rb +117 -0
- data/lib/usps/api/endpoints/city_state_lookup.rb +50 -0
- data/lib/usps/api/endpoints/e_vs_express_mail_intl.rb +359 -0
- data/lib/usps/api/endpoints/e_vs_first_class_mail_intl.rb +323 -0
- data/lib/usps/api/endpoints/e_vs_priority_mail_intl.rb +366 -0
- data/lib/usps/api/endpoints/e_vsgxg_get_label.rb +366 -0
- data/lib/usps/api/endpoints/e_vsi_cancel.rb +55 -0
- data/lib/usps/api/endpoints/hfp_facility_info.rb +71 -0
- data/lib/usps/api/endpoints/intl_rate_v2.rb +135 -0
- data/lib/usps/api/endpoints/pts_email.rb +73 -0
- data/lib/usps/api/endpoints/pts_pod.rb +86 -0
- data/lib/usps/api/endpoints/pts_rre.rb +72 -0
- data/lib/usps/api/endpoints/ptst_pod.rb +75 -0
- data/lib/usps/api/endpoints/rate_v4.rb +140 -0
- data/lib/usps/api/endpoints/scan.rb +121 -0
- data/lib/usps/api/endpoints/track_v2.rb +62 -0
- data/lib/usps/api/endpoints/usps_returns_label.rb +149 -0
- data/lib/usps/api/endpoints/verify.rb +75 -0
- data/lib/usps/api/endpoints/zip_code_lookup.rb +69 -0
- data/lib/usps/api/error.rb +6 -0
- data/lib/usps/api/errors/too_many_requests_error.rb +22 -0
- data/lib/usps/api/errors/usps_error.rb +30 -0
- data/lib/usps/api/templates/_build_xml.erb +7 -0
- data/lib/usps/api/templates/_options.erb +6 -0
- data/lib/usps/api/templates/_throw_argument_error.erb +3 -0
- data/lib/usps/api/templates/endpoints.erb +22 -0
- data/lib/usps/api/templates/method.erb +49 -0
- data/lib/usps/api/templates/method_spec.erb +22 -0
- data/lib/usps/api/xml.rb +8 -0
- data/lib/usps/client.rb +37 -0
- data/lib/usps/config.rb +50 -0
- data/lib/usps/faraday/connection.rb +34 -0
- data/lib/usps/faraday/request.rb +39 -0
- data/lib/usps/faraday/response/raise_error.rb +16 -0
- data/lib/usps/logger.rb +14 -0
- data/lib/usps/version.rb +4 -0
- data/usps-ruby-client.gemspec +46 -0
- metadata +307 -0
@@ -0,0 +1,366 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file was auto-generated by lib/tasks/api.rake
|
4
|
+
|
5
|
+
module Usps
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module EVSPriorityMailIntl
|
9
|
+
#
|
10
|
+
# eVS Priority Mail International Label API
|
11
|
+
#
|
12
|
+
# The
|
13
|
+
# eVS Priority Mail Express International Label API lets customers generate eVS Priority
|
14
|
+
# Mail Express International labels given the weight and dimensions of the item.
|
15
|
+
#
|
16
|
+
# @option option [(Alias)] :eVSPriorityMailIntRequest (Required)
|
17
|
+
# - Produces a Priority Mail International label with customs declaration
|
18
|
+
# @option option [Empty] :Option (Optional)
|
19
|
+
# - For future use.
|
20
|
+
# @option option [String] :Revision (Required)
|
21
|
+
# - Use of value 2 Required as of January 2011. For example: <Revision>2</Revision>
|
22
|
+
# @option option [(Group)] :ImageParameters (Optional)
|
23
|
+
# - Groups alternate image options.
|
24
|
+
# @option option [String] :ImageParameter (Optional)
|
25
|
+
# - Returns alternate label image. Only alternate 4’’x6’’ size label image may be requested at this time. · 4X6LABEL - (4X6 on a full page 8.5/11” background) · 4X6LABELL - (Landscape – true size 4X6; image rotated, not on an 8.5 x 11 background page) · 4X6LABELP - (Portrait – true size 4X6, not on an 8.5 x 11 background page) · 4X6ZPL203DPI - (ZPL - Zebra Programming Language) format. When using this enumeration, <ImageType> is required - this tag cannot be left blank. Integrators should use either “TIF” or “PDF” for ZPL – neither value will impact the label image itself, but it must be included in the request to return a successful response. · 4X6ZPL300DPI - Prints a label formatted for ZPL printers in 300 dpi. When using this enumeration, <ImageType> is required - this tag cannot be left blank. Integrators should use either “TIF” or “PDF” for ZPL – neither value will impact the label image itself, but it must be included in the request to return a successful response. For example: <ImageParameter>4X6LABEL</ImageParameter>
|
26
|
+
# @option option [String] :FromFirstName (Required)
|
27
|
+
# - Both FromFirstName and FromLastName are Required if FromFirmName is left blank. Maximum Length: 32 characters total for First, Middle, and Last Names with space after first and middle name. For example: <FromFirstName>John</FromFirstName>
|
28
|
+
# @option option [String] :FromMiddleInitial (Optional)
|
29
|
+
# - Middle Initial. Maximum Length: 32 characters total for First, Middle, and Last Names with space after first and middle name. For example: <FromMiddleInitial>L</FromMiddleInitial>
|
30
|
+
# @option option [String] :FromLastName (Required)
|
31
|
+
# - Both FromFirstName and FromLastName are Required if FromFirmName is left blank. Maximum Length: 32 characters total for First, Middle, and Last Names with space after first and middle name. For example: <FromLastName>Doe</FromLastName>
|
32
|
+
# @option option [String] :FromFirm (Required)
|
33
|
+
# - FromFirm is Required if FromFirstName and FromLastName are left blank. For example: <FromFirm>XYZ</FromFirm>
|
34
|
+
# @option option [String] :FromAddress1 (Optional)
|
35
|
+
# - Use this tag for a suite or apartment number only. Either Address1 or Address2 is Required. For example: <FromAddress1>Suite 100</FromAddress1>
|
36
|
+
# @option option [String] :FromAddress2 (Required)
|
37
|
+
# - Use this tag for the primary address line. For example: <FromAddress2>10 Elm Street </FromAddress2>
|
38
|
+
# @option option [String] :FromUrbanization (Optional)
|
39
|
+
# - Use this tag for Puerto Rico only. ZIP Code prefixes 006 to 009, if area is so designated. For example: <FromUrbanization>URB Caparra Ter</FromUrbanization>
|
40
|
+
# @option option [String] :FromCity (Required)
|
41
|
+
# - For example: <FromCity>Anytown</FromCity>
|
42
|
+
# @option option [String] :FromState (Required)
|
43
|
+
# - Use 2-letter USPS abbreviation. For example: <FromState>ST</FromState>
|
44
|
+
# @option option [String] :FromZip5 (Required)
|
45
|
+
# - Input tag exactly as presented, not all caps. 5 digits Required. For example: <FromZip5>01234</FromZip5>
|
46
|
+
# @option option [String] :FromZip4 (Optional)
|
47
|
+
# - Input tag exactly as presented, not all caps. If value is entered, 4 digits Required. This is the ZIP+4 extension. For example: <FromZip4>5678</FromZip4>
|
48
|
+
# @option option [String] :FromPhone (Required)
|
49
|
+
# - 10 digits Required (including area code), with no punctuation. Use format: 2125551234 For example: <FromPhone>5555555555</FromPhone>
|
50
|
+
# @option option [String] :FromCustomsReference (Optional)
|
51
|
+
# - Enter a value for the "Sender's Customs Reference" that will appear on the label. The text entered is any reference number that the sender wishes to use. For example: <FromCustomsReference> 45655332 </FromCustomsReference>
|
52
|
+
# @option option [String] :ToName (Optional)
|
53
|
+
# - Deprecated. See “ToFirstName” and “ToLastName” tags.
|
54
|
+
# @option option [String] :ToFirstName (Required)
|
55
|
+
# - Both ToFirstName and ToLastName are Required if ToFirm is left blank. For example: <ToFirstName>John</ToFirstName>
|
56
|
+
# @option option [String] :ToLastName (Required)
|
57
|
+
# - Both ToFirstName and ToLastName are Required if ToFirm is left blank. For example: <ToLastName>Doe</ToLastName>
|
58
|
+
# @option option [String] :ToFirm (Required)
|
59
|
+
# - ToFirm is Required if ToFirstName and ToLastName are left blank. For example: <ToFirm>YYZ</ToFirm>
|
60
|
+
# @option option [String] :ToAddress1 (Optional)
|
61
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. For example: <ToAddress1> Apartado 3068</ToAddress1>
|
62
|
+
# @option option [String] :ToAddress2 (Required)
|
63
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
64
|
+
# @option option [String] :ToAddress3 (Optional)
|
65
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
66
|
+
# @option option [String] :ToCity (Required)
|
67
|
+
# - Recipient's city. For example: <ToCity>Puerto Vallarta</ToCity>
|
68
|
+
# @option option [String] :ToProvince (Optional)
|
69
|
+
# - Enter the province for the recipient. For example: <ToProvince>Jalisco</ToProvince>
|
70
|
+
# @option option [String] :ToCountry (Required)
|
71
|
+
# - The country name entered must match an entry from the USPS-approved International Index of Countries and Localities. (http://pe.usps.gov/text/Imm/Immctry.htm - click on the link for "International Country Listings.") Using a country name not on the list will result in a request failure. For example: <ToCountry>Mexico</ToCountry>
|
72
|
+
# @option option [String] :ToPostalCode (Required)
|
73
|
+
# - Enter the postal code for the recipient. For example: <ToPostalCode>46807</ToPostalCode>
|
74
|
+
# @option option [String] :ToPOBoxFlag (Required)
|
75
|
+
# - Indicates whether the destination address is a Post Office Box. For example: <ToPOBoxFlag>N</ToPOBoxFlag>
|
76
|
+
# @option option [String] :ToPhone (Optional)
|
77
|
+
# - No format checking is done on international phone numbers. Required when <ToPOBoxFlag>Y</ToPOBoxFlag> For example: <ToPhone>011 52 (322) 222-0069</ToPhone>
|
78
|
+
# @option option [String] :ToFax (Optional)
|
79
|
+
# - No format checking is done on international fax numbers. For example: <ToFax>011 52 (322) 222-0074</ToFax>
|
80
|
+
# @option option [String] :ToEmail (Optional)
|
81
|
+
# - Complete valid e-mail address is Required if tag is used. For example: <ToEmail>cpapple@email.com</ToEmail>
|
82
|
+
# @option option [String] :ImportersReferenceNumber (Optional)
|
83
|
+
# - Enter a value for the "Recipient's Reference" that will appear on the label. The text entered is any reference number that the recipient wishes to use. For example: <ImportersReferenceNumber>Order 23432</ImportersReferenceNumber>
|
84
|
+
# @option option [String] :NonDeliveryOption (Optional)
|
85
|
+
# - In case package is undeliverable, enter one of the following: · "RETURN" for package to be returned to <FromAddress> above. · "REDIRECT" to return package to address specified below in <AltReturn…> tags. · "ABANDON" to dispose of undeliverable package. For example: <NonDeliveryOption>RETURN</NonDeliveryOption>
|
86
|
+
# @option option [String] :RedirectName (Optional)
|
87
|
+
# - Enter a value for the recipient's name.
|
88
|
+
# @option option [String] :RedirectEmail (Optional)
|
89
|
+
# - Complete valid e-mail address is Required if tag is used.
|
90
|
+
# @option option [String] :RedirectSMS (Optional)
|
91
|
+
# - This value must be a syntactically-valid SMS number.
|
92
|
+
# @option option [String] :RedirectAddress (Optional)
|
93
|
+
# - Enter the redirect address. This is a free form field.
|
94
|
+
# @option option [String] :RedirectCity (Optional)
|
95
|
+
# - Redirect city. For example: <RedirectCity>Anytown</RedirectCity>
|
96
|
+
# @option option [String] :RedirectState (Optional)
|
97
|
+
# - Redirect state. For example: <RedirectState>MN</RedirectState>
|
98
|
+
# @option option [String] :RedirectZipCode (Optional)
|
99
|
+
# - Redirect ZIP code. For example: <RedirectZipCode>12345</RedirectZipCode>
|
100
|
+
# @option option [String] :RedirectZip4 (Optional)
|
101
|
+
# - Redirect ZIP+4 extension. For example: <ToZip5>01234</ToZip5>
|
102
|
+
# @option option [String] :Container (Optional)
|
103
|
+
# - For example: <Container>MDFLATRATEBOX</Container> Otherwise, use to specify special containers or container attributes that may affect postage.
|
104
|
+
# @option option [(Group)] :ShippingContents (Required)
|
105
|
+
# @option option [(Group)] :ItemDetail (Optional)
|
106
|
+
# - Groups individual item details
|
107
|
+
# @option option [String] :Description (Required)
|
108
|
+
# - Description of the item. For example: <Description>Policy guidelines document</Description>
|
109
|
+
# @option option [Integer] :Quantity (Required)
|
110
|
+
# - Quantity of the item. Integer value Required. For example: <Quantity>1</Quantity>
|
111
|
+
# @option option [Decimal] :Value (Required)
|
112
|
+
# - The data entered with this tag provides the value of the set of items. For example: If the item is 2 boxes of 50 pens and the value of each box is $10.00, "20.00" (2 boxes x $10.00) should be entered. If the value of each pen is .25 then "25.00" (100 pens x .25) should be entered. For example: <Value>55.00</Value>
|
113
|
+
# @option option [Integer] :NetPounds (Required)
|
114
|
+
# - Provide the pounds component of the weight of the individual item listed with <Description>. For example: <NetPounds>1</NetPounds>
|
115
|
+
# @option option [Decimal] :NetOunces (Required)
|
116
|
+
# - Provide the ounces component of the weight of the individual item listed with <Description>. For example: <NetOunces>5</NetOunces>
|
117
|
+
# @option option [String] :HSTariffNumber (Required)
|
118
|
+
# - For commercial items only. If known, the HS tariff number must be based on the Harmonized Commodity Description and Coding System developed by the World Customs Organization. For example: <HSTariffNumber>490110</HSTariffNumber>
|
119
|
+
# @option option [String] :CountryOfOrigin (Required)
|
120
|
+
# - For commercial items only. Country of Origin means the country where the goods originated, e.g. were produced, manufactured, or assembled. It is recommended you supply this information and attach an invoice to the outside to accelerate customs clearance in processing the items. The country name entered must match an entry from the USPS-approved International Index of Countries and Localities or be "United States". (http://pe.usps.gov/text/Imm/Immctry.htm - click on the link for "International Country Listings.") Using a country name not on the list will result in a request failure. For example: <CountryOfOrigin>United States</CountryOfOrigin>
|
121
|
+
# @option option [String] :Insured (Optional)
|
122
|
+
# - Restricted use: authorized users may indicate with a value of Y that the item is insured for purposes of obtaining a barcode number from the insured range. All other users must specify N or omit.
|
123
|
+
# @option option [String] :InsuredNumber (Optional)
|
124
|
+
# - For backward-compatibility; not validated.
|
125
|
+
# @option option [Decimal] :InsuredAmount (Optional)
|
126
|
+
# - Use this tag for entering an insurance amount, if known. For example: <InsuredAmount>100.00</InsuredAmount>
|
127
|
+
# @option option [Decimal] :Postage (Optional)
|
128
|
+
# - 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>
|
129
|
+
# @option option [Integer] :GrossPounds (Required)
|
130
|
+
# - 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. WebTools 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>
|
131
|
+
# @option option [Integer] :GrossOunces (Required)
|
132
|
+
# - Enter the ounces component of the total package weight with this tag. For example: <GrossOunces>0</GrossOunces>
|
133
|
+
# @option option [String] :ContentType (Required)
|
134
|
+
# - Specifies the content of the package or envelope. For example: <ContentType>DOCUMENTS</ContentType> Note : “NonnegotiableDocument” and “Documents” both signify mailable non-negotiable documents and are insured automatically for up to $100. Additional Insurance cannot be purchased. Any non-document <ContentType> values are insured automatically for up to $200. Additional Insurance can be purchased for values $200 and greater.
|
135
|
+
# @option option [String] :ContentTypeOther (Optional)
|
136
|
+
# - Required when <ContentType>OTHER<ContentType>. Maximum length enforced via truncation
|
137
|
+
# @option option [String] :Agreement (Required)
|
138
|
+
# - Requires a value of Y to print <FromFirstName/> and <FromLastName/> in Signature Box along with Current Date (Central Time USA). Any other value returns an error.
|
139
|
+
# @option option [String] :Comments (Optional)
|
140
|
+
# - Enter any comments. For example: <Comments></Comments>
|
141
|
+
# @option option [String] :LicenseNumber (Optional)
|
142
|
+
# - Enter license number, if known or if included in package. For example: <LicenseNumber>LIC-24356879</LicenseNumber>
|
143
|
+
# @option option [String] :CertificateNumber (Optional)
|
144
|
+
# - Enter certificate number, if known or if included in package. For example: <CertificateNumber>CERT-97865342</CertificateNumber>
|
145
|
+
# @option option [String] :InvoiceNumber (Optional)
|
146
|
+
# - Enter invoice number, if known or if included in package. For example: <InvoiceNumber>INV-040903</InvoiceNumber>
|
147
|
+
# @option option [String] :ImageType (Required)
|
148
|
+
# - Label Image Type. Note: All <ImageType> values are ignored when <ImageParameter> = “4X6ZPL203DPI” or “4X6ZPL300DPI”. For example: <ImageType>PDF</ImageType>
|
149
|
+
# @option option [String] :ImageLayout (Optional)
|
150
|
+
# - Controls how the multipage form is returned in the response tags. "ONEPERFILE" returns one page per response tag while “ALLINONEFILE” returns all pages in a single response tag. The “TRIM” options conserve page space if possible by combining two form parts on a single page. For example: <ImageLayout>ONEPERFILE<ImageLayout>
|
151
|
+
# @option option [String] :CustomerRefNo (Optional)
|
152
|
+
# - Written to Postal Manifest Detail record. For example: <CustomerRefNo>Ref 369246</CustomerRefNo>
|
153
|
+
# @option option [String] :CustomerRefNo2 (Optional)
|
154
|
+
# - Written to Postal Manifest Detail record. For example: <CustomerRefNo2>ACT369246</CustomerRefNo2>
|
155
|
+
# @option option [String] :POZipCode (Optional)
|
156
|
+
# - 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>
|
157
|
+
# @option option [String] :LabelDate (Optional)
|
158
|
+
# - 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>
|
159
|
+
# @option option [String] :HoldForManifest (Optional)
|
160
|
+
# - Restricted use. Holds manifest record for possible inclusion in SCAN request.
|
161
|
+
# @option option [String] :EELPFC (Optional)
|
162
|
+
# - Exemption and Exclusion Legend or PFC Code. Use in conjunction with Revision tag with value of 1 to indicate and trigger new functionality. Please refer to the International Mail Manual for further information - http://pe.usps.gov/text/imm/immc5_007.htm. To activate check boxes use ”30.37a” or “30.37h”. For example: <EELPFC>30.37a</EELPFC>
|
163
|
+
# @option option [String] :PriceOptions (Optional)
|
164
|
+
# - Price option for package.
|
165
|
+
# @option option [Decimal] :Length (Optional)
|
166
|
+
# - 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. Please reference https://about.usps.com/postalbulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing
|
167
|
+
# @option option [Decimal] :Width (Optional)
|
168
|
+
# - 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. Please reference https://about.usps.com/postalbulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing
|
169
|
+
# @option option [Decimal] :Height (Optional)
|
170
|
+
# - 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. Please reference https://about.usps.com/postalbulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing
|
171
|
+
# @option option [Decimal] :Girth (Optional)
|
172
|
+
# - 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. Please reference https://about.usps.com/postalbulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing
|
173
|
+
# @option option [(Group)] :ExtraServices (Optional)
|
174
|
+
# - Groups extra services elements
|
175
|
+
# @option option [Extra Service Name] :ExtraService (Optional)
|
176
|
+
# - [{"Extra Service Name"=>"e-USPS Return Receipt", "Service ID"=>"105"}]
|
177
|
+
# @option option [String] :ActionCode (Optional)
|
178
|
+
# - 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>
|
179
|
+
# @option option [Boolean] :OptOutOfSPE (Optional)
|
180
|
+
# - Allows a customer to opt out of SPE file creation. “false” WILL create a SPE file. Note: This request tag is case sensitive.
|
181
|
+
# @option option [String] :PermitNumber (Optional)
|
182
|
+
# - Number associated with a mailing permit. The permit is permission to use a certain postage payment method for bulk and commercial mailings
|
183
|
+
# @option option [String] :AccountZipCode (Optional)
|
184
|
+
# - 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>
|
185
|
+
# @option option [String] :ImportersReferenceType (Optional)
|
186
|
+
# - Tax code / VAT no. / Importer Code.
|
187
|
+
# @option option [String] :ImportersTelephoneNumber (Optional)
|
188
|
+
# - For Importer: 10 digits (including area code), with no punctuation. Use format: 2125551234 For example: <ImportersTelephoneNumber>5555555555</ImportersTelephoneNumber>
|
189
|
+
# @option option [String] :ImportersFaxNumber (Optional)
|
190
|
+
# - For Importer: No format checking is done on international fax numbers. For example: <ImportersFaxNumber>011 52 (322) 222-0074</ImportersFaxNumber>
|
191
|
+
# @option option [String] :ImportersEmail (Optional)
|
192
|
+
# - For Importer: Complete valid e-mail address is Required if tag is used. For example: <ImportersEmail>cpapple@email.com</ImportersEmaill>
|
193
|
+
# @option option [Boolean] :Machinable (Optional)
|
194
|
+
# - 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. For example: <Machinable>false</Machinable>
|
195
|
+
# @option option [String] :DestinationRateIndicator (Required)
|
196
|
+
# - Required for destination entry packages. · I = International Service Center (ISC) · N = None
|
197
|
+
# @option option [String] :MID (Optional)
|
198
|
+
# - 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>
|
199
|
+
# @option option [String] :LogisticsManagerMID (Optional)
|
200
|
+
# - 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>
|
201
|
+
# @option option [String] :CRID (Optional)
|
202
|
+
# - Customer Registration ID, Represents Mail Owner CRID. Located in position #20 in the Detail 1 record of the Shipping Services File v2.0. For example: <CRID>544762</ CRID>
|
203
|
+
# @option option [String] :VendorCode (Optional)
|
204
|
+
# - Code from vendor software to identify the developer of the shipping system. Located in position #15 in the Detail 1 record of the Shipping Services File v2.0. For example: <VendorCode>1234<VendorCode>
|
205
|
+
# @option option [String] :VendorProductVersionNumber (Optional)
|
206
|
+
# - 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>
|
207
|
+
# @option option [String] :ePostageMailerReporting (Optional)
|
208
|
+
# - Verifies Sender Information, sender fields must match From information when <ePostageMailerReporting>=1 · 1 - (ePostage sender information in SSF) · 2 - (ePostage sender information through DES) · 3 - (ePostage sender information using child MID)
|
209
|
+
# @option option [String] :SenderFirstName (Optional)
|
210
|
+
# - First Name of Sender. For example: <SenderFirstName>Adam</SenderFirstName> Required when <ePostageMailerReporting>=1
|
211
|
+
# @option option [String] :SenderLastName (Optional)
|
212
|
+
# - Last Name of Sender. For example: <SenderLastName>Smith</SenderLastName> Required when <ePostageMailerReporting>=1
|
213
|
+
# @option option [String] :SenderBusinessName (Optional)
|
214
|
+
# - Values for Sender Business Name must be sent. For example: <SenderBusinessName>USPS</SenderBusinessName>
|
215
|
+
# @option option [String] :SenderAddress1 (Optional)
|
216
|
+
# - Sender address line. Use this tag for full address (Address1 and Address2) Must match Address1 and Address2 or will produce an error. For example: <SenderAddress1>STE 150 10 Elm Street </SenderAddress1> Required when <ePostageMailerReporting>=1
|
217
|
+
# @option option [String] :SenderCity (Optional)
|
218
|
+
# - Sender city. For example: <SenderCity>BETHESDA</SenderCity>Required when <ePostageMailerReporting>=1
|
219
|
+
# @option option [String] :SenderState (Optional)
|
220
|
+
# - Sender state. For example: <SenderState>MD</ SenderState> Required when <ePostageMailerReporting>=1
|
221
|
+
# @option option [String] :SenderZip5 (Optional)
|
222
|
+
# - Sender ZIP code. For example: <SenderZip5>20212</SenderZip5> Required when <ePostageMailerReporting>=1
|
223
|
+
# @option option [String] :SenderPhone (Optional)
|
224
|
+
# - Sender Phone #. 10 digits Required (including area code), with no punctuation. For example: <SenderPhone>2125551234</ SenderPhone> Required when <ePostageMailerReporting>=1
|
225
|
+
# @option option [String] :SenderEmail (Optional)
|
226
|
+
# - E-mail Address of Sender. Valid e-mail addresses must be used. For example: <SenderEMail>cpapple@email.com</ SenderEMail> Required when <ePostageMailerReporting>=1
|
227
|
+
# @option option [String] :ChargebackCode (Optional)
|
228
|
+
# - Used in Shipping Services File v2.0 for G-10 labels. Contact your Technical Integration Specialist for details.
|
229
|
+
|
230
|
+
#
|
231
|
+
# @see
|
232
|
+
def e_vs_priority_mail_intl(options = {})
|
233
|
+
throw ArgumentError.new('Required arguments :e_vs_priority_mail_int_request missing') if options[:e_vs_priority_mail_int_request].nil?
|
234
|
+
throw ArgumentError.new('Required arguments :e_vs_priority_mail_int_request, :revision missing') if options[:e_vs_priority_mail_int_request][:revision].nil?
|
235
|
+
|
236
|
+
request = build_request(:e_vs_priority_mail_intl, options)
|
237
|
+
get('https://secure.shippingapis.com/ShippingAPI.dll', {
|
238
|
+
API: 'eVSPriorityMailIntl',
|
239
|
+
XML: request,
|
240
|
+
})
|
241
|
+
end
|
242
|
+
|
243
|
+
private
|
244
|
+
|
245
|
+
def tag_unless_blank(xml, tag_name, data)
|
246
|
+
xml.tag!(tag_name, data) unless data.blank? || data.nil?
|
247
|
+
end
|
248
|
+
|
249
|
+
def build_e_vs_priority_mail_intl_request(xml, options = {})
|
250
|
+
tag_unless_blank(xml, 'Option', options[:e_vs_priority_mail_int_request][:option])
|
251
|
+
xml.tag!('Revision', options[:e_vs_priority_mail_int_request][:revision])
|
252
|
+
xml.tag!('ImageParameters') do
|
253
|
+
tag_unless_blank(xml, 'ImageParameter', options[:e_vs_priority_mail_int_request][:image_parameters][:image_parameter])
|
254
|
+
xml.tag!('FromFirstName', options[:e_vs_priority_mail_int_request][:image_parameters][:from_first_name])
|
255
|
+
tag_unless_blank(xml, 'FromMiddleInitial', options[:e_vs_priority_mail_int_request][:image_parameters][:from_middle_initial])
|
256
|
+
xml.tag!('FromLastName', options[:e_vs_priority_mail_int_request][:image_parameters][:from_last_name])
|
257
|
+
xml.tag!('FromFirm', options[:e_vs_priority_mail_int_request][:image_parameters][:from_firm])
|
258
|
+
tag_unless_blank(xml, 'FromAddress1', options[:e_vs_priority_mail_int_request][:image_parameters][:from_address1])
|
259
|
+
xml.tag!('FromAddress2', options[:e_vs_priority_mail_int_request][:image_parameters][:from_address2])
|
260
|
+
tag_unless_blank(xml, 'FromUrbanization', options[:e_vs_priority_mail_int_request][:image_parameters][:from_urbanization])
|
261
|
+
xml.tag!('FromCity', options[:e_vs_priority_mail_int_request][:image_parameters][:from_city])
|
262
|
+
xml.tag!('FromState', options[:e_vs_priority_mail_int_request][:image_parameters][:from_state])
|
263
|
+
xml.tag!('FromZip5', options[:e_vs_priority_mail_int_request][:image_parameters][:from_zip5])
|
264
|
+
tag_unless_blank(xml, 'FromZip4', options[:e_vs_priority_mail_int_request][:image_parameters][:from_zip4])
|
265
|
+
xml.tag!('FromPhone', options[:e_vs_priority_mail_int_request][:image_parameters][:from_phone])
|
266
|
+
tag_unless_blank(xml, 'FromCustomsReference', options[:e_vs_priority_mail_int_request][:image_parameters][:from_customs_reference])
|
267
|
+
tag_unless_blank(xml, 'ToName', options[:e_vs_priority_mail_int_request][:image_parameters][:to_name])
|
268
|
+
xml.tag!('ToFirstName', options[:e_vs_priority_mail_int_request][:image_parameters][:to_first_name])
|
269
|
+
xml.tag!('ToLastName', options[:e_vs_priority_mail_int_request][:image_parameters][:to_last_name])
|
270
|
+
xml.tag!('ToFirm', options[:e_vs_priority_mail_int_request][:image_parameters][:to_firm])
|
271
|
+
tag_unless_blank(xml, 'ToAddress1', options[:e_vs_priority_mail_int_request][:image_parameters][:to_address1])
|
272
|
+
xml.tag!('ToAddress2', options[:e_vs_priority_mail_int_request][:image_parameters][:to_address2])
|
273
|
+
tag_unless_blank(xml, 'ToAddress3', options[:e_vs_priority_mail_int_request][:image_parameters][:to_address3])
|
274
|
+
xml.tag!('ToCity', options[:e_vs_priority_mail_int_request][:image_parameters][:to_city])
|
275
|
+
tag_unless_blank(xml, 'ToProvince', options[:e_vs_priority_mail_int_request][:image_parameters][:to_province])
|
276
|
+
xml.tag!('ToCountry', options[:e_vs_priority_mail_int_request][:image_parameters][:to_country])
|
277
|
+
xml.tag!('ToPostalCode', options[:e_vs_priority_mail_int_request][:image_parameters][:to_postal_code])
|
278
|
+
xml.tag!('ToPOBoxFlag', options[:e_vs_priority_mail_int_request][:image_parameters][:to_po_box_flag])
|
279
|
+
tag_unless_blank(xml, 'ToPhone', options[:e_vs_priority_mail_int_request][:image_parameters][:to_phone])
|
280
|
+
tag_unless_blank(xml, 'ToFax', options[:e_vs_priority_mail_int_request][:image_parameters][:to_fax])
|
281
|
+
tag_unless_blank(xml, 'ToEmail', options[:e_vs_priority_mail_int_request][:image_parameters][:to_email])
|
282
|
+
tag_unless_blank(xml, 'ImportersReferenceNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:importers_reference_number])
|
283
|
+
tag_unless_blank(xml, 'NonDeliveryOption', options[:e_vs_priority_mail_int_request][:image_parameters][:non_delivery_option])
|
284
|
+
tag_unless_blank(xml, 'RedirectName', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_name])
|
285
|
+
tag_unless_blank(xml, 'RedirectEmail', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_email])
|
286
|
+
tag_unless_blank(xml, 'RedirectSMS', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_sms])
|
287
|
+
tag_unless_blank(xml, 'RedirectAddress', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_address])
|
288
|
+
tag_unless_blank(xml, 'RedirectCity', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_city])
|
289
|
+
tag_unless_blank(xml, 'RedirectState', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_state])
|
290
|
+
tag_unless_blank(xml, 'RedirectZipCode', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_zip_code])
|
291
|
+
tag_unless_blank(xml, 'RedirectZip4', options[:e_vs_priority_mail_int_request][:image_parameters][:redirect_zip4])
|
292
|
+
tag_unless_blank(xml, 'Container', options[:e_vs_priority_mail_int_request][:image_parameters][:container])
|
293
|
+
xml.tag!('ShippingContents') do
|
294
|
+
xml.tag!('ItemDetail') do
|
295
|
+
xml.tag!('Description', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:description])
|
296
|
+
xml.tag!('Quantity', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:quantity])
|
297
|
+
xml.tag!('Value', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:value])
|
298
|
+
xml.tag!('NetPounds', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:net_pounds])
|
299
|
+
xml.tag!('NetOunces', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:net_ounces])
|
300
|
+
xml.tag!('HSTariffNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:hs_tariff_number])
|
301
|
+
xml.tag!('CountryOfOrigin', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:country_of_origin])
|
302
|
+
tag_unless_blank(xml, 'Insured', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:insured])
|
303
|
+
tag_unless_blank(xml, 'InsuredNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:insured_number])
|
304
|
+
tag_unless_blank(xml, 'InsuredAmount', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:insured_amount])
|
305
|
+
tag_unless_blank(xml, 'Postage', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:postage])
|
306
|
+
xml.tag!('GrossPounds', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:gross_pounds])
|
307
|
+
xml.tag!('GrossOunces', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:gross_ounces])
|
308
|
+
xml.tag!('ContentType', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:content_type])
|
309
|
+
tag_unless_blank(xml, 'ContentTypeOther', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:content_type_other])
|
310
|
+
xml.tag!('Agreement', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:agreement])
|
311
|
+
tag_unless_blank(xml, 'Comments', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:comments])
|
312
|
+
tag_unless_blank(xml, 'LicenseNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:license_number])
|
313
|
+
tag_unless_blank(xml, 'CertificateNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:certificate_number])
|
314
|
+
tag_unless_blank(xml, 'InvoiceNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:invoice_number])
|
315
|
+
xml.tag!('ImageType', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:image_type])
|
316
|
+
tag_unless_blank(xml, 'ImageLayout', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:image_layout])
|
317
|
+
tag_unless_blank(xml, 'CustomerRefNo', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:customer_ref_no])
|
318
|
+
tag_unless_blank(xml, 'CustomerRefNo2', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:customer_ref_no2])
|
319
|
+
tag_unless_blank(xml, 'POZipCode', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:po_zip_code])
|
320
|
+
tag_unless_blank(xml, 'LabelDate', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:label_date])
|
321
|
+
tag_unless_blank(xml, 'HoldForManifest', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:hold_for_manifest])
|
322
|
+
tag_unless_blank(xml, 'EELPFC', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:eelpfc])
|
323
|
+
tag_unless_blank(xml, 'PriceOptions', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:price_options])
|
324
|
+
tag_unless_blank(xml, 'Length', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:length])
|
325
|
+
tag_unless_blank(xml, 'Width', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:width])
|
326
|
+
tag_unless_blank(xml, 'Height', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:height])
|
327
|
+
tag_unless_blank(xml, 'Girth', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:girth])
|
328
|
+
xml.tag!('ExtraServices') do
|
329
|
+
tag_unless_blank(xml, 'ExtraService', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:extra_service])
|
330
|
+
tag_unless_blank(xml, 'ActionCode', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:action_code])
|
331
|
+
tag_unless_blank(xml, 'OptOutOfSPE', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:opt_out_of_spe])
|
332
|
+
tag_unless_blank(xml, 'PermitNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:permit_number])
|
333
|
+
tag_unless_blank(xml, 'AccountZipCode', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:account_zip_code])
|
334
|
+
tag_unless_blank(xml, 'ImportersReferenceType', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:importers_reference_type])
|
335
|
+
tag_unless_blank(xml, 'ImportersTelephoneNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:importers_telephone_number])
|
336
|
+
tag_unless_blank(xml, 'ImportersFaxNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:importers_fax_number])
|
337
|
+
tag_unless_blank(xml, 'ImportersEmail', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:importers_email])
|
338
|
+
tag_unless_blank(xml, 'Machinable', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:machinable])
|
339
|
+
xml.tag!('DestinationRateIndicator', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:destination_rate_indicator])
|
340
|
+
tag_unless_blank(xml, 'MID', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:mid])
|
341
|
+
tag_unless_blank(xml, 'LogisticsManagerMID', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:logistics_manager_mid])
|
342
|
+
tag_unless_blank(xml, 'CRID', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:crid])
|
343
|
+
tag_unless_blank(xml, 'VendorCode', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:vendor_code])
|
344
|
+
tag_unless_blank(xml, 'VendorProductVersionNumber', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:vendor_product_version_number])
|
345
|
+
tag_unless_blank(xml, 'ePostageMailerReporting', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:e_postage_mailer_reporting])
|
346
|
+
tag_unless_blank(xml, 'SenderFirstName', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_first_name])
|
347
|
+
tag_unless_blank(xml, 'SenderLastName', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_last_name])
|
348
|
+
tag_unless_blank(xml, 'SenderBusinessName', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_business_name])
|
349
|
+
tag_unless_blank(xml, 'SenderAddress1', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_address1])
|
350
|
+
tag_unless_blank(xml, 'SenderCity', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_city])
|
351
|
+
tag_unless_blank(xml, 'SenderState', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_state])
|
352
|
+
tag_unless_blank(xml, 'SenderZip5', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_zip5])
|
353
|
+
tag_unless_blank(xml, 'SenderPhone', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_phone])
|
354
|
+
tag_unless_blank(xml, 'SenderEmail', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:sender_email])
|
355
|
+
tag_unless_blank(xml, 'ChargebackCode', options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services][:chargeback_code])
|
356
|
+
end if options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail][:extra_services].present?
|
357
|
+
end if options[:e_vs_priority_mail_int_request][:image_parameters][:shipping_contents][:item_detail].present?
|
358
|
+
end
|
359
|
+
end if options[:e_vs_priority_mail_int_request][:image_parameters].present?
|
360
|
+
xml.target!
|
361
|
+
end
|
362
|
+
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
366
|
+
end
|
@@ -0,0 +1,366 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file was auto-generated by lib/tasks/api.rake
|
4
|
+
|
5
|
+
module Usps
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module EVSGXGGetLabel
|
9
|
+
#
|
10
|
+
# eVS GXG Get Label API
|
11
|
+
#
|
12
|
+
# Global
|
13
|
+
# Express Guaranteed is our fastest international shipping service, with
|
14
|
+
# transportation and delivery by FedEx Express. It features date-certain delivery
|
15
|
+
# in 1-3 business days* to more than 190 countries with a money-back guarantee**
|
16
|
+
# to all destinations. This document contains a Reference Guide to the eVS GXG
|
17
|
+
# Get Label Request.
|
18
|
+
#
|
19
|
+
# @option option [(Alias)] :eVSGXGGetLabelRequest (Required)
|
20
|
+
# @option option [Empty] :Option (Required)
|
21
|
+
# - For future use.
|
22
|
+
# @option option [String] :Revision (Optional)
|
23
|
+
# - This is for versioning of the APIs and for triggering response tags for future versions. In this API use a value of 2 to trigger new functionality. For example: <Revision>1</Revision>
|
24
|
+
# @option option [Empty] :ImageParameters (Required)
|
25
|
+
# - For future use.
|
26
|
+
# @option option [String] :FromFirstName (Required)
|
27
|
+
# - First and Last Name must be sent. Maximum Length: 32 characters total for First, Middle, and Last Names with space after first and middle name. For example: <FromFirstName>John</FromFirstName>
|
28
|
+
# @option option [String] :FromMiddleInitial (Optional)
|
29
|
+
# - First and Last Name must be sent. Maximum Length: 32 characters total for First, Middle, and Last Names with space after first and middle name. For example: <FromMiddleInitial>L</FromMiddleInitial>
|
30
|
+
# @option option [String] :FromLastName (Required)
|
31
|
+
# - First and Last Name must be sent. Maximum Length: 32 characters total for First, Middle, and Last Names with space after first and middle name. For example: <FromLastName>Doe</FromLastName>
|
32
|
+
# @option option [String] :FromFirm (Required)
|
33
|
+
# - Firm Name. For example: <FromFirm>USPS</FromFirm>
|
34
|
+
# @option option [String] :FromAddress1 (Optional)
|
35
|
+
# - Secondary address unit designator and number (such as an apartment or suite number (APT 202, STE 100). For example: <FromAddress1>APT 202</FromAddress1>
|
36
|
+
# @option option [String] :FromAddress2 (Required)
|
37
|
+
# - Street number and name (including predirectional, suffix, and postdirectional as shown in USPS ZIP+4 Product for the delivery address or rural route and box number (RR 5 BOX 10), highway contract route and box number (HC 4 BOX 45), or post office box number (PO BOX 458). For example: <FromAddress2>10 Elm Street </FromAddress2>
|
38
|
+
# @option option [String] :FromUrbanization (Optional)
|
39
|
+
# - Urbanization name (Puerto Rico only, ZIP Code prefixes 006 to 009, if area is so designated). For example: <FromUrbanization>URB Caparra Ter</FromUrbanization>
|
40
|
+
# @option option [String] :FromCity (Required)
|
41
|
+
# - City name. For example: <FromCity>Anytown</FromCity>
|
42
|
+
# @option option [String] :FromState (Required)
|
43
|
+
# - Use 2-letter USPS state abbreviation. For example: <FromState>PA</FromState>
|
44
|
+
# @option option [String] :FromZIP5 (Required)
|
45
|
+
# - Five-digit ZIP code. For example: <FromZip5>01234</FromZip5>
|
46
|
+
# @option option [String] :FromZIP4 (Optional)
|
47
|
+
# - Four-digit extension of ZIP+4 code. For example: <FromZip4>5678</FromZip4>
|
48
|
+
# @option option [String] :FromPhone (Required)
|
49
|
+
# - 10 digits Required (including area code), with no punctuation. Use format: 2125551234 For example: <FromPhone>5555555555</FromPhone>
|
50
|
+
# @option option [String] :ShipFromZIP (Optional)
|
51
|
+
# - Origin ZIP Code shall be accepted as component in request via "ShipFromZip" tag. For example: <ShipFromZIP>18701</ShipFromZIP>
|
52
|
+
# @option option [String] :SenderEMail (Optional)
|
53
|
+
# - E-mail address of sender. Valid e-mail addresses must be used. Note: No e-mail is returned when generating a Sample label request. For example: <SenderEMail>cpapple@email.com</SenderEMail>
|
54
|
+
# @option option [String] :ToFirstName (Required)
|
55
|
+
# - First and Last Name must be sent. Maximum Length: 36 characters total for First, and Last Names with space after first name. For example: <ToFirstName>John</ToFirstName>
|
56
|
+
# @option option [String] :ToLastName (Required)
|
57
|
+
# - First and Last Name must be sent. Maximum Length: 36 characters total for First, and Last Names with space after first name. For example: <ToLastName>John</ToLastName>
|
58
|
+
# @option option [String] :ToFirm (Required)
|
59
|
+
# - Firm Name. For example: <ToFirm>USPS</ToFirm>
|
60
|
+
# @option option [String] :ToAddress1 (Optional)
|
61
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
62
|
+
# @option option [String] :ToAddress2 (Required)
|
63
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
64
|
+
# @option option [String] :ToAddress3 (Optional)
|
65
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
66
|
+
# @option option [String] :ToPostalCode (Optional)
|
67
|
+
# - Destination Postal Code. For example: <ToPostalCode> T2G 2W1</ToPostalCode>
|
68
|
+
# @option option [String] :ToPhone (Optional)
|
69
|
+
# - Up to 25 digits allowed with no punctuation. For example: <ToPhone>1234567890</ToPhone>
|
70
|
+
# @option option [String] :RecipientEMail (Optional)
|
71
|
+
# - E-mail address of recipient. Valid e-mail addresses must be used. Note: No e-mail is returned when generating a Sample label request. For example: <RecipientEMail>cpapple@email.com</RecipientEMail>
|
72
|
+
# @option option [String] :ToDPID (Required)
|
73
|
+
# - The Delivery Point ID as determined via the GXGGetDeliveryPoint API response. Please contact webtools@usps.gov for more information. For example: <ToDPID>142</ToDPID>
|
74
|
+
# @option option [String] :ToProvince (Optional)
|
75
|
+
# - Enter the province for the recipient. For example: <ToProvince>JALISCO</ToProvince>
|
76
|
+
# @option option [String] :ToTaxID (Optional)
|
77
|
+
# - Tax ID For example: <ToTaxID/>
|
78
|
+
# @option option [String] :Container (Required)
|
79
|
+
# - Container type. USPS refers to USPS-supplied large flat envelopes which incur weight-based postage. For example: <Container>LETTER</Container>
|
80
|
+
# @option option [String] :ContentType (Required)
|
81
|
+
# - Content type. For example: <ContentType>DOCUMENTS</ContentType>
|
82
|
+
# @option option [(Group)] :ShippingContents (Required)
|
83
|
+
# - Contents of package.
|
84
|
+
# @option option [(Group)] :ItemDetail (Optional)
|
85
|
+
# - One item detail per item type enclosed.
|
86
|
+
# @option option [String] :Description (Required)
|
87
|
+
# - Description of the item. For example: <Description>Policy guidelines document</Description>
|
88
|
+
# @option option [String] :Commodity (Required)
|
89
|
+
# - Commodity shall be a text String matching Commodity Name from GXGGetCommodityInfo. For example: <Commodity>Documents</Commodity>
|
90
|
+
# @option option [(Group)] :Restriction (Optional)
|
91
|
+
# - Allows integrators to pass restrictions information (responses to footnote questions) for each "Commodity/CommodityName."
|
92
|
+
# @option option [String] :FootnoteNumber (Required)
|
93
|
+
# - Number associated with the commodity restriction question returned from the Get Commodity Restrictions service. Using a number which does not pertain to the passed commodity and derived country will result in an error return. For example: <FootnoteNumber>196</FootnoteNumber>
|
94
|
+
# @option option [String] :Response (Required)
|
95
|
+
# - May affect the need to use a Commercial invoice, and/or the ability to continue the transaction at all. For example: <Response>Y</Response>
|
96
|
+
# @option option [String] :Quantity (Required)
|
97
|
+
# - Quantity of the item. For example: <Quantity>4</Quantity>
|
98
|
+
# @option option [Decimal] :UnitValue (Required)
|
99
|
+
# - The data entered with this tag provides the value of the one of items in this Item Detail. For example: <UnitValue>125.00</UnitValue>
|
100
|
+
# @option option [Integer] :NetPounds (Optional)
|
101
|
+
# - Rules: 1. If any <ItemDetail> contains either a <NetPounds> or <NetOunces> sub-tag, then all <ItemDetail> nodes must specify at least a <NetPounds> or <NetOunces> tag. 2. If the <NetPounds> and/or <NetOunces> are specified successfully, then those values will be used in the manifesting of the Customs Declarations. 3. If <NetPounds> and <NetOunces> are note specified, then the value for <NetPounds> and <NetOunces> for each customs declaration will be the <GrossPounds> and <GrossOunces> divided by the number of <ItemDetails> present.
|
102
|
+
# @option option [Decimal] :NetOunces (Optional)
|
103
|
+
# - Rules: 1. If any <ItemDetail> contains either a <NetPounds> or <NetOunces> sub-tag, then all <ItemDetail> nodes must specify at least a <NetPounds> or <NetOunces> tag. 2. If the <NetPounds> and/or <NetOunces> are specified successfully, then those values will be used in the manifesting of the Customs Declarations. 3. If <NetPounds> and <NetOunces> are note specified, then the value for <NetPounds> and <NetOunces> for each customs declaration will be the <GrossPounds> and <GrossOunces> divided by the number of <ItemDetails> present.
|
104
|
+
# @option option [String] :UnitOfMeasure (Optional)
|
105
|
+
# - Unit of Measure for item quantity. For example: <UnitOfMeasure>Dozen</UnitOfMeasure>
|
106
|
+
# @option option [String] :HSTariffNumber (Optional)
|
107
|
+
# - For commercial items only. If known, the HS tariff number must be based on the Harmonized Commodity Description and Coding System developed by the World Customs Organization. For example: <HSTariffNumber>123456</HSTariffNumber>
|
108
|
+
# @option option [String] :CountryofManufacture (Optional)
|
109
|
+
# - The country name entered must match an entry from the USPS-approved International Index of Countries and Localities or be "United States". Click on the link for "International Country Listings." Using a country name not on the list will result in a request failure. Required when CIRequired=”true”. For example: <CountryOfManufacture>United States</CountryOfManufacture>
|
110
|
+
# @option option [String] :PurposeOfShipment (Required)
|
111
|
+
# - Statement of shipment purpose. For example: <PurposeOfShipment>Gift</PurposeOfShipment>
|
112
|
+
# @option option [String] :PartiesToTransaction (Optional)
|
113
|
+
# - Defines relationship of parties to transaction. For example: <PartiesToTransaction>Related</PartiesToTransaction>
|
114
|
+
# @option option [String] :Agreement (Required)
|
115
|
+
# - Agreement to GXG service terms and conditions. For example: <Agreement>Y</Agreement>
|
116
|
+
# @option option [Decimal] :Postage (Optional)
|
117
|
+
# - Use this tag for entering the postage amount, if known, excluding extra services. If the value is blank, the postage will be automatically calculated using retail rates. For example: <Postage>137.95</Postage>
|
118
|
+
# @option option [Decimal] :InsuredValue (Optional)
|
119
|
+
# - If specified, InsuredValue is used to calculate the Insurance Fee. For example: <InsuredValue>180.00</InsuredValue>
|
120
|
+
# @option option [Decimal] :GrossPounds (Optional)
|
121
|
+
# - GrossPounds + (GrossOunces/16) must be less than 70. For example: <GrossPounds>40</GrossPounds>
|
122
|
+
# @option option [Decimal] :GrossOunces (Optional)
|
123
|
+
# - GrossPounds + (GrossOunces/16) must be less than 70. For example: <GrossOunces>5</GrossOunces>
|
124
|
+
# @option option [Decimal] :Length (Optional)
|
125
|
+
# - 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. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
126
|
+
# @option option [Decimal] :Width (Optional)
|
127
|
+
# - 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 packages. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
128
|
+
# @option option [Decimal] :Height (Optional)
|
129
|
+
# - 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. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
130
|
+
# @option option [Decimal] :Girth (Optional)
|
131
|
+
# - 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. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
132
|
+
# @option option [String] :Shape (Optional)
|
133
|
+
# - Required except when Container=” USPS”. 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>
|
134
|
+
# @option option [boolean] :CIRequired (Optional)
|
135
|
+
# - Indicates if Commercial Invoice is Required. When CIRequired=” true”, commercial invoice image will be generated. For example: <CIRequired>true</CIRequired>
|
136
|
+
# @option option [] :InvoiceDate (Optional)
|
137
|
+
# - Invoice date. Required when CommercialShipment=” true”. For example: <InvoiceDate>01/01/2012</InvoiceDate>
|
138
|
+
# @option option [String] :InvoiceNumber (Optional)
|
139
|
+
# - Invoice number. Required when CommercialShipment=” true”. For example: <InvoiceNumber>20120101</InvoiceNumber>
|
140
|
+
# @option option [String] :CustomerOrderNumber (Optional)
|
141
|
+
# - Customer order number. User assigned number for internal use. For example: <CustomerOrderNumber>20120101</CustomerOrderNumber>
|
142
|
+
# @option option [String] :CustOrderNumber (Optional)
|
143
|
+
# - Customer order number. User assigned number for internal use. Either use CustomerOrderNumber or CustOrderNumber. For example: <CustOrderNumber>20120101</CustOrderNumber>
|
144
|
+
# @option option [String] :TermsDelivery (Optional)
|
145
|
+
# - Indicates terms of delivery. Required when CommercialShipment=” true”. For example: <TermsDelivery>CPT</TermsDelivery>
|
146
|
+
# @option option [String] :TermsDeliveryOther (Optional)
|
147
|
+
# - Terms description. Required when TermsDelivery=” OTHER”. For example: <TermsDeliveryOther>DES</TermsDeliveryOther>
|
148
|
+
# @option option [Decimal] :PackingCost (Optional)
|
149
|
+
# - Packing cost. For example: <PackingCost>15.00</PackingCost>
|
150
|
+
# @option option [String] :CountryUltDest (Required)
|
151
|
+
# - Ultimate destination country. For example: <CountryUltDest>Austria</CountryUltDest>
|
152
|
+
# @option option [boolean] :CIAgreement (Optional)
|
153
|
+
# - Agreement to Commercial Invoice terms and conditions. Required when CIRequired=” true”. For example: <CIAgreement>true</CIAgreement>
|
154
|
+
# @option option [String] :ImageType (Required)
|
155
|
+
# - Controls the file format of the commercial invoice image returned. For example: <ImageType>NONE</ImageType>
|
156
|
+
# @option option [Empty] :ImageLayout (Optional)
|
157
|
+
# - For future use.
|
158
|
+
# @option option [String] :CustomerRefNo (Optional)
|
159
|
+
# - Written to Postal Manifest Detail record. For example: <CustomerRefNo>Ref 369246</CustomerRefNo>
|
160
|
+
# @option option [String] :CustomerRefNo2 (Optional)
|
161
|
+
# - Written to Postal Manifest Detail record. For example: <CustomerRefNo2>ACT 369246</ CustomerRefNo2>
|
162
|
+
# @option option [String] :ShipDate (Required)
|
163
|
+
# - Format: mm/dd/yyyy. No more than 4 days in the future. Should "ShipDate" value not be provided, the service shall use the current date as a basis for delivery date calculations. For example: <ShipDate>01/01/2012</ShipDate>
|
164
|
+
# @option option [String] :HoldForManifest (Optional)
|
165
|
+
# - Restricted use. For authorized users, holds manifest record for possible inclusion in SCAN request when Y. All other users should omit or specify N. For example: <HoldForManifest>Y</HoldForManifest>
|
166
|
+
# @option option [String] :PriceOptions (Optional)
|
167
|
+
# - Returns commercial pricing.
|
168
|
+
# @option option [boolean] :CommercialShipment (Optional)
|
169
|
+
# - If True, then Invoice/Buyer info Required. If False, then Optional. For example: <CommercialShipment>true</CommercialShipment>
|
170
|
+
# @option option [String] :BuyerFirstName (Optional)
|
171
|
+
# - Buyer first name. Required when CommercialShipment=” true”. For example: <BuyerFirstName>John</BuyerFirstName>
|
172
|
+
# @option option [String] :BuyerLastName (Optional)
|
173
|
+
# - Buyer last name. Required when CommercialShipment=” true”. For example: <BuyerLastName>Smith</BuyerLastName>
|
174
|
+
# @option option [String] :BuyerAddress1 (Optional)
|
175
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. Required when CommercialShipment=”true”. For example: <BuyerAddress1>Lazarette Str. 7</BuyerAddress1>
|
176
|
+
# @option option [String] :BuyerAddress2 (Optional)
|
177
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. For example: <BuyerAddress2/>
|
178
|
+
# @option option [String] :BuyerAddress3 (Optional)
|
179
|
+
# - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. For example: <BuyerAddress3/>
|
180
|
+
# @option option [String] :BuyerCity (Optional)
|
181
|
+
# - Buyer city. Required when CommercialShipment=” true”. For example: <BuyerCity>Berlin</BuyerCity>
|
182
|
+
# @option option [String] :BuyerState (Optional)
|
183
|
+
# - Buyer state. Required when CommercialShipment=” true”. For example: <BuyerState/>
|
184
|
+
# @option option [String] :BuyerPostalCode (Optional)
|
185
|
+
# - Buyer postal code. Required when CommercialShipment=” true”. For example: <BuyerPostalCode>10117</BuyerPostalCode>
|
186
|
+
# @option option [String] :BuyerCountry (Optional)
|
187
|
+
# - Buyer country. Required when CommercialShipment=” true”. For example: <BuyerCountry>Germany</BuyerCountry>
|
188
|
+
# @option option [String] :BuyerTaxID (Optional)
|
189
|
+
# - Buyer TaxID. For example: <BuyerTaxID>11123456789</BuyerTaxID>
|
190
|
+
# @option option [Boolean] :BuyerRecipient (Optional)
|
191
|
+
# - Indicates that Buyer and Recipient are the same. When CommercialShipment=”true” and BuyerRecipient =”true”, buyer information is not Required. For example: <BuyerRecipient>true</BuyerRecipient>
|
192
|
+
# @option option [String] :TermsPayment (Optional)
|
193
|
+
# - TermsPayment is Required when CommercialShipment =” true”. For example: <TermsPayment>Net 50</TermsPayment>
|
194
|
+
# @option option [String] :ActionCode (Optional)
|
195
|
+
# - Passed to SPE file via the shipment manifest.
|
196
|
+
# @option option [boolean] :OptOutOfSPE (Optional)
|
197
|
+
# - Allows a customer to opt out of SPE file creation. “false” WILL create a SPE file. Note: This request tag is case sensitive.
|
198
|
+
# @option option [String] :PermitNumber (Optional)
|
199
|
+
# - Number associated with a mailing permit. The permit is permission to use a certain postage payment method for bulk and commercial mailings
|
200
|
+
# @option option [String] :AccountZipCode (Optional)
|
201
|
+
# - 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>
|
202
|
+
# @option option [Boolean] :Machinable (Optional)
|
203
|
+
# - 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. For example: <Machinable>false</Machinable>
|
204
|
+
# @option option [String] :DestinationRateIndicator (Required)
|
205
|
+
# - Required for destination entry packagesenter either “I” or “N”. · I = International Service Center (ISC) · N = None
|
206
|
+
# @option option [String] :MID (Optional)
|
207
|
+
# - 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>
|
208
|
+
# @option option [String] :LogisticsManagerMID (Optional)
|
209
|
+
# - 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>
|
210
|
+
# @option option [String] :CRID (Optional)
|
211
|
+
# - Customer Registration ID, Represents Mail Owner CRID. Located in position #20 in the Detail 1 record of the Shipping Services File v2.0. For example: <CRID>544762</ CRID>
|
212
|
+
# @option option [String] :VendorCode (Optional)
|
213
|
+
# - Code from vendor software to identify the developer of the shipping system. Located in position #15 in the Detail 1 record of the Shipping Services File v2.0. For example: <VendorCode>1234<VendorCode>
|
214
|
+
# @option option [String] :VendorProductVersionNumber (Optional)
|
215
|
+
# - 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>
|
216
|
+
# @option option [String] :OverrideMID (Optional)
|
217
|
+
# @option option [String] :ChargebackCode (Optional)
|
218
|
+
# - Used in Shipping Services File v2.0 for G-10 labels. Contact your Technical Integration Specialist for details.
|
219
|
+
|
220
|
+
#
|
221
|
+
# @see
|
222
|
+
def e_vsgxg_get_label(options = {})
|
223
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request missing') if options[:e_vsgxg_get_label_request].nil?
|
224
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :option missing') if options[:e_vsgxg_get_label_request][:option].nil?
|
225
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :image_parameters missing') if options[:e_vsgxg_get_label_request][:image_parameters].nil?
|
226
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_first_name missing') if options[:e_vsgxg_get_label_request][:from_first_name].nil?
|
227
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_last_name missing') if options[:e_vsgxg_get_label_request][:from_last_name].nil?
|
228
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_firm missing') if options[:e_vsgxg_get_label_request][:from_firm].nil?
|
229
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_address2 missing') if options[:e_vsgxg_get_label_request][:from_address2].nil?
|
230
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_city missing') if options[:e_vsgxg_get_label_request][:from_city].nil?
|
231
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_state missing') if options[:e_vsgxg_get_label_request][:from_state].nil?
|
232
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_zip5 missing') if options[:e_vsgxg_get_label_request][:from_zip5].nil?
|
233
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_phone missing') if options[:e_vsgxg_get_label_request][:from_phone].nil?
|
234
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_first_name missing') if options[:e_vsgxg_get_label_request][:to_first_name].nil?
|
235
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_last_name missing') if options[:e_vsgxg_get_label_request][:to_last_name].nil?
|
236
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_firm missing') if options[:e_vsgxg_get_label_request][:to_firm].nil?
|
237
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_address2 missing') if options[:e_vsgxg_get_label_request][:to_address2].nil?
|
238
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_dpid missing') if options[:e_vsgxg_get_label_request][:to_dpid].nil?
|
239
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :container missing') if options[:e_vsgxg_get_label_request][:container].nil?
|
240
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :content_type missing') if options[:e_vsgxg_get_label_request][:content_type].nil?
|
241
|
+
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :shipping_contents missing') if options[:e_vsgxg_get_label_request][:shipping_contents].nil?
|
242
|
+
|
243
|
+
request = build_request(:e_vsgxg_get_label, options)
|
244
|
+
get('https://secure.shippingapis.com/ShippingAPI.dll', {
|
245
|
+
API: 'eVSGXGGetLabel',
|
246
|
+
XML: request,
|
247
|
+
})
|
248
|
+
end
|
249
|
+
|
250
|
+
private
|
251
|
+
|
252
|
+
def tag_unless_blank(xml, tag_name, data)
|
253
|
+
xml.tag!(tag_name, data) unless data.blank? || data.nil?
|
254
|
+
end
|
255
|
+
|
256
|
+
def build_e_vsgxg_get_label_request(xml, options = {})
|
257
|
+
xml.tag!('Option', options[:e_vsgxg_get_label_request][:option])
|
258
|
+
tag_unless_blank(xml, 'Revision', options[:e_vsgxg_get_label_request][:revision])
|
259
|
+
xml.tag!('ImageParameters', options[:e_vsgxg_get_label_request][:image_parameters])
|
260
|
+
xml.tag!('FromFirstName', options[:e_vsgxg_get_label_request][:from_first_name])
|
261
|
+
tag_unless_blank(xml, 'FromMiddleInitial', options[:e_vsgxg_get_label_request][:from_middle_initial])
|
262
|
+
xml.tag!('FromLastName', options[:e_vsgxg_get_label_request][:from_last_name])
|
263
|
+
xml.tag!('FromFirm', options[:e_vsgxg_get_label_request][:from_firm])
|
264
|
+
tag_unless_blank(xml, 'FromAddress1', options[:e_vsgxg_get_label_request][:from_address1])
|
265
|
+
xml.tag!('FromAddress2', options[:e_vsgxg_get_label_request][:from_address2])
|
266
|
+
tag_unless_blank(xml, 'FromUrbanization', options[:e_vsgxg_get_label_request][:from_urbanization])
|
267
|
+
xml.tag!('FromCity', options[:e_vsgxg_get_label_request][:from_city])
|
268
|
+
xml.tag!('FromState', options[:e_vsgxg_get_label_request][:from_state])
|
269
|
+
xml.tag!('FromZIP5', options[:e_vsgxg_get_label_request][:from_zip5])
|
270
|
+
tag_unless_blank(xml, 'FromZIP4', options[:e_vsgxg_get_label_request][:from_zip4])
|
271
|
+
xml.tag!('FromPhone', options[:e_vsgxg_get_label_request][:from_phone])
|
272
|
+
tag_unless_blank(xml, 'ShipFromZIP', options[:e_vsgxg_get_label_request][:ship_from_zip])
|
273
|
+
tag_unless_blank(xml, 'SenderEMail', options[:e_vsgxg_get_label_request][:sender_e_mail])
|
274
|
+
xml.tag!('ToFirstName', options[:e_vsgxg_get_label_request][:to_first_name])
|
275
|
+
xml.tag!('ToLastName', options[:e_vsgxg_get_label_request][:to_last_name])
|
276
|
+
xml.tag!('ToFirm', options[:e_vsgxg_get_label_request][:to_firm])
|
277
|
+
tag_unless_blank(xml, 'ToAddress1', options[:e_vsgxg_get_label_request][:to_address1])
|
278
|
+
xml.tag!('ToAddress2', options[:e_vsgxg_get_label_request][:to_address2])
|
279
|
+
tag_unless_blank(xml, 'ToAddress3', options[:e_vsgxg_get_label_request][:to_address3])
|
280
|
+
tag_unless_blank(xml, 'ToPostalCode', options[:e_vsgxg_get_label_request][:to_postal_code])
|
281
|
+
tag_unless_blank(xml, 'ToPhone', options[:e_vsgxg_get_label_request][:to_phone])
|
282
|
+
tag_unless_blank(xml, 'RecipientEMail', options[:e_vsgxg_get_label_request][:recipient_e_mail])
|
283
|
+
xml.tag!('ToDPID', options[:e_vsgxg_get_label_request][:to_dpid])
|
284
|
+
tag_unless_blank(xml, 'ToProvince', options[:e_vsgxg_get_label_request][:to_province])
|
285
|
+
tag_unless_blank(xml, 'ToTaxID', options[:e_vsgxg_get_label_request][:to_tax_id])
|
286
|
+
xml.tag!('Container', options[:e_vsgxg_get_label_request][:container])
|
287
|
+
xml.tag!('ContentType', options[:e_vsgxg_get_label_request][:content_type])
|
288
|
+
xml.tag!('ShippingContents') do
|
289
|
+
xml.tag!('ItemDetail') do
|
290
|
+
xml.tag!('Description', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:description])
|
291
|
+
xml.tag!('Commodity', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:commodity])
|
292
|
+
xml.tag!('Restriction') do
|
293
|
+
xml.tag!('FootnoteNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:footnote_number])
|
294
|
+
xml.tag!('Response', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:response])
|
295
|
+
xml.tag!('Quantity', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:quantity])
|
296
|
+
xml.tag!('UnitValue', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:unit_value])
|
297
|
+
tag_unless_blank(xml, 'NetPounds', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:net_pounds])
|
298
|
+
tag_unless_blank(xml, 'NetOunces', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:net_ounces])
|
299
|
+
tag_unless_blank(xml, 'UnitOfMeasure', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:unit_of_measure])
|
300
|
+
tag_unless_blank(xml, 'HSTariffNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:hs_tariff_number])
|
301
|
+
tag_unless_blank(xml, 'CountryofManufacture', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:countryof_manufacture])
|
302
|
+
xml.tag!('PurposeOfShipment', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:purpose_of_shipment])
|
303
|
+
tag_unless_blank(xml, 'PartiesToTransaction', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:parties_to_transaction])
|
304
|
+
xml.tag!('Agreement', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:agreement])
|
305
|
+
tag_unless_blank(xml, 'Postage', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:postage])
|
306
|
+
tag_unless_blank(xml, 'InsuredValue', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:insured_value])
|
307
|
+
tag_unless_blank(xml, 'GrossPounds', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:gross_pounds])
|
308
|
+
tag_unless_blank(xml, 'GrossOunces', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:gross_ounces])
|
309
|
+
tag_unless_blank(xml, 'Length', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:length])
|
310
|
+
tag_unless_blank(xml, 'Width', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:width])
|
311
|
+
tag_unless_blank(xml, 'Height', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:height])
|
312
|
+
tag_unless_blank(xml, 'Girth', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:girth])
|
313
|
+
tag_unless_blank(xml, 'Shape', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:shape])
|
314
|
+
tag_unless_blank(xml, 'CIRequired', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:ci_required])
|
315
|
+
tag_unless_blank(xml, 'InvoiceDate', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:invoice_date])
|
316
|
+
tag_unless_blank(xml, 'InvoiceNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:invoice_number])
|
317
|
+
tag_unless_blank(xml, 'CustomerOrderNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:customer_order_number])
|
318
|
+
tag_unless_blank(xml, 'CustOrderNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:cust_order_number])
|
319
|
+
tag_unless_blank(xml, 'TermsDelivery', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:terms_delivery])
|
320
|
+
tag_unless_blank(xml, 'TermsDeliveryOther', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:terms_delivery_other])
|
321
|
+
tag_unless_blank(xml, 'PackingCost', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:packing_cost])
|
322
|
+
xml.tag!('CountryUltDest', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:country_ult_dest])
|
323
|
+
tag_unless_blank(xml, 'CIAgreement', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:ci_agreement])
|
324
|
+
xml.tag!('ImageType', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:image_type])
|
325
|
+
tag_unless_blank(xml, 'ImageLayout', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:image_layout])
|
326
|
+
tag_unless_blank(xml, 'CustomerRefNo', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:customer_ref_no])
|
327
|
+
tag_unless_blank(xml, 'CustomerRefNo2', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:customer_ref_no2])
|
328
|
+
xml.tag!('ShipDate', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:ship_date])
|
329
|
+
tag_unless_blank(xml, 'HoldForManifest', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:hold_for_manifest])
|
330
|
+
tag_unless_blank(xml, 'PriceOptions', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:price_options])
|
331
|
+
tag_unless_blank(xml, 'CommercialShipment', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:commercial_shipment])
|
332
|
+
tag_unless_blank(xml, 'BuyerFirstName', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_first_name])
|
333
|
+
tag_unless_blank(xml, 'BuyerLastName', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_last_name])
|
334
|
+
tag_unless_blank(xml, 'BuyerAddress1', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_address1])
|
335
|
+
tag_unless_blank(xml, 'BuyerAddress2', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_address2])
|
336
|
+
tag_unless_blank(xml, 'BuyerAddress3', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_address3])
|
337
|
+
tag_unless_blank(xml, 'BuyerCity', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_city])
|
338
|
+
tag_unless_blank(xml, 'BuyerState', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_state])
|
339
|
+
tag_unless_blank(xml, 'BuyerPostalCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_postal_code])
|
340
|
+
tag_unless_blank(xml, 'BuyerCountry', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_country])
|
341
|
+
tag_unless_blank(xml, 'BuyerTaxID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_tax_id])
|
342
|
+
tag_unless_blank(xml, 'BuyerRecipient', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_recipient])
|
343
|
+
tag_unless_blank(xml, 'TermsPayment', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:terms_payment])
|
344
|
+
tag_unless_blank(xml, 'ActionCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:action_code])
|
345
|
+
tag_unless_blank(xml, 'OptOutOfSPE', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:opt_out_of_spe])
|
346
|
+
tag_unless_blank(xml, 'PermitNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:permit_number])
|
347
|
+
tag_unless_blank(xml, 'AccountZipCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:account_zip_code])
|
348
|
+
tag_unless_blank(xml, 'Machinable', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:machinable])
|
349
|
+
xml.tag!('DestinationRateIndicator', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:destination_rate_indicator])
|
350
|
+
tag_unless_blank(xml, 'MID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:mid])
|
351
|
+
tag_unless_blank(xml, 'LogisticsManagerMID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:logistics_manager_mid])
|
352
|
+
tag_unless_blank(xml, 'CRID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:crid])
|
353
|
+
tag_unless_blank(xml, 'VendorCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:vendor_code])
|
354
|
+
tag_unless_blank(xml, 'VendorProductVersionNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:vendor_product_version_number])
|
355
|
+
tag_unless_blank(xml, 'OverrideMID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:override_mid])
|
356
|
+
tag_unless_blank(xml, 'ChargebackCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:chargeback_code])
|
357
|
+
end if options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction].present?
|
358
|
+
end if options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail].present?
|
359
|
+
end
|
360
|
+
xml.target!
|
361
|
+
end
|
362
|
+
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
366
|
+
end
|