> For the complete documentation index, see [llms.txt](https://docs.xplorpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplorpay.com/guides/mobile-emv/start-transaction.md).

# 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xplorpay.com/guides/mobile-emv/start-transaction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
