Skip to content
This is a new version of the Kivra Developer Docs. Report issues or share feedback at avsandare.support@kivra.se. The previous version can be found here.

Schemas

The operation pages expand referenced schemas inline. Use this page to browse the reusable component schemas and inspect their complete YAML definitions.

73 schemas.

TokenResponseobject
title: TokenResponse
type: object
required:
  - access_token
  - token_type
  - expires_in
properties:
  access_token:
    type: string
    description: OAuth 2.0 access token.
  token_type:
    type: string
    description: Token type to use in the Authorization header.
  expires_in:
    type: integer
    description: Lifetime of the access token in seconds.
TicketsCreateEventobject
title: TicketsCreateEvent
type: object
required:
  - event_reference
  - name
  - organizer
  - schedule
  - venue
properties:
  event_reference:
    type: string
    description: Used for uniqness of the event, only one event can be created with
      a specific event_reference.
  name:
    type: string
    description: The name of the event.
  url:
    type:
      - string
      - "null"
    format: uri
    description: A URL to the event's website or more information. Must be HTTPS.
  organizer:
    type: object
    required:
      - name
    properties:
      name:
        type: string
  information:
    type:
      - string
      - "null"
  images:
    type:
      - object
      - "null"
    properties:
      thumbnail:
        type:
          - object
          - "null"
        required:
          - content_type
          - data
        properties:
          content_type:
            type: string
            enum:
              - image/jpeg
              - image/png
              - image/webp
          data:
            type: string
            description: Base64 encoded string
      landscape:
        type:
          - object
          - "null"
        required:
          - content_type
          - data
        properties:
          content_type:
            type: string
            enum:
              - image/jpeg
              - image/png
              - image/webp
          data:
            type: string
            description: Base64 encoded string
  schedule:
    type: object
    required:
      - start
    properties:
      start:
        type: string
      end:
        type:
          - string
          - "null"
      admission:
        type:
          - string
          - "null"
  venue:
    type: object
    required:
      - name
    properties:
      name:
        type: string
      location:
        type:
          - object
          - "null"
        properties:
          city:
            type:
              - string
              - "null"
          address:
            type:
              - string
              - "null"
          zip:
            type:
              - string
              - "null"
          coordinates:
            type:
              - object
              - "null"
            required:
              - longitude
              - latitude
            properties:
              longitude:
                type: string
              latitude:
                type: string
TicketEventMetadataobject
title: TicketEventMetadata
type: object
required:
  - event_key
  - tickets
properties:
  event_key:
    type: string
    description: Reference to the event (created via /tickets/event)
  order_id:
    type:
      - string
      - "null"
    description: Optional order identifier
  group_ticket:
    type:
      - object
      - "null"
    properties:
      qr_data:
        type: string
        description: QR code data for the group ticket
    required:
      - qr_data
  tickets:
    type: array
    minItems: 1
    items:
      type: object
      required:
        - qr_data
        - type
      properties:
        seating:
          type:
            - object
            - "null"
          properties:
            seat:
              type:
                - string
                - "null"
            row:
              type:
                - string
                - "null"
            section:
              type:
                - string
                - "null"
            gate:
              type:
                - string
                - "null"
        qr_data:
          type: string
          description: QR code data for the ticket
        type:
          type: string
          description: Ticket type (e.g., "Standard", "VIP")
Content_user_v2_salaryslipobject
title: salaryslip
type: object
required:
  - subject
  - type
  - salaryslip
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Salary for March 2022
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: salaryslip
    description: |
      Indicating that the content is a salary slip with
      structured metadata. A valid `salaryslip` object needs to
      be provided. The data includes detailed payment
      information, employer details, benefits, holidays, and tax
      information. This type supports the `retain`
      functionality. Note that if an HTML-version is stated, it
      will overwrite the structured data view.
  retain:
    description: >
      Boolean denoting if Kivra should try and retain this Content if it can’t
      be delivered. Default `false`.

      Please note that retain can only be used with content types

      `letter.creditnotice`, `letter.salary`, `letter.signed`, `salaryslip`,

      and `invite.sign`, otherwise an error with status code `422` will be
      returned.
    type: boolean
    writeOnly: true
    example: false
  retention_time:
    description: |
      How long to retain a Content. Supported values: `"30"` and `"390"`
    type: string
    writeOnly: true
    example: "30"
    enum:
      - "30"
      - "390"
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  salaryslip:
    description: Optional salary slip
    $ref: "#/components/schemas/schema-salary-slip"
Content_user_v2_letter_formobject
title: letter.form
type: object
required:
  - subject
  - type
  - form
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Address form
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: letter.form
    description: |
      Indicating that the content contains a form.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  form:
    description: Optionally attach a form
    $ref: "#/components/schemas/Form"
Content_user_v2_letter_signedobject
title: letter.signed
type: object
required:
  - subject
  - type
  - signed
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Signed contract
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: letter.signed
    description: |
      Indicates that the content contains a signed document.
      This type supports the `retain` functionality.
  retain:
    description: >
      Boolean denoting if Kivra should try and retain this Content if it can’t
      be delivered. Default `false`.

      Please note that retain can only be used with content types

      `letter.creditnotice`, `letter.salary`, `letter.signed`, `salaryslip`,

      and `invite.sign`, otherwise an error with status code `422` will be
      returned.
    type: boolean
    writeOnly: true
    example: false
  retention_time:
    description: |
      How long to retain a Content. Supported values: `"30"` and `"390"`
    type: string
    writeOnly: true
    example: "30"
    enum:
      - "30"
      - "390"
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  signed:
    description: Optional signed metadata
    $ref: "#/components/schemas/Signed"
Content_user_v2_invite_researchobject
title: invite.research
type: object
required:
  - subject
  - type
  - invite
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Research Invite
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invite.research
    description: |
      For invitations to participate in surveys and polls.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  invite:
    description: |
      Invite metadata.
    $ref: "#/components/schemas/InviteResearch"
Content_user_v2_invite_giftobject
title: invite.gift
type: object
required:
  - subject
  - type
  - invite
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: A gift
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invite.gift
    description: |
      For invitations to collect a gift.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  invite:
    description: |
      Invite metadata.
    $ref: "#/components/schemas/InviteGift"
Content_user_v2_invite_signobject
title: invite.sign
type: object
required:
  - subject
  - type
  - invite
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Invitation to sign
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invite.sign
    description: >
      For invitations to sign a document. This type supports the `retain`
      functionality.
  retain:
    description: >
      Boolean denoting if Kivra should try and retain this Content if it can’t
      be delivered. Default `false`.

      Please note that retain can only be used with content types

      `letter.creditnotice`, `letter.salary`, `letter.signed`, `salaryslip`,

      and `invite.sign`, otherwise an error with status code `422` will be
      returned.
    type: boolean
    writeOnly: true
    example: false
  retention_time:
    description: |
      How long to retain a Content. Supported values: `"30"` and `"390"`
    type: string
    writeOnly: true
    example: "30"
    enum:
      - "30"
      - "390"
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  invite:
    description: |
      Invite metadata.
    $ref: "#/components/schemas/InviteSign"
Content_user_v2_invite_voucherobject
title: invite.voucher
type: object
required:
  - subject
  - type
  - invite
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Voucher
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invite.voucher
    description: |
      For invitations to use a voucher
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  invite:
    description: |
      Invite metadata.
    $ref: "#/components/schemas/InviteVoucher"
Content_user_v2_invite_kycobject
title: invite.kyc
type: object
required:
  - subject
  - type
  - invite
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: KYC Questions
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invite.kyc
    description: |
      For invitations to complete KYC (Know Your Customer) process.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  invite:
    description: |
      Invite metadata.
    $ref: "#/components/schemas/InviteKyc"
Content_user_v2_bookingobject
title: booking
type: object
required:
  - subject
  - type
  - booking
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Appointment booking
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: booking
    description: |
      Indicating that the content is a booking/appointement.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  booking:
    description: Optionally specify booking information
    $ref: "#/components/schemas/Booking"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_registered_letterobject
title: registered.letter
type: object
required:
  - subject
  - type
  - registered
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Important letter
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: registered.letter
    description: >
      Indicating that the content is a registered letter. A valid `registered`
      object needs to be provided. Note that email matching is not yet supported
      for this content type.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  registered:
    description: Optional registered letter
    $ref: "#/components/schemas/RegisteredLetter"
Content_user_v2_ticket_eventobject
title: ticket.event
type: object
required:
  - subject
  - type
  - ticket
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Event Ticket
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: ticket.event
    description: |
      Indicating that the content is a ticket for an event. A
      valid `ticket` object needs to be provided. Note that even
      if multiple parts are stated in a ticket, only one part
      will be displayed.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
  ticket:
    description: Optional ticket metadata
    $ref: "#/components/schemas/TicketEventMetadata"
Content_user_v2_letterobject
title: letter
type: object
required:
  - subject
  - type
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Invoice for March 2022
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: letter
    description: >
      Indicating that the content is an information letter. This is the default
      type for all non-payable content.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_letter_salaryobject
