openapi: 3.0.1
info:
  title: Donations API
  description: The Donation API provides features that specifically support fundraising
  version: v1
servers:
  - url: https://api.vipps.no/
    description: ''
paths:
  /donations/v1/reports/payments:
    get:
      tags:
        - Reports
      summary: Get a list of payments marked as donations
      description: >-
        Returns a list of payments marked as donation made to any sales unit
        belonging to the merchant of the sales unit identified in the token.
      parameters:
        - name: fromDateTimeUtc
          in: query
          description: Timestamp where payments made after should be included in the report
          required: true
          schema:
            type: string
            format: date-time
        - name: toDateTimeUtc
          in: query
          description: >-
            Timestamp where payments made after should not be included in the
            report
          required: true
          schema:
            type: string
            format: date-time
        - name: includeGDPRSensitiveData
          in: query
          description: >-
            When `true` the response will include the message input by the user
            when making the payment
          schema:
            type: boolean
            default: false
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: APIM Subscription Key
          required: true
          schema:
            type: string
            example: da7d5b0e18a84aeda961c0c31b75c2a9
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentsReportResponseV1'
components:
  schemas:
    Payment:
      required:
        - recipientHandle
        - paymentDateTimeUtc
        - amount
        - currency
        - pspReference
        - payer
      type: object
      properties:
        recipientHandle:
          type: string
        paymentDateTimeUtc:
          type: string
          format: date-time
        amount:
          type: integer
          format: int64
        currency:
          type: string
        externalReference:
          type: string
          nullable: true
        agreementId:
          type: string
          format: uuid
          nullable: true
        pspReference:
          type: string
        message:
          type: string
          nullable: true
        payer:
          $ref: '#/components/schemas/Person'
    PaymentsReportResponseV1:
      required:
        - fromDateTimeUtc
        - toDateTimeUtc
        - payments
      type: object
      properties:
        fromDateTimeUtc:
          type: string
          format: date-time
        toDateTimeUtc:
          type: string
          format: date-time
        payments:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
    Person:
      required:
        - name
        - phoneNumber
      type: object
      properties:
        name:
          type: string
        phoneNumber:
          type: string
          nullable: true
      nullable: true
tags:
  - name: Reports
