openapi: 3.0.0
info:
  title: QR API
  version: '1.0'
  description: >-
    The QR API enables you to generate Vipps and MobilePay QR codes and merchant
    redirects for a Vipps MobilePay payment.

    See the [QR API Guide](/docs/APIs/qr-api/qr-api-guide/) for more details.
  contact:
    name: Vipps MobilePay
    url: https://developer.vippsmobilepay.com/docs/contact/
servers:
  - url: https://api.vipps.no/qr
    description: >-
      Production environment (uses the production API keys, the official app and
      live data)
  - url: https://apitest.vipps.no/qr
    description: Test environment (uses the test API keys, the test app and test data)
paths:
  /v1:
    parameters: []
    post:
      summary: Create One Time Payment QR
      operationId: generateOtpQr
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OneTimePaymentQrResponse'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '415':
          $ref: '#/components/responses/415UnsupportedMediaType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OneTimePaymentQrRequest'
        description: ''
      description: >-
        Endpoint for generating a Vipps MobilePay QR for a merchant payment.
        Given a valid `vippsLandingPageUrl`, this endpoint will return a QR for
        that payment.
      parameters:
        - $ref: '#/components/parameters/Accept'
        - $ref: '#/components/parameters/Size'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
      tags:
        - One time payment QR
  /v1/merchant-redirect:
    post:
      summary: Create merchant redirect QR
      operationId: CreateMerchantRedirectQr
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantRedirectQrResponse'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '409':
          $ref: '#/components/responses/409Conflict'
        '415':
          $ref: '#/components/responses/415UnsupportedMediaType'
      description: Generate a QR that works as a redirect back to the merchant
      parameters:
        - $ref: '#/components/parameters/Accept'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
        - $ref: '#/components/parameters/Size'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantRedirectQrRequest'
        description: ''
      tags:
        - Merchant redirect QR
    parameters: []
    get:
      summary: Get all merchant redirect QRs
      operationId: GetAllMerchantRedirectQrs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantRedirectQrResponseGetAll'
        '401':
          description: Unauthorized
      description: Get all merchant redirect QRs for this saleunit
      tags:
        - Merchant redirect QR
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
        - $ref: '#/components/parameters/Accept'
        - $ref: '#/components/parameters/Size'
  /v1/merchant-redirect/{id}:
    put:
      summary: Update redirectUrl for merchant redirect QR
      operationId: UpdateMerchantRedirectUrl
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantRedirectQrResponse'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '404':
          $ref: '#/components/responses/404NotFound'
        '415':
          $ref: '#/components/responses/415UnsupportedMediaType'
      description: Update the redirect url (target destination) of the QR
      tags:
        - Merchant redirect QR
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantRedirectQrUpdateRequest'
      parameters:
        - $ref: '#/components/parameters/Accept'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
        - $ref: '#/components/parameters/Size'
    delete:
      summary: Delete merchant redirect QR
      operationId: DeleteMerchantRedirectQr
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
        '404':
          $ref: '#/components/responses/404NotFound'
      description: Delete merchant redirect QR
      tags:
        - Merchant redirect QR
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
        - $ref: '#/components/parameters/Size'
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: The unique ID for QR
    get:
      summary: Get merchant redirect QR by ID
      operationId: GetMerchantRedirectQrById
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantRedirectQrResponse'
        '401':
          description: Unauthorized
        '404':
          $ref: '#/components/responses/404NotFound'
      description: Get merchant redirect QR by ID
      tags:
        - Merchant redirect QR
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
        - $ref: '#/components/parameters/Accept'
        - $ref: '#/components/parameters/Size'
  /v1/merchant-callback:
    get:
      summary: Get all merchant callback QRs
      operationId: GetMerchantCallbackQrs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MerchantCallbackQr'
              examples:
                Example 1:
                  value:
                    - merchantSerialNumber: '12345'
                      merchantQrId: 27072f82-c4b6-49cd-9838-10f21d87496e
                      locationDescription: Kasse 1
                      qrImageUrl: https://qr.vipps.no/generate/qr.png?...
                      qrContent: https://qr.vipps.no/...
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '403':
          $ref: '#/components/responses/403Forbidden'
        '500':
          description: Internal Server Error
      description: Returns all QR codes that matches the provided Merchant-Serial-Number.
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number-Required'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
        - $ref: '#/components/parameters/QrImageFormat'
        - $ref: '#/components/parameters/QrImageSize'
      tags:
        - Merchant callback QR
    parameters: []
  /v1/merchant-callback/{merchantQrId}:
    get:
      summary: Get callback QR by ID
      operationId: GetMerchantCallbackById
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantCallbackQr'
              examples:
                Example 1:
                  value:
                    merchantSerialNumber: '12345'
                    merchantQrId: 27072f82-c4b6-49cd-9838-10f21d87496e
                    locationDescription: Kasse 1
                    qrImageUrl: https://qr.vipps.no/generate/qr.png?...
                    qrContent: https://qr.vipps.no/...
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      description: >-
        Returns the QR code represented by the merchantQrId and
        Merchant-Serial-Number provided in the path and header respectively. The
        image format and size of the QR code is defined by the Accept and Size
        headers respectively.
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number-Required'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
        - $ref: '#/components/parameters/QrImageFormat'
        - $ref: '#/components/parameters/QrImageSize'
      tags:
        - Merchant callback QR
    put:
      summary: Create or update callback QR
      operationId: PutMerchantCallbackQr
      description: >-
        Note: MobilePay integrators that needs to migrate existing QRs cannot
        use this endpoint. They must use the dedicated endpoint: [PUT
        /v1/merchant-callback/mobilepay/{beaconId}](https://developer.vippsmobilepay.com/api/qr/#tag/Merchant-callback-QR/operation/PutMerchantCallbackMobilePayQr)


        Creates or updates the QR code that encapsulates the provided
        `merchantSerialNumber` and `merchantQrId`.

        See [Webhooks API](/docs/APIs/webhooks-api) to create a webhook that
        will send callbacks when this QR code is scanned by a Vipps or MobilePay
        user.


        If the endpoint is called with the same `merchantQrId` twice or more, it
        is the last call that defines the location property.

        The actual QR code image will not be updated on consecutive calls.
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number-Required'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '403':
          $ref: '#/components/responses/403Forbidden'
        '500':
          description: Internal Server Error
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantCallbackPutRequest'
            examples:
              Example 1:
                value:
                  locationDescription: string
                  category: IN_STORE
        description: ''
      tags:
        - Merchant callback QR
    parameters:
      - schema:
          type: string
        name: merchantQrId
        in: path
        required: true
        description: The merchant defined identifier for a QR code.
    delete:
      summary: Delete callback QR
      operationId: DeleteMerchantCallbackQr
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '500':
          description: Internal Server Error
      description: >-
        Deletes the QR code that matches the provided merchantQrId and
        merchantSerialNumber.
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number-Required'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
      tags:
        - Merchant callback QR
  /v1/merchant-callback/mobilepay/{beaconId}:
    put:
      summary: Create or update MobilePay QR code
      operationId: PutMerchantCallbackMobilePayQr
      description: >-
        This endpoint is for creating existing MobilePay PoS QR codes.

        It is meant for merchants that have printed QR codes that they need to
        assign to a store.


        This endpoint will not create a new QR code but rather map the provided
        `beaconId` with the Merchant-Serial-Number,

        to make sure the already printed QR code can be re-used.

        When the QR code is scanned by MobilePay users, it will result in a
        callback being sent to the merchant

        if the merchant has registered a [webhook](/docs/APIs/webhooks-api)

        for the `user.checked-in.v1` event.


        The callback will include a `MerchantQrId` which in this scenario will
        equal the beaconId.
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number-Required'
        - $ref: '#/components/parameters/Vipps-System-Name'
        - $ref: '#/components/parameters/Vipps-System-Version'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Name'
        - $ref: '#/components/parameters/Vipps-System-Plugin-Version'
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '403':
          $ref: '#/components/responses/403Forbidden'
        '409':
          $ref: '#/components/responses/409Conflict'
        '500':
          description: Internal Server Error
      tags:
        - Merchant callback QR
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantCallbackMobilePayPutRequest'
            examples:
              Example 1:
                value:
                  locationDescription: cashier_1
                  category: IN_STORE
        description: ''
    parameters:
      - schema:
          type: string
        name: beaconId
        in: path
        required: true
        description: The MobilePay PoS BeaconId
  /v1/exchange:
    post:
      summary: Exchange user presented QR code for data
      operationId: exchangeQr
      tags:
        - QR Exchange
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrExchangeRequest'
            examples:
              Example 1:
                value:
                  qrCode: https://qr.vipps.no/p/qwjhewqhueheuqwhuqwhe
              Example 2:
                value:
                  qrCode: https://qr.vipps.no/p/qwjhewqhueheuqwhuqwhe
                  requestedData:
                    - MSISDN
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrExchangeResponse'
              examples:
                Version 2.0 example:
                  value:
                    msisdn: '4798765432'
                    timestamp: 1634025600
                    version: '2.0'
                Version 1.0 example:
                  value:
                    msisdn: '4798765432'
                    version: '1.0'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrExchangeErrorResponse'
              examples:
                Example 1:
                  value:
                    title: Bad request
                    status: 400
                    detail: The request body contains one or more invalid parameters.
                    extraDetails:
                      - name: qrCode
                        reason: >-
                          The complete data contained in the QR code is
                          required.
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
  /v1/exchange/customer:
    post:
      summary: >-
        Exchange customer for data, for example customerToken received on
        webhook.
      operationId: exchangeCustomer
      tags:
        - Customer Exchange
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Merchant-Serial-Number'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerExchangeRequest'
            examples:
              Simple example:
                value:
                  customer:
                    customerToken: eyJra
                  requestedData:
                    - MSISDN
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerExchangeResponse'
              examples:
                Example for requested data MSISDN:
                  value:
                    msisdn: '4798765432'
                    timestamp: 1634025600
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerExchangeErrorResponse'
              examples:
                Example missing customer object:
                  value:
                    title: Bad request
                    status: 400
                    detail: The request body contains one or more invalid parameters.
                    extraDetails:
                      - name: customer
                        reason: Customer object is required.
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
components:
  schemas:
    OneTimePaymentQrRequest:
      title: OneTimePaymentQrRequest
      type: object
      description: ''
      x-examples:
        example-1:
          url: >-
            https://api.vipps.no/dwo-api-application/v1/deeplink/vippsgateway?v=2&token=eyJraWQiO....
      properties:
        url:
          type: string
          description: Url to the Vipps landing page, obtained from ecom/recurring apis
          example: '   https://api.vipps.no/dwo-api-application/v1/deeplink/vippsgateway?v=2&token=eyJraWQiO....'
      required:
        - url
    OneTimePaymentQrResponse:
      title: OneTimePaymentQrResponse
      type: object
      x-examples: {}
      description: ''
      properties:
        url:
          type: string
          description: Link to QR image
          example: https://qr.vipps.no/generate/qr.png?...
        expiresIn:
          type: integer
          description: How many seconds more this QR will be active
          example: 544
      required:
        - url
        - expiresIn
    QrErrorResponse:
      title: QrErrorResponse
      type: object
      x-examples:
        example-1:
          title: Order timeout
          detail: Payment has already timed out
          instance: 3cff3564-4a14-4481-8dbb-431087753eed
        example-2:
          title: Validation error
          detail: Supplied landing page token is not valid
          instance: 3cff3564-4a14-4481-8dbb-431087753eed
        Validation error:
          type: https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1
          title: One or more validation errors occurred.
          detail: BadRequest
          instance: 00-616e415f5af7584eb4d9369d0fe8d7cc-48b90041faff204c-00
          invalidParams:
            - name: RedirectUrl
              reason: >-
                The field RedirectUrl must match the regular expression
                '^https://[\w\.]+([\w#!:.?+=&%@\-/]+)?$'.
      properties:
        type:
          type: string
          minLength: 1
        title:
          type: string
          minLength: 1
        detail:
          type: string
          minLength: 1
        instance:
          type: string
          minLength: 1
        invalidParams:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
              reason:
                type: string
                minLength: 1
            required:
              - name
              - reason
      required:
        - title
        - detail
        - instance
    MerchantRedirectQrRequest:
      title: MerchantRedirectQrRequest
      type: object
      x-examples: {}
      properties:
        id:
          type: string
          description: Merchant supplied Id for QR
          example: billboard_1
          pattern: ^[-_+%æøåÆØÅ\w\s]*$
          maxLength: 128
          minLength: 1
          nullable: true
        redirectUrl:
          type: string
          format: uri
          description: The target url of the QR (redirect destination)
          pattern: ^https:\/\/[\w\.]+([\w#!:.?+=&%@\-\/]+)?$
          example: https://example.com/myProduct
          nullable: true
        ttl:
          type: integer
          description: Optional time-to-live field, given in seconds
          example: 600
          minimum: 300
          maximum: 2147483647
          nullable: true
      required:
        - id
        - redirectUrl
    MerchantRedirectQrResponse:
      title: MerchantRedirectQrResponse
      type: object
      x-examples: {}
      properties:
        id:
          type: string
          description: Merchant supplied Id for QR
          example: billboard_1
          pattern: ^[-_+%æøåÆØÅ\w\s]*$
        url:
          type: string
          format: uri
          description: Link to QR image
          example: https://qr.vipps.no/generate/qr.png?...
        redirectUrl:
          type: string
          format: uri
          description: The target url of the QR (redirect destination)
          pattern: ^https:\/\/[\w\.]+([\w#!:.?+=&%@\-\/]+)?$
          example: https://example.com/myProduct
        expiresIn:
          type: integer
          description: >-
            Time in seconds until expiration. -1 means no expiration (infinite
            QR code)
          example: 598
      required:
        - id
        - url
        - redirectUrl
    MerchantRedirectQrResponseGetAll:
      title: MerchantRedirectQrResponseGetAll
      x-examples: {}
      type: array
      items:
        $ref: '#/components/schemas/MerchantRedirectQrResponse'
    MerchantRedirectQrUpdateRequest:
      title: MerchantRedirectQrUpdateRequest
      type: object
      description: Model for put-requests
      properties:
        redirectUrl:
          type: string
          format: uri
          pattern: ^https:\/\/[\w\.]+([\w#!:.?+=&%@\-\/]+)?$
          example: https://example.com/myProduct
      required:
        - redirectUrl
    MerchantCallbackPutRequest:
      title: MerchantCallbackPutRequest
      type: object
      x-examples:
        Example 1:
          locationDescription: cashier_1
          category: IN_STORE
      properties:
        locationDescription:
          type: string
          description: >-
            A description of where the QR code will be located. It will be shown
            in the app when a user scans the QR code. Examples could be ‘Kasse
            1’ , ‘Kiosk’ or ‘Platform 3’.
          maxLength: 36
        category:
          $ref: '#/components/schemas/CategoryEnum'
      required:
        - locationDescription
    MerchantCallbackMobilePayPutRequest:
      title: MerchantCallbackMobilePayPutRequest
      type: object
      x-examples:
        Example 1:
          locationDescription: Kasse 1
      properties:
        locationDescription:
          type: string
          description: >-
            A description of where the QR code will be located. This corresponds
            to the PoS name field from the old MobilePay V10 API. It will be
            shown in the app when a user scans the QR code. Examples could be
            ‘Kasse 1’ , ‘Kiosk’ or ‘Platform 3’.
          maxLength: 36
        category:
          $ref: '#/components/schemas/CategoryEnum'
      required:
        - locationDescription
    MerchantCallbackQr:
      title: MerchantCallbackQr
      type: object
      description: >-
        A representation of a QR code. It contains all the three properties that
        was provided when creating the QR code, in addition to a link pointing
        to the actual QR code itself.
      x-examples:
        Example 1:
          merchantSerialNumber: '12345'
          merchantQrId: 27072f82-c4b6-49cd-9838-10f21d87496e
          locationDescription: Kasse 1
          qrImageUrl: https://qr.vipps.no/generate/qr.png?...
          qrContent: https://qr.vipps.no/...
      properties:
        merchantSerialNumber:
          type: string
          description: The merchant serial number (MSN) for the sale unit
        merchantQrId:
          type: string
          description: >-
            The merchant defined identifier for a QR code. It will be provided
            in the callback to the merchant when the QR code has been scanned.
        locationDescription:
          type: string
          description: >-
            A description of where the QR code will be located. It will be shown
            in the app when a user scans the QR code. Examples could be ‘Kasse
            1’ , ‘Kiosk’ or ‘Platform 3’.
        qrImageUrl:
          type: string
          description: The link to the actual QR code.
          format: uri
          example: https://qr.vipps.no/generate/qr.png?...
        qrContent:
          type: string
          description: >-
            The text that is being encoded by the QR code. This is the actual
            content of the QR code.
        category:
          $ref: '#/components/schemas/CategoryEnum'
    QrExchangeRequest:
      type: object
      description: >-
        The request body for the QR exchange endpoint. This endpoint is used to
        exchange information about a QR code that has been scanned by a Vipps
        user.
      required:
        - qrCode
      properties:
        qrCode:
          type: string
          description: The complete content of the QR code.
        requestedData:
          type: array
          items:
            $ref: '#/components/schemas/RequestedData'
          default:
            - MSISDN
    QrExchangeResponse:
      type: object
      properties:
        msisdn:
          type: string
          description: The MSISDN of the user presenting the QR code.
        timestamp:
          type: integer
          description: >-
            The UTC timestamp in seconds when the QR code was generated. Only
            available for version 2.0 QR codes.
        version:
          type: string
          description: >-
            Version of the QR code format. There are two versions: 1.0 and 2.0.
            Version 1.0 is the old format, and version 2.0 is the new format.
      required:
        - msisdn
        - version
    CustomerExchangeRequest:
      type: object
      description: >-
        The request body for the QR exchange endpoint. This endpoint is used to
        exchange information about a QR code that has been scanned by a Vipps
        user.
      required:
        - customer
        - requestedData
      properties:
        customer:
          type: object
          properties:
            customerToken:
              type: string
          description: The customer identifier.
        requestedData:
          type: array
          items:
            $ref: '#/components/schemas/RequestedData'
          default:
            - MSISDN
    CustomerExchangeResponse:
      type: object
      properties:
        msisdn:
          type: string
          description: The MSISDN of the user presenting the QR code.
        timestamp:
          type: integer
          description: >-
            The UTC timestamp in seconds when the QR code was generated. Only
            available for version 2.0 QR codes.
      required:
        - msisdn
    RequestedData:
      type: string
      description: >-
        Which data fields the merchant wants to receive from the QR exchange.
        Currently only MSISDN is supported.
      enum:
        - MSISDN
    QrExchangeErrorResponse:
      type: object
      required:
        - title
        - status
        - detail
      properties:
        title:
          type: string
          description: A short, human-readable summary of the problem type.
        status:
          type: integer
          format: int32
          description: The HTTP status code associated with the error.
        detail:
          type: string
          description: A human-readable explanation of the specific problem.
        extraDetails:
          type: array
          items:
            type: object
            required:
              - name
              - reason
            properties:
              name:
                type: string
                description: The name of the invalid parameter.
              reason:
                type: string
                description: The reason why the parameter is invalid.
    CustomerExchangeErrorResponse:
      type: object
      required:
        - title
        - status
        - detail
      properties:
        title:
          type: string
          description: A short, human-readable summary of the problem type.
        status:
          type: integer
          format: int32
          description: The HTTP status code associated with the error.
        detail:
          type: string
          description: A human-readable explanation of the specific problem.
        extraDetails:
          type: array
          items:
            type: object
            required:
              - name
              - reason
            properties:
              name:
                type: string
                description: The name of the invalid parameter.
              reason:
                type: string
                description: The reason why the parameter is invalid.
      x-examples:
        example-1:
          title: Bad request
          status: 400
          detail: The request body contains one or more invalid parameters.
          extraDetails:
            - name: qrCode
              reason: The complete data contained in the QR code is required.
    CategoryEnum:
      title: CategoryEnum
      type: string
      enum:
        - IN_STORE
        - VENDING
      default: IN_STORE
      description: >-
        Category for the QR. Different categories will show different messages
        in the apps while the user is waiting for the payment/login to show.
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
  parameters:
    Merchant-Serial-Number:
      name: Merchant-Serial-Number
      in: header
      required: false
      schema:
        type: string
      description: >-
        The merchant serial number (MSN) for the sales unit. Partners and PSP
        merchants must always send the Merchant-Serial-Number header, and we
        recommend that everyone sends it, also when using the merchant's own API
        keys. The Merchant-Serial-Number header can be used with all API keys,
        and can speed up any trouble-shooting of API problems quite a bit.
    Merchant-Serial-Number-Required:
      name: Merchant-Serial-Number
      in: header
      required: true
      schema:
        type: string
      description: >-
        The merchant serial number (MSN) for the sales unit. See [API
        keys](/docs/knowledge-base/api-keys/).
    Ocp-Apim-Subscription-Key:
      name: Ocp-Apim-Subscription-Key
      in: header
      required: true
      schema:
        type: string
      description: >-
        The subscription key for a sales unit. See [API
        keys](/docs/knowledge-base/api-keys/).
    Authorization:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
      description: >-
        The access token is a base64-encoded string that is required for all API
        calls. It is a JWT (JSON Web Token). The access token is fetched from
        the
        [`POST:/accesstoken/get`](/api/access-token#tag/Authorization-Service/operation/fetchAuthorizationTokenUsingPost)
        endpoint. It is valid for 1 hour in the test environment and 24 hours in
        the production environment.
    Accept:
      name: Accept
      in: header
      required: true
      schema:
        type: string
        enum:
          - image/*
          - image/png
          - image/svg+xml
          - text/targetUrl
      description: >-
        Requested image format. Supported values: {image/*,image/png,
        image/svg+xml, text/targetUrl}
    QrImageFormat:
      name: QrImageFormat
      in: query
      required: false
      schema:
        type: string
        enum:
          - PNG
          - SVG
      description: >-
        Requested image format. Supported values: {PNG, SVG}. If not provided,
        SVG is chosen.
    QrImageSize:
      name: QrImageSize
      in: query
      required: false
      schema:
        type: integer
        minimum: 100
        maximum: 2000
      description: >-
        Eks: 200. Then 200x200 px is set at dimension for the QR. Only relevant
        if PNG is chosen as image format.
    Size:
      name: Size
      in: header
      required: false
      schema:
        type: integer
        minimum: 100
        maximum: 2000
      description: 'Eks: 200. Then 200x200 px is set at dimension for the QR'
    Vipps-System-Name:
      name: Vipps-System-Name
      in: header
      description: |-
        The name of the ecommerce solution.
        One word in lowercase letters is good.
        See [http-headers](/docs/knowledge-base/http-headers).
      schema:
        type: string
        maxLength: 30
        example: WooCommerce
    Vipps-System-Version:
      name: Vipps-System-Version
      in: header
      description: |-
        The version number of the ecommerce solution.
        See [http-headers](/docs/knowledge-base/http-headers).
      schema:
        type: string
        maxLength: 30
        example: 5.4.0
    Vipps-System-Plugin-Name:
      name: Vipps-System-Plugin-Name
      in: header
      description: |-
        The name of the ecommerce plugin (if applicable).
        One word in lowercase letters is good.
        See [http-headers](/docs/knowledge-base/http-headers).
      schema:
        type: string
        maxLength: 30
        example: woocommerce-payment
    Vipps-System-Plugin-Version:
      name: Vipps-System-Plugin-Version
      in: header
      description: |-
        The version number of the ecommerce plugin (if applicable).
        See [http-headers](/docs/knowledge-base/http-headers).
      schema:
        type: string
        maxLength: 30
        example: 1.2.1
  responses:
    415UnsupportedMediaType:
      description: Unsupported Media Type
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QrErrorResponse'
    400BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QrErrorResponse'
    403Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QrErrorResponse'
    409Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            properties:
              id:
                type: string
    404NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QrErrorResponse'
tags:
  - name: Merchant redirect QR
  - name: One time payment QR
  - name: Merchant callback QR
security:
  - BearerToken: []
