lib/pbshipping/shipment.rb
# 
# MANAGING RATES AND SHIPMENTS
# API: POST /shipments/
# API signature: post/shipments
#
# Create a shipment and purchase a shipment label.
#     
MANAGING RATES AND SHIPMENTS
API: POST /shipments
API signature: post/shipments

Create a shipment and purchase a shipment label.
MANAGING RATES AND SHIPMENTS API : POST / shipments API signature : post / shipments Create a shipment and purchase a shipment label .
def createAndPurchase(auth_obj, txid, includeDeliveryCommitment=nil, 
      extraHdrs=nil, overwrite=true)
      hdrs = { PBShipping::txid_attrname => txid }
      if extraHdrs != nil
        hdrs.update(extraHdrs)      
      end
      if includeDeliveryCommitment == nil
        params = { :includeDeliveryCommitment => false }            
      else
        params = { :includeDeliveryCommitment => includeDeliveryCommitment }     
      end  
      api_sig = "post/shipments"
      api_version = PBShipping::get_api_version(api_sig)
      api_path = "/shipments"
      json_resp = PBShipping::api_request(
        auth_obj, :post, api_version, api_path, hdrs, params, self)
      if overwrite == true 
        self.update(json_resp)
        self
      else
        Shipment.new(json_resp)
      end
    end
def createAndPurchase ( auth_obj , txid , includeDeliveryCommitment = nil , extraHdrs = nil , overwrite = true ) hdrs = { PBShipping :: txid_attrname => txid } if extraHdrs != nil hdrs . update ( extraHdrs ) end if includeDeliveryCommitment == nil params = { :includeDeliveryCommitment => false } else params = { :includeDeliveryCommitment => includeDeliveryCommitment } end api_sig = "post/shipments" api_version = PBShipping :: get_api_version ( api_sig ) api_path = "/shipments" json_resp = PBShipping :: api_request ( auth_obj , :post , api_version , api_path , hdrs , params , self ) if overwrite == true self . update ( json_resp ) self else Shipment . new ( json_resp ) end end
MANAGING RATES AND SHIPMENTS
API: POST /shipments
API signature: post/shipments
MANAGING RATES AND SHIPMENTS API : POST / shipments API signature : post / shipments
auth_obj
<not_specific>
txid
<not_specific>
includeDeliveryCommitment
<not_specific>
extraHdrs
<not_specific>
overwrite
<not_specific>