swagger: '2.0'
info:
  title: Payments API
  contact:
    name: API Integration Support
    email: integration@dintero.com
  description: |
    Public endpoints for payments, including checkout, payout and settlement reports.
  version: LATEST
  license:
    name: UNLICENSED
    url: https://dintero.com
  x-logo:
    url: https://docs.dintero.com/img/dintero-dark-padded.svg
    altText: Dintero Logo
consumes:
  - application/json
produces:
  - application/json
security:
  - apikey: []
tags:
  - name: Transactions
    x-displayName: Transactions
    description: |
      View and perform operations on transactions
  - name: session
    x-displayName: Sessions
    description: |
      A Checkout Session relates to an order in your system.
      When an order has been placed you create a corresponding Checkout Session
      to receive payment for that order.
  - name: payment
    x-displayName: Payment
    description: |
      Resources used by the customer aka user to complete the payment of a
      session.
  - name: settlements
    x-displayName: Settlement reports
    description: Get settlement reports generated per payout
  - name: settlements.configuration
    x-displayName: Configuration
    description: Configure settlement reports
  - name: reports
    x-displayName: Reports
    description: List the generated monthly transaction reports
  - name: example-session-callbacks
    x-displayName: Callback
    description: |
      Example of recieved callbacks from Dintero's servers.
  - name: fund-transfers
    x-displayName: Fund Transfer
    description: Transfer funds between sellers
  - name: Sellers
    x-displayName: Sellers
    description: Manage the signup of a new Seller / Merchant account
  - name: example-session-callbacks
    x-displayName: Example Callbacks
    description: Example of callbacks delivered
  - name: v2-fund-transfers
    x-displayName: Fund Transfer
    description: Transfer funds between sellers
  - name: v2-config-payout-destinations
    x-displayName: Sellers
    description: Get payout data for sellers
