---
openapi: 3.0.3
info:
  title: Algorep APP-API Production
  version: 1.0.32
  description: Algorep APP API
servers:
- url: https://b6l4r8pq7c.execute-api.eu-west-3.amazonaws.com/
paths:
  "/eco-products/{EcoProductExternalId}/eco-contributions":
    get:
      tags:
      - EcoContribution
      summary: Fetch Eco Product Details With Matching Eco Contributions
      parameters:
      - "$ref": "#/components/parameters/EcoProductExternalId"
      - "$ref": "#/components/parameters/EprCountryCode"
      - "$ref": "#/components/parameters/DeclarationPeriodCode"
      - "$ref": "#/components/parameters/ProducerNrnRequestAuthor"
      - "$ref": "#/components/parameters/ExternalIdType"
      - name: Title
        in: query
        schema:
          type: string
      - name: Description
        in: query
        schema:
          type: string
      - name: ImageUrl
        in: query
        schema:
          type: string
      - name: Weight
        in: query
        schema:
          type: number
      responses:
        '200':
          description: Response with product details or status information
          content:
            application/json:
              schema:
                oneOf:
                - "$ref": "#/components/responses/EcoProductResponse/content/application~1json/schema"
                - type: object
                  description: Insufficient credits - Product not added to catalog
                  required:
                  - status
                  - message
                  - error
                  properties:
                    status:
                      type: string
                      enum:
                      - INSUFFICIENT_CREDITS
                      example: INSUFFICIENT_CREDITS
                    message:
                      type: string
                      example: Insufficient credits to add this product to catalog
                    creditsNeeded:
                      type: number
                      example: 1
                    nbCreditsMissing:
                      type: number
                      example: 1
                    error:
                      type: 'null'
        '400':
          "$ref": "#/components/responses/ErrorResponse"
        '500':
          "$ref": "#/components/responses/ErrorResponse"
      x-amazon-apigateway-integration:
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_r_eco-products-get_production/invocations
        connectionType: INTERNET
  "/producers/{ProducerNrn}/eco-products":
    get:
      tags:
      - Producer EcoProducts
      summary: Fetch Eco Product Details For Given Producer
      parameters:
      - "$ref": "#/components/parameters/ProducerNrn"
      - "$ref": "#/components/parameters/DeclarationPeriodCode"
      - "$ref": "#/components/parameters/EprCountryCode"
      - "$ref": "#/components/parameters/SchemeCode"
      - "$ref": "#/components/parameters/Search"
      - "$ref": "#/components/parameters/Limit"
      - "$ref": "#/components/parameters/Offset"
      responses:
        '200':
          "$ref": "#/components/responses/ProducerEcoProductsResponse"
        '400':
          "$ref": "#/components/responses/ErrorResponse"
        '500':
          "$ref": "#/components/responses/ErrorResponse"
      x-amazon-apigateway-integration:
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_r_producers-eco-products-get_production/invocations
        connectionType: INTERNET
  "/producers/{ProducerNrn}/schemes":
    get:
      tags:
      - Producer Schemes
      summary: Fetch Registrations/Schemes For Given Producer
      parameters:
      - "$ref": "#/components/parameters/ProducerNrn"
      - "$ref": "#/components/parameters/DeclarationPeriodCode"
      - "$ref": "#/components/parameters/EprCountryCode"
      responses:
        '200':
          "$ref": "#/components/responses/RegistrationsResponse"
        '400':
          "$ref": "#/components/responses/ErrorResponse"
        '500':
          "$ref": "#/components/responses/ErrorResponse"
      x-amazon-apigateway-integration:
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_r_producers-schemes-get_production/invocations
        connectionType: INTERNET
  "/producers/{ProducerNrn}/credits":
    get:
      tags:
      - Producer Credits
      summary: Fetch Producer Credits Amount
      parameters:
      - "$ref": "#/components/parameters/ProducerNrn"
      responses:
        '200':
          description: Response with credit amount
          content:
            application/json:
              schema:
                type: object
                properties:
                  gravityCredits:
                    default: number
                  planName:
                    type: string
                  planFrequency:
                    type: string
                  planCredits:
                    type: number
        '400':
          "$ref": "#/components/responses/ErrorResponse"
        '500':
          "$ref": "#/components/responses/ErrorResponse"
      x-amazon-apigateway-integration:
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_r_producers-credits-get_production/invocations
        connectionType: INTERNET
  "/producers/{ProducerNrn}/eco-contributions":
    get:
      tags:
      - Producer Eco Contributions
      summary: Fetch Producer Eco Contributions
      parameters:
      - "$ref": "#/components/parameters/ProducerNrn"
      - "$ref": "#/components/parameters/EprCountryCode"
      - "$ref": "#/components/parameters/DeclarationPeriodCode"
      - "$ref": "#/components/parameters/Option"
      responses:
        '200':
          "$ref": "#/components/responses/ProducerEcoContributionsResponse"
        '400':
          "$ref": "#/components/responses/ErrorResponse"
        '500':
          "$ref": "#/components/responses/ErrorResponse"
      x-amazon-apigateway-integration:
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_r_producers-eco-contributions-get_production/invocations
        connectionType: INTERNET
  "/producers/{ProducerNrn}/declarations/quantities":
    post:
      tags:
      - Producer Declarations
      summary: Update Eco-Products Quantities in Declarations
      parameters:
      - "$ref": "#/components/parameters/ProducerNrn"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - producerNrn
              - eprCountryCode
              - declarationPeriodCode
              properties:
                producerNrn:
                  type: string
                  example: '98181160700010'
                eprCountryCode:
                  type: string
                  example: FR
                declarationPeriodCode:
                  type: string
                  example: '2025'
                codePeriod:
                  type: string
                  example: JAN
                products:
                  type: array
                  items:
                    type: object
                    required:
                    - ecoProductReference
                    - quantity
                    properties:
                      ecoProductReference:
                        type: string
                        example: '4008496556267'
                      quantity:
                        type: number
                        example: 300
                      codeVendor:
                        type: string
                        nullable: true
                        example: AMAZ
      responses:
        '200':
          description: Updated Quantities
          content:
            application/json:
              schema:
                type: object
                required:
                - status
                - creditsNeeded
                properties:
                  status:
                    type: string
                    example: OK
                  creditsNeeded:
                    type: number
                    example: 3
        '402':
          description: Operation status
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                    example: Insufficient credits
                  creditsNeeded:
                    type: number
                    example: 42
                  creditsMissing:
                    type: number
                    example: 10
        '400':
          "$ref": "#/components/responses/ErrorResponse"
        '500':
          "$ref": "#/components/responses/ErrorResponse"
      x-amazon-apigateway-integration:
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_r_producers-declarations-quantities-post_production/invocations
        connectionType: INTERNET
  "/producers/{ProducerNrn}/declarations/eco-contributions":
    get:
      tags:
      - Producer Declarations
      summary: Get Eco-Contributions for Producer Declarations
      description: Retrieve all eco-contributions for a producer's declaration, including
        quantities and calculated contributions (quantity × price). The itemWeight
        field is returned for information only.
      parameters:
      - "$ref": "#/components/parameters/ProducerNrn"
      - "$ref": "#/components/parameters/EprCountryCode"
      - "$ref": "#/components/parameters/DeclarationPeriodCode"
      - name: CodePeriod
        in: query
        required: false
        schema:
          type: string
          example: SEP
        description: Optional period code to filter results (e.g., JAN, SEP)
      - name: CodeVendor
        in: query
        required: false
        schema:
          type: string
          example: AMAZ
        description: Optional vendor code to filter results (e.g., AMAZ, CDIS)
      responses:
        '200':
          description: Eco-contributions retrieved successfully
          content:
            application/json:
              schema:
                type: object
                required:
                - status
                - count
                - data
                properties:
                  status:
                    type: string
                    example: OK
                  count:
                    type: number
                    example: 18
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        producerNrn:
                          type: string
                          example: '98181160700010'
                        eprCountryCode:
                          type: string
                          example: FR
                        declarationPeriodCode:
                          type: string
                          example: '2025'
                        codePeriod:
                          type: string
                          nullable: true
                          example: SEP
                        codeVendor:
                          type: string
                          nullable: true
                          example: AMAZ
                        schemeCode:
                          type: string
                          example: BAT
                        ecoOrganismName:
                          type: string
                          example: BATRIBOX
                        scaleCode:
                          type: string
                          example: BP-BAT-LIT
                        ecoProductReference:
                          type: string
                          example: B07R59DMQR
                        quantity:
                          type: number
                          example: 200
                        itemWeight:
                          type: string
                          nullable: true
                          example: '0.5'
                          description: Weight in KG extracted from product metadata.
                            Used for weight-based pricing.
                        price:
                          type: number
                          example: 2.561
                        priceUnit:
                          type: string
                          example: Poids (KG)
                          description: If 'Poids (KG)', contribution = quantity ×
                            price × itemWeight. Otherwise, contribution = quantity
                            × price.
                        ecoContribution:
                          type: number
                          example: 512.2
                          description: 'Calculated as: quantity × price (rounded to
                            2 decimals)'
        '400':
          description: Bad request - Missing required parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: 'Missing required parameters: producerNrn, eprCountryCode,
                      declarationPeriodCode'
        '500':
          "$ref": "#/components/responses/ErrorResponse"
      x-amazon-apigateway-integration:
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_r_producers-declarations-eco-cont-get_production/invocations
        connectionType: INTERNET