title: letter.salary
type: object
required:
  - subject
  - type
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Invoice for March 2022
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: letter.salary
    description: |
      Indicating that the content is a salary specification.
      This type supports the retain functionality.
  retain:
    description: >
      Boolean denoting if Kivra should try and retain this Content if it can’t
      be delivered. Default `false`.

      Please note that retain can only be used with content types

      `letter.creditnotice`, `letter.salary`, `letter.signed`, `salaryslip`,

      and `invite.sign`, otherwise an error with status code `422` will be
      returned.
    type: boolean
    writeOnly: true
    example: false
  retention_time:
    description: |
      How long to retain a Content. Supported values: `"30"` and `"390"`
    type: string
    writeOnly: true
    example: "30"
    enum:
      - "30"
      - "390"
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_letter_creditnoticeobject
title: letter.creditnotice
type: object
required:
  - subject
  - type
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Invoice for March 2022
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: letter.creditnotice
    description: |
      Indicating that the content is a creditnotice. This type
      supports the retain functionality.
  retain:
    description: >
      Boolean denoting if Kivra should try and retain this Content if it can’t
      be delivered. Default `false`.

      Please note that retain can only be used with content types

      `letter.creditnotice`, `letter.salary`, `letter.signed`, `salaryslip`,

      and `invite.sign`, otherwise an error with status code `422` will be
      returned.
    type: boolean
    writeOnly: true
    example: false
  retention_time:
    description: |
      How long to retain a Content. Supported values: `"30"` and `"390"`
    type: string
    writeOnly: true
    example: "30"
    enum:
      - "30"
      - "390"
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_invoiceobject
title: invoice
type: object
required:
  - subject
  - type
  - payment_multiple_options
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Invoice for March 2022
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invoice
    description: >
      indicating that the content is an invoice. A valid
      `payment_multiple_options` object needs to be provided.

      This is the default type for all payable content.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  payment_multiple_options:
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_invoice_reminderobject
title: invoice.reminder
type: object
required:
  - subject
  - type
  - payment_multiple_options
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Reminder of invoice for March 2022
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invoice.reminder
    description: |
      indicating that the content is an invoice, a reminder for
      a previously unpaid invoice. The invoice might include late fees
      and other differences compared to the original invoice. A valid
      payment_multiple_options object needs to be provided and the
      payable attribute must be set to true.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  payment_multiple_options:
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_invoice_debtcampaignobject
title: invoice.debtcampaign
type: object
required:
  - subject
  - type
  - payment_multiple_options
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Invoice for March 2022
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invoice.debtcampaign
    description: |
      Indicating that the content is an invoice or payment plan
      from a debt collection company. The invoice might include
      fees such as interest and reminder fees. A valid
      payment_multiple_options object needs to be provided and
      the payable attribute must be set to true. This content
      types enables long due dates with a longer notification
      scheme.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  payment_multiple_options:
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_invoice_renewalobject
title: invoice.renewal
type: object
required:
  - subject
  - type
  - payment_multiple_options
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Offer to renew your service
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invoice.renewal
    description: |
      Indicating that the content is not a real invoice, but an
      offer that is voluntary to pay for the receiver. It can be
      used to send an offer to renew a subscription, insurance
      or similar. A valid payment_multiple_options object needs
      to be provided and the payable attribute must be set to
      true.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  payment_multiple_options:
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_invoice_debtcollectionobject
title: invoice.debtcollection
type: object
required:
  - subject
  - type
  - payment_multiple_options
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Inkassokrav
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invoice.debtcollection
    description: |
      Indicating that the content is a debt collection claim (in
      Swedish: “inkassokrav”). A valid payment_multiple_options
      object needs to be provided and the payable attribute must
      be set to true.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  payment_multiple_options:
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_invoice_donationobject
title: invoice.donation
type: object
required:
  - subject
  - type
  - payment_multiple_options
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Donate to a charity
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invoice.donation
    description: |
      Indicating that the content is a donation where the
      payment by the user is optional. A valid
      payment_multiple_options object needs to be provided and
      the payable attribute must be set to true.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  payment_multiple_options:
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
Content_user_v2_invoice_paymentnoticeobject
title: invoice.paymentnotice
type: object
required:
  - subject
  - type
  - payment_multiple_options
properties:
  ssn:
    description: |
      User's unique SSN, according to the `YYYYMMDDnnnn` format
    type: string
    writeOnly: true
    example: "191212121212"
  email:
    description: |
      A kivra user's verified email address.
    type: string
    writeOnly: true
    example: Kivra.Sweden@example.com
  subject:
    description: >
      The subject/title will be visibile in the Recipients Inbox.

      Keep the subject short and concise (i.e. up to 30-35 characters) to make
      sure that is fully visible on most screen sizes.

      Avoid using personal or sensitive information in the subject.
    type: string
    example: Time to pay for your memebership
  generated_at:
    type: string
    format: ISO8601
    example: 2022-12-31
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site.

      The attribute will be used for sorting in the Kivra user interface, which
      makes it possible for a tenant or integrator to control the sorting.
  type:
    const: invoice.paymentnotice
    description: |
      Indicating that the content is a payment notice targeting
      the needs of membership organizations. A valid
      payment_multiple_options object needs to be provided and
      the payable attribute must be set to true.
  parts:
    description: Array of file Objects
    type: array
    writeOnly: true
    items:
      $ref: "#/components/schemas/Parts_Responsive"
  payment_multiple_options:
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  campaign:
    description: Optionally attach a campaign
    $ref: "#/components/schemas/Campaign"
FormTemplateobject
title: FormTemplate
type: object
required:
  - title
  - description
  - questions
  - key
  - created_at
  - start_question
  - version
properties:
  title:
    type: string
    description: |
      The title of the form.
    example: Customer KYC
  description:
    type: string
    description: |
      The purpose of the form.
    example: Your bank has some questions
  start_question:
    type: string
    description: |
      The id of the first question in questions that will be asked to the user.
    example: number_deposits
  questions:
    type: array
    description: |
      The questions that you want to ask the user.
    items:
      $ref: "#/components/schemas/FormQuestion"
    example:
      - label: How many times per month do you deposit into your account?
        id: number_deposits
        type: number
        next_question: largest_sum
      - label: What is the largest amount deposited?
        id: largest_sum
        type: options
        options:
          - id: small
            label: 10000 - 20000
          - id: medium
            label: 20000 - 30000
          - id: large
            label: 30000 - 40000
            next_question: source
        next_question: citizenship
      - label: Select your country of citizenship
        id: citizenship
        type: multi_options
        options:
          - id: swe
            label: Sweden
          - id: no
            label: Norway
          - id: dk
            label: Denmark
        min: 1
        max: 2
        next_question: comments
      - label: What is the source of the deposit?
        id: source
        type: free_text
        next_question: account
      - label: Select your salary account
        id: account
        type: verified_account
        next_question: comments
      - label: Do you have any further comments?
        id: comments
        type: free_text
        help_text: This can be any type of feedback that you have.
  key:
    type: string
    format: uuid
    description: |
      The key of the newly created form template.
    readOnly: true
    example: 2877d684-a340-4e4c-867f-d93283787b01
  created_at:
    type: string
    description: |
      The date the form template was created.
    readOnly: true
    example: 2022-11-23T14:51:23.874434Z
  version:
    type: integer
    description: |
      The form template version
    readOnly: true
    example: 1
FormQuestionobject
title: FormQuestion
type: object
required:
  - type
  - label
  - id
properties:
  type:
    type: string
    enum:
      - free_text
      - number
      - options
      - multi_options
      - verified_account
    description: |
      The input type required to answer the question.

      `free_text` is a string.

      `number` is an integer.

      `options` is a list of `FormOption` objects.

      `multi_options` is a list of `FormMultiOption` objects.

      `verified_account` is a string containing the IBAN of the account.
  label:
    type: string
    description: |
      Human readable description of what the question is.
  id:
    type: string
    description: |
      A key used to identify the question.
  help_text:
    type: string
    description: |
      Provides the user with more information about the question.
  next_question:
    type: string
    description: >
      The question id of the next question that the user will be asked.


      If question is of type `options` then this value is overridden if
      `next_question` is present on the option that the user selects.


      If `next_question` is not present on the question or option then this will
      be the last question that the user is asked.
  options:
    type: array
    description: >
      When `type` is `options` then use this to specify the answers that the
      user can select.
    items:
      $ref: "#/components/schemas/FormOption"
  multi_options:
    type: array
    description: >
      When `type` is `multi_options` then use this to specify the answers that
      the user can select.
    items:
      $ref: "#/components/schemas/FormMultiOption"
  min:
    type: integer
    description: >
      When `type` is `number` then use this to specify the minimum (inclusive)
      value to accept in the response.

      When `type` is `multi_option` then use this to specify the minimum number
      of options that the user can select.
  max:
    type: integer
    description: >
      When `type` is `number` then use this to specify the maximum (inclusive)
      value to accept in the response.

      When `type` is `multi_option` then use this to specify the maximum number
      of options that the user can select.
