Authentication

👋

Please get in touch

If you would like access to our staging environment to begin interacting with our APIs, please get in touch with your implementation manager, or at [email protected] so we can provide you with API credentials.

To call a YouLend API:

1. Get a token: Send your client ID, client secret and the API’s audience value to the token endpoint.

2. Call the API: Send the returned token as a Bearer token to the appropriate regional API host.

Auth tokens

Having trouble authenticating? See here.

YouLend uses the Client Credentials flow from OAuth 2.0 to secure the API endpoints.
To request an access token for any of the APIs, perform a POST operation to one of the following endpoints:

LocationStaging URLProduction URL
Europehttps://youlend-stag.eu.auth0.com/oauth/tokenhttps://youlend.eu.auth0.com/oauth/token
USAhttps://youlend-stag.eu.auth0.com/oauth/tokenhttps://youlend-us.us.auth0.com/oauth/token

Send the token request in the following format:

curl --request POST \
  --url 'https://youlend-stag.eu.auth0.com/oauth/token' \
  --header 'Content-Type: application/json' \
  --data '{
    "grant_type": "client_credentials",
    "client_id": "CLIENT_ID",
    "client_secret": "CLIENT_SECRET",
    "audience": "API_IDENTIFIER"
  }'

The audience identifies the API that the token will be used to access. Select the appropriate audience value below. The OAuth client must also be enabled for that API.

API audience values

APIStaging audience (Europe and USA)Europe production audienceUSA production audienceRequired Auth0 API access
Onboardinghttps://staging.youlendapi.com/onboardinghttps://youlendapi.com/onboardinghttps://youlendapi.us/onboardingThird Party Onboarding API
Notificationhttps://staging.youlendapi.com/notificationhttps://youlendapi.com/notificationhttps://youlendapi.us/notificationThird Party Notification API
Preapprovalhttps://staging.youlendapi.com/preapprovalhttps://youlendapi.com/preapprovalhttps://youlendapi.us/preapprovalThird Party PreApproval API
Prequalificationhttps://staging.youlendapi.com/prequalificationhttps://youlendapi.com/prequalificationhttps://youlendapi.us/prequalificationThird Party PreQualification API
Loanhttps://staging.youlendapi.com/loanhttps://youlendapi.com/loanhttps://youlendapi.us/loanThird Party Loan API
Test Supporthttps://staging.youlendapi.com/testsupportNot supportedNot supportedThird Party Test Support API
Fast Trackhttps://staging.youlendapi.com/onboarding/fasttrackhttps://youlendapi.com/onboarding/fasttrackhttps://youlendapi.com/onboarding/fasttrackThird Party Onboarding FastTrack API

Good to know

Test Support is available in staging only.

A successful response (200) contains a signed JSON Web Token (JWT), the token's type (Bearer), and lifetime in seconds (86400, equal to 24 hours).

{
  "access_token": "eyJz93a...k4laUWw",
  "token_type": "Bearer",
  "expires_in": 86400
}
🚧

Be aware

Tokens are valid for 24 hours. Reuse a valid token until it expires instead of requesting a new token for every API call. Use the expires_in value to manage token renewal.

Calling an API

After obtaining an access token, send the API request to the host for the merchant’s region and environment. The request host is used for the API call, not for obtaining the token.

The four request hosts are:

RegionStaging API hostProduction API host
Europehttps://partners.staging-youlendapi.comhttps://youlendapi.com
USAhttps://uspartners.staging-youlendapi.comhttps://youlendapi.us

Pass the retrieved access token as a Bearer token in the Authorization header of every API request.

For example:

curl --request POST \
  --url 'https://partners.staging-youlendapi.com/onboarding/leads' \
  --header 'Authorization: Bearer ACCESS_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data 'REQUEST_DATA'
👍

Try it out

You can also add the bearer token for an API directly in the API reference for each endpoint next to the Try it button to try API requests without leaving this site.



Troubleshooting 401 Unauthorized


Never share client secrets or access tokens when requesting support.

Token request:

  • Confirm that the client ID and client secret are correct for the selected environment.
  • Confirm that the audience exactly matches the API being requested.
  • Confirm that the OAuth client has access to the corresponding Auth0 API.

API request:

  • Confirm that the token was requested using the correct audience for that API.
  • Confirm that the token has not expired.
  • Check that the request includes Authorization: Bearer ACCESS_TOKEN.
  • Confirm that the API request host matches the correct region and environment.