# Klarna

> Manage merchant orders, captures, refunds, and payout reconciliation.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/klarna

## Actions

### Acknowledge order

Acknowledge order.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```

### Add capture shipping info

Add capture shipping info.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Capture ID (`capture_id`, text, required): Capture id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Shipping info (`shipping_info`, list, required): New shipping info. Maximum: 500 items.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```

### Add order shipping info

Add order shipping info.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Shipping info (`shipping_info`, list, required): New shipping info. Maximum: 500 items.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```

### Cancel order

Cancel order.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```

### Capture order

Capture order.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Captured amount (`captured_amount`, number, required): The captured amount in minor units. From 0 to 200000000.
- Description (`description`, text): Description of the capture shown to the customer. Maximum 255 characters.
- Order lines (`order_lines`, list): Order lines for this capture. Maximum 1000 items.
- Reference (`reference`, text): Internal reference to the capture. This will be included in the settlement files. Max length is 255 characters.
- Shipping delay (`shipping_delay`, number): Shipping delay. At least 0.
- Shipping info (`shipping_info`, list): Shipping information for this capture. Maximum 500 items.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "capture_id": "example",
    "location": "example"
  }
}
```

### Extend authorization time

Extend authorization time.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```

### Extend capture due date

Extend capture due date.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Capture ID (`capture_id`, text, required): Capture id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Number of days (`number_of_days`, number, required): Number of days to extend the due date.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```

### Get capture

Get capture.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Capture ID (`capture_id`, text, required): Capture id

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "billing_address": {
      "attention": "example",
      "city": "example",
      "country": "example",
      "email": "example",
      "family_name": "example",
      "given_name": "example",
      "organization_name": "example",
      "phone": "example",
      "postal_code": "example",
      "region": "example",
      "street_address": "example",
      "street_address2": "example",
      "title": "example"
    },
    "capture_id": "example",
    "captured_amount": 1,
    "captured_at": "example",
    "description": "example",
    "klarna_reference": "example",
    "order_lines": [],
    "reference": "example",
    "refunded_amount": 1,
    "shipping_address": {
      "attention": "example",
      "city": "example",
      "country": "example",
      "email": "example",
      "family_name": "example",
      "given_name": "example",
      "organization_name": "example",
      "phone": "example",
      "postal_code": "example",
      "region": "example",
      "street_address": "example",
      "street_address2": "example",
      "title": "example"
    },
    "shipping_info": []
  }
}
```

### Get due date options

Get merchant fees for extension of due date due date

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Capture ID (`capture_id`, text, required): Capture id

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "currency": "example",
    "options": []
  }
}
```

### Get order

Get order.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna integrator (`klarna_integrator`, text): Klarna integrator.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "billing_address": {
      "attention": "example",
      "city": "example",
      "country": "example",
      "email": "example",
      "family_name": "example",
      "given_name": "example",
      "organization_name": "example",
      "phone": "example",
      "postal_code": "example",
      "region": "example",
      "street_address": "example",
      "street_address2": "example",
      "title": "example"
    },
    "captured_amount": 1,
    "captures": [],
    "created_at": "example",
    "customer": {
      "date_of_birth": "example",
      "national_identification_number": "example"
    },
    "expires_at": "example",
    "fraud_status": "example",
    "initial_payment_method": {
      "description": "example",
      "number_of_installments": 1,
      "type": "example"
    },
    "klarna_reference": "example",
    "locale": "example",
    "merchant_data": "example",
    "merchant_reference1": "example",
    "merchant_reference2": "example",
    "order_amount": 1,
    "order_id": "example",
    "order_lines": [],
    "original_order_amount": 1,
    "purchase_country": "example",
    "purchase_currency": "example",
    "refunded_amount": 1,
    "refunds": [],
    "remaining_authorized_amount": 1,
    "selected_shipping_option": {
      "carrier": "example",
      "carrier_product": {
        "identifier": "example",
        "name": "example"
      },
      "class": "example",
      "id": "example",
      "location": {
        "address": {
          "city": "example",
          "country": "example",
          "postal_code": "example",
          "region": "example",
          "street_address": "example",
          "street_address__2": "example"
        },
        "id": "example",
        "name": "example",
        "price": 1
      },
      "method": "example",
      "name": "example",
      "price": 1,
      "selected_addons": [],
      "tax_amount": 1,
      "tax_rate": 1,
      "timeslot": {
        "cutoff": "example",
        "end": "example",
        "id": "example",
        "price": 1,
        "start": "example"
      },
      "tms_reference": "example",
      "type": "example"
    },
    "shipping_address": {
      "attention": "example",
      "city": "example",
      "country": "example",
      "email": "example",
      "family_name": "example",
      "given_name": "example",
      "organization_name": "example",
      "phone": "example",
      "postal_code": "example",
      "region": "example",
      "street_address": "example",
      "street_address2": "example",
      "title": "example"
    },
    "shipping_info": [],
    "status": "AUTHORIZED"
  }
}
```

