openapi: 3.0.0
info:
  title: Dintero API
  description: |
    API for managing Receipts, Discounts, Customers, Wallets and Webhooks

    # Introduction

    The Dintero API is organized around REST. Our API has predictable,
    resource-oriented URLs, and uses HTTP response codes to indicate API errors.
    We use built-in HTTP features, like HTTP authentication and HTTP verbs,
    which are understood by off-the-shelf HTTP clients.
    We support cross-origin resource sharing, allowing you to interact
    securely with our API from a client-side web application
    (though you should never expose your secret API key in any public
    website's client-side code). JSON is returned by all API responses,
    including errors.

    To make the API as explorable as possible, accounts have test mode and
    live mode API keys. There is no "switch" for changing between modes,
    just use the appropriate key to perform a live or test transaction.
    Requests made with test mode incur no cost.

    # Downloads

    Download the OpenAPI specification

    - [customers](/specs/spec-customers.yaml)
    :   API for managing customers

    - [discounts](/specs/spec-discounts.yaml)
    :   API for managing discount for customers

    - [products](/specs/spec-products.yaml)
    :   API for managing products

    - [hooks](/specs/spec-webhooks.yaml)
    :   API for managing webhooks

    - [receipts](/specs/spec-receipts.yaml)
    :   API for managing receipts

    - [wallets](/specs/spec-wallets.yaml)
    :   API for managing virtual cards, digital gift
        cards and transactions
  contact:
    name: API Integration Support
    email: integration@dintero.com
  version: LATEST
  license:
    name: UNLICENSED
    url: https://dintero.com
  x-logo:
    url: /img/dintero-dark-padded.svg
tags:
  - name: users
    description: A user, aka customer, member.
  - name: rules customers
    x-displayName: customers
    description: Manage customers
  - name: rules automations
    description: Manage automation rules
    x-displayName: rules
  - name: auth users
    description: Admin users
    x-displayName: users
  - name: account users
    x-displayName: users
    description: |
      Admin user for an account. The user is allowed to manage the
      account and administrate access via client/grants
paths:
  /accounts/{aid}/customers/change_password:
    post:
      summary: aid_customers_change_password
      description: |
        Specify the email address of the user whose password you
        would like to reset. If the call is successful, the user
        will receive an email prompting them to change their password.
        The caller must have scope `write:accounts:/auth/users` to perform a
        change password request.
        scopes:
        - write:accounts:/auth/users
      operationId: aid_customers_change_password
      tags:
        - password
      x-scopes:
        - write:accounts:/auth/users
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - audience
                - email
                - type
              properties:
                email:
                  type: string
                audience:
                  type: string
                  description: |
                    The unique identifier of the target API you want to access.
                    The audience must be a grant associated with the client used
                    when calling this resource.
                type:
                  type: string
                  enum:
                    - customer
                    - company
                  description: |
                    user type to login, required as users with different
                    type can share email
        required: true
      security:
        - JWT: []
      responses:
        '204':
          description: Success
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Change password
          sidebarTitle: Change password
  /accounts/{aid}/customers/company/departments:
    get:
      operationId: aid_company_departments_get
      summary: aid_company_departments_get
      description: |
        List all departments register by company customers

        scopes:
        - admin:customers
        - read:customers
        - public:customers
      tags:
        - company
      x-scopes:
        - admin:customers
        - read:customers
        - public:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: organization_number
          in: query
          required: true
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          description: company departments
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    organization_number:
                      type: string
                      example: 123456789MVA
                    departments:
                      type: array
                      example:
                        - Production
                        - Research and Development
                        - Accounting and Finance
                      items:
                        type: string
        '400':
          $ref: '#/components/responses/BadRequest'
      x-mint:
        metadata:
          title: Get departments
          sidebarTitle: Get departments
  /accounts/{aid}/customers/login:
    post:
      summary: aid_customers_login_post
      description: |
        Login a customer user, the caller must have scope
        `write:accounts:/auth/users`.
        If MFA is enabled on account, use
        `write:accounts:/auth/users/no-mfa` to skip MFA.
        scopes:
        - write:accounts:/auth/users
        - write:accounts:/auth/users/no-mfa
      operationId: aid_customers_login_post
      tags:
        - password
      x-scopes:
        - write:accounts:/auth/users
        - write:accounts:/auth/users/no-mfa
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Auth'
                - required:
                    - password
                  properties:
                    password:
                      type: string
                      minLength: 4
                      maxLength: 255
                      description: |
                        The customer pin or password. The caller must have scope
                        `write:accounts:/auth/users` or `write:accounts:/auth/users/no-mfa`
                        when password is included in the body
        description: credentials
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Login with email/password
          sidebarTitle: Login with email/password
  /accounts/{aid}/customers/mfa_login:
    post:
      summary: aid_customers_mfa_login_post
      description: |
        Initiate a Multi-Factor Authentication for a customer user, the caller must
        have scope `write:accounts:/auth/users` to perform a login.
        Post the `ident_type`, along with the `ident` and `secret`.
        The server will return a challenge response specifying the
        `challenge_type` that will have to be completed to when getting an access
        token from the `POST /v1/accounts/{oid}/auth/token` endpoint.
        scopes:
        - write:accounts:/auth/users
      operationId: aid_customers_mfa_login_post
      tags:
        - password
      x-scopes:
        - write:accounts:/auth/users
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/MFAAuth'
                - required:
                    - secret
                  properties:
                    secret:
                      type: string
                      description: |
                        The customers pin or password.
        description: credentials
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: MFA login challenge
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultiFactorAuthenticationChallenge'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Login with MFA
          sidebarTitle: Login with MFA
  /accounts/{aid}/customers/mfa_login_recovery:
    post:
      summary: aid_customers_mfa_login_initiate_recovery_post
      description: |
        Initiate a Multi-Factor Authentication recovery login for a customer user
        that has forgotten/lost their `secret`.
        Specify the ident_type and the ident (email or phone_number) of the user. If
        the call is successful, the user will get an email with an one time recovery
        code that has to be submitted to the mfa_recovery endpoint.
        When a valid one time recovery has been posted the server response with a
        regular MFA challenge.
        Once authenticated the password or pin can be changed by updating the
        customer.
        scopes:
          - write:accounts:/auth/users
      operationId: aid_customers_mfa_login_initiate_recovery_post
      tags:
        - password
      x-scopes:
        - write:accounts:/auth/users
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MFAAuth'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Recovery MFA challenge
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultiFactorAuthenticationRecoveryChallenge'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: MFA recovery
          sidebarTitle: MFA recovery
  /accounts/{aid}/customers/settings:
    get:
      operationId: aid_customers_atributes_get
      summary: aid_customers_atributes_get
      description: |
        Get customers settings

        scopes:
        - admin:customers
        - read:customers
        - public:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - settings
      x-scopes:
        - admin:customers
        - read:customers
        - public:customers
      security:
        - JWT: []
      responses:
        '200':
          description: an object of customers settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomersSettings'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Customers settings
          sidebarTitle: Customers settings
    put:
      operationId: aid_customers_atributes_put
      summary: aid_customers_atributes_put
      description: |
        Update customers settings

        scopes:
        - admin:customers
        - write:customers
      tags:
        - settings
      x-scopes:
        - admin:customers
        - write:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomersSettings'
        description: customers settings
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: added/updated object of customers settings
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CustomersSettings'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update settings
          sidebarTitle: Update settings
  /accounts/{aid}/customers/tags:
    get:
      operationId: aid_customers_tags_get
      summary: aid_customers_tags_get
      description: |
        Get all customer tags (also known as groups).
        scopes:
        - admin:customers
        - read:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
      tags:
        - tags
      x-scopes:
        - admin:customers
        - read:customers
      security:
        - JWT: []
      responses:
        '200':
          description: Customers Tags
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerTag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Tags collection
          sidebarTitle: Tags collection
    post:
      operationId: aid_customers_tags_post
      summary: aid_customers_tags_post
      description: |
        Create a tag
        scopes:
        - admin:customers
        - write:customers
      tags:
        - tags
      x-scopes:
        - admin:customers
        - write:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerTag'
        description: customer tag add
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Customers Tags
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerTag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new Tag
          sidebarTitle: Create new Tag
  /accounts/{aid}/customers/tags/{tag_id}:
    delete:
      operationId: aid_customers_tags_tid_delete
      summary: aid_customers_tags_tid_delete
      description: |
        Delete a tag.
        A deleted tag is removed from customer tags
        scopes:
        - admin:customers
        - write:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: tag_id
          description: |
            tag id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      tags:
        - tags
      x-scopes:
        - admin:customers
        - write:customers
      security:
        - JWT: []
      responses:
        '200':
          description: Tag deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerTag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete Tag
          sidebarTitle: Delete Tag
  /accounts/{aid}/customers/terms:
    post:
      operationId: aid_customers_terms_post
      summary: aid_customers_terms_post
      description: |
        Create customer terms and conditions
        scopes:
        - admin:customers
        - write:customers
      tags:
        - terms
      x-scopes:
        - admin:customers
        - write:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TermsAndConditions'
        description: terms to create
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Term created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TermsAndConditions'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new Terms
          sidebarTitle: Create new Terms
    get:
      operationId: aid_customers_terms_get
      summary: aid_customers_terms_get
      description: |
        Get all customer terms and conditions
        scopes:
        - admin:customers
        - read:customers
        - public:customers
      tags:
        - terms
      x-scopes:
        - admin:customers
        - read:customers
        - public:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: include_deleted
          description: |
            include deleted terms in the response
          in: query
          schema:
            type: boolean
            default: false
      security:
        - JWT: []
      responses:
        '200':
          description: Terms collection
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TermsAndConditions'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Terms collection
          sidebarTitle: Terms collection
  /accounts/{aid}/customers/terms/{tid}:
    get:
      operationId: aid_customers_terms_tid_post
      summary: aid_customers_terms_tid_post
      description: |
        Get single terms and conditions
        scopes:
        - admin:customers
        - read:customers
        - public:customers
      tags:
        - terms
      x-scopes:
        - admin:customers
        - read:customers
        - public:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: tid
          description: terms id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      security:
        - JWT: []
      responses:
        '200':
          description: Term details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TermsAndConditions'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Terms details
          sidebarTitle: Terms details
    delete:
      operationId: aid_customers_terms_tid_delete
      summary: aid_customers_terms_tid_delete
      description: |
        Delete the customer term
        scopes:
        - admin:customers
        - write:customers
      tags:
        - terms
      x-scopes:
        - admin:customers
        - write:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: tid
          description: terms id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      security:
        - JWT: []
      responses:
        '200':
          description: Deleted term
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TermsAndConditions'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete Term
          sidebarTitle: Delete Term
  /accounts/{aid}/customers/tokens/events:
    get:
      operationId: aid_customers_tokens_events_get
      summary: aid_customers_tokens_events_get
      description: |
        Get the token events
        scopes:
        - admin:customers
        - read:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: since_datetime
          description: |
            Only token events added/updated at or after this time is returned
            NOTE: this parameter can't be combined with `starting_after` parameter.
            Retrieve next page by updating since_datetime to the latest updated_at
            value found in the result.
          in: query
          schema:
            type: string
            format: date-time
        - name: deleted_since
          description: |
            return only token events that has been deleted
          in: query
          schema:
            type: string
            format: date-time
      tags:
        - tokens
      x-scopes:
        - admin:customers
        - read:customers
      security:
        - JWT: []
      responses:
        '200':
          description: events collection
          headers:
            page-count:
              description: |
                count object in response
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  allOf:
                    - properties:
                        id:
                          type: string
                          readOnly: true
                          description: |
                            Auto-generated ID identifying the token type/value.
                        status:
                          type: string
                          readOnly: true
                          description: |
                            The status resolved from latest events registered on
                            given token type and value
                          default: UNKNOWN
                          example: DELETED
                        events:
                          type: array
                          readOnly: true
                          description: |
                            Events recorded given token type and value
                          example:
                            - created_at: '2018-01-31T16:56:33Z'
                              event: anonymous token
                              status: PENDING
                            - created_at: '2018-02-05T00:00:00Z'
                              event: reqruited
                              status: DELETED
                          items:
                            $ref: '#/components/schemas/TokenEvent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      x-mint:
        metadata:
          title: Get token events
          sidebarTitle: Get token events
    delete:
      operationId: aid_customers_tokens_events_delete
      summary: aid_customers_tokens_events_delete
      description: |
        Delete the connection between token (type/value) and
        list of events.
        Include an event in the request to store the reason
        for the request
        scopes:
        - admin:customers
        - write:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - token
              properties:
                token:
                  $ref: '#/components/schemas/TokenTypeValue'
                event:
                  description: Record an delete event, the status will be set to DELETED.
                  type: object
                  properties:
                    event:
                      type: string
                      example: customer registered in webshop
                    metadata:
                      type: object
        required: true
      tags:
        - tokens
      x-scopes:
        - admin:customers
        - write:customers
      security:
        - JWT: []
      responses:
        '204':
          description: events cleared
      x-mint:
        metadata:
          title: Delete token events
          sidebarTitle: Delete token events
    post:
      operationId: aid_customers_tokens_events_post
      summary: aid_customers_tokens_events_post
      description: |
        Find details about a token, inclusive details about
        any customer the token belongs to and any token events recorded
        Include event in the request to update the status of the token
        scopes:
        - admin:customers
        - write:customers
      tags:
        - tokens
      x-scopes:
        - admin:customers
        - write:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - token
              properties:
                token:
                  $ref: '#/components/schemas/TokenTypeValue'
                event:
                  $ref: '#/components/schemas/TokenEvent'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Token details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDetail'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-mint:
        metadata:
          title: Find / Add token events
          sidebarTitle: Find / Add token events
  /accounts/{aid}/customers/users:
    post:
      summary: aid_customers_post
      description: |
        Create a new customer, `customer_id`, `email` and `phone_number` must
        be unique if specified.
        scopes:
        - admin:customers
        - write:customers
        - create:customers:/users
      operationId: aid_customers_post
      tags:
        - users
      x-scopes:
        - admin:customers
        - write:customers
        - create:customers:/users
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - $ref: '#/components/schemas/Customer'
                - properties:
                    customer_id:
                      type: string
                      maxLength: 255
                      description: |
                        The customer id you have defined for the customer.
                        (must not have trailing or leading spaces)
                        An auto-generated customer_id will be created if no
                        customer_id is provided.
                    password:
                      type: string
                      minLength: 8
                      maxLength: 255
                      description: |
                        The customer password. The caller must have scope
                        `write:accounts:/auth/users` when password is included in the body
                    pin:
                      type: string
                      minLength: 6
                      maxLength: 6
                      pattern: ^\d{6}$
                      description: |
                        6 digit customer pin, can only used for MFA login. The caller must have scope
                        `write:accounts:/auth/users` when pin is included in the body
        description: customer to create
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Customer created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
        '400':
          description: |
            Bad request - missing required fields or
            duplicate field detected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new Customer
          sidebarTitle: Create new Customer
    head:
      summary: aid_customers_head
      description: |
        Check if there is users that match the parameters. The result will
        match all parameters with `AND`.
        This endpoint must be enabled from [PUT /customers/settings](/customers-api/settings/aid_customers_atributes_put)
        scopes:
        - admin:customers
        - read:customers
        - public:customers
      operationId: aid_customers_head
      tags:
        - users
      x-scopes:
        - admin:customers
        - read:customers
        - public:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: email
          description: lookup customer by email
          in: query
          schema:
            type: string
        - name: phone_number
          description: lookup customer by phone_number
          in: query
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          description: Customer user exist
          headers:
            types:
              description: |
                The type of the user(s) matching the parameters.
              schema:
                type: string
        '404':
          description: No user match given query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method not allowed by customer settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-mint:
        metadata:
          title: User exist
          sidebarTitle: User exist
    get:
      summary: aid_customers_get
      description: |
        Get all customers, limited by parameters. The result will
        match all parameters with `AND`.
        Search is done by prefix match, and `+` in phone_number/email
        must be URL encoded, (+4799999999 => %2B4799999999)

        Users with type `contact` are by default excluded from the result,
        use `type=contact` or `type=any` to include contact users

        The response from a request that match contact users will include the
        users that are linked from the contact

        scopes:
        - admin:customers
        - read:customers
      operationId: aid_customers_get
      tags:
        - users
      x-scopes:
        - admin:customers
        - read:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: token_value
          description: lookup customers by token value
          in: query
          schema:
            type: string
        - name: token_type
          description: lookup customer by token type
          in: query
          schema:
            type: string
        - name: email
          description: lookup customer by email
          in: query
          schema:
            type: string
        - name: phone_number
          description: lookup customer by phone_number
          in: query
          schema:
            type: string
        - name: type
          description: lookup customer by type
          in: query
          schema:
            type: string
            enum:
              - customer
              - company
              - contact
              - employee
              - other
              - any
        - name: search
          description: |
            lookup customer where search term match name,
            phone number, customer_id or email. The search term will be matched
            with the user details
          in: query
          schema:
            type: string
        - name: tag_id
          description: lookup customers by tag id
          in: query
          schema:
            type: string
        - name: include_deleted
          description: |
            include deleted customers in the response. A deleted
            user will only have an id/customer_id, created_at/created_by
            and deleted_at/deleted_by set
            All other details of a customer, like email or phone_number
            will be deleted.
          in: query
          schema:
            type: boolean
            default: false
        - name: attributes_keys
          in: query
          description: |
            include customers that has all the attributes.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            maxItems: 4
        - name: attributes_values
          in: query
          description: |
            Combine with `attributes_keys` to include customers
            with match on attribute values
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            maxItems: 4
        - name: since_datetime
          description: |
            lookup customers that has been added or modified
            since an ISO timestamp. NOTE: this parameter can't be combined
            with `starting_after` parameter. Retrieve next page by updating
            since_datetime to the latest updated_at value found in the result
          in: query
          schema:
            type: string
            format: date-time
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/total'
      security:
        - JWT: []
      responses:
        '200':
          description: Customer collection
          headers:
            page-count:
              description: |
                count object in response
              schema:
                type: integer
            total-count:
              description: |
                total count, only set if query parameter
                `total` is set
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-mint:
        metadata:
          title: Customer collection
          sidebarTitle: Customer collection
  /accounts/{aid}/customers/users/{customer_id}:
    get:
      operationId: aid_customers_cid_get
      summary: aid_customers_cid_get
      description: |
        Customer details
        scopes:
        - admin:customers
        - read:customers
        - user:customers
        - user:customers:/customer/details
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
      tags:
        - users
      x-scopes:
        - admin:customers
        - read:customers
        - user:customers
        - user:customers:/customer/details
      security:
        - JWT: []
      responses:
        '200':
          description: Customer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Customer details
          sidebarTitle: Customer details
    put:
      operationId: aid_customers_cid_put
      summary: aid_customers_cid_put
      description: |
        Update customer properties, properties not included in the body
        will remain unchanged.
        scopes:
        - admin:customers
        - write:customers
        - user:customers
      tags:
        - users
      x-scopes:
        - admin:customers
        - write:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - $ref: '#/components/schemas/BasicUser'
                - properties:
                    password:
                      type: string
                      minLength: 8
                      maxLength: 255
                      description: |
                        The customer password. The caller must have scope
                        `write:accounts:/auth/users` when password is included in the body
                    pin:
                      type: string
                      minLength: 6
                      maxLength: 6
                      pattern: ^\d{6}$
                      description: |
                        6 digit customer pin, can only be used for MFA login. The caller must have scope
                        `write:accounts:/auth/users` when pin is included in the body
        description: Customer update
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Customer updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Customer
          sidebarTitle: Update Customer
    delete:
      operationId: aid_customers_cid_delete
      summary: aid_customers_cid_delete
      description: |
        Delete single customer
        scopes:
        - admin:customers
        - write:customers
        - user:customers
      tags:
        - users
      x-scopes:
        - admin:customers
        - write:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: delete_tokens
          description: |
            Delete all tokens owned by the customer
          in: query
          schema:
            type: boolean
            default: false
      security:
        - JWT: []
      responses:
        '200':
          description: Customer deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete customer
          sidebarTitle: Delete customer
  /accounts/{aid}/customers/users/{customer_id}/change_customer_id:
    post:
      operationId: aid_customers_cid_change_customer_id_post
      summary: aid_customers_cid_change_customer_id_post
      description: |
        Update customer_id for an customer
        **warning**: Any external resources "owned" by the user, i.e
        receipts, discounts etc. will not be updated with the new
        customer_id.
        A new metadata property `dintero_change_customer_id_{timestamp}.{hash}`
        will be added everytime the customer_id is changed
        Following data will be included in the metadata property
         - created_at
         - created_by
         - old
         - new
        scopes:
        - admin:customers
        - admin:accounts
      tags:
        - users
      x-scopes:
        - admin:customers
        - admin:accounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  maxLength: 255
                  minLength: 1
                  description: |
                    New customer_id
                    (must not have trailing or leading spaces).
        description: Customer update
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Customer updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Change customer_id
          sidebarTitle: Change customer_id
  /accounts/{aid}/customers/users/{customer_id}/communication:
    get:
      operationId: aid_customers_cid_verify_get
      summary: aid_customers_cid_verify_get
      description: |
        Get the status of customer email / phone_number communication
        scopes:
        - admin:customers
        - read:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
      tags:
        - communication
      x-scopes:
        - admin:customers
        - read:customers
        - user:customers
      security:
        - JWT: []
      responses:
        '200':
          description: Customer email / phone_number communication status
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Communication'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Customer email/phone_number Status
          sidebarTitle: Customer email/phone_number Status
  /accounts/{aid}/customers/users/{customer_id}/communication/{operation}/{field}:
    post:
      operationId: aid_customers_cid_verify_post
      summary: aid_customers_cid_verify_post
      description: |
        Verify customer email/phone_number field. Consist of
        to steps:
          - send verification code to the customer (sms or email)
          - verify the email/phone_number by posting verification code sent to customer
        scopes:
        - admin:customers
        - write:customers
        - user:customers
      tags:
        - communication
      x-scopes:
        - admin:customers
        - write:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: field
          description: field to verify
          in: path
          required: true
          schema:
            type: string
            enum:
              - email
              - phone_number
        - name: operation
          description: Verify operation
          in: path
          required: true
          schema:
            type: string
            enum:
              - send-verification-code
              - confirm-verification-code
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  description: |
                    Verification code sent to customer
                  type: string
        description: verification code
      security:
        - JWT: []
      responses:
        '204':
          description: No content
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Verify Customer email/phone_number
          sidebarTitle: Verify Customer email/phone_number
  /accounts/{aid}/customers/users/{customer_id}/tags:
    put:
      operationId: aid_customers_cid_tags_put
      summary: aid_customers_cid_tags_put
      description: |
        Update Customer Tags
        scopes:
        - admin:customers
        - write:customers
        - user:customers
      tags:
        - tags
      x-scopes:
        - admin:customers
        - write:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
                format: uuid
                description: list of tag ids
        description: tag ids to set
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Customer Data
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerTag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Customer Tags
          sidebarTitle: Update Customer Tags
    get:
      operationId: aid_customers_cid_tags_get
      summary: aid_customers_cid_tags_get
      description: |
        Get tags for a customer
        scopes:
        - admin:customers
        - read:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
      tags:
        - tags
      x-scopes:
        - admin:customers
        - read:customers
        - user:customers
      security:
        - JWT: []
      responses:
        '200':
          description: Customer tags
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerTag'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Tag collection
          sidebarTitle: Tag collection
  /accounts/{aid}/customers/users/{customer_id}/tokens:
    get:
      operationId: aid_customers_cid_tokens_get
      summary: aid_customers_cid_tokens_get
      description: |
        Get all tokens for a Customer
        scopes:
        - admin:customers
        - read:customers
        - user:customers
      tags:
        - tokens
      x-scopes:
        - admin:customers
        - read:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: type
          description: filter tokens on type
          in: query
          schema:
            type: string
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/total'
        - name: include_deleted
          description: |
            include deleted tokens in the response.
          in: query
          schema:
            type: boolean
            default: true
      security:
        - JWT: []
      responses:
        '200':
          description: Token collection
          headers:
            page-count:
              description: |
                count object in response
              schema:
                type: integer
            total-count:
              description: |
                total count, only set if query parameter
                `total` is set
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Token collections
          sidebarTitle: Token collections
    post:
      operationId: aid_customers_cid_tokens_post
      summary: aid_customers_cid_tokens_post
      description: |
        Create a new customer token
        scopes:
        - admin:customers
        - write:customers
        - user:customers
      tags:
        - tokens
      x-scopes:
        - admin:customers
        - write:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: delete_token_events
          description: |
            delete all token events recorded on token type/value
            before creating new customer token
          in: query
          schema:
            type: boolean
            default: false
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - properties:
                    token_id:
                      type: string
                      maxLength: 255
                      minLength: 1
                      description: |
                        The token id you have defined for the token.
                        (must not have trailing or leading spaces).
                        An auto-generated token_id will be created if no
                        token_id is provided.
                      readOnly: false
                - $ref: '#/components/schemas/CustomerToken'
        description: customer token to add
        required: true
      security:
        - JWT: []
      responses:
        '201':
          description: Customer token added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new Token
          sidebarTitle: Create new Token
  /accounts/{aid}/customers/users/{customer_id}/tokens/{tid}:
    delete:
      operationId: aid_customers_cid_tokens_tid_delete
      summary: aid_customers_cid_tokens_tid_delete
      description: |
        Delete Token

        scopes:
        - admin:customers
        - write:customers
        - user:customers
      tags:
        - tokens
      x-scopes:
        - admin:customers
        - write:customers
        - user:customers
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: tid
          description: |
            The token id you have defined for the token.
            (must not have trailing or leading spaces)
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      security:
        - JWT: []
      responses:
        '200':
          description: Token deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/CustomerToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete customer token
          sidebarTitle: Delete customer token
  /accounts/{aid}/locations:
    get:
      operationId: aid_locations_get
      summary: aid_locations_get
      description: |
        Get all sales locations, the starting_after have to be set to location_id
        scopes:
        - admin:locations
        - read:locations
      tags:
        - locations
      x-scopes:
        - admin:locations
        - read:locations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: search
          in: query
          description: |
            lookup locations where search term match name,
            phone_number, email, organization_number and business_name
          schema:
            type: string
        - name: status
          in: query
          description: |
            filter locations by status
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: country
          in: query
          description: |
            filter locations by country
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: phone_number
          in: query
          description: |
            filter locations by phone_number
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: organization_number
          in: query
          description: |
            filter locations by organization_number
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: email
          in: query
          description: |
            filter locations by email
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: type
          in: query
          description: |
            filter locations by type
          explode: true
          schema:
            type: array
            items:
              type: string
      security:
        - JWT: []
      responses:
        '200':
          description: SalesLocation collection
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SalesLocationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Locations collection
          sidebarTitle: Locations collection
    post:
      operationId: aid_location_post
      summary: aid_location_post
      description: |
        Create a sales location
        scopes:
        - admin:locations
        - write:locations
      tags:
        - locations
      x-scopes:
        - admin:locations
        - write:locations
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    location_id:
                      type: string
                      maxLength: 255
                      description: |
                        The id you have defined for the sales location.
                        (must not have trailing or leading spaces). An
                        auto-generated location_id will be created if no location_id
                        is provided
                      example: S01923
                      readOnly: false
                - $ref: '#/components/schemas/SalesLocation'
        description: location to create
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: created an location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesLocationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new sales location
          sidebarTitle: Create new sales location
  /accounts/{aid}/locations/{lid}:
    get:
      operationId: aid_locations_lid_get
      summary: aid_locations_lid_get
      description: |
        Get single sales location
        scopes:
        - admin:locations
        - read:locations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: lid
          description: location id
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      tags:
        - locations
      x-scopes:
        - admin:locations
        - read:locations
      security:
        - JWT: []
      responses:
        '200':
          description: a single sales location details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesLocationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Location details
          sidebarTitle: Location details
    put:
      operationId: aid_location_lid_put
      summary: aid_location_lid_put
      description: |
        Update location properties
        scopes:
        - admin:locations
        - write:locations
      tags:
        - locations
      x-scopes:
        - admin:locations
        - write:locations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: lid
          description: location id
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/SalesLocation'
        description: Location update
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Location updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SalesLocationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Sales location
          sidebarTitle: Update Sales location
    delete:
      operationId: aid_location_lid_delete
      summary: aid_location_lid_delete
      description: |
        Delete single location
        scopes:
        - admin:locations
        - write:locations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: lid
          description: location id
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      tags:
        - locations
      x-scopes:
        - admin:locations
        - write:locations
      security:
        - JWT: []
      responses:
        '200':
          description: Location deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SalesLocationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete location
          sidebarTitle: Delete location
  /accounts/{aid}/search/external/organizations/{country}:
    get:
      operationId: aid_search_external_organizations_country
      summary: aid_search_external_organizations_country
      description: |
        Proxy queries to the Norwegian or Danish organization registry.

        Please note that the only supported countries currently are "no" (Norway)
        and "dk" (Denmark).

        scopes:
        - public
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/country'
        - name: name
          description: Search for organization
          in: query
          required: false
          schema:
            type: string
        - name: organization_number
          description: Search for organization
          in: query
          required: false
          schema:
            type: string
      tags:
        - organizations
      responses:
        '200':
          description: Organization search result collection
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SearchExternalOrganizationResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Search external organization registry
          sidebarTitle: Search external organization registry
  /accounts/{aid}/search/external/organizations/{country}/{organization_number}:
    get:
      operationId: aid_get_external_organizations
      summary: aid_get_external_organizations
      description: |
        scopes:
        - public
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/country'
        - name: organization_number
          description: Organization number to get addresses for
          in: path
          required: true
          schema:
            type: string
      tags:
        - organizations
      responses:
        '200':
          description: Organization search result collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/GetExternalOrganizationResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get addresses for organization number from external organization registry
          sidebarTitle: Get addresses for organization number from external organization registry
  /accounts/{aid}/search/external/postal_place/{country}/{postal_code}:
    get:
      operationId: aid_search_external_postal_place
      summary: aid_search_external_postal_place
      description: |
        Get postal place by country and postal code.

        scopes:
        - public
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: country
          description: |
            ISO 3166-1 country code
          in: path
          required: true
          schema:
            type: string
        - name: postal_code
          description: |
            Postal code
          in: path
          required: true
          schema:
            type: string
      tags:
        - addresses
      responses:
        '200':
          description: Result with postal_place
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostalPlaceResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Search external postal place
          sidebarTitle: Search external postal place
  /accounts/{aid}/search/external/address/{country}/validate:
    post:
      operationId: aid_search_external_validate_address
      summary: aid_search_external_validate_address
      description: |
        Validate the given address and return close matching alternative
        suggestions if the provided address was most likely wrong.

        scopes:
        - public
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: country
          description: |
            ISO 3166-1 country code
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Address'
                - required:
                    - postal_code
        description: |
          Address information, including the name of the address, the postal code,
          the postal place (city where the address is in), and the country.
      tags:
        - addresses
      responses:
        '200':
          description: Result with close matching alternative addresses if found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddressValidationResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Validate address
          sidebarTitle: Validate address
  /accounts/{aid}/automations/rules:
    post:
      operationId: aid_automations_rules_post
      summary: aid_automations_rules_post
      description: |
        Create a discount automation to apply on events received.


        A automation can be used to automate the task of
        giving discount to customers. The customer found in
        the event will receive the discount.

        ###
        Welcome discount: give discount to new user

            {
              "requirement": {
                "events": ["customer_add"],
                "automation_from": "2018-05-07T08:54:31Z",
                "automation_to": "2018-06-07T08:54:31Z"
              },
              "actions": [
                {
                  "type": "discount",
                  "id": "cae3e485-0e15-4afa-bc66-472f843efb84"
                }
              ]
            }

        ###
        Purchase discount: give discount on first purchase at store

            {
              "name": "purchase at store sc029",
              "requirement": {
                "events": ["receipt_add"],
                "automation_from": "2018-05-07T08:54:31Z",
                "automation_to": "2018-06-07T08:54:31Z",
                "filters": {
                  "$.store.id": ["sc029"]
                }
              },
              "actions": [
                {
                  "type": "discount",
                  "id": "cae3e485-0e15-4afa-bc66-472f843efb84"
                }
              ],
              "limitation": {
                "automation_repeat": 1
              }
            }

        scopes:
        - admin:automations
        - write:automations
      tags:
        - rules automations
      x-scopes:
        - admin:automations
        - write:automations
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Automation'
        description: Automation to create
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Automation created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Automation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new automation
          sidebarTitle: Create new automation
    get:
      operationId: aid_automations_rules_get
      summary: aid_automations_rules_get
      description: |
        Get available automations for the account

        scopes:
        - admin:automations
        - read:automations
      tags:
        - rules automations
      x-scopes:
        - admin:automations
        - read:automations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: state
          in: query
          description: |
            Indicate the state of the automation to return
          required: false
          schema:
            type: string
            enum:
              - all
              - available
              - deleted
            default: all
      security:
        - JWT: []
      responses:
        '200':
          description: Automation collection
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  allOf:
                    - $ref: '#/components/schemas/Entity'
                    - $ref: '#/components/schemas/Automation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Automation collection
          sidebarTitle: Automation collection
  /accounts/{aid}/automations/rules/{arid}:
    delete:
      operationId: aid_automations_rules_rid_delete
      summary: aid_automations_rules_rid_delete
      description: |
        Delete an automation rule.

        scopes:
        - admin:automations
        - write:automations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: arid
          description: An UUID that uniquely identifies the automation
          in: path
          required: true
          schema:
            type: string
            format: uuid
      tags:
        - rules automations
      x-scopes:
        - admin:automations
        - write:automations
      security:
        - JWT: []
      responses:
        '200':
          description: Automation deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Automation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete automation
          sidebarTitle: Delete automation
    get:
      operationId: aid_automations_rules_rid_get
      summary: aid_automations_rules_rid_get
      description: |
        Get details about an automations

        scopes:
        - admin:automations
        - read:automations
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: arid
          description: An UUID that uniquely identifies the automation
          in: path
          required: true
          schema:
            type: string
            format: uuid
      tags:
        - rules automations
      x-scopes:
        - admin:automations
        - read:automations
      security:
        - JWT: []
      responses:
        '200':
          description: Automation collection
          content:
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Automation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Automation details
          sidebarTitle: Automation details
  /accounts/{aid}/discounts/available_for_receipt:
    post:
      operationId: aid_discounts_available_for_receipt_post
      summary: aid_discounts_available_for_receipt_post
      description: |
        Find discounts available for the receipt

        ### Active discounts

        - `customer_id` will be used to find active discounts for the purchase.
        - `customer.token` will be used to resolve `customer_id` if no `customer_id` is provided.
        - No discounts will be given if the token does not resolve to any customer_id.
        - A receipt with no `customer_id` and no `customer.token` will only be applicable for
          active discounts given to **`/`**
          ([see](/discounts-api/rules-customers/aid_discounts_did_customers_post))

        ### Requirement of the receipt

          - all items must have `eligible_for_discount` set to enable for discount
          - all items must have a positive `gross_amount` to qualify for discount
          - a `net` base discount reward requires the receipt to include existing
            discounts as discount_lines (on item) in order to calculate net

        A receipt that qualified for discount will have the `is_change`
        property set to true. Any items that has received a discount will be
        flagged by `is_change` and have one or more new entries to its
        discount_lines.

        The receipt `discounts` list will be populated with all discounts the
        receipt is qualified to receive

        scopes:
        - admin:discounts
        - write:discounts
        - write:discounts:/available_for_receipt
      tags:
        - use discounts
      x-scopes:
        - admin:discounts
        - write:discounts
        - write:discounts:/available_for_receipt
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Receipt'
        description: receipt
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt with discount
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Receipt'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post receipt for discount
          sidebarTitle: Post receipt for discount
  /accounts/{aid}/discounts/available_for_receipt/claims:
    get:
      operationId: aid_discounts_available_for_receipt_get_claims
      summary: aid_discounts_available_for_receipt_get_claims
      description: |
        Get all claims, limited by parameters. The result will
        match all parameters with `AND`

        scopes:
        - admin:discounts
        - read:discounts
        - read:discounts:/available_for_receipt
      tags:
        - use discounts
      x-scopes:
        - admin:discounts
        - read:discounts
        - read:discounts:/available_for_receipt
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: ref
          description: filter claims by ref
          in: query
          required: false
          schema:
            type: string
        - name: customer_id
          description: filter claims by customer_id
          in: query
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/total'
      security:
        - JWT: []
      responses:
        '200':
          description: Claim collection
          headers:
            page-count:
              description: |
                count object in response
              schema:
                type: integer
            total-count:
              description: |
                total count, only set if query parameter
                `total` is set
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Claim'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Claim collections
          sidebarTitle: Claim collections
    post:
      operationId: aid_discounts_available_for_receipt_post_claim
      summary: aid_discounts_available_for_receipt_post_claim
      description: |
        Claim discount rewards, checks will be done to ensure that all
        discount limitation are uphold

        Note, only the following discount limitation will affect
        the success of a claim

          - discount_reward_usage
          - discount_repeat_usage

        scopes:
        - admin:discounts
        - write:discounts
        - write:discounts:/available_for_receipt
      tags:
        - use discounts
      x-scopes:
        - admin:discounts
        - write:discounts
        - write:discounts:/available_for_receipt
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Claim'
        description: discounts to claim
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: claim accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Claim'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Claim discounts
          sidebarTitle: Claim discounts
  /accounts/{aid}/discounts/available_for_receipt/claims/{claim_id}:
    delete:
      operationId: aid_discounts_available_for_receipt_delete_claim
      summary: aid_discounts_available_for_receipt_delete_claim
      description: |
        Release claim on discounts, revert previously claimed discount
        and make them available for future purchase

        scopes:
        - admin:discounts
        - write:discounts
        - write:discounts:/available_for_receipt
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: claim_id
          description: |
            A string that uniquely identifies claim
          in: path
          required: true
          schema:
            type: string
      tags:
        - use discounts
      x-scopes:
        - admin:discounts
        - write:discounts
        - write:discounts:/available_for_receipt
      security:
        - JWT: []
      responses:
        '200':
          description: claim deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Claim'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete claim
          sidebarTitle: Delete claim
    get:
      operationId: aid_discounts_available_for_receipt_get_claim
      summary: aid_discounts_available_for_receipt_get_claim
      description: |
        Get details about a claim

        scopes:
        - admin:discounts
        - read:discounts
        - read:discounts:/available_for_receipt
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: claim_id
          description: |
            A string that uniquely identifies claim
          in: path
          required: true
          schema:
            type: string
      tags:
        - use discounts
      x-scopes:
        - admin:discounts
        - read:discounts
        - read:discounts:/available_for_receipt
      security:
        - JWT: []
      responses:
        '200':
          description: claim details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Claim'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get claim
          sidebarTitle: Get claim
  /accounts/{aid}/discounts/campaigns:
    post:
      operationId: aid_discounts_campaigns_post
      summary: aid_discounts_campaigns_post
      description: |
        Create a new campaign to group discount rules

        scopes:
        - admin:discounts
        - write:discounts
      tags:
        - campaigns
      x-scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Campaign'
        description: Campaign to create
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Campaign created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new campaign
          sidebarTitle: Create new campaign
    get:
      operationId: aid_discounts_campaigns_get
      summary: aid_discounts_campaigns_get
      description: |
        List campaigns

        scopes:
        - admin:discounts
        - read:discounts
      tags:
        - campaigns
      x-scopes:
        - admin:discounts
        - read:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: state
          in: query
          description: |
            Indicate the state of the campaign to return
          required: false
          schema:
            type: string
            enum:
              - all
              - public
              - private
              - deleted
            default: all
      security:
        - JWT: []
      responses:
        '200':
          description: Campaign collection
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Campaigns collection
          sidebarTitle: Campaigns collection
  /accounts/{aid}/discounts/campaigns/{campaign_id}:
    get:
      operationId: aid_discounts_campaigns_campaign_id_get
      summary: aid_discounts_campaigns_campaign_id_get
      description: |
        Get more details about a campaign

        scopes:
        - admin:discounts
        - read:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      tags:
        - campaigns
      x-scopes:
        - admin:discounts
        - read:discounts
      security:
        - JWT: []
      responses:
        '200':
          description: Campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Campaign details
          sidebarTitle: Campaign details
    put:
      operationId: aid_discounts_campaigns_campaign_id_put
      summary: aid_discounts_campaigns_campaign_id_put
      description: |
        Update campaign details. Undeletes a deleted campaign.

        scopes:
        - admin:discounts
        - write:discounts
      tags:
        - campaigns
      x-scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                private:
                  description: |
                    The campaign is private and will be excluded from public rules
                    when filtered by campaign_id

                    [GET /discounts/public/rules](/discounts-api/rules/aid_discounts_public_get)
        description: Campaign properties to update
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Campaign Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Campaign
          sidebarTitle: Update Campaign
    delete:
      operationId: aid_discounts_campaigns_campaign_id_delete
      summary: aid_discounts_campaigns_campaign_id_delete
      description: |
        Delete a campagn.

        Deleting a campagn does not affect its discount rules. i.e. active
        campagn rules will continue to be active after deleting the campagn

        scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      tags:
        - campaigns
      x-scopes:
        - admin:discounts
        - write:discounts
      security:
        - JWT: []
      responses:
        '200':
          description: Campaign deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete campagn
          sidebarTitle: Delete campagn
  /accounts/{aid}/discounts/customers/{customer_id}/refs/{ref_id}:
    post:
      operationId: aid_discounts_customer_cid_post_ref_id
      summary: aid_discounts_customer_cid_post_ref_id
      description: |
        Add stamps and usage to a discount ref.
        scopes:
        - admin:discounts
        - write:discounts
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: ref_id
          description: |
            A string that uniquely identifies a customer discount reference
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                usage_ref:
                  $ref: '#/components/schemas/UsageRefWrite'
        description: update usage, stamps and amount
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Discount ref updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Discount'
                  - $ref: '#/components/schemas/Statistics'
                  - properties:
                      ref_id:
                        type: string
                        description: |
                          customer reference to the discount, a customer may have multiple
                          references to a discount (discount given to customer multiple times)
        '400':
          description: Update invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Discount ref not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update customer discount ref
          sidebarTitle: Update customer discount ref
    get:
      operationId: aid_discounts_customer_cid_get_ref_id
      summary: aid_discounts_customer_cid_get_ref_id
      description: |
        Get a customer discount ref.
        scopes:
        - admin:discounts
        - read:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: ref_id
          description: |
            A string that uniquely identifies a customer discount reference
          in: path
          required: true
          schema:
            type: string
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - write:discounts
      security:
        - JWT: []
      responses:
        '200':
          description: Discount ref
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Discount'
                  - $ref: '#/components/schemas/CustomerDiscountStatistics'
                  - properties:
                      ref_id:
                        type: string
                        description: |
                          customer reference to the discount, a customer may have multiple
                          references to a discount (discount given to customer multiple times)
        '400':
          description: Discount ref already deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Discount ref not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get customer discount ref
          sidebarTitle: Get customer discount ref
    delete:
      operationId: aid_discounts_customer_cid_delete_ref_id
      summary: aid_discounts_customer_cid_delete_ref_id
      description: |
        Delete a customer discount ref. The discount will no longer
        be available on purchase ([Post receipt for discount](/discounts-api/use-discounts/aid_discounts_available_for_receipt_post))

        scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - name: ref_id
          description: |
            A string that uniquely identifies a customer discount reference
          in: path
          required: true
          schema:
            type: string
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - write:discounts
      security:
        - JWT: []
      responses:
        '200':
          description: Discount ref deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Discount'
                  - $ref: '#/components/schemas/Statistics'
                  - properties:
                      ref_id:
                        type: string
                        description: |
                          customer reference to the discount, a customer may have multiple
                          references to a discount (discount given to customer multiple times)
                      debit_balance:
                        type: integer
                        readOnly: true
                        description: |
                          **deprecated** The debit balance, only set if the discount reward
                          type is `discount_debit`. The balance is the amount
                          vailable for discount on a future purchase. Inital value
                          is the discount reward value.
        '400':
          description: Discount ref already deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Discount ref not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete customer discount ref
          sidebarTitle: Delete customer discount ref
  /accounts/{aid}/discounts/customers/{customer_id}/rules:
    get:
      operationId: aid_discounts_customer_cid_get
      summary: aid_discounts_customer_cid_get
      description: |
        Get all discounts available for a customer, result will exclude
        expired and inactive discounts


        Expired discounts are:

          - discount used up (customer has allready used it) and there
            was a limitation on the discount that prevents more use.
          - discount requirement purchase periode is in the past
          - discount that has been deleted

        Inactive discounts are:

          - discount with `active` property set to false.

        Use value of `ref_id` as parameter value of `starting_after`

        scopes:
        - admin:discounts
        - read:discounts
        - user:discounts
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - read:discounts
        - user:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      security:
        - JWT: []
      responses:
        '200':
          description: Customer discount collection
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  allOf:
                    - $ref: '#/components/schemas/Discount'
                    - $ref: '#/components/schemas/CustomerDiscountStatistics'
                    - properties:
                        ref_id:
                          type: string
                          description: |
                            customer reference to the discount, a customer may have multiple
                            references to a discount (discount given to customer multiple times)
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Customer discounts collection
          sidebarTitle: Customer discounts collection
  /accounts/{aid}/discounts/events:
    post:
      operationId: aid_discounts_events_post
      summary: aid_discounts_events_post
      description: |
        Send an Event to the service.

        - rules automations will receive the event and give
          its discount to the customer found in the event


        - Token received will be stored to support resolving
          customer from token when handling discounts available
          for receipt

          scopes:
          - admin:discounts
          - write:discounts
          - write:discounts:/events
      tags:
        - use discounts
      x-scopes:
        - admin:discounts
        - write:discounts
        - write:discounts:/events
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: event
          description: The event type that was sent
          in: header
          required: true
          schema:
            type: string
            enum:
              - token_add
              - token_remove
              - receipt_add
        - name: event-delivery
          description: |
            UUID to identify the payload and event
            being sent.
          in: header
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Event'
        description: |
          The event payload, e.g. a Customer, Receipt or Token
        required: true
      security:
        - JWT: []
      responses:
        '204':
          description: Event processed
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post event
          sidebarTitle: Post event
  /accounts/{aid}/discounts/public/rules:
    get:
      operationId: aid_discounts_public_get
      summary: aid_discounts_public_get
      description: |
        Get all discounts available for any customer given
        current date, result will exclude expired and inactive
        discounts

        Use value of `ref_id` as parameter value of `starting_after`

        scopes:
        - admin:discounts
        - read:discounts
        - public:discounts
      tags:
        - rules
      x-scopes:
        - admin:discounts
        - read:discounts
        - public:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: no_customer_id
          in: query
          description: |
            List rules available for purchase where no customer id is
            provided.
          schema:
            type: boolean
            default: false
        - name: campaign_id
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
      security:
        - JWT: []
      responses:
        '200':
          description: Public Discount collection
          content:
            application/json:
              schema:
                type: array
                items:
                  allOf:
                    - $ref: '#/components/schemas/Discount'
                    - properties:
                        ref_id:
                          type: string
                          description: |
                            public reference to the discount, a public
                            discount may be given to all customer several times
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Public Discount collection
          sidebarTitle: Public Discount collection
  /accounts/{aid}/discounts/rules:
    post:
      operationId: aid_discounts_post
      summary: aid_discounts_post
      description: |
        Create a new discount for an account.

        A new discount will be **unavailable** for purchases
        until the discount is given to one or more customer.

        Discount can be given to a customer by either adding
        a automation to the discount that will grant the
        discount to the customer from events received or by
        adding customers to the discount.

        See [Discount Examples](#section/Discount-Examples)

        scopes:
        - admin:discounts
        - write:discounts
      tags:
        - rules
      x-scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Discount'
        description: Discount to create
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Discount created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new discount
          sidebarTitle: Create new discount
    get:
      operationId: aid_discounts_get
      summary: aid_discounts_get
      description: |
        List discounts available for the account
        scopes:
        - admin:discounts
        - read:discounts
      tags:
        - rules
      x-scopes:
        - admin:discounts
        - read:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: since_datetime
          description: |
            Only discounts added/updated/delete at or after this time is returned.
            NOTE: this parameter can't be combined with `starting_after` parameter.
            Retrieve next page by updating since_datetime to the latest
            updated_at value found in the result.
          in: query
          schema:
            type: string
            format: date-time
        - name: purchase_from
          description: |
            Only discounts with requirement purchase_from at or after this time is returned.
          in: query
          schema:
            type: string
            format: date-time
        - name: purchase_to
          description: |
            Only discounts with requirement purchase_to at or before this time is returned.
          in: query
          schema:
            type: string
            format: date-time
        - name: state
          in: query
          description: |
            Indicate the state of the discounts to return

            - **active**: purchase range is within current timestamp
            - **scheduled**: purchase range is in the future
            - **completed**: purchase range is in the past
            - **available**: active and not deleted
            - **deleted**: discount have been deleted
            - **inactive**: active is set to false
          required: false
          schema:
            type: string
            enum:
              - all
              - active
              - scheduled
              - completed
              - available
              - deleted
              - inactive
            default: all
        - name: campaign_id
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: include
          description: |
            Additional fields to include for each discount
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - statistics
      security:
        - JWT: []
      responses:
        '200':
          description: Discount collection
          content:
            application/json:
              schema:
                type: array
                items:
                  allOf:
                    - $ref: '#/components/schemas/Discount'
                    - $ref: '#/components/schemas/Statistics'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Discount collection
          sidebarTitle: Discount collection
  /accounts/{aid}/discounts/rules/{did}:
    get:
      operationId: aid_discounts_did_get
      summary: aid_discounts_did_get
      description: |
        Get more details about a discount, includes statistics
        about the discount
        scopes:
        - admin:discounts
        - read:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/discountId'
      tags:
        - rules
      x-scopes:
        - admin:discounts
        - read:discounts
      security:
        - JWT: []
      responses:
        '200':
          description: Discount
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Discount'
                  - $ref: '#/components/schemas/Statistics'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Discount details
          sidebarTitle: Discount details
    put:
      operationId: aid_discounts_did_put
      summary: aid_discounts_did_put
      description: |
        Update discount details.


        **Caution**: Update of non-meta properties, properties that
        changes requirement or limitation can create conflict with
        the usage history of the discount.

        Example is to change requirement.item.items, such change would
        mean that purchases before the change would not be correcly
        rewarded given the new version of the discount.

        We recomment to limit the update of a discount to meta only
        properties if the discount has previously been used in a
        purchase.

        Update on requirement `purchase_to` is only supported when
        the new value that is after current value.

        Update of requirement `purchase_from` and `reward` is not supported.

        Update `discount.active` to toggle if an discount is active
        and available for purchase.

        Update `discount.private` to toggle if an discount is included
        in public discount collection if given to all customers

        scopes:
        - admin:discounts
        - write:discounts
      tags:
        - rules
      x-scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/discountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                campaign_id:
                  description: |
                    The campaign the rule belongs to, use `null` to remove
                    the rule from the campaign.
                  nullable: true
                  type: string
                active:
                  description: |
                    the discount is active and can be available
                    for purchase
                  type: boolean
                  default: true
                private:
                  description: |
                    the discount is private and will not be included in
                    public discount collection
                  type: boolean
                  example: false
                links:
                  $ref: '#/components/schemas/Links'
                limitation:
                  $ref: '#/components/schemas/Limitation'
                requirement:
                  allOf:
                    - $ref: '#/components/schemas/BaseRequirement'
                    - properties:
                        purchase_to:
                          type: string
                          format: date-time
                          description: |
                            New value must be after current
                reward:
                  type: object
                  properties:
                    base:
                      $ref: '#/components/schemas/RewardBase'
                description:
                  type: string
                  example: Gjør et Stablestol kupp!
                metadata:
                  type: object
                  maxProperties: 10
                  description: |
                    Additional metadata about the discount
                  example:
                    campaign_id: V101
                    is_featured: true
                name:
                  type: string
                  example: Spar 100,-
                receipt_text:
                  type: string
                  description: |
                    Text that should be used when displaying
                    the discount, e.g. on receipt
                  example: Mai Salg
        description: Discount properties to update
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Discount Updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Discount'
                  - $ref: '#/components/schemas/Statistics'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Discount
          sidebarTitle: Update Discount
    delete:
      operationId: aid_discounts_did_delete
      summary: aid_discounts_did_delete
      description: |
        Delete a discount

        - Customer that has previously received the discount will not
          be able to use it on purchases.
        - rules automations belonging to the discount will be deleted

        scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/discountId'
      tags:
        - rules
      x-scopes:
        - admin:discounts
        - write:discounts
      security:
        - JWT: []
      responses:
        '200':
          description: Discount deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Statistics'
                  - $ref: '#/components/schemas/Discount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete discount
          sidebarTitle: Delete discount
  /accounts/{aid}/discounts/rules/{did}/customers:
    post:
      operationId: aid_discounts_did_customers_post
      summary: aid_discounts_did_customers_post
      description: |
        Give the Discount to one or more customers

        scopes:
        - admin:discounts
        - write:discounts
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/discountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customers
              properties:
                offering_constraint_id:
                  type: string
                  description: |
                    Use the `offering_constraint_id` to limit customers
                    to only receive the discount once for a given `offering_constraint_id` value.
                    i.e. a customer that is given the same discounts in multiple requests
                    with the same offering_constraint_id will only have one discount available.
                  example: stamp-2020
                customers:
                  type: array
                  description: |
                    Array of customer IDs (must not have trailing or leading spaces)

                    Following values are reserved:

                    - **`*`** give the discount to purchase with *any `customer_id`*.
                    - **`/`** give the discount to purchase with *no `customer_id`*.
                  items:
                    type: string
                    example: 12397af6e5e
        description: |
          Customers to give the discount to
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Discount added to customers
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Statistics'
                  - $ref: '#/components/schemas/Discount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Add customers
          sidebarTitle: Add customers
    get:
      operationId: aid_discounts_did_customers_get
      summary: aid_discounts_did_customers_get
      description: |
        Get list of customers refs for a discount. A ref is an instant
        of discount given to a customer or `all customers`. See
        [Add customers](/discounts-api/rules-customers/aid_discounts_did_customers_post)

        scopes:
        - admin:discounts
        - read:discounts
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - read:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/discountId'
        - name: limit
          in: query
          description: |
            A limit on the number of refs to be returned. Limit can range
            between 1 and 1000, the default is 10 items.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 10
        - $ref: '#/components/parameters/startingAfter'
        - name: state
          description: |
            limit by state of customer ref, note, a customer ref will continue to be active after the discount has been deleted.
            Use state `inactive` to list all discount where active is set to false.
          in: query
          required: false
          schema:
            type: string
            enum:
              - all
              - available
              - deleted
              - inactive
            default: all
      security:
        - JWT: []
      responses:
        '200':
          description: Discount customers (refs)
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  description: |
                    Array of customer refs
                  allOf:
                    - $ref: '#/components/schemas/Entity'
                    - properties:
                        customer_id:
                          type: string
                          description: |
                            customer id for the ref. The customer_id will be
                            null if the ref originated from giving the discount to
                            all customers (wilcard '**`*`**')
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get discount customers (refs)
          sidebarTitle: Get discount customers (refs)
    delete:
      operationId: aid_discounts_did_customers_delete
      summary: aid_discounts_did_customers_delete
      description: |
        Remove Discount from one or more customers

        scopes:
        - admin:discounts
        - write:discounts
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - write:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/discountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customers
              properties:
                customers:
                  type: array
                  items:
                    type: string
                    description: |
                      Array of customer IDs, use `"*"` to remove discounts from
                      all users. (must not have trailing or leading spaces)
                    example: 102997af6e5e
        description: |
          Customers to give the discount to
          ###
          Use value '**`*`**' to remove the discounts from all customers
          ###
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Discount deleted from customers
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Statistics'
                  - $ref: '#/components/schemas/Discount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Remove customers
          sidebarTitle: Remove customers
  /accounts/{aid}/discounts/rules/{did}/usages:
    get:
      operationId: aid_discounts_did_usages_get
      summary: aid_discounts_did_usages_get
      description: |
        Get list of discount refs usages.
        scopes:
        - admin:discounts
        - read:discounts
      tags:
        - rules customers
      x-scopes:
        - admin:discounts
        - read:discounts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/discountId'
        - name: limit
          in: query
          description: |
            A limit on the number of refs to be returned. Limit can range
            between 1 and 1000, the default is 10 items.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 10
        - $ref: '#/components/parameters/startingAfter'
      security:
        - JWT: []
      responses:
        '200':
          description: Discount usages
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DiscountUsage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get discount ref usages
          sidebarTitle: Get discount ref usages
  /account/user:
    get:
      operationId: account_user_get
      summary: account_user_get
      description: |
        Get public and private profile information when authenticated
        through Bearer auth

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

        scopes:
        - openid
        - aws.cognito.signin.user.admin
      x-scopes:
        - openid
        - aws.cognito.signin.user.admin
      tags:
        - account users
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AuthenticatedAccountUserResponse'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Authenticated User
          sidebarTitle: Authenticated User
  /account/user/mfa/sms:
    put:
      operationId: account_user_mfa_sms_put
      summary: account_user_mfa_sms_put
      description: |
        Update the user SMS MFA configuration
      x-scopes:
        - openid
        - aws.cognito.signin.user.admin
      tags:
        - account users
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                phone_number:
                  type: string
                  pattern: ^\+?\d{5,15}$
                  description: |
                    mobile number of a person / company, ITU/E.123 format with
                    international prefix (+PPNNNNNNNNN...)

                    **required** when enabling SMS MFA
                enabled:
                  type: boolean
        required: true
      responses:
        '201':
          description: Accepted
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Configure SMS MFA
          sidebarTitle: Configure SMS MFA
  /account/user/password:
    post:
      operationId: account_user_password_put
      summary: account_user_password_put
      description: |
        Change the password for the account user

        scopes:
        - openid
      x-scopes:
        - openid
      tags:
        - account users
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - previous_password
                - proposed_password
              properties:
                previous_password:
                  type: string
                proposed_password:
                  type: string
      security:
        - JWT: []
      responses:
        '201':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Change User password
          sidebarTitle: Change User password
  /accounts/{aid}/auth/mfa/challenge:
    post:
      operationId: aid_auth_mfa_challenge_post
      summary: aid_auth_mfa_challenge_post
      description: |
        Request a challenge for multi-factor authentication (MFA) based
        on the challenge types supported by the user.

        The challenge_type is how the user will get the challenge
        and prove possession. Supported challenge types include:

          - `oob`: for SMS messages or out-of-band (OOB)

        Use the response to request access token from the
        [auth/token](/api-reference/authenticate/aid_auths_oauth_token_post) endpoint
        with `grant_type=mfa_oob`

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/mfa
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/mfa
      tags:
        - challenge
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthChallenge'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/MfaChallengeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Challenge request
          sidebarTitle: Challenge request
  /accounts/{aid}/auth/mfa/recovery:
    post:
      operationId: aid_auth_mfa_recovery_post
      summary: aid_auth_mfa_recovery_post
      description: |
        Request a recovery for user with multi-factor
        authentication (MFA) enabled.

        A recovery is done with two out-of-band (OOB) challenges
        over different channels.

        Use the response to request access token from the
        [auth/token](/api-reference/authenticate/aid_auths_oauth_token_post) endpoint
        with `grant_type=mfa_oob`.

        A `403 status` with `mfa_required` error will be returned on success,
        use the response to request a new challenge from the
        [auth/mfa/challenge](/management-auth-api/challenge/aid_auth_mfa_challenge_post) endpoint.

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/mfa
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/mfa
      tags:
        - challenge
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Challenge'
                - required:
                    - username
                    - audience
                  properties:
                    username:
                      type: string
                      description: The end user's identifier.
                    audience:
                      type: string
                      example: https://api.dintero.com/v1/accounts/P00000000
                      description: |
                        The unique identifier of the target API you want to access.
                        The audience must be a grant associated with the client used
                        in the request
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/MfaRecoveryResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Recovery
          sidebarTitle: Recovery
  /accounts/{aid}/auth/users:
    post:
      operationId: aid_auth_users_post
      summary: aid_auth_users_post
      description: |
        Create a new user

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
      tags:
        - auth users
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - $ref: '#/components/schemas/AuthenticatedUser'
                - required:
                    - password
                  properties:
                    password:
                      type: string
                      description: The user's password
                      minLength: 8
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/UserCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create User
          sidebarTitle: Create User
  /accounts/{aid}/auth/users/{username}:
    put:
      operationId: aid_auth_users_username_put
      summary: aid_auth_users_username_put
      description: |
        Update existing user with new password

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
      tags:
        - auth users
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: username
          description: |
            Username identifying the user
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - required:
                    - password
                  properties:
                    password:
                      type: string
                      description: The user's password
                      minLength: 8
                    links:
                      $ref: '#/components/schemas/AuthUserLinks'
                    mfa:
                      $ref: '#/components/schemas/AuthUserMfa'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/UserUpdated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update user
          sidebarTitle: Update user
    delete:
      operationId: aid_auth_users_username_delete
      summary: aid_auth_users_username_delete
      description: |
        Delete existing user

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
      tags:
        - auth users
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: username
          description: |
            Username identifying the user
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/UserDeleted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete user
          sidebarTitle: Delete user
  /accounts/{aid}/auth/users/{username}/change_username:
    post:
      operationId: aid_auth_users_username_change_username_post
      summary: aid_auth_users_username_change_username_post
      description: |
        Update existing users username

        scopes:
        - admin:accounts
      x-scopes:
        - admin:accounts
      tags:
        - auth users
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: username
          description: |
            Username identifying the user
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - required:
                    - username
                  properties:
                    username:
                      type: string
                      description: The user's new usernname
                      minLength: 1
                      maxLength: 255
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/UserUpdated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Change username
          sidebarTitle: Change username
  /accounts/{aid}/management/assets:
    post:
      operationId: aid_account_assets_post
      summary: aid_account_assets_post
      description: |
        Create an upload URL that can be used to transfere the asset

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/assets
        - write:dintero:/management/accounts
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/assets
        - write:dintero:/management/accounts
      tags:
        - account-assets
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - size_bytes
                - mime_type
              properties:
                size_bytes:
                  type: integer
                  minimum: 1
                  maximum: 2000000
                  description: Size in bytes of the asset file to be uploaded.
                mime_type:
                  type: string
                  description: MIME type of the asset to be uploaded
                  enum:
                    - image/png
                    - image/jpeg
                    - application/pdf
                    - application/vnd.ms-excel
                    - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                    - text/csv
                access:
                  type: string
                  description: Who can access the file?
                  enum:
                    - private
                    - public
                  default: public
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AssetUploadUrl'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create asset upload url
          sidebarTitle: Create asset upload url
  /accounts/{aid}/management/settings:
    put:
      operationId: aid_account_settings_put
      summary: aid_account_settings_put
      description: |
        Update account settings

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-settings
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                company:
                  $ref: '#/components/schemas/AccountCompany'
                billing:
                  $ref: '#/components/schemas/AccountBilling'
                services:
                  type: object
                  properties:
                    checkout:
                      type: object
                      required:
                        - features
                      properties:
                        features:
                          $ref: '#/components/schemas/CheckoutServiceFeaturesRequest'
                    payout:
                      required:
                        - features
                      properties:
                        features:
                          $ref: '#/components/schemas/PayoutServiceFeaturesRequest'
                onboarding:
                  $ref: '#/components/schemas/AccountOnboarding'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/AccountResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Account Settings
          sidebarTitle: Update Account Settings
    get:
      operationId: aid_account_aid_get
      summary: aid_account_aid_get
      description: |
        Get details about the account

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-settings
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Account settings
          sidebarTitle: Get Account settings
  /accounts/{aid}/management/settings/approvals/payments:
    get:
      operationId: aid_management_settings_approvals_payment_get
      summary: aid_management_settings_approvals_payment_get
      description: |

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - approvals
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: case_status
          description: |
            filter CDDs by status
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - ACTIVE
                - DECLINED
                - UNDER_MANUAL_REVIEW
                - AUTOMATIC_REVIEW
                - WAITING_FOR_SIGNATURE
                - WAITING_FOR_DECLARATION
                - ERROR
                - ARCHIVED
                - WAITING_FOR_DETAILS
                - TERMINATED
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ApprovalsPaymentList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List payment approvals
          sidebarTitle: List payment approvals
    post:
      operationId: aid_management_settings_approvals_payment_post
      summary: aid_management_settings_approvals_payment_post
      description: |
        Initiate an application for using Dintero payments . The application
        will contain a link to an URL where the signatory of the account will need
        to finish submission of the case contract and sign it. Dintero will perform
        a KYC, AML and bank ownership check before the application
        `case_status`will be updated to `ACTIVE`. Once the application is approved
        we will set up your account for using Dintero payments. Note that not all
        payment methods are available in all countries, and that for some payments
        methods some processing time must be expected before you can start accepting
        payments.

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/management/settings/approvals
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/management/settings/approvals
      tags:
        - approvals
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalsPayment'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/ApprovalsPaymentCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: New payment approval
          sidebarTitle: New payment approval
  /accounts/{aid}/management/settings/approvals/payout-destinations:
    get:
      operationId: aid_management_settings_approvals_payout_destinations_get
      summary: aid_management_settings_approvals_payout_destinations_get
      description: |

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

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

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

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

        NOTE: This behavior is only available in test mode, i.e. with an `aid` prefixed with "T".
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/management/settings/approvals
      tags:
        - approvals
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalsPayoutDestination'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/ApprovalsPayoutDestinationCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      servers:
        - url: https://api.dintero.com/v1
      x-mint:
        metadata:
          title: New seller approval
          sidebarTitle: New seller approval
  /accounts/{aid}/management/settings/cdd/cases:
    get:
      operationId: aid_management_settings_cdd_cases_get
      summary: aid_management_settings_cdd_cases_get
      description: |

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-cdd
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: products
          description: |
            filter CDDs by product
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - payout
                - checkout
        - name: payout_destination_id
          description: |
            filter CDDs by payout_destination_id, use * as a wildcard
          in: query
          required: false
          schema:
            type: string
        - name: case_status
          description: |
            filter CDDs by status
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - ACTIVE
                - DECLINED
                - UNDER_MANUAL_REVIEW
                - AUTOMATIC_REVIEW
                - WAITING_FOR_SIGNATURE
                - WAITING_FOR_DECLARATION
                - ERROR
                - ARCHIVED
                - WAITING_FOR_DETAILS
                - TERMINATED
        - name: actions_on_approval
          description: |
            filter CDDs by actions to take on approval
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - enable_payout_account
                - enable_checkout_account
                - create_payout_destination
        - name: includes
          in: query
          description: |
            Include aditional data in the returned data that are by default excluded
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - events.case.contracts
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/CustomerDueDiligenceList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get list of due diligence cases
          sidebarTitle: Get list of due diligence cases
    post:
      operationId: aid_management_settings_cdd_cases_post
      summary: aid_management_settings_cdd_cases_post
      description: |

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-cdd
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerDueDiligenceCase'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/CustomerDueDiligenceCaseCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create a due diligence case
          sidebarTitle: Create a due diligence case
  /accounts/{aid}/management/settings/cdd/cases/{id}/callback:
    post:
      operationId: aid_management_settings_cdd_cases_callback
      summary: aid_management_settings_cdd_cases_callback
      description: |
        Performs a GET on CDD Service to get the updated case (ignores body).
      tags:
        - account-cdd
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: id
          description: Case ID
          in: path
          required: true
          schema:
            type: string
        - name: signature
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Post updated case
          sidebarTitle: Post updated case
  /accounts/{aid}/management/settings/connections/mastercard-3ds:
    post:
      operationId: aid_account_settings_connections_mastercard_3ds_post
      summary: aid_account_settings_connections_mastercard_3ds_post
      description: |
        Enrol the merchant into 3D-Secure for Mastercard
        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/Mastercard3DSConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/Mastercard3DSConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Mastercard 3D-Secure signup
          sidebarTitle: Mastercard 3D-Secure signup
    get:
      operationId: aid_account_settings_connections_mastercard_3ds_get
      summary: aid_account_settings_connections_mastercard_3ds_get
      description: |
        Check status for enrolling the merchant into 3D-Secure for Mastercard
        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: sync
          in: query
          required: false
          description: |
            Use this parameter to check the status of the enrollment in the 3rd party system and update
            the status in the Dintero system.
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/Mastercard3DSConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Mastercard 3D-Secure signup status
          sidebarTitle: Get Mastercard 3D-Secure signup status
  /accounts/{aid}/management/settings/connections/bambora-payfac:
    post:
      operationId: aid_account_settings_connections_bambora_payfac_post
      summary: aid_account_settings_connections_bambora_payfac_post
      description: |
        Initialize Bambora PayFac signup

        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: force_new_signup
          in: query
          description: |
            Will allow signing up again even if there are previous pending signups.
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/BamboraPayFacConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/BamboraConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Bambora PayFac signup
          sidebarTitle: Bambora PayFac signup
  /accounts/{aid}/management/settings/connections/bambora:
    post:
      operationId: aid_account_settings_connections_bambora_post
      summary: aid_account_settings_connections_bambora_post
      description: |
        **DEPRECATED** 

        Old signup for bambora. Please use Bambora Direct or Bambora Payfac for new signups.

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/BamboraConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/BamboraConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Bambora signup
          sidebarTitle: Bambora signup
    get:
      operationId: aid_account_settings_connections_bambora_get
      summary: aid_account_settings_connections_bambora_get
      description: |
        Get details about the Bambora configuration

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/BamboraConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Bambora signup status
          sidebarTitle: Get Bambora signup status
  /accounts/{aid}/management/settings/connections/bambora/{callback_reference}:
    post:
      operationId: aid_account_settings_connections_bambora_callback_post
      summary: aid_account_settings_connections_bambora_callback_post
      description: |
        Handle callback from Bambora signup

        Completes the Bambora signup, enables Bambora for Checkout

        scopes:
        - write:accounts:/management/settings/connections/bambora
        - write:accounts
      x-scopes:
        - write:accounts:/management/settings/connections/bambora
        - write:accounts
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: callback_reference
          in: path
          required: true
          description: Authorization header Bearer JWT payload `sub`
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BamboraConnectionCallback'
        required: true
      responses:
        '200':
          description: Signup
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Bambora Callback
          sidebarTitle: Bambora Callback
  /accounts/{aid}/management/settings/connections/collector:
    post:
      operationId: aid_account_settings_connections_collector_post
      summary: aid_account_settings_connections_collector_post
      description: |
        Initialize Collector Bank signup

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/CollectorConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/CollectorConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Collector Bank signup
          sidebarTitle: Collector Bank signup
    get:
      operationId: aid_account_settings_connections_collector_get
      summary: aid_account_settings_connections_collector_get
      description: |
        Get details about the Collector Bank configuration

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/CollectorConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Collector Bank signup status
          sidebarTitle: Get Collector Bank signup status
  /accounts/{aid}/management/settings/connections/collector/{callback_reference}:
    post:
      operationId: aid_account_settings_connections_collector_callback_post
      summary: aid_account_settings_connections_collector_callback_post
      description: |
        Handle callback from Collector Bank signup

        Completes the Collector Bank signup, enables Collector Bank for Checkout

        scopes:
        - write:accounts:/management/settings/connections/collector
        - write:accounts
        - admin:dintero
      x-scopes:
        - write:accounts:/management/settings/connections/collector
        - write:accounts
        - admin:dintero
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: callback_reference
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectorConnectionCallback'
        required: true
      responses:
        '200':
          description: Signup
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Collector Bank Callback
          sidebarTitle: Collector Bank Callback
  /accounts/{aid}/management/settings/connections/common:
    post:
      operationId: aid_account_settings_connections_common_post
      summary: aid_account_settings_connections_common_post
      description: |
        Initialize Common signup

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  allOf:
                    - $ref: '#/components/schemas/CommonConnectionSignup'
                    - type: object
                      properties:
                        applicant:
                          type: object
                          properties:
                            social_security_number:
                              maxLength: 11
                              minLength: 11
                              type: string
                              description: |
                                The social security number of the applicant. Only
                                needed for Vipps.
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/CommonConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Common signup
          sidebarTitle: Common signup
    get:
      operationId: aid_account_settings_connections_common_get
      summary: aid_account_settings_connections_common_get
      description: |
        Get details about the Common configuration

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/CommonConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Common signup status
          sidebarTitle: Get Common signup status
  /accounts/{aid}/management/settings/connections/common/signup:
    post:
      operationId: aid_account_settings_connections_common_signup_url_post
      summary: aid_account_settings_connections_common_signup_url_post
      description: |
        Endpoint used by the Dintero Onboarding Team, get link to the common
        configuration signup object.

        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          description: Common connection
          content:
            application/json:
              schema:
                type: object
                properties:
                  ref:
                    description: Temporary link to signup object
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get link to the Common signup object with sensitive signup data
          sidebarTitle: Get link to the Common signup object with sensitive signup data
  /accounts/{aid}/management/settings/connections/instabank:
    post:
      operationId: aid_account_settings_connections_instabank_post
      summary: aid_account_settings_connections_instabank_post
      description: |
        Initialize Instabank signup

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/InstabankConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/InstabankConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Instabank signup
          sidebarTitle: Instabank signup
    get:
      operationId: aid_account_settings_connections_instabank_get
      summary: aid_account_settings_connections_instabank_get
      description: |
        Get details about the Instabank

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/InstabankConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Instabank signup status
          sidebarTitle: Get Instabank signup status
  /accounts/{aid}/management/settings/connections/instabank/{callback_reference}:
    post:
      operationId: aid_account_settings_connections_instabank_callback_post
      summary: aid_account_settings_connections_instabank_callback_post
      description: |
        Handle callback from Instabank signup

        Completes the Instabank signup, enables Instabank for Checkout

        scopes:
        - write:accounts:/management/settings/connections/instabank
      x-scopes:
        - write:accounts:/management/settings/connections/instabank
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: callback_reference
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstabankConnectionCallback'
        required: true
      responses:
        '202':
          description: Callback handled
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Instabank Callback
          sidebarTitle: Instabank Callback
  /accounts/{aid}/management/settings/connections/klarna:
    post:
      operationId: aid_account_settings_connections_klarna_post
      summary: aid_account_settings_connections_klarna_post
      description: |
        Initialize Klarna signup

        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: force_new_signup
          in: query
          description: |
            Will allow signing up again even if there are previous pending signups.
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/KlarnaConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/KlarnaConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Klarna signup
          sidebarTitle: Klarna signup
    get:
      operationId: aid_account_settings_connections_klarna_get
      summary: aid_account_settings_connections_klarna_get
      description: |
        Get details about the Klarna configuration

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/KlarnaConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Klarna signup status
          sidebarTitle: Get Klarna signup status
  /accounts/{aid}/management/settings/connections/payex/{payment_product_type}:
    post:
      operationId: aid_account_settings_connections_payex_post
      summary: aid_account_settings_connections_payex_post
      description: |
        Initialize PayEx signup

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: payment_product_type
          in: path
          required: true
          schema:
            type: string
            enum:
              - payex.creditcard
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/PayExConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/PayExConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: PayEx signup
          sidebarTitle: PayEx signup
    get:
      operationId: aid_account_settings_connections_payex_get
      summary: aid_account_settings_connections_payex_get
      description: |
        Get details about the Vipps

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: payment_product_type
          in: path
          required: true
          schema:
            type: string
            enum:
              - payex.creditcard
      responses:
        '200':
          $ref: '#/components/responses/PayExConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get PayEx signup status
          sidebarTitle: Get PayEx signup status
  /accounts/{aid}/management/settings/connections/payex/{payment_product_type}/{callback_reference}:
    post:
      operationId: aid_account_settings_connections_payex_callback_post
      summary: aid_account_settings_connections_payex_callback_post
      description: |
        Handle callback from PayEx signup

        Completes the PayEx signup, enables PayEx for Checkout

        scopes:
        - write:accounts:/management/settings/connections/payex
        - write:accounts
      x-scopes:
        - write:accounts:/management/settings/connections/payex
        - write:accounts
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: payment_product_type
          in: path
          required: true
          schema:
            type: string
            enum:
              - payex.creditcard
        - name: callback_reference
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayExConnectionCallback'
        required: true
      responses:
        '200':
          description: Signup
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: PayEx Callback
          sidebarTitle: PayEx Callback
  /accounts/{aid}/management/settings/connections/payex/overrides:
    put:
      operationId: aid_account_settings_connections_payex_overrides_put
      summary: aid_account_settings_connections_payex_overrides_put
      description: |
        Add PayEx overrides for pre-existing connection

        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                overrides:
                  type: array
                  minItems: 0
                  maxItems: 1
                  items:
                    type: object
                    required:
                      - store_id
                      - credentials
                    properties:
                      store_id:
                        type: string
                        example: '999'
                      credentials:
                        type: object
                        required:
                          - payee_id
                        properties:
                          payee_id:
                            type: string
                            example: 803-518c-4fa0-9b0f-177e871f21dd
                          token:
                            type: string
                            example: eb4835ac0b0835ad8f886c0b077a49bc28f200ac03ba543ebea8bba8a62e143d
                          subsite:
                            type: string
                            example: '1234678'
        required: true
      responses:
        '200':
          description: Override
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: PayEx overrides
          sidebarTitle: PayEx overrides
  /accounts/{aid}/management/settings/connections/santander/overrides:
    put:
      operationId: aid_account_settings_connections_santander_overrides_put
      summary: aid_account_settings_connections_santander_overrides_put
      description: |
        Add Santander overrides for pre-existing connection

        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                overrides:
                  type: array
                  minItems: 0
                  maxItems: 1
                  items:
                    type: object
                    required:
                      - store_id
                      - credentials
                    properties:
                      store_id:
                        type: string
                        example: '999'
                      credentials:
                        type: object
                        required:
                          - store_email
                          - store_token
                        properties:
                          store_email:
                            type: string
                          store_token:
                            type: string
        required: true
      responses:
        '200':
          description: Override
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Santander overrides
          sidebarTitle: Santander overrides
  /accounts/{aid}/management/settings/connections/swish:
    post:
      operationId: aid_account_settings_connections_swish_post
      summary: aid_account_settings_connections_swish_post
      description: |
        Initialize Swish signup

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - signup
              properties:
                signup:
                  $ref: '#/components/schemas/SwishConnectionSignup'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/SwishConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Swish signup
          sidebarTitle: Swish signup
    get:
      operationId: aid_account_settings_connections_swish_get
      summary: aid_account_settings_connections_swish_get
      description: |
        Get details about the Swish configuration

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      responses:
        '200':
          $ref: '#/components/responses/SwishConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Swish signup status
          sidebarTitle: Get Swish signup status
  /accounts/{aid}/management/settings/connections/swish/{callback_reference}:
    post:
      operationId: aid_account_settings_connections_swish_callback_post
      summary: aid_account_settings_connections_swish_callback_post
      description: |
        Handle callback from Swish signup

        Completes the Swish signup, enables Swish for Checkout

        scopes:
        - write:accounts:/management/settings/connections/swish
      x-scopes:
        - write:accounts:/management/settings/connections/swish
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: callback_reference
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwishConnectionCallback'
        required: true
      responses:
        '200':
          description: Signup
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Swish Callback
          sidebarTitle: Swish Callback
  /accounts/{aid}/management/settings/connections/swish/overrides:
    put:
      operationId: aid_account_settings_connections_swish_overrides_put
      summary: aid_account_settings_connections_swish_overrides_put
      description: |
        Add Swish overrides for pre-existing connection

        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                overrides:
                  type: array
                  minItems: 0
                  maxItems: 1
                  items:
                    type: object
                    required:
                      - store_id
                      - credentials
                    properties:
                      store_id:
                        type: string
                        example: '999'
                      credentials:
                        type: object
                        required:
                          - swish_number
                        properties:
                          swish_number:
                            type: string
        required: true
      responses:
        '200':
          description: Override
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Swish overrides
          sidebarTitle: Swish overrides
  /accounts/{aid}/management/settings/connections/vipps:
    post:
      operationId: aid_account_settings_connections_vipps_post
      summary: aid_account_settings_connections_vipps_post
      description: |
        Initialize Vipps signup

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/VippsConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Vipps signup
          sidebarTitle: Vipps signup
    put:
      operationId: aid_account_settings_connections_vipps_put
      summary: aid_account_settings_connections_vipps_put
      description: |
        Reinitialize Vipps signup if connection is not enabled.

        Requires the account company to be configured with `organization_number`
        [PUT /management/settings](/management-auth-api/account-settings/aid_account_settings_put)

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account-connections
        - connection-onboarding
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/VippsConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Vipps signup
          sidebarTitle: Vipps signup
    get:
      operationId: aid_account_settings_connections_vipps_get
      summary: aid_account_settings_connections_vipps_get
      description: |
        Get details about the Vipps

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account-connections
      parameters:
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/VippsConnectionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Vipps signup status
          sidebarTitle: Get Vipps signup status
  /accounts/{aid}/management/settings/connections/vipps/{callback_reference}:
    post:
      operationId: aid_account_settings_connections_vipps_callback_post
      summary: aid_account_settings_connections_vipps_callback_post
      description: |
        Handle callback from Vipps signup

        Completes the Vipps signup, enables Vipps for Checkout

        scopes:
        - write:accounts:/management/settings/connections/vipps
      x-scopes:
        - write:accounts:/management/settings/connections/vipps
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: callback_reference
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VippsConnectionCallback'
        required: true
      responses:
        '200':
          description: Signup
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Vipps Callback
          sidebarTitle: Vipps Callback
  /accounts/{aid}/management/settings/connections/vipps/overrides:
    put:
      operationId: aid_account_settings_connections_vipps_overrides_put
      summary: aid_account_settings_connections_vipps_overrides_put
      description: |
        Add Vipps overrides for pre-existing connection

        scopes:
        - admin:dintero
      x-scopes:
        - admin:dintero
      tags:
        - account-connections
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                overrides:
                  type: array
                  minItems: 0
                  maxItems: 1
                  items:
                    type: object
                    required:
                      - store_id
                      - credentials
                    properties:
                      store_id:
                        type: string
                        example: '999'
                      credentials:
                        type: object
                        required:
                          - merchantSerialNumber
                        properties:
                          merchantSerialNumber:
                            type: string
                            example: '123456'
        required: true
      responses:
        '200':
          description: Override
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Vipps overrides
          sidebarTitle: Vipps overrides
  /accounts/{oid}/auth/authorize:
    post:
      operationId: aid_auths_oauth_authorize_post
      summary: aid_auths_oauth_authorize_post
      description: |
        This endpoint is used to authorize Passwordless link sent to user
        by email/sms.

        A valid request will redirect to
        This is the OAuth 2.0 grant that Client-side web apps
        utilize in order to access an API.
      tags:
        - authenticate
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: audience
          in: query
          required: true
          description: |
            The unique identifier of the target API you want to access.
          schema:
            type: string
        - name: scope
          in: query
          description: The scopes which you want to request authorization for.
          schema:
            type: string
            enum:
              - openid
        - name: response_type
          in: query
          required: true
          description: |
            This will specify the type of token you will receive at
            the end of the flow. Use token to get only an access_token

            If `response_type=token`, after the user authenticates with the
            provider, this will redirect them to your application callback URL
            while passing the access_token in the address location.hash.
            This is used for Single Page Apps and on Native Mobile SDKs.
          schema:
            type: string
            enum:
              - authenticate
        - name: client_id
          in: query
          required: true
          description: |
            Your application's Client ID.
          schema:
            type: string
        - name: state
          in: query
          description: |
            An opaque value the clients adds to the initial request that Dintero
            includes when redirecting the back to the client. This value must
            be used by the client to prevent CSRF attacks.
          schema:
            type: string
        - name: redirect_uri
          in: query
          description: |
            The URL to which Dintero will redirect the browser after
            authorization has been granted by the user.

            The `redirect_uri` value must be specified as a valid
            callback URL under your Client's Settings.
          schema:
            type: string
        - name: verification_code
          in: query
          description: one-time verification-code
          required: true
          schema:
            type: string
        - name: connection
          in: query
          description: The name of the connection configured to your client.
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '302':
          description: Found
          headers:
            Location:
              description: |
                Redirect URL, example:
                https://YOUR_APP/callback#access_token=TOKEN&state=STATE&token_type=TYPE&expires_in=SECONDS
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Authorize Passwordless link
          sidebarTitle: Authorize Passwordless link
  /accounts/{oid}/auth/client-grants:
    get:
      operationId: aid_auths_client_grants_get
      summary: aid_auths_client_grants_get
      description: |
        Manage your Client Grants (also called Client Credentials Grants).
        Using Client Grants, your Client can request an access token using
        its credentials (a Client ID and a Client Secret).
        The access token then represents your Client during API calls.

        Use the Grant type to limit how the grant can be used when requesting
        an access token. A Grant with type `password` can only be used when
        requesting an access token with grant_type set to `password`.

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - grants
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: audience
          description: |
            filter client grants by audience
          in: query
          required: false
          schema:
            type: string
            maximum: 1
        - name: client_id
          description: |
            filter client grants by client_id
          in: query
          required: false
          schema:
            type: string
            maximum: 1
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/GrantCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Client grants collection
          sidebarTitle: Client grants collection
    post:
      operationId: aid_auths_client_grants_post
      summary: aid_auths_client_grants_post
      description: |

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - grants
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Grant'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/GrantCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create client grant
          sidebarTitle: Create client grant
  /accounts/{oid}/auth/client-grants/{id}:
    delete:
      operationId: aid_auths_client_grants_id_delete
      summary: aid_auths_client_grants_id_delete
      description: |

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - grants
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: id
          in: path
          required: true
          description: |
            The id of the client grant to delete
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/GrantDeleted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete client grant
          sidebarTitle: Delete client grant
    patch:
      operationId: aid_auths_client_grants_id_patch
      summary: aid_auths_client_grants_id_patch
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - grants
      description: |
        Update the client grant with the given id.

        scopes:
        - admin:accounts
        - write:accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: id
          in: path
          required: true
          description: |
            The id of the client grant to update
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGrantRequest'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/GrantUpdated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update client grant
          sidebarTitle: Update client grant
  /accounts/{oid}/auth/clients:
    get:
      operationId: aid_auth_clients_get
      summary: aid_auth_clients_get
      description: |
        Retrieve a list of all client applications

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - clients
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: search
          in: query
          description: |
            Search clients by name or client id.
          example: my-client
          schema:
            type: string
        - name: status
          in: query
          description: |
            Filter clients by status.
          example: active
          schema:
            type: string
            enum:
              - active
              - inactive
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ClientCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Clients collection
          sidebarTitle: Clients collection
    post:
      operationId: aid_auth_clients_post
      summary: aid_auth_clients_post
      description: |
        Creates a new client application.

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - clients
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Client'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ClientWithSecret'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create Client
          sidebarTitle: Create Client
  /accounts/{oid}/auth/clients/{id}:
    get:
      operationId: aid_auths_clients_id_get
      summary: aid_auths_clients_id_get
      description: |
        Retrieves a client by its id.

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - clients
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: id
          in: path
          required: true
          description: |
            The id of the client
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ClientResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Client
          sidebarTitle: Get Client
    delete:
      operationId: aid_auths_clients_id_delete
      summary: aid_auths_clients_id_delete
      description: |
        Deletes a client and all its related assets

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - clients
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: id
          in: path
          required: true
          description: |
            The id of the client
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ClientResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete Client
          sidebarTitle: Delete Client
    patch:
      operationId: aid_auths_clients_id_patch
      summary: aid_auths_clients_id_patch
      description: |
        Update client details

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - clients
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: id
          in: path
          required: true
          description: |
            The id of the client
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientPatch'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ClientResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Client
          sidebarTitle: Update Client
  /accounts/{oid}/auth/clients/{id}/rotate-secret:
    post:
      operationId: aid_auths_clients_id_rotate_post
      summary: aid_auths_clients_id_rotate_post
      description: |
        Rotate a client secret.

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - clients
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: id
          in: path
          required: true
          description: |
            The id of the client
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ClientWithSecret'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Rotate a client secret.
          sidebarTitle: Rotate a client secret.
  /accounts/{oid}/auth/keys:
    get:
      operationId: aid_auths_keys_get
      summary: aid_auths_keys_get
      description: |
        Retrieve the JSON Web Key Set (JWKS) that can be used
        to validate `access_token`

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - keys
      parameters:
        - $ref: '#/components/parameters/owner'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/KeysCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get public keys
          sidebarTitle: Get public keys
  /accounts/{oid}/auth/oidc/authorize:
    get:
      operationId: aid_auths_oidc_authorize_get
      summary: aid_auths_oidc_authorize_get
      tags:
        - authenticate
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: audience
          in: query
          required: true
          description: |
            The unique identifier of the target API you want to access. The audience must have
            a Grant with OIDC configured
          schema:
            type: string
        - name: response_type
          in: query
          required: true
          schema:
            type: string
            enum:
              - code
        - name: client_id
          in: query
          required: true
          description: |
            The client_id of your application
          schema:
            type: string
        - name: redirect_uri
          in: query
          required: true
          description: |
            The URL to redirect after authorization has been granted by the user.
          schema:
            type: string
        - name: scope
          in: query
          description: Scope of the access request, space-separated list.
          schema:
            type: string
        - name: client_token
          in: query
          description: |
            Authorization token to use if no authorization header is included
          example: eyJhbGci...t7P4
          schema:
            type: string
      responses:
        '302':
          description: Found
          headers:
            Location:
              description: |
                Redirect URL, example:
                https://identityserver.example.com/access/auth?client_id=XXX...
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Authorize with OIDC
          sidebarTitle: Authorize with OIDC
  /accounts/{oid}/auth/oidc/token:
    post:
      operationId: aid_auths_oidc_token_post
      summary: aid_auths_oidc_token_post
      description: |
        Use this endpoint to obtains an access token by presenting its authorization
        grant

        scopes:
        - write:accounts:/auth/users
      x-scopes:
        - write:accounts:/auth/users
      tags:
        - authenticate
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - audience
                - code
                - grant_type
                - client_id
              properties:
                grant_type:
                  type: string
                  enum:
                    - authorization_code
                code:
                  type: string
                client_id:
                  type: string
                redirect_uri:
                  type: string
                  description: |
                    The redirect URL which the user agent is redirected to after
                    finishing a login.
                audience:
                  type: string
                  example: https://api.dintero.com/v1/accounts/P00000000
                  description: |
                    The unique identifier of the target API you want to access.
                    The audience must be a grant associated with the client that
                    has `oidc` configured
        required: true
      responses:
        '200':
          $ref: '#/components/responses/TokenGranted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Token verified by OIDC
          sidebarTitle: Token verified by OIDC
  /accounts/{oid}/auth/passwordless:
    post:
      operationId: aid_auth_account_passwordless_post
      summary: aid_auth_account_passwordless_post
      description: |
        Passwordless connections do not require the user to
        remember a password. Instead, another mechanism is used
        to prove identity, such as a one-time code sent through
        email or SMS, every time the account user logs in.

        - The client_id/audience must have a grant with type
          `authorization_code` to allow sending verification-code
        - This endpoint is designed to be called from the client-side
          and is subjected to rate limits

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/passwordless
        - write:accounts:/auth/passwordless-sms
        - write:accounts:/auth/passwordless-email
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/passwordless
        - write:accounts:/auth/passwordless-sms
        - write:accounts:/auth/passwordless-email
      tags:
        - authenticate
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordLess'
        required: true
      security:
        - JWT: []
      responses:
        '204':
          description: Request processed
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Passwordless
          sidebarTitle: Passwordless
  /accounts/{oid}/auth/passwordless/code:
    post:
      operationId: aid_auth_passwordless_post
      summary: aid_auth_passwordless_post
      description: |
        Passwordless connections do not require the user to
        remember a password. Instead, another mechanism is used
        to prove identity, such as a one-time code sent through
        email or SMS, every time the account user logs in.

        Use this endpoint to generate a one-time verification-code that can
        be sent to the user.

        The client_id/audience must have a grant with type
        `authorization_code` to allow creating a verification-code

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/passwordless/code
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/passwordless/code
      tags:
        - authenticate
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - required:
                    - audience
                    - client_id
                    - user_id
                  properties:
                    audience:
                      type: string
                      description: |
                        The unique identifier of the target API you want to grant the user
                    client_id:
                      type: string
                      description: |
                        The client whoose grants will be granted to the user, the
                    user_id:
                      type: string
                      description: |
                        The user_id / subject to grant access
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccessCode'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Passwordless Code
          sidebarTitle: Passwordless Code
  /accounts/{oid}/auth/redirect:
    post:
      operationId: aid_auths_oauth_redirect_post
      summary: aid_auths_oauth_redirect_post
      description: |
        Use this endpoint to redirect to an URL with a
        ID token added.
      tags:
        - authenticate
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - redirect_uri
              properties:
                redirect_uri:
                  description: |
                    The HTTP URL to redirect to
                  format: uri
                  pattern: ^https?://.*
                custom_claims:
                  description: |
                    Include custom claims to the ID token. Custom claims will be
                    prefixed by `ext_`.
                  type: object
                  maxProperties: 5
                  additionalProperties:
                    type: string
                    minLength: 1
                    maxLength: 100
                claims:
                  type: array
                  items:
                    type: string
                    enum:
                      - name
                      - email
                  description: |
                    Specify optional claims to include in the ID token
        required: true
      responses:
        '200':
          $ref: '#/components/responses/RedirectUrl'
        '302':
          $ref: '#/components/responses/RedirectFound'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Redirect with ID token
          sidebarTitle: Redirect with ID token
  /accounts/{oid}/auth/revoke:
    post:
      operationId: aid_auths_oauth_revoke_post
      summary: aid_auths_oauth_revoke_post
      description: |
        Use this endpoint to invalidate a Refresh Token if it has been compromised.

        scopes:
        - admin:accounts
        - write:accounts
        - create:accounts:auth:refresh_token
      x-scopes:
        - admin:accounts
        - write:accounts
        - create:accounts:auth:refresh_token
      tags:
        - authenticate
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RevokeToken'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Revoke Token
          sidebarTitle: Revoke Token
  /accounts/{oid}/auth/roles:
    get:
      operationId: aid_auths_roles_get
      summary: aid_auths_roles_get
      description: |
        Retrieve filtered list of roles that can be assigned to users.

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - roles
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: search
          description: |
            lookup roles matching id, name and description
          in: query
          schema:
            type: string
        - name: name
          description: |
            lookup roles by name
          in: query
          schema:
            type: string
        - name: include_deleted
          description: |
            include deleted roles in the response
          in: query
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/RoleCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Roles collection
          sidebarTitle: Roles collection
    post:
      operationId: aid_auths_roles_post
      summary: aid_auths_roles_post
      description: |

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - roles
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        $ref: '#/components/requestBodies/AuthRole'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/RoleResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create a role
          sidebarTitle: Create a role
  /accounts/{oid}/auth/roles/{role_id}:
    get:
      operationId: aid_auths_roles_id_get
      summary: aid_auths_roles_id_get
      description: |

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - roles
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: role_id
          in: path
          required: true
          description: |
            The id of the rule to delete
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/RoleResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get role
          sidebarTitle: Get role
    put:
      operationId: aid_auths_roles_id_put
      summary: aid_auths_roles_id_put
      description: |

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - roles
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: role_id
          in: path
          required: true
          description: |
            The id of the rule to delete
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AuthRole'
      responses:
        '200':
          $ref: '#/components/responses/RoleUpdated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update role
          sidebarTitle: Update role
    delete:
      operationId: aid_auths_roles_id_delete
      summary: aid_auths_roles_id_delete
      description: |
        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - roles
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: role_id
          in: path
          required: true
          description: |
            The id of the rule to delete
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/RoleDeleted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete role
          sidebarTitle: Delete role
  /accounts/{oid}/auth/token:
    post:
      operationId: aid_auths_oauth_token_post
      summary: aid_auths_oauth_token_post
      description: |
        Use this endpoint to directly request an access_token

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

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

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

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

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

        ### Multi-factor authentication (MFA)

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

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

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

        scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
        - write:accounts:/auth/users/no-mfa
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:accounts:/auth/users
        - write:accounts:/auth/users/no-mfa
      tags:
        - authenticate
      security:
        - clientAuth: []
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthToken'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - properties:
                      mfa_token:
                        type: string
                        description: |
                          Included in the response if `mfa_required` in `error.code` is
                          returned. The client must then perform a `challenge`. This
                          is done by sending a request to the
                          [/mfa/challenge](/management-auth-api/challenge/aid_auth_mfa_challenge_post)
                          endpoint.
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Token
          sidebarTitle: Get Token
  /accounts/{oid}/management/accounts:
    get:
      operationId: aid_mgmnt_accounts_get
      summary: aid_mgmnt_accounts_get
      description: |
        Get list of accounts filtered by the partner account

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: search
          description: |
            lookup accounts where search term match account id
          in: query
          schema:
            type: string
        - name: connection
          in: query
          description: |
            Filter accounts by payment connection applications.

            Will return an account if it has applied, been approved or rejected for all the given connections.

            Example: `connection=payex&connection=vipps&connection=collector&connection=swish`
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: connection_status
          in: query
          description: |
            Filter accounts by connection status

            Will return an account if all statuses are represented among the connections.

            If the `connection`-filter is set, it will filter on the status only on those connections.

            Example: `connection_status=pending&connection_status=enabled&connection_status=declined`
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: payment_option
          in: query
          description: |
            Filter account by enabled payment_options

            Will return an account if all the given payment_options are enabled on the account.

            Example: `payment_option=payex.creditcard&payment_option=vipps&payment_option=collector.invoice`
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: account_manager
          in: query
          description: |
            filter account by account_manager
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: country
          in: query
          description: |
            filter account by country
          example:
            - SE
            - 'NO'
          explode: true
          schema:
            type: array
            items:
              type: string
            minLength: 2
            maxLength: 2
        - name: services
          in: query
          description: |
            filter account by service status
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - checkout.status.enabled
                - checkout.status.disabled
                - payout.status.enabled
                - payout.status.disabled
                - customers.status.enabled
                - customers.status.disabled
                - discounts.status.enabled
                - discounts.status.disabled
                - shopping.status.enabled
                - shopping.status.disabled
                - receipts.status.enabled
                - receipts.status.disabled
                - wallets.status.enabled
                - wallets.status.disabled
                - ledger.status.enabled
                - ledger.status.disabled
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ExtendedAccountCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Accounts collection
          sidebarTitle: Accounts collection
    post:
      operationId: aid_mgmnt_accounts_post
      summary: aid_mgmnt_accounts_post
      description: |
        Create an account from an partner account

        scopes:
        - admin:accounts
        - write:accounts
        - public:accounts

        In order to create an account with `livemode` correctly enabled, the following fields must be set in the body request:
          - `company.business_name`
          - `company.organization_number`
          - `company.address.address_line`
          - `company.address.postal_place`
          - `company.address.country`
          - `company.website`
          - `billing.business_name`
          - `billing.organization_number`
          - `billing.address.address_line`
          - `billing.address.postal_place`
          - `billing.address.country`

        This allows the account to proceed with KYC in Backoffice.
      x-scopes:
        - admin:accounts
        - write:accounts
        - public:accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - properties:
                    partner_id:
                      type: string
                      description: |
                        The id of the partner to associate with the account
                      format: ^[PT]{1}(?=(?:.{3})$)[0-9]*$
                      readOnly: false
                    applicant:
                      $ref: '#/components/schemas/AccountApplicant'
                    invites:
                      type: array
                      description: |
                        Users to invite to the account by email
                      items:
                        type: string
                        format: email
                      example:
                        - user@example.com
                    invite_users:
                      type: array
                      description: |
                        Users to invite to the account with name and email
                      items:
                        type: object
                        description: |
                          The user to invite to the account with name and email
                        required:
                          - email
                          - first_name
                          - last_name
                        properties:
                          email:
                            type: string
                            description: |
                              The email of the user to invite
                            format: email
                            example: user@example.com
                          first_name:
                            type: string
                            description: |
                              The first name of the user to invite
                            example: John
                          last_name:
                            type: string
                            description: |
                              The last name of the user to invite
                            example: Doe
                    invitation_note:
                      type: string
                      description: |
                        A note to include in the invitation email
                      example: Welcome to the account
                    actions:
                      type: array
                      description: |
                        The actions to perform on the account
                        - 'send_invite' - send an invite to the applicant
                      items:
                        type: string
                        enum:
                          - send_invite
                      example:
                        - send_invite
                    custom_price_package:
                      type: object
                      description: |
                        Custom price package to apply to the account
                      allOf:
                        - $ref: '#/components/schemas/PricePackageCustomCreateData'
                - $ref: '#/components/schemas/Account'
                - $ref: '#/components/schemas/AccountPrivateDetails'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ExtendedAccountResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create Account
          sidebarTitle: Create Account
  /accounts/{oid}/management/accounts/{aid}:
    delete:
      operationId: aid_mgmnt_accounts_aid_delete
      summary: aid_mgmnt_accounts_aid_delete
      description: |
        Delete an account

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ExtendedAccountDeleted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete Account
          sidebarTitle: Delete Account
    get:
      operationId: aid_accounts_aid_get
      summary: aid_accounts_aid_get
      description: |
        Get account details

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ExtendedAccountResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get Account
          sidebarTitle: Get Account
    put:
      operationId: aid_accounts_aid_put
      summary: aid_accounts_aid_put
      description: |
        Update an account

        scopes:
        - admin:accounts
        - write:accounts
        - write:dintero:/management/accounts
      x-scopes:
        - admin:accounts
        - write:accounts
        - write:dintero:/management/accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - properties:
                    active:
                      type: boolean
                      description: |
                        Activation the account is only allowed by client with
                        scope `mgmnt:admin`
                      readOnly: false
                    partner_id:
                      type: string
                      description: |
                        Changing `partner_id` is only allowed by client with scope
                        `mgmnt:admin`
                      format: ^[PT]{1}(?=(?:.{3})$)[0-9]*$
                      readOnly: false
                    configuration:
                      $ref: '#/components/schemas/PartnerConfiguration'
                    platform_type:
                      type: string
                      readOnly: false
                      description: |
                        Optional type of platform for merchants using split payout.
                      enum:
                        - marketplace
                        - aggregator
                - $ref: '#/components/schemas/Account'
                - $ref: '#/components/schemas/AccountPrivateDetails'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/ExtendedAccountUpdated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update Account
          sidebarTitle: Update Account
  /accounts/{oid}/management/accounts/{aid}/connections/{connection}/events:
    post:
      operationId: aid_accounts_aid_connections_events_post
      summary: aid_accounts_aid_connections_events_post
      description: |
        Update an account connection with new status and add an event

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/accountId'
        - name: connection
          description: |
            The connection to update.

            `payex.creditcard` is deprecated in favor of `payex`
          in: path
          required: true
          schema:
            type: string
            enum:
              - instabank
              - vipps
              - payex.creditcard
              - payex
              - collector
              - swish
              - bambora
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountConnectionEvent'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountConnectionEventResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update connection status
          sidebarTitle: Update connection status
  /accounts/{oid}/management/accounts/{aid}/events:
    get:
      operationId: aid_mgmnt_accounts_events_get
      summary: aid_mgmnt_accounts_events_get
      description: |
        Get list of account events

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/accountId'
        - name: type
          description: |
            filter events by type
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - comment
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountEventCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Account events
          sidebarTitle: Account events
    post:
      operationId: aid_mgmnt_accounts_events_post
      summary: aid_mgmnt_accounts_events_post
      description: |
        Create an account event

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountEvent'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountEventResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create Account Event
          sidebarTitle: Create Account Event
  /accounts/{oid}/management/accounts/{aid}/partner_onboarding_link:
    post:
      operationId: aid_accounts_aid_partner_onboarding_link_post
      summary: aid_accounts_aid_partner_onboarding_link_post
      description: |
        Partner onboarding link

        scopes:
        - admin:dintero
        - write:dintero:/management/accounts
      x-scopes:
        - admin:dintero
        - write:dintero:/management/accounts
      tags:
        - accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/accountId'
      security:
        - JWT: []
      responses:
        '200':
          description: Onboarding link created
          content:
            application/json:
              schema:
                type: object
                properties:
                  partner_onboarding_url:
                    type: string
                    example: https://onboarding.dintero.com/?partner=P18400000
                  client_id:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Partner onboarding link
          sidebarTitle: Partner onboarding link
  /accounts/{aid}/compliance-search/match:
    post:
      operationId: accounts_aid_search_match_post
      summary: accounts_aid_search_match_post
      description: |
        Search the MATCH register for any potential matches related to fraud for the account

        scopes:
        - read:accounts:/match
      x-scopes:
        - read:accounts:/match
      tags:
        - account-fraud-search
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: limit
          in: query
          description: |
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100 items, and the default is 20 items.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: starting_after
          in: query
          description: |
            Zero-based offset to start from. A value of 10 will start with the 11th item
          schema:
            type: integer
            minimum: 0
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchTerminationRequest'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/MatchSearch'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: MATCH register search
          sidebarTitle: MATCH register search
  /accounts/{aid}/compliance-search/match/terminate:
    post:
      operationId: accounts_aid_search_match_terminate_merchant_post
      summary: accounts_aid_search_match_terminate_merchant_post
      description: |
        Add a terminated merchant to Mastercard MATCH

        scopes:
        - write:accounts:/match
      x-scopes:
        - write:accounts:/match
      tags:
        - account-fraud-search
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchTerminateMerchant'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/MatchAddMerchantResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Add a terminated merchant to MATCH
          sidebarTitle: Add a terminated merchant to MATCH
  /accounts/{aid}/compliance-search/match/{irn}:
    get:
      operationId: accounts_aid_search_match_get
      summary: accounts_aid_search_match_get
      description: |
        Get result of a MATCH inquiry by the inquiry reference number (IRN)

        scopes:
        - read:accounts:/match
      x-scopes:
        - read:accounts:/match
      tags:
        - account-fraud-search
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: irn
          description: |
            The inquiry reference number (IRN) returned by the termination inquiry to MATCH
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: |
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100 items, and the default is 20 items.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: starting_after
          in: query
          description: |
            Zero-based offset to start from. A value of 10 will start with the 11th item
          schema:
            type: integer
            minimum: 0
            default: 0
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/MatchSearch'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get MATCH register search
          sidebarTitle: Get MATCH register search
  /accounts/{aid}/compliance-search/vmss:
    post:
      operationId: accounts_aid_search_vmss_post
      summary: accounts_aid_search_vmss_post
      description: |
        Search the Visa Merchant Screening Service register for any potential matches related to fraud for the account

        scopes:
        - read:accounts:/vmss
      x-scopes:
        - read:accounts:/vmss
      tags:
        - account-fraud-search
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VMSSInquiryRequest'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/VMSSInquiry'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: VMSS register search
          sidebarTitle: VMSS register search
  /accounts/{aid}/compliance-search/vmss/terminate:
    post:
      operationId: accounts_aid_search_vmss_terminate_merchant_post
      summary: accounts_aid_search_vmss_terminate_merchant_post
      description: |
        Add a terminated to Visa Merchant Screening Service

        scopes:
        - write:accounts:/vmss
      x-scopes:
        - write:accounts:/vmss
      tags:
        - account-fraud-search
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VMSSTermianteMerchantRequest'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/VMSSTerminateMerchant'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Add a terminated merchant to VMSS
          sidebarTitle: Add a terminated merchant to VMSS
  /accounts/{oid}/management/users:
    get:
      operationId: aid_accounts_aid_mgmnt_users_get
      summary: aid_accounts_aid_mgmnt_users_get
      description: |
        Get list of all users with access to the account

        scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account users
      x-scopes:
        - admin:accounts
        - read:accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: expand
          in: query
          description: |
            Expand properties in the response
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - roles
        - name: search
          in: query
          description: |
            Search for users by email or name
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountUserCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Users Collection
          sidebarTitle: Users Collection
    post:
      operationId: aid_accounts_aid_mgmnt_users_post
      summary: aid_accounts_aid_mgmnt_users_post
      description: |
        Create and grant user access to the account

        scopes:
        - admin:accounts
        - write:accounts
      x-scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account users
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: expand
          in: query
          description: |
            Expand properties in the response
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - roles
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  example: customer@example.com
                name:
                  type: string
                  example: John Doe
                scope:
                  type: array
                  items:
                    type: string
                    minItems: 1
                    example: receipts:write
                authentication_type:
                  description: |
                    - `external`: authentication of the user will be done
                      externally, Dintero will not manage user password. Requires
                      the account to be configured with `jwks.uri`.
                  type: string
                  enum:
                    - external
                roles:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        description: Role ID
                  description: |
                    Create user with one or more roles. The authorization used to
                    create the user must have access to use the role, i.e. have the
                    same scopes as granted by the role.
                  example:
                    - id: 7b288256-f4f8-4370-bb63-7157652ead21
                    - id: 42e75d9b-af5a-41bc-bf21-ed30444a268e
                agreement:
                  $ref: '#/components/schemas/AccountAgreement'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountUserResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create User
          sidebarTitle: Create User
  /accounts/{oid}/management/users/{uid}:
    delete:
      operationId: aid_accounts_aid_mgmnt_users_delete
      summary: aid_accounts_aid_mgmnt_users_delete
      description: |
        Delete a user from an account

        scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account users
      x-scopes:
        - admin:accounts
        - write:accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/user'
        - name: expand
          in: query
          description: |
            Expand properties in the response
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - roles
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountUserDeleted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete User
          sidebarTitle: Delete User
    put:
      operationId: aid_accounts_aid_mgmnt_users_put
      summary: aid_accounts_aid_mgmnt_users_put
      description: |
        Update user

        scopes:
        - admin:accounts
        - write:accounts
      tags:
        - account users
      x-scopes:
        - admin:accounts
        - write:accounts
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/user'
        - name: expand
          in: query
          description: |
            Expand properties in the response
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - roles
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    name:
                      type: string
                      example: John Doe
                    scope:
                      type: array
                      items:
                        type: string
                        minItems: 1
                        example: receipts:write
                    roles:
                      type: array
                      items:
                        type: object
                        required:
                          - id
                        properties:
                          id:
                            type: string
                            description: Role ID
                      description: |
                        Create user with one or more roles. The authorization used to
                        create the user must have access to use the role, i.e. have the
                        same scopes as granted by the role.
                      example:
                        - id: 7b288256-f4f8-4370-bb63-7157652ead21
                        - id: 42e75d9b-af5a-41bc-bf21-ed30444a268e
                    agreement:
                      $ref: '#/components/schemas/AccountAgreement'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AccountUserUpdated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update User
          sidebarTitle: Update User
  /accounts/{oid}/management/users/{uid}/activities:
    get:
      operationId: aid_accounts_aid_mgmnt_users_activities_get
      summary: aid_accounts_aid_mgmnt_users_activities_get
      description: |
        Get activities for User

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - account users
      parameters:
        - $ref: '#/components/parameters/owner'
        - $ref: '#/components/parameters/user'
      security:
        - JWT: []
      responses:
        '200':
          $ref: '#/components/responses/AuditEventCollection'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get user activity log
          sidebarTitle: Get user activity log
  /accounts/{oid}/signup:
    post:
      operationId: accounts_oid_signup_post
      summary: accounts_oid_signup_post
      x-scopes:
        - create:account
      description: |
        Initiate a signup for Dintero Account

        - An email verification request will be sent to the applicant,
          that contains a code that must be sent to
          [POST /account/{oid}/signup/verify](/management-auth-api/account-onboarding/accounts_oid_signup_verify_post)

        - A welcome email will be sent after verification of the applicant email
          is completed. The email contains links to Backoffice

        scopes:
        - create:account
      tags:
        - account-onboarding
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountSignupRequest'
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Signup to Dintero Account
          sidebarTitle: Signup to Dintero Account
  /accounts/{oid}/signup/prefill:
    post:
      operationId: accounts_oid_signup_prefill_post
      summary: accounts_oid_signup_prefill_post
      x-scopes:
        - create:applicant
      description: |
        Pre-fill a sign up form for a new Dintero Account

        - An email verification request will be sent to the applicant,
          that contains a link where the merchant can accept the terms and create a new account.

          [POST /account/{oid}/signup/prefill/{prefill_id}](/management-auth-api/account-onboarding-prefill/accounts_oid_signup_prefill_accept_post)

        - An email will be sent after accepting the terms. The email contains a link to the Backoffice as well as a password

        scopes:
        - create:applicant
      tags:
        - account-onboarding-prefill
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
      requestBody:
        $ref: '#/components/requestBodies/AccountSignupPreFillRequest'
      responses:
        '200':
          $ref: '#/components/responses/AccountSignupPrefillResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Pre-fill a sign up for a new Dintero Account
          sidebarTitle: Pre-fill a sign up for a new Dintero Account
  /accounts/{oid}/signup/prefill/{prefill_id}:
    post:
      operationId: accounts_oid_signup_prefill_accept_post
      summary: accounts_oid_signup_prefill_accept_post
      x-scopes:
        - create:account
      description: |
        Accept a prefilled sign up form for a new Dintero Account

        - An email will be sent after accepting the terms if no auhtorize query is included.
          The email contains a link to the Backoffice as well as a password

        scopes:
        - create:account
      tags:
        - account-onboarding-prefill
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: prefill_id
          in: path
          required: true
          schema:
            type: string
        - name: authorize
          in: query
          description: |
            Request access tokens to be included in the response.
          schema:
            type: string
            enum:
              - Bearer
      requestBody:
        $ref: '#/components/requestBodies/AccountSignupPreFillRequest'
      responses:
        '200':
          $ref: '#/components/responses/AccountSignupAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Accept pre-filled sign up for a new Dintero Account
          sidebarTitle: Accept pre-filled sign up for a new Dintero Account
    get:
      operationId: accounts_oid_signup_prefill_get
      summary: accounts_oid_signup_prefill_get
      x-scopes:
        - create:account
      description: |
        Get a prefilled a sign up form for a new Dintero Account by id, not yet
        accepted by the applicant.

        scopes:
        - create:account
      tags:
        - account-onboarding-prefill
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: prefill_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/AccountSignupPrefillResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get pending pre-filled sign up for a new Dintero Account
          sidebarTitle: Get pending pre-filled sign up for a new Dintero Account
  /accounts/{oid}/signup/verify:
    post:
      operationId: accounts_oid_signup_verify_post
      summary: accounts_oid_signup_verify_post
      x-scopes:
        - create:account
      description: |
        Complete the signup for a Dintero Account by sending the verification code
        sent to the applicant

        scopes:
        - create:account
      tags:
        - account-onboarding
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/owner'
        - name: verification_code
          in: query
          required: true
          description: |
            Verification code sent to the applicant email when requesting a signup
            [POST /accounts/{oid}/signup](/management-auth-api/account-onboarding/accounts_oid_signup_post)
          schema:
            type: string
        - name: authorize
          in: query
          description: |
            Request access tokens to be included in the response.
          schema:
            type: string
            enum:
              - Bearer
      responses:
        '200':
          $ref: '#/components/responses/EmailAuthorizedUserResponse'
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Verify signup
          sidebarTitle: Verify signup
  /accounts/{partner_id}/auth/exchange_token:
    post:
      operationId: aid_auths_oauth_exchange_token_post
      summary: aid_auths_oauth_exchange_token_post
      description: |
        Use this endpoint to exchange access_token to a sub-account

        scopes:
        - admin:accounts
        - read:accounts
      x-scopes:
        - admin:accounts
        - read:accounts
      tags:
        - authenticate
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/partnerId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Exchange'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Exchange Token
          sidebarTitle: Exchange Token
  /accounts/{aid}/products/catalogs:
    get:
      operationId: aid_catalogs_get
      summary: aid_catalogs_get
      description: |
        Get catalogs from account based on query parameters

        scopes:
          - admin:products
          - write:products
          - read:products
      x-scopes:
        - admin:products
        - write:products
        - read:products
      tags:
        - catalogs
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          description: Catalog collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  catalogs:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Catalog'
                        - $ref: '#/components/schemas/Entity'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Catalogs collection
          sidebarTitle: Catalogs collection
    post:
      operationId: aid_catalogs_post
      summary: aid_catalogs_post
      description: |
        Create a new product catalog

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - catalogs
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    catalog_id:
                      type: string
                      maxLength: 255
                      description: |
                        The id you have defined for the catalog.
                        (must not have trailing or leading spaces). An
                        auto-generated catalog_id will be created if no catalog_id
                        is provided
                      example: SK33
                      readOnly: false
                - $ref: '#/components/schemas/Catalog'
        description: catalogs
        required: true
      responses:
        '200':
          description: Catalog created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new catalog
          sidebarTitle: Create new catalog
  /accounts/{aid}/products/catalogs/{catalog_id}:
    put:
      operationId: aid_catalogs_put
      summary: aid_catalogs_put
      description: |
        Update an existing catalog

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - catalogs
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Catalog'
        description: catalog
        required: true
      responses:
        '200':
          description: Catalog updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update catalog
          sidebarTitle: Update catalog
    delete:
      operationId: aid_catalogs_delete
      summary: aid_catalogs_delete
      description: |
        Delete catalog and all corresponding products

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
      tags:
        - catalogs
      security:
        - JWT: []
      responses:
        '200':
          description: Catalog deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete catalog
          sidebarTitle: Delete catalog
  /accounts/{aid}/products/catalogs/{catalog_id}/products:
    get:
      operationId: aid_products_get
      summary: aid_products_get
      description: |
        Get products in a catalog based on query parameters

        scopes:
          - admin:products
          - write:products
          - read:products
      x-scopes:
        - admin:products
        - write:products
        - read:products
      tags:
        - products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
        - $ref: '#/components/parameters/productId'
        - $ref: '#/components/parameters/product_name'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          description: Product collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  products:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/ProductResponse'
                        - properties:
                            groups:
                              type: array
                              items:
                                $ref: '#/components/schemas/Group'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Products collection
          sidebarTitle: Products collection
    post:
      operationId: aid_products_post
      summary: aid_products_post
      description: |
        Create a new product

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductPost'
        description: product to create
        required: true
      responses:
        '200':
          description: Product created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ProductResponse'
                  - properties:
                      groups:
                        type: array
                        items:
                          $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new product
          sidebarTitle: Create new product
  /accounts/{aid}/products/catalogs/{catalog_id}/products/{product_id}:
    put:
      operationId: aid_products_put
      summary: aid_products_put
      description: |
        Update an existing product

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      tags:
        - products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
        - $ref: '#/components/parameters/product_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Product'
        description: products
        required: true
      responses:
        '200':
          description: Product updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update product
          sidebarTitle: Update product
    delete:
      operationId: aid_catalog_id_product_delete
      summary: aid_catalog_id_product_delete
      description: |
        Delete product in a given catalog

        scopes:
          - admin:products
          - write:products
      x-scopes:
        - admin:products
        - write:products
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/catalogId'
        - $ref: '#/components/parameters/product_id'
      tags:
        - products
      responses:
        '200':
          description: Product deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete product
          sidebarTitle: Delete product
  /accounts/{aid}/products/groups:
    get:
      operationId: aid_group_get
      summary: aid_group_get
      description: |
        Lists all groups
      x-scopes:
        - admin:products
        - write:products
      tags:
        - groups
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/group_id_query'
      responses:
        '200':
          description: Group collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  groups:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Entity'
                        - $ref: '#/components/schemas/Group'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Group collection
          sidebarTitle: Group collection
    post:
      operationId: aid_group_post
      summary: aid_group_post
      description: |
        Insert a new group
      x-scopes:
        - admin:products
        - write:products
      tags:
        - groups
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    group_id:
                      type: string
                      maxLength: 255
                      description: |
                        The id you have defined for the group (must not have training or leading spaces). An auto-generated group_id will be created if not provided
                      example: b1
                      readOnly: false
                - $ref: '#/components/schemas/Group'
        description: group
        required: true
      responses:
        '200':
          description: Group created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new group
          sidebarTitle: Create new group
  /accounts/{aid}/products/groups/{group_id}:
    put:
      operationId: aid_group_put
      summary: aid_group_put
      description: |
        Update an existing group
      x-scopes:
        - admin:products
        - write:products
      tags:
        - groups
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/groupId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Group'
        description: group
        required: true
      responses:
        '200':
          description: Group updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update group
          sidebarTitle: Update group
    delete:
      operationId: aid_delete
      summary: aid_delete
      description: |
        Delete an existing group
      x-scopes:
        - admin:products
        - write:products
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/groupId'
      tags:
        - groups
      security:
        - JWT: []
      responses:
        '200':
          description: Group deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete group
          sidebarTitle: Delete group
  /accounts/{aid}/products/tax:
    get:
      operationId: aid_tax_get
      summary: aid_tax_get
      description: |
        Lists all taxgroups
      x-scopes:
        - admin:products
        - write:products
      tags:
        - tax
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          description: Taxgroup collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  tax_groups:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Entity'
                        - $ref: '#/components/schemas/TaxGroup'
                  starting_after:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Taxgroup collection
          sidebarTitle: Taxgroup collection
    post:
      operationId: aid_tax_post
      summary: aid_tax_post
      description: |
        Insert a new taxgroup
      x-scopes:
        - admin:products
        - write:products
      tags:
        - tax
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - properties:
                    tax_id:
                      type: string
                      maxLength: 255
                      description: |
                        The id you have defined for the taxgroup (must not have training or leading spaces). An auto-generated tax_id will be created if not provided
                      example: vmva1
                      readOnly: false
                - $ref: '#/components/schemas/TaxGroup'
        description: tax_group
        required: true
      responses:
        '200':
          description: Taxgroup created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/TaxGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new taxgroup
          sidebarTitle: Create new taxgroup
  /accounts/{aid}/products/tax/{tax_id}:
    put:
      operationId: aid_tax_put
      summary: aid_tax_put
      description: |
        Update an existing taxgroup
      x-scopes:
        - admin:products
        - write:products
      tags:
        - tax
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/taxId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxGroup'
        description: tax_group
        required: true
      responses:
        '200':
          description: Taxgroup updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/TaxGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update taxgroup
          sidebarTitle: Update taxgroup
    delete:
      operationId: aid_tax_delete
      summary: aid_tax_delete
      description: |
        Delete an existing taxgroup
      x-scopes:
        - admin:products
        - write:products
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/taxId'
      tags:
        - tax
      security:
        - JWT: []
      responses:
        '200':
          description: Taxgroup deleted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/TaxGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete taxgroup
          sidebarTitle: Delete taxgroup
  /accounts/{aid}/receipts:
    post:
      operationId: aid_receipts_post
      summary: aid_receipts_post
      description: |
        Post receipts

        scopes:
        - admin:receipts
        - write:receipts
      tags:
        - receipts
      x-scopes:
        - admin:receipts
        - write:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: token_expire_days
          in: query
          description: |
            Generate tokens for the receipts created, the token can be used
            to retrieve the receipt from:

             - [GET /receipts](/receipts-api/receipts/aid_receipts_receipt_token_get)

            Following values will be added to `extra_info` when receipt
            is created with this query parameter:

             - `dintero.receipt.token.value`: JWT token that can be used to
               retrieve the receipt.
             - `dintero.receipt.token.expires_at`: The date-time when the
               token expires.
             - `dintero.receipt.token.url`: URL to retrieve the receipt using
               the token.
          schema:
            type: integer
            minimum: 1
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Receipt'
                  - properties:
                      receipt_id:
                        type: string
                        minLength: 1
        description: receipt
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt created
          content:
            application/json:
              schema:
                type: object
                properties:
                  receipts:
                    type: array
                    items:
                      $ref: '#/components/schemas/Entity'
                  duplicates:
                    type: integer
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '404':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create new Receipts
          sidebarTitle: Create new Receipts
  /accounts/{aid}/receipts/all/{receipt_id}:
    put:
      operationId: aid_receipts_update_put
      summary: aid_receipts_update_put
      description: |
        Update existing anonymous receipt.

        ### Limitation

        - update of customer_id is only allowed if the current customer_id
          is null.
        - update of discounts is only allowed if current discounts value is
          null or empty

        scopes:
        - admin:receipts
        - read:receipts
      x-scopes:
        - admin:receipts
        - read:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/receipt_id'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_id
              properties:
                customer_id:
                  type: string
                  description: |
                    Add customer_id to existing receipt.

                    The customer id identifying the customer.
                    (must not have trailing or leading spaces)
                  example: C13db4f63
                  maxLength: 255
                discounts:
                  description: |
                    Add discount to existing receipt.
                  type: array
                  items:
                    $ref: '#/components/schemas/DiscountRefs'
        description: changes
        required: true
      tags:
        - receipts
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Receipt'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Update receipt
          sidebarTitle: Update receipt
  /accounts/{aid}/receipts/customer_segment:
    post:
      operationId: aid_receipts_customer_segment_post
      summary: aid_receipts_customer_segment_post
      description: |
        Segment customer by receipt data

        scopes:
        - admin:receipts
        - read:receipts
      tags:
        - segment
      x-scopes:
        - admin:receipts
        - read:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                purchase_from:
                  type: string
                  format: date-time
                purchase_to:
                  type: string
                  format: date-time
                store_ids:
                  type: array
                  items:
                    type: string
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      group:
                        type: string
        description: segmentation on receipt data
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Customer matching segmentation
          content:
            application/json:
              schema:
                type: object
                properties:
                  customers:
                    type: array
                    items:
                      type: object
                      properties:
                        customer_id:
                          type: string
                          format: uuid
                        purchases:
                          type: integer
                          example: 5
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Customer segmentation
          sidebarTitle: Customer segmentation
  /accounts/{aid}/receipts/customers/{customer_id}:
    get:
      operationId: aid_receipts_customers_cid_get
      summary: aid_receipts_customers_cid_get
      description: |
        Get the receipts for a customer

        scopes:
        - admin:receipts
        - read:receipts
        - user:receipts
      tags:
        - customer receipts
      x-scopes:
        - admin:receipts
        - read:receipts
        - user:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  receipts:
                    type: array
                    items:
                      $ref: '#/components/schemas/ReceiptMinimal'
                  starting_after:
                    type: string
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Customer Receipts collection
          sidebarTitle: Customer Receipts collection
  /accounts/{aid}/receipts/customers/{customer_id}/{receipt_id}:
    get:
      operationId: aid_receipts_customers_cid_rid_get
      summary: aid_receipts_customers_cid_rid_get
      description: |
        Get a customer receipt

        scopes:
        - admin:receipts
        - read:receipts
        - user:receipts
      tags:
        - customer receipts
      x-scopes:
        - admin:receipts
        - read:receipts
        - user:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/receipt_id'
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt detail
          content:
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/Receipt'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Customer receipt details
          sidebarTitle: Customer receipt details
  /accounts/{aid}/receipts/customers/{customer_id}/{receipt_id}/change_customer_id:
    post:
      operationId: aid_receipts_customers_cid_rid_change_customer_id_post
      summary: aid_receipts_customers_cid_rid_change_customer_id_post
      description: |
        Update customer_id for an receipt, i.e. move the receipt
        to a new customer

        > **warning**: The receipt will no longer be accessible
        > by the previous customer_id

        Following extra_info field will be added to the receipt
        when customer_id is changed using key

         - `dintero.receipts.change_customer_id.{timestamp}.{hash}`

        The content of the extra_info will be a JSON string containing:

         - created_at
         - created_by
         - old
         - new

        scopes:
        - admin:receipts
      tags:
        - customer receipts
      x-scopes:
        - admin:receipts
        - read:receipts
        - user:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/receipt_id'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  maxLength: 255
                  minLength: 1
                  description: |
                    New customer_id
                    (must not have trailing or leading spaces).
        description: Receipt update
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt detail with new customer_id
          content:
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/Receipt'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Change customer_id
          sidebarTitle: Change customer_id
  /accounts/{aid}/receipts/receipt-token:
    post:
      operationId: aid_receipts_receipt_token_post
      summary: aid_receipts_receipt_token_post
      description: |
        Update `customer_id` on receipt identified by token. The token will be
        invalid after the claim.

        scopes:
        - admin:receipts
        - write:receipts
        - user:receipts
      tags:
        - receipts
      x-scopes:
        - admin:receipts
        - write:receipts
        - user:receipts
        - public:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: token
          description: JWT token for receipt
          in: query
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_id
              properties:
                customer_id:
                  type: string
        description: new customer id
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt claimed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Receipt'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Claim receipt by token
          sidebarTitle: Claim receipt by token
    get:
      operationId: aid_receipts_receipt_token_get
      summary: aid_receipts_receipt_token_get
      description: |
        Get receipt from token. The token must be a signed JWT token
        containing the `customer_id` and `receipt_id` to fetch.

        scopes:
        - admin:receipts
        - read:receipts
        - user:receipts
        - public:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: token
          description: JWT token for receipt
          in: query
          required: true
          schema:
            type: string
      tags:
        - receipts
      x-scopes:
        - admin:receipts
        - read:receipts
        - user:receipts
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Receipt'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get receipt by token
          sidebarTitle: Get receipt by token
  /accounts/{aid}/receipts/search:
    get:
      operationId: aid_receipts_rid_get
      summary: aid_receipts_rid_get
      description: |
        Get receipts matching receipt_id (POS id)

        scopes:
        - admin:receipts
        - read:receipts
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/receiptId'
      tags:
        - receipts
      x-scopes:
        - admin:receipts
        - read:receipts
      security:
        - JWT: []
      responses:
        '200':
          description: Receipt collection
          content:
            application/json:
              schema:
                type: object
                properties:
                  receipts:
                    type: array
                    items:
                      $ref: '#/components/schemas/Receipt'
                  starting_after:
                    type: string
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Receipt search
          sidebarTitle: Receipt search
  /accounts/{aid}/wallets/cards:
    post:
      operationId: aid_cards_post
      summary: aid_cards_post
      description: |
        Create a new card

        scopes:
        - admin:wallets
        - write:wallets
      tags:
        - cards
      x-scopes:
        - admin:wallets
        - write:wallets
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - $ref: '#/components/schemas/Card'
                - properties:
                    pin:
                      $ref: '#/components/schemas/PinGenerator'
                    card_token:
                      $ref: '#/components/schemas/TokenGenerator'
        description: card details
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Card created
          content:
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/Card'
                  - properties:
                      pin:
                        $ref: '#/components/schemas/PinGenerator'
                      card_token:
                        $ref: '#/components/schemas/TokenGenerator'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create a card
          sidebarTitle: Create a card
    get:
      operationId: aid_cards_get
      summary: aid_cards_get
      description: |
        Get all cards for an account

        scopes:
        - admin:wallets
        - read:wallets
      tags:
        - cards
      x-scopes:
        - admin:wallets
        - read:wallets
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - name: search
          in: query
          description: |
            Will try to match the search to either `card_id`, `customer_id` or `amount`
          required: false
          schema:
            type: string
        - name: created_at.gte
          in: query
          description: Card created after (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
          required: false
          schema:
            type: string
            format: isodate
        - name: created_at.lte
          in: query
          description: Card created before a date (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
          required: false
          schema:
            type: string
            format: isodate
        - name: type
          in: query
          description: |
            Filter cards by type
          required: false
          schema:
            type: string
            enum:
              - gift_card
              - credit_note
        - name: status
          in: query
          description: |
            Filter cards by amount and expiry status
          required: false
          schema:
            type: string
            enum:
              - inactive
              - unused
              - partially_used
              - used
              - expired
        - name: expires_at.gte
          in: query
          description: Card expires after (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
          required: false
          schema:
            type: string
            format: isodate
        - name: expires_at.lte
          in: query
          description: Card expires before a date (ISO 8601. We recommend using a localised ISO 8601 datetime like `2017-07-21T17:32:28Z`. If a timezone is not specified we assume UTC)
          required: false
          schema:
            type: string
            format: isodate
        - name: amount_balance
          in: query
          description: Exact card balance
          required: false
          schema:
            type: integer
        - name: amount_balance.gte
          in: query
          description: Lower limit for filtering on card balance.
          required: false
          schema:
            type: integer
        - name: amount_balance.lte
          in: query
          description: Upper limit for filtering on card balance.
          required: false
          schema:
            type: integer
        - name: amount_available
          in: query
          description: Amount available on the card
          required: false
          schema:
            type: integer
        - name: amount_available.gte
          in: query
          description: Lower limit for filtering on available amount on card.
          required: false
          schema:
            type: integer
        - name: amount_available.lte
          in: query
          description: Upper limit for filtering on available amount on card.
          required: false
          schema:
            type: integer
        - name: currency
          in: query
          description: |
            The currency of the card. `?currency=NOK&currency=SEK`
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: customer
          in: query
          description: |
            Filter cards by `customer_id`
          required: false
          schema:
            type: string
      security:
        - JWT: []
      responses:
        '200':
          description: Collection of cards
          content:
            application/json:
              schema:
                type: object
                required:
                  - cards
                properties:
                  cards:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Card'
                  starting_after:
                    type: string
                    description: |
                      The cursor to use in the next request to get the next page of results
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get cards
          sidebarTitle: Get cards
  /accounts/{aid}/wallets/cards/{card_id}:
    get:
      operationId: aid_cards_cardid_get
      summary: aid_cards_cardid_get
      description: |
        Get all details about a card

        scopes:
        - admin:wallets
        - read:wallets
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/cardId'
        - name: includes
          in: query
          description: |
            Comma separated list of additional fields to include in the response.
            Possible values are:
            - `token.format`: Include the format that was used to generate token.
            - `pin.format`: Include the format that was used to generate PIN.
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - token.format
                - pin.format
      tags:
        - cards
      x-scopes:
        - admin:wallets
        - read:wallets
      security:
        - JWT: []
      responses:
        '200':
          description: Card details
          content:
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/CardDetails'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Retrieve card by card ID
          sidebarTitle: Retrieve card by card ID
  /accounts/{aid}/wallets/cards/{card_id}/tokens:
    post:
      operationId: aid_cards_cardid_token_post
      summary: aid_cards_cardid_token_post
      description: |
        Create a temporary `token` (also referred as Card Code)
        for the card, an temporary alias that must be used when
        when creating a drawdown transaction

        The token can be stored in a barcode to allow use of virtuell card
        in purchase in POS or webstore

        scopes:
        - admin:wallets
        - write:wallets
      tags:
        - cards
      x-scopes:
        - admin:wallets
        - write:wallets
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/cardId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Metadata'
                - $ref: '#/components/schemas/BaseOperation'
                - $ref: '#/components/schemas/TokenGenerator'
        description: token details
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Token created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create a token for the card
          sidebarTitle: Create a token for the card
  /accounts/{aid}/wallets/cards/{card_id}/transactions:
    get:
      operationId: aid_cards_cardid_transactions_tid_get
      summary: aid_cards_cardid_transactions_tid_get
      description: |
        Retrieve a list of Card's Transaction based on card id

        scopes:
        - admin:wallets
        - read:wallets
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/cardId'
      tags:
        - transactions
      security:
        - JWT: []
      x-scopes:
        - admin:wallets
        - read:wallets
      responses:
        '200':
          description: Transcation list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Transaction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List card transactions
          sidebarTitle: List card transactions
  /accounts/{aid}/wallets/customers/{customer_id}/cards:
    get:
      operationId: aid_customers_cid_cards_get
      summary: aid_customers_cid_cards_get
      description: |
        Get the cards active for a customer

        scopes:
        - admin:wallets
        - read:wallets
        - user:wallets
      tags:
        - customers
      x-scopes:
        - admin:wallets
        - read:wallets
        - user:wallets
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
      responses:
        '200':
          description: Card details
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerCard'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List customer cards
          sidebarTitle: List customer cards
  /accounts/{aid}/wallets/customers/{customer_id}/cards/{card_id}:
    get:
      operationId: aid_customers_cid_card_cid_get
      summary: aid_customers_cid_card_cid_get
      description: |
        Get all details about a customer card 

        scopes:
        - admin:wallets
        - read:wallets
        - user:wallets
      tags:
        - customers
      x-scopes:
        - admin:wallets
        - read:wallets
        - user:wallets
      security:
        - JWT: []
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/cardId'
      responses:
        '200':
          description: Card details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerCardState'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get customer card details
          sidebarTitle: Get customer card details
  /accounts/{aid}/wallets/info:
    post:
      operationId: aid_cards_token_post
      summary: aid_cards_token_post
      description: |
        Get details about a card, including the current balance and available
        funds. No details will be returned for expired tokens

        scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/info
      tags:
        - cards
      x-scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/info
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TokenCode'
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Card info details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Retrieve card by Token
          sidebarTitle: Retrieve card by Token
  /accounts/{aid}/wallets/transactions:
    post:
      operationId: aid_cards_transactions_post
      summary: aid_cards_transactions_post
      description: |
        Create a transaction against a Card using `token` or `card_id`.
        If the Transactions is created as pending, the value will
        be locked until it is either captured or voided. Transaction ID must
        be used when capturing or voiding a transaction.

        > Using **`card_id`** or creating a **`fund`** transaction requires
        > authorization scope `admin:wallets` or `write:wallets`

        scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/transactions
      tags:
        - transactions
      x-scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/transactions
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CardByIdOrToken'
                - $ref: '#/components/schemas/TransactionInput'
                - properties:
                    type:
                      type: string
                      default: drawdown
                      enum:
                        - drawdown
                        - fund
                    pending:
                      type: boolean
                      default: false
                      description: |
                        If true, the transaction will be created as pending, i.e.
                        the value will be locked until it is either captured or
                        voided.

                        > Only supported when creating a `drawdown` transaction.
        description: transaction details
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Transaction created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create transaction
          sidebarTitle: Create transaction
  /accounts/{aid}/wallets/transactions/{transaction_id}/capture:
    post:
      operationId: aid_cards_cardid_transactions_capture_post
      summary: aid_cards_cardid_transactions_capture_post
      description: |
        Capture a pending Transaction, thereby collection the amount
        withheld by the pending transaction.

        Option to specify an amount that should be captured. 
        Defaults to capture the full transaction.
        When the amount specified is less than the reserved/pending, 
        the remaining amount will still be reserved/pending and can be captured later.

        scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/transactions
      tags:
        - transactions
      x-scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/transactions
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/transactionId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Metadata'
                - $ref: '#/components/schemas/BaseOperation'
                - $ref: '#/components/schemas/OptionalAmount'
        description: capture details
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Transaction created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Capture pending transaction
          sidebarTitle: Capture pending transaction
  /accounts/{aid}/wallets/transactions/{transaction_id}/void:
    post:
      operationId: aid_cards_cardid_transactions_void_post
      summary: aid_cards_cardid_transactions_void_post
      description: |
        Void a pending Transaction by unlocking the amount
        withheld by the pending transaction

        scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/transactions
      tags:
        - transactions
      x-scopes:
        - admin:wallets
        - write:wallets
        - write:wallets:/transactions
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/transactionId'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Metadata'
                - $ref: '#/components/schemas/BaseOperation'
        description: void details
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Transaction voided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Void pending transaction
          sidebarTitle: Void pending transaction
  /accounts/{aid}/hooks/subscriptions:
    post:
      operationId: aid_source_hooks_post
      summary: aid_source_hooks_post
      description: |

        When you create a new webhook, we'll send you a simple ping event to
        let you know you've set up the webhook correctly.
        You can trigger a ping again by calling the
        [ping endpoint](/webhooks-api/subscription-deliveries/aid_source_hooks_hid_ping_post).

        ## Receiving Webhooks

        In order for Dintero to send webhook payloads, your server needs to be
        accessible from the Internet. We also highly suggest using SSL
        so that we can send encrypted payloads over HTTPS.

        ## Respond to a webhook

        Your webhook acknowledges that it received data by sending a 200 OK
        response. Any response outside of the 200 range will let Dintero
        know that you did not receive your webhook, including 301 Redirect.
        Dintero does not follow redirects for webhook notifications and will
        consider a redirection as an error response.

        Dintero has implemented a 60-second timeout period and a retry
        period for subscriptions. We wait 120 seconds for a response to
        each request, and if there isn't one or we get an error, we retry
        the connection to a total of 5 times.
        A webhook will be deleted if there are consecutive failures for the
        exact same webhook. You should monitor the admin of your webhook
        tool for failing webhooks.

        ### Webhooks Headers

        Dintero will send along several HTTP headers to differentiate between
        event types and payload identifiers.

        | Name           | Description                                          |
        |----------------|------------------------------------------------------|
        | event          | The event type                                       |
        | event-delivery | A guid to indentify the payload and event being sent |
        | event-signature| The value of this header is computed as the HMAC SHA1 hex digest of the body, using the secret config option as the key. |

        scopes:
        - admin:hooks
        - write:hooks
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - write:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Hook'
        description: subscription configuration
        required: true
      security:
        - JWT: []
      responses:
        '200':
          description: Subscription created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Hook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Create subscription
          sidebarTitle: Create subscription
    get:
      operationId: aid_source_hooks_get
      summary: aid_source_hooks_get
      description: |
        Get a list of all subscriptions

        scopes:
        - admin:hooks
        - read:hooks
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - name: include_deleted
          description: |
            include deleted subscriptions in the response.
          in: query
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/startingAfter'
        - $ref: '#/components/parameters/total'
      security:
        - JWT: []
      responses:
        '200':
          description: Subscriptions
          headers:
            page-count:
              description: |
                count object in response
              schema:
                type: integer
            total-count:
              description: |
                total count, only set if query parameter
                `total` is set
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Hook'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List subscriptions
          sidebarTitle: List subscriptions
  /accounts/{aid}/hooks/subscriptions/{hid}:
    get:
      operationId: aid_source_hooks_hid_get
      summary: aid_source_hooks_hid_get
      description: |
        Get subscription details

        scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - read:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Hook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get subscription details
          sidebarTitle: Get subscription details
    delete:
      operationId: aid_source_hooks_hid_delete
      summary: aid_source_hooks_hid_delete
      description: |
        Delete a webhook subscription

        No more events will be sent to the webhook

        scopes:
        - admin:hooks
        - write:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscriptions
      x-scopes:
        - admin:hooks
        - write:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Subscription deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Hook'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Delete Subscription
          sidebarTitle: Delete Subscription
  /accounts/{aid}/hooks/subscriptions/{hid}/deliveries:
    get:
      operationId: aid_source_hooks_hid_deliveries_get
      summary: aid_source_hooks_hid_deliveries_get
      description: |
        Get recent subscription deliveries

        scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscription deliveries
      x-scopes:
        - admin:hooks
        - read:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Deliveries Collection
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HookDelivery'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: List subscription deliveries
          sidebarTitle: List subscription deliveries
  /accounts/{aid}/hooks/subscriptions/{hid}/deliveries/{delivery_id}:
    get:
      operationId: aid_source_hooks_hid_deliveries_did_get
      summary: aid_source_hooks_hid_deliveries_did_get
      description: |
        Get subscription delivery details

        scopes:
        - admin:hooks
        - read:hooks
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
        - name: delivery_id
          in: path
          required: true
          description: delivery id
          schema:
            type: string
      tags:
        - subscription deliveries
      x-scopes:
        - admin:hooks
        - read:hooks
      security:
        - JWT: []
      responses:
        '200':
          description: Deliveries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HookDeliveryDetail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Get delivery details
          sidebarTitle: Get delivery details
  /accounts/{aid}/hooks/subscriptions/{hid}/ping:
    post:
      operationId: aid_source_hooks_hid_ping_post
      summary: aid_source_hooks_hid_ping_post
      description: |
        This will trigger a ping event to be sent to the subscription URL.

        ### Ping Event Payload

        ```http
        POST /
        User-Agent: Dintero-Hook/0c9ad03b
        Content-Type: application/json
        event: ping
        event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

        {
          "created_at": "2017-12-06T15:36:43Z",
          "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
          "id": "string",
          "updated_at": "2017-12-06T15:36:43Z",
          "active": true,
          "config": {
            "content_type": "application/json",
            "insecure_ssl": 0,
            "secret": { ... }
            "url": "string"
          },
          "events": ["receipt_add"]
        }
        ```
      parameters:
        - $ref: '#/components/parameters/accountId'
        - $ref: '#/components/parameters/subscriptionId'
      tags:
        - subscription deliveries
      x-scopes:
        - admin:hooks
        - write:hooks
      security:
        - JWT: []
      responses:
        '204':
          headers:
            event-delivery:
              schema:
                type: string
          description: No Content
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Subscription ping
          sidebarTitle: Subscription ping
  /examples/approval_payout_destination_update:
    post:
      operationId: example_approval_payout_destination_update_event
      summary: example_approval_payout_destination_update_event
      description: |
        Event is pushed to subscribers when the `case_status`
        of a seller approval changes
      tags:
        - example-management-auth-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: approval_payout_destination_update
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalPayoutDestinationUpdateEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: approval_payout_destination_update
          sidebarTitle: approval_payout_destination_update
  /examples/checkout_transaction:
    post:
      operationId: example_checkout_transaction_event
      summary: example_checkout_transaction_event
      description: |
        Event is pushed to subscribers when the checkout transaction is created or
        updated
      tags:
        - example-checkout-events
      security: []
      parameters:
        - name: event
          in: header
          required: true
          example: checkout_transaction_update
          schema:
            type: string
        - name: event-delivery
          in: header
          required: true
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
          schema:
            type: string
        - name: event-signature
          in: header
          example: f572d396fae9206628714fb2ce00f72e94f2258f
          schema:
            type: string
        - name: content-type
          in: header
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutTransactionEvent'
        required: true
      responses:
        '200':
          description: event handled
        '400':
          description: ignored, stop resend
        '500':
          description: unhandled, resend
      x-mint:
        metadata:
          title: checkout_transaction
          sidebarTitle: checkout_transaction
  /logs/events:
    post:
      operationId: internal_logs_events_post
      summary: internal_logs_events_post
      description: |
        Endpoint intended for Dintero frontend to report any
        error raised during operation
      tags:
        - log events
      security: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                account_id:
                  type: string
                request_id:
                  type: string
                  description: request-id received from Dintero API request
                client_session_id:
                  type: string
                  description: |
                    frontend session id
                metadata:
                  type: array
                  description: |
                    Additional metadata about the error event
                  example:
                    - key: origin
                      value: iframe
                    - key: iframe-src
                      value: https://example.com/77f1c47192210b13570f6f
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                      value:
                        type: string
                message:
                  type: string
                error:
                  type: string
        required: true
      responses:
        '204':
          description: Event added
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      x-mint:
        metadata:
          title: Add log event
          sidebarTitle: Add log event
x-tagGroups:
  - name: auth
    tags:
      - authenticate
      - clients
      - grants
      - roles
      - keys
      - auth users
      - challenge
  - name: customers
    tags:
      - users
      - tokens
      - password
      - communication
      - tags
      - terms
      - settings
  - name: discounts
    tags:
      - rules
      - rules customers
      - use discounts
      - campaigns
  - name: automations
    tags:
      - rules automations
  - name: products
    tags:
      - catalogs
      - products
      - tax
  - name: receipts
    tags:
      - receipts
      - customer receipts
      - segment
  - name: wallets
    tags:
      - cards
      - customers
      - transactions
  - name: saleslocations
    tags:
      - locations
  - name: webhooks
    tags:
      - subscriptions
      - subscription deliveries
  - name: logs
    tags:
      - log events
servers:
  - url: https://api.dintero.com/v1
components:
  parameters:
    accountId:
      name: aid
      description: |
        An id that uniquely identifies the account.
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}\d{8}$
        minLength: 9
        maxLength: 9
    limit:
      name: limit
      in: query
      description: |
        A limit on the number of objects to be returned. Limit can range
        between 1 and 100 items, and the default is 10 items.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
    startingAfter:
      name: starting_after
      in: query
      description: |
        cursor for use in pagination. starting_after is an object ID
        that defines your place in the list. For instance, if you make
        a list request and receive 100 objects, end the result contains
          `paging_token=pt1`, your subsequent call can include
        `starting_after=pt1` in order to fetch the next page of the list.
      required: false
      schema:
        type: string
    total:
      name: total
      in: query
      description: |
        include `total-count` header in the response
      required: false
      schema:
        type: boolean
        default: false
    customerId:
      name: customer_id
      description: |
        The customer id you have defined for the customer.
        (must not have trailing or leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    country:
      name: country
      description: |
        ISO 3166-1 country code
      in: path
      required: true
      schema:
        type: string
    discountId:
      name: did
      description: An UUID that uniquely identifies the discount
      in: path
      required: true
      schema:
        type: string
        format: uuid
    owner:
      name: oid
      description: |
        An id that uniquely identifies the account or owner (partner)
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}(?=(?:.{3}|.{8})$)[0-9]*$
    user:
      name: uid
      description: |
        Id identifying the user
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    partnerId:
      name: partner_id
      description: |
        An id that uniquely identifies the partner account
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}\d{3}00000$
        minLength: 9
        maxLength: 9
    catalogId:
      name: catalog_id
      description: |
        An id that uniquely identifies the catalog. (must not have trailing or leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    productId:
      name: product_id
      description: |
        A string that uniquely identifies the product. (must not have trailing or leading spaces)
      in: query
      required: false
      schema:
        type: string
    product_name:
      name: product_name
      description: |
        Lookup on product name
      in: query
      required: false
      schema:
        type: string
    product_id:
      name: product_id
      description: |
        A string that uniquely identifies the product. (must not have trailing or leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    group_id_query:
      name: group_id
      description: |
        A string that uniquely identifies the group. (must not have trailing or leading spaces)
      in: query
      schema:
        type: string
        maxLength: 255
    groupId:
      name: group_id
      description: |
        A string that uniquely identifies the group. (must not have trailing or leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    taxId:
      name: tax_id
      description: |
        A string that uniquely identifies the tax. (must not have trailing or leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    receipt_id:
      name: receipt_id
      description: |
        A string that uniquely identifies POS receipt
      in: path
      required: true
      schema:
        type: string
    receiptId:
      name: receipt_id
      description: |
        A string that uniquely identifies POS receipt
      in: query
      required: true
      schema:
        type: string
    cardId:
      name: card_id
      description: |
        The card id you have defined for the card.
        (must not have trailing or leading spaces)
      in: path
      required: true
      schema:
        type: string
        maxLength: 255
    transactionId:
      name: transaction_id
      description: |
        An id that uniqely idetifies a transaction
      in: path
      required: true
      schema:
        type: string
        format: uuid
    subscriptionId:
      name: hid
      description: subscription id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    BadRequest:
      description: Bad / Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AccessForbidden:
      description: Access forbidden, invalid JWT token was used
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Too Many Requests
      headers:
        Retry-After:
          description: |
            Indicates how long the user agent should wait
            in seconds before making a follow-up request.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AuthenticatedAccountUserResponse:
      description: User account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthenticatedAccountUser'
    MfaChallengeResponse:
      description: Challenge response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MfaChallenge'
    MfaRecoveryResponse:
      description: Recovery response
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/MfaChallenge'
              - properties:
                  mfa_token:
                    type: string
    UserCreated:
      description: User created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthenticatedUser'
    UserUpdated:
      description: User updated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthenticatedUser'
    UserDeleted:
      description: User deleted
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthenticatedUser'
    AssetUploadUrl:
      description: Upload URL
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UploadUrl'
    AccountResponse:
      description: Account
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Account'
              - $ref: '#/components/schemas/AccountReadOnly'
              - type: object
                properties:
                  configuration:
                    $ref: '#/components/schemas/PartnerConfiguration'
                  onboarding:
                    $ref: '#/components/schemas/AccountOnboarding'
    ApprovalsPaymentList:
      description: List of ApprovalsPaymentResponse objects
      content:
        application/json:
          schema:
            type: object
            properties:
              payments:
                type: array
                items:
                  $ref: '#/components/schemas/ApprovalsPaymentResponse'
    ApprovalsPaymentCreated:
      description: Created ApprovalsPaymentResponse
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApprovalsPaymentResponse'
    ApprovalsPayoutDestinationList:
      description: List of ApprovalsPayoutDestinationResponse objects
      content:
        application/json:
          schema:
            type: object
            properties:
              payout_destinations:
                type: array
                items:
                  $ref: '#/components/schemas/ApprovalsPayoutDestinationResponse'
    ApprovalsPayoutDestinationCreated:
      description: Created ApprovalsPayoutDestinationResponse
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApprovalsPayoutDestinationResponse'
    CustomerDueDiligenceList:
      description: CustomerDueDiligenceCase collection
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/CustomerDueDiligenceCaseResponse'
    CustomerDueDiligenceCaseCreated:
      description: Customer Due Diligence case created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomerDueDiligenceCaseResponse'
    Mastercard3DSConnectionResponse:
      description: Mastercard 3DS Connection response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Mastercard3DSConnection'
    BamboraConnectionResponse:
      description: Bambora Connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BamboraConnection'
    CollectorConnectionResponse:
      description: Collector connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CollectorConnection'
    CommonConnectionResponse:
      description: Common connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CommonConnection'
    InstabankConnectionResponse:
      description: Instabank Connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InstabankConnection'
    KlarnaConnectionResponse:
      description: Klarna Connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/KlarnaConnection'
    PayExConnectionResponse:
      description: PayEx Connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayExConnection'
    SwishConnectionResponse:
      description: Swish connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SwishConnection'
    VippsConnectionResponse:
      description: Vipps connection
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VippsConnection'
    GrantCollection:
      description: Grant Collection
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/Grant'
    GrantCreated:
      description: Grant created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Grant'
    GrantDeleted:
      description: Grant deleted
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Grant'
    GrantUpdated:
      description: Grant updated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Grant'
    ClientCollection:
      description: Client Collection
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/Client'
    ClientWithSecret:
      description: Client with secret
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/Client'
              - properties:
                  client_secret:
                    type: string
                    example: JYCRP/x7iBGWA1fun0J9laH5sEg5cP9g/4QivhfGzm4
                    readOnly: true
    ClientResponse:
      description: Client
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Client'
    KeysCollection:
      description: Keys Collection
      content:
        application/json:
          schema:
            type: array
            items:
              type: object
              properties:
                alg:
                  description: The algorithm for the key
                  type: string
                  example: RS256
                kty:
                  description: The key type
                  type: string
                  enum:
                    - RSA
                use:
                  description: The intended use of the public key
                  type: string
                  enum:
                    - sig
                'n':
                  description: The modulus for a standard pem
                  type: string
                  example: |
                    lC4ehVB6W0OCtNPnz8udYH9Ao83B6EKnHA5eTcMOap_lQZ-nKtS1lZwBj4wXRVc1XmS0d2OQFA1VMQ-dHLDE3CiGfsGqWbaiZFdW7U
                    GLO1nAwfDdH6xp3xwpKOMewDXbAHJlXdYYAe2ap-CE9c5WLTUBU6JROuWcorHCNJisj1aExyiY5t3JQQVGpBz2oUIHo7NRzQoKimvp
                    dMvMzcYnTlk1dhlG11b1GTkBclprm1BmOP7Ltjd7aEumOJWS67nKcAZzl48Zyg5KtV11V9F9dkGt25qHauqFKL7w3wu-DYhT0hmyFc
                    wn-tXS6e6HQbfHhR_MQxysLtDGOk2ViWv8AQ
                e:
                  description: The exponent for a standard pem
                  type: string
                  example: AQAB
                kid:
                  description: The unique identifier for the key
                  type: string
                  example: a8fdc205a9f19cc1c7507a60c4f01b13d11d7fd0
    TokenGranted:
      description: Success
      content:
        application/json:
          schema:
            required:
              - access_token
              - token_type
              - expires_in
            properties:
              access_token:
                type: string
                description: A JWT access token
                example: eyJhbGci...t7P4
              token_type:
                type: string
                enum:
                  - Bearer
              expires_in:
                type: integer
                description: |
                  The lifetime in seconds of the access token.  For
                  example, the value "3600" denotes that the access token will
                  expire in one hour from the time the response was generated.
                example: 86400
              user_info:
                description: |
                  Details about the user provided by the authentication
                  server
                type: object
                required:
                  - authority
                properties:
                  authority:
                    type: string
                    format: url
                    example: https://identityserver.example.com/access
                  value:
                    type: object
                    description: |
                      User information provided by OIDC, properties included depends on
                      the authority
                    properties:
                      sub:
                        type: string
                        example: c06c4afe-d9e1-4c5d-939a-177d752a0944
                      name:
                        type: string
                        example: Ada Lovelace
    AccessCode:
      description: Access code
      content:
        application/json:
          schema:
            type: object
            properties:
              verification_code:
                type: string
                description: The verification code
    RedirectUrl:
      description: |
        Response with redirect URL in response body. `Accept: application/json`
      content:
        application/json:
          schema:
            type: object
            properties:
              redirect_uri:
                description: |
                  The HTTP URL to redirect to with ID token
                format: uri
                pattern: ^https?://.*
                example: https://example.dintero.com/reports/123.pdf?id_token=XB...
    RedirectFound:
      description: Redirect to URL with ID token
      headers:
        Location:
          description: "the URL to redirect to\n\n- `id_token` will be included in the redirect URL as a\n  `query` parameter\n\nA valid `id_token` will contain following claims\n\n query name | type         | description                    | required\n----------- | :----------: | ------------------------------ | :-----------:\nsub         |   string     | User Id                        | true\nemail       |   string     | User email                     | false\nname        |   string     | User name                      | false\naud         |   string     | Redirect URI                   | true\niss         |   string     | Issuer (Dintero)               | true\nexp         |   int        | Token expiry                   |\_true\next_property name* |   string  | Custom claims                  |\_false\n\n```\n{\n  \"kid\" : \"1234example\"\n  \"alg\" : \"RS256\"\n}\n\n{\n  \"aud\": \"${redirect_uri}\n  \"iss\": \"https://P12345678@api.dintero.com\",\n  \"sub\": \"dintero:user:id\",\n  \"email\": \"janedoe@example.com\"\n  \"exp\": 1386899131,\n  \"property name*\": \"custom-claim\"\n}\n```\nThe kid (key ID) should be used to match specific key to use when validating\nthe `id_token`. The `aud` in a valid token will contain the original `redirect_uri`\n(without id_token) that should be used to authorize the request.\n"
          schema:
            type: string
    RoleCollection:
      description: Role Collection
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/AuthRole'
    RoleResponse:
      description: Role
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthRole'
    RoleUpdated:
      description: Role updated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthRole'
    RoleDeleted:
      description: Role deleted
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthRole'
    ExtendedAccountCollection:
      description: List of Accounts
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ExtendedAccount'
    ExtendedAccountResponse:
      description: Account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExtendedAccount'
    ExtendedAccountUpdated:
      description: Account updated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExtendedAccount'
    ExtendedAccountDeleted:
      description: Account deleted
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExtendedAccount'
    AccountConnectionEventResponse:
      description: Connection event
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountConnectionEvent'
    AccountEventCollection:
      description: Account events
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/AccountEvent'
    AccountEventResponse:
      description: Account event
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountEvent'
    MatchSearch:
      description: Possible merchant matches from MATCH
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MatchSearchResponse'
    MatchAddMerchantResponse:
      description: MATCH merchant ID
      content:
        application/json:
          schema:
            type: object
            properties:
              merchant_reference_number:
                type: integer
                description: |
                  Unique ID to identify the added merchant in MATCH
    VMSSInquiry:
      description: Possible merchant matches from VMSS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VMSSInquiryResponse'
    VMSSTerminateMerchant:
      description: The added VMSS record
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/VMSSTerminateMerchantResponse'
    AccountUserCollection:
      description: User collection
      content:
        application/json:
          schema:
            type: array
            items:
              allOf:
                - $ref: '#/components/schemas/AccountAdminUser'
    AccountUserResponse:
      description: Account user
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountAdminUser'
    AccountUserUpdated:
      description: Account user updated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountAdminUser'
    AccountUserDeleted:
      description: Account user deleted
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountAdminUser'
    AuditEventCollection:
      description: List of Audit events
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/AuditEvent'
    AccountSignupPrefillResponse:
      description: Account Signup
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountSignupPreFillRequest'
    AccountSignupAccepted:
      description: Pre-filled sign up accepted by applicant
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/AccountSignupPreFillRequest'
              - $ref: '#/components/schemas/EmailAuthorizedUser'
    EmailAuthorizedUserResponse:
      description: Authorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EmailAuthorizedUser'
  requestBodies:
    AccountSignupPreFillRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountSignupPreFillRequest'
      required: true
    AuthRole:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthRole'
      required: true
  securitySchemes:
    clientAuth:
      type: http
      description: |
        Authorizatoin by using the **Basic** schema with client_id and
        client_secret as username/password
      scheme: basic
    JWT:
      type: http
      description: |
        Bearer authentication (token authentication) should be used for accessing the API.

        Use [Get Token](/api-reference/authenticate/aid_auths_oauth_token_post) to get an access token for client credentials.
        Pass the token in the request header:

            Authorization: Bearer {access_token}

        where the **access_token** is JSON Web Tokens (JWT).
      scheme: bearer
      bearerFormat: JWT
  schemas:
    HMAC-SHA256:
      type: object
      description: HMAC-SHA-256
      allOf:
        - $ref: '#/components/schemas/AutoTokenType'
        - required:
            - secret
          properties:
            secret:
              type: string
              description: |
                Use the secret to compute HMAC SHA256 digest of the source value.
    SHA256:
      type: object
      description: SHA-256
      allOf:
        - $ref: '#/components/schemas/AutoTokenType'
    AutomationActionDiscount:
      x-discriminator-value: discount
      allOf:
        - required:
            - id
          properties:
            id:
              type: string
              description: |
                Id of existing discount to give to customer the
                automation originated from
              readOnly: false
            type:
              type: string
              enum:
                - discount
        - $ref: '#/components/schemas/AutomationActionBase'
      title: discount
    AutomationActionHTTP:
      type: object
      x-discriminator-value: http
      allOf:
        - $ref: '#/components/schemas/AutomationActionBase'
        - required:
            - url
            - method
          properties:
            url:
              type: string
              example: https://api.dintero.com/v1/accounts/{aid}/discounts/rules/{did}/customers
            method:
              type: string
              example: POST
            content_type:
              type: string
              example: application/json
            body:
              type: string
              example: '{ "customers": [ "$.customer_id" ] }'
            type:
              type: string
              enum:
                - http
      title: http
    account_user:
      type: object
      x-discriminator-value: account_user
      allOf:
        - $ref: '#/components/schemas/AuthTokenBase'
        - properties:
            grant_type:
              type: string
              enum:
                - account_user
      title: account_user
    authorization_code:
      type: object
      x-discriminator-value: authorization_code
      allOf:
        - $ref: '#/components/schemas/AuthTokenBase'
        - required:
            - verification_code
            - audience
            - ident_type
            - ident
          properties:
            ident_type:
              type: string
              enum:
                - email
                - user_id
            ident:
              type: string
              description: |
                The email that was use when requesting `verification_code`
                from [POST /v1/accounts/{oid}/auth/passwordless](/management-auth-api/authenticate/aid_auth_account_passwordless_post)
            verification_code:
              type: string
              description: The one-time Passwordless verification-code to exchange for a access token
            audience:
              type: string
              example: https://api.dintero.com/v1/accounts/P00000000
              description: |
                The unique identifier of the target API you want to access.
                The audience must be a grant associated with the client
            grant_type:
              type: string
              enum:
                - authorization_code
      title: authorization_code
    client_credentials:
      description: Client token credential
      x-discriminator-value: client_credentials
      type: object
      allOf:
        - $ref: '#/components/schemas/AuthTokenBase'
        - required:
            - audience
          properties:
            audience:
              type: string
              example: https://api.dintero.com/v1/accounts/P00000000
              description: |
                The unique identifier of the target API you want to access.
                The audience must be a grant associated with the client
            grant_type:
              type: string
              enum:
                - client_credentials
      title: client_credentials
    mfa_oob:
      type: object
      x-discriminator-value: mfa_oob
      allOf:
        - $ref: '#/components/schemas/AuthTokenBase'
        - required:
            - oob_code
            - binding_code
            - mfa_token
          properties:
            oob_code:
              type: string
              description: The `oob_code` received from the challenge response
            binding_code:
              type: string
              description: The binding code sent _out of band_.
            mfa_token:
              type: string
              description: The `mfa_token` received as part of mfa_required error.
            grant_type:
              type: string
              enum:
                - mfa_oob
      title: mfa_oob
    password:
      type: object
      x-discriminator-value: password
      allOf:
        - $ref: '#/components/schemas/AuthTokenBase'
        - required:
            - username
            - password
            - audience
          properties:
            username:
              type: string
              description: |
                The end user's identifier.
            password:
              type: string
              description: |
                The end user's password.
            audience:
              type: string
              example: https://api.dintero.com/v1/accounts/P00000000
              description: |
                The unique identifier of the target API you want to access.
                The audience must be a grant associated with the client
            grant_type:
              type: string
              enum:
                - password
      title: password
    refresh_token:
      type: object
      x-discriminator-value: refresh_token
      description: |
        Refresh an Access Token using a Refresh Token
      allOf:
        - $ref: '#/components/schemas/AuthTokenBase'
        - required:
            - refresh_token
          properties:
            refresh_token:
              type: string
              description: |
                The Refresh Token to use.
            grant_type:
              type: string
              enum:
                - refresh_token
      title: refresh_token
    AccountEventComment:
      x-discriminator-value: comment
      allOf:
        - $ref: '#/components/schemas/AccountEventBase'
        - required:
            - event_type
            - body
            - visibility
          properties:
            event_type:
              description: |
                The event_type corresponding to comment event
              type: string
              enum:
                - comment
            body:
              type: string
            visibility:
              type: string
              enum:
                - private
      title: comment
    AccountEventStatistics:
      x-discriminator-value: statistics
      allOf:
        - $ref: '#/components/schemas/AccountEventBase'
        - required:
            - event_type
            - statistics
          properties:
            event_type:
              description: |
                The event_type corresponding to comment event
              type: string
              enum:
                - statistics
            statistics:
              $ref: '#/components/schemas/AccountMonthlyStatistics'
      title: statistics
    BatchResponse:
      allOf:
        - type: object
          properties:
            catalog:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - $ref: '#/components/schemas/Catalog'
            products:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Product'
    HMAC-SHA1:
      type: object
      description: Sign all requests with HMAC SHA1, signature added to `event-signature` header.
      x-discriminator-value: HMAC-SHA1
      allOf:
        - $ref: '#/components/schemas/SecretBase'
        - required:
            - value
          properties:
            value:
              type: string
              description: |
                Use the value to compute HMAC SHA1 hex digest of
                the body and pass it with the HTTP requests as
                an `event-signature` header.
            type:
              type: string
              enum:
                - HMAC-SHA1
      title: HMAC-SHA1
    AWS4-HMAC-SHA256:
      type: object
      description: |
        Sign all requests with AWS Signature Version 4.
      x-discriminator-value: AWS4-HMAC-SHA256
      allOf:
        - $ref: '#/components/schemas/SecretBase'
        - required:
            - aws_access_key_id
            - aws_secret_access_key
            - region
            - service
          properties:
            aws_access_key_id:
              type: string
              description: AWS access key
              example: AKIAIOSFODNN7EXAMPLE
            aws_secret_access_key:
              type: string
              description: AWS secret key
              example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
            region:
              type: string
              example: eu-west-1
            service:
              type: string
              example: execute-api
            type:
              type: string
              enum:
                - AWS4-HMAC-SHA256
      title: AWS4-HMAC-SHA256
    Authorization:
      type: object
      description: |
        Include Authorization header on all requests
      x-discriminator-value: Authorization
      allOf:
        - $ref: '#/components/schemas/SecretBase'
        - required:
            - value
          properties:
            value:
              type: string
              example: Bearer <token>
            type:
              type: string
              enum:
                - Authorization
      title: Authorization
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            code:
              type: string
              description: The code used to identify the error/warning
            errors:
              type: array
              description: The nested error(s) encountered during validation
              items:
                type: object
            message:
              type: string
              description: The human readable description of the error/warning
    Auth:
      type: object
      required:
        - audience
        - type
      properties:
        email:
          type: string
          description: |
            **Required** if `ident_type` and `ident` is not set
        ident_type:
          type: string
          description: |
            **Required** if `email` is not set
          enum:
            - phone_number
            - email
        ident:
          type: string
          description: |
            Email or phone_number, depending on the `ident_type`.

            **Required** if `email` is not set.
        audience:
          type: string
          description: |
            The unique identifier of the target API you want to access.
            The audience must be a grant associated with the client used
            when calling this resource.
        type:
          type: string
          enum:
            - customer
            - company
          description: |
            user type to login, required as users with different
            type can share email
    AccessToken:
      type: object
      required:
        - access_token
        - token_type
        - expires_in
      properties:
        access_token:
          type: string
          description: A JWT access token
          example: eyJhbGci...t7P4
        token_type:
          type: string
          enum:
            - Bearer
        expires_in:
          type: integer
          description: |
            The lifetime in seconds of the access token.  For
            example, the value "3600" denotes that the access token will
            expire in one hour from the time the response was generated.
          example: 86400
        refresh_token:
          type: string
          description: |
            Token that can be used to request new tokens when the existing
            Access Token expire.

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

             - `create:accounts:auth:refresh_token`

            and the `grant-type` is one of:

             - `authorization_code`
             - `password`

            **NOTE**:
             - A Single-Page Application should not ever receive a Refresh Token,
               this information is sensitive and should not be exposed client-side
               in a browser.
             - Refresh token must be stored securely by an application since
               they allow a user to remain authenticated essentially forever.
    MFAAuth:
      type: object
      required:
        - audience
        - ident_type
        - ident
        - type
      properties:
        ident_type:
          type: string
          enum:
            - phone_number
            - email
        ident:
          type: string
          description: |
            Email or phone_number, depending on the `ident_type`.
        audience:
          type: string
          description: |
            The unique identifier of the target API you want to access.
            The audience must be a grant associated with the client used
            when calling this resource.
        type:
          type: string
          enum:
            - customer
            - company
          description: |
            user type to login, required as users with different
            type can share email
    MultiFactorAuthenticationChallenge:
      type: object
      required:
        - links
        - mfa_token
        - challenge_type
      properties:
        links:
          type: array
          items:
            type: object
            required:
              - rel
              - href
            properties:
              rel:
                type: string
                enum:
                  - mfa_challenge
                  - mfa_oob
              href:
                type: string
          example:
            - rel: mfa_challenge
              href: https://test.dintero.com/v1/accounts/T11223351/auth/mfa/challenge
            - rel: mfa_oob
              href: https://test.dintero.com/v1/accounts/T11223351/auth/token
        mfa_token:
          description: MFA challenge token
          type: string
        challenge_type:
          description: |
            MFA challenge types

            - `oob` (out of band) means that the user will get an out of band message
              containing a `binding_code` that will have to be submitted along with the
              `mfa_token` when answering the mfa challenge
          type: string
          enum:
            - oob
        oob_channel:
          type: string
          enum:
            - sms
            - email
          description: |
            The channel to use for OOB
    MultiFactorAuthenticationRecoveryChallenge:
      type: object
      required:
        - links
        - mfa_token
        - oob_code
        - challenge_type
      properties:
        links:
          type: array
          items:
            type: object
            required:
              - rel
              - href
            properties:
              rel:
                type: string
                enum:
                  - mfa_oob
              href:
                type: string
        binding_method:
          type: string
          enum:
            - prompt
        oob_code:
          type: string
          example: bkaiew...akas
        mfa_token:
          type: string
        challenge_type:
          description: |
            MFA challenge types

            - `oob` (out of band) means that the user will get an out of band message
              containing a `recovery_code` that will have to be submitted along with the
              `recovery_token` when answering the MFA recovery challenge.
          type: string
          enum:
            - oob
    CustomersMfaSettings:
      type: object
      description: enable mfa login
      required:
        - enabled
        - login
        - login_recovery
      properties:
        enabled:
          type: boolean
          description: |
            Use this setting to enable mfa for customers login.
            When mfa is enabled the mfa_login endpoint has to be used for logging in.
          default: false
        login:
          type: object
          description: mfa login
          required:
            - challenge_type
            - oob_channel
          properties:
            challenge_type:
              type: string
              enum:
                - oob
            oob_channel:
              type: string
              enum:
                - sms
                - email
        login_recovery:
          type: object
          description: mfa login recovery
          required:
            - challenge_type
            - oob_channel
          properties:
            challenge_type:
              type: string
              enum:
                - oob
            oob_channel:
              type: string
              enum:
                - sms
                - email
    AutoTokenType:
      type: object
      discriminator:
        propertyName: type
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - SHA256
            - HMAC-SHA256
    CustomersSettings:
      type: object
      description: |
        Customer settings for the account
      properties:
        users:
          type: object
          description: |
            customers user configurations
          required:
            - customer_id_format
          properties:
            head:
              type: object
              description: |
                Enable endpoint [HEAD /customers/users endpoint](/customers-api/users/aid_customers_head)
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
                  default: false
            phone_number_validation:
              type: object
              description: |
                Configuration validation of user phone_number
              required:
                - allow_duplicates
              properties:
                allow_duplicates:
                  type: boolean
                  default: false
                  description: |
                    Allow multiple users to share the same phone number. Passwordless login
                    with OTP sent via SMS is not supported when enabled.
            customer_id_format:
              type: string
              description: |
                Format used when generating a customer_id when new user is created.

                - **uuid**: customer_id generated will be a random UUID
                - **sequence**: customer_id generated will be serial. The initial start
                  value will be the current maximum + 1 of existing customer_ids.

                >  **Note**: New customers should not be created with customer_id set when
                  `sequence` format is used as it can introduce conflicts later when
                  creating user without specifying customer_id
              enum:
                - uuid
                - sequence
              default: uuid
            mfa:
              $ref: '#/components/schemas/CustomersMfaSettings'
            verifications:
              type: object
              description: |
                Enable verifications on user updates.
              properties:
                phone_number:
                  description: |
                    Require verification to update user phone_number
                  type: string
                  enum:
                    - sms
        auto_tokens:
          type: object
          description: |
            Automatically generate tokens for these properties on the customer
          properties:
            phone_number:
              type: array
              items:
                $ref: '#/components/schemas/AutoTokenType'
            email:
              type: array
              items:
                $ref: '#/components/schemas/AutoTokenType'
        tokens:
          type: object
          description: |
            tokens configuration
          properties:
            event_expiry:
              type: array
              description: |
                configure the expire behaviour of token events
              items:
                type: object
                required:
                  - status
                  - time_to_live
                properties:
                  status:
                    description: |
                      the event status to configure TTL on
                    type: string
                    example: OPT_OUT
                  time_to_live:
                    type: integer
                    example: 15780000
                    description: |
                      Time-To-Live (TTL) for for the token event status in seconds
        attributes:
          type: array
          description: user attributes
          items:
            type: object
            required:
              - name
              - type
            properties:
              name:
                type: string
                description: name of the attribute
              type:
                type: string
                description: type of the attribute value
                enum:
                  - string
                  - integer
                  - real
                  - boolean
                  - phonenumber
                  - email
                  - date
                  - date-time
              multiple_values:
                type: boolean
                description: |
                  agreement (true/false) to enter multiple values
                default: false
              private:
                type: boolean
                description: |
                  agreement (true/false) for visibility for customers
                default: false
    Entity:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        deleted_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
    CustomerTag:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - tag
          properties:
            tag:
              type: string
              description: tag value
              example: VIP
            metadata:
              type: object
              description: |
                A set of key/value pairs that you can attach to
                a tag.
    TermsAndConditions:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - terms
          properties:
            terms:
              type: string
    TokenEvent:
      type: object
      description: |
        Record event data about a token
        An event can be created before the customer exist and
        before the token has been added to the customer
      required:
        - event
      properties:
        expires_at:
          type: string
          format: date-time
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        event:
          type: string
          description: context about the event
          example: customer declined signup in store
        status:
          type: string
          description: |
            State to set on given token type and value
          example: OPT_OUT
        metadata:
          type: object
          description: |
            Additional metadata about the event
          example:
            store_id: SID1234
    TokenTypeValue:
      type: object
      description: Lookup by token type and value
      required:
        - type
        - value
      properties:
        type:
          type: string
          minLength: 1
        value:
          description: |
            identifies how or who is resposible for the token value
          type: string
          minLength: 1
    CustomerData:
      type: object
      allOf:
        - properties:
            metadata:
              type: object
              maxProperties: 40
              description: |
                A set of key/value pairs that you can attach to a
                customer object. It can be useful for storing additional
                information about the customer in a structured format.
                You can unset an individual key by setting its value to
                null and then saving. To clear all keys, set metadata to null
              example:
                dob_year: 1985
    UserConsent:
      type: object
      properties:
        consent:
          type: boolean
          example: true
        updated_at:
          readOnly: true
          type: string
          format: date-time
          example: '2018-01-12T13:42:00Z'
          description: |
            The date-time when the resource was last updated:
    Address:
      type: object
      required:
        - address_line
        - postal_place
        - country
      properties:
        address_line:
          type: string
          example: Sommerkroveien 34
        address_line_2:
          type: string
          example: PB 123
        postal_code:
          type: string
          example: '0349'
        postal_place:
          type: string
          example: Oslo
        country:
          type: string
          format: iso-3166-1
          description: |
            ISO 3166-1 country code
          example: 'NO'
    CustomerAddress:
      description: Customer's addresses
      allOf:
        - $ref: '#/components/schemas/Address'
        - properties:
            latitude:
              type: number
              example: 59.942112
            longitude:
              type: number
              example: 10.716991
            type:
              type: string
              description: The address type
              enum:
                - custom
                - home
                - other
                - work
            custom_type:
              type: string
              description: |
                If the address `type` is `custom`, this
                property contains the custom value
            comment:
              type: string
              description: |
                Comment about the address
              example: 5th floor, use doorbell.
    CustomerTerm:
      type: object
      properties:
        id:
          type: string
          format: uuid
        accepted_at:
          type: string
          format: date-time
          readOnly: true
    BasicUser:
      type: object
      properties:
        first_name:
          example: John
          nullable: true
          type: string
        last_name:
          example: Doe
          nullable: true
          type: string
        email:
          description: |
            customer email,
            case insensitive duplication control prevents
            multiple user with same `type` to have equal email

            customer@example.com is equal to CUStOMer@EXAMPLE.com
          example: customer@example.com
          nullable: true
          type: string
        phone_number:
          description: |
            A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
          nullable: true
          type: string
        attributes:
          type: object
          description: |
            Custom attributes
        status:
          description: Status of the customer
          nullable: true
          type: string
        favorite_store:
          description: customer favorite store
          nullable: true
          type: string
        enrolled_by:
          type: object
          required:
            - value
          description: The source that recruited the customer
          properties:
            type:
              type: string
              description: |
                Enrollment type, e.g. `url`, `store`, `qr_code`, any string
              example: url
            value:
              example: https://facebook.com
              nullable: true
              type: string
        marketing_consent:
          type: object
          description: Customers consent for marketing in different channels
          maxProperties: 10
          properties:
            sms:
              $ref: '#/components/schemas/UserConsent'
            email:
              $ref: '#/components/schemas/UserConsent'
          additionalProperties:
            $ref: '#/components/schemas/UserConsent'
        type:
          type: string
          enum:
            - customer
            - company
            - contact
            - employee
            - other
          description: |
            Describe type of a user.

            - `company` property is required when using the type `company`
            - `company` property is only supported for users with type `other`
              or `company`
            - Creating or updating user with type `employee` or `other` requires
              `admin:customers` or `write:customers` scope.
            - User login is only available for users with type `customer` or `company`
          default: customer
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/CustomerAddress'
        term:
          $ref: '#/components/schemas/CustomerTerm'
        company:
          type: object
          required:
            - bussiness_name
          description: |
            Company details, supported when type is Company
          properties:
            organization_number:
              type: string
              description: Companys identification number
              example: 123456789MVA
            bussiness_name:
              type: string
              example: TKP tech AS
            department:
              type: string
              description: companys department
              example: sales department
            industry:
              type: string
              example: computer industry
            website:
              type: string
            number_of_employees:
              type: string
        gender:
          example: male
          nullable: true
          type: string
        date_of_birth:
          format: date
          example: '1990-09-20'
          nullable: true
          type: string
        contact_for:
          type: array
          description: |
            The users that it is a contact for, supported when type is `contact`
          items:
            type: object
            required:
              - customer_id
            properties:
              customer_id:
                type: string
                description: |
                  The customer id that it is a contact for
    Customer:
      type: object
      allOf:
        - $ref: '#/components/schemas/CustomerData'
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/BasicUser'
        - required:
            - type
          properties:
            type:
              type: string
              enum:
                - customer
                - company
                - contact
                - employee
                - other
              default: customer
    CustomerResponse:
      allOf:
        - $ref: '#/components/schemas/Customer'
        - required:
            - customer_id
          properties:
            customer_id:
              type: string
              maxLength: 255
              description: |
                The customer id you have defined for the customer.
                (must not have trailing or leading spaces)
                An auto-generated customer_id will be created if no
                customer_id is provided.
              readOnly: true
    CustomerToken:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - type
            - value
          properties:
            token_id:
              type: string
              maxLength: 255
              minLength: 1
              description: |
                The token id you have defined for the token.
                (must not have trailing or leading spaces)
              readOnly: true
            type:
              type: string
              minLength: 1
              description: |
                identifies how or who is resposible for the token value
              example: sha1:email
            value:
              type: string
              minLength: 1
              example: a1b79ef1a62d94ffa86b3f3d846df0ee3993af92
            metadata:
              type: object
              description: |
                Additional metadata about the token or the entity the
                token was created from
              example:
                exp_month: 10
                exp_year: 20
                mask_pan: '**** **** **** 3477'
    TokenDetail:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          description: |
            Auto-generated ID identifying the token type/value. Will be random
            until the token type/value has been added to a customer or a token
            event has been registered.
        customer:
          type: object
          readOnly: true
          description: |
            The customer (if any) that the token belongs to
          allOf:
            - $ref: '#/components/schemas/CustomerResponse'
        token:
          type: object
          readOnly: true
          description: |
            The token (if any) that is found given token type and value
          allOf:
            - $ref: '#/components/schemas/CustomerToken'
        status:
          type: string
          readOnly: true
          description: |
            Aggregated status from events registered or customer resolved.

            The status will be set to `customer.status` and fallback to
            the status of the latest event.

            The status will be set to `UNKNOWN` if no `customer.status` and
            event status is registered.

            The status will be set to the previous event status (or UNKNOWN)
            if the event has expired
          default: UNKNOWN
          example: OPT_OUT
        events:
          type: array
          readOnly: true
          description: Events recorded given token type and value
          items:
            $ref: '#/components/schemas/TokenEvent'
    Communication:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - properties:
            communication:
              type: object
              properties:
                email:
                  type: object
                  properties:
                    verified_at:
                      type: string
                      format: date-time
                      description: email verified by verification code
                      readOnly: true
                    allowed:
                      type: boolean
                      readOnly: true
                phone_number:
                  type: object
                  properties:
                    verified_at:
                      type: string
                      format: date-time
                      readOnly: true
                      description: phone_number verified by verification code
                    allowed:
                      type: boolean
                      readOnly: true
    SalesLocation:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - properties:
            location_id:
              type: string
              maxLength: 255
              description: |
                The id you have defined for the sales location.
                (must not have trailing or leading spaces). An
                auto-generated location_id will be created if no location_id
                is provided
              example: S01923
              readOnly: true
            name:
              type: string
              description: The location's trade name which is shown to its customers (receipt/signs)
              example: TKP Store
            timezone:
              type: string
              description: The location's timezone (IANA Timezone)
              example: Europe/Oslo
            status:
              type: string
              description: The location's status
              example: Active
            language_code:
              type: string
              description: |
                Language code of the localized company info, as defined by
                <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>
                (IETF BCP 47, "Tags for Identifying Languages").
            currency:
              type: string
              example: NOK
              description: |
                The three-character ISO-4217 currency.
                https://en.wikipedia.org/wiki/ISO_4217
            phone_number:
              type: string
              description: |
                A phone number in E.164 number formatting.
              format: ^\+?[1-9]\d{1,14}$
              example: '+4799999999'
            chain:
              type: string
              example: SuperChain
            email:
              type: string
              example: saleslocation@example.com
            mcc:
              type: string
              format: iso-18245
              description: |
                A four-digit Merchant Category Code (MCC) for the store
                [ISO 18245:2003](https://www.iso.org/standard/33365.html)
              example: '5814'
              minimum: 4
              maximum: 4
            gln:
              type: string
              description: Company Global Location Number
            organization_number:
              type: string
              description: Company identification number
              example: 123456789MVA
            business_name:
              type: string
              description: The location's legal name
              example: TKP technology AS
            franchise:
              description: The location is part of a franchise.
              type: string
              example: Subway
            type:
              type: string
              description: The location type (Physical, Mobile)
            website_url:
              type: string
              description: The location's website
            address:
              allOf:
                - $ref: '#/components/schemas/Address'
                - properties:
                    latitude:
                      type: number
                    longitude:
                      type: number
    SalesLocationResponse:
      allOf:
        - properties:
            account_id:
              type: string
              format: ^[PT]{1}\d{8}$
              minLength: 9
              maxLength: 9
        - $ref: '#/components/schemas/SalesLocation'
    SearchExternalOrganizationResult:
      type: object
      required:
        - response_from
        - organization_type
        - organization_number
        - business_name
      properties:
        response_from:
          type: string
          enum:
            - enhetsregisteret
            - cvr
            - underenheter
          example: enhetsregisteret
        organization_type:
          type: string
          example: AS
          description: |
            A code or string specifying the type of organization.
        phone_number:
          type: string
          description: |
            A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
        email:
          type: string
          example: hello@company.com
        organization_number:
          type: string
          description: Company identification number.
          example: 123456789MVA
        business_name:
          type: string
          description: The location's legal name.
          example: TKP technology AS
        business_address:
          $ref: '#/components/schemas/Address'
        registry_address:
          $ref: '#/components/schemas/Address'
        website_url:
          type: string
          description: The company's website.
    GetExternalOrganizationResult:
      type: object
      required:
        - organization_number
        - business_name
      properties:
        organization_number:
          type: string
          description: Company identification number
          example: 123456789MVA
        business_name:
          type: string
          description: The location's legal name
          example: TKP technology AS
        business_address:
          $ref: '#/components/schemas/Address'
        registry_address:
          $ref: '#/components/schemas/Address'
        office_type:
          type: string
          description: head_office, branch or other type of office
          example:
            - head_office
            - branch
    PostalPlaceResult:
      type: object
      required:
        - country
        - postal_code
        - postal_place
      properties:
        country:
          type: string
          description: |
            ISO 3166-1 country code
          example: 'NO'
        postal_code:
          type: string
          example: '0349'
        postal_place:
          type: string
          example: Oslo
    AddressValidationResult:
      type: object
      required:
        - valid
        - alternatives
      properties:
        valid:
          type: boolean
          description: |
            If the address was valid or not.
          example: false
        alternatives:
          type: array
          description: |
            Close matching alternative addresses.
          items:
            type: object
            allOf:
              - $ref: '#/components/schemas/Address'
              - required:
                  - postal_code
    AutomationAction:
      discriminator:
        propertyName: type
        mapping:
          discount: '#/components/schemas/AutomationActionDiscount'
          http: '#/components/schemas/AutomationActionHTTP'
      oneOf:
        - $ref: '#/components/schemas/AutomationActionDiscount'
        - $ref: '#/components/schemas/AutomationActionHTTP'
    Automation:
      type: object
      required:
        - requirement
        - actions
      properties:
        name:
          type: string
          description: Optinal name for the automation rule
          example: Company Automation
        description:
          type: string
          description: Optional description for the automation rule
          example: Automation for non blocked companies with postal_code 0342 or 6901
        requirement:
          type: object
          required:
            - automation_from
            - automation_to
            - events
          properties:
            automation_from:
              description: |
                limit the time when automation is activated, the value must be
                before the discount `requirement.purchase_to` time if the action
                type is `discount`
              type: string
              format: date-time
            automation_to:
              description: |
                limit the time when the automation is active, the value must be
                before the discount `requirement.purchase_to` time if the action
                type is `discount`
              type: string
              format: date-time
            events:
              type: array
              description: |
                Events that the automation will be applied to (triggers)
              minItems: 1
              items:
                type: string
                enum:
                  - customer_add
                  - customer_update
                  - customer_remove
                  - token_add
                  - token_remove
                  - receipt_add
            filter:
              type: object
              description: |
                limit the automation by properties read from the events accepted
                by the automation
                The key for each filter must be a valid JSONPath, that will be used
                to resolve the event value to match with the path value. The result of the JSONPath
                must be a single value or list of values to compare.

                #### Excact matching

                  - `"$.store.id": ["S00123"]`

                #### Anything-but matching

                  - `$.status: [{"anything-but":"blocked"}]`

                #### Numeric Range matching

                In addition to the `=` operator, a numeric filter can include `<`, `<=`, `>`, and `>=`

                  - `$.gross_amount: [{"numeric":[">", 50000]}]`
                  - `$.gross_amount: [{"numeric":[">", 0, "<=", 1500]}]`

                #### AND/OR Logic
                Apply AND/OR logic to your filter policies as follows.

                ##### AND logic
                Apply AND logic by using multiple names (keys). For example, the filters:

                      {
                        "$.store.id": ["S00129"],
                        "$.gross_amount": [{"numeric":[">", 50000]}]
                      }

                Matches events with a store.id of S00129 and a gross_amount value that's over 50000.

                ##### OR logic

                Apply OR logic by assigning multiple values to an attribute name. For example, the filter:

                    "$.addresses[*].postal_code": ["0342", "6901", "5020"]

                Matches events with an address.postal_code value of 0342 or 6901 or 5020.
              example:
                $.type:
                  - company
                $.status:
                  - anything-but: blocked
                $.addresses[*].postal_code:
                  - '0342'
                  - '6901'
        limitation:
          type: object
          required:
            - automation_repeat
          properties:
            automation_repeat:
              description: |
                limit the number of times the automation will trigger and
                give the customer the discount. A value of `-1` will disable the
                limitation and the automation will give discount to the customer
                every time
              type: number
              default: 1
              minimum: -1
        actions:
          type: array
          description: |
            Actions to perform if the automation is triggered
            (given events, limitation and filter)
          minItems: 1
          maxItems: 1
          items:
            $ref: '#/components/schemas/AutomationAction'
    Item:
      type: object
      properties:
        id:
          type: string
          example: b714118
        group_id:
          type: string
          example: B1
    Limitation:
      type: object
      properties:
        dynamic_purchase_to_days:
          type: number
          format: int32
          minimum: 1
          description: |
            Limit the `purchase_to` to the time added to a customer + the days

            The customer discount rule `purchase_to` will be set to the minimum
            of `requirement.purchase_to` and `now + limitation.dynamic_purchase_to_days`
        discount_activation:
          type: array
          description: |
            Dynamically control if the discount should be active.
          items:
            minItems: 1
            maxItems: 1
            type: object
            required:
              - type
              - value
            properties:
              type:
                type: string
                description: |
                  - `deactivate_if_discount_active`: The discount is deactivated if
                    the value match the `id` of another active discount
                    available for the purchase
                enum:
                  - deactivate_if_discount_active
              value:
                type: string
                description: |
                  Value given the type
        discount_hours:
          type: object
          description: |
            Limit the discount to hours of the day
          required:
            - hours
          properties:
            timezone:
              description: |
                The timezone identifier for the hour start/end, see
                https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
                for examples. DST is handled when using a Timezone with DST.
              default: Europe/Oslo
              type: string
            hours:
              description: |
                an array of periods, day and time when discount will be
                available. Multiple periods for one day is accepted.
                Any hour of purchase is accepted if the array is empty.
              type: array
              items:
                type: object
                required:
                  - day
                  - start
                  - end
                properties:
                  day:
                    type: string
                    enum:
                      - mon
                      - tue
                      - wed
                      - thu
                      - fri
                      - sat
                      - sun
                  start:
                    type: string
                    pattern: ^([01]?[0-9]|2[0-3]):[0-5][0-9]$
                    example: '10:00'
                  end:
                    type: string
                    pattern: ^([01]?[0-9]|2[0-3]):[0-5][0-9]$
                    example: '20:00'
        discount_reward_usage:
          type: integer
          description: |
            Limit the number of rewards to be given in a purchase
            where multiple receipt items match the requirement
          example: 1
          default: -1
        discount_combination:
          type: integer
          description: |
            Limit how many other discounts can be combined in a purchase
            where multiple discounts are applicable.
          default: -1
          enum:
            - -1
            - 0
        discount_eligible:
          type: string
          description: |
            Limit what items in the purchase is eligible for this discount
          enum:
            - item_eligible_for_discount
            - item_eligible_for_discount_no_discount
            - receipt_no_discount
          default: item_eligible_for_discount
        discount_repeat_usage:
          type: integer
          description: |
            Limit how many purchases the discount can be used
          default: -1
        stamp_expire_days:
          type: integer
          description: |
            Number of days between first and last (exceeding count) stamp
            where reward will be given
          example: 100
          default: -1
        blacklist:
          type: array
          description: |
            items not eligible for discount.
          items:
            $ref: '#/components/schemas/Item'
          minItems: 1
    CustomerRequirement:
      type: object
      properties:
        addresses:
          type: array
          description: Require customer to have one or more addresses matching the properties. All properties defined must match a single address.
          items:
            type: object
            minItems: 1
            maxItems: 5
            properties:
              country:
                type: array
                example:
                  - 'NO'
                items:
                  type: string
                  minItems: 1
                  maxItems: 5
              postal_code:
                type: array
                example:
                  - '0349'
                items:
                  type: string
                  minItems: 1
                  maxItems: 5
              postal_place:
                type: array
                example:
                  - Oslo
                items:
                  type: string
                  minItems: 1
                  maxItems: 5
              custom_type:
                type: array
                example:
                  - offsite
                items:
                  type: string
                  minItems: 1
                  maxItems: 5
              type:
                type: array
                example:
                  - custom
                items:
                  type: string
                  minItems: 1
                  maxItems: 5
        company:
          type: object
          description: |
            Require customer to be a company matching all properties defined.
          properties:
            bussiness_name:
              type: array
              example:
                - TKP tech AS
              items:
                type: string
                minItems: 1
                maxItems: 5
            department:
              type: array
              example:
                - production
                - research
              items:
                type: string
                minItems: 1
                maxItems: 5
            industry:
              type: array
              example:
                - J62.0.1
                - J62.0.2
              items:
                type: string
                minItems: 1
                maxItems: 5
            number_of_employees:
              type: array
              example:
                - '20'
              items:
                type: string
                minItems: 1
                maxItems: 5
            organization_number:
              type: array
              example:
                - 123456789MVA
              items:
                type: string
                minItems: 1
                maxItems: 5
            website:
              type: array
              example:
                - https://dintero.com
              items:
                type: string
                minItems: 1
                maxItems: 5
        date_of_birth:
          type: array
          example:
            - '1990-09-20'
            - '1990-05-10'
          items:
            type: string
            minItems: 1
            maxItems: 5
        enrolled_by:
          type: object
          properties:
            type:
              type: array
              example:
                - url
              items:
                type: string
                minItems: 1
                maxItems: 5
            value:
              type: array
              example:
                - https://mypage.example.dintero.com
              items:
                type: string
                minItems: 1
                maxItems: 5
        favorite_store:
          type: array
          example:
            - sc029
          items:
            type: string
            minItems: 1
            maxItems: 5
        first_name:
          type: array
          example:
            - John
          items:
            type: string
            minItems: 1
            maxItems: 5
        gender:
          type: array
          example:
            - male
          items:
            type: string
            minItems: 1
            maxItems: 5
        last_name:
          type: array
          example:
            - Doe
          items:
            type: string
            minItems: 1
            maxItems: 5
        marketing_consent:
          type: object
          properties:
            email:
              type: object
              properties:
                consent:
                  type: array
                  example:
                    - 'true'
                  items:
                    type: string
                    minItems: 1
                    maxItems: 5
            sms:
              type: object
              properties:
                consent:
                  type: array
                  example:
                    - 'true'
                  items:
                    type: string
                    minItems: 1
                    maxItems: 5
        status:
          type: array
          example:
            - vip
          description: |
            limit discount to only receipt where customer status
            is included in the receipt and match one of the status
            values required by the discount
          items:
            type: string
            minItems: 1
            maxItems: 5
        term:
          type: object
          properties:
            id:
              type: array
              items:
                type: string
                minItems: 1
                maxItems: 5
        type:
          type: array
          items:
            type: string
            minItems: 1
            maxItems: 5
        attributes:
          type: object
          description: |
            Limit discount to only receipt where customer attributes are included
            and match one of the values required by the discount
          additionalProperties:
            type: array
            items:
              type: string
            minItems: 1
            maxItems: 5
    ItemMixProperty:
      type: object
      description: |
        Use mix in case where all items are required in one purchase.

        A reward will be eligible to all items in the mix that
        has `mix.reward_eligible=true`
      required:
        - quantity
        - reward_eligible
      properties:
        items:
          description: |
            Acceptable items for the mix "item" (`any`). No wildcard `*` is
            accepted.
          type: array
          example:
            - id: b714118
            - group_id: g4
          items:
            type: object
            minItems: 1
            properties:
              id:
                type: string
                example: b714118
                pattern: ^(\*.+|(?!\*).*)$
              group_id:
                type: string
                pattern: ^(\*.+|(?!\*).*)$
                example: g4
        quantity:
          type: number
          description: |
            minimum quantity of given item (match by id or group) by the mix
          minimum: 0
        reward_eligible:
          type: boolean
          description: |
            The item will be eligible for discount when calculating the reward
            Example: The value of `discount_item_new_price` reward will be the
            total price of all items in a mix that has the applicable set to `true`
    StoreRequirement:
      type: object
      properties:
        id:
          type: array
          items:
            type: string
            example: sc029
        name:
          type: array
          description: |
            name of the store, aka trade name of the store
          items:
            type: string
            example: SC Oslo
        business_name:
          type: array
          description: |
            Official name of the person or entity that owns the store.
          items:
            type: string
            example: SC Oslo AS
        address:
          type: object
          description: Require customer to have one or more addresses matching the properties. All properties defined must match a single address.
          properties:
            country:
              type: array
              example:
                - 'NO'
              items:
                type: string
                minItems: 1
                maxItems: 5
            postal_code:
              type: array
              example:
                - '0349'
              items:
                type: string
                minItems: 1
                maxItems: 5
            postal_place:
              type: array
              example:
                - Oslo
              items:
                type: string
                minItems: 1
                maxItems: 5
        chain:
          type: array
          items:
            type: string
            example: SuperChain
        email:
          type: array
          items:
            type: string
            example: contact@superchain.com
        gln:
          type: array
          items:
            type: string
            example: '5790001398644'
        organization_number:
          type: array
          items:
            type: string
            example: 123456789MVA
        phone_number:
          type: array
          items:
            type: string
            example: '+4738260107'
        mcc:
          type: array
          description: |
            A four-digit Merchant Category Code (MCC) for the store
            [ISO 18245:2003](https://www.iso.org/standard/33365.html)
          items:
            type: string
            format: iso-18245
            example: 5814
        mcc_ranges:
          type: array
          description: |
            Ranges of MCC codes to accept the discount for.
            Multiple ranges are possible.
            Prefer `mcc` if not a range.
          items:
            type: object
            required:
              - start
              - end
            properties:
              start:
                type: string
                format: iso-18245
                example: 5814
                minimum: 4
                maximum: 4
                pattern: ^\d{4}$
              end:
                type: string
                format: iso-18245
                example: 5815
                minimum: 4
                maximum: 4
                pattern: ^\d{4}$
        bax:
          type: array
          description: |
            Merchant number associated with the stores
            payment terminal
          items:
            type: string
            example: '102603'
        terminal_id:
          type: array
          description: |
            Id to a specific point-of-sale (POS) terminal
            or workstation
          items:
            type: string
            example: T0292
    BaseRequirement:
      type: object
      description: |
        Discount base requirement
      properties:
        customer:
          $ref: '#/components/schemas/CustomerRequirement'
        item:
          type: object
          properties:
            quantity:
              type: number
              description: |
                minimum number of items
              default: 0
              minimum: 0
            mixes:
              type: array
              minItems: 1
              description: |
                Required mix items for the discount.

                A purchase must include `all` the items to fulfill the `item.mixes`
                requirement.
              items:
                $ref: '#/components/schemas/ItemMixProperty'
            items:
              type: array
              description: |
                Required items for the discount

                A purchase can include `any` of the items to fulfill the `item.items`
                requirement.

                The values contols if the reward is given on the receipt (all items) or
                if they are limited to matching items

                **Receipt**
                - A rule with no items or items with only wildcard items

                **Item**
                - A rule with one or more items (except wildcard)
                - A rule with a single item `{"id": "ANY_ITEM"}` in items
              items:
                $ref: '#/components/schemas/Item'
              minItems: 1
        store_ids:
          type: array
          description: |
            `DEPRECATED`: [@since 2021-09-01](#section/Changelog/2021-09-01)
          items:
            type: string
            example: sc029
        gross_amount:
          type: integer
          description: |
            Minimum gross amount on purchase.
            Monetary amount in smallest unit for the currency
          default: 0
        net_amount:
          type: integer
          description: |
            Minimum net amount on purchase (amount after existing discounts).
            Monetary amount in smallest unit for the currency
          default: 0
        currencies:
          description: |
            List of valid currencies, or `[{"anything-but": ["NOK"]}]` to exclude currencies.
            Currency format is the three-character [ISO-4217 currency](https://en.wikipedia.org/wiki/ISO_4217).
          type: array
          items:
            anyOf:
              - type: object
                properties:
                  anything-but:
                    type: array
                    items:
                      type: string
                      example: NOK
              - type: string
                example: NOK
        stamp:
          type: integer
          description: |
            Stamp count required for the reward
          example: 5
        discount_code:
          type: string
          description: |
            A code required for the reward. The purchase must include the
            promotion code in the `receipt.discount_code` property or as
            an `receipt.item` where the `item.id` is the promotion code.
          example: TACO
        store:
          $ref: '#/components/schemas/StoreRequirement'
    Requirement:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseRequirement'
        - required:
            - purchase_from
            - purchase_to
          properties:
            purchase_from:
              type: string
              format: date-time
            purchase_to:
              type: string
              format: date-time
    RewardBase:
      type: string
      description: |
        Let the discount reward be calculated from net or gross price.
        Not applicable for `discount_item_new_price`

        *Example*:
          item A à 100,- NOK with existing rebate of 20,-

          - 10% net reward is 10% of 80,- : 8,-
          - 10% gross reward is 10% of 100,- : 10,-

          * *net*: `gross - "any existing discounts"`
          * *gross*: `"total expense amount, including taxes"`
      default: gross
      enum:
        - net
        - gross
    Reward:
      type: object
      required:
        - type
        - value
      properties:
        type:
          type: string
          description: |

            Reward Type:
              * `discount_amount` - value as discount
              * `discount_percent` - value percentage of gross amount
                  as discount
              * `discount_item_new_price` - discount as old price subtracted with value
              * `discount_item_quantity` - number of items to get as discount (free)
              * `discount_item_percent` - percent discount of the cheapest item (stamp)
                  as discount
              * `discount_debit` - value as discount, remaining amount after a
                purchase will be available in future purchases (if not limited by usage)
              * `discount_mix_new_price` - discount as old mix total value (reward_eligible=true)
                subtracted with value
          enum:
            - discount_amount
            - discount_percent
            - discount_item_new_price
            - discount_item_quantity
            - discount_item_percent
            - discount_mix_new_price
            - discount_debit
        value:
          example: 10000
          description: |
            The reward value, unit of the value is resolved
            from the reward type

            Examples:
              - Percent: 10.5
              - Amount: 10000 (amount in smallest unit for the currency)
              - Quantity: 1
          minimum: 0
          oneOf:
            - type: integer
            - type: number
        values:
          description: |
            Reward values that is used to "override" the reward value for matching items.
            Add support for having a single rule for multiple items that gives different
            reward value for each items

            > Only available for rules where `requirements.item.items` is non-empty.
          type: array
          minItems: 1
          items:
            type: object
            required:
              - items
              - value
            properties:
              items:
                type: array
                minItems: 1
                description: |
                  `id` or `group_id` is required, if both are included both id and
                  group id must match
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: b714118
                    group_id:
                      type: string
                      example: B1
              value:
                type: number
        base:
          $ref: '#/components/schemas/RewardBase'
        effect:
          type: string
          description: |
            How the reward will be added to the receipt.
            - `discount`: the reward will be applied as a discount directly on the receipt
            - `bonus`: the reward will be accumulated as bonus on the customers discount balance
          default: discount
          enum:
            - discount
            - bonus
    Links:
      description: Links to resources related to the discount
      type: array
      example:
        - href: https://example.dintero.com/c/photos/2018/6_20_thumbnail_discount_image.png
          rel: thumbnail_discount_image
        - href: https://example.dintero.com/c/photos/2018/6_20_medium_discount_image.png
          rel: medium_discount_image
        - href: https://example.dintero.com/shop?utm_source=dintero&utm_medium=email&utm_campaign=spring-summer
          rel: webshoop
        - href: https://example.dintero.com/newsletter/2018.pdf
          rel: newletter
          type: application/pdf
      items:
        type: object
        maxItems: 10
        required:
          - href
        properties:
          href:
            description: The URL of the link.
            type: string
            format: uri
          rel:
            description: |
              Specifies the relationship between the discount and the link

              Following `rel` values are reserved for specific usage

                - thumbnail_discount_image: link to discount image
                - medium_discount_image: link to discount image
                - large_discount_image: link to discount image
                - webshop: link to site where the discount may be used
            type: string
          type:
            type: string
            description: Specifies the media type of the link
    Discount:
      required:
        - requirement
        - reward
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        deleted_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
        campaign_id:
          type: string
          description: |
            The campaign the rule belongs to
        active:
          description: |
            the discount is active and can be available
            for purchase (if given to any or all customers)
          type: boolean
          default: true
        private:
          description: |
            the discount will be excluded from  public discount collection
            (GET /discounts/public/rules).
          type: boolean
          default: false
        updated_by:
          type: string
          example: 3d1e4824-5474-48e7-a369-4f603fa4c5b8
          description: |
            The ID of the user/client that last updated the resource
          readOnly: true
        type:
          type: string
          description: The discount base type * `receipt` discount is given on receipt * `item` discount is given to items
          enum:
            - item
            - receipt
          readOnly: true
        name:
          type: string
          example: Spar 100,-
        receipt_text:
          type: string
          description: |
            Text that should be used when displaying
            the discount, e.g. on receipt
          example: Mai Salg
        visible_from:
          type: string
          format: date-time
          description: |
            Make the discount visible to the customer from
            given date. Default behavior is to only return
            discount to the customer where the current time
            is between purchase_from and purchase_to
        description:
          type: string
          example: Gjør et Stablestol kupp!
        limitation:
          $ref: '#/components/schemas/Limitation'
        requirement:
          $ref: '#/components/schemas/Requirement'
        reward:
          $ref: '#/components/schemas/Reward'
        metadata:
          type: object
          maxProperties: 10
          description: |
            Additional metadata about the discount

            Metadata prefixed with `dintero:exclude:public:` will
            be excluded when listing the rules from the public endpoint

            - [GET /v1/accounts/{aid}/discounts/public/rules](/discounts-api/rules/aid_discounts_public_get)

            and included in all other endpoints that returns discount rules
          example:
            campaign_id: V101
            is_featured: true
            dintero:private_text:kind: Gold
        links:
          $ref: '#/components/schemas/Links'
    DiscountRefs:
      allOf:
        - $ref: '#/components/schemas/Discount'
        - properties:
            refs:
              type: array
              description: |
                References to instances of the discount, a customer can
                have multiple instances of the same discount, this propery
                list the instances used
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: |
                      reference id to the customer instance of the
                      discount
                    example: e3da6be5-d8e0-466c-af66-b7f69472ebb5
                  stamp:
                    type: integer
                    description: |
                      number of stamp collected by the discount when
                      used on the receipt.
                  amount:
                    type: integer
                    description: |
                      reward amount for the the ref used,
                      monetary amount in smallest unit for the currency
                    example: 10000
                  bonus:
                    type: integer
                    description: |
                      reward bonus for the ref used
                    example: 9050
                  statistics:
                    type: object
                    description: |
                      statistics for given discount instance (ref)
                    properties:
                      amount:
                        type: integer
                        description: |
                          total amount discount given, inclusive discount
                          amounts from previous purchases where the
                          the discount was used
                        example: 15050
                      bonus:
                        type: integer
                        description: |
                          total bonus given, inclusive bonus from previous
                          purchases where the the discount was used
                        example: 11050
                      debit_balance:
                        type: integer
                        description: |
                          the discount debit balance, only applicable if
                          discount reward type is `discount_debit`
                        example: 12350
                      stamp:
                        type: integer
                        description: |
                          total stamp collected by the discount, inclusive
                          previous purchases
                        example: 11
                      usage:
                        type: integer
                        description: |
                          total times the discount reward was used,
                          inclusive discount usage from previous purchases
                        example: 2
                  items:
                    type: array
                    description: |
                      Items receiving the discount, list what items
                      received an discount_lines entry for this discount
                    example:
                      - line_id: 1
                        amount: 3000
                      - line_id: 5
                        amount: 7000
                    items:
                      type: object
                      properties:
                        line_id:
                          type: integer
                          description: |
                            item line_id
                        bonus:
                          type: integer
                          description: bonus for given line_id
                        amount:
                          type: integer
                          description: |
                            discount amount for given line_id
                            monetary amount in smallest unit for the currency
                  usage:
                    type: integer
                    description: number of times the ref was used
                    example: 1
    Store:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          example: sc029
        name:
          type: string
          description: |
            name of the store, aka trade name of the store
          example: SC Oslo
        business_name:
          type: string
          description: |
            Official name of the person or entity that owns the store.
          example: SC Oslo AS
        address:
          $ref: '#/components/schemas/Address'
        chain:
          type: string
          example: SuperChain
        email:
          type: string
          example: contact@superchain.com
        gln:
          type: string
          example: '5790001398644'
        organization_number:
          type: string
          example: 123456789MVA
        phone_number:
          type: string
          example: '+4738260107'
        mcc:
          type: string
          format: iso-18245
          description: |
            A four-digit Merchant Category Code (MCC) for the store
            [ISO 18245:2003](https://www.iso.org/standard/33365.html)
          example: '5814'
          minimum: 4
          maximum: 4
        bax:
          type: string
          example: '102603'
          description: |
            Merchant number associated with the stores
            payment terminal
        terminal_id:
          type: string
          description: |
            Id to a specific point-of-sale (POS) terminal
            or workstation
          example: T0292
        payout_destination_id:
          type: string
          maxLength: 40
          description: |
            The payout destination id for the merchant of record,
            i.e. the seller responsible for the transaction.

            Required when `seitatech.in_person` payment is enabled.
          example: seller-1
    InfoCodeItem:
      type: object
      properties:
        line_id:
          type: integer
          example: 1
        amount:
          type: integer
          description: |
            Monetary amount in smallest unit for the currency
        amount_dwh:
          type: string
          example: '1.14'
          description: Monetary value with decimal
        infocode_id:
          type: string
        sub_infocode_id:
          type: string
        information:
          type: string
        input_type:
          type: integer
        withdrawal_from_stock:
          type: boolean
          example: false
    TaxItem:
      type: object
      properties:
        amount:
          type: integer
          example: 5584
          description: |
            Monetary amount in smallest unit for the currency
        amount_dwh:
          type: string
          example: '5584.0440'
          description: Monetary value with decimal
        exempt:
          type: boolean
          example: false
        included_in_price:
          type: boolean
          example: true
        percentage:
          type: number
          example: 25
        tax_basis:
          type: integer
          example: 27920
          description: Total monetary value without tax
        tax_basis_dwh:
          type: string
          example: '27920.22'
          description: Total monetary value without tax in decimal
        tax_code:
          type: string
          example: '3'
        tax_group:
          type: string
          example: Vmva-høy
    Dimension:
      type: object
      description: |
        Identify item attributes, such as size and color
      properties:
        color:
          type: string
        size:
          type: string
        style:
          type: string
        config:
          type: string
        variant:
          type: string
    DiscountType:
      type: string
      enum:
        - customer
        - periodic
        - manual
        - loyalty
        - total
        - employee
        - external
    DiscountItem:
      type: object
      properties:
        amount:
          type: integer
          example: 4400
          description: |
            Monetary amount in smallest unit for the currency
        percentage:
          type: number
          description: |
            Optional, set if the amount given was from a percentage discount
          example: 44
        discount_type:
          $ref: '#/components/schemas/DiscountType'
        discount_id:
          type: string
          example: 766da0ef-9283-42bd-b012-0582344ec53c
        description:
          type: string
        line_id:
          type: integer
          example: 1
    BonusItem:
      type: object
      properties:
        bonus:
          type: integer
          example: 3130
          description: Bonus in smallest unit for the currency
        percentage:
          type: number
          description: |
            Optional, set if the bonus given was from a percentage discount
          example: 10
        discount_type:
          $ref: '#/components/schemas/DiscountType'
        discount_id:
          type: string
          example: 766da0ef-9283-42bd-b012-0582344ec53c
        description:
          type: string
        line_id:
          type: integer
          example: 1
    ExtraInfo:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
        value_type:
          type: string
          enum:
            - string
            - integer
            - number
            - boolean
            - datetime
    ReceiptItem:
      type: object
      properties:
        id:
          type: string
          example: '175938'
        groups:
          type: array
          example:
            - id: B234
              name: Stol
            - id: B1
              name: Møbel
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: string
                description: group id
              name:
                type: string
                description: group name
        quantity:
          type: number
          example: 2
          default: 1
        unit:
          type: string
          example: stk
          description: unit type
        description:
          type: string
          example: Stablestol for utendørsbruk
        description_alias:
          type: string
          example: Stablestol
        net_amount:
          type: integer
          example: 27840
          description: |
            Monetary amount in smallest unit for the currency
            after discounts for items in this line
        net_amount_dwh:
          type: string
          example: '27840.10'
          description: |
            Monetary amount in smallest unit for the currency
            after discounts for items in this line in decimal
        gross_amount:
          type: integer
          example: 39800
          description: |
            Monetary amount in smallest unit for the currency
            before discounts for items in this line
        gross_amount_dwh:
          type: string
          example: '34800.12'
          description: |
            Monetary amount in smallest unit for the currency
            before discounts for items in this line in decimal
        unit_gross_price:
          type: integer
          example: 10900
        tax_percent:
          type: number
          example: 25
        line_id:
          type: integer
          example: 1
        barcode:
          type: string
          example: '3123212343212'
        cost_price:
          type: integer
          example: 2033
          description: The purchase price the company pay for item
        voided:
          type: boolean
          example: false
        scale_item:
          type: boolean
          example: false
          description: |
            The price is calculated from scale (weight/volume).
        eligible_for_discount:
          type: boolean
          example: true
        included_in_total_discount:
          type: boolean
          example: true
        price_has_been_keyedIn:
          type: boolean
          example: false
        discount_has_been_keyedIn:
          type: boolean
          example: false
        is_return_item:
          type: boolean
          example: false
        is_linked_item:
          type: boolean
          example: false
        is_virtual_product:
          type: boolean
          example: false
        is_changed:
          description: Discount applied to gross amount
          type: boolean
          example: true
        salesperson_id:
          type: string
          description: |
            Id of the sales person if other
            then the operator
          example: '000111'
        salesperson_name:
          type: string
          description: |
            Name of the sales person
          example: Jesper
        serial_id:
          type: string
          example: '32424234231312312'
        comment:
          type: string
          example: Kan være hva som helst
        infocode_lines:
          type: array
          items:
            $ref: '#/components/schemas/InfoCodeItem'
        tax_lines:
          type: array
          items:
            $ref: '#/components/schemas/TaxItem'
        dimension:
          $ref: '#/components/schemas/Dimension'
        discount_lines:
          type: array
          items:
            $ref: '#/components/schemas/DiscountItem'
        bonus_lines:
          type: array
          items:
            $ref: '#/components/schemas/BonusItem'
        extra_info:
          type: array
          items:
            $ref: '#/components/schemas/ExtraInfo'
    CardInfo:
      type: object
      properties:
        balance_amount:
          type: integer
          description: |
            Monetary amount in smallest unit for the currency
        card_amount:
          type: integer
          description: |
            Monetary amount in smallest unit for the currency
        issuer_id:
          type: integer
        issuer_name:
          type: string
          example: Barcley
        session_id:
          type: string
          example: '022'
        terminal_id:
          type: string
          example: '71015233'
        card_number:
          type: string
          example: '************00198-1'
        card_type:
          type: string
          example: VISA
        receipt:
          type: string
          example: |
            BAX: 111010-71015233\n\r\11/11/2015 14:41\n\r\345849\n\r\ VISA CLASSIC\n\r\************5671\n\r\AID:A0000000031010\n\r\ REF:011 006687000000\n\r\RESP:00 GODKJENT\n\r\RETUR AV VARER\n\r \NOK=           50.00\n\r\SIGNATUR................\n\r \KORTHOLDERS KOPI
    PaymentItem:
      type: object
      properties:
        line_id:
          type: integer
          example: 1
        amount:
          type: integer
          description: |
            Monetary amount in smallest unit for the currency
        type_id:
          type: string
        token_id:
          type: string
          description: Id of the token
          example: 983558fe-05bd-495f-92b5-9075d085db32
        token_type:
          type: string
          description: The token issuer
          example: VIPPS
        description:
          type: string
        voided:
          type: boolean
        card_info:
          $ref: '#/components/schemas/CardInfo'
        reference_id:
          type: string
          example: B00668107235
        infocode_lines:
          type: array
          items:
            $ref: '#/components/schemas/InfoCodeItem'
    Receipt:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - store
            - receipt_id
            - purchase_at
          properties:
            discounts:
              description: |
                List all discounts referenced in discount_lines
              type: array
              items:
                $ref: '#/components/schemas/DiscountRefs'
            store:
              $ref: '#/components/schemas/Store'
            items:
              type: array
              items:
                $ref: '#/components/schemas/ReceiptItem'
            receipt_id:
              type: string
              example: '714118'
            delivery:
              type: object
              description: |
                Details for the delivery
              properties:
                first_name:
                  type: string
                  example: John
                last_name:
                  type: string
                  example: Doe
                email:
                  type: string
                  example: customer@example.com
                phone_number:
                  type: string
                  description: |
                    A phone number in E.164 number formatting.
                  format: ^\+?[1-9]\d{1,14}$
                  example: '+4799999999'
                address:
                  $ref: '#/components/schemas/Address'
            customer_id:
              type: string
              description: |
                The customer id identifying the customer.
                (must not have trailing or leading spaces)
              example: C13db4f63
              maxLength: 255
            customer:
              type: object
              description: |
                The customer, owner of the receipt
              properties:
                gender:
                  type: string
                  example: male
                first_name:
                  type: string
                  example: John
                last_name:
                  type: string
                  example: Doe
                email:
                  type: string
                  example: customer@example.com
                metadata:
                  type: object
                  description: |
                    A set of key/value pairs that you can attach to a
                    customer object. It can be useful for storing additional
                    information about the customer in a structured format.
                  example:
                    dob_year: 1985
                phone_number:
                  type: string
                  description: |
                    A phone number in E.164 number formatting.
                  format: ^\+?[1-9]\d{1,14}$
                  example: '+4799999999'
                addresses:
                  type: array
                  items:
                    allOf:
                      - $ref: '#/components/schemas/Address'
                      - properties:
                          type:
                            type: string
                          custom_type:
                            type: string
                pays_tax:
                  type: boolean
                  description: |
                    Is customer required to pay tax
                  example: false
                date_of_birth:
                  type: string
                  format: date
                  example: '1990-09-20'
                  nullable: true
                enrolled_by:
                  type: object
                  required:
                    - value
                  description: discribe where customers was recruit from
                  properties:
                    type:
                      type: string
                      description: |
                        Enrollment type, e.g. `url`, `store`, `qr_code`, any string
                      example: url
                    value:
                      type: string
                      example: https://facebook.com
                      nullable: true
                favorite_store:
                  type: string
                  description: customer favorite store
                  nullable: true
                company:
                  type: object
                  required:
                    - bussiness_name
                  description: |
                    Company details, supported when type is Company
                  properties:
                    organization_number:
                      type: string
                      description: Companys identification number
                      example: 123456789MVA
                    bussiness_name:
                      type: string
                      example: TKP tech AS
                    department:
                      type: string
                      description: companys department
                      example: sales department
                    industry:
                      type: string
                      example: computer industry
                    website:
                      type: string
                    number_of_employees:
                      type: string
                marketing_consent:
                  type: object
                  description: Customers consent for marketing in different channels
                  properties:
                    sms:
                      type: object
                      properties:
                        consent:
                          type: boolean
                          example: true
                        updated_at:
                          readOnly: true
                          type: string
                          format: date-time
                          example: '2018-01-12T13:42:00Z'
                          description: |
                            The date-time when the resource was last updated:
                    email:
                      type: object
                      properties:
                        consent:
                          type: boolean
                          example: true
                        updated_at:
                          readOnly: true
                          type: string
                          format: date-time
                          example: '2018-01-12T13:42:00Z'
                          description: |
                            The date-time when the resource was last updated:
                status:
                  type: string
                  description: |
                    Status of the customer
                term:
                  description: The term and condition accepted by the customer
                  properties:
                    id:
                      type: string
                type:
                  type: string
                  enum:
                    - customer
                    - company
                    - contact
                    - employee
                    - other
                  description: |
                    Describe type of an customer.
                    Company only allowed to be set when the type is "Company"
                token:
                  type: object
                  description: |
                    Token used to identify the customer
                  properties:
                    token_id:
                      type: string
                      description: |
                        Id of token identifying the customer
                      example: 983558fe-05bd-495f-92b5-9075d085db32
                    value:
                      type: string
                      description: |
                        Token value that combined with type
                        was used to identify the customer
                      example: 5345346544ffea22
                    type:
                      type: string
                      description: The token issuer
                      example: VIPPS
            gross_amount:
              type: integer
              description: |
                Monetary amount in smallest unit for the currency
                before discounts
              example: 59800
            gross_amount_dwh:
              type: string
              description: |
                Monetary amount in smallest unit for the currency
                before discounts with decimal
              example: '59800.01'
            net_amount:
              type: integer
              example: 47840
              description: |
                Monetary amount in smallest unit for the currency
                after discounts
            net_amount_dwh:
              type: string
              description: Monetary value in smallest unit for the currency after discounts with decimal
              example: '47840.01'
            round_off_to_coin:
              type: integer
              example: 100
            currency:
              type: string
              example: NOK
              description: |
                The three-character ISO-4217 currency.
                https://en.wikipedia.org/wiki/ISO_4217
            purchase_at:
              description: |
                The date and time for the receipt purchase
              type: string
              format: date-time
            order_number:
              type: string
              example: order12345
            transaction_date:
              type: string
              format: date-time
            amount_due:
              type: integer
              description: |
                How much more need to be paid before the
                transaction is completed.
                Monetary amount in smallest unit for the currency
              example: 2050
            amount_due_dwh:
              type: string
              example: '2050.10'
              description: Monetary value with decimal
            no_of_items:
              type: number
              description: |
                How many items did the customer buy
              example: 4
            is_changed:
              description: Discount applied to gross amount
              type: boolean
            transaction_id:
              type: string
              example: SC999-9991-1828
            total_discount:
              type: integer
              example: 0
            total_manual_discount_amount:
              type: integer
              example: 0
              description: |
                Monetary amount in smallest unit for the currency
            total_manual_percentage_discount:
              type: integer
              example: 0
            operator_id:
              type: string
              description: POS user
              example: '000210'
            operator_name:
              type: string
              description: Name of the POS user
              example: Ole Anders
            salesperson_id:
              type: string
              description: ID of the POS user
              example: '000111'
            salesperson_name:
              type: string
              example: Jesper
            entry_status:
              type: string
              description: Status for the transaction
              enum:
                - None
                - Voided
                - Posted
                - Concluded
                - Cancelled
                - OnHold
                - Training
                - Reprinted
            comment:
              type: string
              example: Kunden ønsker mer for info
            tax_lines:
              description: |
                Breakdown of the tax to different
                tax groups
              type: array
              items:
                $ref: '#/components/schemas/TaxItem'
            payments:
              type: array
              items:
                $ref: '#/components/schemas/PaymentItem'
            infocode_items:
              type: array
              items:
                $ref: '#/components/schemas/InfoCodeItem'
            receipt_text:
              type: string
            discount_code:
              type: array
              items:
                type: string
            extra_info:
              type: array
              items:
                $ref: '#/components/schemas/ExtraInfo'
    Claim:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - customer_id
            - discounts
            - purchase_at
          properties:
            ref:
              type: string
              description: |
                an external reference for the claim. Must be unique
                for the claim, reuse of ref will result in conflict
              example: transactionid1
            type:
              type: string
              description: |
                an external type for the claim
              example: pos
            purchase_at:
              type: string
              format: date-time
              description: |
                The date and time for the purchase the
                claim is done for.
            customer_id:
              type: string
              maxLength: 255
              description: |
                The customer id you have defined for the customer.
                (must not have trailing or leading spaces)
            discounts:
              type: array
              description: |
                Discounts to claim
              minItems: 1
              items:
                type: object
                required:
                  - id
                  - refs
                properties:
                  id:
                    description: |
                      Discount ID
                    type: string
                  refs:
                    type: array
                    description: |
                      Customer reference to the discount
                    minItems: 1
                    items:
                      type: object
                      required:
                        - id
                        - usage
                        - amount
                      properties:
                        id:
                          type: string
                          description: |
                            reference id to the customer instance of
                            the discount
                        amount:
                          type: integer
                          description: |
                            the amount for the ref to be claimed
                          minimum: 0
                          exclusiveMinimum: true
                        usage:
                          type: integer
                          description: number of times the ref should be claimed
                          example: 1
                          minimum: 0
                          exclusiveMinimum: true
    Campaign:
      description: Discount Campaign
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - name
          properties:
            campaign_id:
              type: string
              maxLength: 255
            name:
              type: string
            description:
              type: string
            private:
              description: |
                The campaign is private and will be excluded from public rules
                when filtered by campaign_id

                [GET /discounts/public/rules](/discounts-api/rules/aid_discounts_public_get)
              type: boolean
              default: false
            metadata:
              type: object
              maxProperties: 10
              description: |
                Additional metadata about the campaign
              example:
                sponsor: Solo
                is_featured: true
    Statistics:
      type: object
      properties:
        statistics:
          type: object
          properties:
            stamp:
              type: integer
              description: |
                total stamp collected
            used:
              type: integer
              description: |
                **deprecated** number of times the discount has been used
              example: 28
            usage:
              type: integer
              description: number of times the discount has been used
              example: 28
            amount:
              type: integer
              description: total reward given
              example: 280000
            debit_balance:
              type: integer
              description: |
                the discount debit balance, only applicable if
                discount reward type is `discount_debit`
              example: 12350
    CustomerDiscountStatistics:
      allOf:
        - $ref: '#/components/schemas/Statistics'
        - properties:
            statistics:
              type: object
              properties:
                current_stamp:
                  type: integer
                  description: stamps collected since last usage, excluding expired stamps
    UsageRefWrite:
      type: object
      required:
        - ref
        - ref_type
      properties:
        ref:
          type: string
          example: fe35e8ed-3fd3-4b04-acdd-6f1d7d7ca7c9
        ref_type:
          type: string
          example: receipt_add
        usage:
          type: integer
          example: 1
        stamp:
          type: integer
          example: 4
        amount:
          type: integer
          example: 12000
    Event:
      type: object
      properties:
        receipt:
          required:
            - id
            - customer_id
          allOf:
            - properties:
                id:
                  type: string
                  description: |
                    An ID that uniquely identifies the receipt
                  readOnly: false
            - $ref: '#/components/schemas/Receipt'
        token:
          type: object
          required:
            - token_id
            - customer_id
            - value
            - type
          properties:
            token_id:
              type: string
              maxLength: 255
              minLength: 1
              description: |
                The token id you have defined for the token.
                (must not have trailing or leading spaces)
            type:
              type: string
              description: identifies how or who is resposible for the token value
              example: sha1:email
              minLength: 1
            value:
              type: string
              example: a1b79ef1a62d94ffa86b3f3d846df0ee3993af92
              minLength: 1
            customer_id:
              type: string
              maxLength: 255
              minLength: 1
              description: |
                The customer id you have defined as owner of the token
                (must not have trailing or leading spaces)
    UsageRef:
      allOf:
        - $ref: '#/components/schemas/UsageRefWrite'
        - properties:
            created_at:
              type: string
              format: date-time
            created_by:
              type: string
    DiscountUsage:
      allOf:
        - properties:
            id:
              type: string
            ref_id:
              type: string
            discount_id:
              type: string
            customer_id:
              type: string
            create_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            created_by:
              type: string
            usage_refs:
              type: array
              items:
                $ref: '#/components/schemas/UsageRef'
        - $ref: '#/components/schemas/CustomerDiscountStatistics'
    AccountUserConfig:
      type: object
      description: Account user configurations
      properties:
        mfa:
          type: object
          properties:
            sms:
              type: object
              properties:
                updated_at:
                  type: string
                  format: date-time
                enabled:
                  type: boolean
            totp:
              type: object
              properties:
                updated_at:
                  type: string
                  format: date-time
                enabled:
                  type: boolean
    AccountAgreement:
      type: object
      description: |
        Defines an terms and conditions agreement between
        a company or user and Dintero
      properties:
        name:
          description: Defines the name of the agreement
          type: string
        version:
          description: Defines the version of the agreement
          type: string
        personal_guarantee_accepted:
          description: |
            The applicant/user has read and accepted the terms of
            a personal guarantee.
          type: boolean
        attachments:
          description: attachment policies
          type: array
          items:
            type: object
            properties:
              name:
                description: Defines the name of the attachment
                type: string
                example: Cookie Policy
              version:
                description: Defines the version of the attachment
                type: string
    AuthenticatedAccountUser:
      type: object
      required:
        - id
        - accounts
      properties:
        id:
          type: string
        configuration:
          $ref: '#/components/schemas/AccountUserConfig'
        accounts:
          type: array
          items:
            type: object
            required:
              - user
              - account_id
            properties:
              account_id:
                type: string
                example: P12345678
                description: The id that uniquely identifies the account
              business_name:
                type: string
                example: TKP technology AS
              public_business_name:
                type: string
                example: TKP tech
              organization_number:
                type: string
                example: 123456789MVA
              display_name:
                type: string
                example: TKP tech instore AS
              icon_url:
                description: |
                  Url to icon. The image should have equal height and width, around 50px.
                  Will be used to personalize the backoffice and checkout.
                type: string
                format: uri
                maxLength: 240
              user:
                type: object
                required:
                  - id
                  - email
                properties:
                  id:
                    type: string
                    description: An UUID that uniquely identifies the account user
                  last_seen_at:
                    type: string
                    format: date-time
                  scope:
                    type: array
                    items:
                      type: string
                      minItems: 1
                      example: receipts:write
                  name:
                    type: string
                    description: The name of the user in the account
                  email:
                    type: string
                    example: customer@example.com
                  agreement:
                    $ref: '#/components/schemas/AccountAgreement'
    Challenge:
      type: object
      description: Challenge recovery
      required:
        - challenge_type
      properties:
        challenge_type:
          type: string
          description: |
            The challenge type accepted by your application
          enum:
            - oob
        oob_channel:
          type: string
          description: |
            The channel to use for OOB. Can only be provided when
            `challenge_type` is oob.
          enum:
            - sms
            - email
          default: sms
    AuthChallenge:
      description: multi-factor authentication (MFA) challenge
      allOf:
        - $ref: '#/components/schemas/Challenge'
        - required:
            - mfa_token
          properties:
            mfa_token:
              type: string
              description: |
                The token received from `mfa_required` error.
    MfaChallenge:
      type: object
      properties:
        challenge_type:
          type: string
          enum:
            - oob
        binding_method:
          type: string
          enum:
            - prompt
        oob_code:
          type: string
          example: bkaiew...akas
    AuthUserLinks:
      type: array
      description: |
        Links to resources related to the user, links is required when
        MFA is enabled.
      items:
        type: object
        properties:
          rel:
            type: string
            description: |
              The relationship between the user and the linked resource
              - `customers_user`: A link to the customer user resource.
                The link will be used to lookup email or phone_number if
                MFA is enabled on the user.
              - `email`: The link includes the email to use in
                email OOB message. Fallback if no `customers_user` rel
                is provided.
              - `phone_number`: The link includes the phone_number to
                use in SMS OOB message. Fallback if no `customers_user`
                rel is provided.
            example: customers_user
            enum:
              - email
              - phone_number
              - customers_user
          href:
            type: string
            description: The URL of the link
      example:
        - rel: customers_user
          href: https://api.dintero.com/v1/accounts/P12345678/users/99919
        - rel: phone_number
          href: tel:+4799999999
        - rel: email
          href: mailto:name@email.com
    AuthUserMfa:
      type: object
      description: |
        Require Multi-factor authentication (MFA) for the user
      required:
        - challenge_type
      properties:
        challenge_type:
          type: string
          description: |
            The challenges types enabled (required) by the user.    enum:
            - oob
        oob_channels:
          type: array
          description: |
            The supported channels to use for OOB. Can only be used if `channel_type`
            is `oob`.
          items:
            type: string
            enum:
              - sms
              - email
    AuthenticatedUser:
      type: object
      description: A user with password
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - username
          properties:
            username:
              type: string
              description: The user's username.
              minLength: 1
              maxLength: 255
            links:
              $ref: '#/components/schemas/AuthUserLinks'
            mfa:
              $ref: '#/components/schemas/AuthUserMfa'
    UploadUrl:
      type: object
      properties:
        public_url:
          type: string
          format: string
          description: |
            The public URL the asset will be made available from after the
            upload has completed.
        upload_url:
          type: string
          format: url
          description: |
            An URL to upload the asset to.

            - The content type header value must be the same as the `mime_type`
            - The content length header value must be the same as the size of
              the file and the `size_bytes`.

            **Upload example**
            ```
            curl -X PUT
              -H 'Content-Type: {mime_type}' \
              -H 'Content-Length: {size_bytes}' \
              --upload-file <file> \
              {upload_url}
            ```
        upload_expires_in:
          type: integer
          description: |
            The number of seconds until the upload url is no longer valid
    AccountJwks:
      type: object
      properties:
        jwks:
          readOnly: true
          description: |
            Alternative JWKS configured for validating access token issued by
            external authentication.
          required:
            - name
            - uri
          properties:
            name:
              description: |
                Short name identifying the issuer.
              type: string
            uri:
              type: string
              format: uri
              example: https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json
    ApprovalStatus:
      type: string
      enum:
        - ACTIVE
        - DECLINED
        - UNDER_MANUAL_REVIEW
        - AUTOMATIC_REVIEW
        - WAITING_FOR_SIGNATURE
        - WAITING_FOR_DECLARATION
        - ERROR
        - ARCHIVED
        - WAITING_FOR_DETAILS
        - TERMINATED
    AccountPaymentSummary:
      type: object
      properties:
        payment_case_status:
          allOf:
            - $ref: '#/components/schemas/ApprovalStatus'
            - readOnly: true
        projected_sales:
          type: string
          readOnly: true
          description: Projected sales declared by merchant.
        average_transaction_value:
          type: string
          readOnly: true
        merchant_category_code:
          type: string
          readOnly: true
          description: Merchant category code declared by merchant.
          format: mcc
        delivery_timeline:
          type: string
          readOnly: true
          enum:
            - P0W
            - P1D
            - P2D
            - P5D
            - P2W
            - P4W
            - P12W
            - P1Y
        most_expensive_product_price:
          type: string
          readOnly: true
          description: Price of most expensive product declared by merchant.
        gift_card_revenue_percentage:
          type: string
          readOnly: true
          description: |
            Percentage of revenue coming from gift card transactions
            declared by merchant.
        credit_rating:
          type: string
          readOnly: true
          description: The most recent credit rating of the merchant.
        prev_credit_rating:
          type: string
          readOnly: true
          description: The previous credit rating of the merchant.
        currency:
          type: string
          enum:
            - NOK
            - SEK
            - DKK
            - EUR
          readOnly: true
          description: |
            The currency of the various values declared by the merchant, such as
            `most_expensive_product_price`, `average_transaction_value`, and so on.
    UtmCampaign:
      type: object
      title: campaign
      properties:
        utm_source:
          type: string
          title: Campaign Source
          description: |
            Use utm_source to identify a search engine, newsletter name,
            or other source.
          example: google
        utm_medium:
          type: string
          title: Campaign Medium
          description: |
            Use utm_medium to identify a medium such as email or cost-per- click.
          example: cpc
        utm_campaign:
          type: string
          title: Campaign Name
          description: |
            Used for keyword analysis. Use utm_campaign to identify a
            specific product promotion or strategic campaign.
          example: spring_sale
        utm_term:
          type: string
          title: Campaign Term
          description: |
            Used for paid search. Use utm_term to note the keywords
            for this ad.
          example: running+shoes
        utm_content:
          type: string
          title: Campaign Content
          description: |
            Used for A/B testing and content-targeted ads. Use utm_content
            to differentiate ads or links that point to the same URL.
          example: textlink
    AccountApplicant:
      type: object
      required:
        - email
        - agreement
      properties:
        first_name:
          type: string
          example: John
        last_name:
          type: string
          example: Doe
        email:
          type: string
          example: customer@example.com
        phone_number:
          type: string
          description: |
            A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
        agreement:
          $ref: '#/components/schemas/AccountAgreement'
        recaptcha_sitekey:
          type: string
          description: |
            The public site key used for reCAPTCHA
          example: 6LdE_pIUAAAAAHbiL0uHjHg2Mgn2IILTvZdA_Ux-
        recaptcha_response:
          type: string
          description: |
            A response from a reCAPTCHA check
          example: 03AOLTBLSbzmXKXuAz9N--DsZ1xWmhfx6okCheBPesOsNmRSdkfcO4E5CkeBQQFJkC_emfE_KF0P8C3T57Nr9eOon_PVTEIq1NUpRS5oGkGMhr1vxVe1F7txMYUc4ClxUDLxWiW5WgnDvWHC7gOnlJZKvxVE4gn7qAJijE6SFMXkvFOwoWcx_kONmBHGnXHGgxIe2M8G-FkIKr0WZbQIDYmDaiQxb6mL1L70UGOyO280v2Pp65JB1mSohdeJLdQhHeye6v6__H9_M0GxDGd8s-LoLUY5Vq9hKbAs8MCsh2OFwtpbTYGfqmDbTwsc2v8SqOOZ86uKXwl7gyk3RHXT27m8Rv8iZAs2Ym5w
        promo_code:
          type: string
          description: Promotion code
        signup_reference:
          type: string
          description: An optional reference that can be used to identify the signup when the account has been created.
        utm:
          $ref: '#/components/schemas/UtmCampaign'
    AccountCompanyTerms:
      description: |
        Terms of company account.
      type: object
      properties:
        type:
          type: string
          enum:
            - all
            - sales
            - cookies
            - privacy
        href:
          type: string
          format: uri
    AccountCompanyContact:
      description: |
        Contact details for a company.
      type: object
      properties:
        phone_number:
          type: string
          pattern: ^\+?\d{5,15}$
          description: |
            ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
        email:
          type: string
          format: email
        website:
          type: string
          format: uri
        type:
          type: string
          enum:
            - support
            - disputes
    AccountCompany:
      description: |
        The details of an account company
      type: object
      required:
        - business_name
        - address
      properties:
        business_name:
          type: string
          example: TKP tech AS
        display_name:
          type: string
          example: TKP tech instore AS
          description: The name of the company as displayed in Dintero systems. If not set, defaults to business_name.
        organization_number:
          type: string
          description: Companys identification number
          example: 123456789MVA
        industry:
          type: string
          example: computer industry
        website:
          type: string
          format: uri
          maxLength: 120
        terms_url:
          type: string
          format: uri
          maxLength: 240
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        address:
          $ref: '#/components/schemas/Address'
        email:
          type: string
          format: email
          example: contact@business.dintero.com
        technical_email:
          type: string
          format: email
          example: tech_support@business.dintero.com
          description: |
            Technical email. Dintero will use this email when contacting
            the company about technical issues.
        phone_number:
          type: string
          pattern: ^\+?\d{5,15}$
          description: |
            mobile number of a person / company, ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
        branding:
          type: object
          properties:
            icon_url:
              description: |
                Url to icon. The image should have equal height and width, around 50px.

                Will be used to personalize the backoffice and checkout.
              type: string
              format: uri
              maxLength: 240
            logo_url:
              description: |
                Url to logo. Will be used in receipts, emails, etc.
              type: string
              format: uri
              maxLength: 240
        merchant_category_code:
          type: string
          format: mcc
        average_transaction_value:
          type: string
        most_expensive_product_price:
          type: string
        projected_sales:
          type: string
        terms:
          type: array
          description: |
            Terms of company account. If `terms_url` is set, this property will include a term of type `all` that corresponds to the `terms_url`.
            If the opposite is true, `terms_url` will be set corresponding to the first term of type `all`.
          items:
            allOf:
              - $ref: '#/components/schemas/AccountCompanyTerms'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/AccountCompanyContact'
        public_business_name:
          type: string
          example: TKP tech
          description: Public name of the business, as displayed to customers
    AccountBillingStatement:
      description: |
        The details of the billing statement for the account
      type: object
      properties:
        name:
          type: string
          description: The name to be displayed on the billing statement
          minLength: 2
          maxLength: 22
          example: John Doe
        phone_number:
          type: string
          description: |
            The phone number to be displayed on the billing statement, ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
          pattern: ^\+?\d{5,15}$
          example: '+4745454545'
    AccountBilling:
      description: |
        The details of the billing for the account
      type: object
      required:
        - business_name
        - address
      properties:
        business_name:
          type: string
          example: TKP tech AS
        organization_number:
          type: string
          description: Companys identification number
          example: 123456789MVA
        address:
          $ref: '#/components/schemas/Address'
        email:
          description: Billing email
          type: string
          example: billing@business.dintero.com
        reference:
          description: Billing reference
          type: string
          maxLength: 120
        phone_number:
          type: string
          pattern: ^\+?\d{5,15}$
          description: |
            mobile number of a person / company, ITU/E.123 format with
            international prefix (+PPNNNNNNNNN...)
        billing_statement:
          $ref: '#/components/schemas/AccountBillingStatement'
    Subscription:
      type: object
      description: Subscription plan for the account
      required:
        - interval
        - plan
      properties:
        interval:
          type: string
          description: |
            The frequency with which a subscription should be billed.
          enum:
            - month
            - year
        plan:
          type: string
          description: |
            The price plan which a billing is based on
          enum:
            - transaction_fee
            - per_customer_fee
        support:
          type: string
          description: The support service enabled
          enum:
            - office_hours
            - 24_7_extended
        metadata:
          type: object
          maxProperties: 40
          description: |
            A set of key/value pairs that you can attach to a subscription
            object. It can be useful for storing additional information about
            the subscription in a structured format.
    Attachment:
      description: |
        An attachment is a file or document associated with a reference and a uri.
      type: object
      required:
        - ref
        - href
      properties:
        ref:
          type: string
          description: |
            The reference to the attachment.
        href:
          type: string
          format: uri
          description: |
            The URI of the attachment.
    Account:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/AccountJwks'
        - $ref: '#/components/schemas/AccountPaymentSummary'
        - required:
            - applicant
            - company
            - billing
          properties:
            applicant:
              description: The individual completing the account registration
              allOf:
                - $ref: '#/components/schemas/AccountApplicant'
                - properties:
                    agreement:
                      type: object
                      properties:
                        accepted_at:
                          description: |
                            defines the date of the account terms and conditions
                            agreement in ISO 8601 format with a timezone
                          type: string
                          format: date-time
                          readOnly: true
            company:
              $ref: '#/components/schemas/AccountCompany'
            billing:
              $ref: '#/components/schemas/AccountBilling'
            subscription:
              $ref: '#/components/schemas/Subscription'
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/Attachment'
            account_id:
              type: string
              description: The id that uniquely identifies the account.
              readOnly: true
            partner_id:
              type: string
              description: The id of the partner associated with the account
              format: ^[PT]{1}(?=(?:.{3})$)[0-9]*$
              readOnly: true
            livemode:
              type: boolean
              description: |
                Flag indicating whether the account exists in live
                mode and test mode.
              default: false
            active:
              type: boolean
              description: The account is active
              default: false
              readOnly: true
            language_code:
              type: string
              description: |
                The preferred language for the account as defined by
                <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>
                (IETF BCP 47, "Tags for Identifying Languages").
            platform_type:
              type: string
              description: |
                Optional type of platform for merchants using split payout.
              readOnly: true
              enum:
                - marketplace
                - aggregator
            allowed_merchant_category_codes:
              type: array
              description: Restricts the MCC codes available for selection during merchant onboarding.
              items:
                type: string
                pattern: ^\d{4}$
    AccountConnectionEvent:
      type: object
      required:
        - status
        - event
      properties:
        id:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: string
          readOnly: true
        status:
          type: string
          enum:
            - pending
            - enabled
            - failed
            - declined
        event:
          type: string
          example: signature_required
        description:
          description: short description about the event
          type: string
          example: Vipps awaiting signature
        metadata:
          maxProperties: 40
          description: |
            A set of key/values that you can attach to a connection
            event.
          example:
            signature_link: https://sig.example.com/K34K244
    AccountConnectionMeta:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        metadata:
          type: object
          maxProperties: 40
          description: |
            A set of key/value pairs that you can attach to a subscription
            object. It can be useful for storing additional information about
            the subscription in a structured format.
        status:
          description: |
            The status of the connection
          type: string
          enum:
            - pending
            - enabled
            - failed
            - declined
        events:
          description: |
            List of events recorded, an event is created when the
            connection is updated with new status
          type: array
          items:
            $ref: '#/components/schemas/AccountConnectionEvent'
        schema:
          type: number
          description: |
            The version of the schema used for the connection
          readOnly: true
    AccountConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnectionMeta'
        - properties:
            configuration:
              type: object
              required:
                - payment_options
              properties:
                payment_options:
                  description: |
                    Payment options supported by this connection
                  type: array
                  items:
                    type: object
                    required:
                      - currencies
                      - type
                    properties:
                      currencies:
                        type: array
                        items:
                          type: string
                          format: iso4217-code
                          example: NOK
                      type:
                        type: string
    ApplePayPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero_psp.applepay
          details:
            type: object
            description: |
              Configuration details for the payment option
            properties:
              domain_names:
                description: |
                  An array of domain names used for embedding the checkout with Apple Pay. The value is just the domain name, without the protocol, port or path.
                type: array
                items:
                  type: string
                  example: example.dintero.com
    ApplePayConnectionConfiguration:
      type: object
      description: |
        The configuration for the Apple Pay connection.
      required:
        - merchant_id
        - payment_options
      properties:
        merchant_id:
          type: string
          description: |
            The Apple Pay merchant identifier.
        payment_options:
          $ref: '#/components/schemas/ApplePayPaymentOptions'
    ApplePayConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/ApplePayPaymentOptions'
        domain_names:
          description: |
            An array of domain names used for payment. Just the domain name, without the protocol.
          type: array
          items:
            type: string
            example: example.dintero.com
    ApplePayConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
            - configuration
          properties:
            configuration:
              $ref: '#/components/schemas/ApplePayConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/ApplePayConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    BamboraConnectionConfiguration:
      type: object
      description: |
        Bambora configuration for the merchant

        The Bambora configuration includes a `secret_token` stored safely and never exposed
      required:
        - merchant_number
        - md5_key
      properties:
        merchant_number:
          type: string
        md5_key:
          type: string
        access_token:
          type: number
        secret_token:
          type: string
        token_scope:
          type: string
    BamboraPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - bambora.creditcard
              - bambora.mobilepay
              - bambora.vipps
              - bambora.applepay
    BamboraDirectConnectionSignup:
      type: object
      required:
        - case_id
        - merchant_number
        - md5_key
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        merchant_number:
          type: string
          example: P12345678
        md5_key:
          type: string
          example: ae45ase
        payment_options:
          $ref: '#/components/schemas/BamboraPaymentOptions'
    BamboraConnectionSignup:
      type: object
      required:
        - payment_options
        - bank_name
        - account_number
        - revenue
      properties:
        payment_options:
          $ref: '#/components/schemas/BamboraPaymentOptions'
        store_type:
          type: array
          items:
            type: string
            enum:
              - online
              - instore
              - remote
        revenue:
          type: object
          properties:
            currency:
              type: string
              format: iso4217-code
              example: NOK
              description: |
                The three-character ISO-4217 currency for the expected amounts.
                https://en.wikipedia.org/wiki/ISO_4217
            yearly_revenue:
              type: string
              example: 100.000-250.000 NOK
            highest_transaction_amount:
              type: string
              example: 500-1000 NOK
              description: |
                estimated highest amount in a single transaction
            average_amount:
              type: string
              example: 250-500 NOK
              description: |
                average amount of transactions
            accept_prepaid:
              description: The company accepts advanced payments
              type: boolean
            subscriptions_or_memberships:
              description: The company sells subscriptions or memberships
              type: boolean
            gift_cards:
              description: The company sells gift cards
              type: boolean
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        ownership:
          type: object
          properties:
            ownership_structure:
              type: string
              enum:
                - owners_with_more_than_25
                - no_owners_with_more_than_25
                - complex
            owners:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Name of owner, or representative of the company owning shares.
                  legal_name:
                    type: string
                    description: Name of company. Required if the owner is a company.
                  date_of_birth:
                    type: string
                    description: Date of birth of the signee.
                    example: '1990-09-20'
                  percentage:
                    type: number
                    example: 25
                    description: Ownership percentage
        verifications:
          type: object
          description: |
            Verify that the business complies with the following requirements from the payment connections.
          properties:
            terms_and_conditions:
              description: |
                The payment site displays terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: boolean
            terms_and_conditions_url:
              description: |
                Url to terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: string
            contact_information:
              description: |
                The company's contact information is easily available, including organization number, phone number
                and address
              type: boolean
            payment_site:
              description: Customers have access to a payment site. Applies to online stores.
              type: boolean
            clear_pricing:
              description: All products and services have clearly marked prices.
              type: boolean
            payment_product_logos:
              description: Visa and Mastercard logos are visible on the payment site.
              type: boolean
        signature:
          type: object
          description: |
            Signatures from general manager or someone with signature authority
          properties:
            signatures:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  email:
                    type: string
            politically_exposed_person:
              description: |
                If you or owner is a politically exposed person according to the money laundering act
              type: boolean
            politically_exposed_associated:
              description: |
                If you or owner is closesely associated with an politically exposed person
                according to the money laundering act
              type: boolean
        applicant:
          description: |
            The person signing up for payment connection.
          type: object
          properties:
            phone_number:
              type: string
              description: |
                A phone number in E.164 number formatting.
              format: ^\+?[1-9]\d{1,14}$
              example: '+4799999999'
    BamboraPayFacConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        merchant_number:
          type: string
          example: P12345678
        md5_key:
          type: string
          example: ae45ase
        payment_options:
          $ref: '#/components/schemas/BamboraPaymentOptions'
        mcc:
          type: string
          format: iso-18245
          example: 5814
          description: |
            A four-digit Merchant Category Code (MCC) for the store
            [ISO 18245:2003](https://www.iso.org/standard/33365.html)

            Overrides what is previously set on the case.
    BamboraConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - properties:
            configuration:
              $ref: '#/components/schemas/BamboraConnectionConfiguration'
            direct_signups:
              type: array
              description: |
                The Bambora direct signups received for this account.
              items:
                allOf:
                  - $ref: '#/components/schemas/BamboraDirectConnectionSignup'
                  - required:
                      - created_at
                      - signup_id
                    properties:
                      signup_id:
                        type: string
                        description: |
                          Unique ID for the signup
                        format: uuid
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
                      callback_at:
                        type: string
                        format: date-time
                        description: |
                          Callback when Bambora approved the signup
            signup:
              description: |
                **DEPRECATED** 

                Signup object present for Bambora signups with the old `POST /connections/bambora` endpoint.
              allOf:
                - $ref: '#/components/schemas/BamboraConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Bambora approved the signup
            submerchant_signups:
              type: array
              description: |
                The signups received for this account

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/BamboraPayFacConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
                      callback_at:
                        type: string
                        format: date-time
                        description: |
                          Callback when Bambora approved the signup
    CollectorConnectionConfiguration:
      type: object
      description: |
        Collector Bank configuration for the merchant

        The Collector configuration includes a `password` stored safely and never exposed
      properties:
        username:
          type: string
        store_id:
          type: number
        country:
          type: string
          format: iso-3166-1
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - collector.invoice
                  - collector.invoice_b2b
                  - collector.installment
    CollectorConnectionSignup:
      type: object
      required:
        - legal_name
        - organization_number
        - bank_name
        - account_number
        - website
        - payment_options
      properties:
        business_name:
          type: string
          description: Name of the merchant, if it differs from legal_name
        legal_name:
          type: string
        organization_number:
          type: string
          example: 123456789MVA
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        website:
          type: string
          description: Company's website url
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - collector.invoice
                  - collector.installment
    CollectorConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            configuration:
              $ref: '#/components/schemas/CollectorConnectionConfiguration'
            signup:
              allOf:
                - $ref: '#/components/schemas/CollectorConnectionSignup'
                - required:
                    - created_at
                    - url
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    url:
                      type: string
                      description: |
                        Signup URL from Collector, where merchant can complete the signup
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Collector approved the signup
    PaymentOptions:
      type: array
      items:
        type: object
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero.zero
              - swish.swish
              - payex.creditcard
              - payex.vipps
              - payex.mobilepay
              - collector.invoice
              - collector.installment
              - collector.invoice_b2b
              - instabank.finance
              - instabank.invoice
              - instabank.postponement
              - instabank.installment
              - vipps
              - bambora.creditcard
              - bambora.mobilepay
              - bambora.vipps
              - klarna.klarna
              - klarna.billie
    CommonConnectionSignup:
      type: object
      required:
        - payment_options
        - store_type
      properties:
        payment_options:
          $ref: '#/components/schemas/PaymentOptions'
        store_type:
          type: array
          items:
            type: string
            enum:
              - online
              - instore
              - remote
        package:
          type: string
          description: |
            What pricing strategy to use for this company.
          example: Checkout 195 NOK/month + 1.5%
        revenue:
          type: object
          properties:
            currency:
              type: string
              format: iso4217-code
              example: NOK
              description: |
                The three-character ISO-4217 currency for the expected amounts.
                https://en.wikipedia.org/wiki/ISO_4217
            yearly_revenue:
              type: string
              example: 100.000-250.000 NOK
            highest_transaction_amount:
              type: string
              example: 500-1000 NOK
              description: |
                estimated highest amount in a single transaction
            average_amount:
              type: string
              example: 250-500 NOK
              description: |
                average amount of transactions
            accept_prepaid:
              description: The company accepts advanced payments
              type: boolean
            subscriptions_or_memberships:
              description: The company sells subscriptions or memberships
              type: boolean
            gift_cards:
              description: The company sells gift cards
              type: boolean
            estimated_percentage_per_payment_type:
              description: Estimates of revenue in percentages per payment store_type
              type: array
              items:
                type: object
                properties:
                  percentage:
                    type: number
                    minimum: 0
                    maximum: 100
                  type:
                    type: string
                    enum:
                      - swish.swish
                      - payex.creditcard
                      - payex.vipps
                      - payex.mobilepay
                      - collector.invoice
                      - collector.installment
                      - collector.invoice_b2b
                      - instabank.finance
                      - instabank.invoice
                      - instabank.postponement
                      - instabank.installment
                      - vipps
                      - bambora.creditcard
                      - bambora.mobilepay
                      - bambora.vipps
        bank_accounts:
          description: |
            Will only support one bank account for the time being
          type: array
          minItems: 1
          maxItems: 1
          items:
            type: object
            properties:
              account_number:
                type: string
                description: The bank account number
              account_number_type:
                type: string
                description: |
                  What format the account number is.
                enum:
                  - iban
                  - mod11
              bank_name:
                type: string
                description: The name of the bank
              account_statement_url:
                type: string
                format: uri
                pattern: https?://*
                example: https://example.dintero.com/c/photos/account_statement.pdf
                description: |
                  Document or image to prove that the account number belongs to the company.
        ownership:
          type: object
          properties:
            ownership_structure:
              type: string
              enum:
                - owners_with_more_than_25
                - no_owners_with_more_than_25
                - complex
            owners:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Name of owner, or representative of the company owning shares.
                  legal_name:
                    type: string
                    description: Name of company. Required if the owner is a company.
                  date_of_birth:
                    type: string
                    description: Date of birth of the owner.
                    example: '1990-09-20'
                  social_security_number:
                    type: string
                    description: Social security number of the owner.
                  percentage:
                    type: number
                    example: 25
                    description: Ownership percentage
                  address:
                    $ref: '#/components/schemas/Address'
        verifications:
          type: object
          description: |
            Verify that the business complies with the following requirements from the payment connections.
          properties:
            terms_and_conditions:
              description: |
                The payment site displays terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: boolean
            terms_and_conditions_url:
              description: |
                Url to terms and conditions, including return policy, delivery options and a
                privacy policy.
              type: string
            contact_information:
              description: |
                The company's contact information is easily available, including organization number, phone number
                and address
              type: boolean
            payment_site:
              description: Customers have access to a payment site. Applies to online stores.
              type: boolean
            payment_site_url:
              description: |
                Url to payment site.
              type: string
            demo_site_url:
              description: |
                Url to demo site.
              type: string
            clear_pricing:
              description: All products and services have clearly marked prices.
              type: boolean
            payment_product_logos:
              description: Visa and Mastercard logos are visible on the payment site.
              type: boolean
        signature:
          type: object
          description: |
            Signatures from general manager or someone with signature authority
          properties:
            signatures:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  email:
                    type: string
            politically_exposed_person:
              description: |
                If you or owner is a politically exposed person according to the money laundering act
              type: boolean
            politically_exposed_associated:
              description: |
                If you or owner is closesely associated with an politically exposed person
                according to the money laundering act
              type: boolean
        applicant:
          description: |
            The person signing up for payment connection.
          type: object
          properties:
            first_name:
              type: string
              example: John
            last_name:
              type: string
              example: Doe
            email:
              type: string
              example: customer@example.com
            phone_number:
              type: string
              description: |
                A phone number in E.164 number formatting.
              format: ^\+?[1-9]\d{1,14}$
              example: '+4799999999'
            social_security_number:
              type: string
              description: Social security number of the owner.
        company_information:
          type: object
          description: |
            Information on what your company does
          properties:
            industry:
              type: string
              enum:
                - goods
                - services
                - subscriptions_or_memberships
                - charity
                - travel_and_entertainment
                - food_and_beverages
                - other
            company_category:
              type: string
              description: |
                Company MCC code
              enum:
                - '4722'
                - '5021'
                - '5045'
                - '5122'
                - '5211'
                - '5399'
                - '5499'
                - '5691'
                - '5699'
                - '5712'
                - '5719'
                - '5732'
                - '5811'
                - '5812'
                - '5813'
                - '5814'
                - '5816'
                - '5817'
                - '5932'
                - '5941'
                - '5944'
                - '5945'
                - '5971'
                - '5977'
                - '5993'
                - '5999'
                - '7011'
                - '7033'
                - '7298'
                - '7299'
                - '7392'
                - '7399'
                - '7512'
                - '7922'
                - '7929'
                - '7991'
                - '7997'
                - '7999'
                - '8299'
                - '8398'
                - '8641'
                - '8699'
                - '8999'
            mcc:
              type: object
              description: More data about the mcc code selected
              properties:
                mcc:
                  type: string
                range:
                  type: object
                  properties:
                    start:
                      type: string
                    end:
                      type: string
                    description:
                      type: string
                    reserved:
                      type: boolean
                iso_description:
                  type: string
                usda_description:
                  type: string
                stripe_description:
                  type: string
                stripe_code:
                  type: string
                visa_description:
                  type: string
                visa_req_clearing_name:
                  type: string
            company_description:
              type: string
              description: |
                Description of the product or services that the company accepts payments from
        payment_method_specific:
          type: object
          description: |
            Any properties specifically needed for a certain payment method
          properties:
            payex:
              type: object
              properties:
                signup_url:
                  type: string
                  description: |
                    Link to payex form
            instabank:
              type: object
              required:
                - total_number_of_transactions
                - total_volume_of_transactions
                - finance_number_of_transactions
                - finance_volume_of_transactions
              description: |
                These fields must be filled out if instabank is a chosen payment method
              properties:
                total_number_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated number of transactions
                total_volume_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated yearly transaction volume
                finance_number_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated number of finance transactions
                finance_volume_of_transactions:
                  type: string
                  minLength: 1
                  description: |
                    Estimated yearly volume of finance transactions
    CommonConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnectionMeta'
        - required:
            - signup
          properties:
            signup:
              allOf:
                - $ref: '#/components/schemas/CommonConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                - properties:
                    payment_method_specific:
                      type: object
                      description: |
                        Any properties specifically needed for a certain payment method
                      properties:
                        vipps:
                          type: object
                          properties:
                            signup_url:
                              type: string
                              description: |
                                Link to vipps form
    DinteroPspConnectionConfiguration:
      type: object
      description: |
        Visa Tokenization configuration for the merchant
      required:
        - client_app_id
        - relationship_id
      properties:
        visa_net_client_id:
          type: string
        acquirer_merchant_id:
          type: string
        vipps_merchant_serial_number:
          type: string
          example: '123456'
        visa_token_client_app_id:
          type: string
        visa_token_relationship_id:
          type: string
          example: 10000000-20000000000
        mastercard_token_src_dpa_id:
          type: string
          example: src_dpa_56068
        mastercard_token_service_id:
          type: string
          example: SECURE_COF_MERCHANT_OBO#TESTPROJECT_PROD-PGMNAME#01
        google_pay_merchant_gateway_id:
          type: string
          example: dintero-test
    DinteroPspPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero_psp.creditcard
    DinteroPspConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service.
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/DinteroPspPaymentOptions'
    DinteroPspConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/DinteroPspConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/DinteroPspConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    InstabankConnectionConfiguration:
      type: object
      description: |
        Instabank configuration for the merchant
      properties:
        payment_product_codes:
          type: object
          description: |
            Instabank Product Codes
          required:
            - instabank.invoice
            - instabank.finance
          properties:
            instabank.finance:
              type: string
              example: '630'
            instabank.invoice:
              type: string
              example: '632'
        organization_number:
          type: string
        payment_options:
          type: array
          items:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - instabank.invoice
                  - instabank.finance
    InstabankConnectionSignup:
      type: object
      required:
        - email
        - phone_number
        - total_number_of_transactions
        - total_volume_of_transactions
        - finance_number_of_transactions
        - finance_volume_of_transactions
        - industry
        - payment_options
        - account_number
      properties:
        email:
          type: string
          example: customer@example.com
        phone_number:
          type: string
          description: |
            A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
        total_number_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated number of transactions
        total_volume_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated yearly transaction volume
        finance_number_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated number of finance transactions
        finance_volume_of_transactions:
          type: string
          minLength: 1
          description: |
            Estimated yearly volume of finance transactions
        industry:
          type: string
          example: computer industry
        account_number:
          type: string
          description: |
            The account number for where settlement payout is transfered to. Must be
            a checking account in a Norwegian bank.
          format: modulus11
          minLength: 11
          maxLength: 11
          example: '12345678911'
        payment_options:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - instabank.invoice
                  - instabank.finance
    InstabankConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            configuration:
              $ref: '#/components/schemas/InstabankConnectionConfiguration'
            signup:
              allOf:
                - $ref: '#/components/schemas/InstabankConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Instabank approved the signup
    KlarnaPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - klarna.klarna
              - klarna.billie
    KlarnaConnectionConfiguration:
      type: object
      description: |
        Klarna configuration for the merchant
      properties:
        credentials:
          type: array
          description: |
            The Klarna credentials created for this account
          items:
            type: object
            required:
              - case_id
              - merchant_id
              - username
            properties:
              case_id:
                description: |
                  The id to the case id in auth service
                type: string
                format: uuid
              merchant_id:
                type: string
              username:
                type: string
        payment_options:
          $ref: '#/components/schemas/KlarnaPaymentOptions'
    KlarnaConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/KlarnaPaymentOptions'
        price_package:
          description: |
            Name of the Dintero price package for the merchant. 
            The price package must be registered with Klarna as a price plan.
          type: string
          example: EU_DINTERO_PP001
        mcc:
          type: string
          format: iso-18245
          example: 5814
          description: |
            A four-digit Merchant Category Code (MCC) for the store
            [ISO 18245:2003](https://www.iso.org/standard/33365.html)

            Overrides what is previously set on the case.
    KlarnaConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/KlarnaConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/KlarnaConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
                      callback_at:
                        type: string
                        format: date-time
                        description: |
                          Callback when Klarna approved the signup
    KraviaConnectionSettlementType:
      type: string
      description: |
        Indicates whether settlement is done directly to the merchant or handled by Dintero
      enum:
        - direct
        - via_dintero
    KraviaPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - kravia.invoice_b2b
              - kravia.invoice_b2c
              - kravia.invoice_b2b_grouped
    InvoiceChannel:
      type: string
      description: |
        Default channel used for Kravia invoice distribution.

        - `kravia`: Dintero/Kravia distributes the invoice.
        - `merchant`: The merchant distributes the invoice.
      enum:
        - kravia
        - merchant
      default: kravia
    KraviaConnectionConfiguration:
      type: object
      description: |
        Kravia configuration for the merchant
      properties:
        credentials:
          type: array
          description: |
            The Kravia credentials created for this account
          items:
            type: object
            required:
              - case_id
              - merchant_id
            properties:
              case_id:
                description: |
                  The id to the case id in auth service
                type: string
                format: uuid
              merchant_id:
                type: string
              settlement_type:
                $ref: '#/components/schemas/KraviaConnectionSettlementType'
        payment_options:
          $ref: '#/components/schemas/KraviaPaymentOptions'
        supported_invoice_channels:
          type: array
          description: |
            Invoice channels available for this account.
          items:
            $ref: '#/components/schemas/InvoiceChannel'
          default:
            - kravia
    KraviaConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/KraviaPaymentOptions'
        settlement_type:
          $ref: '#/components/schemas/KraviaConnectionSettlementType'
    KraviaConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/KraviaConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/KraviaConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    Mastercard3DSConnectionSignup:
      type: object
      required:
        - case_id
      properties:
        case_id:
          description: |
            The id to the case id in auth service.
          type: string
          format: uuid
    Mastercard3DSConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              type: object
              description: |
                Mastercard 3DS configuration for the merchant
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - enabled
                    - failed
                    - pending
                    - declined
                  description: |
                    The status of the configuration
            events:
              type: array
              description: |
                The events received for this account.
              items:
                allOf:
                  - $ref: '#/components/schemas/AccountConnectionEvent'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when event was initiated
                        type: string
                        format: date-time
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/Mastercard3DSConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    MastercardTokenizationConnectionConfiguration:
      type: object
      description: |
        Mastercard Tokenization configuration for the merchant
      required:
        - token_src_dpa_id
        - token_service_id
      properties:
        token_src_dpa_id:
          type: string
        token_service_id:
          type: string
    MastercardTokenizationConnectionSignup:
      type: object
      required:
        - case_id
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
    MastercardTokenizationConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/MastercardTokenizationConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/MastercardTokenizationConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    PayExConnectionConfiguration:
      type: object
      description: |
        PayEx configuration for the merchant

        The PayEx configuration includes a `token` stored safely and never exposed
      properties:
        payee_id:
          type: string
        subsite:
          type: string
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - payex.creditcard
    PayExConnectionSignupContact:
      type: object
      required:
        - name
        - phone_number
        - email
      description: Contact information for the person in the given role
      properties:
        name:
          type: string
          example: John Doe
          description: Name of the contact person
        phone_number:
          type: string
          description: |
            Phone number for the contact person. A phone number in E.164 number formatting.
          format: ^\+?[1-9]\d{1,14}$
          example: '+4799999999'
        email:
          type: string
          description: Contact person's e-mail
          example: customer@example.com
    PayExConnectionSignup:
      type: object
      required:
        - payment_options
      properties:
        business_name:
          type: string
          description: Name of the merchant, if it differs from legal_name
        legal_name:
          type: string
        organization_number:
          type: string
          example: 123456789MVA
        applicant_contact:
          $ref: '#/components/schemas/PayExConnectionSignupContact'
        accounting_contact:
          $ref: '#/components/schemas/PayExConnectionSignupContact'
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        website:
          type: string
          description: Company's website url
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - payex.creditcard
    PayExConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            configuration:
              $ref: '#/components/schemas/PayExConnectionConfiguration'
            signup:
              allOf:
                - $ref: '#/components/schemas/PayExConnectionSignup'
                - required:
                    - created_at
                    - url
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    url:
                      type: string
                      description: |
                        Signup URL from PayEx, where merchant can complete the signup
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when PayEx approved the signup
    PayExConnectionConfigurationV2:
      type: object
      description: |
        PayEx configuration for the merchant

        The PayEx configuration includes a `token` stored safely and never exposed
      properties:
        payee_id:
          type: string
        subsite:
          type: string
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - payex.creditcard
                  - payex.swish
                  - payex.vipps
    PayExConnectionV2:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            creditcard:
              $ref: '#/components/schemas/PayExConnection'
            configuration:
              $ref: '#/components/schemas/PayExConnectionConfigurationV2'
            signup:
              allOf:
                - $ref: '#/components/schemas/PayExConnectionSignup'
                - required:
                    - created_at
                    - url
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    url:
                      type: string
                      description: |
                        Signup URL from PayEx, where merchant can complete the signup
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when PayEx approved the signup
    SwishConnectionConfiguration:
      type: object
      description: |
        Swish configuration for the merchant

        The Collector configuration includes a `password` stored safely and never exposed
      properties:
        swish_number:
          type: string
          description: The merchant's Swish number
          example: '1231182293'
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - swish.swish
    SwishConnectionSignup:
      type: object
      required:
        - legal_name
        - organization_number
        - website
        - payment_options
      properties:
        business_name:
          type: string
          description: Name of the merchant, if it differs from legal_name
        legal_name:
          type: string
        organization_number:
          type: string
          example: 123456789MVA
        bank_name:
          type: string
          description: The name of the bank where the company's bank account is
        account_number:
          type: string
          description: The company's bank account number
        website:
          type: string
          description: Company's website url
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: SEK
              type:
                type: string
                enum:
                  - swish.swish
    SwishConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - type: object
          properties:
            configuration:
              $ref: '#/components/schemas/SwishConnectionConfiguration'
            signups:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - direct
                      - payfac
                  created_at:
                    type: string
                  callback_at:
                    type: string
                  data:
                    type: object
                    properties:
                      business_name:
                        type: string
                      legal_name:
                        type: string
                      organization_number:
                        type: string
                      bank_name:
                        type: string
                      account_number:
                        type: string
                      website:
                        type: string
                      case_id:
                        type: string
                      swish_number:
                        type: string
                      payment_options:
                        type: array
                        items:
                          type: object
                          properties:
                            currencies:
                              type: array
                              items:
                                type: string
                            type:
                              type: string
                              enum:
                                - swish.swish
            signup:
              description: Deprecated, replaced by signups
              allOf:
                - $ref: '#/components/schemas/SwishConnectionSignup'
                - required:
                    - created_at
                  properties:
                    created_at:
                      description: |
                        The time when signup was initiated
                      type: string
                      format: date-time
                    callback_at:
                      type: string
                      format: date-time
                      description: |
                        Callback when Swish approved the signup
    TwoPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - two.invoice_b2b
    TwoConnectionConfiguration:
      type: object
      description: |
        Two configuration for the merchant
      properties:
        merchant_id:
          description: The merchant ID registered in Two
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/TwoPaymentOptions'
    TwoConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/TwoPaymentOptions'
    TwoConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/TwoConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/TwoConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    VippsConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signup
          properties:
            signup:
              type: object
              required:
                - created_at
              properties:
                created_at:
                  description: |
                    The time when signup was initiated
                  type: string
                  format: date-time
                id:
                  type: string
                  description: |
                    Signup ID from Vipps
                  example: 81b83246-5c19-7b94-875b-ea6d1114f099
                url:
                  type: string
                  description: |
                    Signup URL from Vipps, where merchant can complete the signup
                callback_at:
                  type: string
                  format: date-time
                  description: |
                    Result from callback received from Vipps after merchant completed
                    the signup, and Vipps approved it.
                expires_at:
                  type: string
                  format: date-time
                  description: |
                    The Vipps signup URL expires after 30 days.
            configuration:
              description: |
                Vipps configuration for the merchant, received from signup callback
                The vipps configuration includes a `client_secret` stored safely and
                never exposed
              properties:
                payment_options:
                  type: array
                  items:
                    type: object
                    required:
                      - type
                    properties:
                      type:
                        type: string
                        enum:
                          - vipps
                merchant_name:
                  type: string
                  example: Vipps
                created_time:
                  type: string
                  example: '00:00:00'
                merchant_serial_number:
                  type: string
                  example: '123456'
                client_id:
                  type: string
                  format: uuid
                  example: 51358942-08c8-4d50-99f4-a9aa970b5f5b
                subscription_keys:
                  type: array
                  items:
                    type: object
                    properties:
                      product:
                        type: string
                        example: Access
                      ocp_apim_subscription_key:
                        type: string
                        example: de897dbb-0cd3-4445-b003-ac8214ac4638
    VippsPspPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - dintero_psp.vipps
    VippsPspConnectionConfiguration:
      type: object
      description: |
        Vipps PSP configuration for the merchant
      required:
        - merchant_serial_number
      properties:
        merchant_serial_number:
          description: Merchant serial number generated by vipps
          type: string
          pattern: ^[0-9]{6}$
          example: '123456'
        payment_options:
          $ref: '#/components/schemas/VippsPspPaymentOptions'
    VippsPspConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
        - logo
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/VippsPspPaymentOptions'
        logo:
          type: string
          description: |
            Base64 encoded string of merchant logo which will be displayed in Vipps app. 
            The logo must be in PNG format. Square images are recommended. 
            The longest side cannot be more than 1000 pixels. Minimum size is 100 x 100 pixels.
    VippsPspConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/VippsPspConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/VippsPspConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    VisaTokenizationConnectionConfiguration:
      type: object
      description: |
        Visa Tokenization configuration for the merchant
      required:
        - client_app_id
        - relationship_id
      properties:
        client_app_id:
          type: string
          description: |
            Unique identifier of merchant in VTS system
        relationship_id:
          type: string
          description: |
            Identifies relationship between merchant and us in VTS system
    VisaTokenizationConnectionSignup:
      type: object
      required:
        - case_id
      properties:
        case_id:
          description: |
            The id to the case id in auth service
          type: string
          format: uuid
    VisaTokenizationConnection:
      allOf:
        - required:
            - signups
          properties:
            configuration:
              $ref: '#/components/schemas/VisaTokenizationConnectionConfiguration'
            signups:
              type: array
              description: |
                The signups received for this account.

                Will be unique per `case_id` and `store_id`.
              items:
                allOf:
                  - $ref: '#/components/schemas/VisaTokenizationConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
        - $ref: '#/components/schemas/AccountConnectionMeta'
    SeitatechPaymentOptions:
      description: |
        Payment options to enable for this connection
      type: array
      items:
        type: object
        required:
          - currencies
          - type
        properties:
          currencies:
            type: array
            maxItems: 1
            items:
              type: string
              format: iso4217-code
              example: NOK
          type:
            type: string
            enum:
              - seitatech.in_person
    SeitatechConnectionSignup:
      type: object
      required:
        - case_id
        - payment_options
      properties:
        case_id:
          description: |
            The id to the case in auth service
          type: string
          format: uuid
        payment_options:
          $ref: '#/components/schemas/SeitatechPaymentOptions'
    SeitatechConnection:
      allOf:
        - $ref: '#/components/schemas/AccountConnection'
        - required:
            - signups
          properties:
            signups:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/SeitatechConnectionSignup'
                  - required:
                      - created_at
                    properties:
                      created_at:
                        description: |
                          The time when signup was initiated
                        type: string
                        format: date-time
    AccountService:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        updated_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        status:
          type: string
          enum:
            - enabled
            - disabled
        progression:
          type: string
          enum:
            - not_applied
            - applied
            - live
            - frozen
            - deactivated
        metadata:
          type: object
          maxProperties: 40
          description: |
            A set of key/value pairs that you can attach to a subscription
            object. It can be useful for storing additional information about
            the subscription in a structured format.
    ServiceFeatureStatus:
      type: string
      description: |
        Whether the feature is operational

        **enabled**
        > Indicates that the Feature might be used

        **pending**
        > Indicates that the Feature can't be used but that the `status`
        > eventually changes to either `declined` or `enabled` without
        > user intervention.

        **disabled**
        > Indicates that the Feature have been disabled

        **declined**
        > Indicates that the Feature can't be used and either requires some
        > action by the user or is permanently disabled
      enum:
        - declined
        - disabled
        - enabled
        - pending
    ServiceFeature:
      type: object
      required:
        - requested
        - status
      properties:
        created_by:
          type: string
          readOnly: true
        created_at:
          type: string
          format: datetime
          readOnly: true
        updated_by:
          type: string
          readOnly: true
        updated_at:
          type: string
          format: datetime
          readOnly: true
        requested:
          type: string
          enum:
            - enable
            - disable
        status:
          $ref: '#/components/schemas/ServiceFeatureStatus'
    CheckoutServiceFeatures:
      type: object
      properties:
        applepay:
          $ref: '#/components/schemas/ServiceFeature'
        billie:
          $ref: '#/components/schemas/ServiceFeature'
        clicktopay:
          $ref: '#/components/schemas/ServiceFeature'
        collector:
          $ref: '#/components/schemas/ServiceFeature'
        creditcard:
          $ref: '#/components/schemas/ServiceFeature'
        googlepay:
          $ref: '#/components/schemas/ServiceFeature'
        instabank:
          $ref: '#/components/schemas/ServiceFeature'
        klarna:
          $ref: '#/components/schemas/ServiceFeature'
        mobilepay:
          $ref: '#/components/schemas/ServiceFeature'
        santander:
          $ref: '#/components/schemas/ServiceFeature'
        swish:
          $ref: '#/components/schemas/ServiceFeature'
        vipps:
          $ref: '#/components/schemas/ServiceFeature'
        kravia:
          $ref: '#/components/schemas/ServiceFeature'
        two:
          $ref: '#/components/schemas/ServiceFeature'
        ipp:
          allOf:
            - $ref: '#/components/schemas/ServiceFeature'
            - type: object
              properties:
                sandbox_requested:
                  type: string
                  enum:
                    - enable
                    - disable
                sandbox_status:
                  $ref: '#/components/schemas/ServiceFeatureStatus'
    AccountCheckoutGateway:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        progression:
          type: string
          enum:
            - not_applied
            - waiting_for_dintero
            - waiting_for_gateway
            - waiting_for_merchant
            - rejected
            - live
            - frozen
            - deactivated
    CheckoutAccountService:
      allOf:
        - $ref: '#/components/schemas/AccountService'
        - properties:
            features:
              $ref: '#/components/schemas/CheckoutServiceFeatures'
            gateways:
              type: object
              description: |
                All gateways requires an `enabled` connection
              properties:
                santander:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                collector:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                instabank:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                vipps:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                swish:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                bambora:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                payex:
                  type: object
                  properties:
                    creditcard:
                      $ref: '#/components/schemas/AccountCheckoutGateway'
                    swish:
                      $ref: '#/components/schemas/AccountCheckoutGateway'
                klarna:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                dintero_psp:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                kravia:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                two:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
                seitatech:
                  $ref: '#/components/schemas/AccountCheckoutGateway'
    PayoutServiceFeatures:
      type: object
      description: |
        Payout features
      properties:
        split_payment:
          $ref: '#/components/schemas/ServiceFeature'
        daily_payouts:
          $ref: '#/components/schemas/ServiceFeature'
    PayoutAccountService:
      allOf:
        - $ref: '#/components/schemas/AccountService'
        - properties:
            features:
              $ref: '#/components/schemas/PayoutServiceFeatures'
    AccountReadOnly:
      type: object
      properties:
        connections:
          type: object
          readOnly: true
          description: |
            Connections to external services registered on the merchant account
          properties:
            applepay:
              $ref: '#/components/schemas/ApplePayConnection'
            bambora:
              $ref: '#/components/schemas/BamboraConnection'
            collector:
              $ref: '#/components/schemas/CollectorConnection'
            common:
              $ref: '#/components/schemas/CommonConnection'
            dintero_psp:
              $ref: '#/components/schemas/DinteroPspConnection'
            instabank:
              $ref: '#/components/schemas/InstabankConnection'
            klarna:
              $ref: '#/components/schemas/KlarnaConnection'
            kravia:
              $ref: '#/components/schemas/KraviaConnection'
            mastercard_3ds:
              $ref: '#/components/schemas/Mastercard3DSConnection'
            mastercard_tokenization:
              $ref: '#/components/schemas/MastercardTokenizationConnection'
            payex:
              $ref: '#/components/schemas/PayExConnectionV2'
            swish:
              $ref: '#/components/schemas/SwishConnection'
            two:
              $ref: '#/components/schemas/TwoConnection'
            vipps:
              $ref: '#/components/schemas/VippsConnection'
            vipps_psp:
              $ref: '#/components/schemas/VippsPspConnection'
            visa_tokenization:
              $ref: '#/components/schemas/VisaTokenizationConnection'
            seitatech:
              $ref: '#/components/schemas/SeitatechConnection'
        services:
          type: object
          readOnly: true
          description: |
            Status on services enabled on the merchant account
          properties:
            checkout:
              $ref: '#/components/schemas/CheckoutAccountService'
            customers:
              $ref: '#/components/schemas/AccountService'
            discounts:
              $ref: '#/components/schemas/AccountService'
            shopping:
              $ref: '#/components/schemas/AccountService'
            receipts:
              $ref: '#/components/schemas/AccountService'
            wallets:
              $ref: '#/components/schemas/AccountService'
            payout:
              $ref: '#/components/schemas/PayoutAccountService'
            ledger:
              $ref: '#/components/schemas/AccountService'
    PartnerConfiguration:
      type: object
      description: |
        Configuration options for the account.
      properties:
        default_price_package:
          type: string
          description: |
            Default price package to assign to new merchants.

            Use the price package ID of the price package.

            Please note that the price package must exist and be available to the
            partner account in question.
    AccountOnboarding:
      type: object
      properties:
        payment_channels:
          type: array
          items:
            type: string
            enum:
              - online
              - physical
              - payment_links
        integration_types:
          type: array
          items:
            type: string
            enum:
              - plugin
              - custom
        platforms:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              integration_type:
                type: string
                enum:
                  - plugin
              channel:
                type: string
                enum:
                  - online
                  - physical
        requested_payment_methods:
          type: array
          items:
            type: string
            enum:
              - creditcard
              - clicktopay
              - applepay
              - googlepay
              - vipps
              - mobilepay
              - swish
              - klarna
              - billie
              - walley
              - kravia
              - two
              - ipp
        currencies:
          type: array
          items:
            type: string
            format: currency
        allowed_merchant_category_codes:
          type: array
          description: Restricts the MCC codes available for selection during merchant onboarding.
          items:
            type: string
            pattern: ^\d{4}$
    ServiceFeatureRequest:
      type: object
      required:
        - requested
      properties:
        requested:
          type: string
          description: |
            Whether the Account should have the Feature
          enum:
            - enable
            - disable
    CheckoutServiceFeaturesRequest:
      type: object
      description: |
        Checkout features
      properties:
        applepay:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        billie:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        clicktopay:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        collector:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        creditcard:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        googlepay:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        instabank:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        klarna:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        mobilepay:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        santander:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        swish:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        vipps:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        two:
          $ref: '#/components/schemas/ServiceFeatureRequest'
    PayoutServiceFeaturesRequest:
      type: object
      description: |
        Payout features
      properties:
        split_payment:
          $ref: '#/components/schemas/ServiceFeatureRequest'
        daily_payouts:
          $ref: '#/components/schemas/ServiceFeatureRequest'
    ApprovalsPaymentProduct:
      type: string
      description: |
        The type of product that the merchant wants to use for their business.
         - `checkout` the merchant accepts payouts to a single bank account
           (per currency).
         - `split_payment` needed for partners, marketplaces and platforms that
           will onboard sellers that will receive payouts to the sellers' own bank
           accounts.
      enum:
        - checkout
        - split_payment
    BankAccountCountryCode:
      type: string
      description: |
        Which country the bank account is registered in.
        Must be a two letter ISO 3166-1-alpha-2 country code.

        Supported bank account country codes:
          * `AT` (Austria)
          * `BE` (Belgium)
          * `HR` (Croatia)
          * `CY` (Cyprus)
          * `DK` (Denmark)
          * `EE` (Estonia)
          * `FI` (Finland)
          * `FR` (France)
          * `DE` (Germany)
          * `GR` (Greece)
          * `IE` (Ireland)
          * `IS` (Iceland)
          * `IT` (Italy)
          * `LV` (Latvia)
          * `LT` (Lithuania)
          * `LU` (Luxembourg)
          * `MT` (Malta)
          * `NL` (Netherlands)
          * `NO` (Norway)
          * `PT` (Portugal)
          * `SK` (Slovakia)
          * `SI` (Slovenia)
          * `ES` (Spain)
          * `SE` (Sweden)
          * `UK` (United Kingdoms)
          * `US` (United States of America)
      maxLength: 2
      minLength: 2
      pattern: ^[A-Z]{2}$
      example: 'NO'
    ApprovalsBankAccount:
      type: object
      required:
        - bank_account_currency
        - payout_currency
      properties:
        bank_name:
          type: string
          description: Name of the Bank used
        bank_account_number:
          type: string
          description: BBAN, national bank account number
        bank_account_number_type:
          type: string
          enum:
            - IBAN
            - BBAN
          description: |
            The type of bank account number. Will default to BBAN in bank_country_code
            is norwegian. Will default to IBAN in all other countries.
        bank_account_country_code:
          $ref: '#/components/schemas/BankAccountCountryCode'
        bank_account_currency:
          type: string
          format: iso4217-code
          example: NOK
          description: |
            The three-character ISO-4217 currency.
            https://en.wikipedia.org/wiki/ISO_4217
        payout_currency:
          type: string
          format: iso4217-code
          example: NOK
          description: |
            The three-character ISO-4217 currency.
            https://en.wikipedia.org/wiki/ISO_4217
        bank_identification_code:
          type: string
          example: DNBANOKKXXX
          description: |
            A BIC code, or Bank Identifier Code also know as SWIFT code, consistin of
            8 to 11 alphanumeric characters.
    ApprovalsPayment:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - country_code
            - organization_number
            - bank_accounts
            - payment_methods
            - products
          properties:
            products:
              type: array
              items:
                type: object
                required:
                  - product
                properties:
                  product:
                    $ref: '#/components/schemas/ApprovalsPaymentProduct'
            payment_methods:
              description: |
                Payment methods that the merchant wants to accept.
              type: array
              items:
                type: object
                required:
                  - payment_method
                properties:
                  payment_method:
                    type: string
                    enum:
                      - creditcard
                      - applepay
                      - clicktopay
                      - vipps
                      - swish
                      - mobilepay
                      - klarna
                      - walley
                      - santander
                      - netaxept
                      - instabank
                      - googlepay
                      - billie
                      - kravia
                      - two
                      - ipp
            country_code:
              type: string
              format: iso-3166-1
              description: |
                Country code, must be a two letter ISO 3166-1-alpha-2 country code
              maxLength: 2
              minLength: 2
            organization_number:
              type: string
              description: |
                National organization number valid in the country specified.
            bank_accounts:
              type: array
              minItems: 1
              maxItems: 1
              description: |
                Bank account information about the seller. Currently
                the contract service only supports one bank_account per payout
                destination.
              items:
                $ref: '#/components/schemas/ApprovalsBankAccount'
            form_submitter:
              type: object
              description: |
                The user that will submit the form. If the email is set the user will be notified
                about the form via email.

                See [Seller onboarding - Reminder emails](https://docs.dintero.com/docs/checkout/split-payment/add-payout-destinations#reminder-emails)
                for the reminder schedule.
              properties:
                email:
                  type: string
                  format: email
                  description: |
                    The email of the user that will submit the form.
                name:
                  type: string
                  description: |
                    The name of the user that will submit the form.
                title:
                  type: string
                  description: |
                    The title of the user that will submit the form.
    ApprovalLinks:
      type: array
      items:
        type: object
        properties:
          href:
            type: string
            description: The URL of the link.
            format: uri
          rel:
            type: string
            description: |
              Specifies the type of link
            enum:
              - contract_url
              - cdd_case_url
              - dintero_cdd_case_url
              - declaration_url
              - signed_contract_file_url
    ApprovalsPaymentResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/ApprovalsPayment'
        - properties:
            case_status:
              $ref: '#/components/schemas/ApprovalStatus'
            links:
              $ref: '#/components/schemas/ApprovalLinks'
            mcc:
              type: string
              format: iso-18245
              example: 5814
              description: |
                A four-digit Merchant Category Code (MCC) for the store
                [ISO 18245:2003](https://www.iso.org/standard/33365.html)

                The MCC set on the case
    LegalEntityType:
      type: string
      description: |
        - For a company seller select `company` or leave blank. Required fields are
          `organization_number` and `country_code`.
        - For an individual seller select `individual`. Provide optional fields in
          the individual object.
      enum:
        - company
        - individual
    Individual:
      type: object
      description: |
        Used only if `type` is `individual`.
      additionalProperties: false
      properties:
        name:
          type: string
        birth_date:
          type: string
          format: date
        phone_number:
          type: string
        email:
          type: string
          format: email
        address_line:
          type: string
          example: Sommerkroveien 34
        address_line_2:
          type: string
          example: PB 123
        address_postal_code:
          type: string
          example: '0349'
        address_city:
          type: string
          example: Oslo
        address_country:
          type: string
          format: iso-3166-1
          description: |
            ISO 3166-1 country code
          example: 'NO'
    ApprovalsPayoutDestination:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - payout_destination_id
            - payout_reference
            - bank_accounts
          properties:
            language:
              type: string
              maxLength: 2
              enum:
                - en
                - 'no'
              description: The language that will be used in emails, declaration form, signing page etc.
            payout_destination_id:
              type: string
              maxLength: 40
              description: |
                ID of seller to create when the contract has been completed,
                signed, and approved.
            payout_destination_name:
              type: string
              maxLength: 60
              description: The name of the seller
            payout_destination_description:
              type: string
              maxLength: 1000
              description: Description of the seller
            payout_reference:
              type: string
              maxLength: 60
              description: |
                A static reference that will be included on bank payments, the
                name of the service the payout-destination will be enrolled into.
                Eg. if yor platform is an "Uber for lawnmowers" called "Mowber"
                the payout_reference should be "Mowber".
            type:
              $ref: '#/components/schemas/LegalEntityType'
            country_code:
              type: string
              format: iso-3166-1
              description: |
                Country code, must be a two letter ISO 3166-1-alpha-2 country code.
                Required if type is omitted or set to `company`.
              maxLength: 2
              minLength: 2
            organization_number:
              type: string
              description: |
                National organization number valid in the country specified. Required
                if type is omitted or set to `company`.
            individual:
              $ref: '#/components/schemas/Individual'
            bank_accounts:
              type: array
              minItems: 1
              maxItems: 1
              description: |
                Bank account information about the seller. Currently
                the contract service only supports one bank_account per payout
                destination.
              items:
                $ref: '#/components/schemas/ApprovalsBankAccount'
            payout_interval_type:
              type: string
              description: |
                The interval of the payout. The interval can be `daily`, `weekly`, `monthly` or `manual`.
              enum:
                - daily
                - weekly
                - monthly
                - manual
            form_submitter:
              type: object
              description: |
                The user that will submit the form. If the email is set the user will be notified
                about the form via email.

                See [Seller onboarding - Reminder emails](https://docs.dintero.com/docs/checkout/split-payment/add-payout-destinations#reminder-emails)
                for the reminder schedule.
              properties:
                email:
                  type: string
                  format: email
                  description: |
                    The email of the user that will submit the form.
                name:
                  type: string
                  description: |
                    The name of the user that will submit the form.
                title:
                  type: string
                  description: |
                    The title of the user that will submit the form.
            settlement_report_configuration:
              type: object
              required:
                - emails
              properties:
                emails:
                  type: array
                  description: Emails that will receive settlement reports by email for this payout destination
                  minItems: 1
                  items:
                    type: string
                    format: email
            report_configuration:
              type: object
              description: Optional settings for automatically creating report configurations when the payout destination is created.
              required:
                - create_report_configuration
              properties:
                create_report_configuration:
                  type: boolean
                  description: |
                    If enabled a report configuration for this sellers transactions is added when the payout destination is created.
                email:
                  type: string
                  format: email
                  description: |
                    Optional email used in report configuration.
                schedule:
                  type: string
                  description: |
                    Optional report configuration schedule, will match the payout interval if not otherwise specified.
                  enum:
                    - daily
                    - weekly
                    - monthly
                reference:
                  type: string
                  description: |
                    Optional reference, will use `payout_destination_id` if not specified.
                content_types:
                  type: array
                  description: Optional content types for the report, default is both `application/pdf` and `text/csv`.
                  items:
                    type: string
                    enum:
                      - application/pdf
                      - text/csv
    ApprovalsPayoutDestinationResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/ApprovalsPayoutDestination'
        - properties:
            case_status:
              $ref: '#/components/schemas/ApprovalStatus'
            links:
              $ref: '#/components/schemas/ApprovalLinks'
    CustomerDueDiligenceCase:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - case_for
            - products
            - case_request
          properties:
            package:
              type: string
              description: |
                What pricing strategy to use for this company.
            case_for:
              type: object
              required:
                - account_id
              properties:
                account_id:
                  type: string
                payout_destination_id:
                  type: string
                  maxLength: 40
                  description: |
                    If set the case will apply to the seller id for the given
                    account.
                payout_destination_name:
                  type: string
                  maxLength: 60
                  description: The name of the seller
                payout_destination_description:
                  type: string
                  maxLength: 1000
                  description: Description of the seller
                payout_reference:
                  type: string
                  maxLength: 60
                  description: |
                    A static reference that will be included on bank payments made via the payout_destination_id
            actions_on_approval:
              type: array
              items:
                type: string
                minItems: 1
                enum:
                  - enable_payout_account
                  - enable_checkout_account
                  - create_payout_destination
            products:
              type: array
              items:
                type: string
                minItems: 1
                enum:
                  - payout
                  - checkout
            payment_options:
              $ref: '#/components/schemas/PaymentOptions'
            case_request:
              type: object
              description: |
                Case object that will be submitted to the CDD service. See docs at https://docs.quickr.no/
              required:
                - checks
                - countryCode
                - organizationNumber
                - requireContractSigning
              properties:
                checks:
                  type: array
                  items:
                    type: string
                    minItems: 1
                    enum:
                      - KYC
                      - AML
                      - RISK
                      - INDUSTRY
                      - BANK_OWNERSHIP
                countryCode:
                  type: string
                  description: |
                    Country code, must be a two letter ISO 3166-1-alpha-2 country code
                  maxLength: 2
                  minLength: 2
                organizationNumber:
                  type: string
                  description: |
                    National organization number valid in the country specified.
                requireContractSigning:
                  type: boolean
                details:
                  type: object
                  description: |
                    Refer to docs at https://docs.quickr.no/. These properties are populated in the contract and by checks performed
                callbackUrl:
                  type: string
                  description: Autogenerated. Quickr POSTS to this url when the case is updated
                referenceId:
                  type: string
    CustomerDueDiligenceCaseResponse:
      type: object
      allOf:
        - $ref: '#/components/schemas/CustomerDueDiligenceCase'
        - required:
            - events
            - account_id
          properties:
            account_id:
              readOnly: true
              type: string
            events:
              readOnly: true
              type: array
              items:
                description: Updates to case
                type: object
                required:
                  - id
                  - event
                  - created_at
                  - request_id
                properties:
                  id:
                    type: number
                    description: Starts at 1, increment by 1 for each event
                  request_id:
                    type: string
                  case_status:
                    $ref: '#/components/schemas/ApprovalStatus'
                  event:
                    type: string
                    enum:
                      - case_created
                      - case_updated
                      - enable_payout_account
                      - enable_checkout_account
                      - create_payout_destination
                  created_at:
                    type: string
                    format: date-time
                    description: |
                      The date-time when the event was created
                    readOnly: true
                  error:
                    type: string
                    description: |
                      Error message if the event contains an error
                    readOnly: true
                  case:
                    type: object
                    description: |
                      Case object as received from the CDD service
                  created:
                    type: object
                    description: |
                      Response when the case was created
                    required:
                      - case_id
                      - contract_url
                    properties:
                      case_id:
                        type: string
                      contract_url:
                        type: string
    BamboraConnectionCallback:
      type: object
      required:
        - merchant_number
        - md5_key
        - payment_options
      properties:
        merchant_number:
          type: string
          example: P12345678
        md5_key:
          type: string
          example: ae45ase
        access_token:
          type: string
        secret_token:
          type: string
        token_scope:
          type: string
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - bambora.creditcard
                  - bambora.vipps
    CollectorConnectionCallback:
      type: object
      required:
        - username
        - payment_options
      properties:
        username:
          type: string
          example: c_user
        password:
          type: string
          example: my_collector_bank_password
          description: |
            The password for the given username. Password is optional _if_ using dintero:admin and one of the standard usernames
        store_id:
          type: number
          description: |
            **Deprecated** in favour of `stores.store_id`.

            Store id for B2C
        country:
          type: string
          format: iso-3166-1
          description: |
            **Deprecated** in favour of `stores.country`.
        stores:
          description: Configured stores in the Collector Partner Portal
          type: array
          items:
            type: object
            properties:
              store_id:
                type: number
              country:
                type: string
                format: iso-3166-1
              currency:
                type: string
                example: NOK
                description: |
                  The three-character ISO-4217 currency.
                  https://en.wikipedia.org/wiki/ISO_4217
              segment:
                type: string
                description: The type of customers this store id is used for
                enum:
                  - B2C
                  - B2B
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - collector.invoice
                  - collector.installment
                  - collector.invoice_b2b
    InstabankConnectionCallback:
      type: object
      description: Instabank Callback
      required:
        - organization_number
      properties:
        organization_number:
          type: string
    PayExConnectionCallback:
      type: object
      required:
        - payee_id
        - payment_options
      properties:
        token:
          type: string
          example: eb4835ac0b0835ad8f886c0b077a49bc28f200ac03ba543ebea8bba8a62e143d
        payee_id:
          type: string
          example: 803-518c-4fa0-9b0f-177e871f21dd
        subsite:
          description: |
            Perform split settlements on payments. The subsite must be resolved with
            PayEx reconciliation before being used.
          type: string
          example: '1234678'
          maxLength: 40
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - payex.creditcard
    SwishConnectionCallback:
      type: object
      required:
        - swish_number
      properties:
        swish_number:
          type: string
          description: The merchant's Swish number
          example: '1231182293'
        cert:
          type: string
          description: |
            Base 64 encoded string of the certificate. Can be in PEM or P12 format.
            If PEM, key and ca are required.
        key:
          type: string
          description: Base 64 encoded string of the public key
        passphrase:
          description: The passphrase for the certificate
          type: string
        ca:
          description: Base 64 encoded string of the CA of the certificate
          type: string
        payment_options:
          description: |
            Payment options to enable for this connection
          type: array
          items:
            type: object
            required:
              - currencies
              - type
            properties:
              currencies:
                type: array
                items:
                  type: string
                  format: iso4217-code
                  example: NOK
              type:
                type: string
                enum:
                  - swish.swish
    VippsConnectionCallback:
      type: object
      properties:
        signup-id:
          type: string
          example: 81b83246-5c19-7b94-875b-ea6d1114f099
        orgnumber:
          type: string
          example: '692493206'
        merchant-name:
          type: string
          example: Vipps
        createdTime:
          type: string
          example: '00:00:00'
        merchantSerialNumber:
          type: string
          example: '123456'
        client_Id:
          type: string
          example: 51358942-08c8-4d50-99f4-a9aa970b5f5b
        client_Secret:
          type: string
          example: verysecret123
        subscriptionKeys:
          type: array
          items:
            type: object
            properties:
              product:
                type: string
                example: Access
              ocp-apim-subscription-key:
                type: string
                example: de897dbb-0cd3-4445-b003-ac8214ac4638
    Grant:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - client_id
            - audience
            - scope
          properties:
            client_id:
              type: string
            audience:
              type: string
              example: https://api.dintero.com/v1/accounts/P00000000
            scope:
              type: array
              items:
                type: string
                minItems: 1
                example: receipts:write
            type:
              description: |
                Limit the usage of the grant. A grant with grant_types set
                to only `authorization_code` cannot be used in
                [Get Token](/api-reference/authenticate/aid_auths_oauth_token_post) when
                calling the endpoint with `grant_type=client_credentials`
              default: any
              type: string
              enum:
                - any
                - authorization_code
                - client_credentials
                - password
            oidc:
              description: |
                Open ID connect configuration for the Grant. The option enables client
                to verify the identify of the End-User based on the authentication
                performed by an authorization server

                The grant type must be set to `authorization_code` when configured.
              required:
                - authority
                - client_id
                - client_secret
              properties:
                client_id:
                  type: string
                client_secret:
                  type: string
                authority:
                  type: string
                  description: |
                    The authority for the authentication, the authority must support
                    OpenID connect discovery

                    example: https://identityserver.example.com/access/.well-known/openid-configuration
                  format: url
                  example: https://identityserver.example.com/access
    UpdateGrantRequest:
      type: object
      allOf:
        - required:
            - scope
          properties:
            scope:
              type: array
              items:
                type: string
                minItems: 1
                example: receipts:write
    Client:
      type: object
      allOf:
        - $ref: '#/components/schemas/Entity'
        - properties:
            name:
              type: string
            description:
              type: string
            client_id:
              type: string
              description: Your client ID.
            callbacks:
              type: array
              items:
                type: string
    ClientPatch:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
    PasswordLess:
      type: object
      required:
        - client_id
        - connection
        - audience
      properties:
        audience:
          type: string
          description: |
            The unique identifier of the target API you want to access.
        client_id:
          type: string
        connection:
          type: string
          description: |
            How to send the code to the user.
          enum:
            - email
            - sms
        email:
          type: string
          description: |
            The user's email address
        type:
          type: string
          description: |
            Passwordless for type company/customer requires that
            the email is registered to a customers users
          enum:
            - company
            - customer
          default: customer
        send:
          type: string
          description: |
            Use `code` to send a verification code.
          default: code
          enum:
            - code
        login_session_id:
          type: string
          description: |
            Use `login_session_id` to resend the same verifcation code to
            an alternative connection.
    RevokeToken:
      type: object
      required:
        - token
      properties:
        token:
          type: string
          example: YOUR_REFRESH_TOKEN
    AuthRole:
      type: object
      description: |
        Role that can be assigned to users
      required:
        - scope
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was last updated
          readOnly: true
        deleted_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client created the resource
          readOnly: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
        name:
          type: string
          example: order support
        description:
          type: string
          example: Administrate orders
        scope:
          type: array
          items:
            type: string
            minItems: 1
          example:
            - read:accounts
            - read:billing
            - admin:shopping
    AuthToken:
      discriminator:
        propertyName: grant_type
        mapping:
          account_user: '#/components/schemas/account_user'
          authorization_code: '#/components/schemas/authorization_code'
          client_credentials: '#/components/schemas/client_credentials'
          mfa_oob: '#/components/schemas/mfa_oob'
          password: '#/components/schemas/password'
          refresh_token: '#/components/schemas/refresh_token'
      oneOf:
        - $ref: '#/components/schemas/account_user'
        - $ref: '#/components/schemas/authorization_code'
        - $ref: '#/components/schemas/client_credentials'
        - $ref: '#/components/schemas/mfa_oob'
        - $ref: '#/components/schemas/password'
        - $ref: '#/components/schemas/refresh_token'
    ReportedVolume:
      type: object
      required:
        - type
        - period
        - currency
        - volume
        - count
      properties:
        type:
          type: string
          enum:
            - monthly
            - weekly
        period:
          type: string
          description: |
            Format depend on type, e.g. `2023-09` for monthly and `2023-W40`
            for weekly
          format: iso-8601
        currency:
          type: string
          format: iso-4217
        volume:
          type: integer
        count:
          type: integer
    AccountPrivateDetails:
      type: object
      description: |
        Account properties that are private and managed by the
        root partner.
      properties:
        progression:
          type: string
          enum:
            - applied
            - live
            - frozen
            - deactivated
          description: |
            Status assigned to the account by the account partner
            > value is not visible for the merchant.
        reseller_id:
          type: string
          description: |
            Reseller id assigned by the account partner
            > value is not visible for the merchant
          example: DINTERO_ACCOUNT:99900000
        account_manager:
          type: object
          required:
            - email
          description: |
            Account manager responsible for the account.
            > value is not visible for the merchant
          properties:
            email:
              type: string
              example: employee@dintero.com
        permissions:
          description: List the permission granted the account
          type: array
          items:
            type: object
            required:
              - effect
              - action
            properties:
              effect:
                type: string
                enum:
                  - allow
                  - deny
              action:
                type: array
                minItems: 1
                maxItems: 1
                items:
                  type: string
                  enum:
                    - checkout:auto_capture
                    - notifications:publish
        sale_channel:
          type: string
          enum:
            - DIRECT
            - INBOUND
            - PARTNER
            - REFERRAL
        price_package:
          type: string
        statistics:
          type: object
          description: Statistics for the account
          properties:
            checkout_captures:
              description: Statistics about transactions captured
              type: array
              readOnly: true
              items:
                $ref: '#/components/schemas/ReportedVolume'
              example:
                - type: monthly
                  periode: 2023-09
                  currency: NOK
                  volume: 3921930
                  count: 131
                - type: weekly
                  periode: 2023-W33
                  currency: NOK
                  volume: 980482
                  count: 32
            metrics:
              description: key metrics about the account
              properties:
                checkout:transaction:first_capture_at:
                  type: string
                  format: datetime
                checkout:transaction:last_capture_at:
                  type: string
                  format: datetime
        services:
          type: object
          properties:
            checkout:
              type: object
              required:
                - features
              properties:
                features:
                  $ref: '#/components/schemas/CheckoutServiceFeatures'
            payout:
              required:
                - features
              properties:
                features:
                  $ref: '#/components/schemas/PayoutAccountService'
    AccountApprovals:
      type: object
      properties:
        approvals_payments_statuses:
          type: object
          description: Count of statuses of payments approvals
          properties:
            ACTIVE:
              type: number
            DECLINED:
              type: number
            UNDER_MANUAL_REVIEW:
              type: number
            AUTOMATIC_REVIEW:
              type: number
            WAITING_FOR_SIGNATURE:
              type: number
            WAITING_FOR_DECLARATION:
              type: number
            WAITING_FOR_DETAILS:
              type: number
            ERROR:
              type: number
            ARCHIVED:
              type: number
            TERMINATED:
              type: number
        approvals_payout_destinations_statuses:
          type: object
          description: Count of statuses of payout destinations approvals (aka seller approvals)
          properties:
            ACTIVE:
              type: number
            DECLINED:
              type: number
            UNDER_MANUAL_REVIEW:
              type: number
            AUTOMATIC_REVIEW:
              type: number
            WAITING_FOR_SIGNATURE:
              type: number
            WAITING_FOR_DECLARATION:
              type: number
            WAITING_FOR_DETAILS:
              type: number
            ERROR:
              type: number
            ARCHIVED:
              type: number
            TERMINATED:
              type: number
    ExtendedAccount:
      allOf:
        - $ref: '#/components/schemas/Account'
        - $ref: '#/components/schemas/AccountPrivateDetails'
        - $ref: '#/components/schemas/AccountReadOnly'
        - $ref: '#/components/schemas/AccountApprovals'
        - type: object
          properties:
            configuration:
              $ref: '#/components/schemas/PartnerConfiguration'
    PricePackageMeta:
      type: object
      required:
        - name
        - description
      properties:
        name:
          type: string
        description:
          type: string
        pricing_conditions:
          type: string
        source_price_package_id:
          description: |
            The ID of the price package that this price package is based on.
          type: string
        metadata:
          type: object
          maxProperties: 40
          description: |
            A set of key/value pairs that you can attach to price package.
    PricePackagePrice:
      type: object
      additionalProperties: false
      required:
        - type
        - amounts
        - dimensions
      properties:
        type:
          type: string
          enum:
            - blend
            - ic++
        amounts:
          description: |
            All the fees for the product
          type: array
          minItems: 1
          items:
            type: object
            required:
              - unit_amount
              - flat_amount
            properties:
              name:
                type: string
                enum:
                  - default
                  - eu
                  - non_eu
                  - invoice
                  - invoice_b2b
                  - invoice_b2b_grouped
                  - invoice_b2c
                  - installment
                  - monthly_fee
                  - tx_fee
                description: |
                  Identifies the price variation within a product:

                  | Name | Description | Applicable `product_id` |
                  |---|---|---|
                  | `default` (or omitted) | Single price for all variations of a payment method | Any non-creditcard product |
                  | `eu` | Price for EU-issued cards | `checkout.*.visa`, `checkout.*.mastercard` |
                  | `non_eu` | Price for non-EU-issued or non-consumer cards | `checkout.*.visa`, `checkout.*.mastercard` |
                  | `installment` | Walley installment payments | `checkout.capture.walley` |
                  | `invoice` | Walley B2C invoice payments | `checkout.capture.walley` |
                  | `invoice_b2b` | B2B invoice payments | `checkout.capture.walley`, `checkout.capture.kravia`, `checkout.capture.two` |
                  | `invoice_b2b_grouped` | Grouped B2B invoice payments | `checkout.capture.kravia` |
                  | `invoice_b2c` | Kravia B2C invoice payments | `checkout.capture.kravia` |
                  | `monthly_fee` | Dintero monthly fee, separate from per-transaction prices | `checkout.dintero` |
                  | `tx_fee` | Dintero per-transaction fee, added on top of all other payment method prices | `checkout.dintero` |
              description:
                type: string
              flat_amount:
                type: integer
                example: 250
              unit_amount:
                type: string
                description: |
                  The unit depends on the context/product. The unit of checkout
                  payment is the transaction amount
                format: number
                example: '0.025'
        dimensions:
          type: array
          description: |
            The dimensions is used to decide what price alternative is applicable,
            one one price alternative will be used for a "cost" event
          example:
            - name: currency
              values:
                - NOK
                - SEK
            - name: card.issuer_country
              values:
                - 'NO'
                - SE
            - name: payment_product_type_category
              values:
                - invoice
                - b2b_invoice
          items:
            type: object
            additionalProperties: false
            required:
              - name
              - values
            properties:
              name:
                type: string
                enum:
                  - currency
                  - card.issuer_country
                  - payment_product_type_category
                description: |
                  | Name | Description |
                  |---|---|
                  | `currency` | ISO 4217 currency code |
                  | `card.issuer_country` | ISO 3166-1 alpha-2 country code of the card issuer |
                  | `payment_product_type_category` | Klarna only. Possible values: `card`, `invoice`, `fixed_amount`, `base_account`, `direct_debit`, `direct_bank_transfer`, `b2b_invoice`, `slice_it_by_card`, `pay_later_by_card`, `pay_by_card`, `fixed_sum_credit` |
              values:
                type: array
                items:
                  type: string
    PricePackageProduct:
      type: object
      required:
        - namespace
        - product_id
        - prices
      properties:
        namespace:
          type: string
          enum:
            - checkout
            - payout
            - orders
        product_id:
          type: string
          description: |
            **Examples**
              - checkout.capture.apple_pay
              - checkout.capture.card
              - checkout.capture.google_pay
              - checkout.capture.instabank
              - checkout.capture.klarna
              - checkout.capture.mobilepay
              - checkout.capture.vipps
              - checkout.capture.walley
              - checkout.monthly.service_fee
          example: checkout.capture.card
        prices:
          type: array
          items:
            $ref: '#/components/schemas/PricePackagePrice'
    PricePackageProducts:
      type: object
      required:
        - products
      properties:
        products:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/PricePackageProduct'
    PricePackageCustomCreateData:
      type: object
      allOf:
        - $ref: '#/components/schemas/PricePackageMeta'
        - $ref: '#/components/schemas/PricePackageProducts'
    AccountEvent:
      discriminator:
        propertyName: event_type
        mapping:
          comment: '#/components/schemas/AccountEventComment'
          statistics: '#/components/schemas/AccountEventStatistics'
      description: |
        Events registered on the account
      oneOf:
        - $ref: '#/components/schemas/AccountEventComment'
        - $ref: '#/components/schemas/AccountEventStatistics'
    MatchRequestAddress:
      type: object
      properties:
        address_line:
          type: string
          description: First line of the address, usually includes street name and number
          minLength: 1
          maxLength: 60
        address_line_2:
          type: string
          description: Second line of the address, usually includes apartment number or suite number
          maxLength: 60
        city:
          type: string
          description: The name of the city for a merchant location
          minLength: 1
          maxLength: 40
        postal_code:
          type: string
          description: The postal code for a merchant location
          minLength: 1
          maxLength: 10
        country:
          type: string
          description: |
            The country in which the address resides. \
            Valid values are three digit alpha country codes as defined in ISO 3166-1 (See https://en.wikipedia.org/wiki/ISO_3166-1)
          minLength: 1
          maxLength: 3
      required:
        - address_line
        - city
        - postal_code
        - country
    MatchRequestPrincipal:
      type: array
      description: List of ultimate beneficial owners
      minItems: 1
      maxItems: 5
      items:
        type: object
        required:
          - first_name
          - last_name
          - email
          - phone_number
          - address
        properties:
          first_name:
            type: string
            description: The first name of the principal owner of the business
            minLength: 1
            maxLength: 40
          last_name:
            type: string
            description: The last name of the principal owner of the business
            minLength: 1
            maxLength: 40
          email:
            type: string
            description: Email Id of a principal.
            example: abc@xxx.com
            minLength: 1
            maxLength: 100
            pattern: ^[a-zA-Z0-9!#$&*+/\?`@{|}~^.\-]+(\.com|\.net|\.org|\.edu)?$
          phone_number:
            type: string
            description: |
              The merchant’s business phone number, including area code.
              - For U.S. numbers - Must be exactly 10 digits and cannot start with 0 or 1.
              - For non-U.S. numbers - Can be up to 25 digits. Do not include the country code.
              - Formatting - Digits only. Do not use symbols or formatting characters (e.g., parentheses, spaces, or dashes).
            example: '3165557625'
            minLength: 1
            maxLength: 25
            pattern: ^[0-9]+$
          date_of_birth:
            type: string
            description: |
              The date of birth of the principal owner.
              Format: YYYY-MM-DD
            example: ‘1980-01-01’
            format: date
          address:
            type: object
            required:
              - address_line
              - city
              - country
            properties:
              address_line:
                type: string
                description: First line of the address, usually includes street name and number
                minLength: 1
                maxLength: 60
              address_line_2:
                type: string
                description: Second line of the address, usually includes apartment number or suite number
                maxLength: 60
              city:
                type: string
                description: The name of the city for a merchant location
                minLength: 1
                maxLength: 40
              postal_code:
                type: string
                description: The postal code for a merchant location
                minLength: 1
                maxLength: 10
              country:
                type: string
                description: |
                  The country in which the address resides. \
                  Valid values are three digit alpha country codes as defined in ISO 3166-1 (See https://en.wikipedia.org/wiki/ISO_3166-1)
                minLength: 1
                maxLength: 3
    MatchRequestMerchant:
      type: object
      properties:
        business_name:
          type: string
          description: The name of the business assigned by the principal owner(s)
          minLength: 1
          maxLength: 60
        trade_name:
          type: string
          description: The name used by a merchant that could be different from the legal name of the business
          maxLength: 110
        website_url:
          type: string
          description: URL to website of business
          maxLength: 4000
        address:
          $ref: '#/components/schemas/MatchRequestAddress'
        principals:
          $ref: '#/components/schemas/MatchRequestPrincipal'
        phone_number:
          type: string
          description: The Business or Merchant's phone number. Should not contain country code and should be digits only
          maxLength: 25
        merchant_category:
          type: string
          minLength: 1
          maxLength: 4
          description: |
            A classification code used in authorization, clearing,
            and other transactions or reports to identify the type of merchant.
          example: '1234'
      required:
        - business_name
        - principals
        - address
        - phone_number
        - merchant_category
    MatchRequestSearchCriteria:
      required:
        - search_all
      type: object
      properties:
        search_all:
          type: string
          description: |
            Determines if the inquiry is worldwide or not.
            The inquiry request can be either worldwide or regions and/or countries based.
            It cannot be both. If it is not worldwide search (search_all = N) and if 
            both region and country are not specified, then search will happen for USA.
            Valid values are Y or N
        region:
          type: array
          description: |
            Region in which the inquiry results must be obtained.

            (1) - U.S. REGION;
            (A) - CANADA;
            (B) - CARIB,C AMERICA,MEX,S AMERICA;
            (C) - ASIA/PACIFIC;
            (D) - EUROPE;
            (E) - SOUTH ASIA MIDDLE EAST AFRICA;

            A maximum of 6 regions may be submitted.
          items:
            type: string
          example:
            - '1'
            - A
            - D
        country:
          type: array
          description: |
            The three digit country code of the principal owner.
            Valid values are three digit alpha country codes as defined in ISO 3166-1 (See https://en.wikipedia.org/wiki/ISO_3166-1)
          items:
            type: string
          example:
            - NOR
            - USA
            - CAN
    MatchTerminationRequest:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/MatchRequestMerchant'
        search_criteria:
          $ref: '#/components/schemas/MatchRequestSearchCriteria'
      required:
        - merchant
        - search_criteria
    MatchAddress:
      type: object
      properties:
        address_line_one:
          type: string
          description: First line of the address, usually includes street name and number
          minLength: 1
          maxLength: 60
        address_line_two:
          type: string
          description: Second line of the address, usually includes apartment number or suite number
          maxLength: 60
        city:
          type: string
          description: The name of the city for a merchant location.
          minLength: 1
          maxLength: 40
        country_subdivision:
          type: string
          description: The abbreviated state or province code for a merchant location (only supported for US and Canada merchants).
          maxLength: 2
        province:
          type: string
          description: The name of the province for the location.
          maxLength: 3
        postal_code:
          type: string
          description: The postal code for a merchant location
          minLength: 1
          maxLength: 10
        country:
          type: string
          description: The country in which the address resides. Valid values are three digit alpha country codes as defined in ISO 3166-1 (See https://en.wikipedia.org/wiki/ISO_3166-1)
          minLength: 1
          maxLength: 3
    MatchDriversLicense:
      type: object
      properties:
        number:
          type: string
          description: The drivers license number of a principal owner. Required when Drivers License Country is provided. Should not be provided if Drivers License Country is not provided.
          maxLength: 25
        country_subdivision:
          type: string
          description: The abbreviated state or province code for a merchant location (only supported for US and Canada merchants). Required when Drivers License Country is 'USA'. Should not be provided for non-US Drivers License Country.
          maxLength: 2
        country:
          type: string
          description: The three digit country code of the principal owner. Valid values are three digit alpha country codes as defined in ISO 3166-1. Required when Drivers License Number is provided. Should not be provided if Drivers License Number is not provided.
          maxLength: 3
    MatchPrincipal:
      type: array
      items:
        type: object
        properties:
          first_name:
            type: string
            description: The first name of the principal owner of the business.
            minLength: 1
            maxLength: 40
          middle_initial:
            type: string
            description: The middle initial of the name of the principal owner of the business.
          last_name:
            type: string
            description: The last name of the principal owner of the business.
            minLength: 1
            maxLength: 40
          address:
            $ref: '#/components/schemas/MatchAddress'
          phone_number:
            type: string
            description: The Business or Merchant's phone number. Should not contain country code and should be digits only
            maxLength: 25
          email:
            type: string
            description: Email Id of a principal owner of the business.
          alt_phone_number:
            type: string
            description: The Business or Merchant's alternate phone number
            maxLength: 25
          national_id:
            type: string
            description: The Social Security number of a principal owner. If the principal owner is not from the U.S. Region, then use their national ID card number.
            maxLength: 35
          drivers_license:
            $ref: '#/components/schemas/MatchDriversLicense'
    MatchTerminationReason:
      type: string
      example: '13'
      enum:
        - '01'
        - '02'
        - '03'
        - '04'
        - '05'
        - '07'
        - '08'
        - '09'
        - '10'
        - '11'
        - '12'
        - '13'
        - '14'
      description: |
        A two digit numeric code indication why a particular merchant was terminated.

        * 01 - Account Data Compromise
        * 02 - Common Points of Purchase
        * 03 - Laundering
        * 04 - Excessive Chargebacks
        * 05 - Excessive Fraud
        * 06 - Reserved for Future Use
        * 07 - Fraud Conviction
        * 08 - MasterCard Questionable Merchant Audit Program
        * 09 - Bankruptcy/Liquidation/Insolvency
        * 10 - Violation of MasterCard Standards
        * 11 - Merchant collusion
        * 12 - PCI Data Security Standard, Noncompliance
        * 13 - Illegal Transactions
        * 14 - Identity Theft
    MatchUrl:
      type: object
      properties:
        urls:
          type: array
          items:
            type: string
            maxLength: 4000
    MatchUrlGroup:
      type: object
      properties:
        exact_match_urls:
          $ref: '#/components/schemas/MatchUrl'
        close_match_urls:
          $ref: '#/components/schemas/MatchUrl'
        no_match_urls:
          $ref: '#/components/schemas/MatchUrl'
    MatchMerchant:
      type: object
      properties:
        name:
          type: string
          description: The name of the business assigned by the principal owner(s)
          minLength: 1
          maxLength: 60
        doing_business_as_name:
          type: string
          description: The name used by a merchant that could be different from the legal name of the business
          maxLength: 110
        address:
          $ref: '#/components/schemas/MatchAddress'
        phone_number:
          type: string
          description: The Business or Merchant's phone number. Should not contain country code and should be digits only
          maxLength: 25
        alt_phone_number:
          type: string
          description: The Business or Merchant's alternate phone number
          maxLength: 25
        national_tax_id:
          type: string
          description: The Merchant national tax ID (only provided in the US and is masked)
          maxLength: 35
        country_subdivision_tax_id:
          type: string
          description: The Merchant Country Subdivision tax ID (only provided in the US and is masked)
          maxLength: 35
        urls:
          type: array
          description: Website addresses of the merchant
          items:
            type: string
            maxLength: 4000
        principals:
          $ref: '#/components/schemas/MatchPrincipal'
        added_on_date:
          type: string
          description: Date the merchant was added to the MATCH database (ISO 8601 format).
          example: '2024-01-17'
        termination_reason_code:
          $ref: '#/components/schemas/MatchTerminationReason'
        added_by_acquirer_id:
          type: string
          description: The Member ICA that has added the merchant to the MATCH system
          maxLength: 11
        url_groups:
          type: array
          items:
            $ref: '#/components/schemas/MatchUrlGroup'
        comments:
          type: string
          description: Brief comments on why Merchant is added
          example: Added for reasons of fraud
          maxLength: 500
    MatchPrincipalMatch:
      type: object
      properties:
        name:
          type: string
        address:
          type: string
        phone_number:
          type: string
        alt_phone_number:
          type: string
        national_id:
          type: string
        drivers_license:
          type: string
        email:
          type: string
        date_of_birth:
          type: string
    MatchMerchantMatch:
      type: object
      description: |
        Object showing which field in the merchant data that matched the inquiry.
        Each field has a string value of M00, M01 or M02.

        M00 - No match for the given field

        M01 - Exact match for the given field

        M02 - Phonetic match for the given field

        A phonetic match can happen for words that sound similar (e.g. easy and EZ)
        or minor typographical differences, such as Rob and Bob
      properties:
        name:
          type: string
        doing_business_as_name:
          type: string
        phone_number:
          type: string
        address:
          type: string
        alt_phone_number:
          type: string
        country_subdivision_tax_id:
          type: string
        national_tax_id:
          type: string
        principal_matches:
          type: array
          items:
            $ref: '#/components/schemas/MatchPrincipalMatch'
    MatchSearchResponse:
      type: object
      properties:
        starting_after:
          type: integer
          description: |
            cursor for use in pagination. starting_after is the zero-based index to start the next request after.
            For instance, if you send a request that starts at index 0 and returns 10 items, a subsequent call can include starting_after=10 in order to fetch items starting with item 11.

            If there are no more items this field is not returned.
        inquiry_reference_number:
          type: string
          description: Reference number to look up inquiry result
        possible_matches:
          type: array
          items:
            type: object
            properties:
              total_merchant_matches:
                type: number
                description: Total number of possible matches on terminated merchants
              terminated_merchants:
                type: array
                items:
                  type: object
                  properties:
                    merchant:
                      $ref: '#/components/schemas/MatchMerchant'
                    merchant_match:
                      $ref: '#/components/schemas/MatchMerchantMatch'
    MatchTerminateMerchant:
      type: object
      properties:
        merchant:
          allOf:
            - $ref: '#/components/schemas/MatchRequestMerchant'
            - required:
                - phone_number
            - type: object
              required:
                - merchant_id
                - merchant_category
                - is_proprietorship
                - is_transaction_laundering
              properties:
                merchant_id:
                  type: string
                  minLength: 1
                  maxLength: 15
                  description: |
                    The identifier assigned to a merchant by an acquirer. An acquirer ID and 
                    merchant ID combination must be unique and merchant ID should be less than 15 characters.
                  example: '1234567890'
                merchant_category:
                  type: string
                  minLength: 1
                  maxLength: 4
                  description: |
                    A classification code used in authorization, clearing,
                    and other transactions or reports to identify the type of merchant.
                  example: '1234'
                is_proprietorship:
                  type: string
                  enum:
                    - 'Y'
                    - 'N'
                  description: Y if the merchant is a sole proprietorship
                  example: 'N'
                is_transaction_laundering:
                  type: string
                  enum:
                    - 'Y'
                    - 'N'
                  description: Y if the merchant was terminated for transaction laundering
                  example: 'N'
                principals:
                  type: array
                  minItems: 1
                  maxItems: 5
                  items:
                    type: object
                    required:
                      - date_of_birth
                    properties:
                      date_of_birth:
                        type: string
                        description: |
                          The date of birth of the principal owner.
                          Format: YYYY-MM-DD
                        example: '1980-01-01'
                        format: date
        termination:
          type: object
          required:
            - termination_reason
            - agreement_start_date
            - agreement_termination_date
          properties:
            termination_reason:
              $ref: '#/components/schemas/MatchTerminationReason'
            agreement_start_date:
              type: string
              description: |
                Date the merchant entered into agreement with the acquirer
                Format: YYYY-MM-DD
              example: '2013-12-31'
              format: date
            agreement_termination_date:
              type: string
              description: |
                Date the agreement was terminated with the merchant
                Format: YYYY-MM-DD
              example: '2013-12-31'
              format: date
            comment:
              type: string
              description: Comment on why the merchant is added
              example: Added due to fraud
      required:
        - merchant
        - termination
    VMSSAddress:
      type: object
      required:
        - city
        - countryOrRegion
        - streetAddress
      properties:
        city:
          type: string
          description: The city of the merchant's or agent's registered address.
          minLength: 2
          maxLength: 30
          example: St Albans
        countryOrRegion:
          type: string
          description: The country or region of the merchant's or agent's registered address.
          pattern: ([A-Z]){2}
          minLength: 2
          maxLength: 2
          example: 'NO'
        streetAddress:
          type: string
          description: |
            The street details of the merchant's or agent's registered address that should include,
            in this order as applicable: building number/name, street number and name, shop number, floor number.
          minLength: 4
          maxLength: 40
          example: 80 Wood Street
        stateOrProvince:
          type: string
          description: The state or province of the merchant's or agent's registered address.
          minLength: 2
          maxLength: 20
          example: CA
        zipOrPostalCode:
          type: string
          description: The postal code or zip code for the merchant's or agent's registered address. Required for the US.
          minLength: 3
          maxLength: 8
          example: SA82GF
    VMSSPrincipal:
      title: Up to 5 individuals that are registered as the merchant or agent principal/owner.
      type: array
      items:
        required:
          - name
        type: object
        properties:
          SSN:
            maxLength: 11
            minLength: 11
            type: string
            description: The merchant or agent principal's/owner’s social security number.
          name:
            maxLength: 35
            minLength: 5
            type: string
            description: |
              The name of the individual that is registered as the merchant
              or agent principal/owner.
            example: Bill Smith
          principalID:
            maxLength: 30
            minLength: 0
            type: string
            description: The merchant or agent principal's/owner's id from VMSS 1.0.
            example: '07043453'
          passportNumber:
            maxLength: 30
            minLength: 0
            type: string
            description: The merchant or agent principal's/owner's passport number.
            example: '07043453'
          businessPhoneNumber:
            maxLength: 15
            minLength: 8
            type: string
            description: |
              The merchant or agent principal's/owner's corporate/business
              contact number.
            example: '+861071111222'
          driverLicenseNumber:
            maxLength: 20
            minLength: 0
            type: string
            description: The merchant or agent principal's/owner's driver license number.
            example: '07043453'
          businessEmailAddress:
            maxLength: 40
            minLength: 4
            type: string
            description: |
              The merchant or agent principal's/owner's corporate/business
              email address.
            example: billsmith@snapphoto.com
          residentIDOrNationalID:
            maxLength: 30
            minLength: 0
            type: string
            description: |
              The merchant or agent principal's/owner's resident ID number
              or National ID number. This is required for clients in CEMEA.
            example: '07043453'
    VMSSFinancialAccounts:
      title: Up to 3 financial accounts
      type: array
      items:
        type: object
        properties:
          intBankAccountNumber:
            maxLength: 34
            minLength: 4
            type: string
            description: |
              An International Bank Account Number that can be verified by
              a checksum.
            example: NO8330001234567
          financialAccountNumber:
            maxLength: 20
            minLength: 0
            type: string
            description: |
              A code assigned by a financial institution to uniquely identify
              a customer account within the financial institution.
            example: '8090765400'
          financialInstitutionID:
            maxLength: 10
            minLength: 0
            type: string
            description: |
              A unique code that identifies a Financial Institution; for
            example: '101010'
    VMSSRequestMerchant:
      type: object
      required:
        - DBAName
        - address
        - businessPhoneNumbers
        - principals
      properties:
        address:
          $ref: '#/components/schemas/VMSSAddress'
        taxID:
          maxLength: 30
          minLength: 6
          type: string
          description: |
            A Tax Identification Code registered for the merchant or agent;
            for example, a Value Added Tax (VAT) Number in the UK or a Federal Tax
            ID Number in US.
          example: GB123456789
        DBAName:
          maxLength: 70
          minLength: 1
          type: string
          description: |
            The “Doing-Business-As” Name that the merchant or agent operates
            under.
          example: Snap Photoshop Ltd
        category:
          maxLength: 1
          minLength: 1
          pattern: '[0-5]'
          type: string
          description: |-
            Business Category of the Terminated Record defined as follows:
            0 = Merchant
            1 = Payment Facilitator
            2 = Independent Sales Organization
            3 = Marketplace
            4 = Staged Digital Wallet Operator
            5 = Sponsored Merchant
          example: '1'
        legalName:
          maxLength: 70
          minLength: 4
          type: string
          description: |
            The parent or holding company legally registered name if this
            name is different from the Trading Name/DBA Name. For a sole proprietor,
            this field shall be omitted.
          example: Snap Photoshop Ltd
        principals:
          $ref: '#/components/schemas/VMSSPrincipal'
        webAddresses:
          maxItems: 3
          minItems: 0
          type: array
          description: |
            The registered web address of the merchant or agent. You may
            enter up to 3 web addresses. A web address is required when tradeOverInternet
            is true.
          items:
            maxLength: 40
            minLength: 4
            type: string
            example: https://u.nu
        financialAccts:
          $ref: '#/components/schemas/VMSSFinancialAccounts'
        tradeOverInternet:
          type: boolean
          description: |
            An indicator identifying if the merchant or agent trades over
            the Internet.
          default: false
          example: false
        businessEmailAddress:
          maxLength: 40
          minLength: 4
          type: string
          description: The primary email address registered for the merchant or agent.
          example: billsmith@snapphoto.com
        businessPhoneNumbers:
          maxItems: 3
          minItems: 1
          type: array
          description: |
            The primary phone number registered for the merchant or agent.
            You may enter up to 3 phone numbers.
          items:
            maxLength: 15
            minLength: 8
            type: string
            example: '+861071111222'
        merchantCategoryCodes:
          maxItems: 5
          minItems: 0
          type: array
          description: |
            A four-digit numeric code describing the merchant’s type of
            business product or service, also known as the merchant category code
            (MCC).
          items:
            maxLength: 5
            minLength: 1
            pattern: \d{4}
            type: string
            example: '5411'
        businessRegistrationNumber:
          maxLength: 30
          minLength: 2
          type: string
          description: |
            A Business Registration Number such as Commercial Registration,
            Ministry of Commerce certificate number or equivalent registration number
            for the merchant or agent.
          example: '452349600005'
    VMSSInquiryRequest:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/VMSSRequestMerchant'
      required:
        - merchant
    VMSSTerminatedRecord:
      required:
        - address
        - businessPhoneNumbers
        - cardAcceptorIDs
        - category
        - contractEndDate
        - contractStartDate
        - DBAName
        - incorportationStatus
        - primaryListingReason
        - principals
        - tradeInternationally
        - tradeOverInternet
        - merchantCategoryCodes
      type: object
      properties:
        taxID:
          maxLength: 30
          minLength: 6
          type: string
          description: |
            A Tax Identification Code registered for the merchant or agent;
            for example, a Value Added Tax (VAT) Number in the UK or a Federal Tax
            ID Number in US.
          example: GB123456789
        DBAName:
          maxLength: 70
          minLength: 1
          type: string
          description: |
            The “Doing-Business-As” Name that the merchant or agent operates
            under.
          example: Snap Photoshop Ltd
        address:
          $ref: '#/components/schemas/VMSSAddress'
        category:
          maxLength: 1
          minLength: 0
          pattern: '[0-5]'
          type: string
          description: |-
            Business Category of the Terminated Record defined as follows:
            0 = Merchant
            1 = Payment Facilitator
            2 = Independent Sales Organization
            3 = Marketplace
            4 = Staged Digital Wallet Operator
            5 = Sponsored Merchant
          example: '1'
        legalName:
          maxLength: 70
          minLength: 4
          type: string
          description: |
            The parent or holding company legally registered name if this
            name is different from the Trading Name/DBA Name. For a sole proprietor,
            this field shall be omitted.
          example: Snap Photoshop Ltd
        principals:
          $ref: '#/components/schemas/VMSSPrincipal'
        webAddresses:
          title: |
            The registered web address of the merchant or agent. You may enter
            up to 3 web addresses. A web address is required when tradeOverInternet
            is true.
          maxItems: 3
          minItems: 0
          type: array
          description: |
            The registered web address of the merchant or agent. You may
            enter up to 3 web addresses. A web address is required when tradeOverInternet
            is true.
          items:
            maxLength: 40
            minLength: 4
            type: string
            example: https://u.nu
        financialAccts:
          $ref: '#/components/schemas/VMSSFinancialAccounts'
        cardAcceptorIDs:
          title: |
            A unique reference identifying the sales establishment requesting
            the transaction. You may enter up to 5 Card Acceptor IDs.
          maxItems: 5
          minItems: 1
          type: array
          items:
            maxLength: 15
            minLength: 1
            type: string
            description: |
              A unique reference identifying the sales establishment requesting
              the transaction. You may enter up to 5 Card Acceptor IDs.
            example: '12345678910111'
        contractEndDate:
          maxLength: 10
          minLength: 10
          type: string
          description: |
            The date on which the merchant's or agent's contract agreement
            was terminated.
          example: '2019-11-14'
        contractStartDate:
          maxLength: 10
          minLength: 10
          type: string
          description: |
            The date on which the merchant's or agent's contract agreement
            was granted.
          example: '2019-11-01'
        tradeOverInternet:
          type: boolean
          description: |
            An indicator identifying if the merchant or agent trades over
            the Internet.
          default: false
          example: false
        businessEmailAddress:
          maxLength: 40
          minLength: 4
          type: string
          description: The primary email address registered for the merchant or agent.
          example: billsmith@snapphoto.com
        businessPhoneNumbers:
          title: |
            The primary phone number registered for the merchant or agent. You
            may enter up to 3 phone numbers.
          maxItems: 3
          minItems: 1
          type: array
          description: |
            The primary phone number registered for the merchant or agent.
            You may enter up to 3 phone numbers.
          items:
            maxLength: 15
            minLength: 8
            type: string
            example: '+861071111222'
        incorportationStatus:
          maxLength: 1
          minLength: 1
          pattern: '[1-6]|-1'
          type: string
          description: |-
            The incorporation status registered for the merchant or agent defined as follows:
            1 = Individual/Sole Proprietor
            2 = Partnership
            3 = Corporation
            4 = Medical or Legal Corporation 5 = Association / Estate / Trust
            6 = Non-Profit Organization
            -1 = Unknown (returned for legacy listings)
          example: '3'
        primaryListingReason:
          maxLength: 103
          minLength: 2
          type: string
          description: |
            The primary reason for the termination of the merchant's or
            agent's contract.
          example: 29-Bankruptcy/Liquidation/Insolvency
        tradeInternationally:
          type: boolean
          description: |
            An indicator identifying if the merchant or agent trades across
            international borders or territories.
          example: true
          default: false
        merchantCategoryCodes:
          title: |
            A four-digit numeric code describing the merchant’s type of business
            product or service, also known as the merchant category code (MCC).
          maxItems: 5
          minItems: 0
          type: array
          description: |
            A four-digit numeric code describing the merchant’s type of
            business product or service, also known as the merchant category code
            (MCC).
          items:
            maxLength: 5
            minLength: 1
            pattern: \d{4}
            type: string
            example: '5411'
        paymentFacilitatorBID:
          maxLength: 8
          minLength: 8
          pattern: \d{8}
          type: string
          description: |
            The business ID as registered with Visa to uniquely identify
            a payment facilitator.
          example: '10000108'
        secondaryListingReason:
          maxLength: 103
          minLength: 2
          type: string
          description: |
            The secondary reason for the termination of the merchant's
            or agent's contract.
          example: 34-Merchant Identity Theft
        acquirerAssignedMerchantID:
          maxLength: 30
          minLength: 2
          type: string
          description: |
            A unique Merchant Identification Number assigned by the Acquirer
            or by the Payment Facilitator in the case of a Sponsored Merchant. Mandatory
            for Merchant.
          example: '36654773'
        businessRegistrationNumber:
          maxLength: 30
          minLength: 2
          type: string
          description: |
            A Business Registration Number such as Commercial Registration,
            Ministry of Commerce certificate number or equivalent registration number
            for the merchant or agent.
          example: '452349600005'
        paymentFacilitatorCountryOrRegion:
          maxLength: 2
          minLength: 2
          pattern: ([A-Z]){2}
          type: string
          description: The country or region of the payment facilitator.
          example: 'NO'
    VMSSAddressMatch:
      type: object
      properties:
        city:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        streetAddress:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        countryOrRegion:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        stateOrProvince:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        zipOrPostalCode:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
    VMSSPrincipalsMatch:
      title: The principalMatch array.
      type: array
      items:
        type: object
        properties:
          SSN:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          name:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          principalID:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          passportNumber:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          businessPhoneNumber:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          driverLicenseNumber:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          businessEmailAddress:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          residentIDOrNationalID:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
    VMSSFinancialAccountsMatch:
      title: The financialAcctMatch array.
      type: array
      items:
        type: object
        properties:
          intBankAccountNumber:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          financialAccountNumber:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
          financialInstitutionID:
            maxLength: 1
            minLength: 1
            pattern: ([NEP]){1}
            type: string
            description: |-
              The indicator of the match type for the data field.
              N = No Match
              E = Exact Match
              P = Partial Match
            example: 'N'
    VMSSTerminatedRecordMatch:
      type: object
      properties:
        taxID:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        DBAName:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        legalName:
          maxLength: 35
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        addressMatch:
          $ref: '#/components/schemas/VMSSAddressMatch'
        webAddresses:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        principalsMatch:
          $ref: '#/components/schemas/VMSSPrincipalsMatch'
        tradeOverInternet:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        financialAcctsMatch:
          $ref: '#/components/schemas/VMSSFinancialAccountsMatch'
        businessEmailAddress:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        businessPhoneNumbers:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        merchantCategoryCodes:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
        businessRegistrationNumber:
          maxLength: 1
          minLength: 1
          pattern: ([NEP]){1}
          type: string
          description: |-
            The indicator of the match type for the data field.
            N = No Match
            E = Exact Match
            P = Partial Match
          example: 'N'
    VMSSMatchedRecord:
      title: Array of the matched records.
      type: array
      items:
        type: object
        properties:
          acquirerBID:
            maxLength: 8
            minLength: 8
            pattern: \d{8}
            type: string
            description: |
              Visa assigned Business Identifier (BID) of the Acquirer for
              the terminated contract.
            example: '10048640'
          acquirerName:
            maxLength: 240
            minLength: 0
            type: string
            description: Name of the Acquirer for the terminated contract.
            example: Bank of ABC
          terminatedRefID:
            maxLength: 36
            minLength: 1
            type: string
            description: |
              A system-generated terminated record reference identification
              number.
            example: 61e8aa42-d252-4e74-9dcc-85134f37a181
          terminatedRecord:
            $ref: '#/components/schemas/VMSSTerminatedRecord'
          terminatedRecordMatch:
            $ref: '#/components/schemas/VMSSTerminatedRecordMatch'
          acquirerCountryOrRegion:
            maxLength: 2
            minLength: 2
            pattern: ([A-Z]){2}
            type: string
            description: The country or region of the Acquirer for the terminated contract.
            example: 'NO'
    VMSSInquiryResponse:
      type: object
      properties:
        searchTerminatedResponse:
          type: object
          properties:
            possibleMatches:
              type: object
              properties:
                matchedRecords:
                  $ref: '#/components/schemas/VMSSMatchedRecord'
                totalCount:
                  type: integer
                  description: Number of possibly matched records returned in the response.
            searchRequestRef:
              type: object
              properties:
                acquirerBID:
                  maxLength: 8
                  minLength: 8
                  pattern: \d{8}
                  type: string
                  description: |
                    Visa assigned Business Identifier (BID) of the Acquirer for
                    the Search request.
                  example: '10048640'
                globalSearch:
                  type: boolean
                  description: |
                    An indicator identifying if the inquiry is worldwide or regional
                    based. True means Global Search and False means Regional Search.
                  default: false
                  example: false
                searchRequestRefID:
                  maxLength: 99999999
                  minLength: 0
                  type: string
                  description: A system-generated Search request reference id.
                  example: SRCH123412
                acquirerCountryOrRegion:
                  maxLength: 2
                  pattern: ([A-Z]){2}
                  type: string
                  description: The country or region of the Acquirer for the Search request.
                  example: 'NO'
                terminatedRecordSearchCriteria:
                  $ref: '#/components/schemas/VMSSRequestMerchant'
        status:
          type: object
          properties:
            statusDescription:
              type: string
              description: Status Description.
              minLength: 0
              maxLength: 256
              example: Success
            statusCode:
              type: string
              description: Status Code.
              minLength: 6
              maxLength: 6
              example: API000
    VMSSTermianteMerchantRequest:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/VMSSTerminatedRecord'
      required:
        - merchant
    VMSSTerminateMerchantResponse:
      type: object
      properties:
        addResponse:
          type: object
          properties:
            acquirerBID:
              maxLength: 8
              minLength: 8
              pattern: \d{8}
              type: string
              description: |
                Visa assigned Business Identifier (BID) of the Acquirer for
                the Search request.
              example: '10048640'
            acquirerCountryOrRegion:
              maxLength: 2
              pattern: ([A-Z]){2}
              type: string
              description: The country or region of the Acquirer for the Search request.
              example: 'NO'
            acquirerName:
              minLength: 0
              maxLength: 240
              type: string
              description: Name of the Acquirer for the terminated contract.
              example: Dintero
            action:
              minLength: 1
              maxLength: 10
              type: string
              description: Action type.
              example: Add
            terminatedRefID:
              minLength: 1
              maxLength: 36
              type: string
              description: A system-generated terminated record reference identification number.
              example: 61e8aa42-d252-4e74-9dcc-85134f37a181
            terminatedRecord:
              $ref: '#/components/schemas/VMSSTerminatedRecord'
        status:
          type: object
          properties:
            statusDescription:
              type: string
              description: Status Description.
              minLength: 0
              maxLength: 256
              example: Success
            statusCode:
              type: string
              description: Status Code.
              minLength: 6
              maxLength: 6
              example: API000
    AccountUser:
      type: object
      description: An admin user for the account
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - email
          properties:
            email:
              type: string
              example: customer@example.com
            name:
              type: string
              example: John Doe
            scope:
              type: array
              items:
                type: string
                minItems: 1
                example: receipts:write
            authentication_type:
              readOnly: true
              type: string
            agreement:
              $ref: '#/components/schemas/AccountAgreement'
    AccountAdminUser:
      type: object
      description: An admin user for the account
      allOf:
        - $ref: '#/components/schemas/AccountUser'
        - properties:
            roles:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/AuthRole'
                  - required:
                      - id
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: |
                          An UUID that uniquely identifies the resource
            last_seen_at:
              type: string
              format: date-time
            configuration:
              $ref: '#/components/schemas/AccountUserConfig'
    AuditEvent:
      type: object
      description: |
        Audit event, an **actor** takes an **action** on and
        **entity** within a **context**
      required:
        - id
        - created_at
        - action
        - entity
        - context
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
        action:
          type: string
          example: auth.token
          description: Name of the action
        actor:
          type: string
          description: User ID who initiated the action.
        entity:
          type: string
          description: ID of the target entity of the action
        context:
          type: object
          description: Context for the event
          example:
            ip: 93.184.216.34
            user_agent: Mozilla/5.0 ..
    AccountSignupRequest:
      type: object
      properties:
        applicant:
          $ref: '#/components/schemas/AccountApplicant'
        company:
          $ref: '#/components/schemas/AccountCompany'
        billing:
          $ref: '#/components/schemas/AccountBilling'
        account_manager:
          type: object
          required:
            - email
          description: |
            Account manager responsible for the account.
            > value is not visible for the merchant
          properties:
            email:
              type: string
              example: employee@dintero.com
        external_integrations:
          type: object
          properties:
            wallmob_signup:
              type: object
              required:
                - merchant_type
                - password
              properties:
                merchant_type:
                  type: string
                  enum:
                    - company
                    - nonprofit
                password:
                  minLength: 6
                  type: string
      required:
        - applicant
    AccountSignupPreFillRequest:
      type: object
      properties:
        prefill_id:
          type: string
          description: Auto-generated id
        applicant:
          $ref: '#/components/schemas/AccountApplicant'
        company:
          $ref: '#/components/schemas/AccountCompany'
        billing:
          $ref: '#/components/schemas/AccountBilling'
        account_manager:
          type: object
          required:
            - email
          description: |
            Account manager responsible for the account.
            > value is not visible for the merchant
          properties:
            email:
              type: string
              example: employee@dintero.com
      required:
        - applicant
        - company
        - billing
    EmailAuthorizedUser:
      type: object
      properties:
        account_id:
          type: string
          format: ^\d{8}$
          description: |
            Account ID for the account created from completing the signup
        access_token:
          description: |
            Applicant user access token with `openid` scope
          type: string
        expires_in:
          description: |
            The lifetime in seconds of the access token.
          type: integer
        token_type:
          type: string
          enum:
            - Bearer
        refresh_token:
          type: string
        email:
          type: string
          description: |
            The email for the user that verified the account
        previous_password_token:
          type: string
          description: |
            A token that can be used as `previous_password`value when changing the password for the user via [PUT /v1/accounts/{aid}/account/user/password](/management-auth-api/account-users/account_user_password_put). Only included in the response if the signup created a new account user.
    Exchange:
      type: object
      required:
        - account_id
      properties:
        account_id:
          type: string
          format: ^[PT]{1}\d{8}$
          description: |
            The account_id to create exchange access_token for
    Catalog:
      type: object
      properties:
        catalog_id:
          type: string
          example: S23
          description: The id to define which catalog the product is a part of. An auto-generated ID will be created if not provided
          readOnly: true
        catalog_name:
          type: string
          example: Sommer
          description: |
            The catalog's name that will be shown customers
    Images:
      description: Links to images of product
      type: array
      example:
        - href: https://example.dintero.com/c/photos/2018/6_20_thumbnail_image.png
          rel: thumbnail_image
          caption: Image of current discount
        - href: https://example.dintero.com/c/photos/2018/6_20_medium_image.png
          rel: medium_image
      items:
        type: object
        maxItems: 10
        required:
          - href
        properties:
          href:
            description: The URL of the link.
            type: string
            format: uri
          title:
            description: Describes the image
            type: string
          rel:
            description: |
              Specifies the relationship between the image and the link

              Following `rel` values are reserved for specific usage

                - thumbnail_image: link to image
                - medium_image: link to image
                - large_image: link to image
                - webshop: link to site where the image may be used
            type: string
          type:
            type: string
            description: Specifies the media type of the link
    Location:
      type: object
      properties:
        location_id:
          type: string
          description: |
            The id you have defined for the sales location. 
            (must not have trailing or leading spaces). 
            An auto-generated location_id will be created if no location_id is provided
          maxLength: 255
        location_name:
          type: string
          description: |
            The name that will be shown to customers
        is_available_for_shipping:
          description: |
            If true, the product is available for shipping
          type: boolean
          default: true
        is_available_for_pickup:
          description: |
            If true, the product can be picked up at this location
          type: boolean
          default: false
        number_of_items_in_storage:
          description: |
            Number of items currently in storage at this location
          type: integer
    Product:
      type: object
      allOf:
        - properties:
            product_name:
              type: string
              example: Stablestol
              description: |
                The products name which is shown to customers
            description:
              type: string
              example: Stablestol for utendørsbruk
            is_virtual_product:
              type: boolean
              default: false
            unit_gross_price:
              type: integer
              example: 10900
            unit:
              type: string
              example: stk
              description: Unit type
            currency:
              type: string
              example: NOK
              description: |
                The three-character ISO-4217 currency. https://en.wikipedia.org/wiki/ISO_4217
            starting_at:
              type: string
              format: date-time
              description: |
                The product will not be visible until this time
            stopping_at:
              type: string
              format: date-time
              description: |
                The product will not be visible after this time
            dimension:
              $ref: '#/components/schemas/Dimension'
            images:
              $ref: '#/components/schemas/Images'
            locations:
              description: |
                All locations connected to the product
              type: array
              example:
                - location_id: SC_Oslo
                  location_name: SuperChain Oslo
                  is_available_for_shipping: false
                  is_available_for_pickup: true
                  number_of_items_in_storage: 15
                - location_id: SC_web
                  location_name: SuperChain Webshop
                  is_available_for_shipping: true
                  is_available_for_pickup: false
                  number_of_items_in_storage: 500
              items:
                $ref: '#/components/schemas/Location'
    ProductResponse:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - $ref: '#/components/schemas/Product'
        - properties:
            product_id:
              description: |
                The id to define the product. An auto-generated product_id will be created if no product_id is provided
              type: string
              example: Stol22
              readOnly: true
            catalog_id:
              type: string
              example: S23
              description: The id to define which catalog the product is a part of. An auto-generated ID will be created if not provided
            catalog_name:
              type: string
              example: Sommer
              readOnly: true
              description: |
                Name of corresponding catalog
    Group:
      type: object
      properties:
        group_id:
          type: string
          description: group id
          example: B1
          readOnly: true
        group_name:
          type: string
          description: Name of the group
          example: Møbel
    ProductPost:
      allOf:
        - $ref: '#/components/schemas/Product'
        - properties:
            product_id:
              description: |
                The id to define the product. An auto-generated product_id will be created if no product_id is provided
              type: string
              example: Stol22
              readOnly: false
            groups:
              type: array
              description: |
                Array containing relevant product groups and sub-groups to be upserted. New groups will be inserted, existing groups will be updated and deleted groups will be revived.
              example:
                - id: B234
                  name: Stol
                - id: B1
                  name: Møbel
              items:
                allOf:
                  - properties:
                      group_id:
                        type: string
                        maxLength: 255
                        description: |
                          The id you have defined for the group (must not have training or leading spaces). An auto-generated group_id will be created if not provided
                        example: b1
                        readOnly: false
                  - $ref: '#/components/schemas/Group'
    TaxGroup:
      type: object
      properties:
        tax_id:
          type: string
          description: |
            The id you have defined for the taxgroup (must not have training or leading spaces). An auto-generated tax_id will be created if not provided
          example: vmva1
          readOnly: true
        tax_group:
          type: string
          description: |
            The taxgroup name which is usually shown
          example: Vmva-høy
        description:
          type: string
          example: Taxgroup for food. Currently 12%
        amount:
          type: number
          example: 10000
        percentage:
          type: number
          example: 12
        tax_code:
          type: string
          example: 3
    ReceiptMinimal:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - properties:
            store:
              $ref: '#/components/schemas/Store'
            items:
              type: array
              items:
                $ref: '#/components/schemas/ReceiptItem'
            gross_amount:
              type: integer
              example: 47840
              description: |
                Monetary amount in smallest unit for the currency
            net_amount:
              type: integer
              example: 38000
              description: |
                Monetary amount in smallest unit for the currency
                after discounts
            currency:
              type: string
              example: NOK
              description: |
                The three-character ISO-4217 currency.
                https://en.wikipedia.org/wiki/ISO_4217
            purchase_at:
              type: string
              format: date-time
    OriginatedBy:
      type: object
      properties:
        originated_by:
          type: string
          description: |
            The reference to where the entity was created.
            (must not have trailing or leading spaces)
          maxLength: 255
    PinFormat:
      description: PIN format used for generation
      type: object
      properties:
        length:
          description: |
            The length of the PIN (exclusive length of the prefix).
          type: integer
          default: 36
          minimum: 4
        prefix:
          type: string
          description: |
            Prefix the PIN, the length of the prefix will affect
            the total length of the PIN.
          example: 'DINCARD:'
          maxLength: 12
        symbols:
          type: boolean
          description: Allow characters like `@#$%` in the created PIN.
          default: true
        numbers:
          type: boolean
          description: Allow characters like `123456` in the created PIN.
          default: true
        characters:
          type: boolean
          description: Allow characters like `acbABC` in the created PIN.
        barcode:
          default: false
          description: |
            Include the PIN as a base64 encoded barcode image.
          type: boolean
    CardProperties:
      type: object
      required:
        - card_id
      allOf:
        - $ref: '#/components/schemas/OriginatedBy'
        - properties:
            card_id:
              type: string
              description: |
                The card id you have defined for the card.
                (must not have trailing or leading spaces)
              maxLength: 255
            customer_id:
              type: string
              description: |
                The customer id you have defined as the owner
                of the card. (must not have trailing or leading spaces)
              maxLength: 255
            name:
              type: string
              description: Display name for the card
            type:
              type: string
              description: |
                The type of the card. The value is one of the following:
                - `gift_card` - a gift card
                - `credit_note` - a credit note
                Defaults to `gift_card`
              example: gift_card
              enum:
                - gift_card
                - credit_note
            status:
              type: string
              description: |
                The status of the card. The value is one of the following:
                - `inactive` - Inactive card created by batch, needs to be activated
                - `unused` - the card is unused
                - `used` - the card has 0 balance
                - `partially_used` - the card has been used partially
                - `expired` - the card has expired

                Defaults to `unused`
              example: unused
              enum:
                - inactive
                - unused
                - used
                - partially_used
                - expired
            pin:
              type: object
              properties:
                format:
                  allOf:
                    - $ref: '#/components/schemas/PinFormat'
    ImmutableEntity:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: |
            An UUID that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          example: 1c92f7e1-2897-4d46-bdcc-c127a914fb4e
          description: |
            The ID of the user/client that created the resource
          readOnly: true
    Metadata:
      type: object
      properties:
        metadata:
          type: object
          description: |
            A key-value JSON object to store any additional
            information. The dintero_* namespace for keys
            is reserved
          example:
            order_id: xk39592f
    Operation:
      type: object
      allOf:
        - required:
            - amount
            - currency
          properties:
            amount:
              type: integer
              example: 50000
              minimum: 0
              description: |
                Monetary amount in smallest unit for the currency
            currency:
              type: string
              example: NOK
              enum:
                - NOK
                - SEK
                - DKK
                - EUR
                - USD
              description: |
                The three-character ISO-4217 currency.
                https://en.wikipedia.org/wiki/ISO_4217
    CardBalance:
      type: object
      properties:
        amount_balance:
          type: number
          readOnly: true
          example: 50000
          minimum: 0
          description: |
            The balance, including amount locked by pending transaction.
            Monetary amount in smallest unit for the currency
        amount_available:
          type: number
          readOnly: true
          example: 50000
          minimum: 0
          description: |
            The amount available for drawdown
            (exclusive amount locked by pending transactions).
            Monetary amount in smallest unit for the currency
        amount_funds:
          type: number
          readOnly: true
          example: 50000
          minimum: 0
          description: |
            The sum of all fund transactions.
            Monetary amount in smallest unit for the currency
        amount_drawdown:
          type: number
          readOnly: true
          example: 50000
          minimum: 0
          description: |
            The sum of all drawdown transactions.
            Monetary amount in smallest unit for the currency
        amount_pending:
          type: number
          readOnly: true
          example: 50000
          minimum: 0
          description: |
            The sum of all pending transactions.
            Monetary amount in smallest unit for the currency
        amount_reserved:
          type: number
          readOnly: true
          example: 50000
          minimum: 0
          description: |
            The sum of all reserved transactions.
            Monetary amount in smallest unit for the currency
    CardActivePeriod:
      type: object
      properties:
        active_from:
          type: string
          format: date-time
          description: |
            Optional time when the card is activated. No `drawdown` transaction
            will be allowed before if set. (`fund` transaction is allowed)
        expires_at:
          type: string
          format: date-time
          description: |
            Optional expiration time for the card. No transaction will be
            allowed on an expired card
    Card:
      type: object
      allOf:
        - $ref: '#/components/schemas/CardProperties'
        - $ref: '#/components/schemas/ImmutableEntity'
        - $ref: '#/components/schemas/Metadata'
        - $ref: '#/components/schemas/Operation'
        - $ref: '#/components/schemas/CardBalance'
        - $ref: '#/components/schemas/CardActivePeriod'
    PinGenerator:
      type: object
      description: How the PIN should be generated.
      properties:
        format:
          $ref: '#/components/schemas/PinFormat'
        pin:
          type: object
          readOnly: true
          properties:
            value:
              type: string
              example: '012345'
              maxLength: 48
            barcode_128:
              type: string
              description: |
                Code 128 barcode representation of the PIN value. A base64 encoded
                image in format `data:[<mime type>][;charset=<charset>][;base64],<encoded data>`
              example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...
    Format:
      description: Specify the format to generate
      type: object
      properties:
        length:
          description: |
            The length of the token (exclusive length of the prefix)
          type: integer
          default: 36
          minimum: 6
        prefix:
          type: string
          description: |
            Prefix the token, the length of the prefix will affect
            the total length of the token
          example: 'DINCARD:'
          maxLength: 12
        symbols:
          type: boolean
          description: Allow characters like `@#$%` in the created token
          default: true
        numbers:
          type: boolean
          description: Allow characters like `123456` in the created token
          default: true
        characters:
          type: boolean
          description: Allow characters like `acbABC` in the created token
        barcode:
          default: false
          description: |
            Include token as base64 encoded barcode image
          type: boolean
    TokenGenerator:
      type: object
      description: Specify how token should be generated
      required:
        - expires_in
      properties:
        format:
          allOf:
            - $ref: '#/components/schemas/Format'
            - description: |
                specify the format for the token, default format
                is an UUID prefixed with `DINCARD`
        expires_after_transaction:
          type: boolean
          description: |
            The token can only be used to create one transaction, card lookup by
            token will be available until token expires by date
          default: true
        expires_in:
          description: |
            The lifetime in seconds for the card token.  For
            example, the value "3600" denotes that the token will
            expire in one hour from the time the response was generated.
          minimum: 1
          type: integer
        token:
          type: object
          readOnly: true
          properties:
            value:
              type: string
              example: DINCARD:6ccfec5d-3a53-47de-910a-97d6dda22e5f
              maxLength: 48
            barcode_128:
              type: string
              description: |
                Code 128 barcode representation of the token value. A base64 encoded
                image in format `data:[<mime type>][;charset=<charset>][;base64],<encoded data>`
              example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...
    TokenList:
      type: object
      properties:
        tokens:
          type: array
          items:
            type: object
            properties:
              expires_at:
                description: expiration time for the token
                type: string
                format: date-time
              masked_code:
                description: masked token code
                type: string
                example: DINCARD:********-****-****-91**-*******22e5f
              format:
                allOf:
                  - $ref: '#/components/schemas/Format'
    CardDetails:
      type: object
      allOf:
        - $ref: '#/components/schemas/Card'
        - $ref: '#/components/schemas/TokenList'
    BaseOperation:
      type: object
      required:
        - ref_id
      properties:
        ref_id:
          type: string
          description: |
            Unique ref ID provided by the client to support safely retrying
            requests without accidentally performing the same operation twice

            All card transaction must have a unique ref ID, but it is not
            required that the ref ID is globally unique.
    Token:
      type: object
      allOf:
        - $ref: '#/components/schemas/ImmutableEntity'
        - $ref: '#/components/schemas/Metadata'
        - $ref: '#/components/schemas/BaseOperation'
        - $ref: '#/components/schemas/TokenGenerator'
    TransactionInput:
      type: object
      allOf:
        - $ref: '#/components/schemas/ImmutableEntity'
        - $ref: '#/components/schemas/Metadata'
        - $ref: '#/components/schemas/BaseOperation'
        - $ref: '#/components/schemas/Operation'
        - $ref: '#/components/schemas/OriginatedBy'
    Transaction:
      type: object
      allOf:
        - $ref: '#/components/schemas/TransactionInput'
        - properties:
            type:
              type: string
              description: |
                The type of the Transaction:
                  - *fund*: the amount has been funded to the card
                  - *drawdown*: the amount has been drawn from the card
                  - *pending_capture*: the amount has been locked until it is either captured or voided
                  - *voided*: the amount locked by pending Transaction is unlocked
              enum:
                - drawdown
                - pending_capture
                - voided
                - fund
              readOnly: true
            parent_id:
              type: string
              format: uuid
              readOnly: true
              description: |
                The ID of the original Transaction for a void or
                capture transaction
    CustomerCard:
      type: object
      allOf:
        - $ref: '#/components/schemas/ImmutableEntity'
        - $ref: '#/components/schemas/Metadata'
        - $ref: '#/components/schemas/CardActivePeriod'
        - $ref: '#/components/schemas/CardProperties'
    CustomerCardState:
      type: object
      allOf:
        - $ref: '#/components/schemas/CustomerCard'
        - $ref: '#/components/schemas/TokenList'
        - $ref: '#/components/schemas/CardBalance'
        - properties:
            currency:
              type: string
              example: NOK
              enum:
                - NOK
                - SEK
                - DKK
                - EUR
                - USD
              description: |
                Three-character ISO-4217 currency.
                https://en.wikipedia.org/wiki/ISO_4217
    TokenCode:
      type: object
      required:
        - token
      properties:
        token:
          type: string
          description: |
            temporary token for a Card
        pin:
          type: string
          description: PIN for the Card
    CardByIdOrToken:
      type: object
      properties:
        token:
          type: string
          description: |
            **required** if `card_id` is not set (cannot be combined with `card_id`)
        card_id:
          type: string
          description: |
            **required** if `token` is not set (cannot be combined with `token`)
    OptionalAmount:
      type: object
      properties:
        amount:
          type: integer
          example: 50000
          minimum: 0
          description: |
            Monetary amount in smallest unit for the currency
    Secret:
      discriminator:
        propertyName: type
        mapping:
          HMAC-SHA1: '#/components/schemas/HMAC-SHA1'
          AWS4-HMAC-SHA256: '#/components/schemas/AWS4-HMAC-SHA256'
          Authorization: '#/components/schemas/Authorization'
      oneOf:
        - $ref: '#/components/schemas/HMAC-SHA1'
        - $ref: '#/components/schemas/AWS4-HMAC-SHA256'
        - $ref: '#/components/schemas/Authorization'
    Hook:
      type: object
      description: |
        Configuration for a webhook
      allOf:
        - $ref: '#/components/schemas/Entity'
        - required:
            - config
            - events
          properties:
            active:
              type: boolean
              description: |
                Determines whether the hook is actually triggered.
              default: true
            config:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  description: |
                    A required string defining the URL to which
                    the payloads will be delivered.

                    The URL must be public available and you cannot use the
                    following as value:

                      - localhost
                      - "fake" domains like www.example.com
                      - Dintero domains (i.e. dintero.com)
                content_type:
                  type: string
                  default: application/json
                  enum:
                    - application/json
                secret:
                  $ref: '#/components/schemas/Secret'
                insecure_ssl:
                  type: integer
                  description: |
                    An optional string that determines whether the
                    SSLcertificate of the host for url will be
                    verified when delivering payloads. Supported
                    values include `"0"` (verification is performed)
                    and `"1"` (verification is not performed).
                    The default is `"0"`.
                  default: 0
            fields:
              type: string
              description: |
                Limit the event data included in the delivery

                The syntax is loosely based on XPath:
                - a,b,c comma-separated list will select multiple fields
                - a/b/c path will select a field from its parent
                - a(b,c) sub-selection will select many fields from a parent
                - a/*/c the star * wildcard will select all items in a field
              example: account(partner_id,account_id,created_at)
              format: field-mask
            exclude_fields:
              type: array
              description: |
                Limit the event data included in the delivery
              example:
                - customer_ip
                - billing_address
              items:
                type: string
                minItems: 1
                maxItems: 20
                maxLength: 50
                format: field-name
            events:
              type: array
              items:
                type: string
                minItems: 1
                enum:
                  - account_add
                  - account_update
                  - account_store_add
                  - account_store_update
                  - account_store_delete
                  - account_payout_destination_add
                  - account_payout_destination_update
                  - account_payout_destination_delete
                  - receipt_add
                  - receipt_update
                  - customer_add
                  - customer_update
                  - customer_delete
                  - customer_change_password
                  - token_add
                  - token_remove
                  - transaction
                  - wallet_transaction
                  - discount_add
                  - discount_update
                  - discount_delete
                  - discount_add_customers
                  - discount_customer_update
                  - shopping_draft_add
                  - shopping_draft_update
                  - shopping_draft_complete
                  - shopping_order_update
                  - shopping_order_event_add
                  - shopping_order_delete
                  - settlement_add
                  - location_add
                  - location_delete
                  - location_update
                  - cdd_case_update
                  - approval_payout_destination_update
                  - approval_payout_destination_delete
                  - checkout_authorization
                  - checkout_transaction
                  - checkout_token_add
                  - checkout_token_update
                  - checkout_token_delete
    HookDelivery:
      type: object
      properties:
        id:
          type: string
        event_delivery:
          type: string
        created_at:
          type: string
          format: date-time
        status:
          type: integer
          description: |
            HTTP status code
          example: 200
    HookDeliveryDetail:
      type: object
      allOf:
        - $ref: '#/components/schemas/HookDelivery'
        - properties:
            url:
              type: string
              description: |
                The payload URL
            request:
              type: object
              properties:
                headers:
                  type: object
                  properties:
                    event:
                      type: string
                    event-delivery:
                      type: string
                    event-signature:
                      type: string
                body:
                  type: object
            response:
              type: object
              properties:
                headers:
                  type: object
                body:
                  type: string
                  nullable: true
            details:
              type: object
              properties:
                delivery_at:
                  type: string
                  format: date-time
                delivery_duration:
                  type: number
                  example: 848
                delivery_success:
                  type: boolean
                  example: true
    PayoutDestinationUpdateBase:
      type: object
      description: |
        The seller approval case that was updated
      required:
        - id
        - created_at
        - updated_at
        - payout_destination_id
        - payout_reference
        - organization_number
        - case_status
      properties:
        id:
          type: string
          format: uuid
          example: 497f6eca-6276-4993-bfeb-53cbbbba6f08
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
        updated_at:
          type: string
          format: date-time
        payout_destination_id:
          type: string
        payout_destination_name:
          type: string
        payout_destination_description:
          type: string
        payout_reference:
          type: string
        organization_number:
          type: string
        case_status:
          type: string
          enum:
            - ACTIVE
            - DECLINED
            - UNDER_MANUAL_REVIEW
            - AUTOMATIC_REVIEW
            - WAITING_FOR_SIGNATURE
            - WAITING_FOR_DECLARATION
            - ERROR
    ApprovalPayoutDestinationUpdateEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - payout_destination_case
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: approval_payout_destination_update
          enum:
            - approval_payout_destination_update
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        payout_destination_case:
          allOf:
            - $ref: '#/components/schemas/PayoutDestinationUpdateBase'
            - description: |
                The seller approval case that was updated
              required:
                - case_status
              properties:
                case_status:
                  enum:
                    - ACTIVE
                    - DECLINED
                    - UNDER_MANUAL_REVIEW
                    - AUTOMATIC_REVIEW
                    - WAITING_FOR_SIGNATURE
                    - WAITING_FOR_DECLARATION
                    - ERROR
    CheckoutTransactionEvent:
      type: object
      required:
        - account_id
        - event
        - event_delivery
        - transaction
      properties:
        account_id:
          type: string
          example: P12345678
        event:
          type: string
          example: checkout_transaction
          enum:
            - checkout_transaction
        event_delivery:
          type: string
          format: uuid
          example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
        transaction:
          type: object
          description: The transaction details, see Checkout API /api-reference/transactions/transactions_id_get for complete description of all properties that can be included in the transaction object
          required:
            - id
            - session_id
            - merchant_reference
            - created_at
            - updated_at
          properties:
            id:
              type: string
              example: P12345678.465UfBENeLpkBvwmqfTC4k
            session_id:
              type: string
              description: The session id for the transaction
              example: P12345678.465U8CUzaPVpneu1wt8Wei
            merchant_reference:
              type: string
              description: |
                A reference specified by the merchant to identify the transaction
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            merchant_reference_2:
              type: string
              description: |
                A reference specified by the merchant to identify the transaction,
                can be updated after the transaction has been created
    ServiceStatistic:
      type: object
      properties:
        start_at:
          type: string
          format: datetime
        end_at:
          type: string
          format: datetime
        type:
          type: string
          example: checkout/capture
        total_count:
          type: number
        total_metric_value:
          type: number
    AccountMonthlyStatistics:
      type: object
      readOnly: true
      properties:
        checkout:
          required:
            - payment_product_types
          properties:
            payment_product_types:
              type: array
              items:
                allOf:
                  - required:
                      - payment_product_type
                      - operation
                      - currency
                    properties:
                      operation:
                        type: string
                        enum:
                          - capture
                          - refund
                      currency:
                        type: string
                        example: NOK
                        description: |
                          The three-character ISO-4217 currency.
                          https://en.wikipedia.org/wiki/ISO_4217
                      payment_product_type:
                        type: string
                  - $ref: '#/components/schemas/ServiceStatistic'
        shopping:
          required:
            - orders
          properties:
            orders:
              type: array
              items:
                allOf:
                  - required:
                      - operation
                    properties:
                      operation:
                        type: string
                        enum:
                          - create
                  - $ref: '#/components/schemas/ServiceStatistic'
    AutomationActionBase:
      type: object
      properties:
        type:
          type: string
      required:
        - type
    AuthTokenBase:
      type: object
      properties:
        grant_type:
          type: string
      required:
        - grant_type
    AccountEventBase:
      type: object
      description: |
        Events registered on the account
      properties:
        event_type:
          type: string
        id:
          type: string
          description: |
            An id that uniquely identifies the resource
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: |
            The date-time when the resource was created
          readOnly: true
        created_by:
          type: string
          description: |
            The ID of the user/client created the resource
          readOnly: true
      required:
        - event_type
    SecretBase:
      type: object
      properties:
        type:
          type: string
          enum:
            - HMAC-SHA1
            - AWS4-HMAC-SHA256
            - Authorization
      required:
        - type
