Klarna · Capability

Klarna Order Management API — Refunds

Klarna Order Management API — Refunds. 2 operations. Lead operation: Klarna Refund an order. Self-contained Naftiko capability covering one Klarna business surface.

Run with Naftiko KlarnaRefunds

What You Can Do

POST
Refundorder — Klarna Refund an order
/v1/ordermanagement/v1/orders/{order-id}/refunds
GET
Get — Klarna Get refund details
/v1/ordermanagement/v1/orders/{order-id}/refunds/{refund-id}

MCP Tools

klarna-refund-order

Klarna Refund an order

klarna-get-refund-details

Klarna Get refund details

read-only idempotent

Capability Spec

order-management-refunds.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Klarna Order Management API — Refunds
  description: 'Klarna Order Management API — Refunds. 2 operations. Lead operation: Klarna Refund an order. Self-contained
    Naftiko capability covering one Klarna business surface.'
  tags:
  - Klarna
  - Refunds
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    KLARNA_API_KEY: KLARNA_API_KEY
capability:
  consumes:
  - type: http
    namespace: order-management-refunds
    baseUri: https://api.klarna.com
    description: Klarna Order Management API — Refunds business capability. Self-contained, no shared references.
    resources:
    - name: ordermanagement-v1-orders-order_id-refunds
      path: /ordermanagement/v1/orders/{order_id}/refunds
      operations:
      - name: refundorder
        method: POST
        description: Klarna Refund an order
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: order_id
          in: path
          type: string
          description: Order id
          required: true
        - name: Klarna-Idempotency-Key
          in: header
          type: string
          description: This header will guarantee the idempotency of the operation. The key should be unique and is recommended
            to be a UUID version 4. Retries of requests are safe to
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: ordermanagement-v1-orders-order_id-refunds-refund_id
      path: /ordermanagement/v1/orders/{order_id}/refunds/{refund_id}
      operations:
      - name: get
        method: GET
        description: Klarna Get refund details
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: order_id
          in: path
          type: string
          description: Order id
          required: true
        - name: refund_id
          in: path
          type: string
          description: Refund id
          required: true
    authentication:
      type: basic
      username: '{{env.KLARNA_USER}}'
      password: '{{env.KLARNA_PASS}}'
  exposes:
  - type: rest
    namespace: order-management-refunds-rest
    port: 8080
    description: REST adapter for Klarna Order Management API — Refunds. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/ordermanagement/v1/orders/{order-id}/refunds
      name: ordermanagement-v1-orders-order-id-refunds
      description: REST surface for ordermanagement-v1-orders-order_id-refunds.
      operations:
      - method: POST
        name: refundorder
        description: Klarna Refund an order
        call: order-management-refunds.refundorder
        with:
          order_id: rest.order_id
          Klarna-Idempotency-Key: rest.Klarna-Idempotency-Key
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/ordermanagement/v1/orders/{order-id}/refunds/{refund-id}
      name: ordermanagement-v1-orders-order-id-refunds-refund-id
      description: REST surface for ordermanagement-v1-orders-order_id-refunds-refund_id.
      operations:
      - method: GET
        name: get
        description: Klarna Get refund details
        call: order-management-refunds.get
        with:
          order_id: rest.order_id
          refund_id: rest.refund_id
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: order-management-refunds-mcp
    port: 9090
    transport: http
    description: MCP adapter for Klarna Order Management API — Refunds. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: klarna-refund-order
      description: Klarna Refund an order
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: order-management-refunds.refundorder
      with:
        order_id: tools.order_id
        Klarna-Idempotency-Key: tools.Klarna-Idempotency-Key
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: klarna-get-refund-details
      description: Klarna Get refund details
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: order-management-refunds.get
      with:
        order_id: tools.order_id
        refund_id: tools.refund_id
      outputParameters:
      - type: object
        mapping: $.