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

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

</AgentInstructions>

# Transaction management

> Capture, refund, void, and update Dintero Checkout transactions, including partial captures and partial refunds, to settle orders correctly after payment.

## Capturing

When you are ready to ship the order, the transaction can be captured. When capturing, the money will be transferred to
the merchant's account.

<Info>
  After authorizing the transaction, it needs to be captured within a certain amount of time.
  See [https://www.dintero.com/knowledge-base/authorizations](https://www.dintero.com/knowledge-base/authorizations) for more details.
</Info>

The API allows for both a full amount capture and a partial amount capture. The amount to capture cannot be higher than
the authorized amount.

Partial capture can be used to capture parts of the total transaction amount when needed, e.g, if only parts of the
entire order is shipped or for other reasons. Partial capture may be called as many times as required as long
as there is a remaining authorized amount to capture.

<Info>
  If the session contained an `order.shipping_option`, this will have been moved to the list of `items` in the transaction, and this is where you should specify the `shipping_option` when capturing.
</Info>

<Warning>
  NB! Captures might fail for various reasons, so it's important to check that the response indicates a successful
  capture.
</Warning>

#### Request

**`POST`** `/v1/transactions/{id}/capture` [Capture]

```json theme={null}
{
  "amount": 29990,
  "capture_reference": "string",
  "items": [
    {
      "line_id": "1",
      "amount": 29990
    }
  ]
}
```

<Info>
  According to regulations you should not capture a payment until the product or service is provided to the customer. For
  more information, please see the [Consumer Authority's Guidelines] for the standard sales conditions for consumer
  purchases of goods over the internet.
</Info>

## Updating authorization

For transactions authorized with Klarna (`klarna.klarna`) or Billie (`klarna.billie`), it is possible to update the authorized amount after the initial authorization. This allows merchants to add items to an order before capture — for example, to upsell additional products.

<Info>
  Updating the authorization is only supported for Klarna and Billie transactions that have not yet been fully captured.
</Info>

#### Request

**`POST`** `/v1/transactions/{id}/authorization` [Update authorization]

```json theme={null}
{
  "amount": 35990,
  "items": [
    {
      "line_id": "1",
      "description": "Product A",
      "quantity": 1,
      "amount": 29990,
      "vat_amount": 5998,
      "vat": 25
    },
    {
      "line_id": "2",
      "description": "Extra item",
      "quantity": 1,
      "amount": 6000,
      "vat_amount": 1200,
      "vat": 25
    }
  ]
}
```

The `amount` field is the new total authorized amount. If the transaction already has items, the `items` field is required and must include the updated list of items, and the sum of `items[*].amount` must equal the new `amount`. For transactions without existing items, `items` is optional; when provided, the same sum rule applies.

### Backoffice

To add items to an authorized Klarna or Billie transaction via Backoffice:

1. Navigate to the transaction (status must be **Authorized**)
2. In the **Order items** section, click **+ Add item**
3. Fill in the item details: description, quantity, unit price, and VAT %
4. Click **Update**

The authorized amount is automatically updated to reflect the new total.

<h2 id="void-cancel">
  Void/cancel
</h2>

If, for some reason, the order will not be fulfilled, you can cancel the transaction to release the money from the
customer's account.

A transaction can only be voided if it has not been captured.

After the void is successful, the transaction status is changed to `AUTHORIZATION_VOIDED`

#### Request

**`POST`** `/v1/transactions/{id}/void` [Void]

#### Response

```json theme={null}
{
  "id": "...",
  ...
  "status": "AUTHORIZATION_VOIDED"
}
```

## Refund

If the order, or parts of it, are returned, the money can be refunded. The refund amount cannot be larger than the
captured amount.

<Warning>
  NB! Refunds might fail for various reasons, so it's important to check that the response indicates a successful refund.
</Warning>

#### Request

**`POST`** `/v1/transactions/{id}/refund` [Refund]

```json theme={null}
{
  "amount": 29990,
  "reason": "string",
  "items": [
    {
      "line_id": "1",
      "amount": 29990
  }]
}
```

[Update authorization]: /payments-api.html#operation/transaction_tid_extend_authorization_post

[Capture]: /payments-api.html#operation/transactions_id_capture_post

[Void]: /payments-api.html#operation/transactions_id_void_post

[Refund]: /payments-api.html#operation/transactions_id_refund_post

[Consumer Authority's Guidelines]: https://www.forbrukertilsynet.no/english/guidelines/guidelines-the-standard-sales-conditions-consumer-purchases-of-goods-the-internet
