> ## 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/checkout",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# Customer checkout with Kravia

> Offer Kravia invoice payments in Dintero Checkout — collect billing details, run identity verification, and let Kravia deliver and collect the invoice.

Use this flow when customers select invoice payment during checkout. The customer provides their billing details, completes identity verification if required, and invoice delivery and collection are handled automatically.

## How It Works

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

    Customer->>Dintero: Selects Kravia invoice
    Dintero->>Customer: Collects billing address

    alt Identity verification required
        Dintero->>Customer: Redirect to BankID
        Customer->>Dintero: Completes verification
    end

    Dintero->>Kravia: Create invoice
    Kravia-->>Dintero: Invoice created + PDF URL
    Dintero-->>Merchant: Transaction AUTHORIZED + kravia:invoice_url
    Note over Dintero: INITIATE_CAPTURE event added<br/>(Kravia begins delivery)
    Kravia->>Customer: Delivers invoice
    Customer->>Kravia: Pays invoice
    Kravia-->>Dintero: Payment confirmed
    Dintero-->>Merchant: Transaction CAPTURED
    Note over Dintero: settlement_status updates to SETTLED<br/>when funds reach merchant
```

## Step-by-Step Implementation

### 1. Configure Payment Types

Enable the payment types you need in your payment profile or session configuration:

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

### 2. Create Checkout Session

```http theme={null}
POST /v1/sessions-profile
Authorization: Bearer <token>
Content-Type: application/json

{
  "url": {
    "return_url": "https://example.com/accept",
    "callback_url": "https://example.com/callback"
  },
  "order": {
    "amount": 50000,
    "currency": "NOK",
    "vat_amount": 10000,
    "merchant_reference": "order-123",
    "items": [
      {
        "amount": 50000,
        "quantity": 1,
        "line_id": "1",
        "description": "Consulting services",
        "vat": 25,
        "id": "item-1"
      }
    ]
  },
  "configuration": {
    "kravia": {
      "type": "payment_type",
      "invoice_b2b": {
        "type": "payment_product_type",
        "enabled": true,
        "days_until_due": 14
      }
    }
  }
}
```

### 3. Customer Completes Checkout

The customer:

1. Selects "Invoice" as payment method
2. Enters billing address (see [Billing Address Requirements](#billing-address-requirements))
3. Completes BankID verification (if required)
4. Invoice is created and Kravia begins delivery to the customer

### 4. Receive Transaction

After invoice creation, you receive a transaction with status `AUTHORIZED`. An `INITIATE_CAPTURE` event is added automatically to mark the start of Kravia's delivery and collection. The status remains `AUTHORIZED` until the shopper pays the invoice.

```json theme={null}
{
  "id": "T12345",
  "status": "AUTHORIZED",
  "payment_product_type": "kravia.invoice_b2b",
  "metadata": {
    "kravia:invoice_number": "A1B2C-000001",
    "kravia:invoice_url": "https://checkout.dintero.com/transaction-attachments/..."
  },
  "events": [
    {
      "event": "AUTHORIZE",
      "metadata": {
        "kravia:invoice_date": "2026-01-15",
        "kravia:invoice_due_date": "2026-01-29",
        "kravia:invoice_number": "A1B2C-000001",
        "kravia:creditor_id": "12345",
        "kravia:debtor_id": "67890",
        "kravia:invoice_id": "98765",
        "kravia:case_number": "CASE-001"
      }
    },
    {
      "event": "INITIATE_CAPTURE"
    }
  ]
}
```

When Kravia confirms the shopper has paid, the transaction transitions to `CAPTURED` (or `PARTIALLY_CAPTURED` for partial payment) and a `CAPTURE` event is appended. See [Transaction management](/docs/checkout/transaction-management) for the shared lifecycle and event model.

<Info>
  The `kravia:invoice_url` is available for your reference. You can download the PDF for your records. Delivery to the customer is handled automatically.
</Info>

## Configuration Options

| Option                          | Applies To  | Type            | Default     | Description                                                                                                     |
| ------------------------------- | ----------- | --------------- | ----------- | --------------------------------------------------------------------------------------------------------------- |
| `enabled`                       | All         | Boolean         | `false`     | Enable this payment type                                                                                        |
| `days_until_due`                | All         | Integer (0-365) | 14          | Days until invoice is due                                                                                       |
| `require_identity_verification` | All         | Boolean         | `true`      | Require BankID verification                                                                                     |
| `invoice_schedule.interval`     | B2B Grouped | String          | `"monthly"` | Billing cycle: `"monthly"` or `"quarterly"`                                                                     |
| `invoice_channel`               | B2B, B2C    | String          | `"kravia"`  | `"kravia"` for automatic delivery, `"merchant"` for [merchant delivery](/docs/checkout/kravia/invoice-delivery) |

## Identity Verification

Identity verification is required by default for all payment types and uses BankID. To disable it, set `require_identity_verification: false` on the payment type configuration.

## Transaction Lifecycle

In the standard checkout flow, the transaction is `AUTHORIZED` when the invoice is created and an `INITIATE_CAPTURE` event is added as Kravia begins delivery. The transaction moves to `CAPTURED` once Kravia confirms the shopper has paid the invoice in full, or to `PARTIALLY_CAPTURED` for partial payment.

See the [transaction lifecycle](/docs/checkout/kravia/overview#transaction-lifecycle) in the overview for the full state diagram, and [Transaction management](/docs/checkout/transaction-management) for the shared capture/void/refund operations.

## Cancellations

Refund is not supported for Kravia. To cancel an invoice, use [`POST /v1/transactions/{id}/void`](/docs/checkout/transaction-management#void-cancel):

```http theme={null}
POST /v1/transactions/{transaction_id}/void
Authorization: Bearer <token>
```

| Transaction status   | Effect of void                                                                                                                   |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `AUTHORIZED`         | Cancels the invoice with Kravia. Status changes to `AUTHORIZATION_VOIDED`.                                                       |
| `PARTIALLY_CAPTURED` | Cancels the remaining unpaid amount with Kravia. Funds already in transit from the shopper are automatically refunded by Kravia. |
| `CAPTURED`           | Not allowed — the shopper has already paid in full.                                                                              |

<Info>
  If the shopper overpays an invoice, Kravia automatically refunds the difference to the shopper. No merchant action is needed.
</Info>

<Warning>
  The `/refund` operation is not available for Kravia transactions.
</Warning>

## Billing Address Requirements

### B2C Invoices

Required fields: `first_name`, `last_name`, `address_line`, `postal_code`, `country` (ISO 3166 alpha-2), `phone_number`, `email`

### B2B Invoices

All B2C fields plus: `business_name`, `organization_number`, and optionally `customer_reference` (a free-text reference field, also used for [invoice grouping](/docs/checkout/kravia/grouped-invoices#customer-grouping)).

<Info>
  Organization numbers: Norway uses 9 digits, Sweden uses 10 or 12 digits.
</Info>

## Invoice Dates

### Standard Invoices (B2B and B2C)

* **Issue date**: transaction date
* **Due date**: issue date + `days_until_due` (default: 14 days)

### Grouped Invoices (B2B Grouped)

For grouped invoices, multiple purchases are consolidated into a single invoice per billing period. See [Grouped Invoices](/docs/checkout/kravia/grouped-invoices) for schedule details, customer grouping logic, and configuration.

## See Also

* [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