FormOptionobject
title: FormOption
type: object
required:
  - id
  - label
properties:
  id:
    type: string
    description: |
      A key used to identify the answer.
  label:
    type: string
    description: |
      A human readable description of the answer.
  next_question:
    type: string
    description: >
      The question id of the next question that the user will be asked.


      This value overrides any potential `next_question` value on the question
      level.


      If `next_question` is not present on the question or option then this will
      be the last question that the user is asked.
FormMultiOptionobject
title: FormMultiOption
type: object
required:
  - id
  - label
properties:
  id:
    type: string
    description: |
      A key used to identify the answer.
  label:
    type: string
    description: |
      A human readable description of the answer.
FormTemplateKeyobject
title: FormTemplateKey
type: object
required:
  - form_template_key
  - response_count
properties:
  key:
    type: string
    description: |
      A key used to identify the form template.
    example: 2877d684-a340-4e4c-867f-d93283787b01
  response_count:
    type: integer
    minimum: 0
    description: |
      Count of responses available to collect from this template key
FormTemplateListingobject
title: FormTemplateListing
type: object
required:
  - forms
properties:
  forms:
    type: array
    description: |
      form template details
    items:
      $ref: "#/components/schemas/FormTemplateKey"
RegisteredLetterResponseStatusstring

Status of the registered letter response.

title: RegisteredLetterResponseStatus
type: string
description: Status of the registered letter response.
enum:
  - signed
  - expired
RegisteredLetterResponseStatusDetailobject
title: RegisteredLetterResponseStatusDetail
type: object
properties:
  key:
    type: string
    description: Response key
  status:
    $ref: "#/components/schemas/RegisteredLetterResponseStatus"
RegisteredLetterResponseobject
title: RegisteredLetterResponse
type: object
properties:
  status:
    $ref: "#/components/schemas/RegisteredLetterResponseStatus"
  signed_at:
    type: string
    nullable: true
    format: ISO8601
    description: When the registered letter was signed
    example: 2025-06-15T12:00:10Z
  sender_reference:
    type: object
    nullable: true
    description: The same object that was passed by the sender when creating the
      registered letter. Null if nothing was passed.
    example:
      internal_id: 6eb7d1b9-ccd6-408f-ade7-9a1837be3ecf
  content_key:
    type: string
    example: 2877d684-a340-4e4c-867f-d93283787b01
  bank_id_order:
    type: object
    nullable: true
    description: Returns the same as the BankID collect endpoint, however
      *bankIdIssueDate*, *uhi* and *risk* are excluded.
    externalDocs:
      description: More details about this object can be found here.
      url: https://developers.bankid.com/api-references/auth--sign/collect
    example:
      orderRef: 0197b142-2c15-74a7-9850-3b68087ad4ec
      status: completed
      completionData:
        user:
          personalNumber: "197701032380"
          name: Jan-Erik Karlsson
          givenName: Jan-Erik
          surname: Karlsson
        device:
          ipAddress: 142.250.74.206
        stepUp:
          mrtd: false
        signature: PD94bWwgdmVyc2lvb...
        ocspResponse: MIIHdgoBAKCCB28wggdrBg...
FormResponseKeysobject
title: FormResponseKeys
type: object
required:
  - form_template_key
  - responses
properties:
  form_template_key:
    type: string
    format: uuid
    description: |
      The form template key associated with the form responses.
    example: 2877d684-a340-4e4c-867f-d93283787b01
  responses:
    type: array
    description: |
      Metadata about the form response
    items:
      type: object
      properties:
        form_response_key:
          type: string
          format: uuid
          description: |
            A key used to identify the individual form response.
          example: bed773d7902942f29f0b0729390c962c
FormResponseobject
title: FormResponse
type: object
required:
  - form_response_key
  - form_template_key
  - responses
  - matched_by
  - login_method
  - responded_at
  - sender_reference
properties:
  form_response_key:
    type: string
    format: uuid
    description: The form response key
    example: 2877d684-a340-4e4c-867f-d93283787b01
  form_template_key:
    type: string
    format: uuid
    description: The form template key.
    example: 2877d684-a340-4e4c-867f-d93283787b01
  response:
    type: array
    description: The form response that the user submitted.
    items:
      type: object
      properties:
        id:
          type: string
          description: |
            A key used to identify the question.
        value:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - $ref: "#/components/schemas/VerifiedAccount"
          description: |
            The response to the question.
        type:
          type: string
          enum:
            - free_text
            - number
            - options
            - multi_options
          description: |
            The input type required to answer the question.

            `free_text` is a string.

            `number` is an integer.

            `options` can be a string or an integer.

            `multi_options` is a list of `options`.

            `verified_account` an object containing account information.
      example:
        - id: number_deposits
          value: 1
          type: number
        - id: largest_sum
          value: small
          type: options
        - id: comments
          value: No further comments
          type: free_text
        - id: account
          type: verified_account
          value:
            account_number: 1234-5678
            bank_name: Bank
            clearing_number: "1234"
        - id: citizenship
          type: multi_options
          value:
            - Swedish
            - German
  matched_by:
    type: object
    description: Used to identify the user that answered the form
    required:
      - type
      - value
    properties:
      type:
        type: string
        enum:
          - ssn
          - email
        description: How the user that answered the form was identified.
        example: ssn
      value:
        type: string
        description: Represents a value used to identify a user e.g. ssn or email.
        example: 199202286837
  login_method:
    type: string
    enum:
      - bankid
    description: How the user that submitted the form logged into Kivra
    example: bankid
  responded_at:
    type: string
    format: ISO8601
    description: When Kivra received a response to the form
    example: 2023-08-22T12:39:29.000000Z
  sender_reference:
    type: object
    nullable: true
    description: Provided reference data in content sendout is included in the form
      response.
    example:
      internal_id: 6eb7d1b9-ccd6-408f-ade7-9a1837be3ecf
BasicErrorResponseobject
title: BasicErrorResponse
type: object
required:
  - code
  - short_message
  - long_message
properties:
  code:
    type: integer
    description: An error code identifying the reason of the unsuccessful request.
  short_message:
    type: string
    description: Short human-readable description.
  long_message:
    type: string
    description: Longer human-readable description getting into details.
FormErrorResponseobject
title: FormErrorResponse
allOf:
  - $ref: "#/components/schemas/BasicErrorResponse"
  - type: object
VerifiedAccountobject

Account information for verified account

title: VerifiedAccount
type: object
description: Account information for verified account
required:
  - account_number
  - bank_name
properties:
  account_number:
    type: string
    description: User's account number.
  bank_name:
    type: string
    description: Name of the bank the account belongs to.
  clearing_number:
    type: string
    description: The number used for the identification of financial institutions.
Content_companyobject
title: Content_company
type: object
required:
  - vat_number
properties:
  vat_number:
    description: |
      A valid VAT-identifier, Swedish format: `SE[xxxxxxxxxx]01`
    type: string
    writeOnly: true
    example: SE556840226601
  subject:
    description: This Subject/Title will be visibile in the Recipients Inbox.
    type: string
    example: Sample Invoice
  generated_at:
    type: string
    format: ISO8601
    example: 2016-12-12
    description: >
      Optional attribute which denotes when a specific Content was generated at
      the tenant/integrator’s site. The attribute will be used for sorting in
      the Kivra user interface, which makes it possible for a tenant or
      integrator to control the sorting.
  type:
    type: string
    example: letter
    description: >
      Optional attribute providing information about the type of content being
      sent. The type of a content may influence how the user interacts with the
      content and how the user is notified about the content.
        Allowed values are:
        - `"accounting.invoice"`: indicating that the content is a structured invoice that can be shared to the accounting system used by the receiver. A valid `invoice` object needs to be provided.
        - `"accounting.invoicereminder"`: indicating that the content is a structured invoice (reminder) that can be shared to the accounting system used by the receiver. A valid `invoice` object needs to be provided.
        - `"accounting.invoicecreditnote"`: indicating that the content is a structured invoice (credit invoice) that can be shared to the accounting system used by the receiver. A valid `invoice` object needs to be provided.
        - `"letter"`: indicating that the content is an information letter. This is the default type for all non-payable content.
        - `"invoice"`: indicating that the content contains payment information. This value can only be used when a "payment" object is provided. This is the default type for all payable content.
        - `"letter.salary"`: indicating that the content is a salary specification.
          *Note: `letter.salary` will be deprecated from October 1st 2026.*
        - `"letter.creditnotice"`: indicating that the content is a creditnotice.
        - `"invite.research"`: indicating that the content is an invitation to participate in a survey or poll.
        - `"invite.kyc"`: indicating that the content is an invitation to complete a KYC (Know Your Customer) process.
  parts:
    description: files composing the content
    type: array
    items:
      $ref: "#/components/schemas/Parts"
  payment_multiple_options:
    type: object
    description: |
      Specify payment information for both single and multiple payment options
    $ref: "#/components/schemas/PaymentMultipleOptions"
  invoice:
    description: Structured invoice data, required for the `accounting.*` content types
    $ref: "#/components/schemas/Invoice"
  invite:
    description: |
      Invite metadata. Required for `invite.research` and `invite.kyc`
      content types. The shape depends on the content `type`.
    oneOf:
      - $ref: "#/components/schemas/InviteResearch"
      - $ref: "#/components/schemas/InviteKyc"
