Customer Portal ingestion
The Customer Portal API is the same in v1 and v2. Set PORTAL_HOST to the Customer Portal API domain assigned to your integration.
Authenticate
Your platform receives a Customer Portal API key. Keep it on a trusted server and never ship it in a browser or mobile app.
When the token expires, exchange the API key again. If your platform has an IP allowlist, an exchange from any other address returns 401.
Send records
Each record type has one create-or-update endpoint.
{id} is the record’s id, a UUID, or your own externalId.
Create the merchant first. An invoice names its merchant by id or externalId and is addressed to exactly one of recipientContact or recipientBusiness. To attach documents to an invoice, send multipart/form-data with the invoice JSON in a data field and the files in files.
The record comes back under data.
Retry safely
Send your own externalId on every record. Sending the same externalId again updates that record instead of creating another, so you can retry a JSON request. Without an externalId, a retry can create a duplicate.
externalId deduplicates the invoice, not its files. Every multipart request stores its files as new attachments, so resending the same files adds them again. Invoice reads do not list attachments, so you cannot check for them through this API. Send field updates as JSON, and resend files only when you know the earlier upload did not succeed.
Errors
Errors carry a JSON body with an error message. Validation failures add a details array. Branch on the HTTP status, not on the message.