openapi: 3.0.0
info:
  description: >-
    Recurring payments is used for subscription payments, such as weekly dues
    for newspaper access, monthly dues for public transportation, etc. For
    details, see the [Recurring API Guide](/docs/APIs/recurring-api).
  version: 2.6.19
  title: Recurring Payments Merchant API
servers:
  - url: https://api.vipps.no
    description: >-
      Production environment (uses the production API keys, the official app and
      live data)
  - url: https://apitest.vipps.no
    description: Test environment (uses the test API keys, the test app and test data)
tags:
  - name: Agreement v3 endpoints
  - name: Charge v3 endpoints
  - name: Agreement v2 endpoints (deprecated)
    description: Available until November 1, 2023
  - name: Charge v2 endpoints (deprecated)
    description: Available until November 1, 2023
paths:
  /recurring/v2/agreements:
    get:
      deprecated: true
      tags:
        - Agreement v2 endpoints (deprecated)
      summary: List Agreements
      description: >-
        The API endpoint allows merchant to fetch all agreements.

        If no query status is supplied, it will default to only retrieving
        active agreements.

        There is no way to list all agreements with all statuses; this is due to
        performance.

        **Please note:** Use the query parameters `status` and `createdAfter`
        specify the

        agreements you want to retrieve, in order to speed up the query. Try to
        avoid

        requests without query parameters. Set `createdAfter` to the most recent
        value as possible.

        For instance, if you fetch ACTIVE agreements every 24 hours, use
        `createdAfter=now-25h` or similar.

        Not that, in the future, it may be possible to encounter errors when the
        number of agreements in the response is too high

        (e.g., `413 Content Too Large` or similar).
      operationId: ListAgreements
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementStatusQuery'
        - $ref: '#/components/parameters/CreatedAfterQuery'
      responses:
        '200':
          description: OK'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgreementResponseV2'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
    post:
      deprecated: true
      tags:
        - Agreement v2 endpoints (deprecated)
      summary: Create a new Agreement, to be confirmed in the app
      description: >-
        The API endpoint allows merchants to create agreements for a user to
        accept. Once the agreement is drafted,you will receive a
        `vippsConfirmationUrl`.

        This is used to redirect the user to the landing page, or automatically
        app-switched to the app if `"isApp":true` is used.


        If the user accepts or rejects the agreement, the user will be
        redirected back to the URL specified in `merchantRedirectUrl`.

        You **have** to implement polling on the agreement to check when the
        status changes to active instead of relying on the redirect back to the
        `merchantRedirectUrl`.

        We have no control over if a user is actually redirected back or not,
        this depends on what browser the user came from.


        Please note the different use cases for `initialCharge` and `campaign`.
        And when to use `RESERVE_CAPTURE` instead of `DIRECT_CAPTURE` as
        `transactionType`.

        More information about this can be found in the API documentation.
      operationId: DraftAgreement
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DraftAgreementV2'
            examples:
              Minimal:
                value:
                  currency: NOK
                  interval: MONTH
                  intervalCount: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  customerPhoneNumber: '12345678'
                  price: 2500
                  productDescription: MyNews on web
                  productName: MyNews Digital
                  skipLandingPage: false
              With Initial Charge:
                description: >-
                  If you want the customer to pay to activate the agreement, you
                  should add an initial charge. If the amount on the initial
                  charge is not the same as the agreement/campaign price, it
                  will show up as a separate payment bubble in the app.
                value:
                  currency: NOK
                  interval: MONTH
                  intervalCount: 1
                  merchantRedirectUrl: https://merchant.redirect.url.no
                  merchantAgreementUrl: https://merchant.agreement.url.no
                  customerPhoneNumber: '12345678'
                  price: 2500
                  productDescription: MyNews on web
                  productName: MyNews Digital
                  skipLandingPage: false
                  initialCharge:
                    amount: 100
                    currency: NOK
                    description: Initial Charge
                    transactionType: DIRECT_CAPTURE
              With Price Campaign:
                description: >-
                  A price campaign allows you to communicate that the agreement
                  price is rebated until a given date, ie. "1kr per week until
                  04.05.2022, then 39 per week".
                value:
                  currency: NOK
                  interval: MONTH
                  intervalCount: 1
                  isApp: false
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  customerPhoneNumber: '12345678'
                  price: 2500
                  productDescription: MyNews on web
                  productName: MyNews Digital
                  skipLandingPage: false
                  campaign:
                    campaignPrice: 100
                    end: 2022/02/28T00:00:00Z
              With Price Campaign and Initial Charge:
                description: >-
                  A price campaign allows you to communicate that the agreement
                  price is rebated until a given date, ie. "1kr per week until
                  04.05.2022, then 39 per week".
                value:
                  currency: NOK
                  interval: MONTH
                  intervalCount: 1
                  isApp: false
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  customerPhoneNumber: '12345678'
                  price: 2500
                  productDescription: MyNews on web
                  productName: MyNews Digital
                  skipLandingPage: false
                  campaign:
                    campaignPrice: 100
                    end: 2022/02/28T00:00:00Z
                  initialCharge:
                    amount: 100
                    currency: NOK
                    description: Initial Charge
                    transactionType: DIRECT_CAPTURE
              With Variable Amount:
                description: >-
                  An agreement where the price can vary and the user choose a
                  max amount they can be charged each interval.
                value:
                  currency: NOK
                  interval: MONTH
                  intervalCount: 1
                  isApp: false
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  customerPhoneNumber: '12345678'
                  productDescription: Power on web
                  productName: MyNews Digital
                  skipLandingPage: false
                  variableAmount:
                    suggestedMaxAmount: 3000
              With Profile Flow:
                description: >-
                  User consents to sharing data that can be retrieved after they
                  accept the agreement.
                value:
                  currency: NOK
                  interval: MONTH
                  intervalCount: 1
                  isApp: false
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  customerPhoneNumber: '12345678'
                  price: 2500
                  productDescription: Power on web
                  productName: MyNews Digital
                  scope: address name email birthDate phoneNumber
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftAgreementResponseV2'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
  /recurring/v2/agreements/{agreementId}:
    get:
      deprecated: true
      tags:
        - Agreement v2 endpoints (deprecated)
      summary: Fetch an Agreement
      description: >-
        Fetch a single agreement for a user.

        Recommended to use when polling for status changes after sending an
        agreement to a user.
      operationId: FetchAgreement
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementResponseV2'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
    put:
      deprecated: true
      tags:
        - Agreement v2 endpoints (deprecated)
      summary: Update an Agreement
      description: >-
        Updates the agreement.

        Note that when updating the status to `STOPPED`,

        you can not re-activate it. If you want to pause an agreement,

        we suggest leaving the agreement active and skipping the creation of
        charges as long as the agreement is paused in your systems.
      operationId: UpdateAgreementPut
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      requestBody:
        description: agreement
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchAgreementV2'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementReference'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
    patch:
      deprecated: true
      tags:
        - Agreement v2 endpoints (deprecated)
      summary: Update an Agreement
      description: >-
        Updates the agreement.

        Note that when updating the status to `STOPPED`,

        you can not re-activate it. If you want to pause an agreement,

        we suggest leaving the agreement active and skipping the creation of
        charges as long as the agreement is paused in your systems.
      operationId: UpdateAgreementPatch
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      requestBody:
        description: agreement
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchAgreementV2'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementReference'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
  /recurring/v2/agreements/{agreementId}/accept:
    patch:
      deprecated: true
      tags:
        - Agreement v2 endpoints (deprecated)
      summary: Force accept an Agreement (Only available in test environment)
      description: |-
        Forces an agreement to be accepted by the given customer phone number.
        This endpoint can only be used in the test environment.
      operationId: acceptUsingPATCH
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForceAcceptAgreement'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/ErrorResponseV2'
  /recurring/v3/agreements:
    get:
      tags:
        - Agreement v3 endpoints
      summary: List Agreements
      description: >-
        The API endpoint allows merchant to fetch all agreements.

        If no query status is supplied it will default to only retrieving active
        agreements.

        There is no way to list all Agreements with all statuses, this is due to
        performance.

        It is recommended to use the `pageNumber` and `pageSize` query to
        paginate the response.
      operationId: ListAgreementsV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementStatusQuery'
        - $ref: '#/components/parameters/CreatedAfterQuery'
        - $ref: '#/components/parameters/PageNumberQuery'
        - $ref: '#/components/parameters/PageSizeQuery'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgreementResponseV3'
      deprecated: false
    post:
      tags:
        - Agreement v3 endpoints
      summary: Create a new Agreement, to be confirmed in the Vipps or MobilePay app
      description: >-
        The API endpoint allows merchants to create agreements for a user to
        accept. Once the agreement is drafted, you will receive a
        `vippsConfirmationUrl`.

        This is used to redirect the user to the Vipps MobilePay landing page,
        or to the Vipps or MobilePay app when `"isApp":true` is used.


        If the user accepts or rejects the agreement, the user will be
        redirected back to whichever URL has been passed in
        `merchantRedirectUrl`.

        You **must** implement polling on the agreement to check when the status
        changes to active, instead of relying on the redirect back to the
        `merchantRedirectUrl`.

        We have no control over if a user is actually redirected back or not,
        this depends on what browser the user came from.


        Please note the different use cases for `initialCharge` and `campaign`.
        And when to use `RESERVE_CAPTURE` instead of `DIRECT_CAPTURE` as
        transactionType.

        More information about this can be found in the API documentation.
      operationId: DraftAgreementV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DraftAgreementV3'
            examples:
              Minimal:
                description: Agreement with a set price and interval.
                value:
                  pricing:
                    type: LEGACY
                    amount: 2500
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
              With Initial Charge:
                description: >-
                  If you want the customer to pay to activate the agreement, you
                  should add an initial charge. If the amount on the initial
                  charge is not the same as the agreement/campaign price, it
                  will show up as a separate payment bubble in the app.
                value:
                  pricing:
                    type: LEGACY
                    amount: 2500
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
                  initialCharge:
                    amount: 100
                    currency: NOK
                    description: Initial Charge
                    transactionType: DIRECT_CAPTURE
              With Price Campaign:
                description: >-
                  A price campaign allows you to communicate that the agreement
                  price is rebated until a given date, ie. "1kr per week until
                  04.05.2022, then 39 per week".
                value:
                  pricing:
                    type: LEGACY
                    amount: 2500
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
                  campaign:
                    type: PRICE_CAMPAIGN
                    price: 100
                    end: 2022/02/28T00:00:00Z
              With Period Campaign:
                description: >-
                  A period campaign allows you to communicate a campaign where
                  the user pays a fixed price for a given period before the
                  normal agreement starts, ie. "4 weeks for 1 kr". Should be
                  combined with an initial charge to get money on activation.
                value:
                  pricing:
                    type: LEGACY
                    amount: 2500
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
                  campaign:
                    type: PERIOD_CAMPAIGN
                    price: 100
                    period:
                      unit: WEEK
                      count: 4
                  initialCharge:
                    amount: 100
                    currency: NOK
                    description: Activation Charge
                    transactionType: DIRECT_CAPTURE
              With Event Campaign:
                description: >-
                  A period campaign allows you to communicate a campaign where
                  the user pays a fixed price until a given event before the
                  normal agreement starts, ie. "Until Christmas for 1 kr".
                  Should be combined with an initial charge to get money on
                  activation.
                value:
                  pricing:
                    type: LEGACY
                    amount: 2500
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
                  campaign:
                    type: EVENT_CAMPAIGN
                    price: 100
                    eventDate: 2022/12/25T00:00:00Z
                    eventText: Until Christmas
                  initialCharge:
                    amount: 100
                    currency: NOK
                    description: Activation Charge
                    transactionType: DIRECT_CAPTURE
              With Variable Amount:
                description: >-
                  An agreement where the price can vary and the user choose a
                  max amount they can be charged each interval.
                value:
                  pricing:
                    type: VARIABLE
                    suggestedMaxAmount: 3000
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
              With Flexible pricing:
                description: (MobilePay only) An agreement where the price can vary.
                value:
                  pricing:
                    type: FLEXIBLE
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
              With Profile Flow:
                description: >-
                  User consents to sharing data that can be retrieved after they
                  accept the agreement.
                value:
                  pricing:
                    type: LEGACY
                    amount: 2500
                    currency: NOK
                  interval:
                    unit: MONTH
                    count: 1
                  merchantRedirectUrl: https://example.com/redirect
                  merchantAgreementUrl: https://example.com/agreement
                  phoneNumber: '4712345678'
                  productName: MyNews Digital
                  scope: address name email birthDate phoneNumber
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftAgreementResponseV3'
        '400':
          $ref: '#/components/responses/ErrorResponseV3'
        '403':
          $ref: '#/components/responses/ErrorResponseV3'
        '409':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
  /recurring/v3/agreements/{agreementId}:
    get:
      tags:
        - Agreement v3 endpoints
      summary: Fetch an Agreement
      description: >-
        Fetch a single agreement for a user.

        Recommended to use when polling for status changes after sending an
        agreement to a user.
      operationId: FetchAgreementV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgreementResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
    patch:
      tags:
        - Agreement v3 endpoints
      summary: Update an Agreement
      description: >-
        Updates the agreement.

        Note that when updating the status to `STOPPED`,

        you can not re-activate it. If you want to pause an agreement,

        we suggest leaving the agreement active and skipping the creation of
        charges as long as the agreement is paused in your systems.
      operationId: UpdateAgreementPatchV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      requestBody:
        description: agreement
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchAgreementV3'
      responses:
        '202':
          description: >-
            Accepted. Request accepted, the action will likely succeed but has
            not yet been enacted.
        '204':
          description: No content
        '400':
          $ref: '#/components/responses/ErrorResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
  /recurring/v3/agreements/{agreementId}/accept:
    patch:
      tags:
        - Agreement v3 endpoints
      summary: Force accept an Agreement (Only available in test environment)
      description: |-
        Forces an agreement to be accepted by the given customer phone number.
        This endpoint can only be used in the test environment.
      operationId: acceptUsingPATCHV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForceAcceptAgreementV3'
      responses:
        '204':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/ErrorResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
  /recurring/v2/agreements/{agreementId}/charges:
    get:
      deprecated: true
      tags:
        - Charge v2 endpoints (deprecated)
      summary: List Charges
      description: >-
        Fetches all charges for a single agreement, including the optional
        initial charge.

        Supports filtering on `status` using it as a query parameter.
      operationId: ListCharges
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeStatusQuery'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChargeResponseV2'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
    post:
      deprecated: true
      tags:
        - Charge v2 endpoints (deprecated)
      summary: Create a new charge
      description: >-
        Creates a new recurring charge *(payment)* that will charge the user on
        the date specified.

        If the payment fails, the charge will be retried based on `retryDays`.

        We recommend at least two days retry.
      operationId: CreateCharge
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChargeV2'
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeReference'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
  /recurring/v2/agreements/{agreementId}/charges/{chargeId}:
    get:
      deprecated: true
      tags:
        - Charge v2 endpoints (deprecated)
      summary: Fetch a Charge
      description: Fetch a single charge for a user.
      operationId: FetchCharge
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeResponseV2'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
    delete:
      deprecated: true
      tags:
        - Charge v2 endpoints (deprecated)
      summary: Cancel a Charge
      description: >-
        Cancels a pending, due, or reserved charge.

        When cancelling a charge that is `PARTIALLY_CAPTURED`, the remaining
        funds on the charge

        will be released back to the customer.


        Please note: If you cancel an agreement, all the charges for that
        agreement are automatically cancelled.
      operationId: CancelCharge
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeResponseV2'
        default:
          $ref: '#/components/responses/ErrorResponseV2'
  /recurring/v2/agreements/{agreementId}/charges/{chargeId}/capture:
    post:
      deprecated: true
      tags:
        - Charge v2 endpoints (deprecated)
      summary: Capture a reserved charge
      description: |-
        Captures a reserved charge.
        Only charges with transactionType `RESERVE_CAPTURE` can be captured.
      operationId: CaptureCharge
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/ErrorResponseV2'
  /recurring/v2/agreements/{agreementId}/charges/{chargeId}/refund:
    post:
      deprecated: true
      tags:
        - Charge v2 endpoints (deprecated)
      summary: Refund a charge
      description: >-
        Refunds a charge, and can also do a partial refund (refunding a smaller
        part of the payment).
      operationId: RefundCharge
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/ErrorResponseV2'
  /recurring/v3/agreements/{agreementId}/charges:
    get:
      tags:
        - Charge v3 endpoints
      summary: List Charges
      description: >-
        Fetches all charges for a single agreement, including the optional
        initial charge.

        Supports filtering on status using query parameter.
      operationId: ListChargesV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Continuation-Token'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeStatusQueryV3'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChargeResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
    post:
      tags:
        - Charge v3 endpoints
      summary: Create a new charge
      description: >-
        Creates a new recurring charge *(payment)* that will charge the user on
        the date specified.

        If the payment fails, the charge will be retried based on `retryDays`.
      operationId: CreateChargeV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChargeV3'
            examples:
              Recurring:
                value:
                  amount: 49900
                  transactionType: DIRECT_CAPTURE
                  description: October
                  due: '2018-10-01'
                  retryDays: 5
                  type: RECURRING
              Unscheduled:
                value:
                  amount: 49900
                  transactionType: DIRECT_CAPTURE
                  description: October
                  type: UNSCHEDULED
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeReference'
        '400':
          $ref: '#/components/responses/ErrorResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
        '409':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
  /recurring/v3/agreements/charges:
    post:
      tags:
        - Charge v3 endpoints
      summary: Create multiple charges
      description: >-
        Asynchronously creates multiple new recurring charges *(payments)* that
        will be automatically processed on the due date.

        If the payment fails, the charge will be retried based on `retryDays`.
        Maximum 2000 charges per request.
      operationId: CreateChargeAsyncV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateChargeAsyncV3'
      responses:
        '202':
          description: None, some or all charges passed API level validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncChargeResponse'
  /recurring/v3/agreements/{agreementId}/charges/{chargeId}:
    get:
      tags:
        - Charge v3 endpoints
      summary: Fetch a charge
      description: Fetch a single charge for a user.
      operationId: FetchChargeV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
    delete:
      tags:
        - Charge v3 endpoints
      summary: Cancel a charge
      description: >-
        Cancels a pending, due or reserved charge.

        When cancelling a charge that is `PARTIALLY_CAPTURED`, the remaining
        funds on the charge

        will be released back to the customer.


        Note if you cancel an agreement,

        there is no need to cancel the charges that belongs to the agreement.

        This will be done automatically.
      operationId: CancelChargeV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      responses:
        '202':
          description: >-
            Accepted. Request accepted, the action will likely succeed but has
            not yet been enacted.
        '204':
          description: No content
        '400':
          $ref: '#/components/responses/ErrorResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
        '409':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
  /recurring/v3/charges/{chargeId}:
    get:
      tags:
        - Charge v3 endpoints
      summary: Fetch a charge by ID
      description: >-
        A "special case" endpoint to fetch a single charge just by `chargeId`,
        when the `agreementId` is unknown.

        This is useful for investigating claims from customers, but not intended
        for automation.


        Please note: This is *not* a replacement for the normal endpoint for
        fetching charges:

        `GET:/recurring/v3/agreements/{agreementId}/charges/{chargeId}`.
      operationId: FetchChargeByIdV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/ChargeId'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
  /recurring/v3/agreements/{agreementId}/charges/{chargeId}/capture:
    post:
      tags:
        - Charge v3 endpoints
      summary: Capture a reserved charge
      description: |-
        Captures a reserved charge.
        Only charges with transactionType `RESERVE_CAPTURE` can be captured.
        Can also do partial captures (captures a smaller part of the payment).
      operationId: CaptureChargeV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaptureRequestV3'
      responses:
        '202':
          description: >-
            Accepted. Request accepted, the action will likely succeed but has
            not yet been enacted.
        '204':
          description: No content
        '400':
          $ref: '#/components/responses/ErrorResponseV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
        '409':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
  /recurring/v3/agreements/{agreementId}/charges/{chargeId}/refund:
    post:
      tags:
        - Charge v3 endpoints
      summary: Refund a charge
      description: >-
        Refunds a charge, can also do a partial refund (refunding a smaller part
        of the payment).
      operationId: RefundChargeV3
      parameters:
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
        - $ref: '#/components/parameters/Idempotency-Key'
        - $ref: '#/components/parameters/Content-Type'
        - $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/AgreementId'
        - $ref: '#/components/parameters/ChargeId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundRequest'
      responses:
        '204':
          description: No content
        '400':
          $ref: '#/components/schemas/ErrorV3'
        '404':
          $ref: '#/components/responses/ErrorResponseV3'
        '409':
          $ref: '#/components/responses/ErrorResponseV3'
      deprecated: false
