1
votes

My web app was working great on sandbox. I changed all of my requests from https://sandbox-api.uber.com/v1/... to https://api.uber.com/v1/... and now I'm getting an error I've never seen before.

Here are the details of the error:

Status: 409

Code: fare_expired

Title: The fare has expired. Please get estimates again, confirm the new fare, and then re-request.

I can't find any documentation on Uber's site on this specific error. I know that surge pricing acceptance can expire and have to be reauthorized, but I'm getting this error on the very first ride request.

Has anybody else seen this error? Happy to share more details as needed.

This is my ruby code where I make the ride request to Uber:

@uber_ride = JSON.load(RestClient::Request.execute(
      :method => :post,
      :url => "https://api.uber.com/v1/requests",
      :payload => '{"start_latitude":' + lat_start.to_s + ',"start_longitude":' + lng_start.to_s + ',"end_latitude":' + lat_end.to_s + ',"end_longitude":' + lng_end.to_s + ',"product_id":"' + @uberx_id.to_s + '","surge_confirmation_id":"' + surge_id.to_s + '"}',
      :headers => {'Authorization' => 'Bearer ' + session[:request_token], :content_type => 'application/json'}
    ))
1
Got a response from Uber's support team: "we are sending that error down whenever pricing changes between making an estimate or a user accepts surge pricing. I'm working with them to update the documentation to make this more clear." Issue still remains that I'm getting this error without having made a fare request first. I can't find anywhere in their documentation stating I need to make a fare request before making a ride request. - tylerSF
I'm still getting this error. I emailed their support team again. I added in the functionality of a fare estimate before I make a request, however I still get the fare expired error ONLY when surge pricing is in effect (I'm double checking from the Uber app). My app handles surge pricing fine in Sandbox and I don't get the fare expired error. Has anyone else been having this issue? - tylerSF
Did you manage to resolve it? I am getting the same error. I am using the Java sdks for ride request purposes. - Paagalpan
@Paagalpan, yes. It was a bug in their request flow. The way I resolved it was to hit the /V1/ESTIMATES/PRICE endpoint before I hit the request endpoint. I think it stems from Uber wanting you to present an estimated price to the user before submitting a request on their behalf. - tylerSF
It worked. Thanks. May I recommend you posting that as an answer and accepting it? - Paagalpan

1 Answers

2
votes

The way I resolved this error was by hitting the /V1/ESTIMATES/PRICE endpoint BEFORE the request endpoint. I think this error message stems from Uber wanting you to present an estimated price to the user before submitting a request on their behalf.