# TaxSessionsPublicController_GenerateReturn

Generates the tax return for the specified tax session.

`PUT /api/v1/TaxSessions/GenerateReturn`

**API:** Excise Platform API
**Tag:** Tax Sessions
**API Version:** v1
**Base URL:** https://excise.avalara.com
**Accepts:** `application/json`
**Authentication:** Basic (username + license key)

Source: https://developer.avalara.com/products/excise/api/methods/Tax%20Sessions/TaxSessionsPublicController_GenerateReturn/

## Description

Triggers return calculation and generation for the tax session identified by HeaderId and
Sequence. This process updates return totals, validation status, and related output metadata.
Return generation is not permitted if the tax session is locked. If the tax session is filed,
re-generating creates a new PDF document but does not re-calculate the return.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `x-company-id` | integer | header | Yes | Company ID that owns the data. |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API. For more information on the client header, see Client Headers. |
| `headerId` | integer | query | Yes | The header id of the specified tax session. |
| `sequence` | integer | query | No | The sequence of the specified tax session (Default: 0). |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Return generation completed successfully. |  |
| 400 | The HeaderId/Sequence is invalid, not associated with the specified company, the session is locked, or generation failed. |  |
| 401 | Authentication credentials are incorrect. |  |

## Example Request

```bash
curl -X PUT "https://excise.avalara.com/api/v1/TaxSessions/GenerateReturn" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```