/fuel_purchases/:id

Update an existing fuel purchase

require 'uri'
require 'net/http'
require 'json'

url = URI('https://api.keeptruckin.com/v1/fuel_purchases/1')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type'] = 'application/json'
params = {
  :vehicle_id   => 1,
  :driver_id    => 2,
  :purchased_at => '2019-04-23',
  :jurisdiction => 'AL',
  :fuel_type    => 'diesel',
  :fuel         => 13,
  :fuel_unit    => 'gal'
}
request.body = params.to_json

response = http.request(request)
puts response.read_body
Language
Credentials
Header
Click Try It! to start a request and see the response here!