Delete an invoice

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Delete an Invoice

Permanently removes an invoice from your InvestGlass system. This operation cannot be undone.

Endpoint

DELETE /api/v1/invoices/{invoice_id}

Parameters

Path Parameters

ParameterTypeRequiredDescription
invoice_idstringYesThe unique identifier of the invoice to delete

Query Parameters

ParameterTypeRequiredDescription
access_tokenstringYesAccess token generated from your user profile

Request Headers

Authorization: Bearer {access_token}
Accept: application/json

Response

Success Response

Status: 204 No Content

The invoice has been successfully deleted. No response body is returned for successful deletions.

Error Responses

Invoice Not Found

Status: 404 Not Found

{
  "status": 404,
  "title": "Not found",
  "message": "The invoice resource cannot be found"
}

Unauthorized

Status: 401 Unauthorized

{
  "message": "The access token is invalid"
}

Forbidden

Status: 403 Forbidden

{
  "status": 403,
  "title": "Not authorized",
  "message": "Access Forbidden"
}

Bad Request

Status: 400 Bad Request

{
  "error": "Invalid invoice ID format"
}

Example Usage

cURL

curl -X DELETE \
  'https://app.investglass.com/api/v1/invoices/12345?access_token=your_access_token' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer your_access_token'

JavaScript

const deleteInvoice = async (invoiceId, accessToken) => {
  try {
    const response = await fetch(`https://app.investglass.com/api/v1/invoices/${invoiceId}`, {
      method: 'DELETE',
      headers: {
        'Authorization': `Bearer ${accessToken}`,
        'Accept': 'application/json'
      },
      params: {
        access_token: accessToken
      }
    });
    
    if (response.status === 204) {
      console.log('Invoice deleted successfully');
    } else {
      throw new Error(`HTTP ${response.status}: ${response.statusText}`);
    }
  } catch (error) {
    console.error('Error deleting invoice:', error);
  }
};

// Usage
deleteInvoice('12345', 'your_access_token');

Python

import requests

def delete_invoice(invoice_id, access_token):
    url = f"https://app.investglass.com/api/v1/invoices/{invoice_id}"
    
    headers = {
        'Authorization': f'Bearer {access_token}',
        'Accept': 'application/json'
    }
    
    params = {
        'access_token': access_token
    }
    
    try:
        response = requests.delete(url, headers=headers, params=params)
        
        if response.status_code == 204:
            print("Invoice deleted successfully")
        else:
            print(f"Error: {response.status_code} - {response.text}")
            
    except requests.exceptions.RequestException as e:
        print(f"Request failed: {e}")

# Usage
delete_invoice('12345', 'your_access_token')

Important Notes

⚠️ Warning: This operation permanently deletes the invoice and cannot be undone. Make sure you have the correct invoice ID before proceeding.

💡 Tip: Consider archiving or marking invoices as inactive instead of deleting them to maintain audit trails.

🔒 Permissions: Only users with appropriate invoice management permissions can delete invoices.

Related Endpoints

Response
200
Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!