PaymentMultipleOptionsobject

Payment information with the possibility of multiple payment options. Note that the first option is special. Notifications about the invoice will be based on the due date specified in the first option, and in the case where a user looks at the invoice in a client that does not know about multiple options, the first one will be the only one presented. For example, if the invoice offers the choice of paying the entire debt or to start a payment plan, the first option should be to pay the entire debt.

title: PaymentMultipleOptions
type: object
description: |
  Payment information with the possibility of multiple payment options.
  Note that the first option is special. Notifications about the invoice
  will be based on the due date specified in the first option, and in the
  case where a user looks at the invoice in a client that does not know
  about multiple options, the first one will be the only one presented.
  For example, if the invoice offers the choice of paying the entire debt
  or to start a payment plan, the first option should be to pay the entire
  debt.
required:
  - payable
  - account
  - method
  - currency
  - options
properties:
  payable:
    type: boolean
    description: >
      Toggles whether this content should be payable through Kivra’s payment
      platform.
  method:
    type: string
    description: 1 = BG and 2 = PG
    example: "1"
    enum:
      - "1"
      - "2"
  account:
    type: string
    example: 1234-5678
    description: |
      The destination account number if the user choses to pay this
      invoice with a service that uses some variety of bank transfer (for
      example, BankGiro or PlusGiro).
  swish_alias:
    type: string
    minLength: 3
    description: |
      The Swish Payee Alias that should be used as the recipient if the
      user choses to pay this invoice with Swish. The alias given must be
      one that is listed as available for the sender, or Swish will not be
      offered as a payment alternative. The value can be the string
      `disable`, in order to override a default payee alias and disable
      Swish payment for this invoice only.
  autogiro_destination:
    type: string
    enum:
      - disable
    description: |
      This field specifies the destination of a payment made through
      Kivra's Autopay service. At this time, its only use is to disable
      automatic payment of a given invoice. In the future, this field will
      also be used to determine the destination accoutnt to use when the
      sender has more than one.
  currency:
    type: string
    enum:
      - SEK
    example: SEK
    description: |
      Currency used in specifying `amount`. In Sweden, only SEK is allowed.
  options:
    type: array
    description: A list of payment options, where each option should differ in
      either `amount` or `reference`
    items:
      type: object
      description: A payment option where each option should differ in either `amount`
        or `reference`
      required:
        - due_date
        - amount
        - type
        - reference
      properties:
        due_date:
          type: string
          format: ISO8601
          example: 2017-01-01
          description: Date when this option is due.
        amount:
          type: string
          format: float
          example: "123.50"
          description: The payment amount for this option. A number larger than or equal
            to 1.
        type:
          type: string
          description: Type of format for the reference
          example: SE_OCR
          enum:
            - SE_OCR
            - TENANT_REF
        reference:
          type: string
          example: "426523791"
          description: The reference number used for paying. This can be maximum 25
            characters long.
        title:
          type: string
          description: Title for this option
        description:
          type: string
          description: Optional description for this option
        icon:
          $ref: "#/components/schemas/PaymentOptionIcon"
  flexible_option:
    type: object
    description: |
      A flexible payment option. This replaces the old variable amount
      functionality. A content with a flexible option must also have at
      least one fixed option, to allow for old clients that don't know how
      to deal with flexible options.
      The flexible option can have up to four limits: suggested maximum
      and minimum, and mandatory maximum and minimum. For the suggested
      limits, the user will be shown a warning when entering a sum outside
      them, but will be allowed to proceeed if they want to. The mandatory
      limits will be enforced, and paying amounts outside them will not be
      allowed. The closest behaviour to that of the old variable amount is
      achieved by setting `max_limit` and `min_suggested`.
    required:
      - due_date
      - type
      - reference
    properties:
      due_date:
        type: string
        format: ISO8601
        example: 2017-01-01
        description: Date when this option is due.
      type:
        type: string
        description: Type of format for the reference
        example: SE_OCR
        enum:
          - SE_OCR
          - TENANT_REF
      reference:
        type: string
        example: "426523791"
        description: The reference number used for paying. This can be maximum 25
          characters long.
      title:
        type: string
        description: Title for this option
      description:
        type: string
        description: Optional description for this option
      icon:
        $ref: "#/components/schemas/PaymentOptionIcon"
      min_limit:
        type: string
        format: float
        example: "123.50"
        description: The smallest allowed amount to be paid. If not given it defaults to
          1.00 SEK.
      min_suggested:
        type: string
        format: float
        example: "123.50"
        description: The user is encouraged to pay more than this amount.
      max_suggested:
        type: string
        format: float
        example: "123.50"
        description: The user is encouraged to not pay more than this amount.
      max_limit:
        type: string
        format: float
        example: "123.50"
        description: The largest allowed amount to be paid. Note that even if this
          amount is not given or very high, limits from the payment provider or
          bank will still apply.
CompanyListobject
title: CompanyList
type: object
properties:
  key:
    description: This value is deprecated and will always be set to the empty string.
    type: string
    enum:
      - ""
    example: ""
  vatnr:
    $ref: "#/components/schemas/VatNumber"
UserMatchV2SSNobject
title: UserMatchV2SSN
required:
  - list
type: object
properties:
  list:
    type: array
    items:
      type: string
      example:
        - "191212121212"
        - "197701032380"
        - "198112172385"
    description: list of recipient addresses to be matched
example:
  list:
    - "191212121212"
    - "197701032380"
    - "198112172385"
UserMatchV2Emailobject
title: UserMatchV2Email
required:
  - list
type: object
properties:
  list:
    type: array
    items:
      type: string
      example:
        - fOO@example.com
        - bAr@EXAMPLE.COM
    description: list of recipient addresses to be matched
example:
  list:
    - fOO@example.com
    - bAr@EXAMPLE.COM
CompanyMatchSetobject
title: CompanyMatchSet
required:
  - list
type: object
properties:
  list:
    type: array
    items:
      type: string
      example:
        - SE25555555550
        - SE25555555551
        - SE25555555552
    description: list of VAT Numbers
example:
  list:
    - SE25555555550
    - SE25555555551
    - SE25555555552
Tenant_v2object
title: Tenant_v2
type: object
required:
  - name
  - company_id
properties:
  name:
    description: Name of the Tenant, this name shows up in the Users Inbox
    type: string
    example: Kivra
  company_id:
    type: array
    items:
      $ref: "#/components/schemas/CompanyId"
  edit_security_level:
    description: Security level needed for an enduser to `opt_out` from this Tenant
    type: integer
    readOnly: true
    example: 50
    enum:
      - 25
      - 50
  groups:
    type: array
    items:
      type: string
    readOnly: true
    description: List of groups this Tenant belongs to
    example: []
  visibility:
    description: Determines if this Tenant is visible for the enduser
    type: string
    readOnly: true
    enum:
      - visible
      - hidden
  created_at:
    description: Datum when the tenant was created in UTC format
    type: string
    readOnly: true
    example: 2019-05-20T12:42:29Z
  created_by:
    description: ID of client that created the tenant
    type: string
    readOnly: true
    example: client_15063298495eafd2749bb78e2f991af3ab023d13df
  status:
    description: internal field describing whether the user can opt-out the tenant
    type: string
    readOnly: true
    example: optional
  class:
    description: internal field
    type: string
    readOnly: true
    example: opt_out
Error40915object
title: Error40915
type: object
properties:
  code:
    type: string
    description: The 5-digits error code
    example: 40915
  short_message:
    type: string
    description: A short message explaining the conflict
    example: Orgnumber already exist
  long_message:
    type: string
    description: A text message explaining the conflict
    example: "One or more of the organisation numbers within the company_id's you
      provided, already exist in existing tenants. Tenants outside your scope:
      {Name: TestBolag, Tenant key: 1424780396902ee9278b16417f8e3252c3ced28c38,
      Organisation number: SE556840226601}"
Error40045object
title: Error40045
type: object
properties:
  code:
    type: string
    description: The 5-digits error code
    example: 40045
  short_message:
    type: string
    description: A short message explaining the error
    example: PDF was invalid
  long_message:
    type: string
    description: A text message explaining the error
    example: The supplied agreement PDF was invalid. Please check that the file is a
      valid PDF
RequestAccessobject
title: RequestAccess
type: object
properties:
  created_at:
    description: Datum when the request was created in UTC format
    type: string
    readOnly: true
    example: 2019-05-20T12:42:29Z
  created_by:
    description: ID of client that created the request
    type: string
    readOnly: true
    example: client_15063298495eafd2749bb78e2f991af3ab023d13df
  status:
    description: status of the request, for instance `pending`, `accepted` or `rejected`
    type: string
    readOnly: true
    example: pending
  client_id:
    description: ID Of You the Client
  client_name:
    description: Name of the client who created the requested tenant
    type: string
    readOnly: true
    example: Client XYZ
  tenant_name:
    description: Name of the requested tenant
    type: string
    readOnly: true
    example: Tenant ABC
  tenant_key:
    description: Key of the requested tenant
    type: string
    readOnly: true
    example: 1424780396902ee9278b16417f8e3252c3ced28c38
