Skip to content

Create & Book Collection Case

A collection batch (collection case, ID prefix CB.) groups a debtor’s expired invoices into a single errand. A collection profile is the workflow template that drives its stages (notification, claim, monitoring), timing, fees, and distribution. The case is “booked” once its collection-claim ledger event is performed and the claim is distributed to the debtor.

Invoice numbers must be unique per client, so an invoice you create for a collection claim cannot reuse the number of an invoice the client already has. See Invoice numbers and payment references.

  1. Create the collection case. Requires CreateCollectionBatch (or CreateCollectionBatchWithSingleInvoice to start from one invoice). It is created with main status OPEN and ledger status COLLECTION.

    Terminal window
    curl -X POST "https://$HOST/collection-batches" \
    -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
    -d '{
    "clientId": "C.100100",
    "debtorId": "D.100200",
    "currency": "SEK",
    "productCode": "COLLECTION_SERVICE",
    "collectionProfileCode": "STANDARD"
    }'

    Linking the collection profile generates the profile’s ledger events automatically, each scheduled at a planned date - including the COLLECTION_CLAIM event. ledgerStatus defaults to COLLECTION; pass it in the body to override.

  2. (Optional) Set or replace the collection profile if you did not pass one at creation: PUT /collection-batches/$CB_ID/replace-collection-profile (ChangeCollectionProfile).

  3. The collection claim is performed on its planned date. A ledger event is not performed by a single API call; it runs through the reminder pipeline for its reminder date:

    • POST /reminders/generate (GenerateReminders) - builds the reminder + claim document.
    • POST /reminders/authorize (AuthorizeReminders) - authorizes it.
    • POST /reminders/bookkeep (BookkeepReminders) - books it.

    When the COLLECTION_CLAIM event is booked, the case is marked distributed (isDistributed = true), the collection fee is booked as a COLLECTION_BATCH_FEE financial event, and the claim document is queued for distribution to the debtor. This booked-and-distributed state is what “booked” means. In production, reminders can only be booked for the current day.

  4. Track progress with GET /collection-batches/$CB_ID and its financial events; advance the ledger status (WATCH, LEGAL, ENFORCEMENT, …) with PUT /collection-batches/$CB_ID (UpdateCollectionBatch).

Several invoices can share one collection case, so what belongs to the case as a whole is recorded on the case and what belongs to a single invoice stays on the invoice:

  • Collection batch financial events, read with GET /collection-batches/$CB_ID/financial-events (ReadCollectionBatchFinancialEvents). They hold the collection fees and the interest charged on the case, and the part of a payment that settles them. The types are COLLECTION_BATCH_FEE, COLLECTION_BATCH_INTEREST, COLLECTION_BATCH_PAYMENT, COLLECTION_BATCH_LINKED_UNPLACED_PAYMENT, COLLECTION_BATCH_FEE_WRITEOFF and COLLECTION_BATCH_INTEREST_WRITEOFF. A charge has a positive amount and a payment towards it a negative one.
  • Invoice financial events (GET /invoices/events/financial and POST /invoices/events/financial/search). They hold the part of a payment placed on the capital and on the invoice’s own reminder fees and interest.

One payment can therefore produce events in both places. How it is split follows the payment calculation order of the case.