Integration Guide - Authentication
¶ Authentication
To gain access to the Uber Pay API, you need a valid access token from our OAuth service. You can get this token by sending a request to https://auth.uber.com/oauth/v2/token
. Keep this access token for any future requests. Additionally, we require you to have access to the payments.deposits
scope on your applications page, and have the scope in the oauth request payload set to the same thing. You can see this demonstrated in the example below.
Please do keep in mind that this token is only temporary, and you will need to refresh it once it has expired to make sure it stays active.
For more information regarding authentication through the Uber oauth2 API, read about it in the OAuth API section.
¶ Example request
curl -X POST \
-F "client_id=RKI7BA3ugxa01Peu-KSL7pEig76iUK6_" \
-F "client_secret=SECRET_ID" \
-F "grant_type=client_credentials" \
-F "scope=payments.deposits" "https://auth.uber.com/oauth/v2/token"
¶ Example response
{
"access_token": "JA.VUNmGAAAAAAAEgASAAAABwAIAAwAAAAAAAAAEgAAAAAAAAHQAAAAFAAAAAAADgAQAAQAAAAIAAwAAAAOAAAApAAAABwAAAAEAAAAEAAAAA_SbPThodnVCoCSaBrMH8aAAAAAdYwgqOaF5Ub9AyNiWgZLmRvjMuTW--wGos8vj4imGCCo2P2n9FyRG45j1-drRs-jcp4XEkfmNIs1hiT272gpwcikPlutUCyGjFnI_U9dIKa-O1hzZiqe2KUxwAHWnQ2kPJWvHgspAfcT8mKj8A-BE7j0gH3J5cPlQ-i7c74X8p0MAAAAaOTjFRdmMtKeJM7QJAAAAGIwZDg1ODAzLTM4YTAtNDJiMy04MDZlLTdhNGNmOGUxOTZlZQ",
"token_type": "Bearer",
"expires_in": 2592000,
"scope": "payments.deposits"
}
¶ Make API requests
You are now ready to call the Uber Pay API. You have the following options:
- Make use of the hosted Postman collection to call the API through the Postman tool or from the command line through Postman generated curl commands. You can then download the code snippet in the language of your choice through the Postman tool.
- Create your own client in your programming language.
- Make use of our reference app in Node.js. This is particularly useful for you to understand the end-to-end transactional control and data flow.
¶ Postman collections
Use Postman to send requests to the Uber Pay API. To set up Postman:
- In Postman, select the imported Environment.
- Fill in the
CURRENT VALUE
of variablesCLIENT_ID
andCLIENT_SECRET
with the strings in your Uber Developer account. - Send the request
1. Generate Bearer Token
. - Copy the value for
access_token
from the response into theCURRENT VALUE
of variableBEARER_TOKEN
in the Environment. - Fill in the
CURRENT_VALUE
of variablesPARTNER_ID
andPARTNER_SOURCE_ACCOUNT_ID
of the environment, using the IDs provided by Uber. - Update the other variables accordingly:
FUNDING_METHOD
,CURRENCY
,COUNTRY_ISO2
,LOCALE
.
Now, you can start sending requests. You can find details for each endpoint in the API references.