API Bugs / Troubleshooting
Bugs / Troubleshooting
This section outlines how to diagnose and handle issues that may occur during API integration or ongoing data exchanges with Invision. Use these guidelines when unexpected results, errors, or malformed responses occur.
HTTP Status Codes
API requests may return:
- HTTP 400‑range errors for malformed requests or invalid parameters
- HTTP 500‑range errors for server‑side issues
- HTTP 204 (No Content) for successful requests that intentionally return no data
Always inspect the HTTP status code first to determine initial success or failure of the request.
Error Messages in JSON Responses
If a request completes but issues occur while processing:
- The API response includes a top‑level
errorsarray - Each entry contains a human‑readable description of the issue
- These messages should be logged and reviewed during troubleshooting
Common Problem Sources
Typical causes of failed or unexpected responses include:
- Missing required fields
- Incorrect Company identifier
- invalid invoice status transitions
- Incorrect or malformed date values
- Incorrect field names or unexpected JSON structure
- Missing or malformed base64 file data for file‑handling endpoints
- Mismatched invoice types (Normal vs. Supplement)
- API credentials expired or not enabled in the target environment
- Required mapping not completed in Invision (rules, carriers, users, etc.)
File‑Related Issues
When working with file‑based endpoints (GetInvoicePDF, GetInvoiceDocuments, SendCSV, SendInvoiceDocuments):
- Ensure the file is fully base64‑encoded
- Verify that the encoded string is placed inside the correct field
- Make sure the receiving system decodes the base64 value correctly
- Confirm that uploaded documents are not corrupted after decoding
- Ensure filenames include valid extensions and characters
Environment Confusion (Staging vs Production)
Troubleshooting steps:
- Confirm you are calling the correct base URL
- Ensure your API credentials match the environment being used
- Verify that the API module is enabled in both staging and production
- Check that the correct Company identifiers exist in the target environment
Debugging Checklist
Use this quick‑reference checklist:
- Validate all required parameters are included
- Confirm field spelling and casing
- Verify date formats match expected patterns
- Ensure base64 file encoding is correct
- Check that user permissions allow the operation (Vendor Admin vs Vendor User)
- Inspect the
errorsarray returned in JSON responses - Log full request and response payloads for debugging
- Use staging environment first to reproduce and isolate issues
Error Handling
Errors can occur during development or in edge‑case scenarios. The API uses standard HTTP response codes as the initial signal of success or failure.
Error Behavior
- A malformed request or system error may generate an HTTP 400‑ or 500‑level response.
- If a request is accepted but an issue occurs during processing, the JSON response will contain a top‑level
errorsarray. - Endpoints that accept input and do not require a response body may return HTTP 204 (No Content) to indicate a successful operation without data.
Common Error Sources
- Missing required parameters
- Incorrect Company identifier
- Invalid status transitions
- Malformed date formats
- Sending data in the wrong encoding (files must be base64)
- Sending unexpected fields or incorrect field names
Contacting Support
If issues persist after internal review, contact:
Provide:
- API method used
- Full request JSON payload (obfuscate sensitive data as needed)
- Full response body
- Timestamp and environment (staging or production)
- Company or Invoice identifiers involved
- Any relevant error messages returned by the API