Agreementobject
title: Agreement
type: object
required:
  - subject
  - type
  - original
  - parties
properties:
  subject:
    description: Name of the agreement
    type: string
    example: Employment agreement
  type:
    description: the type of content, for agreements always use 'agreement'
    type: string
    example: agreement
  vat_number:
    description: |
      A valid VAT-identifier, Swedish format: `SE[xxxxxxxxxx]01`
    type: string
    example: SE556840226601
  expiration_days:
    type: integer
    minimum: 7
    maximum: 180
    description: |
      Number of days an agreement will be available for signing, 
      before expiring. The expiration_days must be between 7 and 180 days
    example: 60
  original:
    type: object
    properties:
      name:
        description: Name of the document file
        type: string
        example: agreement1025.pdf
      content_type:
        description: The
          [IANA](http://www.iana.org/assignments/media-types/media-types.xhtml)
          media type corresponding to the file, e.g. "application/pdf"
        type: string
        example: application/pdf
      data:
        description: Base64-encoded data for the agreement PDF
        type: string
        format: Base64-encoded data
        example: REVBREJFRUY=
  parties:
    description: list of signers and delegates that are requested to sign the agreement
    type: array
    items:
      $ref: "#/components/schemas/AgreementParties"
    example:
      - ssn: "197701032380"
        name: Jan-Erik Karlsson
        email: je.karlsson@email.nu
        role: signer
      - ssn: "198112172385"
        name: Gustav Larsson
        email: gustav123@mymail.com
        role: delegate
AgreementPartiesobject
title: AgreementParties
type: object
properties:
  ssn:
    description: |
      User's unique SSN, format: `YYYYMMDDnnnn`
    type: string
    example: "197701032380"
  name:
    description: Name of the user
    type: string
    example: Jan-Erik Karlsson
  email:
    description: email to be used to contact the user
    type: string
    example: je.karlsson.hem@email.nu
  role:
    description: the role of the user in this signature flow
    type: string
    enum:
      - signer
      - delegate
    example: signer
AgreementStateShortobject
title: AgreementStateShort
type: object
properties:
  key:
    description: unique agreement id
    type: string
    example: 1544707148d73a3e84a216427724637fc207cba2ab
  state:
    description: current state for the agreement
    type: string
    example: active
    enum:
      - active
      - generating
      - completed
      - revoked
    readOnly: true
AgreementStateDetailedobject
title: AgreementStateDetailed
type: object
properties:
  subject:
    description: Name of the agreement
    type: string
    example: Employment agreement
  created_at:
    description: The time when the agreement was created
    type: string
    example: 2019-04-09T13:42:26Z
    readOnly: true
  expires_at:
    description: >
      The expiration time for the agreement, if the agreement is not completed
      before this date, it will no longer be available for signature
    type: string
    example: 2019-05-09T13:42:26Z
    readOnly: true
  state:
    description: The current state of the agreement
    type: string
    example: completed
    enum:
      - active
      - generating
      - completed
      - revoked
    readOnly: true
  tenant_name:
    description: The name of the tenant that created the agreement
    type: string
    example: Sender AB
  tenant:
    description: The tenant key that created the agreement
    type: string
    example: tenant_154442474745511bbaaa5b44b391eae0513e2c55a0
  type:
    description: The type of agreement as provided by the sender when the agreement
      was created
    type: string
    example: agreement
  signatures:
    description: |
      List of signatures
    type: array
    readOnly: true
    items:
      $ref: "#/components/schemas/AgreementSignature"
    example:
      - ssn: "197701032380"
        real_name: Jan-Erik Karlsson
        created_at: 2019-04-12T08:23:29Z
        order_ref: d4ace777-6b91-4172-903e-39371ede89f1
      - ssn: "198112172385"
        real_name: Gustav Johan Larsson
        created_at: 2019-04-11T18:53:03Z
        order_ref: f5bce777-0b42-4222-1f3e-ab523ede7a5f
  parties:
    description: list of signers and delegates that are requested to sign the agreement
    type: array
    items:
      $ref: "#/components/schemas/AgreementParties"
    example:
      - ssn: "197701032380"
        name: Jan-Erik Karlsson
        email: je.karlsson.hem@email.nu
        role: signer
      - ssn: "198112172385"
        name: Gustav Larsson
        email: gustav123@mymail.com
        role: delegate
AgreementSignatureobject
title: AgreementSignature
type: object
properties:
  ssn:
    description: |
      Signer's unique SSN, format: `YYYYMMDDnnnn`
    type: string
    example: "191212121212"
  real_name:
    description: The real name of the signer, as provided by Mobile BankID service
    type: string
    example: Jan-Erik Karlsson
  created_at:
    description: The time when the signature was created
    type: string
    example: 2019-04-12T08:23:29Z
  order_ref:
    description: The unique ID of the signature
    type: string
    example: d4ace777-6b91-4172-903e-39371ede89f1
CompanyIdobject
title: CompanyId
type: object
required:
  - name
  - orgnr
properties:
  name:
    description: Legal name of Company
    type: string
    example: Kivra AB
  orgnr:
    description: Vat number of Company
    type: string
    example: SE556840226601
Parts_Responsiveobject
title: Parts_Responsive
type: object
required:
  - name
  - data
  - content_type
properties:
  name:
    description: Arbritrary file-name
    type: string
    example: document.pdf
  data:
    description: Base64-encoded data for the PDF content
    type: string
    format: Base64-encoded data
    example: REVBREJFRUY=
  content_type:
    description: The
      [IANA](http://www.iana.org/assignments/media-types/media-types.xhtml)
      media type for PDF files "application/pdf"
    type: string
    example: application/pdf
  responsive_part:
    type: object
    required:
      - name
      - data
      - content_type
    properties:
      name:
        description: Arbritrary file-name
        type: string
        example: document.html
      data:
        description: Base64-encoded data for the HTML document
        type: string
        format: Base64-encoded HTML data
        example: PGgxPmNvbnRlbnQgMTwvaDE+CjxwPmNvbnRlbnQgMTwvcD4=
      content_type:
        description: The
          [IANA](http://www.iana.org/assignments/media-types/media-types.xhtml)
          media type for HTML content "text/html"
        type: string
        example: text/html
Iconobject
title: Icon
type: object
required:
  - data
  - content_type
properties:
  name:
    description: Arbitrary filename
    type: string
    example: filename.pdf
  data:
    description: >
      Base64-encoded data. Max size is 134 kB when encoded which is roughly
      equivalent to 100 kB before encoding. The image format must be PNG. The
      image must be quadratic (that is, width and height must be the same). The
      sides must be at least 256 pixels long, and at most 512 pixels long. The
      image must have an alpha channel.
    type: string
    format: Base64-encoded data
    example: REVBREJFRUY=
  content_type:
    description: The
      [IANA](http://www.iana.org/assignments/media-types/media-types.xhtml)
      media type corresponding to the file, e.g. "image/png"
    type: string
    enum:
      - image/png
    example: image/png
PaymentOptionIconobject
title: PaymentOptionIcon
allOf:
  - $ref: "#/components/schemas/Icon"
  - type: object
    properties:
      data:
        description: This string is ignored by the documentation system
        type: string
        example: REVBREJFRUY=
Bookingobject
title: Booking
type: object
required:
  - title
  - start_time
properties:
  title:
    description: >
      Booking name that is used when creating a post in an external calendar.
      Note! Don’t include any personal or sensitive information here.
    type: string
    example: Kontroll av tandhälsa
  start_time:
    description: >
      Date and time for the booking to start. Must be in the future. If the time
      zone is not stated it will be set to UTC.
    type: string
    format: ISO8601
    example: 2028-06-19T11:00:00Z
  end_time:
    description: >
      Date and time for the booking to end. If present must be after start_time.
      If the time zone is not stated it will be set to UTC.
    type: string
    format: ISO8601
    example: 2028-06-19T12:00:00Z
  location:
    description: Location for the appointment/booking. Address must contain city for
      full functionality.
    type: string
    example: Strandvägen 61, Stockholm
  description:
    description: >
      Additional information. Note! Don’t include any personal or sensitive
      information here.
    type: string
    example: Brush your teeth before coming
  info_url:
    description: Link to page with additional information. The url must use the
      secure HTTPS protocol
    type: string
    format: uri
Formobject
title: Form
required:
  - id
  - days_to_expiry
type: object
properties:
  id:
    type: string
    format: uuid
    description: The form template key
    example: 2877d684-a340-4e4c-867f-d93283787b01
  sender_reference:
    type: object
    description: Reference data you want to include in the form response.
    example:
      internal_id: 6eb7d1b9-ccd6-408f-ade7-9a1837be3ecf
  days_to_expiry:
    type: integer
    minimum: 1
    maximum: 90
    description: >
      Number of days in which a response to the form can be submitted (until
      23:59:59).

      As an *example*, if *the content is sent* on September 8th, and the form
      expires in 30 days, it will effectively expire on October 7th 23:59:59.
    example: 30
Invoiceobject
title: Invoice
type: object
required:
  - total_amount_due
  - currency
anyOf:
  - title: Invoice
    required:
      - due_date
    anyOf:
      - title: bankgiro
        required:
          - bankgiro
      - title: plusgiro
        required:
          - plusgiro
  - title: Invoice Reminder
    required:
      - due_date
    anyOf:
      - title: bankgiro
        required:
          - bankgiro
      - title: plusgiro
        required:
          - plusgiro
  - title: Invoice Credit note
properties:
  total_amount_due:
    type: string
    pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
    description: Amount that remains to be paid to the supplier
    format: amount
    example: "1250.00"
  currency:
    type: string
    format: ISO4217
    pattern: ^[A-Z]{3}$
    description: Currency the invoice is issued in, e.g. SEK, EUR, USD
    example: SEK
  due_date:
    type: string
    format: date
    description: Date by which the invoice is to be paid (`YYYY-MM-DD`)
    example: 2026-11-30
  bankgiro:
    type: string
    pattern: ^[0-9]{3,4}-?[0-9]{4}$
    description: Bankgiro number to pay to. Invoices and reminders need bankgiro or plusgiro
    example: 991-2346
  plusgiro:
    type: string
    pattern: ^[0-9]{1,7}-?[0-9]$
    description: Plusgiro number to pay to. Invoices and reminders need bankgiro or plusgiro
    example: 837700-4
  invoice_number:
    type: string
    example: INV-2024-001
    description: Alphanumeric invoice identifier assigned by the supplier
  original_invoice_number:
    type: string
    example: INV-2023-999
    description: Invoice number of the original invoice that this reminder or credit
      note refers to
  invoice_date:
    type: string
    format: date
    description: Date the invoice was issued by the supplier (`YYYY-MM-DD`)
    example: 2026-10-31
  buyer_reference:
    type: string
    description: Reference provided by the buyer, such as a contact person or a
      project code ("Er referens")
    example: REF-12345
  order_number:
    type: string
    description: Identifier of the buyer's purchase order, used to track the
      transaction from order to invoice
    example: ORD-2024-789
  supplier_name:
    type: string
    description: Name of the company or individual issuing the invoice
    example: Supplier AB
  supplier_organisation_number:
    type: string
    pattern: ^[0-9]{6}-?[0-9]{4}$
    description: Swedish organisation number of the supplier
    example: 556840-2266
  supplier_vat_number:
    type: string
    pattern: ^[A-Z]{2}[A-Z0-9]{2,12}$
    description: VAT identification number of the supplier, country prefixed
    example: SE556840226601
  supplier_address_street:
    type: string
    description: Street address of the supplier
    example: Stora gatan 123
  supplier_address_postal_code:
    type: string
    description: Postal code of the supplier address
    example: "11122"
  supplier_address_city:
    type: string
    description: City of the supplier address
    example: Stockholm
  payment_reference:
    type: object
    description: Reference to state when paying, either a structured OCR number or free text
    required:
      - value
      - reference_type
    properties:
      value:
        type: string
        description: The reference value, an OCR number or free text depending on
          `reference_type`
      reference_type:
        type: string
        description: "`ocr` for a structured OCR number, `unstructured` for free text"
        enum:
          - ocr
          - unstructured
    example:
      payment_reference:
        value: "426523791"
        reference_type: ocr
  iban:
    type: string
    pattern: ^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$
    description: International Bank Account Number of the supplier
    example: SE4550000000058398257466
  bic:
    type: string
    pattern: ^[A-Z0-9]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$
    description: Bank Identifier Code (SWIFT code) of the supplier's bank
    example: ESSESESS
  total_amount_tax_exclusive:
    type: string
    pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
    description: Total amount excluding VAT
    format: amount
    example: "1000.00"
  total_amount_tax_inclusive:
    type: string
    pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
    description: Total amount including VAT
    format: amount
    example: "1250.00"
  total_vat_amount:
    type: string
    pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
    description: Total VAT amount
    format: amount
    example: "250.00"
  rounding_amount:
    type: string
    pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
    description: Rounding difference when the total is rounded to the nearest whole
      currency unit (öresavrundning)
    format: amount
    example: "0.00"
  total_amount_charge:
    type: string
    pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
    format: amount
    description: Sum of all document level charges such as shipping, handling or
      administrative fees
    example: "50.00"
  total_amount_discount:
    type: string
    pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
    format: amount
    description: Sum of all document level allowances and discounts
    example: "100.00"
  supplier_address_country:
    type: string
    pattern: ^[A-Z]{2}$
    format: ISO3166-1-alpha-2
    description: Country of the supplier address, e.g. SE
    example: SE
  supplier_reference:
    type: string
    description: Reference provided by the supplier, e.g. salesperson or contact
      person ("Vår referens")
    example: Anna Andersson
  buyer_name:
    type: string
    description: Full legal name of the company or individual purchasing the goods
      or services
    example: Example Corp AB
  buyer_organisation_number:
    type: string
    pattern: ^[0-9]{6}-?[0-9]{4}$
    description: Swedish organisation number of the buyer
    example: 556013-0717
  project_reference:
    type: string
    description: Project code or number associated with the invoice, used for
      project accounting
    example: PROJ-42
  cost_center_reference:
    type: string
    description: Cost center associated with the invoice, used for project accounting
    example: CC-100
  rows:
    type: array
    description: Invoice line items
    items:
      type: object
      properties:
        account:
          type: string
          description: Bookkeeping account number for the line item in the supplier's
            revenue tracking
          example: "3001"
        quantity:
          type: string
          pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]+)?$
          format: float
          description: Quantity of goods or services for the line item
          example: "2"
        description:
          type: string
          description: Description of the good or service
          example: Consulting hours
        price:
          type: string
          pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]+)?$
          format: float
          description: Unit price excluding VAT
          example: "500.00"
        product_number:
          type: string
          description: Product identifier (SKU or article number) assigned by the supplier
          example: SKU-001
        total:
          type: string
          pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
          format: amount
          description: Line item total, quantity x unit price excluding VAT
          example: "1000.00"
        unit:
          type: string
          description: Unit of measurement, a standard code such as PCE or HUR, or clear
            text such as st or tim
          example: HUR
        vat:
          type: string
          pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
          format: amount
          description: VAT rate in percent
          example: "25"
        discount:
          type: string
          pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]+)?$
          format: float
          description: Discount for the line item, an amount or a percentage depending on
            `discount_type`
          example: "10"
        discount_type:
          type: string
          enum:
            - percent
            - amount
          description: Whether discount is a percentage or a fixed amount
          example: percent
