Skip to main content

Customer Checkout with Kravia

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

Step-by-Step Implementation

1. Configure Payment Types

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

{
"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

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)
  3. Completes BankID verification (if required)
  4. Invoice is created and the transaction is automatically captured

4. Receive Transaction

After successful payment, you receive a transaction with status CAPTURED:

{
"id": "T12345",
"status": "CAPTURED",
"payment_product_type": "kravia.invoice_b2b",
"metadata": {
"kravia:invoice_number": "A1B2C-000001",
"kravia:invoice_url": "https://api.dintero.com/v1/files/f-abc123"
},
"events": [
{
"name": "CAPTURE",
"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"
}
}
]
}
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.

Configuration Options

OptionApplies ToTypeDefaultDescription
enabledAllBooleanfalseEnable this payment type
days_until_dueAllInteger (0-365)14Days until invoice is due
require_identity_verificationAllBooleantrueRequire BankID verification
invoice_schedule.intervalB2B GroupedString"monthly"Billing cycle: "monthly" or "quarterly"
invoice_channelB2B, B2CString"kravia""kravia" for automatic delivery, "merchant" for merchant 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, transactions are automatically captured. There is no separate authorization step and no manual capture needed. See the transaction lifecycle in the overview for the full state diagram.

Refunds and Cancellations

Since transactions are automatically captured, there is no separate void/cancel. To cancel an invoice, issue a full refund:

POST /v1/transactions/{transaction_id}/refund
Authorization: Bearer <token>
Content-Type: application/json

{
"amount": 50000,
"reason": "Customer cancellation"
}
  • Full refund before payment: withdraws invoice from collection entirely. If the customer has partially paid, the partial payment is refunded.
  • Partial refund: reduces the amount owed on the invoice.
warning

Refunds are not available for transactions in SETTLED state.

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

info

Organization numbers: Norway uses 9 digits, Sweden uses 10 or 12 digits.

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 for schedule details, customer grouping logic, and configuration.

See Also