Report an invoice sent
Call this once your ERP has issued an invoice from the send queue. Send your own id for it and what your ERP issued: the legal number, the dates and the total. Reporting the same invoice again with the same reference and the same issued facts changes nothing and answers the invoice as it is. A 409 means the invoice already carries a different external reference, or the same reference was reported with other issued facts. An invoice that was never approved, or that failed, is refused with 400. To report many invoices in one request, use POST /v1/billing/batch/report-sent.
/v1/billing/invoices/{invoiceId}/report-sentAuthorizationOAuth2 access token · headerrequiredAn access token for an Application, from the client_credentials grant. An integration of your own uses the same grant. A connector from Hydda gets its token from the installation-token grant instead. Send it as Authorization: Bearer <token>.
invoiceIdstring<uuid>requiredThe id of the invoice, from the send queue or an earlier report.
application/jsonexternalReferencestringrequiredYour own id for the invoice in your system, 1 to 200 characters and unique in the organization. Payments can be reported by it in place of Hydda One's id.
issuedInvoiceNumberstringrequiredThe legal invoice number your ERP gave the document, 1 to 64 characters. Hydda One's own invoiceNumber is internal.
issuedInvoiceDatestring<date>requiredThe date the invoice was issued, as an ISO date (YYYY-MM-DD).
dueDatestring<date>requiredThe date payment is due, as an ISO date. Overdue is judged against it.
issuedTotalGrossMinorUnitsintegerrequiredThe total including VAT that your ERP issued, in minor units. It may differ from Hydda One's total by rounding. Payments are measured against it.
paymentReferencestringThe reference the payer quotes, such as an OCR number. Send it with paymentReferenceType, or leave both out.
paymentReferenceTypestringThe system the payment reference belongs to: ocr for a Swedish OCR number, kid for a Norwegian KID number, reference for a free reference.
ocrkidreferencedocumentUrlstring<uri>An https link where the issued document can be fetched, at most 2000 characters.
The invoice, now sent or settled since.
idstring<uuid>requiredThe invoice id. Report outcomes against it.
invoiceRunIdstring<uuid>requiredThe invoice run that created the invoice.
organizationIdstring<uuid>requiredThe organization the invoice belongs to.
operationalContextIdstring<uuid>requiredThe operational context the invoice was created in.
contractIdstring<uuid>requiredThe contract the invoice bills.
recipientAgentIdstring<uuid>requiredThe customer the invoice bills.
recipientAgentNamestringrequiredThe customer's name as written on the invoice.
billingAccountIdstring<uuid>requiredThe billing account the invoice is sent to.
documentKindstringrequiredWhether the document is an invoice or a credit note. A credit note names the invoice it credits.
invoicecredit-notecreditedInvoiceIdstring<uuid>On a credit note, the invoice it credits. Absent on an invoice.
billingStreamstringrequiredWhere the charges come from: contractual for the contract's own products, running for purchases beside it, such as bookings.
contractualrunningrequestedInvoiceDatestring<date>requiredThe invoice date to issue with, as an ISO date (YYYY-MM-DD).
requestedDueDatestring<date>The due date to issue with, as an ISO date. Absent on a credit note.
paymentTermsDaysintegerThe payment terms in days that give the requested due date. Absent on a credit note.
invoiceNumberintegerrequiredHydda One's own number for the invoice. The legal number is issuedInvoiceNumber.
statusstringrequiredWhere the invoice is in its life. failed is reached only by a failure report, and written-off is settled like paid with at least one write-off.
createdapprovedsentpaidwritten-offfailedcurrencystringrequiredAn ISO 4217 currency code, for example SEK.
SEKNOKDKKEURUSDGBPtotalNetMinorUnitsintegerrequiredThe total excluding VAT, in minor units. Negative on a credit note.
totalVatMinorUnitsintegerrequiredThe total VAT, in minor units.
totalGrossMinorUnitsintegerrequiredThe total including VAT as Hydda One computed it, in minor units.
externalReferencestringYour own id for the invoice. Absent until you attach one, by passing its proposal or reporting it sent.
issuedInvoiceNumberstringThe legal invoice number your ERP issued. Absent until the invoice is reported sent.
issuedInvoiceDatestring<date>The date your ERP issued the invoice, as an ISO date. Absent until reported sent.
dueDatestring<date>The due date the invoice was issued with, as an ISO date. Absent until reported sent.
issuedTotalGrossMinorUnitsintegerThe total including VAT your ERP issued, in minor units. Payments are measured against it. Absent until reported sent.
paymentReferencestringThe reference the payer quotes, as reported with the send.
paymentReferenceTypestringThe system the payment reference belongs to: ocr for a Swedish OCR number, kid for a Norwegian KID number, reference for a free reference.
ocrkidreferencedocumentUrlstringThe link to the issued document, as reported with the send.
balanceMinorUnitsintegerWhat is left to pay, in minor units: the issued total less payments and write-offs. Below zero after an overpayment. Absent until reported sent.
overduebooleanrequiredTrue when the invoice is sent and its due date has passed.
approvedAtstring<date-time>When the invoice was approved, as an ISO 8601 timestamp in UTC.
sentAtstring<date-time>When the invoice was reported sent, as an ISO 8601 timestamp in UTC.
paidAtstring<date-time>When the invoice was settled as paid, as an ISO 8601 timestamp in UTC.
writtenOffAtstring<date-time>When the invoice was settled as written off, as an ISO 8601 timestamp in UTC.
failedAtstring<date-time>When the invoice was reported failed, as an ISO 8601 timestamp in UTC.
failureReasonstringWhy sending failed, as it was reported.
createdAtstring<date-time>requiredWhen the invoice was created, as an ISO 8601 timestamp in UTC.
updatedAtstring<date-time>requiredWhen the invoice last changed, as an ISO 8601 timestamp in UTC.
The request is not valid, or a business rule refused it. code names the rule.
typestringrequiredAlways about:blank.
titlestringrequiredThe HTTP status phrase, for example Not Found.
statusintegerrequiredThe HTTP status code.
detailstringWhat went wrong, for a person to read. Do not parse it.
codestringNames the rule that refused the request, when the failure has one. Match on this, not on detail.
VALIDATION_FAILEDBILLING_INTEGRATION_NOT_CONFIGUREDBILLING_INVOICE_STATUS_INVALIDparametersobjectValues the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.
issuesobject[]With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.
The access token is missing, expired or not valid.
typestringrequiredAlways about:blank.
titlestringrequiredThe HTTP status phrase, for example Not Found.
statusintegerrequiredThe HTTP status code.
detailstringWhat went wrong, for a person to read. Do not parse it.
codestringNames the rule that refused the request. Match on this, not on detail.
parametersobjectValues the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.
issuesobject[]With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.
The token does not allow this request.
typestringrequiredAlways about:blank.
titlestringrequiredThe HTTP status phrase, for example Not Found.
statusintegerrequiredThe HTTP status code.
detailstringWhat went wrong, for a person to read. Do not parse it.
codestringNames the rule that refused the request. Match on this, not on detail.
parametersobjectValues the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.
issuesobject[]With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.
The resource does not exist, or the token cannot see it.
typestringrequiredAlways about:blank.
titlestringrequiredThe HTTP status phrase, for example Not Found.
statusintegerrequiredThe HTTP status code.
detailstringWhat went wrong, for a person to read. Do not parse it.
codestringNames the rule that refused the request. Match on this, not on detail.
parametersobjectValues the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.
issuesobject[]With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.
The request conflicts with the current state of the resource.
typestringrequiredAlways about:blank.
titlestringrequiredThe HTTP status phrase, for example Not Found.
statusintegerrequiredThe HTTP status code.
detailstringWhat went wrong, for a person to read. Do not parse it.
codestringNames the rule that refused the request, when the failure has one. Match on this, not on detail.
BILLING_EXTERNAL_REFERENCE_ALREADY_USEDBILLING_SENT_REPLAY_MISMATCHparametersobjectValues the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.
issuesobject[]With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.