> For a complete page index, fetch https://docs.transak.com/llms.txt

# Simulate VBA Transaction

POST https://api-gateway-stg.transak.com/api/v2/simulate
Content-Type: application/json

Simulate an incoming bank transfer transaction for Virtual Account Payments in Sandbox Environment.

Reference: https://docs.transak.com/api/whitelabel/virtual-account-payments/simulate-virtual-bank-account-transaction

## Request

### Query parameters

- `type` (string, required) — Type of transaction to simulate. Supported value - `bank_transfer`.

### Headers

- `x-user-ip` (string, required) — End user's originating IP. More details [here](/guides/mandatory-security-changes#user-ip-header-in-apis)
- `x-api-key` (string, required) — Your Partner API key. You can find this in the [Partner Dashboard](https://docs.transak.com/guides/how-to-create-partner-dashboard-account#open-the-developers-section).
- `authorization` (string, optional) — Authorization token is the accessToken received from the API - `api/v2/auth/verify` Note: This is not applicable for [Auth Reliance Flows](/features/auth-reliance)
- `x-user-identifier` (string, optional) — Your authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance)
- `x-access-token` (string, optional) — Your Partner Access Token. Please refer [here](/guides/how-to-create-partner-access-token) for a tutorial on generating your access token. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance)

### Body (application/json)

- `amount` (double, required) — Transaction amount to simulate. Supported range - '0 to 50'
- `paymentMethod` (string, required) — Payment method identifier.
- `source` (object, required)
  - `bankReference` (string, required) — Bank reference used to identify the sender.
  - `senderName` (string, optional) — Sender's name
- `destination` (object, required)
  - `bankAccountIdentifier` (string, required) — Destination bank account identifier.

## Response

### 200

- `data` (object, optional)
  - `success` (boolean, optional)

## Examples

**Request**

```json
{
  "amount": 14,
  "paymentMethod": "gbp_bank_transfer",
  "source": {
    "bankReference": ""
  },
  "destination": {
    "bankAccountIdentifier": ""
  }
}
```

**Response**

```json
{
  "data": {
    "success": true
  }
}
```

**SDK Code**

```python Success
import requests

url = "https://api-gateway-stg.transak.com/api/v2/simulate"

querystring = {"type":"bank_transfer"}

payload = {
    "amount": 14,
    "paymentMethod": "gbp_bank_transfer",
    "source": { "bankReference": "" },
    "destination": { "bankAccountIdentifier": "" }
}
headers = {
    "x-api-key": "",
    "x-user-ip": "",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript Success
const url = 'https://api-gateway-stg.transak.com/api/v2/simulate?type=bank_transfer';
const options = {
  method: 'POST',
  headers: {'x-api-key': '', 'x-user-ip': '', 'Content-Type': 'application/json'},
  body: '{"amount":14,"paymentMethod":"gbp_bank_transfer","source":{"bankReference":""},"destination":{"bankAccountIdentifier":""}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Success
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway-stg.transak.com/api/v2/simulate?type=bank_transfer"

	payload := strings.NewReader("{\n  \"amount\": 14,\n  \"paymentMethod\": \"gbp_bank_transfer\",\n  \"source\": {\n    \"bankReference\": \"\"\n  },\n  \"destination\": {\n    \"bankAccountIdentifier\": \"\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "")
	req.Header.Add("x-user-ip", "")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Success
require 'uri'
require 'net/http'

url = URI("https://api-gateway-stg.transak.com/api/v2/simulate?type=bank_transfer")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = ''
request["x-user-ip"] = ''
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": 14,\n  \"paymentMethod\": \"gbp_bank_transfer\",\n  \"source\": {\n    \"bankReference\": \"\"\n  },\n  \"destination\": {\n    \"bankAccountIdentifier\": \"\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/simulate?type=bank_transfer")
  .header("x-api-key", "")
  .header("x-user-ip", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 14,\n  \"paymentMethod\": \"gbp_bank_transfer\",\n  \"source\": {\n    \"bankReference\": \"\"\n  },\n  \"destination\": {\n    \"bankAccountIdentifier\": \"\"\n  }\n}")
  .asString();
```

```php Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-gateway-stg.transak.com/api/v2/simulate?type=bank_transfer', [
  'body' => '{
  "amount": 14,
  "paymentMethod": "gbp_bank_transfer",
  "source": {
    "bankReference": ""
  },
  "destination": {
    "bankAccountIdentifier": ""
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '',
    'x-user-ip' => '',
  ],
]);

echo $response->getBody();
```

```csharp Success
using RestSharp;

var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/simulate?type=bank_transfer");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "");
request.AddHeader("x-user-ip", "");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 14,\n  \"paymentMethod\": \"gbp_bank_transfer\",\n  \"source\": {\n    \"bankReference\": \"\"\n  },\n  \"destination\": {\n    \"bankAccountIdentifier\": \"\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Success
import Foundation

let headers = [
  "x-api-key": "",
  "x-user-ip": "",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 14,
  "paymentMethod": "gbp_bank_transfer",
  "source": ["bankReference": ""],
  "destination": ["bankAccountIdentifier": ""]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/simulate?type=bank_transfer")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```