Class: PostNordAPI::ShipmentResource

Inherits:
BaseResource show all
Defined in:
lib/post_nord_api/resources/shipment_resource.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#client

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from PostNordAPI::BaseResource

Instance Method Details

#create_return_label(params) ⇒ Object



5
6
7
8
# File 'lib/post_nord_api/resources/shipment_resource.rb', line 5

def create_return_label(params)
  response = post_request('shipment/v3/returns/edi/labels/pdf', body: parse_params(params))
  Booking.new(response.body)
end

#track(tracking_number, locale: 'en') ⇒ Object



10
11
12
13
# File 'lib/post_nord_api/resources/shipment_resource.rb', line 10

def track(tracking_number, locale: 'en')
  response = get_request("shipment/v5/trackandtrace/findByIdentifier.json?id=#{tracking_number}&locale=#{locale}")
  Tracking.new(response.body)
end