openapi: 3.0.1
info:
  title: SCA EUDR API
  description: An API for retrieving EUDR DDS Reference and Verification numbers for
    SCA Products.
  contact:
    name: SCA API Support
    url: https://www.sca.com/sv/hallbarhet/eudr-och-sca/
    email: servicedesk.fp@sca.com
  version: "1.0"
security:
  - api-key: []
paths:
  /api/eudrreferences:
    post:
      tags:
      - EUDR References
      summary: Retrieve EUDR DDS Reference and Verification numbers.
      description: "Returns the EUDR DDS Reference and verification numbers, searching\
        \ for specified package IDs or IFRA barcodes"
      operationId: getEudrReferences
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetEudrDdsReferencesRequest"
        required: true
      responses:
        "200":
          description: Successful operation with EUDR Reference and Verification numbers
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PackageIdAndEudrDdsReferences"
        "400":
          description: Bad Request due to invalid or missing parameters
          content:
            '*/*':
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "401":
          description: Unauthorized access due to invalid Basic Auth credentials
          content:
            '*/*':
              schema:
                $ref: "#/components/schemas/Problem"
        "404":
          description: Package ID not found
          content:
            '*/*':
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: "#/components/schemas/Problem"
components:
  schemas:
    Problem:
      type: object
      properties:
        title:
          type: string
        status:
          $ref: "#/components/schemas/StatusType"
        detail:
          type: string
        instance:
          type: string
          format: uri
        type:
          type: string
          format: uri
    StatusType:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        reasonPhrase:
          type: string
    ConstraintViolationProblem:
      type: object
      properties:
        cause:
          $ref: "#/components/schemas/ThrowableProblem"
        type:
          type: string
          format: uri
        status:
          $ref: "#/components/schemas/StatusType"
        violations:
          type: array
          items:
            $ref: "#/components/schemas/Violation"
        title:
          type: string
        message:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        localizedMessage:
          type: string
    ThrowableProblem:
      type: object
      properties:
        cause:
          $ref: "#/components/schemas/ThrowableProblem"
        message:
          type: string
        title:
          type: string
        status:
          $ref: "#/components/schemas/StatusType"
        detail:
          type: string
        instance:
          type: string
          format: uri
        type:
          type: string
          format: uri
        localizedMessage:
          type: string
    Violation:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
    GetEudrDdsReferencesRequest:
      required:
      - packageIds
      type: object
      properties:
        packageIds:
          minItems: 1
          type: array
          description: "A list of unique package (i.e. paper reel, pulp bale unit,\
            \ wood package etc.) identifiers OR IFRA barcodes"
          items:
            type: string
            description: "A list of unique package (i.e. paper reel, pulp bale unit,\
              \ wood package etc.) identifiers OR IFRA barcodes"
      description: Request for getting EUDR DDS references
    PackageIdAndEudrDdsReferences:
      type: object
      properties:
        packageId:
          type: string
          description: The package identifier
        ifraBarcode:
          type: string
          description: The IFRA barcode
          nullable: true
        ddsReferenceNumber:
          type: string
          description: The EUDR DDS reference number
          nullable: true
        ddsVerificationNumber:
          type: string
          description: The EUDR DDS verification number
          nullable: true
      description: EUDR DDS references response
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-KEY 