openapi: 3.1.0
info:
  title: AbaNinja Exports API
  version: 3.0.0
  x-domain-id: exports
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: exports
    description: Manage exports
    x-displayName: Exports
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/exports/v2/exports:
    get:
      tags:
        - exports
      summary: Get exports
      description: Get exports with current state
      operationId: exports_list_exports
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: page
          in: query
          schema:
            type:
              - integer
              - 'null'
            default: 1
            minimum: 1
        - name: perPage
          in: query
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
        - name: type
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - WAREHOUSE_STOCKS_ALL
                - WAREHOUSE_PRODUCT_RESERVATIONS
            minimum: 0
        - name: expired
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        type: array
                        items:
                          title: Export Resource
                          properties:
                            uuid:
                              type: string
                              format: uuid
                            type:
                              type: string
                              enum:
                                - WAREHOUSE_STOCKS_ALL
                                - WAREHOUSE_PRODUCT_RESERVATIONS
                            status:
                              type: string
                              enum:
                                - QUEUED
                                - RUNNING
                                - FINISHED
                                - FAILED
                            name:
                              type:
                                - string
                                - 'null'
                            createdAt:
                              type: string
                              format: date-time
                            startedAt:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            finishedAt:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            expiresAt:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            isExpired:
                              type: boolean
                          type: object
                      status:
                        example: 200
                      meta:
                        properties:
                          pagination:
                            properties:
                              currentPage:
                                type: integer
                                minimum: 1
                              firstPageUrl:
                                type:
                                  - string
                                  - 'null'
                                format: uri
                              from:
                                type:
                                  - integer
                                  - 'null'
                                example: 1
                              lastPage:
                                type: integer
                              lastPageUrl:
                                type: string
                                format: uri
                              nextPageUrl:
                                type:
                                  - string
                                  - 'null'
                                format: uri
                              perPage:
                                type: integer
                                example: 50
                              previousPageUrl:
                                type:
                                  - string
                                  - 'null'
                                format: uri
                              to:
                                type:
                                  - integer
                                  - 'null'
                                example: 50
                              totalItems:
                                type: integer
                            type: object
                        type: object
                    type: object
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
      security:
        - ApiToken: []
      x-legacy-operation-id: afbe28436acbd9c37d689255e95c9118
  /accounts/{accountUuid}/exports/v2/exports/{exportUuid}:
    get:
      tags:
        - exports
      summary: Get export item
      description: Get export item with current state
      operationId: exports_get_exports
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: exportUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        title: Export Download Resource
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          type:
                            type: string
                            enum:
                              - WAREHOUSE_STOCKS_ALL
                              - WAREHOUSE_PRODUCT_RESERVATIONS
                          status:
                            type: string
                            enum:
                              - QUEUED
                              - RUNNING
                              - FINISHED
                              - FAILED
                          name:
                            type:
                              - string
                              - 'null'
                          createdAt:
                            type: string
                            format: date-time
                          startedAt:
                            type:
                              - string
                              - 'null'
                            format: date-time
                          finishedAt:
                            type:
                              - string
                              - 'null'
                            format: date-time
                          expiresAt:
                            type:
                              - string
                              - 'null'
                            format: date-time
                          isExpired:
                            type: boolean
                          downloadUrl:
                            type:
                              - string
                              - 'null'
                            format: uri
                        type: object
                      status:
                        example: 200
                    type: object
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
      security:
        - ApiToken: []
      x-legacy-operation-id: 4764db15ddef6a4872e93d7a1fec0c50
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