InviteResearchobject
title: InviteResearch
type: object
required:
  - description
  - uri
  - expires_at
  - behalf_of
properties:
  title:
    type: string
  description:
    type: string
    description: longer description
    example: |
      This is the heavy heavy monster sound
      The nuttiest sound around
  uri:
    type: string
    description: The uri to open when the user clicks the invitation. The uri must
      use the secure HTTPS protocol
    example: https://example.com
  behalf_of:
    type: object
    nullable: true
    description: Who this research is conducted on behalf of
    required:
      - name
      - vat_number
    properties:
      name:
        type: string
        description: Something
        example: Test Inc
      vat_number:
        type: string
        description: A Swedish VAT number ("momsregistreringsnummer").
        example: SE556840226601
  expires_at:
    description: >
      The expiration time for the survey, after this date, it will no longer be
      available.
    type: string
    nullable: true
    example: 2024-05-09T13:42:26Z
InviteGiftobject
title: InviteGift
type: object
required:
  - uri
  - expires_at
  - behalf_of
properties:
  uri:
    type: string
    description: The uri to open when the user clicks the invitation. The uri must
      use the secure HTTPS protocol
    example: https://example.com
  behalf_of:
    type: object
    nullable: true
    description: Who this gift is conducted on behalf of
    required:
      - name
      - vat_number
    properties:
      name:
        type: string
        description: Something
      vat_number:
        type: string
        description: A Swedish VAT number ("momsregistreringsnummer").
  expires_at:
    description: >
      The expiration time for the gift, after this date, it will no longer be
      available.
    type: string
    nullable: true
    example: 2024-05-09T13:42:26Z
InviteVoucherobject
title: InviteVoucher
type: object
required:
  - uri
  - expires_at
  - behalf_of
properties:
  store:
    type: object
    description: Where this voucher valid
    required:
      - name
    properties:
      name:
        type: string
  uri:
    type: string
    description: The uri to open when the user clicks the invitation. The uri must
      use the secure HTTPS protocol
    example: https://example.com
  behalf_of:
    type: object
    nullable: true
    description: Who this voucher is conducted on behalf of
    required:
      - name
      - vat_number
    properties:
      name:
        type: string
        description: Test AB
      vat_number:
        type: string
        description: A Swedish VAT number ("momsregistreringsnummer").
  expires_at:
    description: >
      The expiration time for the voucher, after this date, it will no longer be
      available.
    type: string
    nullable: true
    example: 2024-05-09T13:42:26Z
