> This page is for Web API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://ibkrcampus.com/docs/llms.txt.

# Create Tax Voucher Requests

POST https://localhost:5000/gw/api/v1/tax-vouchers
Content-Type: text/plain

Creates tax voucher requests from a signed JWT payload. The request body must be a signed OAuth2 JWT (text/plain) whose decoded payload contains the list of tax voucher requests.**Scope**: `tax-vouchers.write`**Security Policy**: `Signed JWT`

Reference: https://ibkrcampus.com/docs/web-api/api-reference/third-parties/third-parties-tax-vouchers/create-tax-voucher-requests

## Authentication

- `Authorization` header (bearer token, required) — RS256-signed JWT access token signed with your registered private key.

## Servers

- `https://localhost:5000` (Client Portal Gateway, default)
- `https://api.ibkr.com` (Production)
- `https://qa.interactivebrokers.com` (Sandbox)

## Request

### Headers

- `X-Request-ID` (string, optional) — Unique identifier for each HTTP request for tracing and debugging purposes

### Body (text/plain)

This endpoint expects a string.

- `string`

## Response

### 200

Tax voucher requests created successfully

- `list of TaxVoucherDTO`

## Errors

### 400 Bad Request Error

Invalid request body

- `status` (long, optional)
- `error` (string, optional)
- `message` (string, optional)

### 401 Unauthorized Error

OAuth2 JWT verification failed

- `status` (long, optional)
- `error` (string, optional)
- `message` (string, optional)

### 500 Internal Server Error

Internal server error

- `status` (long, optional)
- `error` (string, optional)
- `message` (string, optional)

## Types

### TaxVoucherDTO

- `requestId` (string, optional)
- `custAcctId` (string, optional)
- `corpactionId` (string, optional)
- `requestState` (string, optional)
- `fee` (double, optional)
- `divAmount` (double, optional)
- `withHeldAmount` (double, optional)
- `quantity` (double, optional)
- `countryCode` (string, optional)
- `year` (long, optional)
- `migratedCustAcctId` (string, optional)

## Examples

**Request**

```json
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI"
```

**Response**

```json
[
  {
    "requestId": "65f61b61-47b9-461a-ab61-21b61b61b616",
    "custAcctId": "CNC123456",
    "corpactionId": "CORP20240401",
    "requestState": "Processed",
    "fee": 12.5,
    "divAmount": 150.75,
    "withHeldAmount": 15.08,
    "quantity": 100,
    "countryCode": "US",
    "year": 2023,
    "migratedCustAcctId": "MIGR789012"
  }
]
```

**SDK Code**

```python
import requests

url = "https://localhost:5000/gw/api/v1/tax-vouchers"

payload = "\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI\""
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "text/plain"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://localhost:5000/gw/api/v1/tax-vouchers';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/plain'},
  body: '"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI"'
};

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

```go
package main

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

func main() {

	url := "https://localhost:5000/gw/api/v1/tax-vouchers"

	payload := strings.NewReader("\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI\"")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "text/plain")

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

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

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

}
```

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

url = URI("https://localhost:5000/gw/api/v1/tax-vouchers")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'text/plain'
request.body = "\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI\""

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

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

HttpResponse<String> response = Unirest.post("https://localhost:5000/gw/api/v1/tax-vouchers")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "text/plain")
  .body("\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI\"")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://localhost:5000/gw/api/v1/tax-vouchers', [
  'body' => '"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI"',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'text/plain',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://localhost:5000/gw/api/v1/tax-vouchers");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "text/plain");
request.AddParameter("text/plain", "\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "text/plain"
]

let postData = NSData(data: ""eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YXhWb3VjaGVyUmVxdWVzdHMiOlt7InJlcXVlc3RJZCI6IjY1ZjYxYjYxLTQ3YjktNDYxYS1hYjYxLTIxYjYxYjYxYjYxNiIsImN1c3RBY2N0SWQiOiJDTkMxMjM0NTYiLCJjb3JwYWN0aW9uSWQiOiJDUk9QMTI"".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://localhost:5000/gw/api/v1/tax-vouchers")! 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()
```