{"templateId":"markdown","versions":[{"version":"v2026.03","label":"v2026.03","link":"/products/payments-direct-2/api-docs/tutorials/request-an-access-token","default":true,"active":true,"folderId":"eb16255d"},{"version":"v2025.11","label":"v2025.11","link":"/products/payments-direct-2/v2025.11/api-docs/tutorials/request-an-access-token","default":false,"active":false,"folderId":"eb16255d"}],"sharedDataIds":{"sidebar":"sidebar-products/payments-direct-2/@v2025.11/sidebars.yaml","oas-products/payments-direct-2/@v2026.03/api-docs/payments-direct-api/payments-direct-2-api.yml":"oas-products/payments-direct-2/@v2026.03/api-docs/payments-direct-api/payments-direct-2-api.yml"},"props":{"metadata":{"markdoc":{"tagList":["openapi-code-sample"]},"type":"markdown"},"seo":{"title":"Request an access token","description":"User guides, API reference, and support resources.","siteUrl":"https://docs.ripple.com/products/custody","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"request-an-access-token","__idx":0},"children":["Request an access token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Access tokens are used in token-based authentication to grant applications access to APIs on behalf of a user. After a user successfully logs in and authorizes access, the application receives an access token. This token acts as a credential that the application uses to identify itself and the authorized user when calling the target API."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You must include a valid access token in your request header when you send requests to secured API endpoints."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To get an access token, you must have your client ID and client secret. Learn how to generate a client ID and client secret in the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/products/payments-direct-2/api-docs/payments-direct-api/payments-direct-2-api"},"children":["Payments Direct 2.0 API reference"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request-format","__idx":1},"children":["Request format"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To get an authentication token for the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["UAT"]}," environment, send a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," request to the following URL:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"plaintext","header":{"controls":{"copy":{}}},"source":"https://api.test.ripple.com/v2/oauth/token\n","lang":"plaintext"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authentication-request","__idx":2},"children":["Authentication request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To get an access token, use the authenticate operation in the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/products/payments-direct-2/api-docs/payments-direct-api/payments-direct-2-api"},"children":["Payments Direct 2.0 API reference"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Include the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["audience"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["grant_type"]}," as shown in the example below."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The value of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["audience"]}," field is based on ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://en.wikipedia.org/wiki/Uniform_Resource_Name"},"children":["URN"]}," syntax."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Format"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["urn:ripplexcurrent-ENVIRONMENT_STRING:YOUR_TENANT_ID"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["urn:ripplexcurrent-uat:YOUR_TENANT_ID"]}]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"oas-products/payments-direct-2/@v2026.03/api-docs/payments-direct-api/payments-direct-2-api.yml","operationId":"authenticate","parameters":{},"environments":{}},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authentication-response","__idx":3},"children":["Authentication response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["access_token"]}," for use with all other API operations."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"access_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ\",\n  \"scope\": \"identities:create identities:read identities:write quote_collections:write payments:accept payments:read\",\n  \"expires_in\": 3600,\n  \"token_type\": \"Bearer\"\n}\n","lang":"json"},"children":[]}]},"headings":[{"value":"Request an access token","id":"request-an-access-token","depth":1},{"value":"Request format","id":"request-format","depth":3},{"value":"Authentication request","id":"authentication-request","depth":2},{"value":"Authentication response","id":"authentication-response","depth":2}],"frontmatter":{"toc":{"enable":true,"maxDepth":2},"seo":{"title":"Request an access token"}},"lastModified":"2026-03-11T21:13:28.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/payments-direct-2/api-docs/tutorials/request-an-access-token","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}