# BulkLockTransaction

Lock a set of documents

`POST /api/v2/transactions/lock`

**API:** AvaTax API
**Tag:** Transactions
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Transactions/BulkLockTransaction/

## Description

This API is available by invitation only.
            
Lock a set of transactions uniquely identified by DocumentIds provided. This API allows locking multiple documents at once.
After this API call succeeds, documents will be locked and can't be voided.
            
A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
sales, purchases, inventory transfer, and returns (also called refunds).

### Security Policies

* This API requires the user role Compliance Root User.
* This API depends on the following active services:*Returns* (at least one of):  Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm):  ARA, ARAManaged.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `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](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `BulkLockTransactionModel`

Bulk lock documents model

| Property | Type | Required | Description |
|---|---|---|---|
| `documentIds` | integer[] | **Yes** | List of documents to lock |
| `isLocked` | boolean | **Yes** | The lock status to set for the documents designated in this API Example: `true`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `BulkLockTransactionResult` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |

### 200 Response: `BulkLockTransactionResult`

Returns information about transactions that were locked

| Property | Type | Required | Description |
|---|---|---|---|
| `numberOfRecords` | integer | No | Number of records that have been modified |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/transactions/lock" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "documentIds": [
    1,
    2,
    3,
    4,
    5
  ],
  "isLocked": true
}'
```