InviteSignobject
title: InviteSign
type: object
required:
  - uri
  - expires_at
  - behalf_of
  - service_provider
properties:
  service_provider:
    type: object
    description: The service provider used for signing the document
    required:
      - name
    properties:
      name:
        type: string
  uri:
    type: string
    description: The uri to open when the user clicks the document. The uri must use
      the secure HTTPS protocol
    example: https://example.com
  behalf_of:
    type: object
    nullable: true
    description: Who this document is delivered on behalf of
    required:
      - name
      - vat_number
    properties:
      name:
        type: string
        description: Test AB
      vat_number:
        type: string
        description: A Swedish VAT number ("momsregistreringsnummer").
  expires_at:
    description: >
      The expiration time for the document to be signed, after this date, it
      will no longer be available.
    type: string
    nullable: true
    example: 2024-05-09T13:42:26Z
  description:
    type: string
    description: Additional information. Note! Don't include any personal or
      sensitive information here.
Signedobject
title: Signed
type: object
required:
  - behalf_of
properties:
  behalf_of:
    type: object
    nullable: true
    description: Who this document is delivered on behalf of
    required:
      - name
      - vat_number
    properties:
      name:
        type: string
        description: Test AB
      vat_number:
        type: string
        description: A Swedish VAT number ("momsregistreringsnummer").
InviteKycobject
title: InviteKyc
type: object
required:
  - description
  - uri
  - expires_at
  - behalf_of
  - service_provider
properties:
  title:
    type: string
    nullable: true
    description: Title to present
    example: Hey you, dont watch that, watch this
  description:
    type: string
    description: longer description
    example: |
      This is the heavy heavy monster sound
      The nuttiest sound around
  uri:
    type: string
    description: The uri to open when the user clicks the invitation. The uri must
      use the secure HTTPS protocol
    example: https://example.com
  behalf_of:
    type: object
    nullable: true
    description: Who this KYC invite is conducted on behalf of
    required:
      - name
      - vat_number
    properties:
      name:
        type: string
        description: Something
        example: Test Inc
      vat_number:
        type: string
        description: A Swedish VAT number ("momsregistreringsnummer").
        example: SE556840226601
  expires_at:
    description: >
      The expiration time for the survey, after this date, it will no longer be
      available.
    type: string
    nullable: true
    example: 2024-05-09T13:42:26Z
  service_provider:
    type: object
    description: The service provider
    required:
      - name
    properties:
      name:
        type: string
RegisteredLetterobject
title: RegisteredLetter
type: object
required:
  - expires_at
  - hidden
properties:
  expires_at:
    type: string
    format: ISO8601
    description: When the registered letter expires, max 30 days from now.<br>- Time
      will always be set to end-of-day, regardless of whether time is specified
      or not.
  hidden:
    type: object
    required:
      - sender
      - subject
    description: Specifies which fields that should be hidden in the Kivra Inbox.
    properties:
      sender:
        type: boolean
        description: False if the sender name and icon should be shown in the Kivra Inbox.
      subject:
        type: boolean
        description: False if the subject should be shown in the Kivra Inbox.
  sender_reference:
    type: object
    nullable: true
    description: Any reference that the sender might want to include.
Campaignobject
title: Campaign
type: object
required:
  - tag
properties:
  tag:
    type: string
    description: The tag that refers to the campaign that you want to attach. Note
      that the request will still be processed even if the campaign does not
      exist.
    example: summer_2023
Partsobject
title: Parts
type: object
properties:
  content_type:
    type: string
    description: The IANA media type corresponding to the file, e.g. "application/pdf"
    example: application/pdf
  checksum:
    type: string
    description: The cheksum of the document calculated with md5
    example: 9209c7eebdd283a4c4bd7555e73e6064
  sha256:
    type: string
    description: hash of the document calculated with SHA-256
    example: 287f2fe67a8a76a10169aa6a885d21e1f83416c4831294ea5c4b0a38bda5c78d
  size:
    type: integer
    description: size of the document in bytes
    example: 163414
  body:
    type: string
    description: body of the content (present only if content_type is "text/html" or
      "text/plain")
    example: |-
      <!doctype html>
      <html class="....
  key:
    type: string
    description: >
      The unique key for the content file (present for all content that is not
      "text/html" or "text/plain")
    example: 15118724482475bf32615b4a2aaa604fd66377010e
VatNumberstring

A Swedish VAT number ("momsregistreringsnummer").

title: VatNumber
pattern: ^SE[0-9]{10}01$
description: A Swedish VAT number ("momsregistreringsnummer").
example: SE556000475501
type: string
PaymentWebhookDefinitionobject

A definition used to send webhooks from Kivra to a sender.

title: PaymentWebhookDefinition
description: |
  A definition used to send webhooks from Kivra to a sender.
type: object
properties:
  id:
    description: The ID of the current webhook definition.
    type: string
    format: uuid
  url:
    description: |
      The target URL that Kivra will try to deliver to. The
      hostname in the URL must not be in a restricted domain
      (like for example `example.org` or `local`). The
      hostname also must resolve to at least one IPv4 address,
      and must not resolve to any addresses in an IPv4 range
      reserved by IANA.
    type: string
    format: url
  cid_filter:
    description: |
      The client key filter for this webhook configuration.
    type: string
    pattern: ^[0-9]{10}[a-f0-9]{32}$
  tkey_filter:
    description: |
      The tenant key filter for this webhook cofiguration.
    type: string
    pattern: ^[0-9]{10}[a-f0-9]{32}$
  types:
    description: |
      A list of the types of payments that should trigger webhooks.
    type: array
    items:
      type: string
      enum:
        - instant
        - bank
        - autogiro
  events:
    description: |
      A list of the payment events that should trigger
      webhooks. Not all events are meaningful for all payment
      types.
    type: array
    items:
      type: string
      enum:
        - scheduled
        - settled
        - failed
        - declined
  secret:
    description: |
      The newly created secret after a webhook definition was added or
      modified. The secret is a 256-bit random number that will be used to
      sign webhook payloads from Kivra. If a secret already exists when
      a new one is added (that is, when a webhook definition is modified
      rather han created), payloads will be signed with both the existing
      and the new secrets for the next 72 hours.
      For security reasons, this field will be missing in
      reponses to API calls that do not result in the creation
      of a new secret.
    type: string
    format: base64
  created_at:
    description: |
      The time when this definition was created.
    type: string
    format: date-time
