{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-ios/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-walkthrough","admonition","step"]},"type":"markdown"},"seo":{"title":"TokenResponse | iOS SDK Reference","description":"Reference for the Finix iOS TokenResponse — the object returned after successful payment sheet submission.","siteUrl":"https://docs.finix.com/","llmstxt":{"hide":false,"sections":[{"title":"Getting Started","includeFiles":["guides/getting-started/**/*.md"],"excludeFiles":[]},{"title":"Online Payments","includeFiles":["guides/online-payments/**/*.md"],"excludeFiles":["guides/online-payments/payment-features/fsa-hsa-non-healthcare-mcc.md"]},{"title":"In-Person Payments","includeFiles":["guides/in-person-payments/**/*.md"],"excludeFiles":[]},{"title":"Subscriptions","includeFiles":["guides/subscriptions/**/*.md"],"excludeFiles":[]},{"title":"After the Payment","includeFiles":["guides/after-the-payment/**/*.md"],"excludeFiles":[]},{"title":"Managing Operations","includeFiles":["guides/managing-operations/**/*.md"],"excludeFiles":[]},{"title":"Platform Payments","includeFiles":["guides/platform-payments/**/*.md"],"excludeFiles":[]},{"title":"Payouts","includeFiles":["guides/payouts/**/*.md"],"excludeFiles":[]},{"title":"Low-Code / No-Code","includeFiles":["low-code-no-code/**/*.md"],"excludeFiles":[]},{"title":"Developers","includeFiles":["additional-resources/developers/**/*.md"],"excludeFiles":[]},{"title":"Plugins","includeFiles":["additional-resources/plugins/**/*.md"],"excludeFiles":[]},{"title":"Industry Considerations","includeFiles":["guides/industry-considerations/**/*.md"],"excludeFiles":[]},{"title":"Regional Considerations","includeFiles":["guides/regional-considerations/**/*.md"],"excludeFiles":[]},{"title":"Release Notes","includeFiles":["release-notes/**/*.md"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":1,"filters":{},"filesets":[{"files":[{"path":"ios/online/_filesets/token-response.swift","content":[{"start":0,"condition":{"steps":["token-shape"]},"children":["// TokenResponse returned via paymentAction(_:didSucceedWith:):","// response.id          — e.g. \"TKeD6uad8xZc52Rqg1VhvSBw\"","// response.fingerprint — e.g. \"FPRrcobjtdU98gr4sjiqYR1Qg\"","// response.instrument  — instrument type (payment card or bank account)","// response.created     — e.g. \"2025-06-10T00:31:53.54Z\"","// response.expires     — 30 minutes after creation","// response.isoCurrency — currency of the token"]},"",{"start":10,"condition":{"steps":["token-usage"]},"children":["extension CheckoutViewController: PaymentActionDelegate {","    func paymentAction(_ action: PaymentAction, didSucceedWith response: TokenResponse) {","        // response.id is the value you pass to the Finix API","        sendTokenToBackend(response.id)","        dismiss(animated: true)","    }","","    func paymentAction(_ action: PaymentAction, didFailWith error: Error) {","        print(\"Error: \\(error.localizedDescription)\")","        dismiss(animated: true)","    }","}"]},""],"metadata":{"steps":["token-shape","token-usage"]},"basename":"token-response.swift","language":"swift"}],"downloadAssociatedFiles":[]}],"steps":[{"id":"token-shape","heading":"TokenResponse shape"},{"id":"token-usage","heading":"Using the token"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"tokenresponse","__idx":0},"children":["TokenResponse"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The object passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentAction(_:didSucceedWith:)"]}," after the buyer successfully submits the payment sheet. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response.id"]}," to create a Payment Instrument via the Finix API."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Token Expiration"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tokens expire ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["30 minutes"]}," after creation. Pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response.id"]}," to your backend and create a Payment Instrument immediately."]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"token-shape","heading":"TokenResponse shape"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"TokenResponse {\n    id: String           // e.g. \"TKeD6uad8xZc52Rqg1VhvSBw\"\n    fingerprint: String  // e.g. \"FPRrcobjtdU98gr4sjiqYR1Qg\"\n    instrument: Int      // instrument type enum\n    created: String      // e.g. \"2025-06-10T00:31:53.54Z\"\n    expires: String      // 30 minutes after creation\n    isoCurrency: Int     // currency enum\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token ID — pass this to the Finix API to create a Payment Instrument."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fingerprint"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unique fingerprint for the underlying payment instrument."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["instrument"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Instrument type: payment card or bank account."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expires"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Timestamp when the token expires (30 minutes after creation)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isoCurrency"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency of the token."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["created"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Timestamp when the token was created."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"token-usage","heading":"Using the token"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pass ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response.id"]}," to your backend, then call the Finix API to create a Payment Instrument. Once created, use the Payment Instrument ID for all subsequent Finix API calls."]}]}]}]},"headings":[{"value":"TokenResponse","id":"tokenresponse","depth":1}],"frontmatter":{"seo":{"title":"TokenResponse | iOS SDK Reference","description":"Reference for the Finix iOS TokenResponse — the object returned after successful payment sheet submission."},"markdown":{"toc":{"hide":true}},"footer":{"hide":true}},"lastModified":"2026-06-12T22:03:54.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ios/online/token-response","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}