API Content Types
Content Types
API requests and responses follow strict content type requirements to ensure proper processing. All integrations must use the correct HTTP headers and data formats outlined below.
Requests
All requests should set the HTTP header:
Content-Type: application/json
Key requirements for requests:
- Body must contain a JSON object for POST methods.
- For GET requests, parameters are passed as standard query string values.
- When uploading files (for example, through SendInvoiceDocuments or SendCSV), binary file data must be base64‑encoded and included in the JSON payload.
Responses
All responses will set the HTTP header:
Content-Type: application/json
Response behavior:
- Response bodies contain JSON objects or JSON arrays, depending on the endpoint.
- When an error occurs, the response includes a top‑level
errorsarray with one or more error messages. - Some POST methods that accept input but do not return content may respond with HTTP 204 (No Content).
Files
Some API endpoints transmit file data (for example, invoice PDFs or claim attachments).
File handling behavior:
- Any PDF, image, or raw file data must be transferred as base64‑encoded text.
- The API consumer must decode the base64 string locally to restore the original file.
- File metadata, such as filename, is provided in fields like FileName.