Module: Mercadolibre::Core::Shippings

Included in:
Api
Defined in:
lib/mercadolibre/core/shippings.rb

Instance Method Summary collapse

Instance Method Details

#get_shipment(shipment_id) ⇒ Object


4
5
6
7
8
9
# File 'lib/mercadolibre/core/shippings.rb', line 4

def get_shipment(shipment_id)
  filters = { access_token: @access_token }
  r = get_request("/shipments/#{shipment_id}", filters)

  Mercadolibre::Entity::Shipment.new(r[:body])
end

#update_shipment(shipment_id, attribs) ⇒ Object


11
12
13
14
15
16
17
# File 'lib/mercadolibre/core/shippings.rb', line 11

def update_shipment(shipment_id, attribs)
  payload = attribs.to_json

  headers = { content_type: :json, accept: :json }

  put_request("/shipments/#{shipment_id}?access_token=#{@access_token}", payload, headers)[:body]
end