components:
  parameters:
    AgreementId:
      name: agreementId
      in: path
      required: true
      description: The agreement identifier (ID)
      schema:
        type: string
      example: agr_5kSeqz
    ChargeId:
      name: chargeId
      in: path
      required: true
      description: The charge identifier (ID)
      schema:
        type: string
      example: chr-123ab
    Ocp-Apim-Subscription-Key:
      in: header
      name: Ocp-Apim-Subscription-Key
      description: >-
        The subscription key for your sales unit. See [API
        keys](/docs/knowledge-base/api-keys/). Keep it secret.
      required: true
      schema:
        type: string
      example: 0f14ebcab0ec4b29ae0cb90d91b4a84a
    Authorization:
      in: header
      name: Authorization
      description: >-
        The access token is a base64-encoded string that is required for all API
        requests. 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.
      required: true
      schema:
        type: string
    Idempotency-Key:
      in: header
      name: Idempotency-Key
      description: |-
        An Idempotency key must be provided to ensure idempotent requests.
        Key size can be between 1 to 40 characters.
        Key must not contain '#', '?', '/' or '\\'
      required: true
      schema:
        type: string
    Continuation-Token:
      in: header
      name: Continuation-Token
      description: >-
        When returned from an endpoint, this indicates that there is more data
        than can be returned in one response.

        Repeating the request with the received token in the Continuation-Token
        header will return the next page of data.

        When not returned, the end of the data has been reached.


        Continuation-Tokens are short-lived, so they cannot be used several
        minutes/hours after received.
      required: false
      schema:
        type: string
        format: uuid
    Merchant-Serial-Number:
      name: Merchant-Serial-Number
      in: header
      description: |-
        The Merchant Serial Number (MSN) is a unique ID for the sales unit
        for which this payment is made.
        This is a required parameter if you are a Recurring partner
        making payments on behalf of a merchant.
        The partner must use the merchant's MSN (not the partner's MSN).
        This parameter is optional, and recommended, for regular Vipps MobilePay
        merchants making payments for themselves.
      schema:
        type: string
      example: 123456
    AgreementStatusQuery:
      in: query
      name: status
      required: false
      description: Filter by the `status` of the agreement.
      schema:
        $ref: '#/components/schemas/AgreementStatus'
    CreatedAfterQuery:
      in: query
      name: createdAfter
      required: false
      description: Filter by createdAfter timestamp (in milliseconds) for paginating.
      schema:
        type: integer
        format: int64
      example: 1644572442944
    ChargeStatusQuery:
      in: query
      name: chargeStatus
      required: false
      description: Filter by status of the charge.
      schema:
        $ref: '#/components/schemas/ChargeStatus'
    ChargeStatusQueryV3:
      in: query
      name: status
      required: false
      description: Filter by status of the charge.
      schema:
        $ref: '#/components/schemas/ChargeStatus'
    PageNumberQuery:
      in: query
      name: pageNumber
      required: false
      description: >-
        Page number for paginating (should be used in combination with
        pageSize).
      schema:
        type: integer
        format: int32
        minimum: 1
      example: 1
    PageSizeQuery:
      in: query
      name: pageSize
      required: false
      description: Page size for paginating (must be used in combination with pageNumber).
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 2000
        default: 500
      example: 500
    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'
    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: vipps-woocommerce
    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
    Content-Type:
      in: header
      name: Content-Type
      description: The content type must be `application/json`
      schema:
        type: string
      example: application/json
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer 'auth token', from
        [`POST:/accesstoken/get`](/api/access-token#tag/Authorization-Service/operation/fetchAuthorizationTokenUsingPost)
        endpoint.
      bearerFormat: JWT
  schemas:
    AgreementStatus:
      type: string
      description: Status of the agreement.
      default: ACTIVE
      example: ACTIVE
      enum:
        - PENDING
        - ACTIVE
        - STOPPED
        - EXPIRED
    ChargeStatus:
      type: string
      example: PENDING
      enum:
        - PENDING
        - DUE
        - RESERVED
        - CHARGED
        - PARTIALLY_CAPTURED
        - FAILED
        - CANCELLED
        - PARTIALLY_REFUNDED
        - REFUNDED
        - PROCESSING
    ChargeSummary:
      type: object
      description: A summary of the amounts captured, refunded and cancelled
      required:
        - captured
        - refunded
        - cancelled
      properties:
        captured:
          type: integer
          format: int32
          example: 19900
          description: >-
            The total amount which has been captured/charged, in case of status
            charged/partial capture.

            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        refunded:
          type: integer
          format: int32
          example: 0
          description: >-
            The total amount which has been refunded, in case of status
            refund/partial refund.

            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        cancelled:
          type: integer
          format: int32
          example: 19900
          description: |-
            The total amount which has been cancelled.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
    ChargeHistory:
      type: array
      items:
        $ref: '#/components/schemas/ChargeEvent'
      description: List of events related to the charge.
    ChargeEvent:
      type: object
      description: Describes the operation that was performed on the charge
      required:
        - occurred
        - event
        - amount
        - idempotencyKey
        - success
      properties:
        occurred:
          type: string
          format: date-time
          description: >-
            Date and time of the event, as timestamp on the format
            `yyyy-MM-dd'T'HH:mm:ss'Z'`,

            with or without milliseconds.
          example: '2022-09-05T14:25:55Z'
        event:
          type: string
          enum:
            - CREATE
            - RESERVE
            - CAPTURE
            - REFUND
            - CANCEL
            - FAIL
          example: RESERVE
        amount:
          type: integer
          format: int32
          example: 19900
          description: |-
            The amount related to the operation.
            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        idempotencyKey:
          type: string
          description: The idempotency key of the event
        success:
          type: boolean
          description: True if the operation was successful, false otherwise
    Currency:
      type: string
      description: 'ISO-4217: https://www.iso.org/iso-4217-currency-codes.html'
      default: NOK
      enum:
        - NOK
      minLength: 3
      maxLength: 3
      pattern: ^[A-Z]{3}$
      example: NOK
    CurrencyV3:
      type: string
      description: Available types of currency are NOK, EUR and DKK
      enum:
        - NOK
        - EUR
        - DKK
      minLength: 3
      maxLength: 3
      pattern: ^[A-Z]{3}$
      example: NOK
    CountryCode:
      type: string
      example: 'NO'
      pattern: ^[A-Z]{2}$
      enum:
        - 'NO'
        - DK
        - FI
      description: >-
        Country code for the agreement according to ISO 3166-2 (two capital
        letters).

        Needs to be set based on the merchant's market/country. Cross border
        agreements are not supported, 

        e.g., Norwegian merchants can only create agreements for Norwegian
        customers and countryCode should be NO.
    transactionType:
      type: string
      description: Type of transaction, either direct capture or reserve capture
      enum:
        - DIRECT_CAPTURE
        - RESERVE_CAPTURE
      example: DIRECT_CAPTURE
    ChargeTypeV2:
      type: string
      default: RECURRING
      enum:
        - INITIAL
        - RECURRING
      example: RECURRING
    ChargeTypeV3:
      type: string
      default: RECURRING
      enum:
        - INITIAL
        - RECURRING
        - UNSCHEDULED
      example: RECURRING
    ChargeCreationTypeV3:
      type: string
      default: RECURRING
      enum:
        - RECURRING
        - UNSCHEDULED
      example: RECURRING
    Interval:
      type: string
      description: Interval for subscription
      default: MONTH
      pattern: ^(YEAR|MONTH|WEEK|DAY)$
      enum:
        - YEAR
        - MONTH
        - WEEK
        - DAY
      example: MONTH
    DraftAgreementV2:
      title: DraftAgreement
      type: object
      required:
        - currency
        - interval
        - intervalCount
        - merchantAgreementUrl
        - merchantRedirectUrl
        - price
        - productName
      properties:
        variableAmount:
          $ref: '#/components/schemas/variableAmountV2'
        campaign:
          $ref: '#/components/schemas/campaignV2'
        currency:
          $ref: '#/components/schemas/Currency'
        customerPhoneNumber:
          type: string
          description: >-
            Customers phone number (if available). Used to simplify the

            following Vipps MobilePay interaction.

            The format is MSISDN: Digits only: Country code and subscriber

            number, but no prefix.

            If the phone number is a Norwegian phone number `(+47) 91 23 45 67`,
            the MSISDN representation is `4712345678`.

            See: https://en.wikipedia.org/wiki/MSISDN
          minLength: 10
          maxLength: 15
          pattern: ^\d{10,15}$
          example: '4712345678'
        initialCharge:
          $ref: '#/components/schemas/InitialChargeV2'
        interval:
          $ref: '#/components/schemas/Interval'
        intervalCount:
          type: integer
          format: int32
          description: |-
            Number of intervals between charges. Example: interval=week,
            intervalCount=2 to be able to charge every two weeks.
            Charges should occur at least once a year.
          minimum: 1
          maximum: 31
          example: 2
        isApp:
          type: boolean
          description: >-
            This optional parameter indicates whether payment request is
            triggered from

            Mobile App or Web browser. Based on this value, response will be

            redirect URL for Vipps MobilePay landing page or deeplink URL to
            connect vipps

            App. When isApp is set to true, URLs passed to us will not be

            validated as regular URLs.

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/app-flow
          example: false
          default: false
        merchantAgreementUrl:
          type: string
          maxLength: 1024
          description: >-
            URL where you can send the customer to view/manage their

            subscription. Typically a "My page" where the user can change,
            pause, cancel, etc.

            The page must offer management tools, not just information about how
            to

            contact customer service, etc.

            We recommend letting users

            [log in](/docs/APIs/login-api),

            not with username and password.

            We do not have any specific requirements for the security of the
            page other than requiring HTTPS.

            Only HTTP or HTTPS scheme is allowed. 
          example: https://example.com/vipps-subscriptions/1234/
        merchantRedirectUrl:
          type: string
          maxLength: 1024
          description: |-
            URL where customer should be redirected after the agreement has been
            approved/rejected in the Vipps or MobilePay app. 
            HTTPS and deeplinks are allowed (example: myApp://home)
          example: https://example.com/landing
        price:
          type: integer
          format: int32
          example: 7900
          description: |-
            The price of the agreement.

            Amounts are specified in minor units.
            NOK: 1 kr = 100 øre.
        productName:
          type: string
          description: Product name (short)
          maxLength: 45
          example: Premier League subscription
        productDescription:
          type: string
          description: Product description (longer)
          maxLength: 100
          example: Access to all games of English top football
        scope:
          type: string
          description: >
            Space-separated list of the required user information (e.g., "name
            phoneNumber")

            for the agreement. See the

            [Userinfo user
            guide](/docs/APIs/userinfo-api/userinfo-api-guide#scope)

            for details.

            Possible values are:

            - name

            - address

            - email

            - phoneNumber

            - birthDate

            - nin
          example: name email birthDate phoneNumber
        skipLandingPage:
          type: boolean
          description: >-
            If the property is set to `true`, it will cause a push notification

            to be sent to the given phone number immediately, without loading

            the landing page.

            This feature has to be specially enabled for eligible sales

            units: The sales units must be whitelisted by Vipps MobilePay. If
            the sales unit is not whitelisted,

            the request will fail and an error message will be returned
            (statusCode=403).

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/landing-page
          default: false
          example: false
    DraftAgreementV3:
      title: DraftAgreement
      type: object
      required:
        - pricing
        - merchantRedirectUrl
        - productName
      properties:
        campaign:
          $ref: '#/components/schemas/campaignV3'
        pricing:
          $ref: '#/components/schemas/pricingRequest'
        phoneNumber:
          type: string
          nullable: true
          description: |-
            Customers phone number (if available). Used to simplify the
            following interaction. MSISDN: https://en.wikipedia.org/wiki/MSISDN
          maxLength: 15
          example: '4712345678'
        initialCharge:
          $ref: '#/components/schemas/InitialChargeV3'
        interval:
          $ref: '#/components/schemas/TimePeriod'
        isApp:
          type: boolean
          description: >-
            This optional parameter indicates whether payment request is
            triggered from

            Mobile App or Web browser. Based on this value, response will be

            redirect URL for Vipps MobilePay landing page or deeplink URL to
            connect vipps

            App. When isApp is set to true, URLs passed to us will not be

            validated as regular URLs.

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/app-flow
          example: false
          default: false
        merchantAgreementUrl:
          type: string
          maxLength: 1024
          description: >-
            URL where we can send the customer to view/manage their

            subscription. Typically a "My page" where the user can change,
            pause, cancel, etc.

            The page must offer actual management, not just information about
            how to

            contact customer service, etc.

            We recommend letting users

            [log in](/docs/APIs/login-api),

            not with username and password.

            We do not have any specific requirements for the security of the
            page other than requiring HTTPS.

            Only HTTPS scheme is allowed. 

            This URL is required for Norwegian Merchants.
          example: https://example.com/vipps-subscriptions/1234/
        merchantRedirectUrl:
          type: string
          maxLength: 2048
          description: |-
            URL where customer should be redirected after the agreement has been
            approved/rejected in the Vipps mobile application.
            HTTPS and deeplinks are allowed (example: myApp://home)
          example: https://example.com/redirect
        productName:
          type: string
          description: Product name (short)
          maxLength: 45
          example: Premier League subscription
        productDescription:
          type: string
          description: Product description (longer)
          maxLength: 100
        scope:
          type: string
          description: >
            Space-separated list of the required user information (e.g., "name
            phoneNumber")

            for the agreement. See the

            [Userinfo user
            guide](/docs/APIs/userinfo-api/userinfo-api-guide#scope)

            for details.

            Possible values are:

            - name

            - address

            - email

            - phoneNumber

            - birthDate

            - nin
          example: address name email birthDate phoneNumber
        skipLandingPage:
          type: boolean
          description: >-
            If the property is set to `true`, it will cause a push notification

            to be sent to the given phone number immediately, without loading

            the landing page.

            This feature has to be specially enabled for eligible sales

            units: The sales units must be whitelisted by Vipps MobilePay. If
            the sales unit is not whitelisted,

            the request will fail and an error message will be returned
            (statusCode=403).

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/landing-page
          default: false
          example: false
        externalId:
          type: string
          nullable: true
          description: >-
            An optional external ID for the agreement.

            The `externalId` can be used by the merchant to map the
            `agreementId`

            to an ID in a subscription system or similar.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
        countryCode:
          $ref: '#/components/schemas/CountryCode'
    DraftAgreementResponseV2:
      title: DraftAgreementResponse
      type: object
      required:
        - agreementId
        - agreementResource
        - vippsConfirmationUrl
        - chargeId
      properties:
        agreementResource:
          type: string
          description: >-
            Reference of a an agreement which user may agree to.

            Initially the agreement is in a pending state waiting for user
            approval.

            It enters active state once the user has approved it in the Vipps or
            MobilePay app.
          example: https://api.vipps.no/v2/agreement/agr_5kSeqz
        agreementId:
          type: string
          description: >-
            Id of a an agreement which user may agree to.

            Initially the agreement is in a pending state waiting for user
            approval.

            It enters active state once the user has approved it in the Vipps or
            MobilePay app.
          example: agr_5kSeqz
        vippsConfirmationUrl:
          type: string
          description: >-
            The `vippsConfirmationUrl` should be used to redirect the

            user to the Vipps MobilePay landing page in a desktop flow (with
            `https://`),

            or to the Vipps or MobilePay app in a mobile flow (with `vipps://`),
            where the

            user can then approve the agreement.
          example: https://api.vipps.no/v2/register/U6JUjQXq8HQmmV
        chargeId:
          type: string
          description: >-
            The Id of the initialCharge if given, otherwise `null`.

            If an `orderId` is specified this is used as the `chargeId`
            otherwise it is auto generated.
          example: chr_5kSeqz
          pattern: ^[a-zA-Z0-9-]{1,50}$
    DraftAgreementResponseV3:
      title: DraftAgreementResponse
      type: object
      required:
        - agreementId
        - uuid
      properties:
        agreementId:
          type: string
          description: >-
            Id of a an agreement which user may agree to.

            Initially the agreement is in a pending state waiting for user
            approval.

            It enters active state once the user has approved it in the Vipps or
            MobilePay app.
          example: agr_5kSeqz
        uuid:
          type: string
          format: uuid
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: UUID (RFC 4122) representation of agreementId
          example: 9c2ca95c-245f-4a2e-aab2-4a08eb78e6fb
        vippsConfirmationUrl:
          type: string
          description: >-
            The `vippsConfirmationUrl` should be used to redirect the

            user to the Vipps MobilePay landing page in a desktop flow (with
            `https://`),

            or to the Vipps or MobilePay app in a mobile flow (with `vipps://`),
            where the

            user can then approve the agreement.
          example: https://api.vipps.no/v2/register/U6JUjQXq8HQmmV
        chargeId:
          type: string
          nullable: true
          description: >-
            The Id of the initialCharge if given, otherwise `null`.

            If an `orderId` is specified this is used as the `chargeId`
            otherwise it is auto generated.
          example: chr_5kSeqz
          pattern: ^[a-zA-Z0-9-]{1,50}$
    AgreementResponseV2:
      title: Agreement response
      type: object
      required:
        - id
        - interval
        - intervalCount
        - price
        - productName
        - productDescription
      properties:
        campaign:
          $ref: '#/components/schemas/campaignV2'
        currency:
          $ref: '#/components/schemas/Currency'
        id:
          type: string
          example: agr_DdLnJAF
          maxLength: 36
          description: Uniquely identifies this agreement
        interval:
          $ref: '#/components/schemas/Interval'
        intervalCount:
          type: integer
          format: int32
          description: >-
            Number of intervals between charges. Example: interval=WEEK,
            intervalCount=2 to be able to charge every two weeks. Charges should
            occur at least once a year.
          minimum: 1
          maximum: 31
          example: 2
        price:
          type: integer
          format: int32
          example: 49900
          description: |-
            The price of the agreement.

            Amounts are specified in minor units.
            NOK: 1 kr = 100 øre.
          minimum: 0
        productName:
          type: string
          description: Product name (short)
          maxLength: 45
          example: Premier League subscription
        productDescription:
          type: string
          description: Product description (longer)
          maxLength: 100
          example: Access to all games of English top football
        start:
          type: string
          format: date-time
          description: |-
            Date and time when agreement was started, in ISO 8601 format.
            This is when the agreement was activated.
          example: '2019-01-01T00:00:00Z'
          nullable: true
        stop:
          type: string
          format: date-time
          description: Date and time when agreement was stopped, in ISO 8601 format.
          nullable: true
          example: null
        status:
          $ref: '#/components/schemas/AgreementStatus'
        merchantAgreementUrl:
          type: string
          description: >-
            URL where we can send the customer to view/manage their

            subscription. Typically a "My page" where the user can change,
            pause, cancel, etc.

            The page must offer actual management, not just information about
            how to

            contact customer service, etc.

            We recommend letting users log in with Vipps MobilePay, not with
            username and password:

            https://developer.vippsmobilepay.com/docs/APIs/login-api

            We do not have any specific requirements for the security of the

            page other than requiring HTTPS.
          example: https://example.com/vipps-subscriptions/1234/
        sub:
          type: string
          example: 8d7de74e-0243-11eb-adc1-0242ac120002
          description: >-
            User identifier (subject). Will be null if profile data was not
            requested.
          nullable: true
        userinfoUrl:
          type: string
          example: >-
            https://api.vipps.no/vipps-userinfo-api/userinfo/8d7de74e-0243-11eb-adc1-0242ac120002
          description: >-
            The full path of the URL for the userinfo endpoint where the user
            data can be retrieved:

            [`GET:/vipps-userinfo-api/userinfo/{sub}`](/api/userinfo#operation/getUserinfo).

            This will be null if profile data was not requested.
          nullable: true
        variableAmount:
          $ref: '#/components/schemas/variableAmountResponseV2'
    AgreementResponseV3:
      title: Agreement response
      type: object
      required:
        - id
        - interval
        - pricing
        - productName
        - uuid
        - countryCode
        - created
        - merchantAgreementUrl
        - merchantRedirectUrl
      properties:
        campaign:
          $ref: '#/components/schemas/campaignResponseV3'
          nullable: true
        pricing:
          $ref: '#/components/schemas/pricingResponse'
        id:
          type: string
          example: agr_DdLnJAF
          maxLength: 36
          description: Uniquely identifies this agreement
        interval:
          $ref: '#/components/schemas/TimePeriodResponse'
        productName:
          type: string
          description: Product name (short)
          maxLength: 45
          example: Premier League subscription
        productDescription:
          type: string
          description: Product description (longer)
          maxLength: 100
        created:
          type: string
          format: date-time
          description: |-
            Date when agreement was created, in ISO 8601 format.
            This is when the agreement was initiated with the API.
          example: '2019-01-01T00:00:00Z'
        start:
          type: string
          format: date-time
          description: |-
            Date and time when agreement was started, in ISO 8601 format.
            This is when the agreement was activated.
          example: '2019-01-01T00:00:00Z'
          nullable: true
        stop:
          type: string
          format: date-time
          description: Date and time when agreement was stopped, in ISO 8601 format.
          nullable: true
          example: null
        status:
          $ref: '#/components/schemas/AgreementStatus'
        merchantAgreementUrl:
          type: string
          description: >-
            URL where we can send the customer to view/manage their

            subscription. Typically a "My page" where the user can change,
            pause, cancel, etc.

            The page must offer actual management, not just information about
            how to

            contact customer service, etc.

            We recommend letting users log in with Vipps MobilePay, not with
            username and password:

            https://developer.vippsmobilepay.com/docs/APIs/login-api

            We do not have any specific requirements for the security of the

            page other than requiring HTTPS.
          example: https://example.com/vipps-subscriptions/1234/
        merchantRedirectUrl:
          type: string
          maxLength: 1024
          description: |-
            URL where customer should be redirected after the agreement has been
            approved/rejected in the Vipps or MobilePay app. 
            HTTPS and deeplinks are allowed (example: myApp://home)
          example: https://example.com/landing
        sub:
          type: string
          example: 8d7de74e-0243-11eb-adc1-0242ac120002
          description: >-
            User identifier (subject). Will be null if profile data was not
            requested.
          nullable: true
        userinfoUrl:
          type: string
          example: >-
            https://api.vipps.no/vipps-userinfo-api/userinfo/8d7de74e-0243-11eb-adc1-0242ac120002
          description: >-
            The full path of the URL for the userinfo endpoint where the user
            data can be retrieved.:

            [`GET:/vipps-userinfo-api/userinfo/{sub}`](/api/userinfo#operation/getUserinfo).

            This will be null if profile data was not requested.
          nullable: true
        externalId:
          type: string
          description: >-
            An optional external ID for the agreement.

            The `externalId` can be used by the merchant to map the
            `agreementId`

            to an ID in a subscription system or similar.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
        countryCode:
          $ref: '#/components/schemas/CountryCode'
        uuid:
          type: string
          format: uuid
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: UUID (RFC 4122) representation of ID
          example: 9c2ca95c-245f-4a2e-aab2-4a08eb78e6fb
        vippsConfirmationUrl:
          type: string
          description: >-
            The `vippsConfirmationUrl` should be used to redirect the

            user to the Vipps MobilePay landing page in a desktop flow (with
            `https://`),

            or to the Vipps or MobilePay app in a mobile flow (with `vipps://`),
            where the

            user can then approve the agreement.
          example: https://api.vipps.no/v2/register/U6JUjQXq8HQmmV
    PatchAgreementV2:
      title: PatchAgreement
      type: object
      properties:
        suggestedMaxAmount:
          type: integer
          format: int32
          example: 3000
          minimum: 100
          maximum: 2000000
          description: |-
            The suggested max amount that the customer should choose.

            Amounts are specified in minor units.
            NOK: 1 kr = 100 øre.
        campaign:
          $ref: '#/components/schemas/campaignV2'
        price:
          type: integer
          format: int32
          example: 7900
          minimum: 0
          description: |-
            The price of the agreement.

            Price is specified in minor units.
            NOK: 1 kr = 100 øre.
        productName:
          type: string
          description: Product name (short)
          maxLength: 45
          example: Premier League subscription
        productDescription:
          type: string
          description: Product description (longer)
          maxLength: 100
          example: Access to all games of English top football
        merchantAgreementUrl:
          type: string
          maxLength: 1024
          description: >-
            URL where we can send the customer to view/manage their

            subscription. Typically a "My page" where the user can change,
            pause, cancel, etc.

            The page must offer actual management, not just information about
            how to

            contact customer service, etc.

            We recommend letting users log in with Vipps MobilePay, not with
            username and password:

            https://developer.vippsmobilepay.com/docs/APIs/login-api

            We do not have any specific requirements for the security of the

            page other than requiring HTTPS.
          example: https://example.com/vipps-subscriptions/1234/
        status:
          type: string
          example: STOPPED
          description: Status of the agreement.
          enum:
            - STOPPED
    PatchAgreementV3:
      title: PatchAgreement
      type: object
      properties:
        productName:
          type: string
          example: Pluss-abonnement
          description: Name of the product being subscribed to.
          maxLength: 45
        productDescription:
          type: string
          description: Product description (longer)
          maxLength: 100
        merchantAgreementUrl:
          type: string
          maxLength: 1024
          description: >-
            URL where we can send the customer to view/manage their

            subscription. Typically a "My page" where the user can change,
            pause, cancel, etc.

            The page must offer actual management, not just information about
            how to

            contact customer service, etc.

            We recommend letting users log in with Vipps MobilePay, not with
            username and password:

            https://developer.vippsmobilepay.com/docs/APIs/login-api

            We do not have any specific requirements for the security of the

            page other than requiring HTTPS.
          example: https://example.com/vipps-subscriptions/1234/
        externalId:
          type: string
          description: >-
            An optional external ID for the agreement.

            The `externalId` can be used by the merchant to map the
            `agreementId`

            to an ID in a subscription system or similar.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
        status:
          type: string
          example: STOPPED
          description: Status of the agreement.
          enum:
            - STOPPED
        pricing:
          $ref: '#/components/schemas/PricingUpdateRequest'
        interval:
          type: object
          description: >-
            The interval of the agreement.


            The interval is specified by the `type` and `period` properties.

            When the type is `RECURRING`, then the property `period` is
            required.

            When the type is `FLEXIBLE`, then the property `period` is not
            allowed.
          properties:
            type:
              type: string
              default: RECURRING
              enum:
                - RECURRING
                - FLEXIBLE
              example: RECURRING
            period:
              $ref: '#/components/schemas/TimePeriod'
    AgreementReference:
      type: object
      title: Agreement reference
      required:
        - agreementId
      properties:
        agreementId:
          type: string
          example: agr_asdf123
          description: >-
            Id of a an agreement which user may agree to.

            Initially the agreement is in a pending state waiting for user
            approval.

            It enters active state once the user has approved it in the Vipps or
            MobilePay app.
    variableAmountV2:
      title: Variable Amount request V2
      type: object
      required:
        - suggestedMaxAmount
      properties:
        suggestedMaxAmount:
          type: integer
          format: int32
          example: 3000
          minimum: 100
          maximum: 2000000
          description: |-
            The suggested max amount that the customer should choose.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
    variableAmountResponseV2:
      title: Variable Amount response V2
      type: object
      properties:
        suggestedMaxAmount:
          type: integer
          format: int32
          example: 3000
          description: |-
            The suggested max amount that the customer should choose.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        maxAmount:
          type: integer
          format: int32
          example: 3000
          description: |-
            The max amount chosen by the customer.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
    campaignV2:
      title: Campaign request
      type: object
      nullable: true
      required:
        - campaignPrice
        - end
      properties:
        campaignPrice:
          type: integer
          format: int32
          example: 1500
          description: |-
            The price of the agreement in the discount period.
            The lowering of the price will be displayed in-app.
            Price is specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        end:
          type: string
          format: date-time
          example: '2022-12-31T00:00:00Z'
          description: The date and time the campaign ends.
    campaignResponseV2:
      title: Campaign response
      type: object
      properties:
        campaignPrice:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.

            Price is specified in minor units.

            NOK: 1 kr = 100 øre.
        start:
          type: string
          format: date-time
          example: '2022-12-31T00:00:00Z'
          description: The date and time the campaign starts. Must be UTC.
        end:
          type: string
          format: date-time
          example: '2022-12-31T00:00:00Z'
          description: |-
            The date and time the campaign ends.
            This is a required field when using `EVENT_CAMPAIGN`.
            Must be UTC.
    campaignV3:
      oneOf:
        - $ref: '#/components/schemas/priceCampaignV3'
        - $ref: '#/components/schemas/periodCampaignV3'
        - $ref: '#/components/schemas/eventCampaignV3'
    priceCampaignV3:
      title: Price campaign
      type: object
      nullable: true
      required:
        - type
        - price
        - end
      properties:
        type:
          type: string
          description: The type of campaign. This decides which properties are required
          enum:
            - PRICE_CAMPAIGN
        price:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.


            Price is specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        end:
          type: string
          example: '2019-06-01T00:00:00Z'
          description: |-
            The date and time the campaign ends.
            Needs to be UTC.
    periodCampaignV3:
      title: Period campaign
      type: object
      nullable: true
      required:
        - type
        - price
        - period
      properties:
        type:
          type: string
          description: The type of campaign. This decides which properties are required
          enum:
            - PERIOD_CAMPAIGN
        price:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.


            Price is specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        period:
          $ref: '#/components/schemas/TimePeriod'
    eventCampaignV3:
      title: Event campaign
      type: object
      nullable: true
      required:
        - type
        - price
        - eventText
        - eventDate
      properties:
        type:
          type: string
          description: The type of campaign. This decides which properties are required
          enum:
            - EVENT_CAMPAIGN
        price:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.


            Price is specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        eventDate:
          type: string
          format: date-time
          example: '2022-12-31T00:00:00Z'
          description: The date and time the campaign ends. Must be UTC.
        eventText:
          type: string
          example: Until Christmas
          description: A short text that describes the event
    campaignResponseV3:
      oneOf:
        - $ref: '#/components/schemas/priceCampaignResponseV3'
        - $ref: '#/components/schemas/periodCampaignResponseV3'
        - $ref: '#/components/schemas/eventCampaignResponseV3'
        - $ref: '#/components/schemas/legacyCampaignResponseV3'
    priceCampaignResponseV3:
      title: Price Campaign
      type: object
      required:
        - type
        - price
        - end
      properties:
        type:
          type: string
          description: The type of campaign. This decides which properties are required
          enum:
            - PRICE_CAMPAIGN
            - PERIOD_CAMPAIGN
            - EVENT_CAMPAIGN
        price:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.


            Price is specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        end:
          type: string
          format: date-time
          example: '2022-12-31T00:00:00Z'
          description: The date and time the campaign ends. Must be UTC.
        explanation:
          type: string
          example: Ordinary price 399 kr starts 6/12/2022
          description: >-
            The text displayed in the Vipps or MobilePay app to explain the
            campaign to the user
    periodCampaignResponseV3:
      title: Period Campaign
      type: object
      required:
        - type
        - price
        - end
        - period
      properties:
        type:
          type: string
          description: The type of campaign. This decides which properties are required
          enum:
            - PRICE_CAMPAIGN
            - PERIOD_CAMPAIGN
            - EVENT_CAMPAIGN
        price:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.


            Price is specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        end:
          type: string
          example: '2019-06-01T00:00:00Z'
          description: |-
            The date and time the campaign ends.
            Needs to be UTC.
        period:
          $ref: '#/components/schemas/TimePeriod'
        explanation:
          type: string
          example: Ordinary price 399 kr starts 6/12/2022
          description: >-
            The text displayed in the Vipps or MobilePay app to explain the
            campaign to the user
    eventCampaignResponseV3:
      title: Event Campaign
      type: object
      required:
        - type
        - price
        - eventText
        - eventDate
      properties:
        type:
          type: string
          description: The type of campaign. This decides which properties are required
          enum:
            - PRICE_CAMPAIGN
            - PERIOD_CAMPAIGN
            - EVENT_CAMPAIGN
        price:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.


            Price is specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        eventDate:
          type: string
          format: date-time
          example: '2022-12-31T00:00:00Z'
          description: The date and time the campaign ends. Must be UTC.
        eventText:
          type: string
          example: Until Christmas
          description: A short text that describes the event
        explanation:
          type: string
          example: Ordinary price 399 kr starts 6/12/2022
          description: >-
            The text displayed in the Vipps or MobilePay app to explain the
            campaign to the user
    legacyCampaignResponseV3:
      title: Legacy Campaign
      type: object
      required:
        - type
        - price
        - end
      properties:
        type:
          type: string
          description: The type of campaign. This decides which properties are required
          enum:
            - PRICE_CAMPAIGN
            - PERIOD_CAMPAIGN
            - EVENT_CAMPAIGN
            - LEGACY_CAMPAIGN
        price:
          type: integer
          format: int32
          example: 1500
          description: >-
            The price of the agreement in the discount period. The lowering of
            the price will be displayed in-app.


            Price is specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        end:
          type: string
          example: '2019-06-01T00:00:00Z'
          description: |-
            The date and time the campaign ends.
            Needs to be UTC.
        explanation:
          type: string
          example: Ordinary price 399 kr starts 6/12/2022
          description: >-
            The text displayed in the Vipps or MobilePay app to explain the
            campaign to the user
    pricingRequest:
      title: DraftAgreementPricingRequest
      type: object
      required:
        - currency
      properties:
        type:
          type: string
          description: The type of pricing. This decides which properties are required.
          enum:
            - LEGACY
            - VARIABLE
            - FLEXIBLE
          default: LEGACY
        currency:
          $ref: '#/components/schemas/CurrencyV3'
        amount:
          type: integer
          format: int32
          minimum: 100
          example: 1500
          description: >-
            The price of the agreement, required if type is LEGACY or not
            present.


            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        suggestedMaxAmount:
          type: integer
          format: int32
          minimum: 100
          example: 3000
          description: >-
            The suggested max amount that the customer should choose, required
            if type is VARIABLE.

            There are limits for each currency:

            - NOK: 20 000 kr (2000000 øre)

            - DKK: 300 000 kr (30000000 øre)

            - EUR: 2 000 Euro (200000 cent)


            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
    pricingResponse:
      oneOf:
        - $ref: '#/components/schemas/LegacyPricingResponse'
        - $ref: '#/components/schemas/VariableAmountPricingResponse'
      discriminator:
        propertyName: type
    LegacyPricingResponse:
      title: LegacyPricingResponse
      type: object
      required:
        - type
        - currency
        - amount
      properties:
        type:
          type: string
          description: The type of pricing. This decides which properties are present.
          enum:
            - LEGACY
            - VARIABLE
        currency:
          $ref: '#/components/schemas/CurrencyV3'
        amount:
          type: integer
          format: int32
          example: 1500
          description: |-
            The price of the agreement, present if type is LEGACY.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.         
    VariableAmountPricingResponse:
      title: VariableAmountPricingResponse
      type: object
      required:
        - type
        - currency
        - suggestedMaxAmount
      properties:
        type:
          type: string
          description: The type of pricing. This decides which properties are present.
          enum:
            - LEGACY
            - VARIABLE
        currency:
          $ref: '#/components/schemas/CurrencyV3'
        suggestedMaxAmount:
          type: integer
          format: int32
          example: 30000
          description: >-
            The suggested max amount that the customer should choose, present if
            type is VARIABLE.


            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        maxAmount:
          type: integer
          format: int32
          example: 30000
          description: |-
            The max amount chosen by the customer.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.       
    PricingUpdateRequest:
      title: UpdateAgreementPricingRequest
      type: object
      properties:
        amount:
          type: integer
          format: int32
          minimum: 100
          example: 1500
          description: >-
            The price of the agreement, can only be updated if agreement type is
            LEGACY


            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        suggestedMaxAmount:
          type: integer
          format: int32
          minimum: 100
          example: 3000
          description: >-
            The suggested max amount that the customer should choose, required
            if type is VARIABLE.

            There are limits for each currency:

            - NOK: 20 000 kr (2000000 øre)

            - DKK: 300 000 kr (30000000 øre)

            - EUR: 2 000 Euro (200000 cent)


            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
    InitialChargeV2:
      title: InitialCharge
      description: >-
        An initial charge for a new agreement.

        The charge will be processed immediately when the user approves the
        agreement.
      type: object
      required:
        - amount
        - currency
        - description
        - transactionType
      properties:
        amount:
          type: integer
          format: int32
          example: 19900
          description: >-
            The amount that must be paid or approved before starting the
            agreement.


            Amounts are specified in minor units.

            NOK: 1 kr = 100 øre.
        currency:
          $ref: '#/components/schemas/Currency'
        description:
          type: string
          example: Månedsabonnement
          description: This field is visible to the end user in-app
        transactionType:
          type: string
          example: DIRECT_CAPTURE
          description: The type of payment to be made.
          enum:
            - RESERVE_CAPTURE
            - DIRECT_CAPTURE
        orderId:
          type: string
          example: acme-shop-123-order123abc
          description: >-
            An optional, but recommended `orderId` for the charge.

            If provided, this will be the `chargeId` for this charge.

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/orderid/

            If no `orderId` is specified, the `chargeId` will be automatically
            generated.
    InitialChargeV3:
      title: InitialCharge
      description: >-
        An initial charge for a new agreement.

        The charge will be processed immediately when the user approves the
        agreement.
      type: object
      required:
        - amount
        - description
        - transactionType
      properties:
        amount:
          type: integer
          format: int32
          example: 19900
          description: >-
            The amount that must be paid or approved before starting the
            agreement.


            Amounts are specified in minor units.

            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        description:
          type: string
          minLength: 1
          maxLength: 100
          example: Månedsabonnement
          description: This field is visible to the end user in-app
        transactionType:
          type: string
          example: DIRECT_CAPTURE
          description: The type of payment to be made.
          enum:
            - RESERVE_CAPTURE
            - DIRECT_CAPTURE
        orderId:
          type: string
          example: acme-shop-123-order123abc
          description: >-
            An optional, but recommended `orderId` for the charge.

            If provided, this will be the `chargeId` for this charge.

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/orderid/

            If no `orderId` is specified, the `chargeId` will be automatically
            generated.
        externalId:
          type: string
          description: |-
            An optional external ID for the charge
            The `externalId` can be used by the merchant to map the `chargeId`
            to an ID in a subscription system or similar.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
    CreateChargeV2:
      title: CreateCharge
      type: object
      required:
        - amount
        - currency
        - description
        - due
        - retryDays
      properties:
        amount:
          type: integer
          format: int32
          minimum: 100
          example: 19900
          description: |-
            Amount to be paid by the customer.

            Amounts are specified in minor units.
            NOK: 1 kr = 100 øre.
        currency:
          $ref: '#/components/schemas/Currency'
        description:
          type: string
          minLength: 1
          maxLength: 45
          example: Månedsabonnement
          description: This field is visible to the end user in-app
        due:
          type: string
          description: |-
            The date when the charge is due to be processed.
            Must be in the format `YYYY-MM-DD` and ISO 8601.
          example: '2030-12-31'
        retryDays:
          type: integer
          format: int32
          minimum: 0
          maximum: 14
          example: 5
          description: >-
            The service will attempt to charge the customer for the number of
            days

            specified in `retryDays` after the `due` date.

            We recommend at least two days retry.
        orderId:
          type: string
          maxLength: 50
          pattern: ^[a-zA-Z\d-]+
          example: acme-shop-123-order123abc
          description: >-
            An optional, but recommended `orderId` for the charge.

            If provided, this will be the `chargeId` for this charge.

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/orderid/

            If no `orderId` is specified, the `chargeId` will be automatically
            generated.
    CreateChargeV3:
      title: CreateCharge
      type: object
      required:
        - amount
        - description
        - transactionType
      properties:
        amount:
          type: integer
          format: int32
          minimum: 100
          example: 19900
          description: |-
            Amount to be paid by the customer.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        transactionType:
          $ref: '#/components/schemas/transactionType'
        type:
          $ref: '#/components/schemas/ChargeCreationTypeV3'
        description:
          type: string
          minLength: 1
          maxLength: 100
          example: Månedsabonnement
          description: This field is visible to the end user in-app
        due:
          type: string
          description: >-
            The date when the charge is due to be processed.


            Must be at least two days in advance in the production environment,

            and at least one day in the test environment.


            If the charge is `DIRECT_CAPTURE`, the charge is processed and
            charged on the `due` date.

            If the charge is `RESERVE_CAPTURE`, the charge is `RESERVED` on
            `due` date.


            Must be in the format `YYYY-MM-DD` and ISO 8601.


            Required only for `RECURRING` charges
          example: '2030-12-31'
        retryDays:
          type: integer
          format: int32
          minimum: 0
          maximum: 14
          example: 5
          description: >-
            The service will attempt to charge the customer for the number of
            days

            specified in `retryDays` after the `due` date.

            We recommend at least two days retry.


            Required only for `RECURRING` charges
        orderId:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z\d-]+
          example: acme-shop-123-order123abc
          description: >-
            An optional, but recommended `orderId` for the charge.

            If provided, this will be the `chargeId` for this charge.

            This is the unique identifier of the payment, from the payment is
            initiated and all the way to the settlement data.

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/orderid/

            If no `orderId` is specified, the `chargeId` will be automatically
            generated.
        externalId:
          type: string
          description: >-
            An optional external ID for the charge, that takes the place of the
            `orderId` in settlement reports without overriding the default
            `chargeId`

            The `externalId` can be used by the merchant to map the `chargeId`
            to an ID in a subscription system or similar.

            Note that while `orderId` must be unique per merchant, `externalId`
            does not have this limitation, 

            so you need to avoid assigning the same `externalId` to multiple
            charges if you want to keep them separate in settlement reports.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
    CreateChargeAsyncV3:
      title: CreateChargeAsync
      type: object
      required:
        - agreementId
        - amount
        - description
        - due
        - retryDays
        - transactionType
        - orderId
      properties:
        agreementId:
          type: string
          example: agr_asdf123
          description: >-
            Id of a an agreement which user may agree to.

            Initially the agreement is in a pending state waiting for user
            approval.

            It enters active state once the user has approved it in the Vipps or
            MobilePay app
        amount:
          type: integer
          format: int32
          minimum: 100
          example: 19900
          description: |-
            Amount to be paid by the customer.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        transactionType:
          $ref: '#/components/schemas/transactionType'
        description:
          type: string
          minLength: 1
          maxLength: 100
          example: Månedsabonnement
          description: This field is visible to the end user in-app
        due:
          type: string
          description: >-
            The date when the charge is due to be processed.


            Must be at least two days in advance in the production environment,

            and at least one day in the test environment.


            If the charge is `DIRECT_CAPTURE`, the charge is processed and
            charged on the `due` date.

            If the charge is `RESERVE_CAPTURE`, the charge is `RESERVED` on
            `due` date.


            Must be in the format `YYYY-MM-DD` and ISO 8601.
          example: '2030-12-31'
        retryDays:
          type: integer
          format: int32
          minimum: 0
          maximum: 14
          example: 5
          description: >-
            The service will attempt to charge the customer for the number of
            days

            specified in `retryDays` after the `due` date.

            We recommend at least two days retry.
        orderId:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z\d-]+
          example: acme-shop-123-order123abc
          description: >-
            This will be the `chargeId` for this charge.

            This is the unique identifier of the payment, from the payment is
            initiated and all the way to the settlement data.

            See:
            https://developer.vippsmobilepay.com/docs/knowledge-base/orderid/
        externalId:
          type: string
          description: >-
            An optional external ID for the charge, that takes the place of the
            `orderId` in settlement reports without overriding the default
            `chargeId`

            The `externalId` can be used by the merchant to map the `chargeId`
            to an ID in a subscription system or similar.

            Note that while `orderId` must be unique per merchant, `externalId`
            does not have this limitation, 

            so you need to avoid assigning the same `externalId` to multiple
            charges if you want to keep them separate in settlement reports.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
    AsyncChargeResponse:
      title: AsyncChargeResponse
      type: object
      required:
        - invalidCharges
        - validCharges
      properties:
        invalidCharges:
          type: array
          items:
            $ref: '#/components/schemas/InvalidChargeResponse'
        validCharges:
          type: array
          items:
            type: string
          example:
            - chr_1111
            - chr_2222
    InvalidChargeResponse:
      title: ChargeBatchResponse
      type: object
      required:
        - chargeBatchItemDto
        - errors
      properties:
        chargeBatchItemDto:
          $ref: '#/components/schemas/ChargeBatchItemDto'
        errors:
          type: array
          items:
            type: string
    ChargeBatchItemDto:
      title: ChargeBatchItemDto
      type: object
      required:
        - due
        - retryDays
        - amount
        - description
        - transactionType
        - orderId
      properties:
        due:
          type: string
          example: '2024-02-09'
        retryDays:
          type: integer
          format: int32
          example: 3
        amount:
          type: integer
          format: int32
          example: 300
        description:
          type: string
          example: charge description
        transactionType:
          type: string
          enum:
            - DIRECT_CAPTURE
            - RESERVE_CAPTURE
          example: DIRECT_CAPTURE
        orderId:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z\d-]+
          example: ea929435-d761-4a80-9271-c896d131b796
        agreementId:
          type: string
        externalId:
          type: string
    ChargeReference:
      type: object
      title: Charge reference
      properties:
        chargeId:
          type: string
          example: chg_WCVbcAbRCmu2zk
          description: Unique identifier for this charge, up to 15 characters.
          maxLength: 15
    ChargeResponseV2:
      title: ChargeResponse
      type: object
      required:
        - transactionId
        - description
        - type
        - amount
        - amountRefunded
        - due
        - id
        - status
      properties:
        amount:
          type: integer
          format: int32
          example: 19900
          description: |-
            Amount to be paid by the customer.

            Amounts are specified in minor units.
            NOK: 1 kr = 100 øre.
        amountRefunded:
          type: integer
          format: int32
          example: 0
          description: >-
            The total amount which has been refunded, in case of status
            refund/partial refund.


            Amounts are specified in minor units.

            NOK: 1 kr = 100 øre.
        description:
          type: string
          description: Description of the charge.
          example: 'Premier League subscription: September'
        due:
          type: string
          format: date-time
          description: The due date for this charge.
          example: '2019-06-01T00:00:00Z'
        id:
          type: string
          description: Identifier for this charge (for this customer's subscription).
          maxLength: 15
          example: chr_WCVbcA
        status:
          $ref: '#/components/schemas/ChargeStatus'
        transactionId:
          type: string
          description: Contains null until the status has reached CHARGED.
          maxLength: 36
          pattern: ^\d{10+}$
          example: '5001419121'
        type:
          $ref: '#/components/schemas/ChargeTypeV2'
        failureReason:
          type: string
          enum:
            - user_action_required
            - charge_amount_too_high
            - non_technical_error
            - technical_error
          example: user_action_required
          description: |
            Identifies the reason why the charged has been marked as `FAILED`:
              * `user_action_required` - The user's card can not fulfil the payment. The user needs to take action in the app.
                 Examples: Card is blocked for ecommerce, insufficient funds, expired card.

              * `charge_amount_too_high` - The user's max amount is too low. The user needs to update their max amount in the Vipps or MobilePay app.

              * `non_technical_error` - Something went wrong with charging the user.
                 Examples: User has deleted their Vipps MobilePay Profile.

              * `technical_error` - Something went wrong in Recurring while performing the payment.
                 Examples: Failure in Recurring, failure in downstream services.
        failureDescription:
          type: string
          description: Description for the failure reason.
          example: User action required
    ChargeResponseV3:
      title: ChargeResponse
      type: object
      required:
        - transactionId
        - description
        - type
        - transactionType
        - amount
        - summary
        - history
        - due
        - id
        - status
        - currency
        - agreementId
        - externalId
        - retryDays
      properties:
        amount:
          type: integer
          format: int32
          example: 19900
          description: |-
            Amount to be paid by the customer.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        currency:
          $ref: '#/components/schemas/CurrencyV3'
        description:
          type: string
          description: Description of the charge
          example: 'Premier League subscription: September'
        due:
          type: string
          format: date-time
          description: The due date for this charge
          example: '2019-06-01T00:00:00Z'
        id:
          type: string
          description: Identifier for this charge (for this customer's subscription).
          maxLength: 15
          example: chr_WCVbcA
        agreementId:
          type: string
          description: Id of the agreement the charge belongs to
          example: agr_5kSeqz
        externalId:
          type: string
          description: |-
            An optional external ID for the charge
            The `externalId` can be used by the merchant to map the `chargeId`
            to an ID in a subscription system or similar.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
        externalAgreementId:
          type: string
          description: >-
            An optional external ID for the agreement

            The `externalId` can be used by the merchant to map the
            `agreementId`

            to an ID in a subscription system or similar.
          maxLength: 64
          minLength: 1
          pattern: ^.{1,64}$
          example: external-id-2468
        retryDays:
          type: integer
          format: int32
          minimum: 0
          maximum: 14
          example: 5
          description: >-
            The service will attempt to charge the customer for the number of
            days

            specified in `retryDays` after the `due` date.

            We recommend at least two days retry.
        status:
          $ref: '#/components/schemas/ChargeStatus'
        transactionId:
          type: string
          description: Contains null until the status has reached CHARGED
          maxLength: 36
          pattern: ^\d{10+}$
          example: '5001419121'
        type:
          $ref: '#/components/schemas/ChargeTypeV3'
        transactionType:
          $ref: '#/components/schemas/transactionType'
        failureReason:
          type: string
          nullable: true
          enum:
            - user_action_required
            - charge_amount_too_high
            - non_technical_error
            - technical_error
          example: user_action_required
          description: |
            Identifies the reason why the charged has been marked as `FAILED`:
              * `user_action_required` - The user's card can not fulfil the payment, user needs to take action in the Vipps or MobilePay app.
                 Examples: Card is blocked for ecommerce, insufficient funds, expired card.

              * `charge_amount_too_high` - The user's max amount is too low, user needs to update their max amount in the Vipps or MobilePay app.

              * `non_technical_error` - Something went wrong with charging the user.
                 Examples: User has deleted their Vipps MobilePay Profile.

              * `technical_error` - Something went wrong in Recurring while performing the payment.
                 Examples: Failure in Recurring, failure in downstream services.
        failureDescription:
          type: string
          description: Description for the failure reason
          example: User action required
        summary:
          $ref: '#/components/schemas/ChargeSummary'
        history:
          $ref: '#/components/schemas/ChargeHistory'
    RefundRequest:
      title: Refund charge request
      type: object
      required:
        - amount
        - description
      properties:
        amount:
          type: integer
          format: int32
          minimum: 100
          example: 5000
          description: |-
            The amount to refund on a captured/charged charge.

            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        description:
          type: string
          minLength: 1
          example: Forgot to apply discount, refunding 50%
          description: >-
            A textual description of the operation, which will be displayed in
            the user's app.
    CaptureRequestV3:
      title: Capture charge request
      type: object
      required:
        - amount
      properties:
        amount:
          type: integer
          format: int32
          minimum: 100
          example: 5000
          description: |-
            The amount to capture on a reserved charge.
            Amounts are specified in minor units.
            NOK and DKK: 1 kr = 100 øre. EUR: 1 Euro = 100 cent.
        description:
          type: string
          minLength: 1
          maxLength: 100
          example: TV subscription for May
          description: Deprecated. Description in CreateChargeV3 is used instead.
          deprecated: true
    TimePeriod:
      title: Time Period request
      description: >-
        A period of time, defined by a unit (DAY, WEEK, ...) and a count (number
        of said units)
      type: object
      required:
        - unit
        - count
      properties:
        unit:
          type: string
          example: WEEK
          description: Unit of time
          enum:
            - YEAR
            - MONTH
            - WEEK
            - DAY
        count:
          type: integer
          format: int32
          minimum: 1
          maximum: 31
          exclusiveMinimum: false
          exclusiveMaximum: false
          example: 2
          description: >-
            Number of units in the time period. Example: unit=week, count=2 to
            define two weeks
    TimePeriodResponse:
      title: Time Period response
      description: >-
        A period of time, defined by a unit (DAY, WEEK, ...) and a count (number
        of said units)
      type: object
      properties:
        unit:
          type: string
          example: WEEK
          description: Unit of time
          enum:
            - YEAR
            - MONTH
            - WEEK
            - DAY
        count:
          type: integer
          format: int32
          example: 2
          description: >-
            Number of units in the time period. Example: unit=week, count=2 to
            define two weeks
        text:
          type: string
          description: >-
            Textual representation used in Vipps MobilePay to describe the time
            period
          example: every 2 weeks
    ForceAcceptAgreement:
      title: Force accept agreement request
      type: object
      required:
        - customerPhoneNumber
      properties:
        customerPhoneNumber:
          type: string
          example: '12345678'
    ForceAcceptAgreementV3:
      title: Force accept agreement request
      type: object
      required:
        - phoneNumber
      properties:
        phoneNumber:
          type: string
          example: '4712345678'
    ErrorFromAzure:
      type: object
      description: >-
        An error from Microsoft Azure. We have limited control of these errors,

        and can not give as detailed information as with the errors from our own
        code.

        The most important property is the HTTP status code.
      required:
        - responseInfo
        - result
      properties:
        responseInfo:
          type: object
          required:
            - responseCode
            - responseMessage
          properties:
            responseCode:
              type: integer
              example: 401
            responseMessage:
              type: string
              example: Unauthorized
        result:
          type: object
          required:
            - message
          properties:
            message:
              type: string
              description: 'When possible: A description of what went wrong.'
              example: >-
                (An error from Azure API Management, possibly related to
                authentication)
    ErrorV2:
      title: Error response
      description: |-
        An error from Vipps MobilePay.
        The most important property is the HTTP status code.
        The response body contains more details of the error.
      type: object
      properties:
        field:
          type: string
          description: Field that caused the error
          example: agreement.status
        message:
          type: string
          description: The error message
          example: Cannot create a charge for an agreement which is not active.
        code:
          type: string
          description: The code for the specific error
          example: recurring.core.charges.create.invalid_agreement
        contextId:
          type: string
          description: A unique ID for this error, useful for searching in logs
          example: f70b8bf7-c843-4bea-95d9-94725b19895f
    ErrorArray:
      type: array
      items:
        $ref: '#/components/schemas/ErrorV2'
    ErrorV3:
      title: Error response
      description: >-
        The standard error object, based on RFC 7807. See
        https://developer.vippsmobilepay.com/docs/APIs/recurring-api/recurring-api-problems/
      type: object
      properties:
        type:
          type: string
          description: Path to type of error
        title:
          type: string
          description: Short description of the error
        status:
          type: integer
          format: int32
          description: HTTP status returned with the problem
        detail:
          type: string
          description: Details about the error
        instance:
          type: string
          description: The path of the request
        contextId:
          type: string
          description: An unique ID for the request
        extraDetails:
          type: array
          items:
            $ref: '#/components/schemas/ExtraDetails'
    ExtraDetails:
      title: Extra details
      description: extra details about the error
      type: object
      properties:
        name:
          type: string
          description: Name of the field related to the error
        reason:
          type: string
          description: Details about the error
  responses:
    ErrorResponseV2:
      description: |-
        Possible error responses.
        Errors can be from both our own code (where we have full control) and
        from Microsoft Azure (where we rely on standard functionality).
      content:
        application/json;charset=UTF-8:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorArray'
              - $ref: '#/components/schemas/ErrorFromAzure'
    ErrorResponseV3:
      description: Standard problem response.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorV3'
      headers: {}
