Skip to content
Hydda One API
Esc
↑↓navigate↵open⌘Jpreview

Report up to 200 invoices that could not be sent

Report several approved invoices failed in one request. Each item is the report-failed body plus invoiceId, and an invoice appears at most once. Each item is handled on its own, in the order sent, exactly as the single route handles it. A refused item changes nothing for the others, and its result carries the status and problem the single route answers, with the same code. The request itself answers 200 unless the token, the integration configuration or the body is refused, which happens before any item is handled. On a 429, wait as long as Retry-After says, then send the same batch again.

POST/v1/billing/batch/report-failed
Authorization
AuthorizationOAuth2 access token · headerrequired

An 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>.

Request body
requiredapplication/json
itemsobject[]required

From 1 to 200 items. They are handled in this order.

min items 1 · max items 200
Show properties
Array of object
reasonstringrequired

The reason in your own words, 1 to 1000 characters.

min length 1 · max length 1000
invoiceIdstring<uuid>required

The id of the invoice this item reports on.

Responses
200

One result per item, in the order sent.

resultsobject[]required

One result per item, in the order the items were sent.

Show properties
Array of object
Any of:
object
statusnumberrequired

Always 200: the item was handled.

Allowed:200
resultInvoicerequired

An invoice or a credit note. Amounts are in minor units of currency.

Show properties
idstring<uuid>required

The invoice id. Report outcomes against it.

invoiceRunIdstring<uuid>required

The invoice run that created the invoice.

organizationIdstring<uuid>required

The organization the invoice belongs to.

operationalContextIdstring<uuid>required

The operational context the invoice was created in.

contractIdstring<uuid>required

The contract the invoice bills.

recipientAgentIdstring<uuid>required

The customer the invoice bills.

recipientAgentNamestringrequired

The customer's name as written on the invoice.

billingAccountIdstring<uuid>required

The billing account the invoice is sent to.

documentKindstringrequired

Whether the document is an invoice or a credit note. A credit note names the invoice it credits.

Allowed:invoicecredit-note
creditedInvoiceIdstring<uuid>

On a credit note, the invoice it credits. Absent on an invoice.

billingStreamstringrequired

Where the charges come from: contractual for the contract's own products, running for purchases beside it, such as bookings.

Allowed:contractualrunning
requestedInvoiceDatestring<date>required

The 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.

paymentTermsDaysinteger

The payment terms in days that give the requested due date. Absent on a credit note.

min 0 · max 9007199254740991
invoiceNumberintegerrequired

Hydda One's own number for the invoice. The legal number is issuedInvoiceNumber.

max 9007199254740991
statusstringrequired

Where 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.

Allowed:createdapprovedsentpaidwritten-offfailed
currencystringrequired

An ISO 4217 currency code, for example SEK.

Allowed:SEKNOKDKKEURUSDGBP
totalNetMinorUnitsintegerrequired

The total excluding VAT, in minor units. Negative on a credit note.

min -9007199254740991 · max 9007199254740991
totalVatMinorUnitsintegerrequired

The total VAT, in minor units.

min -9007199254740991 · max 9007199254740991
totalGrossMinorUnitsintegerrequired

The total including VAT as Hydda One computed it, in minor units.

min -9007199254740991 · max 9007199254740991
externalReferencestring

Your own id for the invoice. Absent until you attach one, by passing its proposal or reporting it sent.

issuedInvoiceNumberstring

The 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.

issuedTotalGrossMinorUnitsinteger

The total including VAT your ERP issued, in minor units. Payments are measured against it. Absent until reported sent.

min -9007199254740991 · max 9007199254740991
paymentReferencestring

The reference the payer quotes, as reported with the send.

paymentReferenceTypestring

The system the payment reference belongs to: ocr for a Swedish OCR number, kid for a Norwegian KID number, reference for a free reference.

Allowed:ocrkidreference
documentUrlstring

The link to the issued document, as reported with the send.

balanceMinorUnitsinteger

What is left to pay, in minor units: the issued total less payments and write-offs. Below zero after an overpayment. Absent until reported sent.

min -9007199254740991 · max 9007199254740991
overduebooleanrequired

True 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.

failureReasonstring

Why sending failed, as it was reported.

createdAtstring<date-time>required

When the invoice was created, as an ISO 8601 timestamp in UTC.

updatedAtstring<date-time>required

When the invoice last changed, as an ISO 8601 timestamp in UTC.

object
statusintegerrequired

The HTTP status the single route answers this refusal with, such as 400, 403, 404 or 409. 500 when the item failed unexpectedly.

min 400 · max 599
problemProblemrequired

An RFC 9457 problem details body. Every failed request returns one.

Show properties
typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request. Match on this, not on detail.

parametersobject

Values 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.

400

The request is not valid, or a business rule refused it. code names the rule.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request, when the failure has one. Match on this, not on detail.

Allowed:VALIDATION_FAILEDBILLING_INTEGRATION_NOT_CONFIGURED
parametersobject

Values 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.

401

The access token is missing, expired or not valid.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request. Match on this, not on detail.

parametersobject

Values 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.

403

The token does not allow this request.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request. Match on this, not on detail.

parametersobject

Values 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.

429

Too many requests. Wait and try again.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request, when the failure has one. Match on this, not on detail.

Allowed:BILLING_BATCH_THROTTLED
parametersobject

Values 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.

Request
curl -X POST 'https://api.hydda.one/v1/billing/batch/report-failed' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "items": [
    {
      "reason": "string",
      "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec"
    }
  ]
}'
Response
{
  "results": [
    {
      "status": 200,
      "result": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "invoiceRunId": "d023feec-6ce3-4d83-8326-53006f2d50e7",
        "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
        "operationalContextId": "a3f64ce2-1602-4028-b89f-abb2bb8c71bc",
        "contractId": "dbf32426-cf38-4818-9c6e-3230d889fa51",
        "recipientAgentId": "9857c18a-555f-4729-b9ab-629537b29cdc",
        "recipientAgentName": "string",
        "billingAccountId": "56a302e4-9416-417d-adcf-22ac99649ba3",
        "documentKind": "invoice",
        "creditedInvoiceId": "74ebea99-ce39-4315-8d5b-103e18e641e4",
        "billingStream": "contractual",
        "requestedInvoiceDate": "2019-08-24",
        "requestedDueDate": "2019-08-24",
        "paymentTermsDays": 0,
        "invoiceNumber": 1,
        "status": "created",
        "currency": "SEK",
        "totalNetMinorUnits": -9007199254740991,
        "totalVatMinorUnits": -9007199254740991,
        "totalGrossMinorUnits": -9007199254740991,
        "externalReference": "string",
        "issuedInvoiceNumber": "string",
        "issuedInvoiceDate": "2019-08-24",
        "dueDate": "2019-08-24",
        "issuedTotalGrossMinorUnits": -9007199254740991,
        "paymentReference": "string",
        "paymentReferenceType": "ocr",
        "documentUrl": "string",
        "balanceMinorUnits": -9007199254740991,
        "overdue": true,
        "approvedAt": "2019-08-24T14:15:22Z",
        "sentAt": "2019-08-24T14:15:22Z",
        "paidAt": "2019-08-24T14:15:22Z",
        "writtenOffAt": "2019-08-24T14:15:22Z",
        "failedAt": "2019-08-24T14:15:22Z",
        "failureReason": "string",
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z"
      }
    }
  ]
}

Was this page helpful?