Print "signature_required" option in Fedex label - Rails

132 Views Asked by At

I'm using the fedex gem version 3.9 and cannot get the "signature required" option printed on my fedex label. This is how it looks:

label = fedex.label(
        :filename => "public/labels/#{label_name}",
        :shipper => shipper,
        :recipient => recipient,
        :packages => packages,
        :service_type => service_type,
        :signature_required => true,
        :shipping_options => shipping_options)

I remember this used to work a couple of months ago but now it doesn't.

Let me know if you have any suggestions.

Best,

1

There are 1 best solutions below

0
On

Turns out that the signature options should be sent as part of the packages. Then it prints the label with the right signature initials

packages = [{
      :weight => {:units => "LB", :value => 3},
      :dimensions => {:length => 10, :width => 5, :height => 4, :units => "IN" },
      :special_services_requested => {:special_service_types => "SIGNATURE_OPTION", :signature_option_detail => {:signature_option_type => "DIRECT"} } 
    }]

  label = fedex.label(
    :filename => "public/labels/#{label_name}",
    :shipper => shipper,
    :recipient => recipient,
    :packages => packages
    :shipping_options => shipping_options)