# Update Invoice's Status

`PUT /api/invoices/{id}/action`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Request body: application/json (required)

Type: object

Schema: [UpdateInvoiceActionDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updateinvoiceactiondto/index.md)

- `status` (required)
  Type: string
  
  enum: ["DRAFT","SENT","VIEWED","FULLY_PAID","PARTIALLY_PAID","OVERPAID","VOID","ACCEPTED","REJECTED"]
  
  readOnly: true

- `isEstimate` (required)
  Type: boolean
  
  readOnly: true

- `internalNote` (required)
  Type: string
  
  readOnly: true

- `isArchived` (required)
  Type: boolean
  
  readOnly: true

- `paid` (required)
  Type: boolean
  
  readOnly: true

- `alreadyPaid` (required)
  Type: number
  
  readOnly: true

- `amountDue` (required)
  Type: number
  
  readOnly: true

- `sentTo` (required)
  Type: string
  
  readOnly: true

Responses:

- 201: The record has been successfully edited.

- 400: Invalid input, The response body may contain clues as to what went wrong

- 401: Unauthorized

- 403: Forbidden

- 404: Record not found

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/invoices/%7Bid%7D/action' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
```

### JavaScript

```javascript
const response = await fetch('http://localhost:3000/api/invoices/%7Bid%7D/action', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body: '{}',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.put(
    'http://localhost:3000/api/invoices/%7Bid%7D/action',
    data='{}'.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
