# frozen_string_literal: true # This file was auto-generated by lib/tasks/api.rake module Usps module Api module Endpoints module EVSGXGGetLabel # # eVS GXG Get Label API # # Global # Express Guaranteed is our fastest international shipping service, with # transportation and delivery by FedEx Express. It features date-certain delivery # in 1-3 business days* to more than 190 countries with a money-back guarantee** # to all destinations. This document contains a Reference Guide to the eVS GXG # Get Label Request. # # @option option [(Alias)] :eVSGXGGetLabelRequest (Required) # @option option [Empty] :Option (Required) # - For future use. # @option option [String] :Revision (Optional) # - 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: 1 # @option option [Empty] :ImageParameters (Required) # - For future use. # @option option [String] :FromFirstName (Required) # - 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: John # @option option [String] :FromMiddleInitial (Optional) # - 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: L # @option option [String] :FromLastName (Required) # - 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: Doe # @option option [String] :FromFirm (Required) # - Firm Name. For example: USPS # @option option [String] :FromAddress1 (Optional) # - Secondary address unit designator and number (such as an apartment or suite number (APT 202, STE 100). For example: APT 202 # @option option [String] :FromAddress2 (Required) # - 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: 10 Elm Street # @option option [String] :FromUrbanization (Optional) # - Urbanization name (Puerto Rico only, ZIP Code prefixes 006 to 009, if area is so designated). For example: URB Caparra Ter # @option option [String] :FromCity (Required) # - City name. For example: Anytown # @option option [String] :FromState (Required) # - Use 2-letter USPS state abbreviation. For example: PA # @option option [String] :FromZIP5 (Required) # - Five-digit ZIP code. For example: 01234 # @option option [String] :FromZIP4 (Optional) # - Four-digit extension of ZIP+4 code. For example: 5678 # @option option [String] :FromPhone (Required) # - 10 digits Required (including area code), with no punctuation. Use format: 2125551234 For example: 5555555555 # @option option [String] :ShipFromZIP (Optional) # - Origin ZIP Code shall be accepted as component in request via "ShipFromZip" tag. For example: 18701 # @option option [String] :SenderEMail (Optional) # - 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: cpapple@email.com # @option option [String] :ToFirstName (Required) # - First and Last Name must be sent. Maximum Length: 36 characters total for First, and Last Names with space after first name. For example: John # @option option [String] :ToLastName (Required) # - First and Last Name must be sent. Maximum Length: 36 characters total for First, and Last Names with space after first name. For example: John # @option option [String] :ToFirm (Required) # - Firm Name. For example: USPS # @option option [String] :ToAddress1 (Optional) # - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. # @option option [String] :ToAddress2 (Required) # - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. # @option option [String] :ToAddress3 (Optional) # - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. # @option option [String] :ToPostalCode (Optional) # - Destination Postal Code. For example: T2G 2W1 # @option option [String] :ToPhone (Optional) # - Up to 25 digits allowed with no punctuation. For example: 1234567890 # @option option [String] :RecipientEMail (Optional) # - 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: cpapple@email.com # @option option [String] :ToDPID (Required) # - The Delivery Point ID as determined via the GXGGetDeliveryPoint API response. Please contact webtools@usps.gov for more information. For example: 142 # @option option [String] :ToProvince (Optional) # - Enter the province for the recipient. For example: JALISCO # @option option [String] :ToTaxID (Optional) # - Tax ID For example: # @option option [String] :Container (Required) # - Container type. USPS refers to USPS-supplied large flat envelopes which incur weight-based postage. For example: LETTER # @option option [String] :ContentType (Required) # - Content type. For example: DOCUMENTS # @option option [(Group)] :ShippingContents (Required) # - Contents of package. # @option option [(Group)] :ItemDetail (Optional) # - One item detail per item type enclosed. # @option option [String] :Description (Required) # - Description of the item. For example: Policy guidelines document # @option option [String] :Commodity (Required) # - Commodity shall be a text String matching Commodity Name from GXGGetCommodityInfo. For example: Documents # @option option [(Group)] :Restriction (Optional) # - Allows integrators to pass restrictions information (responses to footnote questions) for each "Commodity/CommodityName." # @option option [String] :FootnoteNumber (Required) # - 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: 196 # @option option [String] :Response (Required) # - May affect the need to use a Commercial invoice, and/or the ability to continue the transaction at all. For example: Y # @option option [String] :Quantity (Required) # - Quantity of the item. For example: 4 # @option option [Decimal] :UnitValue (Required) # - The data entered with this tag provides the value of the one of items in this Item Detail. For example: 125.00 # @option option [Integer] :NetPounds (Optional) # - Rules: 1. If any contains either a or sub-tag, then all nodes must specify at least a or tag. 2. If the and/or are specified successfully, then those values will be used in the manifesting of the Customs Declarations. 3. If and are note specified, then the value for and for each customs declaration will be the and divided by the number of present. # @option option [Decimal] :NetOunces (Optional) # - Rules: 1. If any contains either a or sub-tag, then all nodes must specify at least a or tag. 2. If the and/or are specified successfully, then those values will be used in the manifesting of the Customs Declarations. 3. If and are note specified, then the value for and for each customs declaration will be the and divided by the number of present. # @option option [String] :UnitOfMeasure (Optional) # - Unit of Measure for item quantity. For example: Dozen # @option option [String] :HSTariffNumber (Optional) # - 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: 123456 # @option option [String] :CountryofManufacture (Optional) # - 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: United States # @option option [String] :PurposeOfShipment (Required) # - Statement of shipment purpose. For example: Gift # @option option [String] :PartiesToTransaction (Optional) # - Defines relationship of parties to transaction. For example: Related # @option option [String] :Agreement (Required) # - Agreement to GXG service terms and conditions. For example: Y # @option option [Decimal] :Postage (Optional) # - 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: 137.95 # @option option [Decimal] :InsuredValue (Optional) # - If specified, InsuredValue is used to calculate the Insurance Fee. For example: 180.00 # @option option [Decimal] :GrossPounds (Optional) # - GrossPounds + (GrossOunces/16) must be less than 70. For example: 40 # @option option [Decimal] :GrossOunces (Optional) # - GrossPounds + (GrossOunces/16) must be less than 70. For example: 5 # @option option [Decimal] :Length (Optional) # - 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. # @option option [Decimal] :Width (Optional) # - 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. # @option option [Decimal] :Height (Optional) # - 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. # @option option [Decimal] :Girth (Optional) # - 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. # @option option [String] :Shape (Optional) # - 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: RECTANGULAR # @option option [boolean] :CIRequired (Optional) # - Indicates if Commercial Invoice is Required. When CIRequired=” true”, commercial invoice image will be generated. For example: true # @option option [] :InvoiceDate (Optional) # - Invoice date. Required when CommercialShipment=” true”. For example: 01/01/2012 # @option option [String] :InvoiceNumber (Optional) # - Invoice number. Required when CommercialShipment=” true”. For example: 20120101 # @option option [String] :CustomerOrderNumber (Optional) # - Customer order number. User assigned number for internal use. For example: 20120101 # @option option [String] :CustOrderNumber (Optional) # - Customer order number. User assigned number for internal use. Either use CustomerOrderNumber or CustOrderNumber. For example: 20120101 # @option option [String] :TermsDelivery (Optional) # - Indicates terms of delivery. Required when CommercialShipment=” true”. For example: CPT # @option option [String] :TermsDeliveryOther (Optional) # - Terms description. Required when TermsDelivery=” OTHER”. For example: DES # @option option [Decimal] :PackingCost (Optional) # - Packing cost. For example: 15.00 # @option option [String] :CountryUltDest (Required) # - Ultimate destination country. For example: Austria # @option option [boolean] :CIAgreement (Optional) # - Agreement to Commercial Invoice terms and conditions. Required when CIRequired=” true”. For example: true # @option option [String] :ImageType (Required) # - Controls the file format of the commercial invoice image returned. For example: NONE # @option option [Empty] :ImageLayout (Optional) # - For future use. # @option option [String] :CustomerRefNo (Optional) # - Written to Postal Manifest Detail record. For example: Ref 369246 # @option option [String] :CustomerRefNo2 (Optional) # - Written to Postal Manifest Detail record. For example: ACT 369246 # @option option [String] :ShipDate (Required) # - 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: 01/01/2012 # @option option [String] :HoldForManifest (Optional) # - 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: Y # @option option [String] :PriceOptions (Optional) # - Returns commercial pricing. # @option option [boolean] :CommercialShipment (Optional) # - If True, then Invoice/Buyer info Required. If False, then Optional. For example: true # @option option [String] :BuyerFirstName (Optional) # - Buyer first name. Required when CommercialShipment=” true”. For example: John # @option option [String] :BuyerLastName (Optional) # - Buyer last name. Required when CommercialShipment=” true”. For example: Smith # @option option [String] :BuyerAddress1 (Optional) # - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. Required when CommercialShipment=”true”. For example: Lazarette Str. 7 # @option option [String] :BuyerAddress2 (Optional) # - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. For example: # @option option [String] :BuyerAddress3 (Optional) # - Three address lines are provided, but only 1 is Required. Use as many as needed for complete address. For example: # @option option [String] :BuyerCity (Optional) # - Buyer city. Required when CommercialShipment=” true”. For example: Berlin # @option option [String] :BuyerState (Optional) # - Buyer state. Required when CommercialShipment=” true”. For example: # @option option [String] :BuyerPostalCode (Optional) # - Buyer postal code. Required when CommercialShipment=” true”. For example: 10117 # @option option [String] :BuyerCountry (Optional) # - Buyer country. Required when CommercialShipment=” true”. For example: Germany # @option option [String] :BuyerTaxID (Optional) # - Buyer TaxID. For example: 11123456789 # @option option [Boolean] :BuyerRecipient (Optional) # - Indicates that Buyer and Recipient are the same. When CommercialShipment=”true” and BuyerRecipient =”true”, buyer information is not Required. For example: true # @option option [String] :TermsPayment (Optional) # - TermsPayment is Required when CommercialShipment =” true”. For example: Net 50 # @option option [String] :ActionCode (Optional) # - Passed to SPE file via the shipment manifest. # @option option [boolean] :OptOutOfSPE (Optional) # - Allows a customer to opt out of SPE file creation. “false” WILL create a SPE file. Note: This request tag is case sensitive. # @option option [String] :PermitNumber (Optional) # - Number associated with a mailing permit. The permit is permission to use a certain postage payment method for bulk and commercial mailings # @option option [String] :AccountZipCode (Optional) # - ZIP of Account Post Office where mailed if different from . Written to Postal Manifest Detail record. Must be valid ZIP Code. For example: 00962 # @option option [Boolean] :Machinable (Optional) # - 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: false # @option option [String] :DestinationRateIndicator (Required) # - Required for destination entry packagesenter either “I” or “N”. · I = International Service Center (ISC) · N = None # @option option [String] :MID (Optional) # - 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: 847654321 # @option option [String] :LogisticsManagerMID (Optional) # - 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: 489001< / LogisticsManagerMID> # @option option [String] :CRID (Optional) # - 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: 544762 # @option option [String] :VendorCode (Optional) # - 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: 1234 # @option option [String] :VendorProductVersionNumber (Optional) # - Shipping software’s product version number. Located in position #16 in the Detail 1 record of the Shipping Services File v2.0. For example: 5.02.1B # @option option [String] :OverrideMID (Optional) # @option option [String] :ChargebackCode (Optional) # - Used in Shipping Services File v2.0 for G-10 labels. Contact your Technical Integration Specialist for details. # # @see def e_vsgxg_get_label(options = {}) throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request missing') if options[:e_vsgxg_get_label_request].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :option missing') if options[:e_vsgxg_get_label_request][:option].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :image_parameters missing') if options[:e_vsgxg_get_label_request][:image_parameters].nil? 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? 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? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_firm missing') if options[:e_vsgxg_get_label_request][:from_firm].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_address2 missing') if options[:e_vsgxg_get_label_request][:from_address2].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_city missing') if options[:e_vsgxg_get_label_request][:from_city].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_state missing') if options[:e_vsgxg_get_label_request][:from_state].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_zip5 missing') if options[:e_vsgxg_get_label_request][:from_zip5].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :from_phone missing') if options[:e_vsgxg_get_label_request][:from_phone].nil? 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? 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? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_firm missing') if options[:e_vsgxg_get_label_request][:to_firm].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_address2 missing') if options[:e_vsgxg_get_label_request][:to_address2].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :to_dpid missing') if options[:e_vsgxg_get_label_request][:to_dpid].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :container missing') if options[:e_vsgxg_get_label_request][:container].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :content_type missing') if options[:e_vsgxg_get_label_request][:content_type].nil? throw ArgumentError.new('Required arguments :e_vsgxg_get_label_request, :shipping_contents missing') if options[:e_vsgxg_get_label_request][:shipping_contents].nil? request = build_request(:e_vsgxg_get_label, options) get('https://secure.shippingapis.com/ShippingAPI.dll', { API: 'eVSGXGGetLabel', XML: request, }) end private def tag_unless_blank(xml, tag_name, data) xml.tag!(tag_name, data) unless data.blank? || data.nil? end def build_e_vsgxg_get_label_request(xml, options = {}) xml.tag!('Option', options[:e_vsgxg_get_label_request][:option]) tag_unless_blank(xml, 'Revision', options[:e_vsgxg_get_label_request][:revision]) xml.tag!('ImageParameters', options[:e_vsgxg_get_label_request][:image_parameters]) xml.tag!('FromFirstName', options[:e_vsgxg_get_label_request][:from_first_name]) tag_unless_blank(xml, 'FromMiddleInitial', options[:e_vsgxg_get_label_request][:from_middle_initial]) xml.tag!('FromLastName', options[:e_vsgxg_get_label_request][:from_last_name]) xml.tag!('FromFirm', options[:e_vsgxg_get_label_request][:from_firm]) tag_unless_blank(xml, 'FromAddress1', options[:e_vsgxg_get_label_request][:from_address1]) xml.tag!('FromAddress2', options[:e_vsgxg_get_label_request][:from_address2]) tag_unless_blank(xml, 'FromUrbanization', options[:e_vsgxg_get_label_request][:from_urbanization]) xml.tag!('FromCity', options[:e_vsgxg_get_label_request][:from_city]) xml.tag!('FromState', options[:e_vsgxg_get_label_request][:from_state]) xml.tag!('FromZIP5', options[:e_vsgxg_get_label_request][:from_zip5]) tag_unless_blank(xml, 'FromZIP4', options[:e_vsgxg_get_label_request][:from_zip4]) xml.tag!('FromPhone', options[:e_vsgxg_get_label_request][:from_phone]) tag_unless_blank(xml, 'ShipFromZIP', options[:e_vsgxg_get_label_request][:ship_from_zip]) tag_unless_blank(xml, 'SenderEMail', options[:e_vsgxg_get_label_request][:sender_e_mail]) xml.tag!('ToFirstName', options[:e_vsgxg_get_label_request][:to_first_name]) xml.tag!('ToLastName', options[:e_vsgxg_get_label_request][:to_last_name]) xml.tag!('ToFirm', options[:e_vsgxg_get_label_request][:to_firm]) tag_unless_blank(xml, 'ToAddress1', options[:e_vsgxg_get_label_request][:to_address1]) xml.tag!('ToAddress2', options[:e_vsgxg_get_label_request][:to_address2]) tag_unless_blank(xml, 'ToAddress3', options[:e_vsgxg_get_label_request][:to_address3]) tag_unless_blank(xml, 'ToPostalCode', options[:e_vsgxg_get_label_request][:to_postal_code]) tag_unless_blank(xml, 'ToPhone', options[:e_vsgxg_get_label_request][:to_phone]) tag_unless_blank(xml, 'RecipientEMail', options[:e_vsgxg_get_label_request][:recipient_e_mail]) xml.tag!('ToDPID', options[:e_vsgxg_get_label_request][:to_dpid]) tag_unless_blank(xml, 'ToProvince', options[:e_vsgxg_get_label_request][:to_province]) tag_unless_blank(xml, 'ToTaxID', options[:e_vsgxg_get_label_request][:to_tax_id]) xml.tag!('Container', options[:e_vsgxg_get_label_request][:container]) xml.tag!('ContentType', options[:e_vsgxg_get_label_request][:content_type]) xml.tag!('ShippingContents') do xml.tag!('ItemDetail') do xml.tag!('Description', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:description]) xml.tag!('Commodity', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:commodity]) xml.tag!('Restriction') do xml.tag!('FootnoteNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:footnote_number]) xml.tag!('Response', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:response]) xml.tag!('Quantity', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:quantity]) xml.tag!('UnitValue', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:unit_value]) tag_unless_blank(xml, 'NetPounds', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:net_pounds]) tag_unless_blank(xml, 'NetOunces', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:net_ounces]) tag_unless_blank(xml, 'UnitOfMeasure', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:unit_of_measure]) tag_unless_blank(xml, 'HSTariffNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:hs_tariff_number]) tag_unless_blank(xml, 'CountryofManufacture', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:countryof_manufacture]) xml.tag!('PurposeOfShipment', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:purpose_of_shipment]) tag_unless_blank(xml, 'PartiesToTransaction', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:parties_to_transaction]) xml.tag!('Agreement', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:agreement]) tag_unless_blank(xml, 'Postage', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:postage]) tag_unless_blank(xml, 'InsuredValue', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:insured_value]) tag_unless_blank(xml, 'GrossPounds', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:gross_pounds]) tag_unless_blank(xml, 'GrossOunces', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:gross_ounces]) tag_unless_blank(xml, 'Length', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:length]) tag_unless_blank(xml, 'Width', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:width]) tag_unless_blank(xml, 'Height', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:height]) tag_unless_blank(xml, 'Girth', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:girth]) tag_unless_blank(xml, 'Shape', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:shape]) tag_unless_blank(xml, 'CIRequired', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:ci_required]) tag_unless_blank(xml, 'InvoiceDate', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:invoice_date]) tag_unless_blank(xml, 'InvoiceNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:invoice_number]) tag_unless_blank(xml, 'CustomerOrderNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:customer_order_number]) tag_unless_blank(xml, 'CustOrderNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:cust_order_number]) tag_unless_blank(xml, 'TermsDelivery', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:terms_delivery]) tag_unless_blank(xml, 'TermsDeliveryOther', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:terms_delivery_other]) tag_unless_blank(xml, 'PackingCost', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:packing_cost]) xml.tag!('CountryUltDest', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:country_ult_dest]) tag_unless_blank(xml, 'CIAgreement', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:ci_agreement]) xml.tag!('ImageType', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:image_type]) tag_unless_blank(xml, 'ImageLayout', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:image_layout]) tag_unless_blank(xml, 'CustomerRefNo', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:customer_ref_no]) tag_unless_blank(xml, 'CustomerRefNo2', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:customer_ref_no2]) xml.tag!('ShipDate', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:ship_date]) tag_unless_blank(xml, 'HoldForManifest', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:hold_for_manifest]) tag_unless_blank(xml, 'PriceOptions', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:price_options]) tag_unless_blank(xml, 'CommercialShipment', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:commercial_shipment]) tag_unless_blank(xml, 'BuyerFirstName', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_first_name]) tag_unless_blank(xml, 'BuyerLastName', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_last_name]) tag_unless_blank(xml, 'BuyerAddress1', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_address1]) tag_unless_blank(xml, 'BuyerAddress2', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_address2]) tag_unless_blank(xml, 'BuyerAddress3', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_address3]) tag_unless_blank(xml, 'BuyerCity', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_city]) tag_unless_blank(xml, 'BuyerState', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_state]) tag_unless_blank(xml, 'BuyerPostalCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_postal_code]) tag_unless_blank(xml, 'BuyerCountry', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_country]) tag_unless_blank(xml, 'BuyerTaxID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_tax_id]) tag_unless_blank(xml, 'BuyerRecipient', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:buyer_recipient]) tag_unless_blank(xml, 'TermsPayment', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:terms_payment]) tag_unless_blank(xml, 'ActionCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:action_code]) tag_unless_blank(xml, 'OptOutOfSPE', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:opt_out_of_spe]) tag_unless_blank(xml, 'PermitNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:permit_number]) tag_unless_blank(xml, 'AccountZipCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:account_zip_code]) tag_unless_blank(xml, 'Machinable', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:machinable]) xml.tag!('DestinationRateIndicator', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:destination_rate_indicator]) tag_unless_blank(xml, 'MID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:mid]) tag_unless_blank(xml, 'LogisticsManagerMID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:logistics_manager_mid]) tag_unless_blank(xml, 'CRID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:crid]) tag_unless_blank(xml, 'VendorCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:vendor_code]) tag_unless_blank(xml, 'VendorProductVersionNumber', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:vendor_product_version_number]) tag_unless_blank(xml, 'OverrideMID', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:override_mid]) tag_unless_blank(xml, 'ChargebackCode', options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction][:chargeback_code]) end if options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail][:restriction].present? end if options[:e_vsgxg_get_label_request][:shipping_contents][:item_detail].present? end xml.target! end end end end end