paths:
  /sessions-profile:
    post:
      operationId: checkout_session_profile_post
      summary: Create checkout session from profile
      description: |
        Create a corresponding Checkout Session for an order placed in your system
        using predefined session profile

        #### Session with Instabank

        Note that `items` is a required property when creating a session with
        Instabank configured.

        scopes:
        - admin:checkout
        - write:checkout
      tags:
        - session
        - Sessions
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      parameters:
        - name: options
          in: body
          schema:
            allOf:
              - $ref: '#/definitions/SessionProfile'
              - $ref: '#/definitions/SessionCustomerTokens'
              - $ref: '#/definitions/SessionCustomerGiftcards'
              - $ref: '#/definitions/Metadata'
          required: true
        - name: include_session
          in: query
          type: boolean
          description: |
            Include all details about the session created
        - $ref: '#/parameters/FeatureToggles'
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          $ref: '#/responses/SessionCreated'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /sessions/{session_id}:
    get:
      operationId: checkout_session_get
      summary: Get checkout session details
      description: |
        scopes:
        - admin:checkout
        - read:checkout
      tags:
        - session
        - Sessions
      x-scopes:
        - admin:checkout
        - read:checkout
      security:
        - apikey: []
        - JWT: []
      consumes: []
      parameters:
        - $ref: '#/parameters/SessionId'
        - name: includes
          in: query
          type: array
          description: |
            Include aditional data that are by default excluded from the session details.

            - **`events.request_headers`** Include the event headers stored for each event
            - **`initiating_system_request_headers`** Include the request headers from the initating system
          required: false
          collectionFormat: multi
          items:
            type: string
            enum:
              - events.request_headers
              - initiating_system_request_headers
      responses:
        '200':
          description: checkout session
          schema:
            allOf:
              - $ref: '#/definitions/Id'
              - $ref: '#/definitions/Session'
              - $ref: '#/definitions/SessionRead'
              - $ref: '#/definitions/SessionCancelled'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
    put:
      operationId: checkout_session_put
      summary: Update checkout session details
      description: |
        Session must be locked for paying before updating.

        **Requirements**:
        - `order.shipping_option` must be included in `express_shipping_options` if both are set.
        - `order.amount` must be equal to the sum of `order.items` and `order.shipping_option`

        scopes:
        - admin:checkout
        - read:checkout
      tags:
        - session
        - Sessions
      x-scopes:
        - admin:checkout
        - read:checkout
      security:
        - apikey: []
        - JWT: []
      consumes: []
      parameters:
        - $ref: '#/parameters/SessionId'
        - name: force_shipping_address_callback
          description: |
            If `express.shipping_options` is set, there will not be a callback to `shipping_address_callback_url`,
            unless `force_shipping_address_callback` is also set.

            If `express.shipping_options` is not set, there will be a callback to `shipping_address_callback_url`.
          in: query
          type: boolean
          default: false
        - name: update_without_lock
          description: |
            Allow updating session without it having been locked first. 

            Allowed for server-to-server when the checkout has not been rendered yet.
          in: query
          type: boolean
          default: false
        - name: options
          in: body
          schema:
            allOf:
              - $ref: '#/definitions/UpdateSessionOptions'
          required: true
        - $ref: '#/parameters/FeatureToggles'
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          description: checkout session
          schema:
            allOf:
              - $ref: '#/definitions/Id'
              - $ref: '#/definitions/Session'
              - $ref: '#/definitions/SessionRead'
              - $ref: '#/definitions/SessionCancelled'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
  /sessions/{session_id}/cancel:
    post:
      operationId: checkout_session_cancel_post
      summary: Cancel session
      description: |

        Cancel a session

        The session transaction will be voided in case where it is
        initialized or authorized.

        Cancel is not allowed in case where the current transaction
        state is not initialized or authorized.

        scopes:
        - admin:checkout
        - write:checkout
      tags:
        - session
        - Sessions
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      consumes: []
      parameters:
        - $ref: '#/parameters/SessionId'
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          description: checkout session
          schema:
            allOf:
              - $ref: '#/definitions/Id'
              - $ref: '#/definitions/Session'
              - $ref: '#/definitions/SessionRead'
              - $ref: '#/definitions/SessionCancelled'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
  /sessions/payment-token:
    post:
      operationId: checkout_payment_token_session_post
      summary: Payment token session
      description: |

        This endpoint lets you create payment and recurrence tokens without reserving
        or charging any amount.

        The URL returned by this endpoint opens a web site where the customer
        can enter their payment details, e.g. card information.

        The payment details will be validated and a transaction with a
        payment/recurrence token will be created on success containing the payment
        token created from the customer payment details.

        - [GET /v1/transactions/{id}?includes=card.payment_token](#operation/transactions_id_get)
        - [GET /v1/transactions/{id}?includes=card.recurrence_token](#operation/transactions_id_get)

        scopes:
        - admin:checkout
        - write:checkout
      tags:
        - session
        - Sessions
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      parameters:
        - name: options
          in: body
          schema:
            type: object
            required:
              - session
              - token_provider
            properties:
              session:
                description: |
                  The session to create the payment token from
                allOf:
                  - $ref: '#/definitions/SessionPaymentToken'
                  - $ref: '#/definitions/Metadata'
              token_provider:
                description: |
                  The type of token to fetch
                $ref: '#/definitions/TokenProvider'
          required: true
        - name: include_session
          in: query
          type: boolean
          description: |
            Include all details about the session created
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          $ref: '#/responses/SessionCreated'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /transactions/{id}/capture:
    post:
      operationId: transactions_id_capture_post
      summary: Capture a transaction
      description: |
        Captures a transaction that was created with the Checkout
        endpoint with a `capture_now` value of `false`.

        #### Capture Instabank transaction

        Note that `items` is required when capturing a transaction
        with `payment_product=instabank`. The items must include
        the lines to Capture, with `line_id`, `quantity` and `amount`.

        scopes:
        - admin:checkout
        - write:checkout
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      tags:
        - Transactions
      parameters:
        - $ref: '#/parameters/TransactionId'
        - name: includes
          in: query
          type: array
          description: |
            Include aditional data in the returned data that are by default excluded from the transaction details.

            - **`events.request_headers`** Include the event headers stored for each event **deprecated**
            - **`initiating_system_request_headers`** Include the request headers from the initating system **deprecated**

            From 2023-09, `events.request_headers` and `initiating_system_request_headers` will be included by default
          required: false
          collectionFormat: multi
          items:
            type: string
            enum:
              - events.request_headers
              - initiating_system_request_headers
        - name: data
          in: body
          schema:
            allOf:
              - $ref: '#/definitions/StringMetadata'
              - type: object
                required:
                  - amount
                properties:
                  amount:
                    type: integer
                    format: int32
                    description: The amount to be captured
                    example: 29990
                  capture_reference:
                    type: string
                    description: |
                      A reference specified by the merchant to identify the
                      transaction
                  items:
                    type: array
                    description: |
                      Info about the captured order items

                      #### Instabank
                      `required` if the transaction `payment_product` is *instabank*.
                      The capture will then be applied to the items included.
                    items:
                      allOf:
                        - $ref: '#/definitions/OrderItem'
                        - required:
                            - amount
                            - line_id
                          properties:
                            discount_lines:
                              description: Metadata about discounts given
                              type: array
                              items:
                                $ref: '#/definitions/DiscountItem'
                            line_id:
                              type: string
                              description: |
                                the number of the line (or id), must be `unique` between
                                all items. `required` when Instabank payment is configured.
                              example: '1'
                            amount:
                              type: integer
                              description: |
                                The total monetary amount of the line item
                              example: 29990
                              format: int32
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          description: Capture created
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
        '202':
          $ref: '#/responses/TransactionOperationAccepted'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
        '503':
          $ref: '#/responses/Conflict'
  /transactions/{id}/authorization:
    post:
      operationId: transaction_tid_extend_authorization_post
      summary: Update transaction authorization
      description: |
        This endpoint is used to update an existing authorization:

        **Use cases:**

        1. **Extend authorization**
           - Provider: `klarna`
           - Purpose: Extend the lifetime of an existing authorization.
           - Required fields:
             - `reason` (string): The reason for the extension.
             - `reference` (string): A reference specified by the merchant to identify the transaction.

        2. **Update pre-authorization**
           - Provider: `dintero_psp`
           - Purpose: Update the pre-authorized amount and/or finalize the authorization.
           - Required fields:
             - `amount` (number):  
               The new amount to authorize.
               - If `final_authorization=false`, the new amount **must be greater than** the previous pre-authorized amount.
               - If `final_authorization=true`, the amount **may be increased, reduced, or unchanged**.
             - `final_authorization` (boolean):
               Indicates whether this is the final authorization step.
               - `true`: Finalizes the authorization and locks the transaction for further updates.
               - `false`: Keeps the pre-authorization open for future updates.
             - `reference` (string): Optional merchant reference to identify the transaction.
             - `items` (array): Optional list of transaction items to update. If the transaction already has items, this field is required. When present, sum of item amounts must equal the updated transaction amount.

        ---
        **Notes:**
        - For extend authorization: Only `reason` and `reference` are relevant.
        - For pre-authorization: Only `amount`, `final_authorization`, and `reference` are relevant.
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      tags:
        - Transactions
      parameters:
        - $ref: '#/parameters/TransactionId'
        - name: body
          in: body
          schema:
            type: object
            properties:
              reason:
                type: string
                description: The reason of the extension
              reference:
                type: string
                description: |
                  A reference specified by the merchant to identify the
                  transaction
              amount:
                type: number
                description: The new amount to authorize.
              final_authorization:
                type: boolean
                description: |
                  Indicates whether this is the final authorization step.
              items:
                type: array
                description: |
                  Optional list of transaction items to update.
                  If the transaction already has items, this field is required.
                  When present, sum of item amounts must equal the updated transaction amount.
                items:
                  allOf:
                    - $ref: '#/definitions/OrderItem'
                    - $ref: '#/definitions/OrderDiscountItem'
      responses:
        '200':
          description: Transaction updated
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
        '400':
          $ref: '#/responses/BadRequest'
        '404':
          $ref: '#/responses/NotFound'
        '409':
          $ref: '#/responses/Conflict'
        '500':
          $ref: '#/responses/ServerError'
  /transactions/{id}/refund:
    post:
      operationId: transactions_id_refund_post
      summary: Refund transaction
      description: |
        Once a transaction has been successfully captured,
        a refund operation is available. Like other operations,
        refund can be partial or total

        #### Refund Instabank transaction

        Note that `items` is required when refunding a transaction
        with `payment_product=instabank`. The items must include the
        lines to Refund, with `line_id`, `quantity` and `amount`.

        scopes:
        - admin:checkout
        - write:checkout
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      tags:
        - Transactions
      parameters:
        - $ref: '#/parameters/TransactionId'
        - name: includes
          in: query
          type: array
          description: |
            Include aditional data in the returned data that are by default excluded from the transaction details.

            - **`events.request_headers`** Include the event headers stored for each event **deprecated**
            - **`initiating_system_request_headers`** Include the request headers from the initating system **deprecated**

            From 2023-09, `events.request_headers` and `initiating_system_request_headers` will be included by default
          required: false
          collectionFormat: multi
          items:
            type: string
            enum:
              - events.request_headers
              - initiating_system_request_headers
        - name: refunds
          in: body
          schema:
            allOf:
              - $ref: '#/definitions/StringMetadata'
              - type: object
                required:
                  - amount
                properties:
                  amount:
                    type: integer
                    format: int32
                    description: The amount to be refunded
                  reason:
                    type: string
                    description: The reason of the refund
                  refund_reference:
                    type: string
                    description: |
                      A reference specified by the merchant to identify the
                      transaction
                  items:
                    type: array
                    description: |
                      Info about the refunded order items

                      #### Instabank
                      `required` if the transaction `payment_product` is *instabank*.
                      The refund will then be applied to the items included.
                    items:
                      allOf:
                        - $ref: '#/definitions/OrderItem'
                        - required:
                            - amount
                            - line_id
                          properties:
                            discount_lines:
                              description: Metadata about discounts given
                              type: array
                              items:
                                $ref: '#/definitions/DiscountItem'
                            line_id:
                              type: string
                              description: |
                                the number of the line (or id), must be `unique` between
                                all items. `required` when Instabank payment is configured.
                              example: '1'
                            amount:
                              type: integer
                              format: int32
                              description: |
                                The total monetary amount of the line item
                              example: 29990
          required: true
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          description: Refund created
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
        '202':
          $ref: '#/responses/TransactionOperationAccepted'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
        '503':
          $ref: '#/responses/ProcessorTemporarilyUnavailable'
  /transactions/{id}/void:
    post:
      operationId: transactions_id_void_post
      summary: Void transaction
      description: |
        At any moment before capture of a transaction, it is
        possible to cancel an authorization. This operation is
        called voiding and can be performed by doing a POST to
        this endpoint

        #### Void on part capture

        Void after a part capture will cancel the difference between
        the capture amount and the authorization amount.

        Void on part capture is only supported on following types:
          - `payex.creditcard`
          - `payex.mobilepay`
          - `payex.vipps`
          - `payex.applepay`
          - `payex.clicktopay`
          - `payex.googlepay`
          - `vipps`
          - `klarna.klarna`
          - `klarna.billie`

        scopes:
        - admin:checkout
        - write:checkout
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      tags:
        - Transactions
      parameters:
        - $ref: '#/parameters/TransactionId'
        - name: includes
          in: query
          type: array
          description: |
            Include aditional data in the returned data that are by default excluded from the transaction details.

            - **`events.request_headers`** Include the event headers stored for each event **deprecated**
            - **`initiating_system_request_headers`** Include the request headers from the initating system **deprecated**

            From 2023-09, `events.request_headers` and `initiating_system_request_headers` will be included by default
          required: false
          collectionFormat: multi
          items:
            type: string
            enum:
              - events.request_headers
              - initiating_system_request_headers
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          description: Transaction voided
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
        '202':
          $ref: '#/responses/TransactionOperationAccepted'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
        '503':
          $ref: '#/responses/ProcessorTemporarilyUnavailable'
  /transactions/{id}:
    get:
      operationId: transactions_id_get
      summary: Get a transaction
      description: |
        scopes:
        - admin:checkout
        - read:checkout
      x-scopes:
        - admin:checkout
        - read:checkout
      security:
        - apikey: []
        - JWT: []
      tags:
        - Transactions
      consumes: []
      parameters:
        - $ref: '#/parameters/TransactionId'
        - name: includes
          in: query
          type: array
          description: |
            Include additional data that are by default excluded from the transaction details.

            - **`card.payment_token`**: Include the payment_token generated from the transaction.
              Only available for transaction with a session that enabled generate_payment_token.
            - **`card.recurrence_token`**: Include the recurrence generated from the transaction.
              Only available for transaction with a session that enabled generate_recurrence_token.
            - **`session`** Include the session that the transaction resulted from.
            - **`session.events.latest`** Include the session that the transaction resulted from with only the latest event in its events array.
            - **`events.request_headers`** Include the event headers stored for each event.
            - **`events.success.true`** Include events where success is true.
            - **`initiating_system_request_headers`** Include the request headers from the initiating system.
          required: false
          collectionFormat: multi
          items:
            type: string
            enum:
              - card.payment_token
              - card.recurrence_token
              - session
              - session.events.latest
              - events.request_headers
              - events.success.true
              - initiating_system_request_headers
      responses:
        '200':
          description: Transaction
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
        '503':
          $ref: '#/responses/ProcessorTemporarilyUnavailable'
    put:
      operationId: transactions_id_put
      summary: Update a transaction
      description: |
        scopes:
        - admin:checkout
        - write:checkout
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      tags:
        - Transactions
      consumes: []
      parameters:
        - $ref: '#/parameters/TransactionId'
        - name: data
          in: body
          schema:
            type: object
            properties:
              merchant_reference_2:
                type: string
                description: A reference specified by the merchant to identify the transaction, can be updated after the transaction has been created
      responses:
        '200':
          description: Transaction
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
        '503':
          $ref: '#/responses/ProcessorTemporarilyUnavailable'
  /transactions:
    get:
      operationId: transactions_get
      summary: List all transactions
      description: |
        scopes:
        - admin:checkout
        - read:checkout
      x-scopes:
        - admin:checkout
        - read:checkout
      security:
        - apikey: []
        - JWT: []
      tags:
        - Transactions
      consumes: []
      parameters:
        - $ref: '#/parameters/Ids'
        - $ref: '#/parameters/Limit'
        - $ref: '#/parameters/StartingAfter'
        - name: status
          in: query
          type: array
          description: |
            The status of the transaction.
          required: false
          collectionFormat: multi
          items:
            type: string
            enum:
              - AUTHORIZATION_VOIDED
              - AUTHORIZED
              - CAPTURED
              - DECLINED
              - FAILED
              - INITIATED
              - ON_HOLD
              - PARTIALLY_CAPTURED
              - PARTIALLY_REFUNDED
              - PARTIALLY_CAPTURED_REFUNDED
              - REFUNDED
              - UNKNOWN
        - name: payment_product
          in: query
          type: array
          collectionFormat: multi
          items:
            type: string
          description: The type of payment product used
        - name: payment_product_type
          in: query
          type: array
          collectionFormat: multi
          items:
            type: string
          description: The payment product type
        - name: card_brand
          in: query
          type: array
          collectionFormat: multi
          items:
            type: string
          description: The card brand for the payment
        - name: merchant_reference
          in: query
          type: string
          description: The merchant reference used
        - name: merchant_reference_2
          in: query
          type: string
          description: The second merchant reference on the transaction
        - name: session_id
          in: query
          type: array
          collectionFormat: multi
          description: |
            The session id(s) associated with the transactions. ?session_id=A&session_id=B&session_id=X.
          items:
            type: string
            format: checkout-id
        - name: store_id
          in: query
          type: array
          collectionFormat: multi
          description: |
            The store_id that the transaction belongs to. ?store_id=A&store_id=B&store_id=X.
          items:
            type: string
        - name: payout_correlation_id
          in: query
          type: array
          collectionFormat: csv
          description: |
            Filter by the `payout_correlation_id`. Different format between payment providers. ?payout_correlation_id=A,B
          items:
            type: string
        - name: currency
          in: query
          type: array
          collectionFormat: multi
          description: |
            The currency of the transaction. ?currency=NOK&currency=SEK.
          items:
            type: string
        - name: amount
          in: query
          type: integer
          description: Exact transaction amount, amount authorized.
          minimum: 0
        - name: amount.gte
          in: query
          type: integer
          description: Lower limit for filtering on transaction amount, amount authorized.
          minimum: 0
        - name: amount.lte
          in: query
          type: integer
          description: Upper limit for filtering on transaction amount, amount authorized.
        - name: created_at.gte
          in: query
          type: string
          format: isodate
          description: Transaction created after (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
        - name: created_at.lte
          in: query
          type: string
          format: isodate
          description: Transaction created before a date (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
        - name: captured_at.gte
          in: query
          type: string
          format: isodate
          description: Transaction captured after date (This param is subject to change in the future) (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
        - name: captured_at.lte
          in: query
          type: string
          format: isodate
          description: Transaction captured before date (This param is subject to change in the future) (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
        - name: refunded_at.gte
          in: query
          type: string
          format: isodate
          description: Transaction refunded after date (This param is subject to change in the future) (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
        - name: refunded_at.lte
          in: query
          type: string
          format: isodate
          description: Transaction refunded before date (This param is subject to change in the future) (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
        - name: search
          in: query
          type: string
          description: |
            Will try to match the search to either transaction_id, session_id or merchant_reference, merchant_reference_2,
            phone_number, email or the customer name using the format `{first_name} {last_name}`, or token_id using value of `card.payment_token_id`.
        - name: payment_operation
          in: query
          type: string
          x-example: unscheduled_purchase
          description: |
            Filter on `payment_operation`
        - name: customer_id
          in: query
          type: string
          description: Filter transactions on the `customer.customer_id`.
        - name: includes
          in: query
          type: array
          description: |
            Control the data that is included in the transactions

            - **`events.success.true`** Include only event where success is true
          required: false
          collectionFormat: multi
          items:
            type: string
            enum:
              - events.success.true
        - name: payout_destination_id
          in: query
          type: string
          description: |
            Filter transactions on `payout_destination_id` and `items[].splits[].payout_destination_id`.
        - name: token_id
          in: query
          type: array
          collectionFormat: multi
          description: |
            Filter transactions on token_id(s) associated with the transactions, using `card.payment_token_id`. ?token_id=A&token_id=B&token_id=X.
          items:
            type: string
      responses:
        '200':
          description: Transactions
          schema:
            type: array
            items:
              allOf:
                - $ref: '#/definitions/Transaction'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /accounts/{aid}/settlements:
    get:
      operationId: aid_settlements_list
      summary: List settlements
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        List settlements

        *scopes*:
          - admin:billing
          - read:billing
          - admin:reports
          - read:reports
          - admin:settlements
          - read:settlements
      x-scopes:
        - admin:billing
        - read:billing
        - admin:reports
        - read:reports
        - admin:settlements
        - read:settlements
      consumes:
        - application/json
      tags:
        - settlements
      parameters:
        - $ref: '#/parameters/accountId'
        - name: limit
          in: query
          description: |
            A limit on the number of objects to be returned. Limit can range
            between 1 and 1000 items, and the default is 10 items.
          type: integer
          minimum: 1
          maximum: 1000
          default: 10
        - name: starting_after_id
          in: query
          description: |
            cursor for use in pagination. starting_after_id is an object ID
            that defines your place in the list, included in the `last_evaluated_key`.

            For instance, if you make a list request and receive 100 objects,
            ending with `obj_foo` and `settled_at=2021-02-02`, your subsequent call
            can include `starting_after_id=obj_foo&starting_after_date=2021-02-02` in
            order to fetch the next page of the list.

            > Note that you need to use the `created_at` as value for `starting_after_date`
            > if used in combination with `item_created_at.gte` or `item_created_at.lte`

            Must be used together with `starting_after_date`
          type: string
          required: false
        - name: starting_after_date
          in: query
          description: |
            cursor for use in pagination.
            starting_after_date is the `settled_at` or `created_at` from the
            `last_evaluated_key` that defines your place in the list.
            For instance, if you make a list request and receive 100 objects,
            ending with `obj_foo` and `settled_at=2021-02-02`, your subsequent
            call can include `starting_after_id=obj_foo&starting_after_date=2021-02-02`
            in order to fetch the next page of the list.

            Must be used together with `starting_after_id`
          type: string
          required: false
        - name: created_at.gte
          in: query
          type: string
          format: date
          description: Settlement created after, the `settled_at` value
        - name: created_at.lte
          in: query
          type: string
          format: date
          description: Settlement created before a date, the `settled_at` value
        - name: item_created_at.gte
          in: query
          type: string
          format: date
          description: |
            Filter by Settlement `created_at` value, cannot be combined
            with `created_at.gte` query parameter
        - name: item_created_at.lte
          in: query
          type: string
          format: date
          description: |
            Filter by Settlement `created_at` value, cannot be combined
            with `created_at.lte` query parameter
        - name: payment_provider
          in: query
          type: array
          collectionFormat: multi
          items:
            type: string
          description: The payment provider
        - name: payout_destination_id
          in: query
          type: string
          description: The seller id to filter on
        - name: search
          in: query
          type: string
          description: Will try to match the search to settlement_id.
      responses:
        '200':
          $ref: '#/responses/SettlementsList'
        '400':
          description: |
            Bad request - invalid filters
          schema:
            $ref: '#/definitions/Error'
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /accounts/{aid}/settlements/reports/configuration:
    get:
      operationId: aid_settlement_report_config_list
      summary: List settlement report configurations
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        List settlement report configurations

        *scopes*:
          - admin:billing
          - read:billing
          - admin:reports
          - read:reports
          - admin:settlements
          - read:settlements
      x-scopes:
        - admin:billing
        - read:billing
        - admin:reports
        - read:reports
        - admin:settlements
        - read:settlements
      consumes:
        - application/json
      tags:
        - settlements.configuration
      parameters:
        - $ref: '#/parameters/accountId'
        - name: starting_after
          in: query
          type: string
          description: cursor for use in pagination
          required: false
        - $ref: '#/parameters/limit1k'
      responses:
        '200':
          $ref: '#/responses/SettlementReportConfigList'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
    post:
      operationId: aid_settlement_report_config_create
      summary: Create settlement report configurations
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        Create settlement report configurations

        *scopes*:
          - admin:billing
          - admin:reports
          - admin:settlements
          - write:settlements
      x-scopes:
        - admin:billing
        - admin:reports
        - admin:settlements
        - write:settlements
      consumes:
        - application/json
      tags:
        - settlements.configuration
      parameters:
        - $ref: '#/parameters/accountId'
        - name: config
          in: body
          schema:
            $ref: '#/definitions/SettlementReportConfigItem'
          required: true
      responses:
        '200':
          $ref: '#/responses/SettlementReportConfig'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /accounts/{aid}/settlements/reports/configuration/{id}:
    get:
      operationId: aid_settlement_report_config_details
      summary: Get settlement report configuration
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        Get settlement report configuration

        *scopes*:
          - admin:billing
          - read:billing
          - admin:reports
          - read:reports
          - admin:settlements
          - read:settlements
      x-scopes:
        - admin:billing
        - read:billing
        - admin:reports
        - read:reports
        - admin:settlements
        - read:settlements
      consumes:
        - application/json
      tags:
        - settlements.configuration
      parameters:
        - $ref: '#/parameters/accountId'
        - $ref: '#/parameters/reportConfigId'
      responses:
        '200':
          $ref: '#/responses/SettlementReportConfig'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
    put:
      operationId: aid_settlement_report_config_update
      summary: Update settlement report configuration
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        Update settlement report configuration

        *scopes*:
          - admin:billing
          - write:billing
          - admin:settlements
          - write:settlements
      x-scopes:
        - admin:billing
        - write:billing
        - admin:settlements
        - write:settlements
      consumes:
        - application/json
      tags:
        - settlements.configuration
      parameters:
        - $ref: '#/parameters/accountId'
        - $ref: '#/parameters/reportConfigId'
        - name: config
          in: body
          schema:
            $ref: '#/definitions/UpdateSettlementReportConfigItem'
          required: true
      responses:
        '200':
          $ref: '#/responses/SettlementReportConfig'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
    delete:
      operationId: aid_settlement_report_config_delete
      summary: Delete settlement report configuration
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        Delete settlement report configuration

        *scopes*:
          - admin:billing
          - write:billing
          - admin:settlements
          - write:settlements
      x-scopes:
        - admin:billing
        - write:billing
        - admin:settlements
        - write:settlements
      consumes:
        - application/json
      tags:
        - settlements.configuration
      parameters:
        - $ref: '#/parameters/accountId'
        - $ref: '#/parameters/reportConfigId'
      responses:
        '200':
          $ref: '#/responses/SettlementReportConfig'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /accounts/{aid}/settlements/{settlementid}/attachments/{attachmentid}:
    get:
      operationId: settlement_attachment_download
      summary: Download attachment
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        Download a settlement attachment

        *scopes*:
          - admin:billing
          - read:billing
          - admin:reports
          - read:reports
          - admin:settlements
          - read:settlements
      x-scopes:
        - admin:billing
        - read:billing
        - admin:reports
        - read:reports
        - admin:settlements
        - read:settlements
      consumes:
        - application/json
      tags:
        - settlements
      parameters:
        - $ref: '#/parameters/accountId'
        - name: settlementid
          description: |
            An id that uniquely identifies the settlement.
          in: path
          required: true
          type: string
        - name: attachmentid
          description: |
            An id that uniquely identifies the attachment.
          in: path
          required: true
          type: string
      responses:
        '200':
          description: success
          schema:
            type: string
            format: binary
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /accounts/{aid}/reports/metadata:
    get:
      operationId: api_reports_metadata_list_get
      summary: |
        List report metadata
      x-servers:
        - url: https://api.dintero.com/v1/
      description: |
        Get list of report metadata for the account

        Scopes:
          - read:reports
          - admin:reports
      produces:
        - application/json
      x-scopes:
        - read:reports
        - admin:reports
      tags:
        - reports
      parameters:
        - $ref: '#/parameters/accountId'
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/startingAfter'
      responses:
        '200':
          $ref: '#/responses/ReportMetadata'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/Unauthorized'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /branding/logos/{logos}/variant/{variant}/color/{color}/width/{width}/{template}:
    get:
      operationId: branding_logoframe
      summary: Get payment logos image
      description: Endpoint that returns an svg that can be used to show the world your payment options. [Go to the documentation for the checkout branding endpoints.](/docs/checkout-branding)
      security: []
      produces:
        - image/svg+xml
      tags:
        - Generate checkout image
      parameters:
        - name: logos
          description: |
            logos for payment types separated by underscore eg. `visa_mastercard_vipps_swish_instabank`
          in: path
          required: true
          type: string
        - name: variant
          description: |
            Image variant, multi-colors or mono-colored.
          in: path
          required: true
          type: string
          enum:
            - colors
            - mono
        - name: color
          description: |
            rgb hex color without the \# character or an rbg() or rgba() color code.
          in: path
          required: true
          type: string
        - name: width
          description: |
            width of image
          in: path
          required: true
          type: string
          pattern: ^[0-9]*$
        - name: template
          description: |
            Template for branding image
          in: path
          required: true
          type: string
          enum:
            - dintero_top_frame.svg
            - logos.svg
      responses:
        '200':
          description: An svg image
        '404':
          description: Not found
  /branding/profiles/{profile_id}/variant/{variant}/color/{color}/width/{width}/{template}:
    get:
      operationId: branding_profile
      summary: Get checkout profile image
      description: Endpoint that returns an svg that can be used to show the world your payment options. [Go to the documentation for the checkout branding endpoints.](/docs/checkout-branding)
      tags:
        - Generate checkout image
      parameters:
        - name: profile_id
          description: |
            Profile Id like `P00112233.abc123def321aAabBb9z9cccDdd`
          in: path
          required: true
          type: string
        - name: variant
          description: |
            Image variant, multi-colors or mono-colored.
          in: path
          required: true
          type: string
          enum:
            - colors
            - mono
        - name: color
          description: |
            rgb hex color without the \# character or an rbg() or rgba() color code
          in: path
          required: true
          type: string
        - name: width
          description: |
            width of image
          in: path
          required: true
          type: string
          pattern: ^[0-9]*$
        - name: template
          description: |
            Template for branding image
          in: path
          required: true
          type: string
          enum:
            - dintero_top_frame.svg
            - logos.svg
      responses:
        '200':
          description: svg image
        '404':
          description: Not found
  /accounts/{oid}/auth/token:
    post:
      operationId: aid_auths_oauth_token_post
      summary: Get Token
      description: |
        Use this endpoint to directly request an access_token

        ### Client Access Token
        Use HTTP Basic authentication scheme for
        authenticating grant_type `client_credentials`, use
        client_id/client_secret as user/password.

        ### Code/Password Token
        Use HTTP Bearer authentication scheme for authenticating
        grant_type `authorization_code` or `password`, where the
        Bearer value must be a JWT toke with access to the token
        endpoint.

        ### Account User Token
        Use HTTP Bearer authentication scheme for authenticating
        grant_type `account_user_token`, where the Bearer value
        must be a account user JWT token.

        > Use ID token as Bearer toke if the user was authenticated
        > externally. The ID must include a `email` claim that
        > identifies the account user.

        ### Refresh Token
        Use HTTP Bearer authentication scheme for authenticating
        grant_type `refresh_token` where the Bearer value **must**
        be an Access Token for the clients that was used to create
        the Refresh Token.

        ### Multi-factor authentication (MFA)

        When a request is made to the endpoint to get an access token,
        normally you either get an error, or you get an access token.
        However, when the MFA is enabled, the endpoint may return a new
        error with `error.code: mfa_required`.

        When an `mfa_required` error is returned, the client must perform
        a `challenge`. This is done by sending a request to the
        [auth/mfa/challenge](#operation/aid_auth_mfa_challenge_post) endpoint

        To verify MFA using an OOB challenge, the client must make a request to
        this endpoint with `grant_type=mfa-oob`. Include the `oob_code` you
        received from the challenge response, as well as the `mfa_token` you
        received as part of mfa_required error.

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
        - write:accounts:/auth/users/no-mfa
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
        - write:accounts:/auth/users/no-mfa
      tags:
        - authenticate
      security:
        - clientAuth: []
        - JWT: []
      parameters:
        - $ref: '#/parameters/owner'
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/AuthToken'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/AccessToken'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          description: Forbidden
          schema:
            allOf:
              - $ref: '#/definitions/Error'
              - properties:
                  mfa_token:
                    type: string
                    description: |
                      Included in the response if `mfa_required` in `error.code` is
                      returned. The client must then perform a `challenge`. This
                      is done by sending a request to the
                      [/mfa/challenge](#operation/aid_auth_mfa_challenge_post)
                      endpoint.
        '429':
          $ref: '#/responses/TooManyRequests'
        '500':
          $ref: '#/responses/ServerError'
  /accounts/{aid}/management/settings/approvals/payout-destinations:
    get:
      operationId: aid_management_settings_approvals_payout_destinations_get
      summary: |
        List seller approvals
      description: |

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      x-servers:
        - url: https://api.dintero.com/v1
      tags:
        - approvals
      parameters:
        - $ref: '#/parameters/accountId'
        - name: payout_destination_id
          description: |
            filter CDDs by payout_destination_id
          type: string
          in: query
          required: false
        - name: case_status
          description: |
            filter CDDs by status
          collectionFormat: multi
          type: array
          items:
            type: string
            enum:
              - ACTIVE
              - DECLINED
              - UNDER_MANUAL_REVIEW
              - AUTOMATIC_REVIEW
              - WAITING_FOR_SIGNATURE
              - WAITING_FOR_DECLARATION
              - ERROR
              - ARCHIVED
              - WAITING_FOR_DETAILS
          in: query
          required: false
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/responses/ApprovalsPayoutDestinationList'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
    post:
      operationId: aid_management_settings_approvals_payout_destinations_post
      summary: |
        New seller approval
      description: |
        Initiate an application for a new seller for Dintero Payout with
        split-payment. The application will contain a link to an URL where the
        signatory of the seller will need to finish submission of the
        case contract and sign it. Dintero will perform a KYC, AML and bank ownership
        check on the seller before the application `case_status`will be
        updated to `ACTIVE`. Once the application is approved, the payout
        destination will be added automatically to the Dintero Payout service.

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/management/settings/approvals

        ---
          For testing purposes it is possible to auto-approve or decline a new seller
          by adding one of the following values to `payout_destination_description`:

          - "AUTO_APPROVE": Approves the case automatically, the case status will be set to `ACTIVE`
          - "AUTO_DECLINE": Declines the case automatically, the case status will be set to `DECLINED`
          - "AUTO_WAITING_FOR_SIGNATURE": Leaves the signature check for the case, the case status will be set to `WAITING_FOR_SIGNATURE`

        NOTE: This behavior is only available in test mode, i.e. with an `aid` prefixed with "T".
      x-servers:
        - url: https://api.dintero.com/v1
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/management/settings/approvals
      tags:
        - approvals
      security:
        - JWT: []
      parameters:
        - $ref: '#/parameters/accountId'
        - name: ApprovalsPayoutDestinationResponse
          in: body
          required: true
          schema:
            $ref: '#/definitions/ApprovalsPayoutDestination'
      responses:
        '200':
          $ref: '#/responses/ApprovalsPayoutDestinationCreated'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '404':
          $ref: '#/responses/NotFound'
        '500':
          $ref: '#/responses/ServerError'
  /sessions/pay:
    post:
      operationId: checkout_session_pay_post
      summary: Create and pay merchant initiated session
      description: |
        For merchant initiated payments, where the customer is not involved.

        Receives a session and pays it with the given card token.

        > Merchant is resposible for managing their retry policy for payments
        > that fails, and not retry when payment fails with `DO_NOT_RETRY` error.
        >
        > 200 response will be returned when request fails due to authorization error. Transaction
        > will have status `FAILED` and error information can  be found at `events.error`.
        >
        > Insufficient error handling will cause cards to be blocked
        > https://docs.dintero.com/docs/checkout/tokenization#do-not-try-again--excessive-reattempts

        scopes:
        - admin:checkout
        - write:checkout
      tags:
        - payment
      x-scopes:
        - admin:checkout
        - write:checkout
      security:
        - apikey: []
        - JWT: []
      parameters:
        - name: Dintero-Feature-Toggles
          in: header
          type: array
          collectionFormat: csv
          default: []
          x-example: strict-merchant-reference
          description: |
            - **`strict-merchant-reference`**: The `session.order.merchant_reference`
              must be unique. The pay request will fail with `400 BadRequest` error
              if `merchant_reference` is duplicated by existing session.
            - **`strict-success-merchant-reference`**: The `session.order.merchant_reference`
              must be unique. The pay request will fail with `400 BadRequest` error
              if `merchant_reference` is duplicated by existing session that was successfully
              authorized. This flag is less strict than **`strict-merchant-reference`**, allowing
              for duplicates session if previous session failed
          items:
            type: string
            enum:
              - strict-merchant-reference
              - strict-success-merchant-reference
        - name: options
          in: body
          schema:
            type: object
            properties:
              session:
                description: |
                  The session to create the payment from
                allOf:
                  - $ref: '#/definitions/PaySessionOptions'
                  - $ref: '#/definitions/SessionCustomerTokens'
                  - $ref: '#/definitions/Metadata'
              payment:
                description: |
                  Details to complete the payment
                $ref: '#/definitions/PayPayment'
          required: true
        - $ref: '#/parameters/DinteroSystemName'
        - $ref: '#/parameters/DinteroSystemVersion'
        - $ref: '#/parameters/DinteroSystemPluginName'
        - $ref: '#/parameters/DinteroSystemPluginVersion'
      responses:
        '200':
          description: Transaction created
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
              - $ref: '#/definitions/SessionPayResult'
        '400':
          description: Bad / Invalid request
          schema:
            allOf:
              - $ref: '#/definitions/Error'
              - $ref: '#/definitions/SessionPayResult'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          description: Unexpected Error
          schema:
            allOf:
              - $ref: '#/definitions/Error'
              - $ref: '#/definitions/SessionPayResult'
        default:
          description: Request failed with 4XX error
          schema:
            allOf:
              - $ref: '#/definitions/Error'
              - $ref: '#/definitions/SessionPayResult'
  /examples/discount_code_callback_url:
    post:
      operationId: example_discount_codes_callback_url
      summary: Discount codes Update
      description: |
        This API endpoint on the merchant side allows Dintero to get
        shipping_options and order with discounts based on the provided
        session that had its `order.discount_codes` updated.
      tags:
        - example-session-callbacks
      security: []
      parameters:
        - name: options
          in: body
          schema:
            allOf:
              - $ref: '#/definitions/Id'
              - $ref: '#/definitions/Session'
              - $ref: '#/definitions/SessionRead'
          required: true
      responses:
        '200':
          description: Session Discount update
          schema:
            type: object
            required:
              - shipping_options
            properties:
              order:
                $ref: '#/definitions/DiscountCodesOrderUpdate'
              shipping_options:
                type: array
                description: |
                  Shipping options that will be presented to the end user after the
                  callback

                  - If the merchant is not able to ship the order to the end users
                    shipping address, use an empty array.
                  - If there is only one option, a free delivery, the order still
                    has to contain one option with a _`price.amount`_ of 0.
                items:
                  $ref: '#/definitions/MultiShipmentShippingOption'
  /examples/session_url_callback:
    parameters:
      - name: Dintero-Signature
        in: header
        description: |
          Dintero signature that can be used to verify the payload from the
          callback.

          Only include if a signature secret exist:

          - [POST /v1/admin/signature](#operation/admin_signature_post)
        type: string
      - name: transaction_id
        in: query
        description: The Id for the transaction created
        required: true
        type: string
      - name: session_id
        in: query
        description: Session Id. Either `session_id` or `sid` is required.
        required: false
        type: string
      - name: sid
        in: query
        description: Session Id if `sid_parameter_name=sid`. Either `session_id` or `sid` is required.
        required: false
        type: string
      - name: merchant_reference
        in: query
        description: The merchants reference
        required: true
        type: string
      - name: time
        in: query
        description: ISO 8601 format for when the transaction was created
        required: true
        type: string
        format: date-time
      - name: error
        in: query
        description: Error code
        required: false
        type: string
        x-example: authorization
      - name: event
        in: query
        description: Event applied to transaction
        required: false
        type: string
      - name: event_id
        in: query
        description: Id for the event applied to transaction
        required: false
        type: string
        x-example: '3'
      - name: method
        in: query
        description: The method to use when delivering the callback
        required: false
        type: string
        x-example: POST
      - name: report_error
        in: query
        description: Report error callback
        required: false
        type: boolean
      - name: delay_callback
        in: query
        description: Delay before delivering the callback
        required: false
        type: integer
      - name: report_event
        in: query
        description: Deliver callback on othe transaction events
        required: false
        type: string
        x-example: CAPTURE
    get:
      operationId: example_session_get_callback_url
      summary: Session Callback
      security: []
      description: |
        This API endpoint on the merchant side allows Dintero to notify
        the `session.url.callback_url` when the payment is completed

        > The `transaction_id` is optional if `report_error=true`
      tags:
        - example-session-callbacks
      responses:
        '200':
          description: Callback handled
          schema:
            type: object
    post:
      operationId: example_session_post_callback_url
      summary: Session Callback
      security: []
      description: |
        This API endpoint on the merchant side allows Dintero to notify
        the `session.url.callback_url` when the payment is completed
        > POST is only use if `callback_url` includes `method=POST` query parameter.

        > The `body` and `transaction_id` is optional if `report_error=true`
      tags:
        - example-session-callbacks
      parameters:
        - name: method
          in: query
          description: POST method used to deliver the callback
          required: true
          type: string
          x-example: POST
        - name: includes
          in: query
          description: Aditional data included
          required: true
          type: string
          x-example: session
        - name: body
          in: body
          required: false
          schema:
            allOf:
              - $ref: '#/definitions/Transaction'
      responses:
        '200':
          description: Callback handled
          schema:
            type: object
  /examples/shipping_address_callback_url:
    post:
      operationId: example_shipping_address_callback_url
      summary: Address Update
      description: |
        This API endpoint on the merchant side allows Dintero to get
        shipping options based on the provided session after an address
        update
      tags:
        - example-session-callbacks
      security: []
      parameters:
        - name: options
          in: body
          schema:
            allOf:
              - $ref: '#/definitions/Id'
              - $ref: '#/definitions/Session'
              - $ref: '#/definitions/SessionRead'
          required: true
      responses:
        '200':
          description: Session shipping options update
          schema:
            type: object
            required:
              - shipping_options
            properties:
              shipping_options:
                type: array
                description: |
                  Shipping options that will be presented to the end user after the
                  callback

                  - If the merchant is not able to ship the order to the end users
                    shipping address, use an empty array.
                  - If there is only one option, a free delivery, the order still
                    has to contain one option with a _`price.amount`_ of 0.
                items:
                  $ref: '#/definitions/MultiShipmentShippingOption'
              order:
                $ref: '#/definitions/ShippingAddressCallbackSessionOrderUpdate'
  /v2/accounts/{aid}/payout/fund-transfers:
    post:
      operationId: v2_aid_payout_fund_transfers_post
      summary: Initiate fund transfer
      x-servers:
        - url: https://api.dintero.com/
      description: |
        You can use the endpoint to programmatically initiate a fund transfer
        between two sellers

        Requests for fund transfers are processed asynchronously so in the response,
        we only inform you that we received your request. You'll get the result in
        the settlement report
      x-scopes:
        - write:payout
        - admin:payout
      tags:
        - v2-fund-transfers
      parameters:
        - $ref: '#/parameters/accountId'
        - name: fund_transferdata
          description: Initiate fund transfer data
          in: body
          required: true
          schema:
            $ref: '#/definitions/FundTransferCreateDataV2'
      responses:
        '200':
          description: Transfer fund initiated
          schema:
            type: object
            properties:
              fund_transfer:
                $ref: '#/definitions/FundTransferV2'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/balances:
    get:
      operationId: v2_aid_payout_destination_balance_get
      summary: Get seller balances
      description: |
        Get seller balance per currency
      x-scopes:
        - read:payout
      x-servers:
        - url: https://api.dintero.com/
      parameters:
        - $ref: '#/parameters/accountId'
        - $ref: '#/parameters/payoutDestinationId'
      tags:
        - v2-config-payout-destinations
      responses:
        '200':
          description: Payout destination balances response
          schema:
            type: object
            properties:
              payout_destination_balances:
                $ref: '#/definitions/PayoutDestinationBalancesV2'
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
  /v2/accounts/{aid}/payout/payout-destinations/{payout_destination_id}/transfers:
    get:
      operationId: v2_aid_payout_destination_transfers_get
      summary: Get seller transfers
      description: |
        Get list of transfers for a seller
      x-scopes:
        - read:payout
      x-servers:
        - url: https://api.dintero.com/
      parameters:
        - $ref: '#/parameters/accountId'
        - $ref: '#/parameters/payoutDestinationId'
        - $ref: '#/parameters/limitV2'
        - $ref: '#/parameters/page'
        - name: currency
          in: query
          type: string
          minLength: 3
          maxLength: 3
          pattern: ^[A-Z]{3}$
          description: Filter by currency
      tags:
        - v2-config-payout-destinations
      responses:
        '200':
          description: Payout destination transfers response
          schema:
            type: object
            properties:
              entries:
                $ref: '#/definitions/PayoutDestinationTransfersV2'
              next_page_token:
                type: string
        '400':
          $ref: '#/responses/BadRequest'
        '401':
          $ref: '#/responses/AccessForbidden'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/ServerError'
definitions:
  SwishPayment:
    type: object
    x-discriminator-value: swish.swish
    allOf:
      - $ref: '#/definitions/Payment'
      - type: object
        properties:
          phone_number:
            type: string
            pattern: ^\+?\d{5,15}$
            description: |
              mobile number of a person / company, ITU/E.123 format with
              international prefix (+PPNNNNNNNNN...)
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
  VippsPayment:
    type: object
    x-discriminator-value: vipps
    allOf:
      - $ref: '#/definitions/Payment'
      - type: object
        properties:
          phone_number:
            type: string
            pattern: ^\+?\d{5,15}$
            description: |
              mobile number of a person / company, ITU/E.123 format with
              international prefix (+PPNNNNNNNNN...)
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
  BamboraMobilePayPayment:
    type: object
    x-discriminator-value: bambora.mobilepay
    allOf:
      - $ref: '#/definitions/Payment'
      - required:
          - phone_number
        properties:
          phone_number:
            type: string
            pattern: ^\+?\d{5,15}$
            description: |
              mobile number of a person / company, ITU/E.123 format with
              international prefix (+PPNNNNNNNNN...)
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
  PayExCreditcardPayment:
    type: object
    x-discriminator-value: payex.creditcard
    allOf:
      - $ref: '#/definitions/PayPayment'
      - required:
          - operation
        properties:
          operation:
            type: string
            enum:
              - unscheduled_purchase
              - recurring_purchase
  BamboraCreditcardPayment:
    type: object
    x-discriminator-value: bambora.creditcard
    allOf:
      - $ref: '#/definitions/PayPayment'
      - required:
          - operation
        properties:
          operation:
            type: string
            enum:
              - unscheduled_purchase
              - recurring_purchase
  DinteroPspCreditcardMitPayment:
    type: object
    x-discriminator-value: dintero_psp.creditcard
    allOf:
      - $ref: '#/definitions/PayPayment'
      - required:
          - operation
        properties:
          operation:
            type: string
            enum:
              - unscheduled_purchase
              - recurring_purchase
  DinteroPspApplePayPayment:
    type: object
    x-discriminator-value: dintero_psp.applepay
    allOf:
      - $ref: '#/definitions/Payment'
      - required:
          - psp_transaction_id
        properties:
          psp_transaction_id:
            type: string
            description: |
              Transaction id received from psp-service when creating applepay transaction
          billing_address:
            description: |
              Billing address for the customer
            $ref: '#/definitions/OrderAddress'
          shipping_address:
            description: |
              Shipping address for the customer
            $ref: '#/definitions/OrderAddress'
  CollectorInvoiceB2BPayment:
    type: object
    x-discriminator-value: collector.invoice_b2b
    allOf:
      - $ref: '#/definitions/Payment'
      - $ref: '#/definitions/CollectorPaymentDetails'
      - required:
          - shipping_address
          - billing_address
        properties:
          shipping_address:
            $ref: '#/definitions/CollectorB2BAddress'
          billing_address:
            $ref: '#/definitions/CollectorB2BAddress'
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
          authorization_code:
            type: string
            description: |
              Code from authorized customer.
  CollectorFinancePayment:
    type: object
    x-discriminator-value: collector.finance
    allOf:
      - $ref: '#/definitions/Payment'
      - $ref: '#/definitions/CollectorDetails'
      - $ref: '#/definitions/CollectorPaymentDetails'
      - required:
          - shipping_address
          - billing_address
        properties:
          shipping_address:
            $ref: '#/definitions/CollectorAddress'
          billing_address:
            $ref: '#/definitions/CollectorAddress'
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
          authorization_code:
            type: string
            description: |
              Code from authorized customer.
  PayExTokenProvider:
    type: object
    x-discriminator-value: payex.creditcard
    allOf:
      - $ref: '#/definitions/TokenProvider'
      - required:
          - token_types
        properties:
          token_types:
            type: array
            items:
              type: string
              enum:
                - payment_token
                - recurrence_token
  BamboraTokenProvider:
    type: object
    x-discriminator-value: bambora.creditcard
    allOf:
      - $ref: '#/definitions/TokenProvider'
      - required:
          - token_types
        properties:
          token_types:
            type: array
            items:
              type: string
              enum:
                - payment_token
  DinteroPspCardTokenProvider:
    type: object
    x-discriminator-value: dintero_psp.creditcard
    allOf:
      - $ref: '#/definitions/TokenProvider'
      - required:
          - token_types
        properties:
          token_types:
            type: array
            items:
              type: string
              enum:
                - payment_token
          token_supported_auth_methods:
            $ref: '#/definitions/DinteroPspTokenAuthMethods'
  DinteroPspGooglePayTokenProvider:
    type: object
    x-discriminator-value: dintero_psp.googlepay
    allOf:
      - $ref: '#/definitions/TokenProvider'
      - required:
          - token_types
        properties:
          token_types:
            type: array
            items:
              type: string
              enum:
                - payment_token
          token_supported_auth_methods:
            $ref: '#/definitions/DinteroPspTokenAuthMethods'
  DinteroPspClickToPayPayTokenProvider:
    type: object
    x-discriminator-value: dintero_psp.clicktopay
    allOf:
      - $ref: '#/definitions/TokenProvider'
      - required:
          - token_types
        properties:
          token_types:
            type: array
            items:
              type: string
              enum:
                - payment_token
          token_supported_auth_methods:
            $ref: '#/definitions/DinteroPspTokenAuthMethods'
  PayExV3ClickToPayPaymentOperation:
    description: |
      Contains href URI to initiate a Click to Pay payment using Swedbank Pay (v3)
    type: object
    x-discriminator-value: pay-payex-v3-clicktopay
    allOf:
      - required:
          - content_type
          - href
        properties:
          content_type:
            type: string
            enum:
              - application/javascript
          href:
            type: string
            description: |
              Contains the URI to initiate a payment.
            example: https://ecom.payex.com/payment/core/js...
      - $ref: '#/definitions/PaymentOperation'
  PayExVippsPayment:
    type: object
    x-discriminator-value: payex.vipps
    allOf:
      - $ref: '#/definitions/Payment'
      - type: object
        properties:
          phone_number:
            type: string
            pattern: ^\+?\d{5,15}$
            description: |
              mobile number of a person / company, ITU/E.123 format with
              international prefix (+PPNNNNNNNNN...)
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
  KlarnaPaymentOperation:
    description: |
      Contains href URI to initiate a pay with Klarna
    type: object
    x-discriminator-value: pay-klarna
    allOf:
      - required:
          - client_token
          - content_type
          - href
          - method
          - rel
          - order
        properties:
          rel:
            type: string
            enum:
              - pay-klarna
          href:
            type: string
            description: |
              Contains the URI to initiate a payment.
            example: https://checkout.dintero.com/v1/sessions/{session_id}/pay
          method:
            type: string
            enum:
              - POST
          client_token:
            type: string
            description: |
              Client token to be passed to the JS client while initializing the
              JS SDK
          order:
            type: string
            description: |
              String representation of the payment order to be used with the payment operations.
          content_type:
            type: string
            enum:
              - application/json
      - $ref: '#/definitions/PaymentOperation'
  CollectorInvoiceB2BPreapprovedPayment:
    type: object
    x-discriminator-value: collector.invoice_b2b_preapproved
    allOf:
      - $ref: '#/definitions/Payment'
      - $ref: '#/definitions/CollectorPaymentDetails'
      - required:
          - shipping_address
          - company_id
        properties:
          shipping_address:
            $ref: '#/definitions/CollectorB2BAddress'
          scc:
            type: string
            description: Optional query parameter. SMS-confirm-code. To verify the identity of the payee.
          company_id:
            type: string
            description: Id to represent the company being paid from
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
          authorization_code:
            type: string
            description: |
              Code from authorized customer.
  BamboraVippsPayment:
    type: object
    x-discriminator-value: bambora.vipps
    allOf:
      - $ref: '#/definitions/Payment'
      - type: object
        properties:
          phone_number:
            type: string
            pattern: ^\+?\d{5,15}$
            description: |
              mobile number of a person / company, ITU/E.123 format with
              international prefix (+PPNNNNNNNNN...)
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
  PayExSwishPayment:
    type: object
    x-discriminator-value: payex.swish
    allOf:
      - $ref: '#/definitions/Payment'
      - properties:
          phone_number:
            type: string
            pattern: ^\+?\d{5,15}$
            description: |
              mobile number of a person / company, ITU/E.123 format with
              international prefix (+PPNNNNNNNNN...)

              The `redirect_url` in the response will be a Swish URL that will
              open the app with the payment request if no phone_number is provided.
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
  BamboraPaymentOperation:
    description: |
      Contains href URI to initiate a pay with Bambora Checkout
    type: object
    x-discriminator-value: pay-bambora-creditcard
    allOf:
      - $ref: '#/definitions/PaymentOperation'
      - required:
          - session
          - href
        properties:
          session:
            type: object
            required:
              - token
            properties:
              token:
                type: string
                example: fb49265d30aa4f1bb327b943c4d43b14
          href:
            type: string
            description: |
              Contains the URI to initiate a payment.
            example: https://v1.checkout.bambora.com/fb49265d30aa4f1bb327b943c4d43b14
  BamboraApplePayPaymentOperation:
    description: |
      Contains a wallet session for Bambora Apple Pay payment.
    type: object
    x-discriminator-value: pay-bambora-applepay
    allOf:
      - $ref: '#/definitions/PaymentOperation'
      - required:
          - merchant_country
          - supported_networks
          - wallet_session
        properties:
          merchant_country:
            type: string
            description: |
              The country code of the merchant.
            example: 'NO'
          supported_networks:
            type: array
            items:
              type: string
          wallet_session:
            type: object
            required:
              - identifier
              - callback_url
              - payment_session
            properties:
              identifier:
                type: string
              callback_url:
                type: string
              payment_session:
                type: string
  CollectorInstallmentPayment:
    type: object
    x-discriminator-value: collector.installment
    allOf:
      - $ref: '#/definitions/Payment'
      - $ref: '#/definitions/CollectorPaymentDetails'
      - required:
          - shipping_address
          - billing_address
          - product
        properties:
          product:
            type: object
            required:
              - id
            properties:
              id:
                type: string
                description: Id of the payment product
                example: IF_3_001
          shipping_address:
            $ref: '#/definitions/CollectorAddress'
          billing_address:
            $ref: '#/definitions/CollectorAddress'
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
          authorization_code:
            type: string
            description: |
              Code from authorized customer.
          social_security_number:
            minLength: 10
            maxLength: 12
            type: string
            description: |
              The social security number of the customer. For Norway, the length
              is 11. For Sweden, it's either 10 or 12 digits.
  CollectorInvoicePayment:
    type: object
    x-discriminator-value: collector.invoice
    allOf:
      - $ref: '#/definitions/Payment'
      - $ref: '#/definitions/CollectorPaymentDetails'
      - required:
          - shipping_address
          - billing_address
        properties:
          shipping_address:
            $ref: '#/definitions/CollectorAddress'
          billing_address:
            $ref: '#/definitions/CollectorAddress'
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
          authorization_code:
            type: string
            description: |
              Code from authorized customer.
          social_security_number:
            minLength: 10
            maxLength: 12
            type: string
            description: |
              The social security number of the customer. For Norway, the length
              is 11. For Sweden, it's either 10 or 12 digits.
  KlarnaPayment:
    type: object
    x-discriminator-value: klarna.klarna
    allOf:
      - $ref: '#/definitions/Payment'
      - required:
          - authorization_token
          - billing_address
          - shipping_address
          - locale
        properties:
          authorization_token:
            type: string
            description: |
              Token received from Klarna on the client-side after successful authorization
          billing_address:
            $ref: '#/definitions/KlarnaAddress'
          shipping_address:
            $ref: '#/definitions/KlarnaAddress'
          locale:
            type: string
            example: en-GB
            pattern: ^[A-Za-z]{2}-[A-Za-z]{2}$
            description: |
              Combination of purchase country and language. Example: `"en-GB"`
  PayExMobilePayPayment:
    type: object
    x-discriminator-value: payex.mobilepay
    allOf:
      - $ref: '#/definitions/Payment'
      - required:
          - phone_number
        properties:
          phone_number:
            type: string
            pattern: ^\+?\d{5,15}$
            description: |
              mobile number of a person / company, ITU/E.123 format with
              international prefix (+PPNNNNNNNNN...)
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
  client_credentials:
    description: Client token credential
    x-discriminator-value: client_credentials
    type: object
    allOf:
      - $ref: '#/definitions/AuthToken'
        example: client_credentials
      - required:
          - audience
        properties:
          audience:
            type: string
            example: https://api.dintero.com/v1/accounts/P00000000
            description: |
              The unique identifier of the target API you want to access.
              The audience must be a grant associated with the client
  BamboraCreditcardCitPayment:
    type: object
    x-discriminator-value: bambora.creditcard
    allOf:
      - $ref: '#/definitions/Payment'
      - required:
          - browser_information
        properties:
          remember_me:
            type: boolean
            description: |
              If true will either make the backend add or update a signed cookie with
              customer data. If false the cookie will be removed. If not set,
              any existing cookie will remain unchanged
          browser_information:
            type: object
            required:
              - java_enabled
              - javascript_enabled
              - color_depth
              - screen_width
              - screen_height
              - timezone_offset
            properties:
              java_enabled:
                type: boolean
                description: |
                  Whether browser can execute Java or not. The value of navigator.javaEnabled browser property.
              javascript_enabled:
                type: boolean
                description: |
                  Whether browser can execute JavaScript or not.
              color_depth:
                type: number
                description: |
                  The bit depth of the colour palette for displaying images, in bits per pixel. The value of screen.colorDepth browser property.
                example: 24
              screen_height:
                type: number
                description: |
                  Total height of the browser screen in pixels. The value of screen.height browser property.
                example: 1080
              screen_width:
                type: number
                description: |
                  Total width of the browser screen in pixels. The value of screen.width browser property.
                example: 1920
              timezone_offset:
                type: number
                description: |
                  Time difference between UTC time and the browser local time, in minutes.
                example: 180
  AmountLimitLTERule:
    type: object
    x-discriminator-value: amount_lte
    allOf:
      - $ref: '#/definitions/SCARule'
      - $ref: '#/definitions/AmountLimit'
  SeitatecInPersonPayment:
    type: object
    x-discriminator-value: seitatech.in_person
    allOf:
      - $ref: '#/definitions/Payment'
  CallbackUrl:
    type: string
    format: uri
    pattern: https?://*
    example: https://example.com/callback?method=GET
    description: |
      URL that Checkout will call when the session
      payment is complete and the transaction has been authorized.

      > **Callback is only delivered to HTTPS URLs**

      > A callback done with a transaction with status `ON_HOLD` will receive
      > an aditional callback (later) when the transaction state changes status
      > from `ON_HOLD`.

      > The callback may be received after the transaction is `CAPTURED`
      > in case when the transaction was created from a session where
      > `auto_capture` was enabled.

      Unlike the `return_url` the `callback_url` is system-to-system
      which means delivery is guaranteed.

      Once a session payment is complete the callback_url is invoked as a
      `GET` request to notify your system that the payment has been approved.

      - A callback_url with `method=POST` query parameter will be invoked as a
        `POST` request with the transaction included in the request body.

      - A callback_url with `report_error=true` will enable the callback_url
        to be called if the payment failed with error `cancelled`, `authorization`
        or `failed`.

      - A callback_url with `delay_callback=<seconds>` will delay the callback
        before trying to deliver the callback. The **maximum** delay is 60 seconds.

      - A callback_url with `report_event={EVENT}` will enable the callback_url
        to be called if a payment event has been applied to the transaction. Valid
        values are `CAPTURE`, `REFUND` and `VOID`. The callback_url can contain
        multiple `report_event` query parameters. An `event` query parameter will be
        included in the request sent to the callback_url.

      - A callback_url with `includes=session` will enable the callback_url
        to include the session data in the body.

      - A callback_url with `sid_parameter_name=sid` will change the query param `session_id`
        to `sid` to avoid false session fixation alarms in firewalls. Possible values: `sid`, `session_id`

      A successful delivery to an HTTPS callback_url sometimes requires
      more than one attempt. This can be the case, for example, if the server
      hosting the callback_url is down for maintenance or is experiencing
      heavy traffic.

      Dintero attempts a retry only after a failed delivery attempt, following
      situations is considered as failed delivery

       - HTTP status code 100 to 101 and 500 to 599 (inclusive)
         (HTTP status code 400 to 499 is considered as permanent failure)
       - A request timeout (10 seconds)
       - Any connection error such as connection timeout, bad certificate, etc

      Failed delivery will be retried 20 times.

       query name        | type          | description                  | required
      ------------------ | :-----------: | :--------------------------- | :-----------
      transaction_id     | string        | Transaction Id               | true
      session_id         | string        | Session Id                   | true
      sid                | string        | Session Id when sid_parameter_name=sid | true
      merchant_reference | string        | The merchants reference      | true
      time               | string        | ISO 8601 format              | true
      error              | string        | Error code                   | false
      event              | string        | event applied                | false
      event_id           | string        | event id for callback        | false
      includes           | string array  | include additional data      | false

      > The transaction_id is optional when callback_url enables `report_error`
      > where error query will be included in case where the payment was completed
      > without creating an authorized transaction.

      > It is not possible to use `https://localhost` or `http://127.0.0.1` for
      > the callback URL as Checkout backend would then call itself.

      See [validating callbacks](https://docs.dintero.com/docs/validating-callbacks) to see how you can verify the integrity of the callbacks,
  SessionUrls:
    type: object
    required:
      - return_url
    properties:
      return_url:
        type: string
        format: uri
        example: https://example.com/accept
        description: |
          URL to page where Checkout will redirect the
          customer to after the Checkout process has ended.

          If a transaction was completed successfully, a `transaction_id`
          will be appended to the URL as a `query` string parameter

          > A `transaction_id` will be appended to the URL if the
          > Checkout failed with `error=capture`

          > A transaction with status `ON_HOLD` must be handled as a payment
          > that is pending approval, where the transaction will later be updated
          > with a final payment staus `AUTHORIZED` or `FAILED`.
          > We recommend that `callback_url` is used to receive the callback when
          > the transaction changes status from `ON_HOLD` to `AUTHORIZED` or `FAILED`.
          > Alternative is to do an hourly/daily poll on the transaction to check
          > if the status has changed.

          *Example*:

             ```
             https://example.com/accept?transaction_id=T00000000.3YkJXSdSnUBXcmQSzn7uJj
             ```

           query name        | type         | description                    | required
          ------------------ | :----------: | ------------------------------ | :-----------:
          transaction_id     |   string     | Transaction Id                 | false
          error              |   string     | Error code identifying cause   | false
          merchant_reference |   string     | The merchants reference        | true

          In case of that something went wrong with the payment flow, an
          `error` query parameter will be appended to the URL. The value
          of the error is a code identifying the cause.

          error         | Description
          ------------- | ------------
          cancelled     | Customer cancelled the checkout payment
          authorization | Customer failed to authorize the payment
          failed        | The transaction has been rejected by us, or an error has occurred during transaction processing

          ### configuration.channel=in_app

          The `in_app` channel is intended for payments done from mobile devices
          where `url.return_url` can be set to the application's appswitch URL.

          #### initial_recipient=merchant

          If the query-param `initial_recipient=merchant` is appended to the
          appswitch URL, the payment app will switch directly to the app,
          i.e. without doing a redirect.

          **The option is not supported for:**

          - payex.vipps
          - payex.swish
          - bambora.mobilepay

          Following query parameters will be added to the `return_url`

           query name               | type         | description                    | required
          ------------------------- | :----------: | ------------------------------ | :-----------:
          transaction_id            |   string     | Transaction Id                 | false
          session_id                |   string     | Session Id                     | false
          error                     |   string     | Error code identifying cause   | false
          payment_return_url        |   string     | Redirect URL to Dintero API    | false
          merchant_reference        |   string     | The merchants reference        | true


          If the `payment_return_url` is present, you can use it to get a url containing the `session_id`
          or `transaction_id`. `payment_return_url` will only be present when `configuration.channel=in_app`
          and `initial_recipient=merchant` is appended on the appswitch URL.

          You will in this case be required to poll for status on the payment by using the
          `session_id` or `transaction_id` to poll from the endpoints:

          - [GET /v1/sessions/{session_id}](#operation/checkout_session_get)
          - [GET /v1/transactions/{transaction_id}](#operation/transactions_id_get)

          Poll the transaction until it has been updated with one of these statuses:

          - AUTHORIZED
          - CAPTURED
          - FAILED

          In case no `transaction_id` is included in the return url, poll the
          session to get the `transaction_id`

          Example url: `myapp://?initial_recipient=merchant&transaction_id=T12345678.abc&merchant_reference=mref123&session_id=T12345678.abd`
      callback_url:
        $ref: '#/definitions/CallbackUrl'
      merchant_terms_url:
        type: string
        format: uri
        pattern: https?://*
        example: https://example.com/terms.html
        description: |
          URL to a webpage with the merchant's Terms of Service. Will be linked to from the checkout.
  SessionCustomer:
    type: object
    properties:
      customer_id:
        type: string
        description: |
          Customer id
      email:
        type: string
        example: john.doe@example.com
        description: |
          Customer email address
      phone_number:
        type: string
        example: '+4799999999'
        description: |
          Customer phone number, ITU/E.123 format with
          international prefix (+PPNNNNNNNNN...)
  OrderAddress:
    type: object
    description: Address
    properties:
      first_name:
        type: string
        example: John
      last_name:
        type: string
        example: Doe
      address_line:
        type: string
        description: Gaustadalleen 21
      address_line_2:
        type: string
        description: PB 123
      co_address:
        type: string
        example: Land Lord
      business_name:
        type: string
        description: Name of the company
      postal_code:
        type: string
        description: The zip code / postal code of the address.
        example: '0349'
      postal_place:
        type: string
        description: The name of the postal code
        example: Oslo
      country:
        type: string
        format: iso3166-alpha2
        description: Country of the location
        example: 'NO'
      phone_number:
        type: string
        pattern: ^\+?\d{5,15}$
        description: |
          mobile number of a person / company, ITU/E.123 format with
          international prefix (+PPNNNNNNNNN...)
      email:
        type: string
        description: |
          The email address of a person or an organization
      latitude:
        type: number
      longitude:
        type: number
      comment:
        type: string
        description: |
          Comment about the address
      organization_number:
        type: string
        description: |
          The organization number of the customer.
      organization_type:
        type: string
        description: |
          Type indicating what kind of organization it is.
      customer_reference:
        type: string
        description: The customer's reference
      cost_center:
        type: string
        description: For companies that needs to specify a cost center.
  PayoutFeeSplit:
    type: object
    description: |
      Specify how fees are handled with splits. The default behaviour is to share
      the fees proportional with all splits destinations
    required:
      - type
    properties:
      type:
        type: string
        enum:
          - proportional
      destinations:
        type: array
        description: |
          Seller ids that will be debited for the payment fees
          All destinations must be included in the list of splits
        minItems: 1
        items:
          type: string
          maxLength: 40
  PayoutSplit:
    type: object
    required:
      - payout_destination_id
      - amount
    properties:
      payout_destination_id:
        type: string
        maxLength: 40
        example: seller-1
        description: |
          An id that identifies the seller

          Note: The seller must be configured before the funds will be paid out. See https://docs.dintero.com/docs/checkout/split-payment/add-payout-destinations
      amount:
        type: integer
        format: int32
        example: 29700
        minimum: 0
        description: |
          The split amount in smallest unit for the currency, e.g. cents.
  EmdEvent:
    type: array
    description: |
      Only required if the item is related to an event or multiple events,
      like for example tickets to a concert.

      If you are selling an event package as a single ticket or item that
      includes multiple events, for example a festival, you need to provide
      information about all the individual events that are part of the package.
    items:
      type: object
      required:
        - event_name
        - event_company
        - genre_of_event
        - start_time
        - end_time
        - ticket_delivery_method
        - ticket_delivery_recipient
      properties:
        event_name:
          type: string
          description: Name of the event, e.g. "Fancy Singer"
          example: Michael Jackson
        event_company:
          type: string
          description: Name of the company arranging the event, e.g. "Happy Parties Ltd."
          example: Diamond Events
        genre_of_event:
          type: string
          description: Category or type of venue, e.g. "Pop"
          example: Pop
        arena_name:
          type: string
          description: Name of the venue, e.g. "Song Arena"
          example: Oslo Spektrum
        arena_location:
          type: object
          required:
            - city
            - country
          properties:
            street_address:
              type: string
              description: Street address representing the venue location, e.g. "Sonja Henies plass 2"
              example: Sonja Henies plass 2
            postal_code:
              type: string
              description: Postal code for the venue location, e.g. "0185"
              example: '0185'
            city:
              type: string
              description: City that the venue is located in, e.g. "Oslo"
              example: Oslo
            country:
              type: string
              description: |
                Country that the venue is located in (ISO 3166-1 alpha-2 format), e.g. "NO"
              example: 'NO'
        start_time:
          type: string
          format: date-time
          description: |
            Start time of the event (ISO 8601 format), e.g. "2023-08-16T15:00:00Z".

            If a timezone is not specified we assume UTC.
          example: '2023-08-16T15:00:00Z'
        end_time:
          type: string
          format: date-time
          description: |
            End time of the event (ISO 8601 format), e.g. "2023-08-16T16:00:00Z".

            If a timezone is not specified we assume UTC.
          example: '2023-08-16T16:00:00Z'
        access_controlled_venue:
          type: boolean
          description: If tickets are digitally checked when entering the venue, e.g. true
          example: true
        ticket_delivery_method:
          type: string
          enum:
            - pick_up
            - email
            - post
            - phone
          example: email
        ticket_delivery_recipient:
          type: string
          description: |
            Name of the recipient the ticket is delivered to, e.g. "recipient@mail.com".

            If email or phone, then use either the email address or the phone number respectively.
          example: recipient@mail.com
        affiliate_name:
          type: string
          description: |
            Name of the affiliate that originated the purchase.
          example: Klarna affiliate
  EmdSubscription:
    type: object
    description: |
      Details related to the subscription.
    required:
      - subscription_name
      - start_time
      - end_time
      - auto_renewal_of_subscription
    properties:
      subscription_name:
        type: string
        description: Name of the product on subscription, e.g. "Contact lenses"
        example: Contact lenses
      start_time:
        type: string
        format: date-time
        description: |
          The start time of the subscription (ISO 8601 format),
          e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified we assume UTC
        example: '2023-08-16T15:00:00Z'
      end_time:
        type: string
        format: date-time
        description: |
          The end time of the subscription (ISO 8601 format),
          e.g. "2023-09-16T15:00:00Z".

          If a timezone is not specified we assume UTC
        example: '2023-09-16T15:00:00Z'
      auto_renewal_of_subscription:
        type: boolean
        description: |
          Whether the subscription will be auto renewed upon expiry, e.g. true
        example: true
      affiliate_name:
        type: string
        description: |
          Name of the affiliate that originated the purchase.
        example: Klarna affiliate
  EmdCustomerAccountInfo:
    type: object
    description: |
      Information related to the customer that wants to purchase the subscription.
    required:
      - unique_account_identifier
      - account_registration_date
      - account_last_modified
    properties:
      unique_account_identifier:
        type: string
        description: |
          Unique name / number to identify the specific customer account.
          Max 24 characters, e.g. "Adam Adamsson"
        example: Adam Adamsson
      account_registration_date:
        type: string
        description: |
          The date and time the account was registered (ISO 8601 format),
          e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-16T15:00:00Z'
      account_last_modified:
        type: string
        description: |
          The date and time the account was last modified (ISO 8601 format),
          e.g. "2023-10-16T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-10-16T15:00:00Z'
  EmdRecurring:
    type: object
    description: |
      Only required if the item is related to a subscription.

      If that is the case, you need to provide information about both the subscription
      and the customer account.
    required:
      - subscription
      - customer_account_info
    properties:
      subscription:
        $ref: '#/definitions/EmdSubscription'
      customer_account_info:
        $ref: '#/definitions/EmdCustomerAccountInfo'
  EmdAirReservationDetailsItinerary:
    type: object
    required:
      - departure
      - arrival
      - carrier
      - departure_date
      - ticket_delivery_method
      - ticket_delivery_recipient
    properties:
      departure:
        type: string
        description: IATA Airport Code (three letters), e.g. "OSL"
        example: OSL
      departure_city:
        type: string
        description: City the flight departs from, e.g. "Oslo"
        example: Oslo
      arrival:
        type: string
        description: IATA Airport Code (three letters), e.g. "MUC"
        example: MUC
      arrival_city:
        type: string
        description: City the flight arrives in, e.g. "Munich"
        example: Munich
      carrier:
        type: string
        description: IATA Airline standard (two letters or digits), e.g. "LH"
        example: LH
      segment_price:
        type: integer
        description: |
          Price for that specific segment of the flight
          in smallest unit of local currency, e.g. 200000
        example: 200000
      departure_date:
        type: string
        description: |
          Departure date (ISO 8601 format), e.g. "2023-08-16T15:00:00Z"

          If a timezone is not specified, we assume UTC.
        example: '2023-08-16T15:00:00Z'
      ticket_delivery_method:
        type: string
        enum:
          - pick_up
          - email
          - post
          - phone
        example: phone
      ticket_delivery_recipient:
        type: string
        description: |
          Name of the recipient the ticket is delivered to, e.g. "Maximilian".

          If email or phone, then use either the email address or the phone number respectively.
        example: '97712123'
      passenger_id:
        type: array
        description: IDs of all the passengers included in this itinerary.
        example:
          - 1
        items:
          type: integer
      class:
        type: string
        description: Travel class, e.g. "First Class"
        example: First Class
  EmdTravelInsurance:
    type: object
    properties:
      insurance_company:
        type: string
        description: Name of the company which offers the insurance, e.g. "Oopsie Insurance Ltd."
        example: Oopsie Insurance Ltd.
      insurance_type:
        type: string
        enum:
          - cancellation
          - travel
          - cancellation_travel
          - bankruptcy
        description: Type of insurance, e.g. "travel"
        example: travel
      insurance_price:
        type: integer
        description: |
          Price of the insurance in smallest unit of local currency,
          e.g. 50000
        example: 50000
  EmdTravelPassenger:
    type: object
    required:
      - first_name
      - last_name
    properties:
      id:
        type: integer
        description: Passenger id, e.g. 1
        example: 1
      title:
        type: string
        enum:
          - mr
          - mrs
          - ms
          - ''
        description: |
          Passenger title, e.g. "mr".

          Blank if under 12 years.
        example: mr
      first_name:
        type: string
        description: First name of the passenger, e.g. "Paul"
        example: Paul
      last_name:
        type: string
        description: Last name of the passenger, e.g. "Lamb"
        example: Lamb
  EmdAirReservationDetails:
    type: object
    description: |
      Details about the reservation of airline tickets.
    required:
      - itinerary
    properties:
      pnr:
        type: string
        description: |
          Trip booking number, e.g. "VH67899"
        example: VH67899
      itinerary:
        type: array
        description: |
          Itinerary data, one per segment.

          If you are selling a ticket that contains one flight from Oslo to Munich,
          and another flight from Munich to Dubai, you need to provide one
          itinerary object for each of these two flights, and so on.
        items:
          $ref: '#/definitions/EmdAirReservationDetailsItinerary'
      insurance:
        type: array
        description: Insurance data, one per segment
        items:
          $ref: '#/definitions/EmdTravelInsurance'
      passengers:
        type: array
        description: Passenger data, one per passenger.
        items:
          $ref: '#/definitions/EmdTravelPassenger'
      affiliate_name:
        type: string
        description: Name of the affiliate that originated the purchase.
        example: Klarna affiliate
  EmdBusReservationDetailsItinerary:
    type: object
    required:
      - departure_city
      - arrival_city
      - carrier
      - departure_date
      - ticket_delivery_method
      - ticket_delivery_recipient
    properties:
      departure_city:
        type: string
        description: City the bus departs from, e.g. "Oslo"
        example: Oslo
      arrival_city:
        type: string
        description: City the bus arrives in, e.g. "Munich"
        example: Munich
      carrier:
        type: string
        description: Name of transportation company. "Big Bus Travels Ltd."
        example: Big Bus Travels Ltd.
      segment_price:
        type: integer
        description: |
          Price for that specific segment of the bus journey
          in smallest unit of local currency, e.g. 200000
        example: 200000
      departure_date:
        type: string
        description: |
          Departure date (ISO 8601 format), e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified, we assume UTC.
        example: '2023-08-16T15:00:00Z'
      ticket_delivery_method:
        type: string
        enum:
          - pick_up
          - email
          - post
          - phone
        example: phone
      ticket_delivery_recipient:
        type: string
        description: |
          Name of the recipient the ticket is delivered to, e.g. "Maximilian".

          If email or phone, then use either the email address or the phone number respectively.
        example: '97712123'
      passenger_id:
        type: array
        description: IDs of all the passengers included in this itinerary.
        example:
          - 1
        items:
          type: integer
      class:
        type: string
        description: Travel class, e.g. "First Class"
        example: First Class
  EmdBusReservationDetails:
    type: object
    description: |
      Details about the reservation of bus tickets.
    required:
      - itinerary
    properties:
      pnr:
        type: string
        description: |
          Trip booking number, e.g. "VH67899"
        example: VH67899
      itinerary:
        type: array
        description: |
          Itinerary data, one per segment.

          If you are selling a ticket that contains one bus journey from Oslo to Munich,
          and another bus journey from Munich to Rome, you need to provide one
          itinerary object for each of these two bus journeys, and so on.
        items:
          $ref: '#/definitions/EmdBusReservationDetailsItinerary'
      insurance:
        type: array
        description: Insurance data, one per segment
        items:
          $ref: '#/definitions/EmdTravelInsurance'
      passengers:
        type: array
        description: Passenger data, one per passenger.
        items:
          $ref: '#/definitions/EmdTravelPassenger'
      affiliate_name:
        type: string
        description: Name of the affiliate that originated the purchase.
        example: Klarna affiliate
  EmdTrainReservationDetailsItinerary:
    type: object
    required:
      - departure_city
      - arrival_city
      - carrier
      - departure_date
      - ticket_delivery_method
      - ticket_delivery_recipient
      - passenger_id
    properties:
      departure_city:
        type: string
        description: City the train departs from, e.g. "Oslo"
        example: Oslo
      arrival_city:
        type: string
        description: City the train arrives in, e.g. "Munich"
        example: Munich
      carrier:
        type: string
        description: Name of transportation company. "Big Train Travels Ltd."
        example: Big Train Travels Ltd.
      segment_price:
        type: integer
        description: |
          Price for that specific segment of the train journey
          in smallest unit of local currency, e.g. 200000
        example: 200000
      departure_date:
        type: string
        description: |
          Departure date (ISO 8601 format), e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified, we assume UTC.
        example: '2023-08-16T15:00:00Z'
      ticket_delivery_method:
        type: string
        enum:
          - pick_up
          - email
          - post
          - phone
        example: phone
      ticket_delivery_recipient:
        type: string
        description: |
          Name of the recipient the ticket is delivered to, e.g. "Maximilian".

          If email or phone, then use either the email address or the phone number respectively.
        example: '97712123'
      passenger_id:
        type: array
        description: IDs of all the passengers included in this itinerary.
        example:
          - 1
        items:
          type: integer
      class:
        type: string
        description: Travel class, e.g. "First Class"
        example: First Class
  EmdTrainReservationDetails:
    type: object
    description: |
      Details about the reservation of train tickets.
    required:
      - itinerary
    properties:
      pnr:
        type: string
        description: |
          Trip booking number, e.g. "VH67899"
        example: VH67899
      itinerary:
        type: array
        description: |
          Itinerary data, one per segment.

          If you are selling a ticket that contains one train journey from Oslo to Munich,
          and another train journey from Munich to Rome, you need to provide one
          itinerary object for each of these two train journeys, and so on.
        items:
          $ref: '#/definitions/EmdTrainReservationDetailsItinerary'
      insurance:
        type: array
        description: Insurance data, one per segment
        items:
          $ref: '#/definitions/EmdTravelInsurance'
      passengers:
        type: array
        description: Passenger data, one per passenger.
        items:
          $ref: '#/definitions/EmdTravelPassenger'
      affiliate_name:
        type: string
        description: Name of the affiliate that originated the purchase.
        example: Klarna affiliate
  EmdFerryReservationDetailsItinerary:
    type: object
    required:
      - departure_city
      - arrival_city
      - carrier
      - departure_date
      - ticket_delivery_method
      - ticket_delivery_recipient
    properties:
      departure_city:
        type: string
        description: City the ferry departs from, e.g. "Oslo"
        example: Oslo
      arrival_city:
        type: string
        description: City the ferry arrives in, e.g. "Munich"
        example: Munich
      carrier:
        type: string
        description: Name of transportation company. "Big Ferry Travels Ltd."
        example: Big Ferry Travels Ltd.
      segment_price:
        type: integer
        description: |
          Price for that specific segment of the ferry journey
          in smallest unit of local currency, e.g. 200000
        example: 200000
      departure_date:
        type: string
        description: |
          Departure date (ISO 8601 format), e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified, we assume UTC.
        example: '2023-08-16T15:00:00Z'
      ticket_delivery_method:
        type: string
        enum:
          - pick_up
          - email
          - post
          - phone
        example: phone
      ticket_delivery_recipient:
        type: string
        description: |
          Name of the recipient the ticket is delivered to, e.g. "Maximilian".

          If email or phone, then use either the email address or the phone number respectively.
        example: '97712123'
      passenger_id:
        type: array
        description: IDs of all the passengers included in this itinerary.
        example:
          - 1
        items:
          type: integer
      class:
        type: string
        description: Travel class, e.g. "First Class"
        example: First Class
  EmdFerryReservationDetails:
    type: object
    description: |
      Details about the reservation of ferry tickets.
    required:
      - itinerary
    properties:
      pnr:
        type: string
        description: |
          Trip booking number, e.g. "VH67899"
        example: VH67899
      itinerary:
        type: array
        description: |
          Itinerary data, one per segment.

          If you are selling a ticket that contains one ferry journey from Oslo to Kiel,
          and another ferry journey from Kiel to Gothenburg, you need to provide one
          itinerary object for each of these two ferry journeys, and so on.
        items:
          $ref: '#/definitions/EmdFerryReservationDetailsItinerary'
      insurance:
        type: array
        description: Insurance data, one per segment
        items:
          $ref: '#/definitions/EmdTravelInsurance'
      passengers:
        type: array
        description: Passenger data, one per passenger.
        items:
          $ref: '#/definitions/EmdTravelPassenger'
      affiliate_name:
        type: string
        description: Name of the affiliate that originated the purchase.
        example: Klarna affiliate
  EmdHotelReservationDetailsItinerary:
    type: object
    required:
      - start_time
      - end_time
      - number_of_rooms
      - passenger_id
      - ticket_delivery_method
      - ticket_delivery_recipient
      - hotel_price
    properties:
      hotel_name:
        type: string
        description: Name of the hotel, e.g. "Premium Hotel"
        example: Premium Hotel
      address:
        type: object
        description: Address details of the hotel.
        required:
          - city
          - country
        properties:
          street_address:
            type: string
            description: Street address of the hotel, e.g. "Karl Johans gt. 31"
            example: Karl Johans gt. 31
          postal_code:
            type: string
            description: Postal code of the hotel, e.g. "0159"
            example: '0159'
          city:
            type: string
            description: City the hotel is located in, e.g. "Oslo"
            example: Oslo
          country:
            type: string
            description: |
              Country the hotel is located in (ISO 3166-1 alpha-2 format), e.g. "NO",
            example: 'NO'
      start_time:
        type: string
        description: |
          Start time of the hotel stay (ISO 8601 format), e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified, we assume UTC.
        example: '2023-08-16T15:00:00Z'
      end_time:
        type: string
        description: |
          End time of the hotel stay (ISO 8601 format), e.g. "2023-08-20T15:00:00Z".

          If a timezone is not specified, we assume UTC.
        example: '2023-08-20T15:00:00Z'
      number_of_rooms:
        type: integer
        description: Number of rooms booked, e.g. 2
        example: 2
      passenger_id:
        type: array
        description: IDs of all the passengers included in this itinerary.
        example:
          - 1
        items:
          type: integer
      ticket_delivery_method:
        type: string
        enum:
          - pick_up
          - email
          - post
          - phone
        example: phone
      ticket_delivery_recipient:
        type: string
        description: |
          Name of the recipient the ticket is delivered to, e.g. "Maximilian".

          If email or phone, then use either the email address or the phone number respectively.
        example: '97712123'
      hotel_price:
        type: integer
        description: |
          Price for the hotel stay in smallest unit of local currency, e.g. 200000
        example: 200000
      class:
        type: string
        description: Travel class, e.g. "First Class"
        example: First Class
  EmdHotelReservationDetails:
    type: object
    description: |
      Details about the reservation of hotel rooms.
    required:
      - itinerary
    properties:
      pnr:
        type: string
        description: |
          Trip booking number, e.g. "VH67899"
        example: VH67899
      itinerary:
        type: array
        description: |
          Hotel itinerary data, one per hotel stay.

          If you are selling a package that contains multiple hotel stays,
          you need to provide itinerary data for each of the individual stays.
        items:
          $ref: '#/definitions/EmdHotelReservationDetailsItinerary'
      insurance:
        type: array
        description: Insurance data, one per segment
        items:
          $ref: '#/definitions/EmdTravelInsurance'
      passengers:
        type: array
        description: Passenger data, one per passenger.
        items:
          $ref: '#/definitions/EmdTravelPassenger'
      affiliate_name:
        type: string
        description: Name of the affiliate that originated the purchase.
        example: Klarna affiliate
  EmdCarRentalReservationDetailsItinerary:
    type: object
    required:
      - rental_company
      - start_time
      - end_time
    properties:
      rental_company:
        type: string
        description: Name of the car rental company, e.g. "Premium Cars Ltd."
        example: Premium Cars
      drivers_id:
        type: array
        description: Driver IDs.
        items:
          type: integer
        example:
          - 1
      pick_up_location:
        type: object
        description: Details related to the pick up location.
        required:
          - city
          - country
        properties:
          street_address:
            type: string
            description: Street address where the car should be picked up, e.g. "Karl Johans gt. 31"
            example: Karl Johans gt. 31
          postal_code:
            type: string
            description: Postal code where the car should be picked up, e.g. "0159"
            example: '0159'
          city:
            type: string
            description: City where the car should be picked up, e.g. "Oslo"
            example: Oslo
          country:
            type: string
            description: |
              Country where the car should be picked up (ISO 3166-1 alpha-2 format), e.g. "NO",
            example: 'NO'
      drop_off_location:
        type: object
        description: Details related to the drop off location.
        required:
          - city
          - country
        properties:
          street_address:
            type: string
            description: Street address where the car should be dropped off, e.g. "Karl Johans gt. 31"
            example: Karl Johans gt. 31
          postal_code:
            type: string
            description: Postal code where the car should be dropped off, e.g. "0159"
            example: '0159'
          city:
            type: string
            description: City where the car should be dropped off, e.g. "Oslo"
            example: Oslo
          country:
            type: string
            description: |
              Country where the car should be dropped off (ISO 3166-1 alpha-2 format), e.g. "NO"
            example: 'NO'
      start_time:
        type: string
        description: |
          Start time of the car rental reservation (ISO 8601 format), e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified, we assume UTC.
        example: '2023-08-16T15:00:00Z'
      end_time:
        type: string
        description: |
          End time of the car rental reservation (ISO 8601 format), e.g. "2023-08-20T15:00:00Z".

          If a timezone is not specified, we assume UTC.
        example: '2023-08-20T15:00:00Z'
      car_price:
        type: integer
        description: |
          Price for the car rental reservation in smallest unit of local currency, e.g. 500000
        example: 500000
      class:
        type: string
        description: Travel class, e.g. "Premium Cars Premium Class"
        example: Premium Cars Premium Class
  EmdCarRentalReservationDetails:
    type: object
    description: |
      Details about the reservation of rental cars.
    required:
      - itinerary
      - drivers
    properties:
      pnr:
        type: string
        description: |
          Trip booking number, e.g. "VH67899"
        example: VH67899
      itinerary:
        type: array
        description: |
          Car rental itinerary data, one per car rental.

          If you are selling a package that contains multiple car rentals,
          you need to provide itinerary data for each of the individual rentals.
        items:
          $ref: '#/definitions/EmdCarRentalReservationDetailsItinerary'
      insurance:
        type: array
        description: Insurance data, one per segment
        items:
          $ref: '#/definitions/EmdTravelInsurance'
      drivers:
        type: array
        description: Driver data, one per driver.
        items:
          $ref: '#/definitions/EmdTravelPassenger'
      affiliate_name:
        type: string
        description: Name of the affiliate that originated the purchase.
        example: Klarna affiliate
  EmdTravel:
    type: object
    description: |
      Only required if the item is part of a travel-related transaction.

      If that is the case, you need to provide information about the itinerary
      to be booked.
    properties:
      air_reservation_details:
        $ref: '#/definitions/EmdAirReservationDetails'
      bus_reservation_details:
        $ref: '#/definitions/EmdBusReservationDetails'
      train_reservation_details:
        $ref: '#/definitions/EmdTrainReservationDetails'
      ferry_reservation_details:
        $ref: '#/definitions/EmdFerryReservationDetails'
      hotel_reservation_details:
        $ref: '#/definitions/EmdHotelReservationDetails'
      car_rental_reservation_details:
        $ref: '#/definitions/EmdCarRentalReservationDetails'
  EmdMarketplaceAccountLastModified:
    type: object
    required:
      - password
      - email
      - listing
      - login
      - address
    properties:
      password:
        type: string
        format: date-time
        description: |
          Date and time that the password was last modified (ISO 8601 format),
          e.g. "2023-08-17T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-17T15:00:00Z'
      email:
        type: string
        format: date-time
        description: |
          Date and time that the email was last modified (ISO 8601 format),
          e.g. "2023-08-17T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-17T15:00:00Z'
      listing:
        type: string
        format: date-time
        description: |
          Date and time that the listing details were last modified (ISO 8601 format),
          e.g. "2023-08-17T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-17T15:00:00Z'
      login:
        type: string
        format: date-time
        description: |
          Date and time that the login details were last changed (ISO 8601 format),
          e.g. "2023-08-17T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-17T15:00:00Z'
      address:
        type: string
        format: date-time
        description: |
          Date and time that the (physical) address was last modified (ISO 8601 format),
          e.g. "2023-08-17T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-17T15:00:00Z'
  EmdMarketplaceSellerInfo:
    type: object
    description: |
      Details related to the seller involved in the marketplace order.
    required:
      - sub_merchant_id
      - product_category
      - account_registration_date
      - account_last_modified
      - number_of_trades
    properties:
      unique_account_identifier_seller:
        type: object
        description: Details about the seller.
        properties:
          email:
            type: string
            description: |
              Seller's email address, e.g. "seller@mail.com"
          phone_number:
            type: string
            description: Seller's phone number, e.g. "97712123"
            example: '97712123'
          other:
            type: string
      sub_merchant_id:
        type: string
        description: |
          Name or unique number of the selling/delivering merchant,
          e.g. "Marketbrick Ltd."
        example: Marketbrick Ltd.
      product_category:
        type: string
        description: |
          Name of the category to which the specific good belongs to,
          according to the selling merchant's categorization, e.g. "Phones".
        example: Phones
      product_name:
        type: string
        description: |
          Name of the good purchased.
        example: iPhone 14 Pro Max
      account_registration_date:
        type: string
        format: date-time
        description: |
          Date and time that the account was registered (ISO 8601 format),
          e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-16T15:00:00Z'
      account_last_modified:
        $ref: '#/definitions/EmdMarketplaceAccountLastModified'
      seller_rating:
        type: number
        description: |
          Current rating of the good purchased according
          to the marketplace's rating scale, e.g. 5
        example: 5
      number_of_trades:
        type: integer
        description: |
          Number of trades the sub-merchant did in the last 12 months, e.g. 23
        example: 23
      volume_of_trades:
        type: integer
        description: |
          Volumes of trades the sub-merchant did in the last 12 months,
          e.g. 230
        example: 230
  EmdMarketplaceWinnerInfo:
    type: object
    description: |
      Details related to the winner involved in the marketplace order.
    required:
      - account_registration_date
      - account_last_modified
      - number_of_trades
    properties:
      unique_account_identifier_winner:
        type: object
        description: Details about the winner.
        properties:
          email:
            type: string
            description: |
              Winner's email address, e.g. "winner@mail.com"
          phone_number:
            type: string
            description: Winner's phone number, e.g. "97712123"
            example: '97712123'
          other:
            type: string
      account_registration_date:
        type: string
        format: date-time
        description: |
          Date and time that the account was registered (ISO 8601 format),
          e.g. "2023-08-16T15:00:00Z".

          If a timezone is not specified we assume UTC.
        example: '2023-08-16T15:00:00Z'
      account_last_modified:
        $ref: '#/definitions/EmdMarketplaceAccountLastModified'
      number_of_trades:
        type: integer
        description: |
          Number of trades the winner did in the last 12 months, e.g. 23
        example: 23
      volume_of_trades:
        type: integer
        description: |
          Volumes of trades the winner did in the last 12 months,
          e.g. 230
        example: 230
  EmdMarketplaceOrder:
    type: object
    description: |
      Only required if them item is related to a marketplace order.

      If that is the case, you need to provide information about both the seller and
      the winner.
    required:
      - seller_info
      - winner_info
    properties:
      seller_info:
        $ref: '#/definitions/EmdMarketplaceSellerInfo'
      winner_info:
        $ref: '#/definitions/EmdMarketplaceWinnerInfo'
  Emd:
    type: object
    description: |
      Details related to [Klarna EMD](https://docs.klarna.com/klarna-payments/in-depth-knowledge/extra-merchant-data/).

      Some items require extra information to be provided when using
      Klarna as an enabled payment option.
    properties:
      event:
        $ref: '#/definitions/EmdEvent'
      subscription:
        $ref: '#/definitions/EmdRecurring'
      travel:
        $ref: '#/definitions/EmdTravel'
      marketplace_order:
        $ref: '#/definitions/EmdMarketplaceOrder'
  Address:
    type: object
    required:
      - address_line
      - postal_place
      - country
    properties:
      address_line:
        type: string
        example: Sommerkroveien 34
      address_line_2:
        type: string
        example: PB 123
      postal_code:
        type: string
        example: '0349'
      postal_place:
        type: string
        example: Oslo
      country:
        type: string
        format: iso-3166-1
        description: |
          ISO 3166-1 country code
        example: 'NO'
  Store:
    type: object
    required:
      - id
    properties:
      id:
        type: string
        example: sc029
      name:
        type: string
        description: |
          name of the store, aka trade name of the store
        example: SC Oslo
      business_name:
        type: string
        description: |
          Official name of the person or entity that owns the store.
        example: SC Oslo AS
      address:
        $ref: '#/definitions/Address'
      chain:
        type: string
        example: SuperChain
      email:
        type: string
        example: contact@superchain.com
      gln:
        type: string
        example: '5790001398644'
      organization_number:
        type: string
        example: 123456789MVA
      phone_number:
        type: string
        example: '+4738260107'
      mcc:
        type: string
        format: iso-18245
        description: |
          A four-digit Merchant Category Code (MCC) for the store
          [ISO 18245:2003](https://www.iso.org/standard/33365.html)
        example: '5814'
        minimum: 4
        maximum: 4
      bax:
        type: string
        example: '102603'
        description: |
          Merchant number associated with the stores
          payment terminal
      terminal_id:
        type: string
        description: |
          Id to a specific point-of-sale (POS) terminal
          or workstation
        example: T0292
  OrderItem:
    type: object
    description: |
      details about order item
    properties:
      id:
        type: string
        description: |
          The ID or SKU of the product on the line
        example: item_01
      groups:
        type: array
        description: |
          The groups the product on the line belongs to
        example:
          - id: B234
            name: Stol
        items:
          type: object
          required:
            - id
          properties:
            id:
              type: string
              description: Group ID
            name:
              type: string
              description: Group name
      line_id:
        type: string
        description: |
          the number of the line (or id), must be `unique` between
          all items. `required` when Instabank payment is configured.
        example: '1'
      version:
        type: number
        readOnly: true
        description: |
          The version where the item was added or last updated, see the
          events for the source.
      description:
        type: string
        description: |
          A short, localized description of the line item
        example: Stablestol
      quantity:
        type: number
        description: |
          The quantity of the product in the item line.

          Quantities are usually whole numbers, but can also be decimal, in cases where the product is sold by weight, volume or other denominations.
        example: 1
      amount:
        type: integer
        description: |
          The total monetary amount of the line item, including VAT and discounts.

          In smallest unit for the currency, e.g. cents
        example: 2000
      vat_amount:
        type: integer
        description: |
          The VAT of the `amount` parameter. Only
          used for display purposes.

          In smallest unit for the currency, e.g. cents
        example: 400
      vat:
        type: number
        description: |
          The VAT percentage. Supports up to 2 decimal places.
        example: 20
      unit_volume:
        type: number
        description: |
          The volume of one item in m³ (cubic meters)
      unit_weight:
        type: number
        description: |
          The volume of one item in kg (kilo grams)
      unit_dimensional_weight:
        type: number
        description: |
          The dimensional weight (also known as volumetric) value unit of one item. [Dimensional weight at Wikipedia](https://en.wikipedia.org/wiki/Dimensional_weight)
      type:
        type: string
        description: |
          The type of order item this is.

          - **physical** - a physical item which must be delivered or handed over
          - **digital** - a digital item which doesn't need shipping
          - **service** - payment for services like maintenance performed in your home
          - **gift_card** - usage of a gift card, where the amount is usually a negative number
          - **shipping** - payment for shipping of the order
          - **surcharge** - extra incurred costs, like taxes or necessary rounding
        enum:
          - physical
          - digital
          - service
          - gift_card
          - shipping
          - surcharge
      fee_split:
        $ref: '#/definitions/PayoutFeeSplit'
      splits:
        type: array
        description: |
          An array of objects specifying how the amount should be split between
          sellers when using Dintero Payout

          Specify an empty array if the splits will be provided during capture.
          `auto_capture` cannot be enabled when splits are defined as empty array.
        items:
          $ref: '#/definitions/PayoutSplit'
      thumbnail_url:
        type: string
        description: |
          URL to a thumbnail of the item. Will be displayed when redirecting to the session.

          Recommended limitations for the image:

          - all images should preferrably have the same dimensions
          - max file size should be less than 2MB
        format: uri
      emd:
        $ref: '#/definitions/Emd'
      store:
        allOf:
          - $ref: '#/definitions/Store'
        description: |
          Store metadata, it can be used to track supplier/vendor/partner
          information when the main `order.store` is a marketplace / reseller
  DiscountType:
    type: string
    enum:
      - customer
      - periodic
      - manual
      - loyalty
      - total
      - employee
      - external
  DiscountItem:
    type: object
    properties:
      amount:
        type: integer
        example: 4400
        description: |
          Monetary amount in smallest unit for the currency
      percentage:
        type: number
        description: |
          Optional, set if the amount given was from a percentage discount
        example: 44
      discount_type:
        $ref: '#/definitions/DiscountType'
      discount_id:
        type: string
        example: 766da0ef-9283-42bd-b012-0582344ec53c
      description:
        type: string
      line_id:
        type: integer
        example: 1
  OrderDiscountItem:
    description: Discount details for an order item
    properties:
      eligible_for_discount:
        type: boolean
        default: false
        example: true
        description: |
          The item is eligible for discount
      is_changed:
        type: boolean
        description: |
          Discount applied to amount
      gross_amount:
        type: number
        readOnly: true
        description: |
          The origin item amount before any discount
      discount_lines:
        type: array
        items:
          $ref: '#/definitions/DiscountItem'
  RelativeTime:
    description: Relative time for delivery or pick-up
    type: object
    properties:
      working_days:
        type: array
        description: |
          The expected range of days until the relative time is reached.
          A range of `[0,0]` means the relative time is today. `[0,3]` means the relative time is within the next 3 days.
        example:
          - 1
          - 2
        minItems: 2
        maxItems: 2
        items:
          type: number
          minimum: 0
      shipping_day_of_week:
        type: number
        description: |
          The day of the week the relative time for shipping is on.
          1 is Monday, 2 is Tuesday, ..., 7 is Sunday.
        example: 3
        minimum: 1
        maximum: 7
      arrival_day_of_week:
        type: number
        description: |
          The day of the week the relative time for arrival is on.
          1 is Monday, 2 is Tuesday, ..., 7 is Sunday.
        example: 3
        minimum: 1
        maximum: 7
  OpeningHours:
    type: object
    properties:
      open_now:
        type: boolean
        description: |
          Indicates if the location is open now.
        example: true
      periods:
        type: array
        items:
          type: object
          description: |
            A period of time when the opening hours are valid.
          properties:
            opens_at:
              type: string
              format: time
              example: '08:00'
            closes_at:
              type: string
              format: time
              example: '16:00'
            day_of_week:
              type: number
              description: |
                The day of the week when the opening hours are valid.
              example: 1
      timezone:
        type: string
        description: |
          The timezone of the location.
        example: Europe/Oslo
  ShippingAddressDetails:
    type: object
    description: Additional information about the shipping address
    properties:
      website_url:
        type: string
        description: |
          The website URL of the customer.
      opening_hours:
        description: |
          The opening hours of the location.
        $ref: '#/definitions/OpeningHours'
  ShippingOption:
    type: object
    description: |
      A shipping option
    required:
      - id
      - line_id
      - amount
      - operator
      - title
    properties:
      id:
        type: string
        description: |
          Id of this shipping option product.

          The express checkout will group all products with the same id. Used for
          grouping delivery to the same address at different time slots, or for
          grouping deliveries to different pick up points.
        example: bring-pick-up-00001
      line_id:
        type: string
        description: |
          Unique id of the specific configuration of this shipping product
        example: bring-pick-up-00001-location-0a1f6b
      countries:
        description: Countries where this shipping option can be used
        type: array
        items:
          type: string
          format: iso3166-alpha2
          example: 'NO'
      amount:
        type: integer
        description: |
          The monetary amount of the shipping option, including VAT and discounts.

          In smallest unit for the currency, e.g. cents
        example: 3900
      vat_amount:
        type: integer
        description: |
          The VAT of the `amount` parameter. Only
          used for display purposes.
        example: 975
      vat:
        type: number
        description: |
          The VAT percentage
        example: 25
      title:
        type: string
        description: |
          A shipping option title. Eg. "Standard"
        example: Standard
      description:
        type: string
        description: |
          A short description of the shipping option product
        example: Pick up at your nearest postal office
      delivery_method:
        type: string
        enum:
          - delivery
          - pick_up
          - unspecified
          - none
        example: pick_up
      operator:
        type: string
        description: |
          Name of company that provides shipping service
        example: Bring
      operator_product_id:
        type: string
        description: |
          The operators own id for this shipping product
        example: pick-up-00001-location-0a1f6b
      eta:
        description: Estimated time of arrival
        type: object
        allOf:
          - $ref: '#/definitions/RelativeTime'
          - properties:
              starts_at:
                type: string
                format: date-time
                example: '2020-10-14T19:00:00Z'
              ends_at:
                type: string
                format: date-time
                example: '2020-10-14T20:00:00Z'
      time_slot:
        description: A specified time for delivery to customer
        type: object
        properties:
          starts_at:
            type: string
            format: date-time
            example: '2020-10-14T19:00:00Z'
          ends_at:
            type: string
            format: date-time
            example: '2020-10-14T20:00:00Z'
      pick_up_address:
        type: object
        allOf:
          - $ref: '#/definitions/OrderAddress'
          - $ref: '#/definitions/ShippingAddressDetails'
          - properties:
              distance:
                type: number
                description: |
                  Distance in kilometers from the shipping_address.
      metadata:
        type: object
        description: Additional metadata about the shipping_option
        maxProperties: 20
        additionalProperties:
          type:
            - string
            - number
        example:
          operator_dest: XAB1239
          number_x: 1921
      environmental_data:
        type: object
        description: |
          Environmental data about the shipping option
        required:
          - description
        properties:
          description:
            type: string
            description: |
              A short description of the environmental data, something like
              - "Fossil free",
              - "Carbon neutral"
              - "Low emissions"
              - "Renewable Energy Sourced"
              - "Eco-certified Fleet"
            example: Fossil free
          details:
            type: array
            items:
              type: object
              required:
                - label
                - value
              properties:
                label:
                  description: |
                    Give context to the value field. Example:
                    - "CO2 emissions"
                    - "Energy consumption"
                    - "Carbon footprint"
                    - "Carbon offset"
                    - "Trees planted"
                    - "Renewable energy percentage"
                  type: string
                  example: Carbon offset
                  maxLength: 50
                value:
                  type: string
                  example: 1KG CO2
                  maxLength: 50
      thumbnail_url:
        type: string
        description: |
          URL to a thumbnail of the shipping option. Will be displayed when
          redirecting to the session.
          Recommended limitations for the image:
            - all images should preferrably have the same dimensions
            - max file size should be less than 2MB
        format: uri
  SplitShippingOption:
    allOf:
      - $ref: '#/definitions/ShippingOption'
      - properties:
          pay_in_store:
            description: |
              Enable pay in-store during pick-up. The amount to be paid will be zero.
              Requires that the payment method `dintero.zero` is enabled
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - full
          fee_split:
            $ref: '#/definitions/PayoutFeeSplit'
          splits:
            type: array
            description: |
              An array of objects specifying how the amount should be split between
              sellers when using Dintero Payout

              Specify an empty array if the splits will be provided during capture.
              `auto_capture` cannot be enabled when splits are defined as empty array.
            items:
              $ref: '#/definitions/PayoutSplit'
  MultiShipmentItem:
    type: object
    required:
      - line_id
    properties:
      line_id:
        type: string
        example: line-id-1
        description: |
          The line_id or an item in order.items
      quantity:
        type: number
        description: |
          The quantity of the product in the item line.
  MultiShipmentShippingOption:
    allOf:
      - $ref: '#/definitions/SplitShippingOption'
      - properties:
          shipment_id:
            type: string
            description: |-
              For orders that have multiple shipments. The shipping options will be grouped by `shipment_id`. The top-level multi shipment shipping option array at `order.shipping_option.shipments` will contain one shipping option per `shipment_id` found in the shipping options sprovided in `express.shipping_options`.
              In order to present multiple shipping options for a given `shipment_id` set the same shipment_id to all the shipping options for that shipment.
          shipment_items:
            type: array
            description: |
              An array of objects specifying what items will be delivered by this shipment. Should
              only be specified when an order has multiple shipments so the checkout knows what
              items will be shipped by the shipping options.

              If there are multiple shipments the session (and resulting transaction) will have a
              single top-level shipping object that contains multiple `shipments` for the order.
            items:
              $ref: '#/definitions/MultiShipmentItem'
  MultiShipmentTopLevelShippingOption:
    allOf:
      - $ref: '#/definitions/SplitShippingOption'
      - properties:
          shipments:
            type: array
            description: |
              For multiple shipments we have a single top-level shipping object that contains
              the shipments for the order. The shipping options defined in `shipments` must contain
              `shipment_items` that define what items belong to what shipment.

              For multiple shipments:
                - do not define `splits` on the toplevel shipping option
                - do not define `fee_split` on the toplevel shipping option
                - the `pay_in_store` option is not compatible with `shipments`
                - empty shipments array is not allowed
                - single item multi shipping option is not allowed
            minItems: 2
            items:
              $ref: '#/definitions/MultiShipmentShippingOption'
  Giftcard:
    type: object
    required:
      - type
      - card_id
      - amount
    properties:
      type:
        type: string
        enum:
          - dintero.wallets
      card_id:
        type: string
      amount:
        type: integer
        description: |
          Non-negative, minor units. Total amount for the gift card
      masked_card_token:
        type: string
  SessionOrderUpdate:
    type: object
    properties:
      amount:
        type: integer
        format: int32
        example: 72200
        description: |
          The amount to authorize/capture including VAT and discounts.
          In smallest unit for the currency, e.g. cents

          The `amount` should be equal to the sum of the `items.amount` + `shipping_option.amount`.
      currency:
        type: string
        format: iso4217-code
        example: NOK
        description: The three-character ISO-4217 currency. https://en.wikipedia.org/wiki/ISO_4217
      vat_amount:
        type: integer
        format: int32
        example: 13660
        description: |
          The VAT of the `amount` parameter.
          Only used for display purposes.

          In smallest unit for the currency, e.g. cents

          The `vat_amount` should be equal to the sum of the `items.vat_amount` + `shipping_option.vat_amount`.
      merchant_reference_2:
        type: string
        description: |
          A reference by the merchant to identify the corresponding
          order for the Checkout Session
      event_reference:
        type: string
        description: |
          Default event_reference to include in transaction events. The value is included
          in the settlement report

          Use of `capture_reference` and `refund_reference` during capture and refund
          overrides the provided value
      shipping_address:
        $ref: '#/definitions/OrderAddress'
      billing_address:
        $ref: '#/definitions/OrderAddress'
      partial_payment:
        type: boolean
        default: false
        description: |
          This is a partial payment where the `order.amount` can be lower or
          equal to the sum of `order.items.amount`
      items:
        type: array
        description: |
          Details about the order items.

          #### Instabank
          `required` if Instabank payment is configured in and partial_payment is false.
          All items must include a unique `line_id`, quantity and amount

          #### Collector Bank
          `required` if Collector Bank payment is configured in and partial_payment is false.
          All items must include a unique `line_id`, quantity and amount
        items:
          allOf:
            - $ref: '#/definitions/OrderItem'
            - $ref: '#/definitions/OrderDiscountItem'
        example:
          - amount: 2000
            quantity: 2
            line_id: '1'
            description: Forsvinnignspølse
            vat: 20
            id: '10'
          - amount: 6600
            quantity: 2
            line_id: '2'
            description: Vissvossafår på neppebrød
            vat: 20
            id: '6'
            eligible_for_discount: true
            is_changed: true
            gross_amount: 10000
            discount_lines:
              - amount: 4400
                discount_type: customer
                discount_id: ed960ace-eb16-4e2e-ae52-b27647ccae8d
                description: Vossafestpris
                line_id: 1
          - amount: 59700
            quantity: 3
            line_id: '3'
            description: Luftboller
            vat: 20
            id: '1'
      gross_amount:
        type: number
        readOnly: true
        description: |
          The origin amount to authorize/capture including VAT
          before any discount, only set if the session was updated
          when calculating discounts.

          In smallest unit for the currency, e.g. cents
      is_changed:
        type: boolean
        readOnly: true
        description: |
          The original order amount was changed by discount
          given.
      shipping_option:
        $ref: '#/definitions/MultiShipmentTopLevelShippingOption'
      store:
        $ref: '#/definitions/Store'
      discount_lines:
        description: |
          Discounts given, additions to any items discount_lines.
        type: array
        items:
          $ref: '#/definitions/DiscountItem'
      discount_codes:
        type: array
        items:
          type: string
          example: SUMMER20
      gift_cards:
        type: array
        description: |
          The gift cards selected, the part of `order.amount` that will be
          authorized using gift cards
        maxItems: 1
        items:
          $ref: '#/definitions/Giftcard'
  SessionOrder:
    type: object
    required:
      - amount
      - currency
    allOf:
      - $ref: '#/definitions/SessionOrderUpdate'
      - required:
          - merchant_reference
        properties:
          payout_destination_id:
            type: string
            maxLength: 40
            description: |
              An id that identifies the seller, value will be included
              in the settlement reports.

              Note: The seller must be configured before the funds will be paid out. See https://docs.dintero.com/docs/checkout/split-payment/add-payout-destinations
          merchant_reference:
            type: string
            description: |
              A reference by the merchant to identify the corresponding
              order for the Checkout Session
  Checkbox:
    type: object
    required:
      - id
      - label
    properties:
      id:
        type: string
        description: |
          ID to assign to the checkbox so you can reference it later
      label:
        type: string
        description: |
          Label that should be visible next to the checkbox
        minLength: 2
        maxLength: 99
      checked:
        type: boolean
        description: |
          If the checkbox should be checked by default or not
      required:
        type: boolean
        description: |
          If the checkbox should be required or not
      link:
        type: object
        required:
          - url
          - text
        properties:
          url:
            type: string
            description: Link URL
          text:
            type: string
            description: Link text
            example: Terms for checkbox action
  CheckboxConfiguration:
    type: array
    description: |
      Configuration for checkboxes that should be part of the checkout
    items:
      $ref: '#/definitions/Checkbox'
    maxItems: 2
  SessionBase:
    type: object
    required:
      - order
      - url
    properties:
      url:
        $ref: '#/definitions/SessionUrls'
      customer:
        $ref: '#/definitions/SessionCustomer'
      order:
        $ref: '#/definitions/SessionOrder'
      expires_at:
        type: string
        format: date-time
      checkboxes:
        $ref: '#/definitions/CheckboxConfiguration'
  SessionCustomerTokens:
    type: object
    description: |
      Enable customer payment tokens in the session
    properties:
      customer:
        type: object
        properties:
          tokens:
            type: object
            properties:
              bambora.creditcard:
                type: object
                properties:
                  payment_token:
                    type: string
                    description: |
                      Preload the store payment data related to the payment
                      token and let the customer make a purchase without having
                      to enter all card data

                      - The `bambora.creditcard` must be enabled in the session
                        configuration to activate the use of provided payment token
                      - Use the `bambora.creditcard.generate_payment_token` option to
                        generate the token.
              payex.creditcard:
                type: object
                properties:
                  payment_token:
                    type: string
                    description: |
                      Preload the store payment data related to the payment
                      token and let the customer make a purchase without having
                      to enter all card data

                      - The `payex.creditcard` must be enabled in the session
                        configuration to activate the use of provided payment token
                      - Use the `payex.creditcard.generate_payment_token` option to
                        generate the token.
                  recurrence_token:
                    type: string
                    description: |
                      Preload the store payment data related to the recurrence
                      token and let the customer make a purchase without having
                      to enter all card data

                      - The `payex.creditcard` must be enabled in the session
                        configuration to activate the use of provided payment token
                      - Use the `payex.creditcard.generate_recurrence_token` option to
                        generate the token.
              dintero_psp.creditcard:
                type: object
                properties:
                  payment_token:
                    type: string
                    description: |
                      Preload the store payment data related to the payment
                      token and make a purchase without having to enter card data

                      - The `dintero_psp.creditcard` must be enabled in the session
                        configuration to activate the use of provided payment token
                      - Use the `dintero_psp.creditcard.generate_payment_token` option to
                        generate the token.
  AutoCaptureConfiguration:
    properties:
      auto_capture:
        type: boolean
        description: |
          If `true` the transaction from the payment session will be captured
          automatically after the transaction has been `AUTHORIZED`. The checkout
          sessions `callback_url` will not be called until after the transaction
          has been `CAPTURED`.

          If `auto_capture` is not specified it defaults to `false`.

          A successful auto-capture of a transaction sometimes requires more
          than one capture attempt. This can be the case if the payment gateway
          is down or is experiencing heavy traffic.

          Dintero will attempts capture retries for 48 hours, the `callback_url`
          will be invoked when capture succeeds.

          Manual capture of a transaction that is pending auto-capture will
          stop the auto-capture process from completing the capture.
  PublishConfiguration:
    description: |
      Publish checkout message to the customer.
    type: array
    items:
      type: object
      required:
        - type
        - channel
      properties:
        channel:
          type: string
          enum:
            - sms
            - push
        type:
          type: string
          enum:
            - checkout-link
            - app
            - terminal
        id:
          type: string
          readOnly: true
        status:
          type: string
          readOnly: true
          description: |
            status of the message sent to the customer.

            **`skipped`** will used in case where publish
            cannot be sent given the `session.customer`.
          enum:
            - sent
            - skipped
            - failed
  SessionPayability:
    type: string
    description: Determines if the payment_product_type is currently available for payment
    enum:
      - payable
      - disabled_by_gateway
      - disabled_by_order_amount
  BamboraConfiguration:
    type: object
    description: Bambora configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      applepay:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: Enable Apple Pay Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      creditcard:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Credit Card Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          generate_payment_token:
            type: boolean
            default: false
            description: |
              generate payment token to use for future payments

              The generated payment token will be made available from
              the transaction details.
      googlepay:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: Enable Google Pay Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      mobilepay:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable MobilePay Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      vipps:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Vipps Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
  DinteroConfiguration:
    type: object
    description: Dintero configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      wallets:
        type: object
        description: |
          Allow the payment session to be fully or partially authorized with
          Dintero Wallets gift card.

          Please note that the following payment methods are not supported together
          with Dintero Wallets gift cards: `vipps`, `swish.swish`,
          `klarna.billie`, `instabank`, `collector`, and `netaxept`.
          Creating a session with Dintero Wallets and either of the abovementioned
          payment types enabled will result in an error.
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable gift card
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      zero:
        type: object
        description: |
          Allow initiating pay on zero amount session, the payability will only
          be enabled if the session order amount is zero. Initiating a `dintero.zero`
          payment will result in a transaction with `dintero.zero` payment product type
          that will be excluded from settlement reports (as it will not have any payout)
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable zero amount session
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
  DinteroPspTokenAuthMethods:
    type: array
    description: |
      Indicates which authentication methods to support during token authentication flows.
      The list order determines which method is preferred.
      Methods are subject to card and device support.

      - `3DS`: Carholder authentication through 3D-Secure.
      - `PASSKEY`: Cardholder is prompted to create and authenticate with a device-bound Passkey.
    example:
      - PASSKEY
      - 3DS
    items:
      type: string
      enum:
        - 3DS
        - PASSKEY
  SCARule:
    type: object
    discriminator: type
    required:
      - type
    properties:
      type:
        type: string
        enum:
          - amount_lte
        description: The type of rule.
  DinteroPaymentOptionSCAPolicy:
    type: object
    description: |
      Configuration for SCA (Strong Customer Authentication) policies for Dintero PSP payment methods.
      Allows merchants to set up exemptions for when SCA can be skipped for a transaction.
      If SCA is skipped for a transaction the merchant will generally have liability for the transaction.
    properties:
      network_exemptions:
        type: object
        description: |
          Configuration for network exemptions, such as low_value and low_risk exemptions.
          The merchant can choose to enable/disable each exemption type, but they need to be
          approved to use them by Dintero. Low risk exemption takes precedence over low value exemption.
        properties:
          low_value:
            type: boolean
            description: |
              If true the low value exemption can be passed to issuer if the transaction amount is below 30 EUR or equivalent.
            example: true
          low_risk:
            type: boolean
            description: |
              If true the low risk exemption can be passed to issuer.
            example: true
      liability_rules:
        type: array
        description: |
          List of rules for when SCA can be skipped for a transaction.
          If multiple rules match the most restrictive rule will be applied.
        items:
          - $ref: '#/definitions/SCARule'
  DinteroPspConfiguration:
    type: object
    description: Dintero PSP configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      creditcard:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable creditcard
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          generate_payment_token:
            type: boolean
            default: false
            description: |
              generate payment token to use for future payments

              The generated payment token will be made available from
              the transaction details.
          token_supported_auth_methods:
            $ref: '#/definitions/DinteroPspTokenAuthMethods'
          sca_policy:
            $ref: '#/definitions/DinteroPaymentOptionSCAPolicy'
      vipps:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Vipps
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          sca_policy:
            $ref: '#/definitions/DinteroPaymentOptionSCAPolicy'
      applepay:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Apple Pay
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          sca_policy:
            $ref: '#/definitions/DinteroPaymentOptionSCAPolicy'
      googlepay:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Google Pay
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          generate_payment_token:
            type: boolean
            default: false
            description: |
              generate payment token to use for future payments

              The generated payment token will be made available from
              the transaction details.
      clicktopay:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Visa Click-to-Pay
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          generate_payment_token:
            type: boolean
            default: false
            description: |
              generate payment token to use for future payments

              The generated payment token will be made available from
              the transaction details.
          sca_policy:
            $ref: '#/definitions/DinteroPaymentOptionSCAPolicy'
  InstabankFinanceProduct:
    type: object
    required:
      - product_code
      - minimum_monthly_balance_rate
      - origination_fee
      - notification_fee
      - loan_example
    properties:
      product_code:
        type: string
        example: '630'
      minimum_monthly_balance_rate:
        type: string
        description: |
          The minimum monthly installment basis as a percentage of the account balance.
        format: ^([0-9]*[.])?[0-9]+$
        example: '1.67'
      annual_interest_rate:
        type: string
        description: |
          The interest rate for the payment product.
        format: ^([0-9]*[.])?[0-9]+$
        example: '0.0'
      effective_annual_interest_rate:
        type: string
        readOnly: true
        description: |
          The effective annual interest rate for the payment product
        example: '0.0'
      origination_fee:
        type: integer
        description: |
          The startup fee for the payment product.
        minimum: 0
        example: 9500
      notification_fee:
        type: integer
        description: |
          The notification fee for the payment product.
        minimum: 0
        example: 3900
      minimum_amount:
        type: integer
        description: |
          Minimum order amount for this product. The product option will be
          excluded in payments where the order amount is less than the minimum
          amount.
        example: 20000
        minimum: 1
      loan_example:
        type: object
        required:
          - amount
          - years
          - total_amount
          - cost
          - effective_annual_interest_rate
        properties:
          amount:
            type: integer
            description: |
              The amount loaned in the example.
            minimum: 0
            example: 2500000
          years:
            type: integer
            description: |
              Years of payment in the example.
            minimum: 1
            example: 1
          total_amount:
            type: integer
            description: |
              The total amount paid back in the example.
            minimum: 0
            example: 2772300
          cost:
            type: integer
            description: |
              The cost of the loan in the example.
            minimum: 0
            example: 272300
          effective_annual_interest_rate:
            type: string
            readOnly: true
            format: ^([0-9]*[.])?[0-9]+$
            description: |
              The effective annual interest rate in the example
            example: '21.38'
      branding_image_url:
        type: string
        description: Url for a custom branding image
  InstabankInvoiceProduct:
    type: object
    required:
      - product_code
      - due_in_days
      - invoice_fee
      - require_applicant_amount
    properties:
      product_code:
        type: string
        example: '632'
      due_in_days:
        type: integer
        minimum: 0
        description: Number of days before the payment is due.
        example: 10
      minimum_amount:
        type: integer
        description: |
          Minimum order amount for this product. The product option will be
          excluded in payments where the order amount is less than the minimum
          amount.
        example: 20000
        minimum: 1
      invoice_fee:
        type: integer
        description: |
          The fee for the payment product
        minimum: 0
        example: 9500
      require_applicant_amount:
        type: integer
        description: |
          The limit for when instabank will require a full applicant during payment.
        minimum: 0
        example: 7500000
      branding_image_url:
        type: string
        description: Url for a custom branding image
  InstabankInstallmentProduct:
    type: object
    description: |
      Payment product configuration
    required:
      - product_code
      - credit_time
      - origination_fee
      - notification_fee
      - annual_interest_rate
    properties:
      minimum_amount:
        type: integer
        description: |
          Minimum order amount for this product. The product option will be
          excluded in payments where the order amount is less than the minimum
          amount.
        example: 20000
        minimum: 1
      product_code:
        type: string
        example: '633'
      credit_time:
        type: integer
        description: |
          Number of months
        minimum: 1
        example: 36
      origination_fee:
        type: integer
        description: |
          The startup fee for the payment product
        minimum: 0
        example: 9500
      notification_fee:
        type: integer
        description: |
          The notification fee for the payment product
        minimum: 0
        example: 3900
      annual_interest_rate:
        type: string
        description: |
          The interest rate for the payment product.
        format: ^([0-9]*[.])?[0-9]+$
        example: '0.0'
      effective_annual_interest_rate:
        type: string
        readOnly: true
        description: |
          The effective annual interest rate for the payment product
        example: '54.69'
      total_amount:
        type: integer
        readOnly: true
        example: 309400
        description: The total amount to pay
      monthly_amount:
        type: integer
        readOnly: true
        example: 100000
        description: The amount to pay pr month
      first_monthly_amount:
        type: integer
        readOnly: true
        description: |
          The amount to pay in the first invoice. Origantion fee is added
          to the first invoice.
        example: 109500
      require_applicant_amount:
        type: integer
        description: |
          The limit for when instabank will require a full applicant during payment.
        minimum: 0
        example: 2500000
      loan_example:
        type: object
        required:
          - amount
          - years
          - total_amount
          - cost
          - effective_annual_interest_rate
        properties:
          amount:
            type: integer
            description: |
              The amount loaned in the example.
            minimum: 0
            example: 2500000
          years:
            type: integer
            description: |
              Years of payment in the example.
            minimum: 1
            example: 1
          total_amount:
            type: integer
            description: |
              The total amount paid back in the example.
            minimum: 0
            example: 2772300
          cost:
            type: integer
            description: |
              The cost of the loan in the example.
            minimum: 0
            example: 272300
          effective_annual_interest_rate:
            type: string
            readOnly: true
            format: ^([0-9]*[.])?[0-9]+$
            description: |
              The effective annual interest rate in the example
            example: '21.38'
      branding_image_url:
        type: string
        description: Url for a custom branding image
  InstabankPostponementProduct:
    type: object
    description: |
      Payment product configuration
    required:
      - product_code
      - postponement_months
      - origination_fee
      - annual_interest_rate
    properties:
      minimum_amount:
        type: integer
        description: |
          Minimum order amount for this product. The product option will be
          excluded in payments where the order amount is less than the minimum
          amount.
        example: 20000
        minimum: 1
      product_code:
        type: string
        example: '633'
      postponement_months:
        type: integer
        description: |
          Number of months
        minimum: 1
        example: 36
      origination_fee:
        type: integer
        description: |
          The startup fee for the payment product
        minimum: 0
        example: 9500
      notification_fee:
        type: integer
        description: |
          The notification fee for the payment product
        minimum: 0
        example: 3900
      annual_interest_rate:
        type: string
        description: |
          The interest rate for the payment product.
        format: ^([0-9]*[.])?[0-9]+$
        example: '0.0'
      effective_annual_interest_rate:
        type: string
        readOnly: true
        description: |
          The effective annual interest rate for the payment product
        example: '54.69'
      total_amount:
        type: integer
        readOnly: true
        example: 309400
        description: The total amount to pay
      require_applicant_amount:
        type: integer
        description: |
          The limit for when instabank will require a full applicant during payment.
        minimum: 0
        example: 2500000
      loan_example:
        type: object
        required:
          - amount
          - years
          - total_amount
          - cost
          - effective_annual_interest_rate
        properties:
          amount:
            type: integer
            description: |
              The amount loaned in the example.
            minimum: 0
            example: 2500000
          years:
            type: integer
            description: |
              Years of payment in the example.
            minimum: 1
            example: 1
          total_amount:
            type: integer
            description: |
              The total amount paid back in the example.
            minimum: 0
            example: 2772300
          cost:
            type: integer
            description: |
              The cost of the loan in the example.
            minimum: 0
            example: 272300
          effective_annual_interest_rate:
            type: string
            readOnly: true
            format: ^([0-9]*[.])?[0-9]+$
            description: |
              The effective annual interest rate in the example
            example: '21.38'
      branding_image_url:
        type: string
        description: Url for a custom branding image
  InstabankConfiguration:
    type: object
    properties:
      finance:
        type: object
        description: finance payment
        required:
          - enabled
        properties:
          enabled:
            description: enable finance payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          product:
            allOf:
              - readOnly: true
              - $ref: '#/definitions/InstabankFinanceProduct'
      invoice:
        type: object
        description: invoice payment
        required:
          - enabled
        properties:
          enabled:
            description: enable invoice payment (only for amounts greater than 500 NOK)
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          require_applicant:
            type: boolean
          product:
            allOf:
              - readOnly: true
              - $ref: '#/definitions/InstabankInvoiceProduct'
      installment:
        type: object
        description: Fixed Part Payment
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
            default: payment_product_type
          enabled:
            description: enable Instabank Installment Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          products:
            readOnly: true
            type: array
            items:
              $ref: '#/definitions/InstabankInstallmentProduct'
      postponement:
        type: object
        description: Postpone payment
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
            default: payment_product_type
          enabled:
            description: enable Instabank Postponement Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          products:
            readOnly: true
            type: array
            items:
              $ref: '#/definitions/InstabankPostponementProduct'
  NetaxeptConfiguration:
    type: object
    description: Netaxept configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      creditcard:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Credit Card Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          terminal:
            type: object
            description: |
              Use Netaxept terminal instead of Dintero Checkout

              See https://shop.nets.eu/web/partners/register
            required:
              - terminal
              - terminal_single_page
            properties:
              terminal:
                type: string
                enum:
                  - /Terminal/default.aspx
                  - /terminal/mobile/default.aspx
              terminal_design:
                description: |
                  Name of the terminal template to use, created in Netaxept Admin
                type: string
              terminal_single_page:
                description: Set hosted payment window to single page
                type: boolean
              terminal_layout:
                type: string
  PayExConfiguration:
    type: object
    properties:
      dynamic_descriptor:
        type: string
        maxLength: 40
        description: |
          A textual description max 40 characters of the purchase.
      swish:
        type: object
        required:
          - enabled
        properties:
          enabled:
            description: enable Payex Swish Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      creditcard:
        type: object
        required:
          - enabled
        properties:
          enabled:
            description: enable Credit Card Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          generate_payment_token:
            type: boolean
            default: false
            description: |
              generate payment token to use for future payments

              The generated payment token will be made available from
              the transaction details.
          generate_recurrence_token:
            type: boolean
            default: false
            description: |
              generate recurrence payment token to use for future payments

              The generated recurrence payment token will be made available from
              the transaction details.
          no_cvc:
            type: boolean
            description: |
              Disable the CVC field for payments where payment token is used.
              > To use this feature it has to be enabled on the contract with Swedbank Pay.
      mobilepay:
        type: object
        required:
          - enabled
        properties:
          enabled:
            description: enable Payex MobilePay Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      vipps:
        type: object
        required:
          - enabled
        properties:
          enabled:
            description: enable Payex Vipps Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      applepay:
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable PayEx Apple Pay payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      clicktopay:
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable PayEx Click to Pay payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      googlepay:
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable PayEx Google Pay payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
  VippsConfiguration:
    type: object
    required:
      - enabled
    properties:
      enabled:
        description: enable vipps payment
        type: boolean
      payability:
        $ref: '#/definitions/SessionPayability'
      dynamic_descriptor:
        type: string
        maxLength: 100
        description: |
          A short reference / descriptor that can be displayed to
          the end user
  CollectorB2BAddress:
    type: object
    required:
      - business_name
      - organization_number
      - address_line
      - postal_code
      - postal_place
      - country
      - phone_number
      - email
    properties:
      business_name:
        type: string
        description: ACME Inc
        maxLength: 50
      organization_number:
        minLength: 9
        maxLength: 12
        type: string
        description: |
          The organization number of the customer. For Norway, the length is 9. For Sweden, it's either 10 or 12 digits.
      address_line:
        type: string
        description: Gaustadalleen 21
        maxLength: 50
      address_line_2:
        type: string
        description: More details about address.
        maxLength: 50
      co_address:
        type: string
        description: CO-Address if applicable.
        maxLength: 50
      postal_code:
        type: string
        description: The zip code / postal code of the address.
        example: '0349'
        maxLength: 50
      postal_place:
        type: string
        description: The name of the postal code
        example: Oslo
        maxLength: 50
      country:
        type: string
        format: iso3166-alpha2
        description: Country of the location
        example: 'NO'
      phone_number:
        type: string
        pattern: ^\+?\d{5,15}$
        description: |
          mobile number of a person / company, ITU/E.123 format with
          international prefix (+PPNNNNNNNNN...)
      email:
        type: string
        maxLength: 100
        description: |
          The email address of a person or an organisation
      customer_reference:
        type: string
        description: The customer's reference
        maxLength: 50
      cost_center:
        type: string
        description: For companies that needs to specify a cost center.
        maxLength: 64
      first_name:
        type: string
        example: John
        maxLength: 50
      last_name:
        type: string
        example: Doe
        maxLength: 50
      address_id:
        type: string
        example: address_1
        description: |
          The unique identification of the address from the available addresses for the business
  CollectorConfiguration:
    type: object
    description: Collector configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        enum:
          - payment_type
      dynamic_descriptor:
        type: string
        maxLength: 40
        description: |
          A textual description max 40 characters of the purchase.
      invoice:
        type: object
        description: Invoice / Part Payment
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
            default: payment_product_type
          enabled:
            description: enable Collector Bank Invoice Payment
            type: boolean
          countries:
            type: array
            items:
              type: string
              format: iso-3166-1
          options:
            type: object
            properties:
              enable_on_hold:
                description: |
                  Create the collector transaction with status `ON_HOLD` and let
                  the Collector callback update the transaction state from `ON_HOLD`
                  to `AUTHORIZED` or `FAILED`.

                  A callback will be sent to the `callback_url` when the transaction
                  changes state from `ON_HOLD` to any new state.

                  This will override the payment option `enable_on_hold` and gateway config `options.enable_on_hold`-setting.
                type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      invoice_b2b:
        type: object
        description: Invoice / Part Payment
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
            default: payment_product_type
          payability:
            $ref: '#/definitions/SessionPayability'
          enabled:
            description: enable Collector Bank Invoice Payment B2B
            type: boolean
          countries:
            type: array
            items:
              type: string
              format: iso-3166-1
          options:
            type: object
            properties:
              disable_collector_b2b_address_enforcement:
                type: boolean
                default: false
                description: |
                  For `collector.invoice_b2b`. By default, the shipping_address B2B payments will be restricted to
                  the registered addresses of a company.

                  Setting this on the session will override the `collector_b2b_address_enforcement` in `payment_options`
                  on the checkout configuration.
              enable_on_hold:
                description: |
                  Create the collector transaction with status `ON_HOLD` and let
                  the Collector callback update the transaction state from `ON_HOLD`
                  to `AUTHORIZED` or `FAILED`.

                  A callback will be sent to the `callback_url` when the transaction
                  changes state from `ON_HOLD` to any new state.

                  This will override the gateway's `options.enable_on_hold`-setting.
                type: boolean
      invoice_b2b_preapproved:
        type: object
        description: Invoice for pre-approved B2B-customers
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
            default: payment_product_type
          payability:
            $ref: '#/definitions/SessionPayability'
          enabled:
            description: enable Collector Bank Invoice Payment B2B
            type: boolean
          countries:
            type: array
            items:
              type: string
              format: iso-3166-1
          accounts:
            description: |
              All Collector B2B accounts configured for the customer's phone number at the merchant.
            type: array
            items:
              type: object
              properties:
                billing_address:
                  $ref: '#/definitions/CollectorB2BAddress'
                company_id:
                  type: string
                  description: Token to represent the company
      finance:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
            default: payment_product_type
          enabled:
            description: enable Collector Bank Finance Payment
            type: boolean
          countries:
            type: array
            items:
              type: string
              format: iso-3166-1
          payability:
            $ref: '#/definitions/SessionPayability'
      installment:
        type: object
        description: Fixed Part Payment
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
            default: payment_product_type
          enabled:
            description: enable Collector Bank Installment Payment
            type: boolean
          countries:
            type: array
            items:
              type: string
              format: iso-3166-1
          options:
            type: object
            properties:
              enable_on_hold:
                description: |
                  Create the collector transaction with status `ON_HOLD` and let
                  the Collector callback update the transaction state from `ON_HOLD`
                  to `AUTHORIZED` or `FAILED`.

                  A callback will be sent to the `callback_url` when the transaction
                  changes state from `ON_HOLD` to any new state.

                  This will override the gateway's `options.enable_on_hold`-setting.
                type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
  KlarnaConfiguration:
    type: object
    description: Klarna configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      klarna:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Klarna Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
      billie:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Klarna B2B Payment with Billie
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
  KraviaConfiguration:
    type: object
    description: Kravia configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      invoice_b2b:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Kravia Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          days_until_due:
            type: integer
            description: |
              The number of days until the invoice is due.
            minimum: 0
            maximum: 365
            format: date
          require_identity_verification:
            type: boolean
            description: |
              Whether identity verification is required, before allowing
              payments.
              Defaults to true, it will require the customer to verify themselves
              before making a payment via methods like BankID, if false no verification
              will be required.
      invoice_b2b_grouped:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Kravia grouped invoices
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          invoice_schedule:
            type: object
            properties:
              interval:
                description: |
                  The interval at which the invoice should be issued. The invoice
                  will be issued on the first day of the interval.
                type: string
                enum:
                  - monthly
                  - quarterly
          days_until_due:
            type: number
            format: int32
            description: |
              The number of days until the invoice is due.
            minimum: 0
            maximum: 365
          require_identity_verification:
            type: boolean
            description: |
              Whether identity verification is required, before allowing
              payments.
              Defaults to true, it will require the customer to verify themselves
              before making a payment via methods like BankID, if false no verification
              will be required.
      invoice_b2c:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Kravia B2C invoice
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          days_until_due:
            type: integer
            description: |
              The number of days until the invoice is due.
            minimum: 0
            maximum: 365
            format: date
  SantanderConfiguration:
    type: object
    properties:
      type:
        description: Denotes what kind of config parameter this is
        enum:
          - payment_type
      debit_account:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            enum:
              - payment_product_type
          enabled:
            description: enable Santander Finance Debit Account
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          branding_name:
            type: string
            description: The name of the chain
          accounts:
            description: Debit accounts belonging to the customer's phone number
            type: array
            items:
              type: object
              properties:
                account_number_token:
                  type: string
                  description: Token to represent the account number
                masked_account_number:
                  type: string
                  description: Representation of the account number for display purposes
  SeitatechConfiguration:
    type: object
    description: Seitatech configuration
    properties:
      type:
        description: |
          Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      in_person:
        type: object
        description: |
          Enabling `in_person` via Seitatech requires `order.store.id` and
          `order.store.terminal_id` to be set

          If there are other payment options enabled in addition to seitatech.in_person,
          the in person payment must be iniated by performing a
          [POST /v1/sessions/{session_id}/pay](/#operation/checkout_sid_pay_post)

          Use callback and webhooks to receive notification when in_store payment
          is completed
        required:
          - enabled
        properties:
          type:
            type: string
            description: \ Denotes what kind of config parameter this is
            enum:
              - payment_product_type
          enabled:
            description: enable in person payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
  SwishConfiguration:
    type: object
    description: Swish configuration
    properties:
      type:
        description: Denotes what kind of config parameter this is
        type: string
        enum:
          - payment_type
      swish:
        type: object
        required:
          - enabled
        properties:
          type:
            description: Denotes what kind of config parameter this is
            type: string
            enum:
              - payment_product_type
          enabled:
            description: enable Swish Payment
            type: boolean
          payability:
            $ref: '#/definitions/SessionPayability'
          payout_enabled:
            description: Flag to check if Dintero handles payout for this payment product
            type: boolean
  PayoutConfiguration:
    type: object
    description: |
      Payout configuration
    properties:
      dynamic_payout_destination_ids:
        type: array
        description: |
          Use the order store id to control what `payout_destination_id` should
          be use

          A session created with the option set must have a store id that resolves
          to a payout_destination_id or have payout_destination_id set

          A session where both `order.store.id` and `order.payout_destination_id`
          will not be updated with match from `dynamic_payout_destination` if
          `overwrite_payout_destination_id` is not set to `true`             

          - **`order_store_id`**: May specific store id to specifc payout destination id
          - **`order_store_id_as_order_payout_destination_id`**: Use store id as payout destination id
        minItems: 1
        items:
          type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - order_store_id
                - order_store_id_as_order_payout_destination_id
            order_store_id:
              type: string
              description: Required if type is `order_store_id`
              example: STORE_123
            order_payout_destination_id:
              type: string
              description: Required if type is `order_store_id`
              example: PD_123
            overwrite_payout_destination_id:
              description: |
                Only applicable when type is `order_store_id`.

                Overwrite existing order payout_destination_id
              type: boolean
              default: false
      payment_products:
        type: array
        readOnly: true
        description: |
          The payment products where payout is enabled
        minItems: 1
        items:
          type: object
          required:
            - payment_product
          properties:
            payment_product:
              type: string
              description: Payment product
              enum:
                - bambora
                - collector
                - payex
                - klarna
                - swish
                - dintero_psp
  PaymentConfiguration:
    type: object
    allOf:
      - $ref: '#/definitions/AutoCaptureConfiguration'
      - properties:
          channel:
            type: string
            enum:
              - ecommerce
              - in_app
              - in_store
            default: ecommerce
            description: |
              `channel` enables special behaviour for various scenarios.

              The majority of web integrations will not need to set this property.

              ### in_app

              The `in_app` channel is intended for payments done from
              mobile devices where `url.return_url` can be set to the
              application's appswitch URL.

              #### Session deeplink URL

              Creating a session with `channel=in_app` will return an
              appswitch deeplink URL if the enabled payment options in
              the session supports it

              Appswitch deeplink is currently only supported for sessions
              that has only Vipps enabled via Dintero PSP, Vipps or Swedbank (payex) or
              Mobilepay enable via Swedbank (payex)

                - configuration.vipps.enabled
                - configuration.payex.vipps.enabled
                - configuration.payex.mobilepay.enabled
                - configuration.dintero_psp.vipps.enabled

              > `in_app` is currently not supported when express is enabled

              > `in_app` with deeplink URL is not supported if `publish` is enabled

              ### in_store

              The `in_store` channel is intended for payments done
              in physical stores.

              Depending on the payment_type, choosing `in_store` will
              change the behaviour of the payment.
          publish:
            $ref: '#/definitions/PublishConfiguration'
          active_payment_types:
            type: object
            properties:
              enabled:
                type: boolean
                description: |
                  Use this flag as wildcard to include all active payment types
                  configured for a given currency when creating a payment session.
          default_payment_type:
            type: string
            description: |
              Configure the default payment type, the selected payment when
              loading the checkout window. The value must be an enabled payment type.
            enum:
              - bambora.applepay
              - bambora.creditcard
              - bambora.googlepay
              - bambora.mobilepay
              - bambora.vipps
              - dintero.zero
              - dintero_psp.applepay
              - dintero_psp.creditcard
              - dintero_psp.vipps
              - dintero_psp.googlepay
              - dintero_psp.clicktopay
              - instabank.finance
              - instabank.invoice
              - instabank.installment
              - instabank.postponement
              - vipps
              - payex.creditcard
              - payex.mobilepay
              - payex.swish
              - payex.vipps
              - payex.applepay
              - payex.clicktopay
              - payex.googlepay
              - collector.finance
              - collector.invoice
              - collector.invoice_b2b
              - collector.invoice_b2b_preapproved
              - collector.installment_b2b_preapproved
              - collector.installment
              - santander.debit_account
              - swish.swish
              - netaxept.creditcard
              - klarna.klarna
              - klarna.billie
              - kravia.invoice_b2b
              - kravia.invoice_b2b_grouped
              - kravia.invoice_b2c
          bambora:
            $ref: '#/definitions/BamboraConfiguration'
          dintero:
            $ref: '#/definitions/DinteroConfiguration'
          dintero_psp:
            $ref: '#/definitions/DinteroPspConfiguration'
          instabank:
            $ref: '#/definitions/InstabankConfiguration'
          netaxept:
            $ref: '#/definitions/NetaxeptConfiguration'
          payex:
            $ref: '#/definitions/PayExConfiguration'
          vipps:
            $ref: '#/definitions/VippsConfiguration'
          collector:
            $ref: '#/definitions/CollectorConfiguration'
          klarna:
            $ref: '#/definitions/KlarnaConfiguration'
          kravia:
            $ref: '#/definitions/KraviaConfiguration'
          santander:
            $ref: '#/definitions/SantanderConfiguration'
          seitatech:
            $ref: '#/definitions/SeitatechConfiguration'
          swish:
            $ref: '#/definitions/SwishConfiguration'
          payout:
            $ref: '#/definitions/PayoutConfiguration'
          allow_express_wallet_payment:
            type: boolean
            description: |
              When enabled, wallet payments (like Apple Pay and Google Pay)
              can be used in their express mode, allowing customers to complete
              purchases with a single tap, bypassing the standard checkout flow.
            default: false
            example: false
  DiscountsConfiguration:
    properties:
      discounts:
        type: object
        description: |
          Configuration for discounts calculations
        properties:
          type:
            type: string
            readOnly: true
            enum:
              - discounts
          express_discount_codes:
            type: object
            required:
              - enabled
            properties:
              payability:
                $ref: '#/definitions/SessionPayability'
              enabled:
                type: boolean
                description: |
                  The discounts will be given by the configured express callback url.

                  The callback URL will be invoked when the session is updated
                  with a discount code, and the response used to update the discounts
                  on the order items and the shipping options.
          order:
            type: object
            description: |
              Configure discounts calculation on the session order.
            required:
              - enabled
            properties:
              enabled:
                description: |
                  Enable discount calculation on order
                  items eligible for discount

                  - A session that has the `customer.customer_id` set will have
                    its discounts calculated when the session is created.

                  - A session with no customer_id will only have the discounts
                    calculated when the customer is identified by the checkout
                    page.

                  - The autorized amount will be the net amount from the
                    original session amount specified when the session was
                    created.
                type: boolean
                default: false
  SessionThemeConfiguration:
    type: object
    properties:
      theme:
        type: object
        description: |
          Customize the appearance of the checkout.
        properties:
          backdrop:
            type: string
            description: |
              Color on backdrop shown in desktop mode

              Color, supported formats are
              - hex: `#ff0000`
              - rgb: `rgb(255,0,0)`
              - rgba: `rgba(255,0,0,0.5)`
          primary:
            type: string
            description: |
              Primary color used on pay button and other buttons.

              Color, supported formats are
              - hex: `#ff0000`
              - rgb: `rgb(255,0,0)`
              - rgba: `rgba(255,0,0,0.5)`
          text:
            type: string
            description: |
              **Deprecated** - will be ignored.

              Default text color.

              Color, supported formats are
              - hex: `#ff0000`
              - rgb: `rgb(255,0,0)`
              - rgba: `rgba(255,0,0,0.5)`
          warning:
            type: string
            description: |
              **Deprecated** - will be ignored.

              Color used for warnings.

              Color, supported formats are
              - hex: `#ff0000`
              - rgb: `rgb(255,0,0)`
              - rgba: `rgba(255,0,0,0.5)`
          error:
            type: string
            description: |
              **Deprecated** - will be ignored.

              Color used for errors.

              Color, supported formats are
              - hex: `#ff0000`
              - rgb: `rgb(255,0,0)`
              - rgba: `rgba(255,0,0,0.5)`
          font-family:
            type: string
            description: |
              **Deprecated** - will be ignored.

              Fontstack used by the checkout.

              Default value `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`
  CountryConfiguration:
    properties:
      countries:
        description: |
          Country preferences
        type: object
        properties:
          preferred_country:
            description: |
              Country to use as default in address and phone country code
            type: string
            format: iso3166-alpha2
          allow_countries:
            description: |
              List of countries where the customer is allowed to set their address.
              If empty, all countries are allowed, except for the ones in `deny_countries`.

              A country can not be in both `allow_countries` and `deny_countries`.
            type: array
            items:
              type: string
              format: iso3166-alpha2
          deny_countries:
            description: |
              List of countries where the customer is not allowed to set their address.

              A country can not be in both `allow_countries` and `deny_countries`.
            type: array
            items:
              type: string
              format: iso3166-alpha2
  DefaultCustomerTypeConfiguration:
    properties:
      default_customer_type:
        description: |
          Customer type to use as default for the customer.
        type: string
        enum:
          - b2c
          - b2b
  AllowDifferentBillingShippingAddressConfiguration:
    properties:
      allow_different_billing_shipping_address:
        description: |
          Allow that the shipping and billing address can be different.

          An array of strings, the values `b2c` and `b2b` can be used to
          limit the what types of customer that are allowed to submit different
          addresses for shipping and billing.

          By default we limit the shipping and billing addresses to be equal for
          both B2C and B2B customers.
        type: array
        default: []
        items:
          type: string
          enum:
            - b2c
            - b2b
  Merchant:
    type: object
    description: |
      Configure merchant information used in the
      checkout.
    required:
      - name
      - logo_url
    properties:
      name:
        type: string
      logo_url:
        type: string
        pattern: https?://*
        format: uri
      website:
        type: string
      email:
        type: string
      phone_number:
        type: string
      merchant_category_code:
        type: string
      country:
        type: string
        format: iso3166-alpha2
      postal_code:
        type: string
      postal_place:
        type: string
      address_line:
        type: string
      address_line_2:
        type: string
  SessionExpressUpdate:
    type: object
    required:
      - shipping_options
    properties:
      shipping_options:
        type: array
        description: |
          Shipping options that will be presented to the end user after the
          end user has submitted a shipping address.

          To dynamically update the shipping_options when the _`order.shipping_address`_ is
          changed by the end user in the checkout, use the
          _`url.shipping_address_callback_url`_.

           If the merchant is not able to ship the order to the end users shipping address, use an empty array.

           If there is only one option, a free delivery, the order still has to contain one option with a _`price.amount`_ of 0.
        items:
          $ref: '#/definitions/ShippingOption'
      shipping_mode:
        type: string
        enum:
          - shipping_required
          - shipping_not_required
        default: shipping_required
  SessionExpress:
    type: object
    properties:
      express:
        description: |
          ### Present only for _Express Checkout_ sessions.

          An _Express Checkout_ session is a session where the end user will submit a
          shipping address and then select a shipping option before the before a
          payment method is selected and the payment is initiated.

          Endpoints used in the _Express Checkout_ flow.
          1. [Set shipping address](/#operation/checkout_sid_json_order_shipping_address_put)
          2. [Set shipping option](/#operation/checkout_sid_json_order_items_shipping_option_put)
        type: object
        allOf:
          - $ref: '#/definitions/SessionExpressUpdate'
          - properties:
              discount_codes:
                description: |
                  Enable discount codes for Express Checkout
                properties:
                  max_count:
                    type: number
                    description: |
                      Limit how many discount codes can be added by the customer
                  callback_url:
                    type: string
                    format: uri
                    pattern: https?://*
                    example: https://example.com/order/00128110/discount_codes_updated
                    description: |
                      URL that Checkout will POST to when the user has submitted/changed
                      the discount codes for an express session.

                      Dintero will not attempt a retry after a failed delivery attempt.
                      Following situations is considered as failed delivery

                      - HTTP status codes that are not 200.
                      - A request timeout (60 seconds)
                      - Any connection error such as connection timeout, bad certificate, etc

                      The response from the callback will be used to update the order amount,
                      items discount_lines and shipping options.

                      See [POST example/discount_codes_callback_url](#operation/example_discount_codes_callback_url)
                      for details about the request and response.
              shipping_address_callback_url:
                type: string
                format: uri
                pattern: https?://*
                example: https://example.com/order/00128110/address_updated
                description: |
                  URL that Checkout will POST to when the end user has submitted/changed
                  a shipping address for an express-session.

                  Dintero will not attempt a retry after a failed delivery attempt.
                  Following situations is considered as failed delivery

                  - HTTP status codes that are not 200.
                  - A request timeout (60 seconds)
                  - Any connection error such as connection timeout, bad certificate, etc

                  The response from the callback will be used to update the shipping options.

                  See [POST example/shipping_address_callback_url](#operation/example_shipping_address_callback_url)
                  for details about the request and response.
              customer_types:
                type: array
                description: |
                  Limit the lind of customers that can be submitted via the address form in the express checkout.
                default:
                  - b2c
                  - b2b
                items:
                  type: string
                  enum:
                    - b2c
                    - b2b
  SessionProfile:
    type: object
    allOf:
      - $ref: '#/definitions/SessionBase'
      - $ref: '#/definitions/SessionCustomerTokens'
      - required:
          - profile_id
        properties:
          configuration:
            description: |
              Override configuration for the profile.
            allOf:
              - $ref: '#/definitions/PaymentConfiguration'
              - $ref: '#/definitions/DiscountsConfiguration'
              - $ref: '#/definitions/SessionThemeConfiguration'
              - $ref: '#/definitions/CountryConfiguration'
              - $ref: '#/definitions/DefaultCustomerTypeConfiguration'
              - $ref: '#/definitions/AllowDifferentBillingShippingAddressConfiguration'
          profile_id:
            type: string
            description: |
              configuration profile
          merchant:
            $ref: '#/definitions/Merchant'
      - $ref: '#/definitions/SessionExpress'
      - properties:
          express:
            type: object
            properties:
              shipping_options:
                type: array
                items:
                  $ref: '#/definitions/MultiShipmentShippingOption'
  SessionCustomerGiftcards:
    type: object
    description: |
      Enable customer gift cards in session
    properties:
      customer:
        type: object
        properties:
          gift_cards:
            type: object
            properties:
              dintero.wallets:
                type: array
                description: |
                  Preload checkout with Wallets cards and let the customer
                  use it during checkout by providing PIN to activate the
                  card (e.g. use Wallets card as giftcard)

                  - The `dintero.wallets` must be enabled in the session
                    configuration to activate the use of the provided gift card
                    tokens
                maxItems: 1
                items:
                  type: object
                  required:
                    - card_id
                  properties:
                    card_id:
                      type: string
  Metadata:
    type: object
    properties:
      metadata:
        type: object
        description: |
          Additional metadata about the resource

          > We recommend that keys used are prefixed with `ext` to avoid
          > collision with reserved keys

          - `dintero`
          - `merchant`
          - `session`
          - `event`
          - `payout`
          - `gateway`
          - `bambora`
          - `collector`
          - `instabank`
          - `klarna`
          - `kravia`
          - `netaxept`
          - `payex`
          - `santander`
          - `swish`
          - `vipps`
        maxProperties: 10
        additionalProperties:
          type:
            - string
            - number
        example:
          ext_system_x_id: XAB1239
          ext_number_x: 1921
          ext_original_currency: USD
          ext_original_amount: 3007
          ext_conversion_rate_ppm: 997258
          ext_conversion_timestamp: '2025-09-09T08:12:30Z'
  Id:
    type: object
    properties:
      id:
        type: string
        description: |
          An ID that uniquely identifies the resource
      created_at:
        type: string
        format: date-time
        description: |
          The date-time when the resource was created
  SessionOptions:
    type: object
    allOf:
      - $ref: '#/definitions/SessionBase'
      - $ref: '#/definitions/SessionExpress'
      - properties:
          express:
            type: object
            properties:
              shipping_options:
                type: array
                items:
                  $ref: '#/definitions/MultiShipmentShippingOption'
      - required:
          - configuration
        properties:
          configuration:
            allOf:
              - $ref: '#/definitions/PaymentConfiguration'
              - $ref: '#/definitions/DiscountsConfiguration'
              - $ref: '#/definitions/SessionThemeConfiguration'
              - $ref: '#/definitions/CountryConfiguration'
              - $ref: '#/definitions/DefaultCustomerTypeConfiguration'
              - $ref: '#/definitions/AllowDifferentBillingShippingAddressConfiguration'
  SystemRequestHeaders:
    type: object
    properties:
      dintero-system-name:
        type: string
        description: The name of the ecommerce solution
        example: woocommerce
      dintero-system-version:
        type: string
        description: The version number of the ecommerce solution
        example: 5.0.0
      dintero-system-plugin-name:
        type: string
        description: The name of the ecommerce plugin
        example: Dintero.Checkout.WooCommerce
      dintero-system-plugin-version:
        type: string
        description: The version number of the ecommerce plugin
        example: 2021.03.02
      user-agent:
        type: string
        description: The user-agent that performed the request
        example: 'Mozilla: Mozilla/5.0'
  PaymentOperationIntent:
    type: string
    enum:
      - unscheduled_purchase
      - recurring_purchase
      - generate_payment_token
    description: |
      Initiated by the merchant or used to generate a token
  RequestHeaders:
    type: object
    allOf:
      - $ref: '#/definitions/SystemRequestHeaders'
      - type: object
        properties:
          dintero-checkout-instance-id:
            type: string
            description: The instance of the checkout that performed the request
            example: abcd-14134556135
  CollectorB2BPaymentOperationAddress:
    type: object
    required:
      - business_name
      - organization_number
      - address_line
      - postal_code
      - postal_place
      - country
    properties:
      business_name:
        type: string
        description: ACME Inc
        maxLength: 50
      organization_number:
        minLength: 9
        maxLength: 12
        type: string
        description: |
          The organization number of the customer. For Norway, the length is 9. For Sweden, it's either 10 or 12 digits.
      address_line:
        type: string
        description: Gaustadalleen 21
        maxLength: 50
      postal_code:
        type: string
        description: The zip code / postal code of the address.
        example: '0349'
        maxLength: 50
      postal_place:
        type: string
        description: The name of the postal code
        example: Oslo
        maxLength: 50
      country:
        type: string
        format: iso3166-alpha2
        description: Country of the location
        example: 'NO'
      address_id:
        type: string
        example: address_1
        description: |
          The unique identification of the address from the available addresses for the business
  CollectorProduct:
    type: object
    description: |
      Collector payment product
    required:
      - id
      - type
      - credit_time
      - campaign_fee
      - origination_fee
      - notification_fee
      - total_amount
      - monthly_amount
      - first_monthly_amount
    properties:
      id:
        type: string
        description: |
          Id for the payment product
        example: IF_3_001
      type:
        type: string
        enum:
          - interest_free
          - annuity
        example: interest_free
      credit_time:
        type: integer
        description: |
          Number of months
        example: 3
      campaign_fee:
        description: |
          The fee for a "Buy now – pay later" Payment product
        type: integer
        example: 0
      origination_fee:
        type: integer
        description: |
          The startup fee for the payment product
        example: 9500
      notification_fee:
        type: integer
        description: |
          The notification fee for the payment product
        example: 3900
      annual_interest_rate:
        type: string
        description: |
          The interest rate for the payment product.
        example: '0.0'
      effective_annual_interest_rate:
        type: string
        description: |
          The effective annual interest rate for the payment product
        example: '54.69'
      total_amount:
        type: integer
        example: 309400
        description: The total amount to pay
      monthly_amount:
        type: integer
        example: 100000
        description: The amount to pay pr month
      first_monthly_amount:
        type: integer
        description: |
          The amount to pay in the first invoice. Origantion fee is added
          to the first invoice.
        example: 109500
  MyDinteroUserCreation:
    type: object
    description: |
      Options for myDintero
    required:
      - actions
      - terms
    properties:
      actions:
        description: |
          Actions to perform on the customer
        type: array
        items:
          type: string
          enum:
            - create_user
      terms:
        required:
          - id
          - url
        description: |
          Terms and conditions accepted
        type: object
        properties:
          id:
            description: |
              id of the myDintero terms and conditions
            type: string
            format: uuid
          url:
            type: string
            format: uri
            pattern: https?://*
            example: https://example.com/toc
            description: |
              Url to the terms and conditions accepted by the customer
  SessionMeta:
    type: object
    properties:
      id:
        type: string
        description: The ID of the Checkout
      created_at:
        type: string
        format: date-time
        description: Time when the Checkout was created
      updated_at:
        type: string
        format: date-time
        description: Last time when the Checkout was updated
      expires_at:
        type: string
        format: date-time
        description: |
          The session expiration time after which the
          Checkout page wouldn't be available
      customer_ip:
        type: string
        description: |
          The IP of the customer upon visiting the page.
          If the page is visited multiple times, the
          field is always updated with the last known value.
      user_agent:
        type: string
        description: |
          The full user agent of the device the customer
          used when visiting the checkout page
      initiating_system_request_headers:
        $ref: '#/definitions/SystemRequestHeaders'
      payment_operation:
        $ref: '#/definitions/PaymentOperationIntent'
      events:
        type: array
        description: |
          Checkout process events
        items:
          type: object
          properties:
            created_at:
              type: string
              format: date-time
            id:
              type: string
            request_id:
              type: string
            name:
              type: string
              enum:
                - INITIATED
                - VISITED
                - COMPLETED
                - AUTHORIZED
                - DECLINED
                - PAY_LOCK_START
                - PAY_LOCK_META
                - PAY_LOCK_END
                - PAY_FAILED
                - ON_HOLD_CALLBACK_SENT
                - AUTH_CALLBACK_SENT
                - FAILED
                - UNKNOWN
                - PAYMENT_TOKEN_FLOW_START
                - UPDATE_SESSION
                - CANCELLED
                - SET_BILLING_ADDRESS
                - SET_DISCOUNT_CODES
                - SET_SHIPPING_ADDRESS
                - SET_SHIPPING_OPTION
                - SET_GIFT_CARD
                - PUSH_NOTIFICATION_SENT
                - SECRET_CONFIRMATION_CODE_SENT
                - SET_MY_DINTERO
                - ADD_PAYMENT_INFORMATION
            request_headers:
              $ref: '#/definitions/RequestHeaders'
            details:
              type: object
              properties:
                error:
                  type: string
                payment_product_type:
                  type: string
                amount:
                  type: integer
                shipping_option:
                  $ref: '#/definitions/MultiShipmentTopLevelShippingOption'
                shipping_address:
                  $ref: '#/definitions/OrderAddress'
                bambora:
                  type: object
                  properties:
                    session_token:
                      type: string
                    session_url:
                      type: string
                    wallet_session_id:
                      type: string
                klarna:
                  type: object
                  required:
                    - client_token
                    - session_id
                  properties:
                    client_token:
                      type: string
                    session_id:
                      type: string
                payex:payment:id:
                  type: string
                vipps:payment:id:
                  type: string
                vipps:gateway_api_version:
                  type: string
                collector:invoice_b2b:addresses:
                  type: array
                  items:
                    $ref: '#/definitions/CollectorB2BPaymentOperationAddress'
                collector:installment:products:
                  type: array
                  items:
                    $ref: '#/definitions/CollectorProduct'
                my_dintero:
                  $ref: '#/definitions/MyDinteroUserCreation'
                organization_number:
                  type: string
                previous_order:
                  $ref: '#/definitions/SessionOrder'
                updated_order:
                  $ref: '#/definitions/SessionOrder'
                updated_order_result:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - NOT_MODIFIED
                      example: NOT_MODIFIED
                      description: |
                        The status of the order object after the update,
                        e.g. if the update modified the order object or not.
                previous_express:
                  $ref: '#/definitions/SessionExpress'
                updated_express:
                  $ref: '#/definitions/SessionExpress'
                updated_express_result:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - NOT_MODIFIED
                      example: NOT_MODIFIED
                      description: |
                        The status of the express object after the update,
                        e.g. if the update modified the express object or not.
                gift_card:
                  type: object
                  properties:
                    card_id:
                      type: string
                    card_amount:
                      type: number
                    masked_card_token:
                      type: string
                    currency:
                      type: string
        example:
          - id: 769952fe-86c9-4185-a1ce-aeb46da3509c
            name: INITIATED
            created_at: '2019-05-09T09:13:40.306Z'
            request_id: b97b6312-f8b3-11ed-be56-0242ac120002
          - name: VISITED
            created_at: '2019-05-09T09:13:50.548Z'
          - name: PAY_FAILED
            created_at: '2019-05-09T09:14:10.548Z'
            details:
              error: Rejected
              payment_product_type: instabank.finance
          - name: FAILED
            created_at: '2019-05-09T09:16:11.786Z'
      transaction_id:
        type: string
        description: |
          Transaction which has been created using the checkout.
  Session:
    allOf:
      - $ref: '#/definitions/SessionOptions'
      - $ref: '#/definitions/SessionMeta'
  SessionRead:
    type: object
    properties:
      order:
        type: object
        properties:
          gift_cards:
            type: array
            description: |
              The gift cards selected, the part of `order.amount` that will be
              authorized using gift cards
            maxItems: 1
            items:
              $ref: '#/definitions/Giftcard'
      customer:
        type: object
        properties:
          my_dintero:
            $ref: '#/definitions/MyDinteroUserCreation'
          gift_cards:
            type: object
            properties:
              dintero.wallets:
                type: array
                description: |
                  Preload checkout with Wallets cards and let the customer
                  use it during checkout by providing PIN to activate the
                  card (e.g. use Wallets card as giftcard)

                  - The `dintero.wallets` must be enabled in the session
                    configuration to activate the use of the provided gift card
                    tokens
                maxItems: 1
                items:
                  type: object
                  required:
                    - card_id
                  properties:
                    card_id:
                      type: string
                    masked_card_token:
                      type: string
          tokens:
            type: object
            properties:
              payex.creditcard:
                type: object
                properties:
                  payment_token_id:
                    type: string
                    description: |
                      Id included if the payex.creditcard was created with
                      payment_token set.
                    readOnly: true
                    example: 2134a260d196b1d65e59b259dc43f619d7f0f3c6
              bambora.creditcard:
                type: object
                properties:
                  payment_token_id:
                    type: string
                    description: |
                      Id included if the bambora.creditcard was created with
                      payment_token set.
                    readOnly: true
                    example: 2134a260d196b1d65e59b259dc43f619d7f0f3c6
              dintero_psp.creditcard:
                type: object
                properties:
                  payment_token_id:
                    type: string
                    description: |
                      Id included if the dintero_psp.creditcard was created with
                      payment_token set.
                    readOnly: true
                    example: 2134a260d196b1d65e59b259dc43f619d7f0f3c6
      metadata:
        type: object
        description: |
          metadata about the session
        properties:
          session:profile_id:
            type: string
            description: Profile Id used when session was created
      configuration:
        type: object
        properties:
          merchant:
            type: object
            properties:
              id:
                type: string
                example: null
              logo_url:
                type: string
                format: uri
              name:
                type: string
                example: TKP tech AS
  SessionCancelled:
    type: object
    properties:
      cancelled_by:
        type: string
      cancelled_at:
        type: string
        format: date-time
        description: |
          The date-time when the resource was cancelled
  Error:
    type: object
    required:
      - error
    properties:
      error:
        type: object
        required:
          - message
        properties:
          code:
            type: string
            description: The code used to identify the error/warning
          errors:
            type: array
            description: The nested error(s) encountered during validation
            items:
              type: object
          message:
            type: string
            description: The human readable description of the error/warning
  UpdateSessionOptions:
    type: object
    allOf:
      - required:
          - order
        properties:
          order:
            $ref: '#/definitions/SessionOrderUpdate'
          express:
            allOf:
              - $ref: '#/definitions/SessionExpressUpdate'
              - properties:
                  shipping_options:
                    type: array
                    items:
                      $ref: '#/definitions/MultiShipmentShippingOption'
          remove_lock:
            type: boolean
            description: Remove lock after updating
            default: true
  SessionPaymentToken:
    type: object
    required:
      - order
      - url
    properties:
      order:
        type: object
        required:
          - currency
          - merchant_reference
        properties:
          currency:
            type: string
            format: iso4217-code
            example: NOK
            description: The three-character ISO-4217 currency. https://en.wikipedia.org/wiki/ISO_4217
          merchant_reference:
            type: string
            description: |
              A reference by the merchant to identify the corresponding
              order for the Checkout Session
          merchant_reference_2:
            type: string
            description: |
              A reference by the merchant to identify the corresponding
              order for the Checkout Session
          store:
            $ref: '#/definitions/Store'
      url:
        $ref: '#/definitions/SessionUrls'
      profile_id:
        type: string
        description: |
          configuration profile to use for branding
      customer:
        $ref: '#/definitions/SessionCustomer'
      expires_at:
        type: string
        format: date-time
      configuration:
        $ref: '#/definitions/SessionThemeConfiguration'
  TokenProvider:
    type: object
    discriminator: payment_product_type
    required:
      - payment_product_type
    properties:
      payment_product_type:
        type: string
        description: |
          The payment product type corresponding to create token for
  StringMetadata:
    type: object
    properties:
      metadata:
        type: object
        description: |
          Additional metadata about the resource

          > All metadata keys must be prefixed with **`ext_`** and the length
          > if key/value pair is 128/256 characters
        maxProperties: 10
        additionalProperties:
          type: string
          maxLength: 256
        example:
          ext_system_x_id: XAB1239
          ext_number_x: '1921'
          ext_original_currency: USD
          ext_original_amount: '3007'
          ext_conversion_rate_ppm: '997258'
          ext_conversion_timestamp: '2025-09-09T08:12:30Z'
  SettlementStatus:
    type: string
    description: |
      Overall settlement status after the events
    enum:
      - NOT_SETTLED
      - PENDING_SETTLEMENT
      - PARTIALLY_SETTLED
      - SETTLED
  TransactionSettlementsEvent:
    type: object
    required:
      - settlement_id
      - provider_reference
      - amount
    properties:
      settlement_id:
        type: string
        description: |
          Id of the settlement this was paid in
      provider_reference:
        type: string
        description: |
          The providers reference for the settlement
      event_correlation_id:
        type: string
        description: |
          Id for matching to transaction event
      amount:
        type: number
        description: |
          The amount paid out in this settlement
      capture:
        type: number
        description: |
          Amount captured in this settlement
      refund:
        description: |
          Amount refunded in this settlement
        type: number
      fee:
        description: |
          Fee of the capture in this settlement
        type: number
  TransactionSettlementsRead:
    type: object
    required:
      - events
    properties:
      events:
        description: |
          One item per payout to the merchants bank account
        type: array
        items:
          $ref: '#/definitions/TransactionSettlementsEvent'
      settlement_status:
        type: string
        enum:
          - NOT_SETTLED
          - PENDING_SETTLEMENT
          - PARTIALLY_SETTLED
          - SETTLED
  TransactionEvent:
    type: object
    properties:
      id:
        type: string
        readOnly: true
      transaction_status:
        description: |
          The transaction state after this event
        type: string
        enum:
          - INITIATED
          - AUTHORIZED
          - AUTHORIZATION_VOIDED
          - CAPTURED
          - PARTIALLY_CAPTURED
          - PARTIALLY_CAPTURED_REFUNDED
          - REFUNDED
          - PARTIALLY_REFUNDED
          - DECLINED
          - FAILED
          - UNKNOWN
          - ON_HOLD
      gift_cards:
        type: array
        description: |
          The gift cards that was used as part of this event
        items:
          allOf:
            - $ref: '#/definitions/Giftcard'
            - required:
                - transaction_id
              properties:
                transaction_id:
                  type: string
                  description: The external transaction ID
      event:
        type: string
        description: the event type
        example: CAPTURE
        enum:
          - INITIALIZE
          - AUTHORIZE
          - CAPTURE
          - REFUND
          - VOID
          - INITIATE_REFUND
          - INITIATE_VOID
          - INITIATE_CAPTURE
          - SETTLEMENT
      success:
        type: boolean
        description: |
          The event operation completed with success
      correction:
        type: object
        description: |
          Correction of the transaction status and event after
          a failed operation
        required:
          - status
          - remaining_capture_amount
          - remaining_refund_amount
          - remaining_void_amount
        properties:
          event_ids:
            type: array
            description: |
              List of event ids added to correct the transaction status
            items:
              type: string
          status:
            description: |
              status the transaction was corrected to
            type: string
          remaining_capture_amount:
            type: integer
            example: 50000
            minimum: 0
            description: |
              Monetary amount in smallest unit for the currency
          remaining_refund_amount:
            type: integer
            example: 50000
            minimum: 0
            description: |
              Monetary amount in smallest unit for the currency
          remaining_void_amount:
            type: integer
            example: 50000
            minimum: 0
            description: |
              Monetary amount in smallest unit for the currency
      error:
        type: object
        description: |
          The event error is only used when the success is `false`.
        required:
          - message
        properties:
          code:
            type: string
            description: The code used to identify the error/warning
          message:
            type: string
            description: The human readable description of the error/warning
          type:
            type: string
            enum:
              - DO_NOT_RETRY
              - MODIFICATIONS_REQUIRED
              - DAILY_LIMIT_EXCEEDED
              - MONTHLY_LIMIT_EXCEEDED
              - REJECTED_BY_ACQUIRER_INVALID_AMOUNT
              - REJECTED_BY_ACQUIRER_FORMAT_ERROR
              - REJECTED_BY_ACQUIRER_POSSIBLE_FRAUD
              - REJECTED_BY_ACQUIRER_CARD_STOLEN
              - REJECTED_BY_ACQUIRER_CARD_EXPIRED
              - REJECTED_BY_ACQUIRER
              - REJECTED_BY_ACQUIRER_INSUFFICIENT_FUNDS
              - ACQUIRER_HOST_OFFLINE
              - UNKNOWN
          result_code:
            type: string
            description: |
              Result code received from Visa or Mastercard
      amount:
        type: number
        description: |
          Amount captured or refunded
      calculated_vat_amount:
        type: number
        description: |
          Best-effort calculation of the VAT amount in this transaction
      items:
        type: array
        description: The applicable event items
        items:
          allOf:
            - properties:
                discount_lines:
                  description: Metadata about discounts given
                  type: array
                  items:
                    $ref: '#/definitions/DiscountItem'
            - $ref: '#/definitions/OrderItem'
      created_at:
        type: string
        format: date-time
      created_by:
        type: string
      request_id:
        type: string
        format: uuid
        example: 05c91a5b-9c3d-4214-a7e1-e472dbe22eb9
      metadata:
        type: object
        description: |
          Additional details about the event
      correlation_request_id:
        type: string
        format: uuid
        example: 05c91a5b-9c3d-4214-a7e1-e472dbe22eb9
        description: |
          The event correlation to existing event. The property will
          be set if the event is an CAPTURE or REFUND of correlated
          INITIATE_CAPTURE or INITIATE_REFUND event.
      event_reference:
        type: string
        description: |
          Reference for the transaction event provided by the merchant.

          - For captures, this is `capture_reference`
          - For refunds, this is `refund_reference`

          When relevant, it will be visible on the Dintero settlement report.
      request_headers:
        $ref: '#/definitions/RequestHeaders'
      settlements:
        $ref: '#/definitions/TransactionSettlementsRead'
  Card:
    type: object
    properties:
      brand:
        type: string
        description: Visa, MasterCard, etc. The brand of the card.
        example: Visa
      masked_pan:
        type: string
        example: 476173******0416
      expiry_date:
        type: string
        format: \d{2}/\d{4}
      type:
        type: string
        enum:
          - Credit
          - Debit
          - Credit Card
          - Debit Card
      region:
        type: string
        enum:
          - domestic
          - eea
          - eea-uk
          - europe
          - inter
        description: |
          The region in which the transaction takes place, determined by
          location of merchant and issuer.

          * `domestic`: merchant and issuer within the same country.
          * `eea`: merchant and issuer within EEA, but not the same country.
          * `eea-uk`: merchant and issuer within EEA plus United Kingdom, but one or both not withing EEA.
          * `europe`: merchant and issuer within Europe, but one or both not within EEA plus United Kingdom.
          * `inter`: merchant and/or issuer not within Europe.
      country:
        type: string
        description: The country the card is issued in
        format: iso-3166-1
        example: NOR
      product_platform:
        type: string
        enum:
          - consumer
          - commercial
      issuing_bank:
        type: string
        description: |
          The name of the bank that issued the card used
      acquirer_transaction_type:
        type: string
        description: |
          3DSECURE or SSL. Indicates the transaction type of the acquirer.
        enum:
          - 3DSECURE
          - SSL
      acquirer_stan:
        description: |
          The System Trace Audit Number assigned by the acquirer to
          uniquely identify the transaction.
        type: string
      acquirer_terminal_id:
        description: The ID of the acquirer terminal.
        type: string
      acquirer_transaction_time:
        description: The ISO-8601 date and time of the acquirer transaction.
        type: string
        format: date-time
      authentication_status:
        type: string
        description: |
          Y, A, U or N. Indicates the status of the authentication.
        enum:
          - 'Y'
          - A
          - U
          - 'N'
      three_ds_version:
        type: string
        example: '2'
      three_ds_server_trans_id:
        type: string
      eci:
        type: string
        example: '05'
      payment_system_type:
        type: string
        example: wallet
      payment_token:
        type: string
        description: |
          The payment token generated by the authorization. Only available
          for transactions created from session where the
          generate_payment_token option is enabled in the session
          configuration, or from payment token sessions where payment_token
          is included in the token_provider.token_types

          - [POST /v1/sessions/payment-token](#operation/checkout_payment_token_session_post)
      payment_token_id:
        type: string
        description: |
          The id of the payment_token, only included in transaction where
          a payment_token was generated.
      recurrence_token:
        type: string
        description: |
          The recurrence token generated by the authorization. Only available
          for transactions created from session where the
          generate_recurrence_token option is enabled in the session
          configuration, or from payment token sessions where recurrence_token
          is included in the token_provider.token_types

          - [POST /v1/sessions/payment-token](#operation/checkout_payment_token_session_post)
      recurrence_token_id:
        type: string
        description: |
          The id of the recurrence_token, only included in transaction where
          a recurrence_token was generated.
  TransactionBambora:
    properties:
      card:
        $ref: '#/definitions/Card'
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                bambora:transaction:status:
                  type: string
                bambora:transactionoperation:id:
                  type: string
                bambora:meta:action:source:
                  type: string
                bambora:meta:action:code:
                  type: string
                bambora:meta:action:type:
                  type: string
                payout_correlation_id:
                  description: |
                    Id that will be referenced on the settlement report, unique for this event
                  type: string
      metadata:
        type: object
        properties:
          gateway:id:
            type: string
          bambora:merchant_number:
            type: string
          bambora:transaction_id:
            type: string
          bambora:reference:
            type: string
          bambora:acquirer:
            type: string
          bambora:wallet:
            type: string
  VerifiedIdentity:
    type: object
    description: |
      Verified identity of the customer aka payer
    required:
      - type
      - iss
      - aud
      - acr
      - auth_time
      - national_idp
      - national_country
    properties:
      type:
        type: string
        enum:
          - collector-idp
      iss:
        type: string
        format: uri
        maxLength: 100
        example: https://idp-uat.collectorbank.se
      sub:
        type: string
        maxLength: 100
      aud:
        type: string
        maxLength: 100
      acr:
        type: string
        format: uri
        maxLength: 100
        description: Authentication Context Class Reference.
        example: urn:collectorbank:ac:method:nbid
      auth_time:
        type: string
        format: date-time
      national_idp:
        type: string
        maxLength: 20
      national_country:
        type: string
        format: iso3166-alpha2
        maxLength: 2
        example: 'NO'
      nonce:
        type: string
      name:
        type: string
        maxLength: 100
        example: John Doe
      given_name:
        type: string
        maxLength: 100
        example: John
      family_name:
        type: string
        maxLength: 100
        example: Doe
  TransactionCollector:
    properties:
      verified_identity:
        $ref: '#/definitions/VerifiedIdentity'
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                collector:Invoice.InvoiceStatus:
                  type: number
                  description: External status reported after adding invoice and activating invoice
                collector:CorrelationId:
                  type: string
                  description: |
                    External request id
                collector:Invoice.PaymentReference:
                  type: string
                  description: |
                    The payment identification number. This is the id the customer must use when they do a payment of an invoice.
                collector:Invoice.LowestAmountToPay:
                  type: number
                  description: The lowest amount to pay on the invoice.
                collector:Invoice.TotalAmount:
                  type: number
                  description: The total amount to pay for the invoice.
                collector:Invoice.DueDate:
                  type: string
                  description: The due date of the invoice.
                collector:Invoice.InvoiceUrl:
                  type: string
                  description: The url to invoice in pdf format.
                collector:Invoice.CurrentInvoiceNumber:
                  type: string
                  description: The invoice number of the invoice that this event belongs to.
                collector:Invoice.NewInvoiceNumber:
                  type: string
                  description: The invoice number for the next capture.
      metadata:
        type: object
        properties:
          collector:StoreId:
            type: string
            description: The Collector Store ID of the payment
          collector:Invoice.InvoiceNumber:
            type: string
            description: The invoice number of the invoice.
          collector:Invoice.OrderNumber:
            type: string
            description: Corresponds to the Dintero session ID
          collector:Invoice.CountryCode:
            type: string
            description: The country of the payment
          collector:Invoice.ProductCode:
            type: string
          collector:Invoice.InvoiceType:
            type: string
          collector:Invoice.SettlementReference:
            type: string
            description: The SettlementReference used for the payment.
  TransactionInstabank:
    properties:
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                instabank:Sale.Status:
                  type: string
                  description: |
                    External status reported after the transaction event
                instabank:RequestId:
                  type: string
                  description: |
                    External request id
      metadata:
        type: object
        properties:
          instabank:Sale.ExternalReference:
            type: string
            description: |
              External reference for the transaction
          instabank:Sale.Sequence:
            type: number
            description: |
              External case sequence (id)
          instabank:Sale.Product.Name:
            type: string
            description: Payment product name
  TransactionDinteroPsp:
    properties:
      card:
        $ref: '#/definitions/Card'
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                dintero_psp:operation_ref:
                  type: string
                  description: Unique reference of operation
                dintero_psp:authorization_operation_ref:
                  type: string
                  description: |
                    Reference to authorization operation upon void or capture
                dintero_psp:capture_operation_ref:
                  type: string
                  description: |
                    Reference to capture operation upon refund
                dintero_psp:sale_operation_ref:
                  type: string
                  description: |
                    Reference to sale operation upon sale refund
                dintero_psp:network:correlation_id:
                  type: string
                  description: |
                    Reference to the operation, assigned by the card network.
                dintero_psp:network:acquirer_stan:
                  type: string
                  description: |
                    System Trace Audit Number (STAN) is a number Dintero assigns
                    to uniquely identify a transaction on the card network.
                    Present on Mastercard transactions only.
                dintero_psp:network:lifecycle_trace_id:
                  type: string
                  description: |
                    Reference to the original authorization. The value is assigned
                    to the original authorization, and is present on subsequent
                    incremental authorizations, captures, and reversals.
                    Present on Mastercard transactions only.
      metadata:
        type: object
        properties:
          gateway:id:
            type: string
            description: |
              Transaction Id in Dintero PSP
  TransactionKlarna:
    properties:
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                klarna:reference:
                  type: string
                  description: |
                    Internal reference sent to Klarna for the capture/refund. This will be included in the settlement files.
                klarna:headers:capture_id:
                  type: string
                  description: Id of the capture created in Klarna
                klarna:headers:refund_id:
                  type: string
                  description: Id of the refund created in Klarna
                klarna:headers:location:
                  type: string
                  description: |
                    The URI at which the capture or refund created in Klarna can be found
                klarna:authorization_expiration:
                  type: string
                  description: |
                    Authorization expiration date (ISO 8601 format), e.g. "2023-08-16T15:00:00Z".
                klarna:authorization_expiration_reason:
                  type: string
                  description: The reason for extending the authorization date. This will be included after extending authorization.
                klarna:authorization_expiration_reference:
                  type: string
                  description: |
                    A reference specified by the merchant to identify the transaction.
                    This will be included after extending authorization.
                klarna:authorization_expiration_error_reason:
                  type: string
                  description: |
                    The reason an error occurred when trying to extend the authorization date.
                    This will be included after extending authorization.
      metadata:
        type: object
        properties:
          gateway:id:
            type: string
            description: |
              Order Id in Klarna
          merchant_name:
            type: string
          klarna:authorized_payment_method:type:
            type: string
            enum:
              - invoice
              - fixed_amount
              - base_account
              - direct_debit
              - direct_bank_transfer
              - b2b_invoice
              - card
              - slice_it_by_card
              - pay_later_by_card
              - pay_by_card
              - fixed_sum_credit
          klarna:authorized_payment_method:number_of_days:
            type: string
          klarna:authorized_payment_method:number_of_installments:
            type: string
          klarna:authorized_payment_method:fraud_status:
            type: string
            enum:
              - ACCEPTED
              - PENDING
            description: |
              Fraud status for order
  TransactionNetaxept:
    properties:
      card:
        $ref: '#/definitions/Card'
      events:
        type: array
        items:
          type: object
          properties:
            transaction_status:
              type: string
              readOnly: true
              enum:
                - INITIATED
                - AUTHORIZED
                - AUTHORIZATION_VOIDED
                - CAPTURED
                - PARTIALLY_CAPTURED
                - REFUNDED
                - PARTIALLY_REFUNDED
                - DECLINED
                - FAILED
                - UNKNOWN
            metadata:
              type: object
              properties:
                netaxept:transaction_id:
                  type: string
                netaxept:operation:
                  type: string
                netaxept:execution_time:
                  type: string
                netaxept:bat_number:
                  type: string
                netaxept:response_code:
                  type: string
                netaxept:terminal_url:
                  type: string
      metadata:
        type: object
        properties:
          netaxept:merchant_id:
            type: string
          netaxept:transaction_id:
            type: string
  TransactionPayEx:
    properties:
      card:
        $ref: '#/definitions/Card'
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                payex:transaction:id:
                  type: string
                payex:transaction:number:
                  type:
                    - number
                    - string
                payex:transaction:type:
                  type: string
                payex:transaction:state:
                  type: string
                payex:transaction:created:
                  type: string
                  format: date-time
                payex:transaction:payee_reference:
                  type: string
      metadata:
        type: object
        properties:
          payex:payment:payee_info:payee_id:
            type: string
          payex:payment:payee_info:payee_name:
            type: string
          payex:payment:payee_info:subsite:
            type: string
          payex:payment:id:
            type: string
          payex:payment:number:
            type:
              - number
              - string
          payex:payment:operation:
            type: string
          payex:payment:created:
            type: string
            format: date-time
  TransactionSantander:
    properties:
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                santander:debit_account.ApplicationNumber:
                  type: string
                  description: ID of the application provided by Santander
                santander:debit_account.StatusCode:
                  type: string
                  description: Status code from Santander
      metadata:
        type: object
        properties:
          santander:debit_account.ApplicationNumber:
            type: string
            description: ID of the application provided by Santander
          santander:debit_account.StatusCode:
            type: string
            description: Status code from Santander
  SwishTransactionEventMetadata:
    type: object
    properties:
      swish:payment_request:token:
        type: string
      swish:payment_request:get_payment_url:
        type: string
      swish:id:
        type: string
      swish:originalPaymentReference:
        type: string
      swish:paymentReference:
        type: string
      swish:amount:
        type: string
      swish:dateCreated:
        type: string
      swish:datePaid:
        type: string
      swish:status:
        type: string
      swish:errorCode:
        type: string
      swish:errorMessage:
        type: string
  TransactionSwish:
    properties:
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              $ref: '#/definitions/SwishTransactionEventMetadata'
      metadata:
        type: object
        properties:
          swish:payment_request:id:
            type: string
          swish:swish_number:
            type: string
          swish:id:
            type: string
            description: Payment request id
          swish:paymentReference:
            type: string
            description: Capture payment reference from bank
  TransactionVipps:
    properties:
      events:
        type: array
        items:
          type: object
          properties:
            metadata:
              type: object
              properties:
                vipps:transactionInfo.timeStamp:
                  type: string
                  format: date-time
                vipps:transactionInfo.transactionId:
                  type: string
                vipps:transactionInfo.status:
                  type: string
                  enum:
                    - INITIATE
                    - RESERVE
                    - CANCEL
                    - CAPTURE
                    - SALE
                    - VOID
                    - Captured
                    - Cancelled
                    - Refund
                vipps:transaction.transactionText:
                  type: string
      metadata:
        type: object
        properties:
          vipps:transaction.orderId:
            type: string
          vipps:transaction.transactionText:
            type: string
          vipps:merchantInfo.merchantSerialNumber:
            type: string
            description: |
              Unique id for this merchant's sales channel: website, mobile app
              etc. Short name: MSN.
            format: ^\d{6}$
            maxLength: 9
          vipps:merchantInfo.paymentType:
            type: string
            enum:
              - eComm Regular Payment
  Transaction:
    allOf:
      - $ref: '#/definitions/Id'
      - type: object
        required:
          - payment_product
          - payment_product_type
          - amount
          - currency
        properties:
          payment_product:
            description: |
              The payment product corresponding to this transaction
            type: string
            enum:
              - bambora
              - collector
              - dintero
              - dintero_psp
              - instabank
              - klarna
              - netaxept
              - payex
              - santander
              - swish
              - vipps
          payment_product_type:
            type: string
            description: |
              The payment product type corresponding to this transaction
            enum:
              - bambora.applepay
              - bambora.creditcard
              - bambora.googlepay
              - bambora.mobilepay
              - bambora.vipps
              - collector.invoice
              - collector.invoice_b2b
              - collector.invoice_b2b_preapproved
              - collector.installment
              - dintero.zero
              - dintero.wallets
              - dintero_psp.creditcard
              - dintero_psp.vipps
              - dintero_psp.googlepay
              - dintero_psp.applepay
              - dintero_psp.clicktopay
              - instabank.finance
              - instabank.invoice
              - instabank.installment
              - instabank.postponement
              - klarna.klarna
              - klarna.billie
              - kravia.invoice_b2b
              - kravia.invoice_b2b_grouped
              - kravia.invoice_b2c
              - netaxept.creditcard
              - payex.creditcard
              - payex.mobilepay
              - payex.swish
              - payex.vipps
              - payex.applepay
              - payex.clicktopay
              - payex.googlepay
              - santander.debit_account
              - swish.swish
              - vipps
          amount:
            type: integer
            description: |
              Non-negative, minor units. Total amount of the transaction
            example: 72200
          currency:
            type: string
            format: iso4217-code
            example: NOK
            description: ISO 4217 transaction currency
          payout_destination_id:
            type: string
            maxLength: 40
            description: |
              An id that identifies the seller, value will be included in
              the settlement reports
          merchant_reference:
            type: string
            description: |
              A reference specified by the merchant to identify the transaction
          channel:
            type: string
            description: |
              The channel for the transaction
            enum:
              - ecommerce
              - in_app
              - in_store
            default: ecommerce
          merchant_reference_2:
            type: string
            description: |
              A reference specified by the merchant to identify the transaction, can be updated after the transaction has been created
          dynamic_descriptor:
            type: string
            description: |
              A short reference / descriptor that will show
              up on the customers bank statement
          payment_operation:
            $ref: '#/definitions/PaymentOperationIntent'
          settlement_status:
            $ref: '#/definitions/SettlementStatus'
          customer:
            type: object
            properties:
              customer_id:
                type: string
                description: |
                  Customer id
              email:
                type: string
                example: john.doe@example.com
                description: |
                  Customer email address
              phone_number:
                type: string
                example: '+4799999999'
                description: |
                  Customer phone number, ITU/E.123 format with
                  international prefix (+PPNNNNNNNNN...)
              my_dintero:
                $ref: '#/definitions/MyDinteroUserCreation'
          customer_ip:
            type: string
            description: The IP address of the customer
            example: 127.0.0.1
          user_agent:
            type: string
            description: |
              The full user agent string of the device the customer used
              to submit the transaction
            example: Mozilla/5.0 ...
          initiating_system_request_headers:
            $ref: '#/definitions/SystemRequestHeaders'
          shipping_address:
            $ref: '#/definitions/OrderAddress'
          shipping_option:
            $ref: '#/definitions/MultiShipmentTopLevelShippingOption'
          billing_address:
            $ref: '#/definitions/OrderAddress'
          store:
            $ref: '#/definitions/Store'
          status:
            description: The current status of the transaction
            type: string
            readOnly: true
            example: CAPTURED
            enum:
              - INITIATED
              - AUTHORIZED
              - AUTHORIZATION_VOIDED
              - CAPTURED
              - PARTIALLY_CAPTURED
              - PARTIALLY_CAPTURED_REFUNDED
              - REFUNDED
              - PARTIALLY_REFUNDED
              - DECLINED
              - FAILED
              - UNKNOWN
              - ON_HOLD
          gift_cards:
            type: array
            description: |
              The gift cards that used to partially or fully authorize the transaction
            items:
              $ref: '#/definitions/Giftcard'
          items:
            type: array
            description: |
              The applicable transaction items
            items:
              allOf:
                - $ref: '#/definitions/OrderItem'
                - $ref: '#/definitions/OrderDiscountItem'
            example:
              - amount: 2000
                quantity: 2.5
                line_id: '1'
                description: Forsvinnignspølse
                vat: 20
                id: '10'
              - amount: 6600
                quantity: 2
                line_id: '2'
                description: Vissvossafår på neppebrød
                vat: 20
                id: '6'
                eligible_for_discount: true
                is_changed: true
                gross_amount: 10000
                discount_lines:
                  - amount: 4400
                    discount_type: customer
                    discount_id: ed960ace-eb16-4e2e-ae52-b27647ccae8d
                    description: Vossafestpris
                    line_id: 1
              - amount: 59700
                quantity: 3
                line_id: '3'
                description: Luftboller
                vat: 20
                id: '1'
          url:
            type: object
            properties:
              redirect_url:
                type: string
                format: uri
                readOnly: true
                description: |
                  URL the customer is redirected after checkout completes
                  (successfully or failed)
              approval_url:
                type: string
                format: uri
                description: |
                  URL the customer is redirected to for authentication.
                readOnly: true
              callback_url:
                type: string
                format: uri
                description: |
                  URL that Checkout will call when the session payment is complete
                  and the transaction has been authorized
          events:
            type: array
            description: |
              All events recorded on the transaction
            items:
              $ref: '#/definitions/TransactionEvent'
            example:
              - event: INITIATE
                transaction_status: INITIATED
                created_at: '2019-01-18T13:13:37.175Z'
                success: true
                request_id: a3dcc23125bc4363b9dae29ed25a4eb1
              - event: AUTHORIZE
                transaction_status: AUTHORIZED
                created_at: '2019-01-18T13:13:37.540Z'
                success: true
                request_id: f5f64165e5b3404e9af63586c184c3e9
              - event: CAPTURE
                transaction_status: PARTIALLY_CAPTURED
                created_at: '2019-01-18T15:37:00.879Z'
                created_by: 99115ac5-2d10-4be4-8594-bbf5e3aa7dfc
                amount: 59700
                splits:
                  - payout_destination_id: P000000001
                    amount: 29700
                  - payout_destination_id: P000000002
                    amount: 30000
                fee_split:
                  type: proportional
                  destinations:
                    - P000000001
                items:
                  - amount: 59700
                    quantity: 3
                    line_id: '3'
                success: true
                request_id: 27c71936004e48649c6dd437d314d90c
              - event: CAPTURE
                transaction_status: CAPTURED
                created_at: '2019-01-18T21:24:31.669Z'
                created_by: a33aef94-a17d-447a-a1dd-81055892b59d
                amount: 8600
                items:
                  - amount: 2000
                    quantity: 2
                    line_id: '1'
                  - amount: 6600
                    quantity: 2
                    line_id: '2'
                success: true
                request_id: c3e60b98a1d1466c97151318be621cf9
          session_id:
            type: string
            description: The session id for the transaction
            example: P00000000.465U8CUzaPVpneu1wt8Wei
          session:
            $ref: '#/definitions/Session'
          updated_at:
            type: string
            description: When the transaction was last modified.
            format: date-time
          created_at:
            type: string
            format: date-time
            description: When the transaction was created
          metadata:
            type: object
            description: Additional details about the transaction
            properties:
              merchant_name:
                type: string
              merchant_country:
                type: string
              merchant_category_code:
                type: string
              session:profile_id:
                type: string
                description: Profile Id used when session was created
              event_reference:
                type: string
                description: |
                  Event Reference used when session was created, default value that
                  will be used on capture and refund
              payout:
                type: string
                description: |
                  How settlement payout will be done by Dintero

                  - `payout_account`: Payout directly to merchant
                  - `payout_splits`: Payout is splitted to one or more sellers
                  - `payout_destination_id`: Payout is done to a single seller
                enum:
                  - payout_account
                  - payout_splits
                  - payout_destination_id
              payout_correlation_id:
                type: string
                description: |
                  Id that will be referenced on the settlement report
          checkboxes:
            $ref: '#/definitions/CheckboxConfiguration'
      - $ref: '#/definitions/TransactionBambora'
      - $ref: '#/definitions/TransactionCollector'
      - $ref: '#/definitions/TransactionInstabank'
      - $ref: '#/definitions/TransactionDinteroPsp'
      - $ref: '#/definitions/TransactionKlarna'
      - $ref: '#/definitions/TransactionNetaxept'
      - $ref: '#/definitions/TransactionPayEx'
      - $ref: '#/definitions/TransactionSantander'
      - $ref: '#/definitions/TransactionSwish'
      - $ref: '#/definitions/TransactionVipps'
  SettlementItem:
    type: object
    properties:
      id:
        type: string
        description: |
          Unique identifier for the settlement
      start_at:
        type: string
        format: datetime
        description: Time of first payment event in this settlement
      end_at:
        type: string
        format: datetime
        description: Time of last payment event in this settlement
      created_at:
        type: string
        format: datetime
      updated_at:
        type: string
        format: datetime
      settled_at:
        type: string
        format: datetime
        description: Settlement date
      email_received_at:
        type: string
        description: Time of email received in Dintero's system
      provider:
        type: string
        description: Name of payment provider.
      provider_reference:
        type: string
        description: The provider's unique id of the settlement
      attachments:
        type: array
        items:
          type: object
          properties:
            id:
              type: string
              description: Unique id of the attachment
            key:
              type: string
              description: Attachment path
            content_type:
              type: string
              example: application/xml
            extension:
              type: string
            created_by:
              type: string
              description: |
                Where the attachment was created. Might be created by dintero,
                or might be created by the providers, e.g. payex, vipps, collector
              example: payex
      amounts:
        type: array
        items:
          type: object
          properties:
            amount:
              type: number
              description: |
                The amount paid out, unless payment_status is postponed.

                `amount = capture - refund - fee`
            capture:
              type: number
              description: |
                The amount captured on the orders in the settlement period.
            refund:
              type: number
              description: |
                The amount refunded on the orders in the settlement period.
            fee:
              type: number
              description: |
                The sum of fees on the orders in the settlement period.
            currency:
              type: string
              format: iso4217-code
              example: NOK
      payment_status:
        type: string
        description: |
          Whether the amount in the report has actually been paid or not.
          The payment might be postponed for later.
        enum:
          - paid
          - postponed
      store_id:
        type: string
        description: |
          The sales location this report is for. Will only be set if all
          transactions share the same store_id.
      payout_destination_id:
        type: string
        description: |
          The seller id this report is for. Will only be set if all
          transactions share the same payout_destination_id.
  SettlementResponse:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/SettlementItem'
      last_evaluated_key:
        type: object
        description: |
          Details included for use in pagination. Use the value of `settled_at`|
          or `created_at` and `id` as `starting_after_id` and `starting_after_date`
          parameter to retrieve the next page of settlements.
        properties:
          id:
            type: string
          account_id:
            type: string
          settled_at:
            type: string
            format: datetime
          created_at:
            type: string
            format: datetime
            description: |
              Included when filtering by `item_created_at.gte` and/or
              `item_created_at.lte`, the value to use for `starting_after_date`
  UpdateSettlementReportConfigItem:
    type: object
    required:
      - filetypes
      - destinations
      - providers
    properties:
      send_every:
        description: |
          **Deprecated** report configuration is not used for controlling when to create and send report

          Value in milliseconds describing how often reports should be sent.
        type: number
        example: 86400000
      filetypes:
        type: array
        items:
          type: string
        description: The filetypes that should be sent
      destinations:
        type: array
        description: List of destinations. If empty, the report is just stored and visible from the backoffice.
        items:
          type: object
          required:
            - destination_type
          properties:
            id:
              type: string
            destination_type:
              type: string
              description: |
                Specifies the type of destination.

                - account_email: Send email to the billing email address registered on the account
                - email: Send email to the email address specified in `destination_value`
              enum:
                - account_email
                - email
            destination_value:
              type: string
              description: |
                If destination_type is email, the email address goes here
      providers:
        type: array
        description: List of providers to send report for. If empty, send for all.
        items:
          type: string
      filters:
        description: |
          The report will only be sent to the provided destinations if it satisfies these criterias.
        type: array
        items:
          type: object
          properties:
            filter:
              type: string
              enum:
                - payout_destination_id
              description: |
                The "field/column" the data will be filtered on
            value:
              type: string
              description: The value the records must contain for the provided filter (field/column)
  SettlementReportConfigItem:
    type: object
    allOf:
      - $ref: '#/definitions/UpdateSettlementReportConfigItem'
      - properties:
          id:
            type: string
          last_send_at:
            description: |
              **Deprecated** report configuration is not used for controlling when to create and send report

              Value in milliseconds (Unix epoch) describing when last time reports was sent.
            type: number
            readOnly: true
          last_modified_at:
            description: |
              **Deprecated** report configuration is not used for controlling when to create and send report

              Value in milliseconds (Unix epoch) describing when last time reports was modified.
            type: number
            readOnly: true
          created_at:
            type: string
            format: date-time
            description: |
              The date-time when the resource was created
            readOnly: true
          updated_at:
            type: string
            format: date-time
            description: |
              The date-time when the resource was last updated
            readOnly: true
          account_id:
            type: string
            readOnly: true
  SettlementReportConfigResponse:
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/SettlementReportConfigItem'
      starting_after:
        type: string
        description: cursor for use in pagination
  ReportFilter:
    type: object
    properties:
      filter:
        type: string
        enum:
          - operation_payout_destination
          - store_id
        description: The "field/column" the data will be filtered on
      value:
        type: string
        description: The value the records must contain for the provided filter (field/column)
  ReportMetadata:
    type: object
    properties:
      id:
        type: string
        description: Unique identification of the report
        readOnly: true
      report_job_id:
        type: string
        description: Unique identification for all reports created by the same reportconfig at the same time (with different content types)
        readOnly: true
      account_id:
        type: string
        description: Id of the report owner
        readOnly: true
      template_id:
        type: string
        description: Id of the template used to create the report
        readOnly: true
      content_type:
        type: string
        description: Report content type
        example: application/pdf
        readOnly: true
      content_language:
        type: string
        description: Report content language
        example: en
        readOnly: true
      created_by:
        type: string
        example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
        description: |
          The ID of the user/client that created the report
        readOnly: true
      created_at:
        type: string
        format: date-time
        description: |
          The date-time when the report was created
        readOnly: true
      data_from:
        type: string
        format: date-time
        description: |
          The start of the data interval, contains created_at if data_from qparam not provided
        readOnly: true
      data_to:
        type: string
        format: date-time
        description: |
          The end of the data interval, contains created_at if data_to qparam not provided
        readOnly: true
      schedule:
        type: string
        description: Schedule for the report
        readOnly: true
      report_file_name:
        type: string
        description: |
          Name of the report file stored in S3.
        readOnly: true
      custom_report_name:
        type: string
        description: |
          Custom name of the report, defined in the report configuration used to generate the report
        readOnly: true
      report_config_id:
        type: string
        description: |
          Id of the report configuration used to generate the report.
        readOnly: true
      data_type:
        type: string
        description: |
          Source of the data used to generate the report. Defined by the report configuration used to create the report
        readOnly: true
      signed_url:
        type: string
        description: |
          Signed url used to download the report from s3
        readOnly: true
      report_filters:
        type: array
        description: List of filters used to filter the data for the report. Similar to SQL WHERE-clause. i.e, WHERE filter=value
        items:
          $ref: '#/definitions/ReportFilter'
  StartingAfter:
    type: string
    description: |
      cursor for use in pagination. starting_after is an object ID
      that defines your place in the list. For instance, if you make
      a list request and receive 100 objects, ending with `obj_foo`,
      your subsequent call can include `starting_after=obj_foo`
      in order to fetch the next page of the list.
  AuthToken:
    type: object
    discriminator: grant_type
    required:
      - grant_type
    properties:
      grant_type:
        type: string
  AccessToken:
    type: object
    required:
      - access_token
      - token_type
      - expires_in
    properties:
      access_token:
        type: string
        description: A JWT access token
        example: eyJhbGci...t7P4
      token_type:
        type: string
        enum:
          - Bearer
      expires_in:
        type: integer
        description: |
          The lifetime in seconds of the access token.  For
          example, the value "3600" denotes that the access token will
          expire in one hour from the time the response was generated.
        example: 86400
      refresh_token:
        type: string
        description: |
          Token that can be used to request new tokens when the existing
          Access Token expire.

          You can only get a Refresh Token if the Access Token used in the
          request has scope:

           - `create:accounts:auth:refresh_token`

          and the `grant-type` is one of:

           - `authorization_code`
           - `password`

          **NOTE**:
           - A Single-Page Application should not ever receive a Refresh Token,
             this information is sensitive and should not be exposed client-side
             in a browser.
           - Refresh token must be stored securely by an application since
             they allow a user to remain authenticated essentially forever.
  Entity:
    type: object
    properties:
      id:
        type: string
        format: uuid
        description: |
          An UUID that uniquely identifies the resource
        readOnly: true
      created_at:
        type: string
        format: date-time
        description: |
          The date-time when the resource was created
        readOnly: true
      created_by:
        type: string
        example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
        description: |
          The ID of the user/client created the resource
        readOnly: true
      updated_at:
        type: string
        format: date-time
        description: |
          The date-time when the resource was last updated
        readOnly: true
      deleted_by:
        type: string
        example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
        description: |
          The ID of the user/client created the resource
        readOnly: true
      deleted_at:
        type: string
        format: date-time
        readOnly: true
  LegalEntityType:
    type: string
    description: |
      - For a company seller select `company` or leave blank. Required fields are
        `organization_number` and `country_code`.
      - For an individual seller select `individual`. Provide optional fields in
        the individual object.
    enum:
      - company
      - individual
  Individual:
    type: object
    description: |
      Used only if `type` is `individual`.
    additionalProperties: false
    properties:
      name:
        type: string
      birth_date:
        type: string
        format: date
      phone_number:
        type: string
      email:
        type: string
        format: email
      address_line:
        type: string
        example: Sommerkroveien 34
      address_line_2:
        type: string
        example: PB 123
      address_postal_code:
        type: string
        example: '0349'
      address_city:
        type: string
        example: Oslo
      address_country:
        type: string
        format: iso-3166-1
        description: |
          ISO 3166-1 country code
        example: 'NO'
  ApprovalsBankAccount:
    type: object
    required:
      - bank_account_currency
      - payout_currency
    properties:
      bank_name:
        type: string
        description: Name of the Bank used
      bank_account_number:
        type: string
        description: BBAN, national bank account number
      bank_account_number_type:
        type: string
        enum:
          - IBAN
          - BBAN
        description: |
          The type of bank account number. Will default to BBAN in bank_country_code
          is norwegian. Will default to IBAN in all other countries.
      bank_account_country_code:
        type: string
        format: iso-3166-1
        description: |
          Country code, must be a two letter ISO 3166-1-alpha-2 country code. If not
          set we default to the country_code of parent approval object.
        maxLength: 2
        minLength: 2
      bank_account_currency:
        type: string
        format: iso4217-code
        example: NOK
        description: |
          The three-character ISO-4217 currency.
          https://en.wikipedia.org/wiki/ISO_4217
      payout_currency:
        type: string
        format: iso4217-code
        example: NOK
        description: |
          The three-character ISO-4217 currency.
          https://en.wikipedia.org/wiki/ISO_4217
      bank_identification_code:
        type: string
        example: DNBANOKKXXX
        description: |
          A BIC code, or Bank Identifier Code also know as SWIFT code, consistin of
          8 to 11 alphanumeric characters.
  ApprovalsPayoutDestination:
    type: object
    allOf:
      - $ref: '#/definitions/Entity'
      - required:
          - payout_destination_id
          - payout_reference
          - bank_accounts
        properties:
          language:
            type: string
            maxLength: 2
            enum:
              - en
              - 'no'
            description: The language that will be used in emails, declaration form, signing page etc.
          payout_destination_id:
            type: string
            maxLength: 40
            description: |
              ID of seller to create when the contract has been completed,
              signed, and approved.
          payout_destination_name:
            type: string
            maxLength: 60
            description: The name of the seller
          payout_destination_description:
            type: string
            maxLength: 1000
            description: Description of the seller
          payout_reference:
            type: string
            maxLength: 60
            description: |
              A static reference that will be included on bank payments, the
              name of the service the payout-destination will be enrolled into.
              Eg. if yor platform is an "Uber for lawnmowers" called "Mowber"
              the payout_reference should be "Mowber".
          type:
            $ref: '#/definitions/LegalEntityType'
          country_code:
            type: string
            format: iso-3166-1
            description: |
              Country code, must be a two letter ISO 3166-1-alpha-2 country code.
              Required if type is omitted or set to `company`.
            maxLength: 2
            minLength: 2
          organization_number:
            type: string
            description: |
              National organization number valid in the country specified. Required
              if type is omitted or set to `company`.
          individual:
            $ref: '#/definitions/Individual'
          bank_accounts:
            type: array
            minItems: 1
            maxItems: 1
            description: |
              Bank account information about the seller. Currently
              the contract service only supports one bank_account per payout
              destination.
            items:
              $ref: '#/definitions/ApprovalsBankAccount'
          payout_interval_type:
            type: string
            description: |
              The interval of the payout. The interval can be `daily`, `weekly` or `monthly`.
            enum:
              - daily
              - weekly
              - monthly
          form_submitter:
            type: object
            description: |
              The user that will submit the form. If the email is set the user will be notified
              about the form via email.
            properties:
              email:
                type: string
                format: email
                description: |
                  The email of the user that will submit the form.
              name:
                type: string
                description: |
                  The name of the user that will submit the form.
              title:
                type: string
                description: |
                  The title of the user that will submit the form.
          settlement_report_configuration:
            type: object
            required:
              - emails
            properties:
              emails:
                type: array
                description: Emails that will receive settlement reports by email for this payout destination
                minItems: 1
                items:
                  type: string
                  format: email
          report_configuration:
            type: object
            description: Optional settings for automatically creating report configurations when the payout destination is created.
            required:
              - create_report_configuration
            properties:
              create_report_configuration:
                type: boolean
                description: |
                  If enabled a report configuration for this sellers transactions is added when the payout destination is created.
              email:
                type: string
                format: email
                description: |
                  Optional email used in report configuration.
              schedule:
                type: string
                description: |
                  Optional report configuration schedule, will match the payout interval if not otherwise specified.
                enum:
                  - daily
                  - weekly
                  - monthly
              reference:
                type: string
                description: |
                  Optional reference, will use `payout_destination_id` if not specified.
              content_types:
                type: array
                description: Optional content types for the report, default is both `application/pdf` and `text/csv`.
                items:
                  type: string
                  enum:
                    - application/pdf
                    - text/csv
  ApprovalStatus:
    type: string
    enum:
      - ACTIVE
      - DECLINED
      - UNDER_MANUAL_REVIEW
      - AUTOMATIC_REVIEW
      - WAITING_FOR_SIGNATURE
      - WAITING_FOR_DECLARATION
      - ERROR
      - ARCHIVED
      - WAITING_FOR_DETAILS
  ApprovalsPayoutDestinationResponse:
    type: object
    allOf:
      - $ref: '#/definitions/ApprovalsPayoutDestination'
      - properties:
          case_status:
            $ref: '#/definitions/ApprovalStatus'
          links:
            type: array
            items:
              type: object
              properties:
                href:
                  type: string
                  description: The URL of the link.
                  format: uri
                rel:
                  type: string
                  description: |
                    Specifies the type of link
                  enum:
                    - contract_url
                    - cdd_case_url
                    - dintero_cdd_case_url
                    - declaration_url
                    - signed_contract_file_url
  PaySessionBase:
    type: object
    required:
      - order
    properties:
      url:
        type: object
        properties:
          callback_url:
            $ref: '#/definitions/CallbackUrl'
      customer:
        $ref: '#/definitions/SessionCustomer'
      order:
        $ref: '#/definitions/SessionOrder'
      expires_at:
        type: string
        format: date-time
  PaySessionOptions:
    type: object
    allOf:
      - $ref: '#/definitions/PaySessionBase'
      - properties:
          configuration:
            allOf:
              - $ref: '#/definitions/AutoCaptureConfiguration'
              - type: object
                properties:
                  pre_authorization:
                    type: boolean
                    description: |
                      If `true` the transaction will be posted as an initial **pre-authorization**.

                      The initial pre-authorization reserves the order amount, can be adjusted,
                      and must be finalized through [POST /transactions/{id}/authorization](#tag/Transactions/operation/transaction_tid_extend_authorization_post)
                      before the final amount can be captured.

                      If `pre_authorization` is not specified it defaults to `false`.
  PayPayment:
    type: object
    discriminator: payment_product_type
    required:
      - payment_product_type
    properties:
      payment_product_type:
        type: string
        description: |
          The payment product type corresponding to this transaction
  SessionPayResult:
    type: object
    required:
      - success
    properties:
      session_id:
        type: string
      success:
        type: boolean
      actions:
        type: array
        items:
          type: object
          properties:
            source:
              type: string
              example: PAYEX
            code:
              type: string
              example: AUTHORIZED
            type:
              type: string
              example: success
  DiscountCodesOrderUpdate:
    type: object
    description: |
      Order updated with discount given by discount_code.
    required:
      - amount
    properties:
      discount_codes:
        type: array
        items:
          type: string
      amount:
        type: number
        example: 72200
        description: |
          The amount to authorize/capture including VAT and discounts.
          In smallest unit for the currency, e.g. cents
      items:
        type: array
        description: |
          Items with discount lines.

           - The list must include all items in the session order
           - **Required** if the session order has any items.
        items:
          allOf:
            - $ref: '#/definitions/OrderItem'
            - properties:
                discount_lines:
                  type: array
                  items:
                    $ref: '#/definitions/DiscountItem'
        example:
          - amount: 2000
            quantity: 2
            line_id: '1'
            description: Forsvinnignspølse
            vat: 20
            id: '10'
          - amount: 6600
            quantity: 2
            line_id: '2'
            description: Vissvossafår på neppebrød
            vat: 20
            id: '6'
            eligible_for_discount: true
            is_changed: true
            gross_amount: 10000
            discount_lines:
              - amount: 4400
                discount_type: external
                discount_id: ed960ace-eb16-4e2e-ae52-b27647ccae8d
                description: Vossafestpris
                line_id: 1
          - amount: 59700
            quantity: 3
            line_id: '3'
            description: Luftboller
            vat: 20
            id: '1'
  ShippingAddressCallbackSessionOrderUpdate:
    type: object
    description: |
      Updates to session order. If the amount is not equal to sum of items.amount and the shipping_option.amount from the request are not equal a correction item will be added to the items.
    required:
      - amount
    properties:
      amount:
        type: integer
        example: 29990
        description: |
          The amount to authorize/capture including VAT and discounts.
          In smallest unit for the currency, e.g. cents
      currency:
        type: string
        format: iso4217-code
        example: NOK
        description: The three-character ISO-4217 currency. https://en.wikipedia.org/wiki/ISO_4217
      vat_amount:
        type: integer
        example: 6000
        description: |
          The VAT of the `amount` parameter.
          Only used for display purposes.

          In smallest unit for the currency, e.g. cents
      items:
        type: array
        description: |
          Details about the order items.

          #### Instabank
          `required` if Instabank payment is configured in and partial_payment is false.
          All items must include a unique `line_id`, quantity and amount

          #### Collector Bank
          `required` if Collector Bank payment is configured in and partial_payment is false.
          All items must include a unique `line_id`, quantity and amount
        items:
          allOf:
            - $ref: '#/definitions/OrderItem'
            - $ref: '#/definitions/OrderDiscountItem'
      discount_codes:
        type: array
        items:
          type: string
          example: SUMMER20
  FundTransferCreateDataV2:
    type: object
    required:
      - fund_transfer_id
      - type
      - source_payout_destination_id
      - destination_payout_destination_id
      - amount
      - currency
      - reference
    properties:
      fund_transfer_id:
        type: string
        description: |
          A string id that uniquely identifies the fund transfer. The `id` is used
          for idempotent processing so you can safely retry the request with same
          id if you don't receive a response (for example, in case of a timeout)
      type:
        type: string
        enum:
          - payout-destination
      source_payout_destination_id:
        type: string
      destination_payout_destination_id:
        type: string
      amount:
        type: integer
        minimum: 1
        description: The amount of the fund transfer in the smallest unit of the currency
      currency:
        type: string
      reference:
        type: string
        maxLength: 60
        description: |
          A static reference that will be included on settlements made to the sellers
  FundTransferV2:
    description: |
      This object contains the result from initiating a transfer fund
    allOf:
      - $ref: '#/definitions/FundTransferCreateDataV2'
      - required:
          - account_id
          - created_at
          - created_by
        properties:
          account_id:
            type: string
          created_at:
            type: string
            format: date-time
            description: The date-time when the resource was created
            readOnly: true
          created_by:
            type: string
            description: User id of the user who created the resource
            readOnly: true
  PayoutDestinationBalanceV2:
    type: object
    description: |
      Seller balance for a currency
    allOf:
      - type: object
        required:
          - account_id
          - payout_destination_config_id
          - payout_destination_id
          - currency
          - amount
        properties:
          account_id:
            type: string
            readOnly: true
          payout_destination_config_id:
            type: string
            description: A string id that uniquely identifies the payout destination configuration id
            readOnly: true
          payout_destination_id:
            type: string
            maxLength: 40
            description: |
              The id of the seller as defined elsewhere in dintero.
          currency:
            type: string
            minLength: 3
            maxLength: 3
            pattern: ^[A-Z]{3}$
          amount:
            type: integer
            description: Amount in the smallest unit of the currency
  PayoutDestinationBalancesV2:
    type: array
    items:
      $ref: '#/definitions/PayoutDestinationBalanceV2'
  PaymentMatchReportDataV2:
    type: object
    properties:
      start_at:
        type: string
        description: Time of first payment event in this transfer
      end_at:
        type: string
        description: Time of last payment event in this transfer
      settled_at:
        type: string
        description: Settlement date
      created_at:
        type: string
        description: Time of creation of the transfer report
      provider:
        type: string
        description: Name of payment provider.
      provider_reference:
        type: string
        description: The provider's unique id of the settlement
      attachments:
        type: array
        items:
          type: object
          properties:
            id:
              type: string
              description: Unique id of the attachment
            key:
              type: string
              description: Attachment path
            content_type:
              type: string
              example: application/xml
            extension:
              type: string
            created_by:
              type: string
              description: |
                Where the attachment was created. Might be created by dintero,
                or might be created by the providers, e.g. payex, vipps, collector
              example: payex
      amounts:
        type: array
        items:
          type: object
          properties:
            amount:
              type: number
              description: |
                The amount paid out, unless payment_status is postponed.

                `amount = capture - refund - fee`
            capture:
              type: number
              description: |
                The amount captured on the orders in the settlement period.
            refund:
              type: number
              description: |
                The amount refunded on the orders in the settlement period.
            fee:
              type: number
              description: |
                The sum of fees on the orders in the settlement period.
            currency:
              type: string
              format: iso4217-code
              example: NOK
      payment_status:
        type: string
        description: |
          Status of the payment.
        enum:
          - payment-match
      store_id:
        type: string
        description: |
          The sales location this report is for. Will only be set if all
          transactions share the same store_id.
      payout_destination_id:
        type: string
        description: |
          The seller id this report is for. Will only be set if all
          transactions share the same payout_destination_id.
  PayoutDestinationTransferEntryV2:
    type: object
    description: |
      Seller transfer entry
    required:
      - ledger_entry_id
      - account_id
      - payout_destination_config_id
      - payout_destination_id
      - created_at
      - currency
      - amount
      - type
      - inbound_payment_provider
      - transfer_id
      - transfer_source_payout_destination_id
      - transfer_destination_payout_destination_id
      - transfer_reference
      - outbound_receiver_country
      - outbound_receiver_bank_account_type
      - outbound_receiver_bank_account_number
      - outbound_receiver_bank_account_bic
      - outbound_message
    properties:
      ledger_entry_id:
        type: string
        readOnly: true
        description: A string id that uniquely identifies the entry in the ledger
      account_id:
        type: string
        readOnly: true
        description: The Dintero account id
      payout_destination_config_id:
        type: string
        readOnly: true
        description: A string id that uniquely identifies the payout destination configuration id
      payout_destination_id:
        type: string
        readOnly: true
        maxLength: 40
        description: |
          The id of the seller as defined elsewhere in dintero.
      created_at:
        type: string
        format: date-time
        description: The date-time when the resource was created
        readOnly: true
      currency:
        type: string
        readOnly: true
        minLength: 3
        maxLength: 3
        pattern: ^[A-Z]{3}$
      amount:
        type: integer
        readOnly: true
        description: Amount in the smallest unit of the currency
      type:
        type: string
        readOnly: true
        enum:
          - inbound
          - transfer
          - outbound
        description: |
          The type of the transfer.
          - `inbound` is a transfer from a payment provider to the sellers account in Dintero
          - `transfer` is a transfer between two Dintero sellers
          - `outbound` is a transfer from the seller account in Dintero to the sellers bank account
      inbound_payment_provider:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The underlying payment provider for the inbound payment, eg. `collector`, `bambora`, `payex`.
          Only applicable for type `inbound`
      transfer_id:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The id of the transfer.
          Only applicable for type `transfer`
      transfer_source_payout_destination_id:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The id of the seller that money was transferred from as defined elsewhere in dintero.
          Only applicable for type `transfer`
      transfer_destination_payout_destination_id:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The id of the seller that money was transferred to as defined elsewhere in dintero.
          Only applicable for type `transfer`
      transfer_reference:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The reference of the transfer.
          Only applicable for type `transfer`
      outbound_receiver_country:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The country of the bank account that will receive the funds.
          Only applicable for type `outbound`
      outbound_receiver_bank_account_type:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The bank account number type that will receive the funds, eg. `iban` or `bban`.
          Only applicable for type `outbound`
      outbound_receiver_bank_account_number:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The bank account number that will receive the funds.
          Only applicable for type `outbound`
      outbound_receiver_bank_account_bic:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          The bic for the bank account will receive the funds.
          Only applicable for type `outbound` if the bank account type is `iban`
      outbound_message:
        type: string
        readOnly: true
        x-nullable: true
        description: |
          Text message attached to the bank transaction.
          Only applicable for type `outbound`
      payment_match_report_data:
        $ref: '#/definitions/PaymentMatchReportDataV2'
  PayoutDestinationTransfersV2:
    type: array
    items:
      $ref: '#/definitions/PayoutDestinationTransferEntryV2'
  Payment:
    type: object
    discriminator: payment_product_type
    required:
      - payment_product_type
    properties:
      payment_product_type:
        type: string
        description: |
          The payment product type corresponding to this transaction
  CollectorPaymentDetails:
    type: object
    discriminator: payment_product_type
    required:
      - payment_product_type
    properties:
      payment_product_type:
        type: string
        description: |
          The payment product type corresponding to this transaction
  CollectorDetails:
    required:
      - social_security_number
    properties:
      social_security_number:
        minLength: 10
        maxLength: 12
        type: string
        description: |
          The social security number of the customer. For Norway, the length is 11. For Sweden, it's either 10 or 12 digits.
  CollectorAddress:
    type: object
    required:
      - first_name
      - last_name
      - address_line
      - postal_code
      - postal_place
      - country
      - phone_number
      - email
    properties:
      first_name:
        type: string
        example: John
        maxLength: 50
      last_name:
        type: string
        example: Doe
        maxLength: 50
      address_line:
        type: string
        description: Gaustadalleen 21
        maxLength: 50
      address_line_2:
        type: string
        description: More details about address.
        maxLength: 50
      business_name:
        type: string
        description: Name of the company
        maxLength: 50
      co_address:
        type: string
        description: CO-Address if applicable.
        maxLength: 50
      postal_code:
        type: string
        description: The zip code / postal code of the address.
        example: '0349'
        maxLength: 50
      postal_place:
        type: string
        description: The name of the postal code
        example: Oslo
        maxLength: 50
      country:
        type: string
        format: iso3166-alpha2
        description: Country of the location
        example: 'NO'
      phone_number:
        type: string
        pattern: ^\+?\d{5,15}$
        description: |
          mobile number of a person / company, ITU/E.123 format with
          international prefix (+PPNNNNNNNNN...)
      email:
        type: string
        maxLength: 100
        description: |
          The email address of a person or an organisation
  PaymentOperation:
    type: object
    discriminator: rel
    required:
      - rel
    properties:
      content_type:
        type: string
        enum:
          - application/json
          - application/javascript
          - text/html
      method:
        type: string
        description: |
          The HTTP method to use when performing the operation
        enum:
          - GET
          - POST
      rel:
        type: string
  KlarnaAddress:
    type: object
    required:
      - first_name
      - last_name
      - address_line
      - postal_code
      - postal_place
      - country
      - phone_number
      - email
    properties:
      first_name:
        type: string
        example: John
        maxLength: 99
      last_name:
        type: string
        example: Doe
        maxLength: 99
      address_line:
        type: string
        example: Gaustadalleen 21
        description: Street address.
        maxLength: 99
      address_line_2:
        type: string
        description: More details about address.
        maxLength: 99
      business_name:
        type: string
        description: Name of the company
        maxLength: 99
      postal_code:
        type: string
        description: The zip code / postal code of the address.
        example: '0349'
        maxLength: 99
      postal_place:
        type: string
        description: The name of the postal code
        example: Oslo
        maxLength: 99
      country:
        type: string
        format: iso3166-alpha2
        description: Country of the location
        example: 'NO'
      phone_number:
        type: string
        pattern: ^\+?\d{5,15}$
        description: |
          mobile number of a person / company, ITU/E.123 format with
          international prefix (+PPNNNNNNNNN...)
      email:
        type: string
        maxLength: 99
        description: |
          The email address of a person or an organisation
  IssuerCountryCondition:
    type: array
    description: |
      List of country codes (ISO 3166-1 alpha-2) for which the merchant can add exemptions for.
      Add a wildcard (`*`) to a allow all countries. Leaving it empty will not allow skipping SCA.
    uniqueItems: true
    maxItems: 250
    items:
      type: string
      description: A valid ISO 3166-1 alpha-2 country code
      pattern: ^([A-Z]{2}|\*)$
    example:
      - 'NO'
      - SE
      - DK
  AmountLimit:
    type: object
    required:
      - limit
      - issuer_countries
      - enabled
    properties:
      limit:
        type: array
        description: |
          The maximum transaction amounts in the smallest currency unit (e.g., cents) for which SCA (Strong Customer Authentication) can be exempted.
        uniqueItems: true
        maxItems: 250
        items:
          type: object
          required:
            - amount
            - currency
          properties:
            amount:
              type: integer
              description: |
                The maximum transaction amount in the smallest currency unit (e.g., cents).
              example: 50000
            currency:
              type: string
              description: The ISO 4217 currency code for the limit.
              example: NOK
      issuer_countries:
        $ref: '#/definitions/IssuerCountryCondition'
      enabled:
        type: boolean
        description: |
          Whether or not the rule is applied.
parameters:
  FeatureToggles:
    name: Dintero-Feature-Toggles
    in: header
    type: array
    collectionFormat: csv
    default: []
    description: |
      Feature toggles that will change how the API works.

      These feature toggles are usually the preferred way to use the API, but they break the current API.

      - strict-session-amounts: `order.amount` must equal the sum of amounts in `order.items` + `order.shipping_option.amount` when creating sessions
    items:
      type: string
      enum:
        - strict-session-amounts
  DinteroSystemName:
    name: Dintero-System-Name
    in: header
    type: string
    description: |
      The name of the ecommerce solution

      Example: `woocommerce`
    maxLength: 120
  DinteroSystemVersion:
    name: Dintero-System-Version
    in: header
    type: string
    description: |
      The version number of the ecommerce solution

      Example: `5.4`
    maxLength: 120
  DinteroSystemPluginName:
    name: Dintero-System-Plugin-Name
    in: header
    type: string
    description: |
      The name of the ecommerce plugin

      Example: `Dintero.Checkout.WooCommerce`
    maxLength: 120
  DinteroSystemPluginVersion:
    name: Dintero-System-Plugin-Version
    in: header
    type: string
    description: |
      The version number of the ecommerce plugin

      Example: `2.3.4`
    maxLength: 120
  SessionId:
    name: session_id
    type: string
    format: checkout-id
    in: path
    description: The session ID
    required: true
  TransactionId:
    name: id
    type: string
    format: checkout-id
    in: path
    description: The ID of the transaction
    required: true
  Ids:
    name: id
    in: query
    description: |
      List of ids that should be included in the result. ?id=A&id=B&id=X
    type: array
    collectionFormat: multi
    items:
      type: string
      format: checkout-id
  Limit:
    name: limit
    in: query
    description: |
      A limit on the number of objects to be returned. Limit can range
      between 1 and 100 items, and the default is 10 items.
    type: integer
    minimum: 1
    maximum: 100
    default: 10
  StartingAfter:
    name: starting_after
    in: query
    format: checkout-id
    description: |
      cursor for use in pagination. starting_after is an object ID
      that defines your place in the list. For instance, if you make
      a list request and receive 100 objects, ending with `obj_foo`,
      your subsequent call can include `starting_after=obj_foo`
      in order to fetch the next page of the list.
    type: string
    required: false
  accountId:
    name: aid
    description: |
      An id that uniquely identifies the account.
    in: path
    required: true
    type: string
    format: ^[PT]{1}\d{8}$
    minLength: 9
    maxLength: 9
  limit1k:
    name: limit
    in: query
    description: |
      A limit on the number of objects to be returned. Limit can range
      between 1 and 1000 items, and the default is 100 items.
    type: integer
    minimum: 1
    maximum: 1000
    default: 100
  reportConfigId:
    name: id
    in: path
    type: string
    format: uuid
    required: true
    description: report config id
  limit:
    name: limit
    in: query
    description: |
      A limit on the number of objects to be returned. Limit can range
      between 1 and 100 items, and the default is 10 items.
    type: integer
    minimum: 1
    maximum: 100
    default: 10
  startingAfter:
    name: starting_after
    in: query
    description: |
      cursor for use in pagination. starting_after is an object ID
      that defines your place in the list. For instance, if you make
      a list request and receive 100 objects, end the result contains
        `paging_token=pt1`, your subsequent call can include
      `starting_after=pt1` in order to fetch the next page of the list.
    type: string
    required: false
  owner:
    name: oid
    description: |
      An id that uniquely identifies the account or owner (partner)
    in: path
    required: true
    type: string
    format: ^[PT]{1}(?=(?:.{3}|.{8})$)[0-9]*$
  payoutDestinationId:
    name: payout_destination_id
    description: Seller id
    in: path
    required: true
    type: string
  limitV2:
    name: limit
    in: query
    description: |
      A limit on the number of objects to be returned. Limit can range
      between 1 and 1000 items, and the default is 10 items.
    type: integer
    minimum: 1
    maximum: 1000
    default: 10
  page:
    name: page
    in: query
    description: The page (as defined by the next_page_token in the api response)
    type: string
    required: false
responses:
  SessionCreated:
    description: checkout session created
    schema:
      type: object
      properties:
        id:
          type: string
          description: The id of the checkout session
        url:
          type: string
          format: uri
          example: https://checkout.api.dintero.com/v1/view/9ea1610a357dc8189081c4cb955f26f612d91367
          description: |
            URL for the Checkout session
        publish:
          $ref: '#/definitions/PublishConfiguration'
        session:
          allOf:
            - $ref: '#/definitions/Id'
            - $ref: '#/definitions/Session'
            - $ref: '#/definitions/SessionRead'
            - $ref: '#/definitions/SessionCancelled'
  BadRequest:
    description: Bad / Invalid request
    schema:
      $ref: '#/definitions/Error'
  AccessForbidden:
    description: Access forbidden, invalid JWT token was used
    schema:
      $ref: '#/definitions/Error'
  Forbidden:
    description: Forbidden
    schema:
      $ref: '#/definitions/Error'
  ServerError:
    description: Unexpected Error
    schema:
      $ref: '#/definitions/Error'
  NotFound:
    description: Resource was not found
    schema:
      $ref: '#/definitions/Error'
  TransactionOperationAccepted:
    description: |
      Request accepted for processing.
    headers:
      event-request-id:
        type: string
        description: |
          The request_id of the event that was accepted for processing.
          The transaction will be updated with a new event with
          `correlation_request_id` set when the operation completes.
    schema:
      allOf:
        - $ref: '#/definitions/Transaction'
  Conflict:
    description: Conflict
    schema:
      $ref: '#/definitions/Error'
  ProcessorTemporarilyUnavailable:
    description: Processor temporarily unavailable
    schema:
      $ref: '#/definitions/Error'
  SettlementsList:
    description: Settlements List
    schema:
      $ref: '#/definitions/SettlementResponse'
  Unauthorized:
    description: Unauthorized
    schema:
      $ref: '#/definitions/Error'
  SettlementReportConfigList:
    description: Settlement report configurations list
    schema:
      $ref: '#/definitions/SettlementReportConfigResponse'
  SettlementReportConfig:
    description: Settlement report configuration
    schema:
      $ref: '#/definitions/SettlementReportConfigItem'
  ReportMetadata:
    description: Report Metadata
    schema:
      properties:
        reports:
          type: array
          items:
            $ref: '#/definitions/ReportMetadata'
        starting_after:
          $ref: '#/definitions/StartingAfter'
  TooManyRequests:
    description: Too Many Requests
    headers:
      Retry-After:
        type: integer
        description: |
          Indicates how long the user agent should wait
          in seconds before making a follow-up request.
    schema:
      $ref: '#/definitions/Error'
  ApprovalsPayoutDestinationList:
    description: List of ApprovalsPayoutDestinationResponse objects
    schema:
      type: object
      properties:
        payout_destinations:
          type: array
          items:
            $ref: '#/definitions/ApprovalsPayoutDestinationResponse'
  ApprovalsPayoutDestinationCreated:
    description: Created ApprovalsPayoutDestinationResponse
    schema:
      $ref: '#/definitions/ApprovalsPayoutDestinationResponse'
securityDefinitions:
  JWT:
    type: apiKey
    name: Authorization
    description: |
      Bearer authentication (also called token authentication) should be
      used when accessing the API.

      Use [Get Token](https://docs.dintero.com/api.html#operation/aid_auths_oauth_token_post)
      to get an access token for client credentials

      Authorization by using the **Bearer** schema
      The content of the header should look like the following:

          Authorization: Bearer {access_token}

      where the **access_token** is JSON Web Tokens (JWT).
    in: header
    x-example: Bearer <access_token>
  apikey:
    type: apiKey
    in: header
    description: |
      X-API-Key authentication for accessing regular endpoints. Use
      [Create api-key](#operation/admin_api_keys_post) to create a key.

      The content of the header should look like the following:

          x-api-key: {api_key}
    name: x-api-key
  adminKey:
    type: apiKey
    in: header
    description: |
      X-API-Key authentication for accessing admin endpoints. Use
      [Create api-key](#operation/admin_api_keys_post) to create a key.

      The content of the header should look like the following:

          x-api-key: {api_key}
    name: x-api-key
  clientAuth:
    type: basic
    description: |
      Authorization by using the **Basic** schema with client_id and
      client_secret as username/password
x-servers:
  - url: https://checkout.dintero.com/v1/
x-tagGroups:
  - name: Token
    tags:
      - authenticate
  - name: Checkout
    tags:
      - session
      - Transactions
      - payment
      - example-session-callbacks
  - name: Payout
    tags:
      - v2-fund-transfers
      - v2-config-payout-destinations
  - name: Sellers
    tags:
      - approvals
  - name: Settlements
    tags:
      - settlements
      - settlements.configuration
  - name: Reports
    tags:
      - reports
  - name: Branding
    tags:
      - Generate checkout image
