Skip to main content

Invoice Delivery

warning

This feature is still in development

By default, invoices are delivered to your customers automatically. You can instead choose to deliver invoices yourself by setting invoice_channel: "merchant". This gives you control over the delivery method, timing, and branding. It works with both customer checkout and merchant initiated.

How It Works

important

After delivering the invoice, you should start collection by calling POST /v1/transactions/{id}/capture. Without this, the collection process will not begin.

Configuration

Set invoice_channel: "merchant" to enable custom distribution.

Session-Level Configuration (Customer Checkout)

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",
"merchant_reference": "order-123",
"items": [ ... ]
},
"configuration": {
"kravia": {
"type": "payment_type",
"invoice_b2b": {
"type": "payment_product_type",
"enabled": true,
"days_until_due": 14,
"invoice_channel": "merchant"
}
}
}
}

Payment Level Configuration (Merchant Initiated)

POST /v1/sessions/pay
Authorization: Bearer <token>
Content-Type: application/json

{
"payment": {
"payment_product_type": "kravia.invoice_b2b",
"operation": "invoice_payment",
"days_until_due": 14,
"invoice_channel": "merchant"
},
"session": {
"url": {
"callback_url": "https://example.com/callback"
},
"order": {
"amount": 50000,
"currency": "NOK",
"merchant_reference": "inv-2026-001",
"billing_address": { ... }
}
}
}

Checkout Level Default

You can set a default delivery method in the checkout configuration or payment profile under payment_options[].details:

{
"configuration": {
"payment_options": [
{
"type": "kravia.invoice_b2b",
"details": {
"invoice_channel": "merchant"
}
}
]
}
}

Configuration Precedence

The value is resolved in this order:

  1. Session/payment configuration (highest priority)
  2. Checkout payment options (fallback)
  3. Default: "kravia"

Delivering the Invoice

1. Retrieve the Invoice PDF

After the invoice is created, the transaction includes the PDF URL in its metadata:

{
"id": "T12345",
"status": "AUTHORIZED",
"payment_product_type": "kravia.invoice_b2b",
"metadata": {
"kravia:invoice_number": "A1B2C-000001",
"kravia:invoice_url": "https://api.dintero.com/v1/files/f-abc123"
}
}

Download the PDF:

GET /v1/files/f-abc123
Authorization: Bearer <token>

2. Deliver Through Your Channel

Send the invoice to your customer via email, SMS, a third-party platform, your ERP system, or any other channel.

3. Capture the Transaction

After delivering the invoice, start collection by capturing the transaction:

POST /v1/transactions/T12345/capture
Authorization: Bearer <token>
Content-Type: application/json

{
"amount": 50000,
"items": [
{
"line_id": "1",
"amount": 50000
}
]
}

The transaction moves from AUTHORIZED to CAPTURED, and the collection process starts.

See Also