components:
  schemas:
    ProducerUpsertPayload:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the Producer. It can be null if the Producer
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        originBubbleId:
          type: string
          description: Origin unique ID from Bubble. It can be null if the Origin
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        originId:
          type: string
          description: Origin unique UUID from database
          example: a490126c-51b7-4ee0-916a-9b15757cc8ff
        nrn:
          type: string
          description: Producer unique nrn
          example: '78965413'
        vat:
          type: string
          description: Producer unique vat number
          example: FR9798787
        companyName:
          type: string
          description: Name of the company
          example: LVMH UNLIMITED
        companyAddress:
          type: string
          description: Address of the company
          example: 42 MONEY STREET
        companyAddressComplement:
          type: string
          example: RIGHT CORNER
        companyCity:
          type: string
          example: PARIS
        companyZipCode:
          type: string
          example: '75019'
        companyCountryBubbleId:
          type: string
          description: Country unique ID from Bubble. It can be null if the Country
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        companyCountryId:
          type: string
          description: Database UUID of the country
          example: 50658c1e-356e-4407-b120-d110552292d8
        shareCapital:
          type: string
          example: 2500 EUR
        sectorCode:
          type: string
          example: 6420Z
        legalStatus:
          type: string
          example: Société par actions simplifiée
        incorporationCertificateFile:
          type: string
          description: URL of incorporation certificate
          example: https://url-to-file
        poaSignedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        poaFile:
          type: string
          example: https://url-to-file
        poaSignedFile:
          type: string
          example: https://url-to-file
        signatureUserBubbleId:
          type: string
          description: Bubble unique ID of the user that signed the document
          example: 1708861331497x933611102973227500
        algoliaId:
          type: string
          example: '4545454'
        planFrequency:
          type: string
          example: Yearly
        planName:
          type: string
          example: Serenity
        onboardingStep:
          type: string
          example: 5 - onboardingCompleted
        offerEndAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        originFees:
          type: number
          example: 42
        originPaidAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        originReportedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        status:
          type: string
          example: Activated
        terminatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        tryEndAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        isLegalVerified:
          type: boolean
          example: true
        isWelcomeEmailSent:
          type: boolean
          example: true
        stripeCancelAtEnd:
          type: boolean
          example: false
        stripeCustomerId:
          type: string
          example: SomeId
        stripeSubscriptionId:
          type: string
          example: SomeId
        stripePaiementMethodId:
          type: string
          example: SomeId
        youSignSignatureLink:
          type: string
          example: https://some-url
        youSignSignatureRequestId:
          type: string
          example: SomeId
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    Producer:
      allOf:
      - type: object
        properties:
          id:
            type: string
            description: Database UUID of the Producer
            example: 50658c1e-356e-4407-b120-d110552292d8
      - "$ref": "#/components/schemas/ProducerUpsertPayload"
    SellerUpsertPayload:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the Seller
          example: 1708861331497x933611102973227500
        companyName:
          type: string
          example: Coca-Cola
        nrn:
          type: string
          example: '45649879465'
        vat:
          type: string
          example: FR95645645678
        companyAddress:
          type: string
          example: 42 RUE VICTOR HUGO
        companyLogo:
          type: string
          example: https://my-url
        superAdminEmail:
          type: string
          example: super-admin@email.com
        superAdminMobilePhone:
          type: string
          example: '0609921214'
        superAdminFirstName:
          type: string
          example: Nicolas
        superAdminLastName:
          type: string
          example: Delalande
        registrationFeesId:
          type: string
        declarationBasicFeesId:
          type: string
        declarationPremiumFeesId:
          type: string
        connectAlgorepId:
          type: string
        commissionPercentage:
          type: string
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    Seller:
      allOf:
      - type: object
        properties:
          id:
            type: string
            description: Database UUID of the Seller
            example: 50658c1e-356e-4407-b120-d110552292d8
      - "$ref": "#/components/schemas/SellerUpsertPayload"
    OriginUpsertPayload:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the Origin. It can be null if the Origin
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        sellerBubbleId:
          type: string
          description: Bubble unique ID of the Seller. It can be null if the Seller
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        sellerId:
          type: string
          example: 50658c1e-356e-4407-b120-d110552292d8
        type:
          type: string
          example: Distributor
        code:
          type: string
          example: C24O22M24
        logo:
          type: string
          example: https://url-to-logo
        companyName:
          type: string
          example: Coca-Cola
        companyAddress:
          type: string
          example: 54 RUE Voltaire
        companyAddressComplement:
          type: string
          example: Bat A, Appt 124
        companyCity:
          type: string
          example: Montpellier
        companyZipCode:
          type: string
          example: '34000'
        companyCountry:
          type: string
          example: France
        companyCountryId:
          type: string
          description: Database UUID of the country
          example: 50658c1e-356e-4407-b120-d110552292d8
        brandName:
          type: string
          example: Coca-Cola Zero
        welcomeEN:
          type: string
          example: Welcome To Coca Cola
        welcomeFR:
          type: string
          example: Welcome To Coca Cola
        referralFeesPercentage:
          type: number
          example: 20
        creditsDiscountedPrice:
          type: number
          example: 1.56
        contact:
          type: string
          example: https://my-contract.com
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    Origin:
      allOf:
      - type: object
        properties:
          id:
            type: string
            description: Database UUID of the Origin
            example: 50658c1e-356e-4407-b120-d110552292d8
      - "$ref": "#/components/schemas/OriginUpsertPayload"
    UserUpsertPayload:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the User. It can be null if the User was
            not created on Bubble at first.
          example: 1708861331497x933611102973227500
        isMailConfirmed:
          type: boolean
          example: true
        language:
          type: string
          example: Français
        lastConnexion:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        email:
          type: string
          example: algorep@algorep.ai
        mobilePhone:
          type: string
          example: '0609921214'
        producerBubbleId:
          type: string
          description: Bubble unique ID of the Producer. It can be null if the Producer
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        producerId:
          type: string
          description: Database UUID of the Producer
          example: 50658c1e-356e-4407-b120-d110552292d8
        sellerBubbleId:
          type: string
          description: Bubble unique ID of the Seller. It can be null if the Seller
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        sellerId:
          type: string
          description: Database UUID of the Seller
          example: 50658c1e-356e-4407-b120-d110552292d8
        originBubbleId:
          type: string
          description: Bubble unique ID of the Origin. It can be null if the Origin
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        originId:
          type: string
          description: Database UUID of the Origin
          example: 50658c1e-356e-4407-b120-d110552292d8
        lastName:
          type: string
          example: Macron
        firstName:
          type: string
          example: Emmanuel
        status:
          type: string
          example: 3 - ACTIF
        role:
          type: string
          example: producerAdmin
        userSignedUp:
          type: boolean
          example: true
        avatar:
          type: string
          example: "//15c83987ea78e6559235081e42c9135b.cdn.bubble.io/f1713427188226x475005611045967500/api"
        isAlgorep:
          type: boolean
          example: false
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    User:
      allOf:
      - type: object
        properties:
          id:
            type: string
            description: Database UUID of the User
            example: 50658c1e-356e-4407-b120-d110552292d8
      - "$ref": "#/components/schemas/UserUpsertPayload"
    RegistrationUpsertPayload:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the Registration. It can be null if the
            Registration was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        producerBubbleId:
          type: string
          description: Bubble unique ID of the Producer. It can be null if the Producer
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        producerId:
          type: string
          description: Database UUID of the Producer
          example: 50658c1e-356e-4407-b120-d110552292d8
        schemeProBubbleId:
          type: string
          description: Bubble unique ID of the SchemePro. It can be null if the SchemePro
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        schemeProId:
          type: string
          description: Database UUID of the SchemePro
          example: 50658c1e-356e-4407-b120-d110552292d8
        uin:
          type: string
          description: Uin given by ADEME or equivalent
          example: 5raeztrytegrfezrgtrhytuy
        proMemberId:
          type: string
          description: External id given by pro
          example: AGJYRTYH987
        status:
          type: string
          example: 4 - PendingPro
        schemeDepositAmount:
          type: number
          example: 42
        isExternalRegistration:
          type: boolean
          example: false
        uinReceivedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        registrationSentToProAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    Registration:
      allOf:
      - type: object
        properties:
          id:
            type: string
            description: Database UUID of the Registration
            example: 50658c1e-356e-4407-b120-d110552292d8
      - "$ref": "#/components/schemas/RegistrationUpsertPayload"
      - type: object
        properties:
          schemePro:
            allOf:
            - "$ref": "#/components/schemas/SchemePro"
            - nullable: true
      - type: object
        properties:
          countProductsScheme:
            type: number
            nullable: true
            description: Number of Products for this Registration/Scheme
            example: 72
          totalQuantityScheme:
            type: number
            nullable: true
            description: Quantity of products for this Registration/Scheme
            example: 654
          totalAmountScheme:
            type: number
            nullable: true
            description: Amount estimated or paid for this Registration/Scheme
            example: 72522.45
          producerPaidAt:
            type: string
            nullable: true
            description: Date at which producer paid for this declaration
            example: '2024-01-19T12:45:04.147Z'
    Summary:
      type: object
      properties:
        countTotalRegistrations:
          type: number
          nullable: true
          description: Number of registrations, with or without UINs
          example: 42
        countRegistrationWithUin:
          type: number
          nullable: true
          description: Number of registrations with UINs only
          example: 4
        countTotalProducts:
          type: number
          nullable: true
          description: Total number of products in the producer catalog
          example: 5642
        totalQuantity:
          type: number
          nullable: true
          description: Total number of products quantities in the producer catalog
          example: 898756
        totalEcoContributionAmount:
          type: number
          nullable: true
          description: Total amount of eco-contribution to date. Can be null or a
            validated amount.
          example: 1222.54
        declarationDeadline:
          type: string
          nullable: true
          description: Deadline to do declaration
          example: '2024-01-19T12:45:04.147Z'
        declarationCompletedAt:
          type: string
          nullable: true
          description: Date at which declaration was completed. Null or undefined
            if not completed.
          example: '2024-01-19T12:45:04.147Z'
        registrations:
          type: array
          items:
            "$ref": "#/components/schemas/Registration"
    SchemeProUpsertPayload:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the SchemePro. It can be null if the SchemePro
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        ecoOrganismName:
          type: string
          example: LEKO
        eprCountryCode:
          type: string
          example: FR
        schemeCode:
          type: string
          example: EMPAP
        ademeSchemeCode:
          type: string
          example: PCHIM
        currencyDeposit:
          type: string
          example: "€"
        declarationFrequency:
          type: string
          example: Annuel
        proAddress:
          type: string
          example: 14, Boulevard de la Chapelle
        proCity:
          type: string
          example: Paris
        proZipCode:
          type: string
          example: '75018'
        proCountryBubbleId:
          type: string
          example: 1699973781289x474882884422860800
        proCountryId:
          type: string
          example: a3bf6503-426b-43da-a2ac-37f8d8305a78
        proLogo:
          type: string
          example: https://my-logo
        registrationDeposit:
          type: number
          example: 77
        schemeNameEn:
          type: string
          example: Clothing textiles, household linens and shoes
        schemeNameFr:
          type: string
          example: Textiles d'habillement, Linge de maison et Chaussures
        schemePartner:
          type: boolean
          example: true
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    SchemePro:
      allOf:
      - type: object
        properties:
          id:
            type: string
            description: Database UUID of the SchemePro
            example: 50658c1e-356e-4407-b120-d110552292d8
      - "$ref": "#/components/schemas/SchemeProUpsertPayload"
      - type: object
        properties:
          countProductsScheme:
            type: number
            nullable: true
            description: Number of Products for this Scheme if any
            example: 72
      - type: object
        properties:
          country:
            allOf:
            - "$ref": "#/components/schemas/Country"
            - nullable: true
      - type: object
        properties:
          seller:
            "$ref": "#/components/schemas/Seller"
      - type: object
        properties:
          sellerStripeConfig:
            "$ref": "#/components/schemas/SellerSchemeProStripeConfig"
    SellerSchemeProStripeConfig:
      type: object
      properties:
        id:
          type: string
          description: Database UUID of the SellerSchemeProStripeConfig
          example: 50658c1e-356e-4407-b120-d110552292d8
        sellerId:
          type: string
          description: Database UUID of the Seller
          example: 50658c1e-356e-4407-b120-d110552292d8
        schemeProId:
          type: string
          description: Database UUID of the SchemePro
          example: 50658c1e-356e-4407-b120-d110552292d8
        depositPriceId:
          type: string
          example: some-id
        ecoContributionPriceId:
          type: string
          example: some-id
        connectId:
          type: string
          example: some-id
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    DeclarationPeriodUpsertPayload:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the DeclarationPeriod. It can be null if
            the DeclarationPeriod was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        declarationCode:
          type: string
          example: '2023'
        periodeStartAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        periodeEndAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        isActive:
          type: boolean
          example: true
        eprCountryBubbleId:
          type: string
          example: 1699973781289x474882884422860800
        eprCountryId:
          type: string
          example: a3bf6503-426b-43da-a2ac-37f8d8305a78
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    DeclarationPeriod:
      allOf:
      - type: object
        properties:
          id:
            type: string
            description: Database UUID of the DeclarationPeriod
            example: 50658c1e-356e-4407-b120-d110552292d8
      - "$ref": "#/components/schemas/DeclarationPeriodUpsertPayload"
    Country:
      type: object
      properties:
        id:
          type: string
          description: Database UUID of the Country
          example: 50658c1e-356e-4407-b120-d110552292d8
        bubbleId:
          type: string
          description: Bubble unique ID of the Country. It can be null if the Country
            was not created on Bubble at first.
          example: 1708861331497x933611102973227500
        codeIso2:
          type: string
          example: FR
        isVat:
          type: boolean
          example: true
        nameEN:
          type: string
          example: United-Kingdom
        nameFR:
          type: string
          example: Royaume-Uni
        nameZH:
          type: string
          example: 英国
        eprActivated:
          type: boolean
          example: true
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        schemePros:
          allOf:
          - "$ref": "#/components/schemas/SchemePro"
          - nullable: true
    SchemeProDeclarationPeriod:
      type: object
      properties:
        bubbleId:
          type: string
          description: Bubble unique ID of the SchemeProDeclarationPeriod. It can
            be null if the SchemeProDeclarationPeriod was not created on Bubble at
            first.
          example: 1708861331497x933611102973227500
        declarationPeriodBubbleId:
          type: string
          example: 1699973781289x474882884422860800
        declarationPeriodId:
          type: string
          example: a3bf6503-426b-43da-a2ac-37f8d8305a78
        declarationStartAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        declarationEndAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        declarationPaiementEndAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        schemeProBubbleId:
          type: string
          example: 1699973781289x474882884422860800
        schemeProId:
          type: string
          example: a3bf6503-426b-43da-a2ac-37f8d8305a78
        createdAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
        updatedAt:
          type: string
          example: '2024-01-19T12:45:04.147Z'
    EcoContribution:
      type: object
      properties:
        id:
          type: string
          example: 6b1d9468-0e7e-47ef-bb05-9b158637bf79
        ecoProductId:
          type: string
          example: 07b456f3-5b03-4987-a7df-cbfdb14f9540
        declarationPeriodCode:
          type: string
          example: '2023'
        eprCountryCode:
          type: string
          example: FR
        schemeCode:
          type: string
          example: TLC
        ecoOrganismName:
          type: string
          example: Refashion
        scaleCode:
          type: string
          example: V-30-N-EM0
        quantityUnit:
          type: string
          example: Unité de vente
        price:
          type: number
          example: 0.0124
        createdAt:
          type: string
          example: '2023-12-08T19:12:30.082+01:00'
        updatedAt:
          type: string
          example: '2023-12-08T19:12:30.082+01:00'
        schemePro:
          "$ref": "#/components/schemas/SchemePro"
    EcoProduct:
      type: object
      properties:
        id:
          type: string
          example: 1a0dde4e-151f-4eb9-a26b-6e5cf2e428c0
        externalId:
          type: string
          example: B07LGH32TM
        externalIdType:
          type: string
          example: ASIN
        title:
          type: string
          example: Nike Jordan Clc99 Snapback - Chapeau - Mixte
        description:
          type: string
          example: Tissu extensible confortable avec technologie respirant, pour une
            sensation de fraîcheur et de légèreté. La technologie dri-fit garantit
            la peau sèche, le confort et la concentration.
        imageUrl:
          type: string
          example: https://m.media-amazon.com/images/I/51eA4-lLSDL.jpg
        weight:
          type: number
          example: '42,5'
        createdAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
        updatedAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
        ecoContributions:
          type: array
          items:
            "$ref": "#/components/schemas/EcoContribution"
    ProducerEcoProductCatalogElement:
      type: object
      properties:
        id:
          type: string
          example: 1a0dde4e-151f-4eb9-a26b-6e5cf2e428c0
        ecoProductId:
          type: string
          example: 1a0dde4e-151f-4eb9-a26b-6e5cf2e428c0
        producerNrn:
          type: string
          example: '34368801600504'
        eprCountryCode:
          type: string
          example: FR
        ecoProductUrl:
          type: string
          example: https://link-to-the-product.com
        ecoProductStatus:
          type: string
          example: AI_QUALIFIED
        source:
          type: string
          description: Can be BATCH_UPLOAD, SINGLE_ADD, AMAZON, MIRAKL
          example: BATCH_UPLOAD
        createdAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
        updatedAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
    ProducerEcoProduct:
      allOf:
      - "$ref": "#/components/schemas/EcoProduct"
      - type: object
        properties:
          catalog:
            allOf:
            - "$ref": "#/components/schemas/ProducerEcoProductCatalogElement"
            - type: object
              properties:
                quantity:
                  type: number
                  example: 42
      - type: object
        properties:
          ecoContributions:
            type: array
            items:
              "$ref": "#/components/schemas/EcoContribution"
    ProducerScheme:
      type: object
      properties:
        schemeCode:
          type: string
          example: EEE
        ecoOrganismName:
          type: string
          example: Leko
        ecoProduct:
          type: array
          items:
            "$ref": "#/components/schemas/EcoProduct"
    QuantityDeclaration:
      type: object
      properties:
        id:
          type: string
          example: 1a0dde4e-151f-4eb9-a26b-6e5cf2e428c0
        producerEcoProductId:
          type: string
          example: 1a0dde4e-151f-4eb9-a26b-6e5cf2e428c0
        declarationPeriodCode:
          type: string
          example: '2023'
        quantity:
          type: number
          example: 4235
        validatedAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
        createdAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
        updatedAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
    ProducerDeclaration:
      type: object
      properties:
        id:
          type: string
          example: 1a0dde4e-151f-4eb9-a26b-6e5cf2e428c0
        ecoProductId:
          type: string
          example: 1a0dde4e-151f-4eb9-a26b-6e5cf2e428c0
        producerNrn:
          type: string
          example: 161481911005x636197106288257400
        eprCountryCode:
          type: string
          example: FR
        ecoProductUrl:
          type: string
          example: https://link-to-the-product.com
        ecoProductStatus:
          type: string
          example: AI_QUALIFIED
        createdAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
        updatedAt:
          type: string
          example: '2023-12-08T18:27:15.895Z'
        ecoProduct:
          "$ref": "#/components/schemas/EcoProduct"
        quantityDeclaration:
          "$ref": "#/components/schemas/QuantityDeclaration"
    Errors:
      oneOf:
      - default: ALGOREP_001
        type: string
        description: The server encountered an unknown error!
      - default: ALGOREP_002
        type: string
        description: Eco product could not be found
      - default: ALGOREP_003
        type: string
        description: Dgraph Failed To Process The Request
      - default: ALGOREP_004
        type: string
        description: Producer could not be found
      - default: ALGOREP_005
        type: string
        description: Bad Request
      - default: ALGOREP_006
        type: string
        description: Declaration already validated for this product
      - default: ALGOREP_007
        type: string
        description: 'Producer Batch Process Failed: Invalid ContentType, Request
          Should Be Multipart/FormData.'
      - default: ALGOREP_008
        type: string
        description: No file found on request
      - default: ALGOREP_009
        type: string
        description: Too many files found on request
      - default: ALGOREP_010
        type: string
        description: 'Qualification Pipeline Failed: ExternalId Not Found'
      - default: ALGOREP_011
        type: string
        description: 'Qualification Pipeline Failed: ExternalIdType Not Found / Could
          Not Be Determined'
      - default: ALGOREP_012
        type: string
        description: 'Qualification Pipeline Failed: ProducerNrn Not Found'
      - default: ALGOREP_013
        type: string
        description: 'Qualification Pipeline Failed: Product ''Title'' Or ''Image''
          Could Not Be Determined, But Necessary To Compute Contributions.'
      - default: ALGOREP_014
        type: string
        description: 'Qualification Pipeline Failed: EcoFeez Could Not Determine Contributions.'
      - default: ALGOREP_015
        type: string
        description: 'Qualification Pipeline Failed: EcoFeez Could Not Determine Some
          Necessary Field.'
      - default: ALGOREP_016
        type: string
        description: 'Producer Batch Pre Process Pipeline Failed: Could Not Find CSV
          File On S3.'
      - default: ALGOREP_017
        type: string
        description: 'Producer Batch Pre Process Pipeline Failed: CSV File Contains
          Errors'
      - default: ALGOREP_018
        type: string
        description: 'Producer Batch Pre Process Pipeline Failed: Did Not Find Any
          Product To Process In CSV File'
      - default: ALGOREP_019
        type: string
        description: 'Producer Batch Pre Process Pipeline Failed: Not Enough Credit
          Balance To Process All Products'
      - default: ALGOREP_020
        type: string
        description: 'Producer Batch Pre Process Pipeline Failed: ProducerId Not Found'
      - default: ALGOREP_021
        type: string
        description: 'Producer Batch Pre Process Pipeline Failed: Unable To Insert
          Pipeline Information Into Database'
      - default: ALGOREP_022
        type: string
        description: 'Producer Batch Pre Process Pipeline Failed: Another Running
          Pipeline Already Exists For This Producer'
      - default: ALGOREP_023
        type: string
        description: 'Producer Batch Process Pipeline Failed: ProducerId Not Found'
      - default: ALGOREP_024
        type: string
        description: 'Producer Batch Process Pipeline Failed: ProductId Not Found'
      - default: ALGOREP_025
        type: string
        description: 'Producer Batch Process Pipeline Failed: EprCountryCode Not Found
          Or Empty'
      - default: ALGOREP_026
        type: string
        description: 'Producer Batch Process Pipeline Failed: DeclarationPeriodCode
          Not Found'
      - default: ALGOREP_027
        type: string
        description: 'Producer Batch Process Pipeline Failed: Too Many Records Consumed
          At Once'
      - default: ALGOREP_028
        type: string
        description: No Company Found With This NRN
  parameters:
    Limit:
      name: Limit
      description: Maximum number of items to return
      in: query
      required: false
      schema:
        type: number
        minimum: 1
        maximum: 25
      example: 25
    Offset:
      name: Offset
      description: Number of items to skip in the pagination system
      in: query
      required: false
      schema:
        type: number
        minimum: 0
      example: 0
    EcoProductExternalId:
      name: EcoProductExternalId
      description: GTIN, ASIN, SKU...
      in: path
      required: true
      schema:
        type: string
      example: B07LGH32TM
    EprCountryCodes:
      name: EprCountryCodes
      description: FR, ES, etc.
      in: query
      required: true
      schema:
        type: array
        items:
          type: string
      example:
      - FR
      - ES
    EprCountryCode:
      name: EprCountryCode
      description: FR, ES, etc.
      in: query
      required: true
      schema:
        type: string
      example: FR
    DeclarationPeriodCode:
      name: DeclarationPeriodCode
      description: 2023, 2024, etc.
      in: query
      required: true
      schema:
        type: string
      example: '2023'
    OptionalEprCountryCode:
      name: EprCountryCode
      description: FR, ES, etc.
      in: query
      required: false
      schema:
        type: string
      example: FR
    OptionalDeclarationPeriodCode:
      name: DeclarationPeriodCode
      description: 2023, 2024, etc.
      in: query
      required: false
      schema:
        type: string
      example: '2023'
    ProducerNrn:
      name: ProducerNrn
      description: Producer Unique NRN
      in: path
      required: true
      schema:
        type: string
      example: '34368801600504'
    SellerNrn:
      name: SellerNrn
      description: Seller Unique NRN
      in: path
      required: true
      schema:
        type: string
      example: '34368801600504'
    OriginCode:
      name: OriginCode
      description: Origin Unique Code
      in: path
      required: true
      schema:
        type: string
      example: FDE789
    UserBubbleId:
      name: UserBubbleId
      description: User Unique Bubble ID
      in: path
      required: true
      schema:
        type: string
      example: 1708861331497x933611102973227500
    ProducerNrnRequestAuthor:
      name: ProducerNrn
      description: Producer Unique NRN
      in: query
      required: true
      schema:
        type: string
      example: '34368801600504'
    SchemeCode:
      name: SchemeCode
      description: Scheme Code
      in: query
      required: false
      schema:
        type: string
      example: EEE
    Search:
      name: Search
      description: Perform Search In Columns (Depending Of The Table Searched)
      in: query
      required: false
      schema:
        type: string
      example: Nike Jordan
    CreditBalance:
      name: CreditBalance
      description: Credit Balance Of Producer
      in: query
      required: true
      schema:
        type: number
      example: 100
    ExternalIdType:
      name: ExternalIdType
      description: Type of externalId, can be either GTIN, ASIN or SKU
      in: query
      required: false
      schema:
        type: string
    DeclarationPeriodId:
      name: DeclarationPeriodId
      description: Database unique ID of a specific DeclarationPeriod
      in: query
      required: false
      schema:
        type: string
    SchemeProId:
      name: SchemeProId
      description: Database unique ID of a specific SchemePro
      in: query
      required: false
      schema:
        type: string
    CodeIso2:
      name: CodeIso2
      description: Code Iso 2 of the country
      in: query
      required: false
      example: FR
      schema:
        type: string
    TemplateType:
      name: TemplateType
      description: Template type for batch add to producer catalog. Chose between
        COMPLIANCR or AMAZON
      in: query
      required: false
      example: COMPLIANCR
      schema:
        type: string
  responses:
    _Meta:
      description: Meta information about response
      content:
        application/json:
          schema:
            type: object
            properties:
              limit:
                type: number
                example: 7
              offset:
                type: number
                example: 10
              search:
                type: string
                example: Nike Jordan
              total:
                type: number
                example: 42
    EcoProductResponse:
      description: Eco product details
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                "$ref": "#/components/schemas/EcoProduct"
              _meta:
                default:
    EcoContributionResponse:
      description: Eco contribution details
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                "$ref": "#/components/schemas/EcoContribution"
              _meta:
                "$ref": "#/components/responses/_Meta/content/application~1json/schema"
    EcoProductsListResponse:
      description: List of eco products
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  "$ref": "#/components/schemas/EcoProduct"
              _meta:
                "$ref": "#/components/responses/_Meta/content/application~1json/schema"
    ProducerEcoProductsResponse:
      description: List of producer eco products
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  "$ref": "#/components/schemas/ProducerEcoProduct"
              _meta:
                "$ref": "#/components/responses/_Meta/content/application~1json/schema"
    ProducerSchemesResponse:
      description: List of producer schemes
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  "$ref": "#/components/schemas/ProducerScheme"
              _meta:
                default:
    ProducerDeclarationsResponse:
      description: List of producer declarations
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  "$ref": "#/components/schemas/ProducerDeclaration"
              _meta:
                allOf:
                - "$ref": "#/components/responses/_Meta/content/application~1json/schema"
                - type: object
                  properties:
                    hasAlreadyValidated:
                      type: boolean
                      example: false
    ProducerDeclarationsSummaryResponse:
      description: List of producer declarations
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: 23a00f43-1045-439f-a581-e07eb834f61c
                    producerNrn:
                      type: string
                      example: 1705999971243x819474718191779800
                    eprCountryCode:
                      type: string
                      example: FR
                    declarationPeriodCode:
                      type: string
                      example: '2023'
                    lastDeadline:
                      type: string
                      example: '2024-06-12T17:02:32.902Z'
                    declarationCurrency:
                      type: string
                      example: EUR
                    startedAt:
                      type: string
                      example: '2024-02-12T17:02:32.902Z'
                    completedAt:
                      type: string
                      example: '2024-02-12T17:02:32.902Z'
                    createdAt:
                      type: string
                      example: '2024-02-12T17:02:32.902Z'
                    updatedAt:
                      type: string
                      example: '2024-02-12T17:02:32.902Z'
                    totalQuantity:
                      type: number
                      example: 654987654
                    totalAmount:
                      type: number
                      example: 89797465564
                    totalProductsMarketed:
                      type: number
                      example: 654
                    totalWeight:
                      type: number
                      example: 654987654
                    schemes:
                      type: array
                      items:
                        type: object
                        properties:
                          proMemberId:
                            type: string
                            example: EZRT978
                          schemeCode:
                            type: string
                            example: EMPAP
                          ecoOrganismName:
                            type: string
                            example: LEKO
                          totalQuantityScheme:
                            type: number
                            example: 45654
                          totalWeightScheme:
                            type: number
                            example: 45647897888
                          totalAmountScheme:
                            type: number
                            example: 898
                          startedAt:
                            type: string
                            example: '2024-02-12T17:02:32.902Z'
                          completedAt:
                            type: string
                            example: '2024-02-12T17:02:32.902Z'
                          producerPaidAt:
                            type: string
                            example: '2024-02-12T17:02:32.902Z'
                          transferedProAt:
                            type: string
                            example: '2024-02-12T17:02:32.902Z'
                          invoiceProReceivedAt:
                            type: string
                            example: '2024-02-12T17:02:32.902Z'
                          paidProAt:
                            type: string
                            example: '2024-02-12T17:02:32.902Z'
                          transferedProFile:
                            type: string
                            example: path/to/file/on/s3.xlsx
                          deadline:
                            type: string
                            example: '2024-02-12T17:02:32.902Z'
              _meta:
                type: object
                default:
    ProducersResponse:
      description: Producers
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/Producer"
    ProducerResponse:
      description: Producer
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/Producer"
    SellersResponse:
      description: Sellers
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/Seller"
    SellerResponse:
      description: Sellers
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/Seller"
    OriginsResponse:
      description: Origins
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/Origin"
    OriginResponse:
      description: Origins
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/Seller"
    UsersResponse:
      description: Users
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/User"
    UserResponse:
      description: User
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/User"
    RegistrationsResponse:
      description: Registrations
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/Registration"
    SchemeProsResponse:
      description: SchemePros
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/SchemePro"
    DeclarationPeriodsReponse:
      description: DeclarationPeriods
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/DeclarationPeriod"
    SchemeProsDeclarationPeriodsReponse:
      description: SchemeProsDeclarationPeriods
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/SchemeProDeclarationPeriod"
    CountriesResponse:
      description: Countries
      content:
        application/json:
          schema:
            type: array
            items:
              "$ref": "#/components/schemas/Country"
    SummaryResponse:
      description: Producer Summary
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/Summary"
    ErrorResponse:
      description: An error happenned during the request, refer to error code for
        more information
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                "$ref": "#/components/schemas/Errors"
  securitySchemes:
    AppApiAuthorizer:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authorizer:
        identitySource: "$request.header.Authorization"
        authorizerUri: arn:aws:apigateway:eu-west-3:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-3:665101765878:function:agp-apis_app_p_has-valid-jwt_production/invocations
        authorizerCredentials: arn:aws:iam::665101765878:role/algorep-apis_app_p_has-valid-jwt_InvokeRole
        authorizerPayloadFormatVersion: '2.0'
        authorizerResultTtlInSeconds: '3600'
        type: request
        enableSimpleResponses: true
security:
- AppApiAuthorizer: []
x-amazon-apigateway-importexport-version: '1.0'
