Skip to main content
POST
/
api
/
v1
/
invoices
/
documents
/
contracts
/
invoices
/
batch_invoicing
Generate invoices for multiple contracts
curl --request POST \
  --url https://api.hevn.finance/api/v1/invoices/documents/contracts/invoices/batch_invoicing \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "items": [
      {}
    ],
    "period": 1,
    "memo": "<string>",
    "finalize": false
  }
]
'
{
  "results": [
    {
      "contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": "<string>",
      "counterpartyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "periodNumber": 123,
      "invoice": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "amount": "<string>",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "onchainTransactionId": "<string>",
        "transaction": {
          "onchainTransactionId": "<string>",
          "amount": 123,
          "txHash": "<string>",
          "type": "<string>",
          "createdAt": "2023-11-07T05:31:56Z"
        },
        "discount": "<string>",
        "comment": "<string>",
        "emailMessage": "<string>",
        "invoiceNumber": "<string>",
        "periodNumber": 123,
        "issuedDate": "2023-12-25",
        "dueDate": "2023-12-25",
        "items": [
          {}
        ],
        "paymentMethods": [
          {
            "bankName": "<string>",
            "ibanNumber": "<string>",
            "beneficiaryName": "<string>",
            "bankAddress": "<string>",
            "currency": "<string>",
            "accountHolderFirstName": "<string>",
            "accountHolderLastName": "<string>",
            "accountHolderBusinessName": "<string>",
            "accountHolderAddress": {
              "streetAddress": "<string>",
              "addressLine2": "<string>",
              "city": "<string>",
              "state": "<string>",
              "zip": "<string>"
            },
            "paymentReference": "<string>",
            "accountType": "sepa",
            "bic": "<string>"
          }
        ],
        "client": {
          "email": "<string>",
          "displayName": "<string>",
          "address": {
            "streetAddress": "<string>",
            "addressLine2": "<string>",
            "city": "<string>",
            "state": "<string>",
            "zip": "<string>"
          }
        },
        "contractor": {
          "email": "<string>",
          "displayName": "<string>",
          "address": {
            "streetAddress": "<string>",
            "addressLine2": "<string>",
            "city": "<string>",
            "state": "<string>",
            "zip": "<string>"
          }
        },
        "contract": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "isRecurring": true,
          "period": "<string>",
          "activationAt": "2023-11-07T05:31:56Z",
          "expirationAt": "2023-11-07T05:31:56Z"
        },
        "invoiceLink": "<string>",
        "documents": [
          {
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "name": "<string>",
            "key": "<string>"
          }
        ],
        "paidAt": "2023-11-07T05:31:56Z"
      },
      "detail": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
default:Bearer <token>
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-key
string | null

Body

application/json
Minimum array length: 1
contractId
string<uuid>
required
items
Items · object[]
required
Minimum array length: 1
period
integer
required
Required range: x >= 0
memo
string | null
finalize
boolean
default:false

Response

Successful Response

results
BatchInvoiceResult · object[]