updateInvoice — record external Healthcode submission outcomes
Summary
The updateInvoice mutation now accepts an optional healthcode block on UpdateInvoiceDataInput, so integrators who submit claims to Healthcode outside Semble can write submission outcomes back to the invoice.
updateInvoice(invoiceData: { healthcode: … })— record Healthcode submission state on an existing invoice.UpdateInvoiceHealthcodeInput— optionalstatus(String) and/orproviderReference(String).INVOICE_INTEGRATIONS_HEALTHCODE_STATUS_UPDATEDwebhook — fired when Healthcode fields change via this mutation (in addition to the existingINVOICE_UPDATEDwebhook on any invoice update).
Validation rules:
status— optional; when provided, must be one of the Healthcode bill status values Semble stores internally (for exampleUnprocessed,In-process,Validated,Collected).providerReference— optional; maximum 25 characters (same constraint as internal Healthcode submission).- When
healthcodeis present, at least one ofstatusorproviderReferenceis required.
Partial updates merge with any existing Healthcode data on the invoice. updateAttempts is not exposed or modified via the API (reserved for internal status polling). updatedAt is set server-side when Healthcode fields change.
This release is additive: existing updateInvoice calls that only send date, doctorId, locationId, comments, or extraInfo behave as before.
Out of scope for this release: reading Healthcode fields on Invoice via the public API, submitInvoiceToHealthcode, and triggering Healthcode status polling from Healthcode's API.
Integration guidance
- First-time external submission: Call
updateInvoicewithhealthcode.statusand/orhealthcode.providerReferenceon an invoice that has no existing Healthcode object. - Status updates: Send only
healthcode.statusto update status while preserving an existingproviderReference. - Reference updates: Send only
healthcode.providerReferenceto update the sender reference while preserving an existingstatus. - Webhooks: Subscribe to
INVOICE_INTEGRATIONS_HEALTHCODE_STATUS_UPDATEDif you need to react when partner-recorded Healthcode state changes.INVOICE_UPDATEDstill fires for all invoice updates, including Healthcode-only updates. - Validation errors: Invalid status values and
providerReferencelonger than 25 characters returnerrorin the mutation payload (HTTP 400).
Example
mutation UpdateInvoiceHealthcode($invoiceId: ID!) {
updateInvoice(
invoiceId: $invoiceId
invoiceData: {
healthcode: {
status: "Unprocessed"
providerReference: "EXT-REF-001"
}
}
) {
data {
id
invoiceNumber
}
error
}
}
Migration
No breaking schema changes for existing updateInvoice clients. If you submit invoices to Healthcode via your own integration today, you can now record status and providerReference on the Semble invoice instead of tracking outcomes only in your own systems.
See also
- API reference:
updateInvoice - API reference:
UpdateInvoiceDataInput - API reference:
UpdateInvoiceHealthcodeInput