> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dintero.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.dintero.com/feedback

```json
{
  "path": "/docs/checkout/kravia/grouped-invoices",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Grouped invoices (B2B) with Kravia

> Consolidate multiple B2B purchases from the same customer into one Kravia invoice per billing period using kravia.invoice_b2b_grouped in Dintero Checkout.

Grouped invoicing consolidates multiple purchases from the same customer into a single invoice per billing period. Instead of receiving an invoice for each transaction, the customer gets one combined invoice at the end of the month or quarter.

## How It Works

```mermaid theme={null}
sequenceDiagram
    participant Customer
    participant Dintero
    participant Kravia

    Customer->>Dintero: Purchase 1 (Jan 5)
    Dintero-->>Merchant: Transaction AUTHORIZED
    Customer->>Dintero: Purchase 2 (Jan 20)
    Dintero-->>Merchant: Transaction AUTHORIZED
    Note over Kravia: Billing period ends (Jan 31)
    Kravia->>Customer: Combined invoice (Feb 1)
    Customer->>Kravia: Pays invoice
    Kravia-->>Dintero: Payment confirmed
    Dintero-->>Merchant: Transactions CAPTURED
```

Each purchase creates its own transaction with status `AUTHORIZED`. At the end of the billing period, Kravia consolidates all `AUTHORIZED` transactions for the same customer into a single invoice. When the shopper pays the consolidated invoice, the underlying transactions move to `CAPTURED` (or `PARTIALLY_CAPTURED` for partial payment). To cancel an unpaid purchase before billing, void the transaction — see [Cancellations](/docs/checkout/kravia/checkout#cancellations).

## Configuration

Enable `invoice_b2b_grouped` and set the billing interval:

```json theme={null}
{
  "configuration": {
    "kravia": {
      "type": "payment_type",
      "invoice_b2b_grouped": {
        "type": "payment_product_type",
        "enabled": true,
        "days_until_due": 14,
        "invoice_schedule": {
          "interval": "monthly"
        }
      }
    }
  }
}
```

| Option                          | Type            | Default     | Description                                |
| ------------------------------- | --------------- | ----------- | ------------------------------------------ |
| `enabled`                       | Boolean         | `false`     | Enable grouped invoicing                   |
| `days_until_due`                | Integer (0-365) | 14          | Days until the consolidated invoice is due |
| `invoice_schedule.interval`     | String          | `"monthly"` | `"monthly"` or `"quarterly"`               |
| `require_identity_verification` | Boolean         | `true`      | Require BankID verification                |

## Invoice Schedule

Invoices are issued on the first business day after the billing period ends.

**Monthly**, first business day of following month:

| Purchase Date | Invoice Issue Date | Due Date      |
| ------------- | ------------------ | ------------- |
| January 5th   | February 1st       | February 15th |
| January 20th  | February 1st       | February 15th |
| February 15th | March 1st          | March 15th    |

**Quarterly**, first business day of following quarter:

| Purchase Date | Invoice Issue Date | Due Date   |
| ------------- | ------------------ | ---------- |
| January 15th  | April 1st          | April 15th |
| February 20th | April 1st          | April 15th |
| April 10th    | July 1st           | July 15th  |

Quarters: Q1 (Jan-Mar), Q2 (Apr-Jun), Q3 (Jul-Sep), Q4 (Oct-Dec)

If the 1st falls on a weekend, the invoice is issued on the following Monday.

## Customer Grouping

Purchases are consolidated per customer, identified by:

* `business_name`
* `organization_number`
* `country`

All purchases matching the same customer within a billing period are grouped into a single invoice.

The `customer_reference` field on the billing address is a free-text reference for the merchant. For grouped invoices, it also controls grouping: purchases with different `customer_reference` values are invoiced separately, even within the same organization.

```json theme={null}
{
  "billing_address": {
    "first_name": "Ola",
    "last_name": "Nordmann",
    "business_name": "Nordmann AS",
    "organization_number": "123456789",
    "customer_reference": "dept-engineering",
    "email": "ola@nordmann.no",
    "phone_number": "+4799999999",
    "address_line": "Storgata 1",
    "postal_code": "0151",
    "postal_place": "Oslo",
    "country": "NO"
  }
}
```

## Billing Address

Grouped invoices use the same B2B billing address fields as [standard B2B invoices](/docs/checkout/kravia/checkout#billing-address-requirements), plus the optional `customer_reference` for grouping.

## Integration

Grouped invoices work with both integration approaches:

* **[Customer Checkout](/docs/checkout/kravia/checkout)**: use `payment_product_type: "kravia.invoice_b2b_grouped"` in your session configuration
* **[Merchant Initiated](/docs/checkout/kravia/merchant-initiated-payments)**: use `payment_product_type: "kravia.invoice_b2b_grouped"` in the pay request

## See Also

* [Customer Checkout](/docs/checkout/kravia/checkout): configuration options, identity verification, and billing address details
* [Merchant Initiated](/docs/checkout/kravia/merchant-initiated-payments): create and pay invoices without customer interaction
* [Invoice Delivery](/docs/checkout/kravia/invoice-delivery): control who delivers the invoice
