vikram
vikram

Reputation: 135

Uber API to create Payment method

I have 2 questions: a. The Uber create payment API says I can only create payment methods of type alipay, baidu_wallet,or braintree_grant. I want to use this API (or any other) to upload a card.... is this possible or will the user need to load the card manually into uber and then use the Payment Method API to choose the correct payment Id? b. When the user makes a ride request from my app, I want associate the trip with a specific card. How can I do this programmatically? In other words, I am looking for some API in RideParameters which will allow me to choose a payment method upfront.

Upvotes: 0

Views: 405

Answers (1)

Sasa Jovanovic
Sasa Jovanovic

Reputation: 857

a) There is no API method available that will create new payment methods or upload cards. As you mentioned in your question "user need to load the card manually into uber and then use the Payment Method API to choose the correct payment Id".

b) You can list all available payment methods by using: "GET /payment-methods" endpoint. In the response, you will get a list of available payment methods. Please use only known types - so if user account has some payment methods that are not recognized by Uber - they will be with type="unknown". Sample 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"
}

Upvotes: 1

Related Questions