{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","openapiLink"]},"type":"markdown"},"seo":{"title":"GetTosRequiredforUser (iOS SDK)","description":"Tilia Wallet Developer Documentation","siteUrl":"https://thunes-tilia-docs.redocly.app/","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"gettosrequiredforuser-ios-sdk","__idx":0},"children":["GetTosRequiredforUser (iOS SDK)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This helper function allows you to see if a user has agreed to the most current terms. Anytime this value is false, the user will be required to agree to the most recent version of the terms before completing a payment."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Authorized User Password Token (A User Password Token is a string that enables Tilia Wallet to verify that a request belongs to an authorized session)"]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All methods and flows in the Tilia SDK require you to have a server setup that communicates with Tilia’s APIs (your server will have a private api key which needs to remain secure and should never be exposed to client-side applications).  Your client application should communicate with your own api (ensuring user authentication) to retrieve data required by the Tilia SDK."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"server-side-code-example-to-retrieve-user-access-token","__idx":2},"children":["Server-Side Code Example to Retrieve User Access Token"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Requires your server to retrieve a client credentials access token.  See more ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/authentication"},"children":["here"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Requires an account id for a user that has been registered with Tilia.  See more ",{"$$mdtype":"Tag","name":"OpenapiLink","attributes":{"link":"accounts/openapi/other/registeraccounthandlerfor","text":"here"},"children":[]},"."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"curl -i -X POST \\\n  https://auth.staging.tilia-inc.com/authorize/user \\\n  -H 'Authorization: Bearer <CLIENT_CREDENTIALS_ACCESS_TOKEN_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"account_id\": \"<USER_ACCOUNT_ID_HERE>\",\n    \"return_token\": true,\n  }'\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-responce-payload","__idx":3},"children":["Example Responce Payload"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"status\": \"Success\",\n    \"message\": [],\n    \"codes\": [],\n    \"payload\": {\n        \"token\": {\n            \"access_token\": \"USER_PASSWORD_TOKEN\",\n            \"token_type\": \"Bearer\",\n            \"refresh_token\": \"REFRESH_TOKEN\",\n            \"expiry\": \"TOKEN_EXPIRATION\"\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your api should return the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["access_token"]}," to your client application to use in the Tilia SDK."," ","For more information on the /authorize/user endpoint go ",{"$$mdtype":"Tag","name":"OpenapiLink","attributes":{"link":"auth/openapi/other/authorizeuserhandler","text":"here"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"swift-code-example","__idx":4},"children":["Swift Code Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"TLManager.shared.setToken(\"USER_PASSWORD_TOKEN\")\nTLManager.shared.getTosRequiredForUser { result in print(result) }\n","lang":"swift"},"children":[]}]},"headings":[{"value":"GetTosRequiredforUser (iOS SDK)","id":"gettosrequiredforuser-ios-sdk","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":3},{"value":"Server-Side Code Example to Retrieve User Access Token","id":"server-side-code-example-to-retrieve-user-access-token","depth":4},{"value":"Example Responce Payload","id":"example-responce-payload","depth":4},{"value":"Swift Code Example","id":"swift-code-example","depth":3}],"frontmatter":{"seo":{"title":"GetTosRequiredforUser (iOS SDK)"}},"lastModified":"2026-02-05T18:12:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/sdks/ios-gettosrequiredbyuser","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}