# Mobile Tokenization (iOS)

This article details how to accept the payments details of your buyer and secure their information in your iOS app. Payment details get secured via [tokenization](/guides/online-payments/payment-tokenization) and stored in Finix's vault, so payment information is never exposed and minimizes your PCI scope.

If you have any questions about using Finix, reach out to your Finix point of contact or email the [Finix Support team](/guides/getting-started/support-at-finix/) at anytime!

## Step 1: Add the FinixPaymentSheet Framework

Use the FinixPaymentSheet SDK and Test App. Add the SDK to your application.

FinixPaymentSheet
This framework provides a Payment Sheet that you can use to tokenize credit cards. It provides a presenter or you can present the PaymentInputController yourself.

## Step 2: Import Library

You can access PaymentsSDK by importing the library.


```swift
import FinixPaymentSheet
```

## Step 3: Initialize Tokenizer Class

The PaymentsSDK provides a Test app that you can utilize to build your own application.

It's composed of 2 delegates and 2 ViewControllers

- ResultViewController: used to react to the result of the tokenization form
- ViewController: used to initialize and configure the tokenization form to your specifications


## Step 4: Create a Payment Instrument

Before you can use the newly tokenized card or bank account you will need to associate it with an `Identity`.

To do this, make an authenticated `POST` request to the `/payment_instrument` and create a `Payment Instrument` with the relevant token
and `Identity` information. You can access the Token from the `TokenResponse`. TokenResponse is of the following structure:


```swift
id: \(instrument.id)
fingerprint: \(instrument.fingerprint)
created: \(instrument.created)
updated: \(instrument.updated)
instrument: \(instrument.instrument)
expires: \(instrument.expires)
isoCurrency: \(instrument.isoCurrency)
```

Token invalidation
Tokens should be associated right away. Tokens that don't get associated within 30 mins of creation get invalidated.

Example
API Definition
Example
Payment Instrument - Token - Card

```json Payment Instrument - Token - Card
{
  "id": "PImmCg3Po7oNi7jaZcXhfkEu",
  "created_at": "2022-10-10T05:32:17.78Z",
  "updated_at": "2022-10-10T05:32:17.78Z",
  "account_updater_enabled": false,
  "application": "APgPDQrLD52TYvqazjHJJchM",
  "created_via": "API",
  "currency": "USD",
  "enabled": true,
  "fingerprint": "FPRiCenDk2SoRng7WjQTr7RJY",
  "identity": "IDgWxBhfGYLLdkhxx2ddYf9K",
  "instrument_type": "PAYMENT_CARD",
  "address": {
    "line1": "900 Metro Center Blv",
    "line2": null,
    "city": "San Francisco",
    "region": "CA",
    "postal_code": "94404",
    "country": "USA"
  },
  "address_verification": "UNKNOWN",
  "bin": "520082",
  "brand": "MASTERCARD",
  "card_type": "DEBIT",
  "expiration_month": 12,
  "expiration_year": 2029,
  "issuer_country": "NON_USA",
  "last_four": "8210",
  "name": "Amy White",
  "network_token_enabled": false,
  "network_token_state": "NOT_ENABLED",
  "security_code_verification": "UNKNOWN",
  "tags": {
    "card_name": "Business Card"
  },
  "type": "PAYMENT_CARD",
  "_links": {
    "self": {
      "href": "https://finix.sandbox-payments-api.com/payment_instruments/PImmCg3Po7oNi7jaZcXhfkEu"
    },
    "authorizations": {
      "href": "https://finix.sandbox-payments-api.com/payment_instruments/PImmCg3Po7oNi7jaZcXhfkEu/authorizations"
    },
    "transfers": {
      "href": "https://finix.sandbox-payments-api.com/payment_instruments/PImmCg3Po7oNi7jaZcXhfkEu/transfers"
    },
    "verifications": {
      "href": "https://finix.sandbox-payments-api.com/payment_instruments/PImmCg3Po7oNi7jaZcXhfkEu/verifications"
    },
    "application": {
      "href": "https://finix.sandbox-payments-api.com/applications/APgPDQrLD52TYvqazjHJJchM"
    },
    "identity": {
      "href": "https://finix.sandbox-payments-api.com/identities/IDgWxBhfGYLLdkhxx2ddYf9K"
    },
    "updates": {
      "href": "https://finix.sandbox-payments-api.com/payment_instruments/PImmCg3Po7oNi7jaZcXhfkEu/updates"
    }
  }
}
```

API Definition