usps-ruby-client 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +113 -0
- data/README.md +11 -6
- data/lib/tasks/api.rake +1 -1
- data/lib/usps/api/endpoints/carrier_pickup_schedule.rb +22 -47
- data/lib/usps/api/endpoints/city_state_lookup.rb +5 -12
- data/lib/usps/api/endpoints/e_vs_express_mail_intl.rb +108 -217
- data/lib/usps/api/endpoints/e_vs_first_class_mail_intl.rb +95 -191
- data/lib/usps/api/endpoints/e_vs_priority_mail_intl.rb +109 -221
- data/lib/usps/api/endpoints/e_vsgxg_get_label.rb +103 -208
- data/lib/usps/api/endpoints/e_vsi_cancel.rb +5 -12
- data/lib/usps/api/endpoints/hfp_facility_info.rb +8 -20
- data/lib/usps/api/endpoints/intl_rate_v2.rb +31 -66
- data/lib/usps/api/endpoints/pts_email.rb +14 -20
- data/lib/usps/api/endpoints/pts_pod.rb +23 -29
- data/lib/usps/api/endpoints/pts_rre.rb +15 -21
- data/lib/usps/api/endpoints/ptst_pod.rb +16 -22
- data/lib/usps/api/endpoints/rate_v4.rb +34 -72
- data/lib/usps/api/endpoints/scan.rb +27 -58
- data/lib/usps/api/endpoints/track_v2.rb +9 -15
- data/lib/usps/api/endpoints/usps_returns_label.rb +33 -70
- data/lib/usps/api/endpoints/verify.rb +13 -30
- data/lib/usps/api/endpoints/zip_code_lookup.rb +11 -25
- data/lib/usps/api/templates/_options.erb +1 -4
- data/lib/usps/api/templates/method.erb +4 -8
- data/lib/usps/version.rb +2 -1
- data/usps-ruby-client-0.1.0.gem +0 -0
- data/usps-ruby-client-0.1.2.gem +0 -0
- data/usps-ruby-client.gemspec +2 -1
- metadata +25 -8
@@ -6,220 +6,115 @@ module Usps
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module EVSGXGGetLabel
|
9
|
-
#
|
10
|
-
# eVS GXG Get Label API
|
11
|
-
#
|
12
9
|
# Global
|
13
10
|
# Express Guaranteed is our fastest international shipping service, with
|
14
11
|
# transportation and delivery by FedEx Express. It features date-certain delivery
|
15
12
|
# in 1-3 business days* to more than 190 countries with a money-back guarantee**
|
16
13
|
# to all destinations. This document contains a Reference Guide to the eVS GXG
|
17
14
|
# Get Label Request.
|
18
|
-
#
|
19
|
-
# @option
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
|
121
|
-
# - 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 = {})
|
15
|
+
# @param [Hash] options
|
16
|
+
# @option options [required, Hash] e_vsgxg_get_label_request
|
17
|
+
# * *:option* (required, Empty) — For future use.
|
18
|
+
# * *:revision* (String) — 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>
|
19
|
+
# * *:image_parameters* (required, Empty) — For future use.
|
20
|
+
# * *:from_first_name* (required, String) — 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>
|
21
|
+
# * *:from_middle_initial* (String) — 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>
|
22
|
+
# * *:from_last_name* (required, String) — 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>
|
23
|
+
# * *:from_firm* (required, String) — Firm Name. For example: <FromFirm>USPS</FromFirm>
|
24
|
+
# * *:from_address1* (String) — Secondary address unit designator and number (such as an apartment or suite number (APT 202, STE 100). For example: <FromAddress1>APT 202</FromAddress1>
|
25
|
+
# * *:from_address2* (required, String) — 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>
|
26
|
+
# * *:from_urbanization* (String) — Urbanization name (Puerto Rico only, ZIP Code prefixes 006 to 009, if area is so designated). For example: <FromUrbanization>URB Caparra Ter</FromUrbanization>
|
27
|
+
# * *:from_city* (required, String) — City name. For example: <FromCity>Anytown</FromCity>
|
28
|
+
# * *:from_state* (required, String) — Use 2-letter USPS state abbreviation. For example: <FromState>PA</FromState>
|
29
|
+
# * *:from_zip5* (required, String) — Five-digit ZIP code. For example: <FromZip5>01234</FromZip5>
|
30
|
+
# * *:from_zip4* (String) — Four-digit extension of ZIP+4 code. For example: <FromZip4>5678</FromZip4>
|
31
|
+
# * *:from_phone* (required, String) — 10 digits Required (including area code), with no punctuation. Use format: 2125551234 For example: <FromPhone>5555555555</FromPhone>
|
32
|
+
# * *:ship_from_zip* (String) — Origin ZIP Code shall be accepted as component in request via "ShipFromZip" tag. For example: <ShipFromZIP>18701</ShipFromZIP>
|
33
|
+
# * *:sender_e_mail* (String) — 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>
|
34
|
+
# * *:to_first_name* (required, String) — 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>
|
35
|
+
# * *:to_last_name* (required, String) — 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>
|
36
|
+
# * *:to_firm* (required, String) — Firm Name. For example: <ToFirm>USPS</ToFirm>
|
37
|
+
# * *:to_address1* (String) — Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
38
|
+
# * *:to_address2* (required, String) — Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
39
|
+
# * *:to_address3* (String) — Three address lines are provided, but only 1 is Required. Use as many as needed for complete address.
|
40
|
+
# * *:to_postal_code* (String) — Destination Postal Code. For example: <ToPostalCode> T2G 2W1</ToPostalCode>
|
41
|
+
# * *:to_phone* (String) — Up to 25 digits allowed with no punctuation. For example: <ToPhone>1234567890</ToPhone>
|
42
|
+
# * *:recipient_e_mail* (String) — 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>
|
43
|
+
# * *:to_dpid* (required, String) — The Delivery Point ID as determined via the GXGGetDeliveryPoint API response. Please contact webtools@usps.gov for more information. For example: <ToDPID>142</ToDPID>
|
44
|
+
# * *:to_province* (String) — Enter the province for the recipient. For example: <ToProvince>JALISCO</ToProvince>
|
45
|
+
# * *:to_tax_id* (String) — Tax ID For example: <ToTaxID/>
|
46
|
+
# * *:container* (required, String) — Container type. USPS refers to USPS-supplied large flat envelopes which incur weight-based postage. For example: <Container>LETTER</Container>
|
47
|
+
# * *:content_type* (required, String) — Content type. For example: <ContentType>DOCUMENTS</ContentType>
|
48
|
+
# * *:shipping_contents* (required, Hash) — Contents of package.
|
49
|
+
# * *:item_detail* (Hash) — One item detail per item type enclosed.
|
50
|
+
# * *:description* (required, String) — Description of the item. For example: <Description>Policy guidelines document</Description>
|
51
|
+
# * *:commodity* (required, String) — Commodity shall be a text String matching Commodity Name from GXGGetCommodityInfo. For example: <Commodity>Documents</Commodity>
|
52
|
+
# * *:restriction* (Hash) — Allows integrators to pass restrictions information (responses to footnote questions) for each "Commodity/CommodityName."
|
53
|
+
# * *:footnote_number* (required, String) — 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>
|
54
|
+
# * *:response* (required, String) — May affect the need to use a Commercial invoice, and/or the ability to continue the transaction at all. For example: <Response>Y</Response>
|
55
|
+
# * *:quantity* (required, String) — Quantity of the item. For example: <Quantity>4</Quantity>
|
56
|
+
# * *:unit_value* (required, Decimal) — The data entered with this tag provides the value of the one of items in this Item Detail. For example: <UnitValue>125.00</UnitValue>
|
57
|
+
# * *:net_pounds* (Integer) — 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.
|
58
|
+
# * *:net_ounces* (Decimal) — 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.
|
59
|
+
# * *:unit_of_measure* (String) — Unit of Measure for item quantity. For example: <UnitOfMeasure>Dozen</UnitOfMeasure>
|
60
|
+
# * *:hs_tariff_number* (String) — 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>
|
61
|
+
# * *:countryof_manufacture* (String) — 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>
|
62
|
+
# * *:purpose_of_shipment* (required, String) — Statement of shipment purpose. For example: <PurposeOfShipment>Gift</PurposeOfShipment>
|
63
|
+
# * *:parties_to_transaction* (String) — Defines relationship of parties to transaction. For example: <PartiesToTransaction>Related</PartiesToTransaction>
|
64
|
+
# * *:agreement* (required, String) — Agreement to GXG service terms and conditions. For example: <Agreement>Y</Agreement>
|
65
|
+
# * *:postage* (Decimal) — 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>
|
66
|
+
# * *:insured_value* (Decimal) — If specified, InsuredValue is used to calculate the Insurance Fee. For example: <InsuredValue>180.00</InsuredValue>
|
67
|
+
# * *:gross_pounds* (Decimal) — GrossPounds + (GrossOunces/16) must be less than 70. For example: <GrossPounds>40</GrossPounds>
|
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. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
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 packages. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
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. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
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. Please reference https://about.usps.com/postal-bulletin/2018/pb22509/html/updt_002.htm for more details on dimensional weight pricing.
|
73
|
+
# * *:shape* (String) — 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>
|
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
|
+
# * *:invoice_date* () — Invoice date. Required when CommercialShipment=” true”. For example: <InvoiceDate>01/01/2012</InvoiceDate>
|
76
|
+
# * *:invoice_number* (String) — Invoice number. Required when CommercialShipment=” true”. For example: <InvoiceNumber>20120101</InvoiceNumber>
|
77
|
+
# * *:customer_order_number* (String) — Customer order number. User assigned number for internal use. For example: <CustomerOrderNumber>20120101</CustomerOrderNumber>
|
78
|
+
# * *:cust_order_number* (String) — Customer order number. User assigned number for internal use. Either use CustomerOrderNumber or CustOrderNumber. For example: <CustOrderNumber>20120101</CustOrderNumber>
|
79
|
+
# * *:terms_delivery* (String) — Indicates terms of delivery. Required when CommercialShipment=” true”. For example: <TermsDelivery>CPT</TermsDelivery>
|
80
|
+
# * *:terms_delivery_other* (String) — Terms description. Required when TermsDelivery=” OTHER”. For example: <TermsDeliveryOther>DES</TermsDeliveryOther>
|
81
|
+
# * *:packing_cost* (Decimal) — Packing cost. For example: <PackingCost>15.00</PackingCost>
|
82
|
+
# * *:country_ult_dest* (required, String) — Ultimate destination country. For example: <CountryUltDest>Austria</CountryUltDest>
|
83
|
+
# * *:ci_agreement* (boolean) — Agreement to Commercial Invoice terms and conditions. Required when CIRequired=” true”. For example: <CIAgreement>true</CIAgreement>
|
84
|
+
# * *:image_type* (required, String) — Controls the file format of the commercial invoice image returned. For example: <ImageType>NONE</ImageType>
|
85
|
+
# * *:image_layout* (Empty) — For future use.
|
86
|
+
# * *:customer_ref_no* (String) — Written to Postal Manifest Detail record. For example: <CustomerRefNo>Ref 369246</CustomerRefNo>
|
87
|
+
# * *:customer_ref_no2* (String) — Written to Postal Manifest Detail record. For example: <CustomerRefNo2>ACT 369246</ CustomerRefNo2>
|
88
|
+
# * *:ship_date* (required, String) — 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>
|
89
|
+
# * *:hold_for_manifest* (String) — 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>
|
90
|
+
# * *:price_options* (String) — Returns commercial pricing.
|
91
|
+
# * *:commercial_shipment* (boolean) — If True, then Invoice/Buyer info Required. If False, then Optional. For example: <CommercialShipment>true</CommercialShipment>
|
92
|
+
# * *:buyer_first_name* (String) — Buyer first name. Required when CommercialShipment=” true”. For example: <BuyerFirstName>John</BuyerFirstName>
|
93
|
+
# * *:buyer_last_name* (String) — Buyer last name. Required when CommercialShipment=” true”. For example: <BuyerLastName>Smith</BuyerLastName>
|
94
|
+
# * *:buyer_address1* (String) — 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>
|
95
|
+
# * *:buyer_address2* (String) — Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. For example: <BuyerAddress2/>
|
96
|
+
# * *:buyer_address3* (String) — Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. For example: <BuyerAddress3/>
|
97
|
+
# * *:buyer_city* (String) — Buyer city. Required when CommercialShipment=” true”. For example: <BuyerCity>Berlin</BuyerCity>
|
98
|
+
# * *:buyer_state* (String) — Buyer state. Required when CommercialShipment=” true”. For example: <BuyerState/>
|
99
|
+
# * *:buyer_postal_code* (String) — Buyer postal code. Required when CommercialShipment=” true”. For example: <BuyerPostalCode>10117</BuyerPostalCode>
|
100
|
+
# * *:buyer_country* (String) — Buyer country. Required when CommercialShipment=” true”. For example: <BuyerCountry>Germany</BuyerCountry>
|
101
|
+
# * *:buyer_tax_id* (String) — Buyer TaxID. For example: <BuyerTaxID>11123456789</BuyerTaxID>
|
102
|
+
# * *:buyer_recipient* (Boolean) — Indicates that Buyer and Recipient are the same. When CommercialShipment=”true” and BuyerRecipient =”true”, buyer information is not Required. For example: <BuyerRecipient>true</BuyerRecipient>
|
103
|
+
# * *:terms_payment* (String) — TermsPayment is Required when CommercialShipment =” true”. For example: <TermsPayment>Net 50</TermsPayment>
|
104
|
+
# * *:action_code* (String) — Passed to SPE file via the shipment manifest.
|
105
|
+
# * *: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.
|
106
|
+
# * *: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
|
107
|
+
# * *: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>
|
108
|
+
# * *: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. For example: <Machinable>false</Machinable>
|
109
|
+
# * *:destination_rate_indicator* (required, String) — Required for destination entry packagesenter either “I” or “N”. · I = International Service Center (ISC) · N = None
|
110
|
+
# * *: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>
|
111
|
+
# * *: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>
|
112
|
+
# * *:crid* (String) — 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>
|
113
|
+
# * *:vendor_code* (String) — 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>
|
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
|
+
# * *:override_mid* (String) —
|
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 = {})
|
223
118
|
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request missing') if options[:e_vsgxg_get_label_request].nil?
|
224
119
|
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :option missing') if options[:e_vsgxg_get_label_request][:option].nil?
|
225
120
|
throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :image_parameters missing') if options[:e_vsgxg_get_label_request][:image_parameters].nil?
|
@@ -6,9 +6,6 @@ module Usps
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module EVSICancel
|
9
|
-
#
|
10
|
-
# eVS International Cancel API
|
11
|
-
#
|
12
9
|
# The eVS
|
13
10
|
# International Cancel request allows an eVS label to be removed from processing
|
14
11
|
# if the request is made prior to 11:59 PM Central Time on the day of label creation.This functionality is available only if the eVS International
|
@@ -17,15 +14,11 @@ module Usps
|
|
17
14
|
# File v2.0 has not yet been created. Depending on customer profile setup, this
|
18
15
|
# transmission could occur for created labels every 15 minutes, at the end of the
|
19
16
|
# shipping day, or when a SCAN Form is manually triggered by the customer.
|
20
|
-
#
|
21
|
-
# @option
|
22
|
-
#
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
#
|
27
|
-
# @see
|
28
|
-
def e_vsi_cancel(options = {})
|
17
|
+
# @param [Hash] options
|
18
|
+
# @option options [required, Hash] e_vsi_cancel_request
|
19
|
+
# * *:barcode_number* (required, ) — BarcodeNumber of original label. Length of 22, 30 or 34 numbers.
|
20
|
+
# * *:e_vsi_cancel_request* (required, ) —
|
21
|
+
def e_vsi_cancel(options = {})
|
29
22
|
throw ArgumentError.new('Required arguments :e_vsi_cancel_request missing') if options[:e_vsi_cancel_request].nil?
|
30
23
|
throw ArgumentError.new('Required arguments :e_vsi_cancel_request, :barcode_number missing') if options[:e_vsi_cancel_request][:barcode_number].nil?
|
31
24
|
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?
|
@@ -6,9 +6,6 @@ module Usps
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module HFPFacilityInfo
|
9
|
-
#
|
10
|
-
# Hold for Pickup Facility Information API
|
11
|
-
#
|
12
9
|
# Hold For
|
13
10
|
# Pickup service is available at approximately 31,000 USPS locations. This API
|
14
11
|
# will list US Postal Service Facilities where Hold-For-Pickup service is
|
@@ -20,23 +17,14 @@ module Usps
|
|
20
17
|
# within five calendar days. Hold For Pickup service
|
21
18
|
# lets customers pick up shipments when it is convenient for them, with the
|
22
19
|
# assurance that their shipments are held safely and securely.
|
23
|
-
#
|
24
|
-
# @option
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
|
31
|
-
# - 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>
|
32
|
-
# @option option [String] :PickupZIP4 (Required)
|
33
|
-
# - 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>
|
34
|
-
# @option option [String] :Service (Optional)
|
35
|
-
# - For future use. May be omitted.
|
36
|
-
|
37
|
-
#
|
38
|
-
# @see
|
39
|
-
def hfp_facility_info(options = {})
|
20
|
+
# @param [Hash] options
|
21
|
+
# @option options [required, Hash] hfp_facility_info_request API=HFPFacilityInfo
|
22
|
+
# * *:pickup_city* (required, String) — Either City/State or ZIP code must be specified. When only city and state are provided, all pickup facilities with addresses within that city and state will be returned. For example: <PickupCity>Boston</PickupCity>
|
23
|
+
# * *:pickup_state* (required, String) — Either City/State or ZIP code must be specified. For example: <PickupState>MA</PickupState>
|
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
|
+
# * *: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
|
+
# * *:service* (String) — For future use. May be omitted.
|
27
|
+
def hfp_facility_info(options = {})
|
40
28
|
throw ArgumentError.new('Required arguments :hfp_facility_info_request missing') if options[:hfp_facility_info_request].nil?
|
41
29
|
throw ArgumentError.new('Required arguments :hfp_facility_info_request, :pickup_city missing') if options[:hfp_facility_info_request][:pickup_city].nil?
|
42
30
|
throw ArgumentError.new('Required arguments :hfp_facility_info_request, :pickup_state missing') if options[:hfp_facility_info_request][:pickup_state].nil?
|