module Mercadolibre::Core::OrderNotes

Public Instance Methods

create_order_note(order_id, text) click to toggle source
# File lib/mercadolibre/core/order_notes.rb, line 9
def create_order_note(order_id, text)
  payload = { note: text }.to_json

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

  result = post_request("/orders/#{order_id}/notes?access_token=#{@access_token}", payload, headers)
  result.body.note
end
delete_order_note(order_id, note_id) click to toggle source
# File lib/mercadolibre/core/order_notes.rb, line 27
def delete_order_note(order_id, note_id)
  result = delete_request("/orders/#{order_id}/notes/#{note_id}?access_token=#{@access_token}")
  result.status_code == 200
end
get_order_notes(order_id) click to toggle source
# File lib/mercadolibre/core/order_notes.rb, line 4
def get_order_notes(order_id)
  filters = { access_token: @access_token }
  get_request("/orders/#{order_id}/notes", filters).body
end
update_order_note(order_id, note_id, text) click to toggle source
# File lib/mercadolibre/core/order_notes.rb, line 18
def update_order_note(order_id, note_id, text)
  payload = { note: text }.to_json

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

  result = put_request("/orders/#{order_id}/notes/#{note_id}?access_token=#{@access_token}", payload, headers)
  result.body.note
end