schema-salary-slipobject
title: schema-salary-slip
$schema: http://json-schema.org/draft-06/schema#
$id: https://se.kivra.com/schemas/json/salaryslip/v1.0
type: object
additionalProperties: false
properties:
  document_metadata:
    type: object
    description: Metadata about the salary slip document creation and source.
    additionalProperties: false
    properties:
      creation_timestamp:
        type: string
        format: date-time
        description: Timestamp when this salary slip document was created in the source
          system. ISO 8601 format in UTC with no timezone offset (e.g.,
          YYYY-MM-DDTHH:MM:SSZ).
        example: 2025-01-05T10:00:00Z
      source_system:
        type: string
        description: Name or identifier of the payroll system that generated this salary
          slip.
        example: Payroll System XYZ
    required:
      - creation_timestamp
      - source_system
  employment:
    type: object
    description: Employment details for the employee.
    additionalProperties: false
    properties:
      start_date:
        type: string
        format: date
        pattern: ^[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
        description: Date when the employment started. YYYY-MM-DD
        example: 2025-01-01
      type:
        type: string
        description: Type of employment.
        example: full-time
      weekly_hours:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Number of weekly working hours.
        example: "40.0"
      organizational_unit_identifier:
        type: string
        description: Identifier for the organizational unit or department.
        example: DEPT-001
      employer:
        type: object
        description: Information about the employer paying the salary.
        additionalProperties: false
        properties:
          legal_name:
            type: string
            description: Legal name of the employer.
            example: Tech Solutions AB
          legal_identifiers:
            type: object
            additionalProperties: false
            properties:
              vat_number:
                type: string
                description: Employer VAT number.
                example: SE212000014201
              org_number:
                type: string
                description: Employer organization identifier.
                example: 212000-0142
            required:
              - vat_number
              - org_number
          contact_information:
            type: object
            additionalProperties: false
            properties:
              address:
                type: object
                description: Physical address of the employer.
                additionalProperties: false
                properties:
                  street_address:
                    type: string
                    description: Street address of the employer.
                    example: Storvägen 5
                  postal_code:
                    type: string
                    description: Postal code.
                    example: 164 40
                  city:
                    type: string
                    description: City name.
                    example: Kista
                  country:
                    type: string
                    description: Country name.
                    example: Sweden
                required:
                  - street_address
                  - postal_code
                  - city
                  - country
              email_address:
                type: string
                format: email
                description: Email address of the employer.
                example: hr@techsolutions.se
              telephone_number:
                type: string
                format: telephone-number
                pattern: ^([0-9]|([+][1-9][0-9]{,2}))([0-9]|[ ]|-)*[0-9]$
                description: Telephone number of the employer. Spaces and dashes allowed, but no
                  parentheses.
                example: +46 770-457 000
            required:
              - address
              - email_address
              - telephone_number
        required:
          - legal_name
          - legal_identifiers
          - contact_information
    required:
      - employer
  yearly_accumulated_gross_pay:
    type: object
    description: Total accumulated gross salary for the year to date.
    additionalProperties: false
    properties:
      monetary_amount:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Total accumulated gross salary for the year to date.
        example: "140000.00"
      currency:
        type: string
        format: currency-code
        pattern: ^[A-Z]{3}$
        description: ISO 4217 currency code (3 uppercase letters)
        example: SEK
    required:
      - monetary_amount
      - currency
  yearly_accumulated_taxes:
    type: object
    description: Total accumulated taxes deducted for the year to date.
    additionalProperties: false
    properties:
      monetary_amount:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Total accumulated taxes deducted for the year to date.
        example: "30000.00"
      currency:
        type: string
        format: currency-code
        pattern: ^[A-Z]{3}$
        description: ISO 4217 currency code (3 uppercase letters)
        example: SEK
    required:
      - monetary_amount
      - currency
  pay_period:
    type: object
    description: Information about the current pay period, including dates, salary,
      gross and net pay, and tax deducted.
    additionalProperties: false
    properties:
      start_date:
        type: string
        format: date
        pattern: ^[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
        description: Start date of the pay period. YYYY-MM-DD
        example: 2025-01-01
      end_date:
        type: string
        format: date
        pattern: ^[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
        description: End date of the pay period. YYYY-MM-DD
        example: 2025-01-31
      payout_date:
        type: string
        format: date
        pattern: ^[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
        description: Date when the salary will be paid out to the employee. YYYY-MM-DD
        example: 2025-02-25
      total_hours_worked:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Total number of hours worked during the pay period.
        example: "160.0"
      overtime_hours:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Number of overtime hours worked during the pay period.
        example: "8.0"
      effective_tax_rate_percentage:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Effective tax rate as a percentage.
        example: "21.43"
      absences:
        type: array
        description: List of absences during this pay period.
        items:
          type: object
          additionalProperties: false
          properties:
            type:
              type: string
              description: Type of absence.
              example: sick leave
            duration_in_hours:
              type: string
              format: amount
              pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
              description: Duration of the absence in hours.
              example: "8.0"
          required:
            - type
            - duration_in_hours
      vacation_pay:
        type: object
        description: Vacation pay amount for this pay period.
        additionalProperties: false
        properties:
          monetary_amount:
            type: string
            format: amount
            pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
            description: Vacation pay amount for this period.
            example: "1500.00"
          currency:
            type: string
            format: currency-code
            pattern: ^[A-Z]{3}$
            description: ISO 4217 currency code (3 uppercase letters)
            example: SEK
        required:
          - monetary_amount
          - currency
      basic_contractual_salary:
        type: object
        description: Basic contractual salary for this pay period.
        additionalProperties: false
        properties:
          monetary_amount:
            type: string
            format: amount
            pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
            description: Basic contractual salary for this pay period.
            example: "30000.00"
          currency:
            type: string
            format: currency-code
            pattern: ^[A-Z]{3}$
            description: ISO 4217 currency code (3 uppercase letters)
            example: SEK
        required:
          - monetary_amount
          - currency
      gross_pay:
        type: object
        description: Total gross salary for this pay period before tax deductions.
        additionalProperties: false
        properties:
          monetary_amount:
            type: string
            format: amount
            pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
            description: Total gross salary for this pay period before tax deductions.
            example: "32500.00"
          currency:
            type: string
            format: currency-code
            pattern: ^[A-Z]{3}$
            description: ISO 4217 currency code (3 uppercase letters)
            example: SEK
        required:
          - monetary_amount
          - currency
      tax_deducted:
        type: object
        description: Total tax deducted from the gross pay for this pay period.
        additionalProperties: false
        properties:
          monetary_amount:
            type: string
            format: amount
            pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
            description: Total tax deducted from the gross pay for this period.
            example: "6962.50"
          currency:
            type: string
            format: currency-code
            pattern: ^[A-Z]{3}$
            description: ISO 4217 currency code (3 uppercase letters)
            example: SEK
        required:
          - monetary_amount
          - currency
      additional_payments:
        type: array
        description: List of additional payments for this pay period.
        items:
          type: object
          additionalProperties: false
          properties:
            type:
              type: string
              description: Type of additional payment.
              example: overtime
            monetary_amount:
              type: string
              format: amount
              pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
              description: Amount of the additional payment.
              example: "2000.00"
            currency:
              type: string
              format: currency-code
              pattern: ^[A-Z]{3}$
              description: ISO 4217 currency code (3 uppercase letters)
              example: SEK
          required:
            - type
            - monetary_amount
            - currency
      net_pay:
        type: object
        description: Net salary to be paid out to the employee after all deductions.
        additionalProperties: false
        properties:
          monetary_amount:
            type: string
            format: amount
            pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
            description: Net salary to be paid out to the employee after all deductions.
            example: "25537.50"
          currency:
            type: string
            format: currency-code
            pattern: ^[A-Z]{3}$
            description: ISO 4217 currency code (3 uppercase letters)
            example: SEK
        required:
          - monetary_amount
          - currency
      employee_benefits:
        type: array
        description: Employee benefits provided by the employer.
        items:
          type: object
          additionalProperties: false
          properties:
            type:
              type: string
              description: Type of benefit.
              example: gym membership
            monetary_amount:
              type: string
              format: amount
              pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
              description: Benefit amount.
              example: "1500.00"
            currency:
              type: string
              format: currency-code
              pattern: ^[A-Z]{3}$
              description: ISO 4217 currency code (3 uppercase letters)
              example: SEK
            description:
              type: string
              description: Full description of benefit.
              example: Monthly gym allowance.
          required:
            - type
            - monetary_amount
            - currency
    required:
      - start_date
      - end_date
      - payout_date
      - gross_pay
      - tax_deducted
      - net_pay
  tax_information:
    type: object
    description: Tax-related information for this pay period.
    additionalProperties: false
    properties:
      tax_code:
        type: object
        description: Tax code information used for this employee.
        additionalProperties: false
        properties:
          identifier:
            type: string
            description: Tax code identifier.
            example: Tabell 30
          schema:
            type: string
            description: Tax code schema or system.
            example: Skatteverket Tax Table
        required:
          - identifier
          - schema
      tax_deduction_details:
        type: object
        description: Details about tax deductions for this employee.
        additionalProperties: false
        properties:
          is_main_income:
            type: boolean
            description: Whether this is the employee's main source of income.
            example: true
          details_provided_by:
            type: string
            description: Authority or organization providing the tax deduction details.
            example: Skatteverket
  recipient_account:
    type: object
    description: Bank account information where the salary will be paid.
    additionalProperties: false
    properties:
      identifier:
        type: string
        description: Account identifier (e.g., IBAN or local account number).
        example: SE4550000000050012345678
      schema:
        type: string
        description: Schema or format of the account identifier (e.g., "IBAN", "Account
          Number", "Bankgiro", "Plusgiro").
        example: IBAN
      bank_name:
        type: string
        description: Name of the bank.
        example: Bank of Sweden
    required:
      - identifier
  holidays:
    type: object
    description: Holiday and vacation information for the employee.
    additionalProperties: false
    properties:
      period:
        type: object
        description: The period covered by this holiday information.
        additionalProperties: false
        properties:
          start_date:
            type: string
            format: date
            pattern: ^[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
            description: Start date of the holiday period. YYYY-MM-DD
            example: 2024-04-01
          end_date:
            type: string
            format: date
            pattern: ^[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
            description: End date of the holiday period. YYYY-MM-DD
            example: 2025-03-31
        required:
          - start_date
          - end_date
      total_days_entitled:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Total number of vacation days the employee is entitled to.
        example: "25.0"
      days_saved_from_previous_years:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Number of vacation days saved from previous years.
        example: "3.0"
      days_used_in_period:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Number of vacation days used during this period.
        example: "0.0"
      days_remaining_in_period:
        type: string
        format: amount
        pattern: ^[-]?(0|[1-9][0-9]*)([.][0-9]{1,2})?$
        description: Number of vacation days remaining after this period.
        example: "28.0"
required:
  - document_metadata
  - employment
  - pay_period
schema-v2-tenantkey-content-responseobject
title: schema-v2-tenantkey-content-response
type: object
properties:
  subject:
    type: string
    example: Invoice for November 2025
    description: Same data as provided by the sender in the input
  generated_at:
    type: string
    format: ISO8601
    example: 2025-10-31
    description: Same data as provided by the sender in the input
  type:
    type: string
    example: invoice
    description: Same data as provided by the sender in the input