openapi: 3.0.0
info:
  title: Check-in API
  version: 1.0.2
  description: >-
    The Check-in API enables you to communicate with users in a physical point
    of sale context. For details, see the [API Guide](/docs/APIs/check-in-api/).
  contact:
    name: Vipps MobilePay
    url: https://developer.vippsmobilepay.com/docs/contact/
servers:
  - url: https://api.vipps.no/point-of-sale
    description: Production environment
  - url: https://apitest.vipps.no/point-of-sale
    description: Merchant Test environment
paths:
  /v1/loyalty-check-in:
    parameters: []
    post:
      summary: Initiate a loyalty check in session for a Vipps user
      operationId: initiateLoyaltyCheckIn
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoyaltyCheckInResponse'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          description: Unauthorized
        '500':
          description: >-
            InternalServerError. If you try to use Check-in from the Merchant
            Test environment, it will fail with this error.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoyaltyCheckInRequest'
        description: ''
      description: Endpoint for triggering a Vipps loyalty check-in
      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'
      tags:
        - point-of-sale
components:
  schemas:
    LoyaltyCheckInRequest:
      title: LoyaltyCheckInRequest
      type: object
      description: Loyalty program check in request
      x-examples:
        Loyalty program check in request:
          phoneNumber: '4712345678'
          isMember: true
      properties:
        phoneNumber:
          type: string
          example: '4712345678'
          description: Phone number for the user in MSISDN format.
          pattern: ^47[0-9]{8}$
          nullable: true
        isMember:
          type: boolean
          description: Is the customer a member of the loyalty program?
          nullable: true
      required:
        - phoneNumber
        - isMember
    LoyaltyCheckInResponse:
      title: LoyaltyCheckInResponse
      type: string
      x-examples: {}
      description: ''
      properties:
        id:
          type: string
          example: '4712345678'
    ErrorResponse:
      type: object
      x-examples:
        example-1:
          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: phoneNumber
              reason: >-
                The field phoneNumber must be in MSDN format and 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
  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 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.
      example: '123456'
    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/).
      example: 0f14ebcab0ec4b29ae0cb90d91b4a84a
    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.
      example: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni (truncated)
    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:
    400BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
security:
  - BearerToken: []
tags:
  - name: point-of-sale
