> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/authentication/authentication-transaction-management/kill-transaction.md).

# Kill Transaction

The Transaction Kill API is used to terminate an ongoing provisioning or authentication transaction. This might be necessary if there is a need to stop the transaction due to any reasons.

## API  Description

**Method** : <mark style="color:green;">`POST`</mark>

**URL** : `https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill`

### **Parameters**

* `client_id`  :  A unique client id that is shared for each partner.
* `client_secret`  :  A unique key that is auto-generated for each parter and will be provided by VIDA.
* `session_identifier` : Session id received in response of Transaction Initiation API

## Kill Transaction

<mark style="color:green;">`POST`</mark> `https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill`

#### Query Parameters

| Name                                                  | Type   | Description                                                 |
| ----------------------------------------------------- | ------ | ----------------------------------------------------------- |
| client\_id<mark style="color:red;">\*</mark>          | String | {YOUR CLIENT ID}                                            |
| client\_secret<mark style="color:red;">\*</mark>      | String | {SHARED SECRET PROVIDED TO YOU BY VIDA}                     |
| session\_identifier<mark style="color:red;">\*</mark> | String | {SESSION ID RECEIVED IN RESPONSE OF TRANSACTION INITIATION} |

#### Headers

| Name                                           | Type   | Description                         |
| ---------------------------------------------- | ------ | ----------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/`x-www-form-urlencoded` |

{% tabs %}
{% tab title="200: OK " %}

```json
{}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
An empty response body indicates a successful request with no content. This is expected behavior and not an error.
{% endhint %}

{% tabs %}
{% tab title="Curl" %}

```http
curl --location --request POST 'https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=api' \
--data-urlencode 'session_identifier=8xrswiUV6So' \
--data-urlencode 'client_secret=enESfot4PPpSWxTa74vR8D9nrW4UTtT3'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill"

payload='client_id=api&session_identifier=8xrswiUV6So&client_secret=enESfot4PPpSWxTa74vR8D9nrW4UTtT3'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'client_id': 'api',
  'session_identifier': '8xrswiUV6So',
  'client_secret': 'enESfot4PPpSWxTa74vR8D9nrW4UTtT3' 
});
var config = {
  method: 'post',
  url: 'https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill',
  headers: { 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "client_id=api&session_identifier=8xrswiUV6So&client_secret=enESfot4PPpSWxTa74vR8D9nrW4UTtT3");
Request request = new Request.Builder()
  .url("https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new RestClient("https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("client_id", "api");
request.AddParameter("session_identifier", "8xrswiUV6So");
request.AddParameter("client_secret", "enESfot4PPpSWxTa74vR8D9nrW4UTtT3");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://{environment-url}/auth/realms/{partner-id}/protocol/api/auth/kill',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'client_id=api&session_identifier=8xrswiUV6So&client_secret=enESfot4PPpSWxTa74vR8D9nrW4UTtT3',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}
{% endtabs %}

### Success Response

```json
{}
```

**Response Schema**

```json
{}
```

{% hint style="info" %}
An empty response body indicates a successful request with no content. This is expected behavior and not an error.
{% endhint %}

### Error Response

```json
{
    "error": "invalid_request",
    "errorDescription": "Invalid session identifier"
}
```

Response Schema

```json
{
    "error": "{TYPE OF ERROR}",
    "errorDescription": "{REASONING FOR THE ERROR}"
}
```
