|
69 | 69 | # This is needed to ensure an accurate rate quote with the response. |
70 | 70 | shipment.RecipientAddress.Residential = True |
71 | 71 |
|
| 72 | +# Who pays for the shipment? |
72 | 73 | # RECIPIENT, SENDER or THIRD_PARTY |
73 | 74 | shipment.ShippingChargesPayment.PaymentType = 'SENDER' |
74 | 75 |
|
75 | | -# These are example label values. You'll want to adjust these to fit your |
76 | | -# usage case. |
| 76 | +# Specifies the label type to be returned. |
| 77 | +# LABEL_DATA_ONLY or COMMON2D |
77 | 78 | shipment.LabelSpecification.LabelFormatType = 'COMMON2D' |
| 79 | + |
| 80 | +# Specifies which format the label file will be sent to you in. |
| 81 | +# DPL, EPL2, PDF, PNG, ZPLII |
78 | 82 | shipment.LabelSpecification.ImageType = 'PNG' |
79 | | -shipment.LabelSpecification.LabelStockType = 'PAPER_7X4.75' |
| 83 | + |
| 84 | +# To use doctab stocks, you must change ImageType above to one of the |
| 85 | +# label printer formats (ZPLII, EPL2, DPL). |
| 86 | +# See documentation for paper types, there quite a few. |
| 87 | +shipment.LabelSpecification.LabelStockType = 'PAPER_4X6' |
| 88 | + |
| 89 | +# This indicates if the top or bottom of the label comes out of the |
| 90 | +# printer first. |
| 91 | +# BOTTOM_EDGE_OF_TEXT_FIRST or TOP_EDGE_OF_TEXT_FIRST |
| 92 | +shipment.LabelSpecification.LabelPrintingOrientation = 'BOTTOM_EDGE_OF_TEXT_FIRST' |
80 | 93 |
|
81 | 94 | package1_weight = shipment.create_wsdl_object_of_type('Weight') |
82 | 95 | # Weight, in pounds. |
|
85 | 98 |
|
86 | 99 | package1 = shipment.create_wsdl_object_of_type('RequestedPackageLineItem') |
87 | 100 | package1.Weight = package1_weight |
| 101 | +# Un-comment this to see the other variables you may set on a package. |
88 | 102 | #print package1 |
89 | 103 |
|
| 104 | +# This adds the RequestedPackageLineItem WSDL object to the shipment. It |
| 105 | +# increments the package count and total weight of the shipment for you. |
90 | 106 | shipment.add_package(package1) |
91 | 107 |
|
92 | 108 | # If you'd like to see some documentation on the ship service WSDL, un-comment |
|
104 | 120 | # This will show the reply to your shipment being sent. You can access the |
105 | 121 | # attributes through the response attribute on the request object. This is |
106 | 122 | # good to un-comment to see the variables returned by the Fedex reply. |
107 | | -#print shipment.response |
| 123 | +print shipment.response |
108 | 124 |
|
109 | 125 | # Here is the overall end result of the query. |
110 | 126 | print "HighestSeverity:", shipment.response.HighestSeverity |
|
0 commit comments