2
votes

I tried to integrate uber to my app. Create an app and I reached the level of request a ride.

i tried to request a ride by using following post method:

https://api.uber.com/v1.2/requests?access_token=

then getting an error like

{
"meta": {},
"errors": [
    {
        "status": 400,
        "code": "invalid_payment",
        "title": "The rider's payment method is invalid and they must update their billing info."
    }
]
}

in my uber account added all the payment methods( cash, paytm, debit card), Is required to keep minimum balance in my paytm or debit card to book a ride?

how can i solve this??

thanks in advance for helping

1
Can you please supply full request to the "api.uber.com/v1.2/requests" endpoint?. Do not supply access_tiken - just want to see what is your parameter list? Are you using : "payment_method_id" parameter?Sasa Jovanovic
i am just using api.uber.com/v1.2/requests link and add access token in header. in the body session added {"product_id": "821415d8-3bd5-4e27-9604-194e4359a449", "start_latitude" : 37.775232, "start_longitude" : -122.4197513,"end_latitude" : 37.7899886, "end_longitude" : -122.4021253,"fare_id" : b523c4b049ec39966c0fc407dfa1a4c009089372e012d11623cdfd23edcc6a44"} these detailsAmil Sajeev

1 Answers

1
votes

From your request, I'm not sure what payment method you were using. You have an option to get a list of all payment methods by using following API "GET /v1.2/payment-methods". So response looks like:

Status-Code: 200 OK { "payment_methods": [
{
"payment_method_id": "5f384f7d-8323-4207-a297-51c571234a8c",
"type": "baidu_wallet",
"description": "*53",
},
{
"payment_method_id": "f33847de-8113-4587-c307-51c2d13a823c",
"type": "alipay",
"description": "ga***@uber.com",
},
{
"payment_method_id": "f43847de-8113-4587-c307-51c2d13a823c",
"type": "visa",
"description": "***23"
},
{
"payment_method_id": "517a6c29-3a2b-45cb-94a3-35d679909a71",
"type": "american_express",
"description": "***05"
},
{
"payment_method_id": "f53847de-8113-4587-c307-51c2d13a823c",
"type": "business_account",
"description": "Late Night Ride"
} ],
"last_used": "f53847de-8113-4587-c307-51c2d13a823c" }

There you can find payment method ID - and you can use it when you create your ride request.

Example:

{
"fare_id":"d30e732b8bba22c9cdc10513ee86380087cb4a6f89e37ad21ba2a39f3a1ba9",
"product_id": "a1111c8c-c720-46c3-8534-2fcdd730040d",
"payment_method_id": "f43847de-8113-4587-c307-51c2d13a823c"
"start_latitude": 37.761492,
"start_longitude": -122.423941,
"end_latitude": 37.775393,
"end_longitude": -122.417546
}