# Start transaction

To start a transaction into your app:

{% stepper %}
{% step %}
Add an object that initializes the transaction.

{% code lineNumbers="true" %}

```javascript
ClearentVP3300Config *config = [[ClearentVP3300Config alloc]init];
        [config setPublicKey:publicKey];
        [config setClearentBaseUrl:baseURL];
        config.contactAutoConfiguration = false;
        config.contactlessAutoConfiguration = false;
        config.contactless = true;
        clearentVP3300 = [[Clearent_VP3300 alloc]  initWithConnectionHandling:self clearentVP3300Configuration:config];
        clearentManualEntry = [[ClearentManualEntry alloc]  init];
        [clearentManualEntry setClearentBaseUrl:baseURL];
        [clearentManualEntry setPublicKey:publicKey];
```

{% endcode %}

{% hint style="info" %}
Visit [Payment Gateway](https://gateway-sb.clearent.net/login.seam) to test your integration with iOS framework and to go live.
{% endhint %}
{% endstep %}

{% step %}
Add an object that represents the payment request.

{% code lineNumbers="true" %}

```javascript
ClearentPayment *clearentPayment = [[ClearentPayment alloc] init];
    [clearentPayment setAmount:theAmount];
    clearentPayment.amtOther = 0;
    clearentPayment.type = 0;
    clearentPayment.timeout = 10;
    clearentPayment.tags = nil;
    clearentPayment.fallback = true;
    clearentPayment.forceOnline = false;
```

{% endcode %}

{% hint style="warning" %}
The `setAmount` field is *required* for certain EMV checks and *must* be provided.
{% endhint %}
{% endstep %}

{% step %}
Add an object that represents a Bluetooth connection.

```javascript
ClearentConnection *clearentConnection = [[ClearentConnection alloc] initBluetoothWithFriendlyName:self.deviceFriendlyName];
```

The framework connects to the card reader over Bluetooth and sends messages to the feedback delegate to start a transaction.

```javascript
ClearentResponse *response = [clearentVP3300 startTransaction:clearentPayment clearentConnection:clearentConnection];
         if (response.responseType != RESPONSE_SUCCESS) 
         {
             //Notify user the transaction could not be started.
         }
```

The iOS framework secures the card data and calls the `successTransactionToken` delegate.
{% endstep %}

{% step %}
Use the POST method with the `/rest/v2/mobile/transactions/sale` endpoint to create a transaction on your app using a mobile JSON Web Token (JWT).
{% endstep %}
{% endstepper %}

{% hint style="info" %}
See the [Mobile Payment Transaction API](https://docs.xplorpay.com/api-references/payments/mobile) for more information.
{% endhint %}