### Get refund

Get refund.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Refund ID (`refund_id`, text, required): Refund id

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "credit_invoice": false,
    "description": "example",
    "order_lines": [],
    "reference": "example",
    "refund_id": "example",
    "refunded_amount": 1,
    "refunded_at": "example"
  }
}
```

### List captures

List all order captures

**Inputs**

- Order ID (`order_id`, text, required): Order id

**Outputs**

- `data` (list): The response from Klarna.

**Example output**

```json
{
  "data": []
}
```

### List payouts

Returns a collection of payouts.

**Inputs**

- Start date (`start_date`, date and time): Start date.
- End date (`end_date`, date and time): End date.
- Currency code (`currency_code`, text): Currency code.
- Size (`size`, number): How many elements to include in the result. If no value for size is provided, a default of 20 will be used. A maximum of 500 can be set. At most 500. Default: `20`.
- Offset (`offset`, number): The current offset. Describes "where" in a collection the current starts. Default: `0`.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "pagination": {
      "count": 1,
      "next": "example",
      "offset": 1,
      "prev": "example",
      "total": 1
    },
    "payouts": []
  }
}
```

### List settlement transactions

Returns a collection of transactions.

**Inputs**

- Payment reference (`payment_reference`, text): The reference id of the payout
- Order ID (`order_id`, text): The Klarna assigned order id reference
- Size (`size`, number): How many elements to include in the result. If no value for size is provided, a default of 20 will be used. A maximum of 500 can be set. At most 500. Default: `20`.
- Offset (`offset`, number): The current offset. Describes "where" in a collection the current starts. Default: `0`.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "pagination": {
      "count": 1,
      "next": "example",
      "offset": 1,
      "prev": "example",
      "total": 1
    },
    "transactions": []
  }
}
```

### Refund order

Refund order.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Description (`description`, text): Description of the refund shown to the customer. Max length is 255 characters.
- Order lines (`order_lines`, list): Order lines for the refund shown to the customer. Optional but increases the customer experience. Maximum 1000 order lines.
- Reference (`reference`, text): Internal reference to the refund. This will be included in the settlement files. Max length is 255 characters.
- Refunded amount (`refunded_amount`, number, required): Refunded amount in minor units. From 0 to 200000000.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {
    "location": "example",
    "refund_id": "example"
  }
}
```

### Release remaining authorization

Release remaining authorization.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.

**Outputs**

- `data` (text): The response from Klarna.

**Example output**

```json
{
  "data": "example"
}
```

### Send capture notification

Send capture notification.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Capture ID (`capture_id`, text, required): Capture id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```

### Update authorization

Update authorization.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Description (`description`, text): Description of the change.
- Order amount (`order_amount`, number, required): The new total order amount. Minor units. From 0 to 200000000.
- Order lines (`order_lines`, list): New set of order lines for the order.

**Outputs**

- `data` (text): The response from Klarna.

**Example output**

```json
{
  "data": "example"
}
```

### Update customer details

Update customer details.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Shipping address (`shipping_address`, object): Shipping address for the capture.

**Outputs**

- `data` (text): The response from Klarna.

**Example output**

```json
{
  "data": "example"
}
```

### Update merchant references

Update merchant references.

**Inputs**

- Order ID (`order_id`, text, required): Order id
- Klarna IDempotency key (`klarna_idempotency_key`, text): Klarna idempotency key.
- Merchant reference1 (`merchant_reference1`, text): New merchant reference 1. Old reference will be overwritten if this field is present.
- Merchant reference2 (`merchant_reference2`, text): New merchant reference 2. Old reference will be overwritten if this field is present.

**Outputs**

- `data` (object): The response from Klarna.

**Example output**

```json
{
  "data": {}
}
```
