openapi: 3.0.3
info:
  title: Interface API Gamma Refonte
  description: Interface API Gamma Refonte
  version: 1.0.0
  contact:
    name: DGDDI - Douane Française
    url: https://www.douane.gouv.fr/

paths:
  # Chemin facultatif
  /1006:
    post:
      summary: Définition d'un message 1006
      operationId: message1006
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType1006'
      parameters:
        - $ref: '../api/headerHttp.yaml#/components/parameters/messageId'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '../api/retourHttp.yaml#/components/schemas/retour200'

components:
  schemas:
    BodyType1006:
      type: object
      properties:
        SubmittedDraftOfEad1006:
          $ref: '#/components/schemas/SubmittedDraftOfEadType1006'
      required:
        - SubmittedDraftOfEad1006

    SubmittedDraftOfEadType1006:
      type: object
      properties:
        Attributes:
          $ref: '#/components/schemas/AttributesType1006'
        ConsigneeTrader:
          $ref: '#/components/schemas/ConsigneeTraderType1006'
        ExciseMovementEad:
          $ref: '#/components/schemas/ExciseMovementEadType1006'
        PlaceOfDispatchTrader:
          $ref: '#/components/schemas/PlaceOfDispatchTraderType1006'
        DispatchImportOffice:
          $ref: '#/components/schemas/DispatchImportOfficeType1006'
        ComplementConsigneeTrader:
          $ref: '#/components/schemas/ComplementConsigneeTraderType1006'
        DeliveryPlaceTrader:
          $ref: '#/components/schemas/DeliveryPlaceTraderType1006'
        TransportArrangerTrader:
          $ref: '#/components/schemas/TransportArrangerTraderType1006'
        FirstTransporterTrader:
          $ref: '#/components/schemas/FirstTransporterTraderType1006'
        TransportDetails:
          type: array
          maxItems: 999
          items:
            $ref: '#/components/schemas/TransportDetailsType1006'
        Ead:
          $ref: '#/components/schemas/EadType1006'
        HeaderEad:
          $ref: '#/components/schemas/HeaderEadType1006'
        TransportMode:
          $ref: '#/components/schemas/TransportModeType1006'
        MovementGuarantee:
          $ref: '#/components/schemas/MovementGuaranteeType1006'
        BodyEad:
          type: array
          maxItems: 999
          items:
            $ref: '#/components/schemas/BodyEadType1006'
      required:
        - Attributes
        - ExciseMovementEadType
        - Ead
        - HeaderEad
        - MovementGuarantee
        - BodyEad

    AttributesType1006:
      type: object
      properties:
        SubmissionMessageType:
          $ref: '../ie/tcl.yaml#/components/schemas/SubmissionType'
        DeferredSubmissionFlag:
          $ref: '../ie/tcl.yaml#/components/schemas/Flag'
      required:
        - SubmissionMessageType
        - DeferredSubmissionFlag


    ConsigneeTraderType1006:
      type: object
      description: |
        | Nom de l'élément | Référentiels  | Règles      | Conditions |
        |------------------|---------------|-------------|------------|
        | Traderid         |               | R045 / M202 | NA         |
        | TraderName       |               | NA          | NA         |
        | StreetName       |               | NA          | NA         |
        | StreetNumber     |               | NA          | NA         |
        | Postcode         |               | NA          | NA         |
        | City             |               | NA          | NA         |
        | Pays             |               | R006N       | NA         |
        | EoriNumber       |               |             | IC_RG_C180 |
      properties:
        Traderid:
          $ref: '../ie/types.yaml#/components/schemas/TraderidType'
        TraderName:
          $ref: '../ie/types.yaml#/components/schemas/TraderNameType'
        StreetName:
          $ref: '../ie/types.yaml#/components/schemas/StreetNameType'
        StreetNumber:
          $ref: '../ie/types.yaml#/components/schemas/StreetNumberType'
        Postcode:
          $ref: '../ie/types.yaml#/components/schemas/PostcodeType'
        City:
          $ref: '../ie/types.yaml#/components/schemas/CityType'
        EoriNumber:
          $ref: '../ie/types.yaml#/components/schemas/EoriNumberType'
      required:
        - TraderName
        - StreetName
        - Postcode
        - City

    ExciseMovementEadType1006:
      type: object
      description: |
        | Nom de l'élément                 | Référentiels | Règles | Conditions |
        |----------------------------------|--------------|--------|------------|
        | AdministrativeReferenceCode      |              | R030   | NA         |
      properties:
        AdministrativeReferenceCode:
          $ref: '../ie/types.yaml#/components/schemas/AdministrativeReferenceCodeType'
      required:
        - AdministrativeReferenceCode

    PlaceOfDispatchTraderType1006:
      type: object
      description: |
        | Nom de l'élément        | Référentiels | Règles | Conditions |
        |-------------------------|--------------|--------|------------|
        | ReferenceOfTaxWarehouse |              | R044N  | NA         |
        | TraderName              |              | NA     | NA         |
        | StreetName              |              | NA     | NA         |
        | StreetNumber            |              | NA     | NA         |
        | Postcode                |              | NA     | NA         |
        | City                    |              | NA     | NA         |
      properties:
        ReferenceOfTaxWarehouse:
          $ref: '#/components/schemas/ReferenceOfTaxWarehouseType1006'
        TraderName:
          $ref: '../ie/types.yaml#/components/schemas/TraderNameType'
        StreetName:
          $ref: '../ie/types.yaml#/components/schemas/StreetNameType'
        StreetNumber:
          $ref: '../ie/types.yaml#/components/schemas/StreetNumberType'
        Postcode:
          $ref: '../ie/types.yaml#/components/schemas/PostcodeType'
        City:
          $ref: '../ie/types.yaml#/components/schemas/CityType'

    DispatchImportOfficeType1006:
      type: object
      description: |
        | Nom de l'élément | Référentiels | Règles | Conditions |
        |------------------|--------------|--------|------------|
        | ReferenceNumber  |              | R032   | NA         |
      properties:
        ReferenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/ExciseOfficeCodeType'
      required:
        - ReferenceNumber

    ComplementConsigneeTraderType1006:
      type: object
      description: |
        | Nom de l'élément                     | Référentiels | Règles | Conditions |
        |--------------------------------------|--------------|--------|------------|
        | MemberStateCode                      |              | R017   | NA         |
        | SerialNumberOfCertificateOfExemption |              | NA     | NA         |
        | DateNAttConsign                      |              | NA     | NA         |
      properties:
        MemberStateCode:
          $ref: '../ie/types.yaml#/components/schemas/MemberStateCodeType'
        SerialNumberOfCertificateOfExemption:
          $ref: '../ie/types.yaml#/components/schemas/SerialNumberOfCertificateOfExemptionType'
        DateNAttConsign:
          $ref: '../ie/types.yaml#/components/schemas/DateType'
      required:
        - MemberStateCode

    DeliveryPlaceTraderType1006:
      type: object
      description: |
        | Nom de l'élément | Référentiels  | Règles     | Conditions |
        |------------------|---------------|------------|------------|
        | TraderId         |               | R045       | C074       |
        | TraderName       |               | NA         | C079       |
        | StreetName       |               | NA         | C078       |
        | StreetNumber     |               | NA         | NA         |
        | Postcode         |               | NA         | C078       |
        | City             |               | NA         | C078       |
      properties:
        Traderid:
          $ref: '../ie/types.yaml#/components/schemas/TraderidType'
        TraderName:
          $ref: '../ie/types.yaml#/components/schemas/TraderNameType'
        StreetName:
          $ref: '../ie/types.yaml#/components/schemas/StreetNameType'
        StreetNumber:
          $ref: '../ie/types.yaml#/components/schemas/StreetNumberType'
        Postcode:
          $ref: '../ie/types.yaml#/components/schemas/PostcodeType'
        City:
          $ref: '../ie/types.yaml#/components/schemas/CityType'

    TransportArrangerTraderType1006:
      type: object
      description: |
        | Nom de l'élément | Référentiels  | Règles     | Conditions |
        |------------------|---------------|------------|------------|
        | VatNumber        |               | NA         | NA         |
        | TraderName       |               | NA         | NA         |
        | StreetName       |               | NA         | NA         |
        | StreetNumber     |               | NA         | NA         |
        | Postcode         |               | NA         | NA         |
        | City             |               | NA         | NA         |
      properties:
        VatNumber:
          $ref: '../ie/types.yaml#/components/schemas/VatNumberType'
        TraderName:
          $ref: '../ie/types.yaml#/components/schemas/TraderNameType'
        StreetName:
          $ref: '../ie/types.yaml#/components/schemas/StreetNameType'
        StreetNumber:
          $ref: '../ie/types.yaml#/components/schemas/StreetNumberType'
        Postcode:
          $ref: '../ie/types.yaml#/components/schemas/PostcodeType'
        City:
          $ref: '../ie/types.yaml#/components/schemas/CityType'
      required:
        - TraderName
        - StreetName
        - Postcode
        - City

    FirstTransporterTraderType1006:
      type: object
      description: |
        | Nom de l'élément | Référentiels  | Règles     | Conditions |
        |------------------|---------------|------------|------------|
        | VatNumber        |               | NA         | NA         |
        | TraderName       |               | NA         | NA         |
        | StreetAndNumber  |               | NA         | NA         |
        | StreetNumber     |               | NA         | NA         |
        | Postcode         |               | NA         | NA         |
        | City             |               | NA         | NA         |
      properties:
        VatNumber:
          $ref: '../ie/types.yaml#/components/schemas/VatNumberType'
        TraderName:
          $ref: '../ie/types.yaml#/components/schemas/TraderNameType'
        StreetName:
          $ref: '../ie/types.yaml#/components/schemas/StreetNameType'
        StreetNumber:
          $ref: '../ie/types.yaml#/components/schemas/StreetNumberType'
        Postcode:
          $ref: '../ie/types.yaml#/components/schemas/PostcodeType'
        City:
          $ref: '../ie/types.yaml#/components/schemas/CityType'
      required:
        - TraderName
        - StreetName
        - Postcode
        - City

    TransportDetailsType1006:
      type: object
      description: |
        | Nom de l'élément             | Référentiels  | Règles | Conditions |
        |------------------------------|---------------|--------|------------|
        | TransportUnitCode            |               | R057   | NA         |
        | IdentityOfTransportUnits     |               | NA     | C156       |
        | CommercialSealIdentification |               | NA     | NA         |
        | ComplementaryInformation     |               | NA     | NA         |
        | SealInformation              |               | NA     | NA         |
      properties:
        TransportUnitCode:
          $ref: '../ie/types.yaml#/components/schemas/TransportUnitCodeType'
        IdentityOfTransportUnits:
          $ref: '../ie/types.yaml#/components/schemas/IdentityOfTransportUnitsType'
        CommercialSealIdentification:
          $ref: '../ie/types.yaml#/components/schemas/CommercialSealIdentificationType'
        ComplementaryInformation:
          $ref: '#/components/schemas/LSDComplementaryInformationType1006'
        SealInformation:
          $ref: '#/components/schemas/LSDSealInformationType1006'
      required:
        - TransportUnitCode

    EadType1006:
      type: object
      description: |
        | Nom de l'élément     | Référentiels | Règles | Conditions |
        |----------------------|--------------|--------|------------|
        | LocalReferenceNumber |              | BR001  | NA         |
        | InvoiceNumber        |              | NA     | NA         |
        | InvoiceDate          |              | NA     | NA         |
        | OriginTypeCode       |              | R047   | NA         |
        | DateOfDispatch       |              | NA     | NA         |
        | TimeOfDispatch       |              | NA     | NA         |
        | ImportSad            |              | NA     | NA         |
      properties:
        LocalReferenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/LocalReferenceNumberType'
        InvoiceNumber:
          $ref: '../ie/types.yaml#/components/schemas/InvoiceNumberType'
        InvoiceDate:
          $ref: '../ie/types.yaml#/components/schemas/DateType'
        OriginTypeCode:
          $ref: '../ie/tcl.yaml#/components/schemas/OriginTypeCode'
        DateOfDispatch:
          $ref: '../ie/types.yaml#/components/schemas/DateType'
        TimeOfDispatch:
          $ref: '../ie/types.yaml#/components/schemas/TimeType'
        ImportSad:
          type: array
          maxItems: 9
          items:
            $ref: '#/components/schemas/ImportSadTypeType1006'
      required:
        - OriginTypeCode

    ImportSadTypeType1006:
      type: object
      properties:
        ImportSadNumber:
          $ref: '../ie/types.yaml#/components/schemas/ImportSadNumberType'
      required:
        - ImportSadNumber

    HeaderEadType1006:
      type: object
      description: |
        | Nom de l'élément     | Référentiels | Règles | Conditions |
        |----------------------|--------------|--------|------------|
        | DestinationTypeCode  |              | R196   | NA         |
        | JourneyTime          |              | R054   | NA         |
        | TransportArrangement |              | R191   | NA         |
      properties:
        SequenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/SequenceNumberType'
        DestinationTypeCode:
          $ref: '../ie/tcl.yaml#/components/schemas/DestinationTypeCode'
        JourneyTime:
          $ref: '../ie/types.yaml#/components/schemas/JourneyTimeType'
        TransportArrangement:
          $ref: '../ie/tcl.yaml#/components/schemas/TransportArrangement'
      required:
        - DestinationTypeCode

    TransportModeType1006:
      type: object
      description: |
        | Nom de l'élément         | Référentiels | Règles | Conditions |
        |--------------------------|--------------|--------|------------|
        | TransportModeCode        |              | R056   | NA         |
        | ComplementaryInformation |              | NA     | C127       |
      properties:
        TransportModeCode:
          $ref: '../ie/types.yaml#/components/schemas/TransportModeCodeType'
        ComplementaryInformation:
          $ref: '#/components/schemas/LSDComplementaryInformationType1006'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'

    MovementGuaranteeType1006:
      type: object
      properties:
        GuarantorTypeCode:
          $ref: '../ie/tcl.yaml#/components/schemas/GuarantorTypeCode'
      required:
        - GuarantorTypeCode
    
    BodyEadType1006:
      type: object
      description: |
        | Nom de l'élément                     | Référentiels  | Règles                                   | Conditions |
        |--------------------------------------|---------------|------------------------------------------|------------|
        | BodyRecordUniqueReference            |               | IC_RG_R232<br>IC_RG_BR037<br>IC_RG_BR040 |            |
        | ExciseProductCode                    |               | R049                                     | NA         |
        | CnCode                               |               | R164/R232                                | NA         |
        | CodeCompl                            |               | NA                                       | NA         |
        | PrixFact                             |               | NA                                       | NA         |
        | Quantity                             |               | R232                                     | NA         |
        | GrossMass                            |               | R232                                     | NA         |
        | NetMass                              |               | R232                                     | NA         |
        | MaturationPeriodOrAgeOfProducts      |               | M205                                     |            |
        | AlcoholicStrength                    |               | R232                                     | NA         |
        | DegreePlato                          |               | R232                                     | NA         |
        | FiscalMark                           |               | NA                                       | NA         |
        | DesignationOfOrigin                  |               | NA                                       | NA         |
        | IndependentSmallProducersDeclaration |               | NA                                       | NA         |
        | SizeOfProducer                       |               | R232                                     | NA         |
        | Density                              |               | R232                                     | NA         |
        | CommercialDescription                |               | NA                                       | NA         |
        | BrandNameOfProducts                  |               | NA                                       | NA         |
      properties:
        BodyRecordUniqueReference:
          $ref: '../ie/types.yaml#/components/schemas/BodyRecordUniqueReferenceType'
        ExciseProductCode:
          $ref: '../ie/types.yaml#/components/schemas/ExciseProductCodeType'
        CnCode:
          $ref: '../ie/types.yaml#/components/schemas/CnCodeType'
        CodeCompl:
          $ref: '../fr/fr-v3.yaml#/components/schemas/CodeCompl'
        PrixFact:
          $ref: '../fr/fr-v3.yaml#/components/schemas/Prix'
        Quantity:
          $ref: '../ie/types.yaml#/components/schemas/QuantityType'
        GrossMass:
          $ref: '../ie/types.yaml#/components/schemas/GrossMassType'
        NetMass:
          $ref: '../ie/types.yaml#/components/schemas/NetMassType'
        MaturationPeriodOrAgeOfProducts:
          $ref: '#/components/schemas/LSDMaturationPeriodOrAgeOfProductsType1006'
        AlcoholicStrengthByVolumeInPercentage:
          $ref: '../ie/types.yaml#/components/schemas/AlcoholicStrengthType'
        DegreePlato:
          $ref: '../ie/types.yaml#/components/schemas/DegreePlatoType'
        FiscalMark:
          $ref: '#/components/schemas/LSDFiscalMarkType1006'
        DesignationOfOrigin:
          $ref: '#/components/schemas/LSDDesignationOfOriginType1006'
        IndependentSmallProducersDeclaration:
          $ref: '#/components/schemas/LSDIndependentSmallProducersDeclarationType1006'
        SizeOfProducer:
          $ref: '../ie/types.yaml#/components/schemas/SizeOfProducerType'
        Density:
          $ref: '../ie/types.yaml#/components/schemas/DensityType'
        CommercialDescription:
          $ref: '#/components/schemas/LSDCommercialDescriptionType1006'
        BrandNameOfProducts:
          $ref: '#/components/schemas/LSDBrandNameOfProductsType1006'
        Package:
          type: array
          maxItems: 999
          items:
            $ref: '#/components/schemas/PackageType1006'
        WineProduct:
          $ref: '#/components/schemas/WineProductType1006'
      required:
        - BodyRecordUniqueReference
        - ExciseProductCode
        - CnCode
        - Quantity
        - GrossMass
        - NetMass
        - Package
    
    PackageType1006:
      type: object
      description: |
        | Nom de l'élément             | Référentiels  | Règles | Conditions |
        |------------------------------|---------------|--------|------------|
        | KindOfPackages               |               | R061   | NA         |
        | NumberOfPackages             |               | R251   | C073       |
        | ShippingMarks                |               | NA     | C203       |
        | CommercialSealIdentification |               | NA     | NA         |
        | SealInformation              |               | NA     | NA         |
      properties:
        KindOfPackages:
          $ref: '../ie/types.yaml#/components/schemas/KindOfPackagesType'
        NumberOfPackages:
          $ref: '../ie/types.yaml#/components/schemas/NumberOfPackagesType'
        ShippingMarks:
          $ref: '../ie/types.yaml#/components/schemas/ShippingMarksType'
        CommercialSealIdentification:
          $ref: '../ie/types.yaml#/components/schemas/CommercialSealIdentificationType'
        SealInformation:
          $ref: '#/components/schemas/LSDSealInformationType1006'
      required:
        - KindOfPackages
    
    WineProductType1006:
      type: object
      description: |
        | Nom de l'élément          | Référentiels  | Règles | Conditions |
        |---------------------------|---------------|--------|------------|
        | WineProductCategory       |               | R043   | NA         |
        | WineGrowingZoneCode       |               | R064   | NA         |
        | ThirdCountryOfOrigin      |               | R051   | C045       |
        | ThirdCountryOfDestination |               | NA     | C002N      |
        | OtherInformation          |               | NA     | NA         |
        | language                  | Ref_28 (BC12) |        | IC_RG_C002 |
      properties:
        WineProductCategory:
          $ref: '../ie/tcl.yaml#/components/schemas/CategoryOfWineProduct'
        WineGrowingZoneCode:
          $ref: '../ie/types.yaml#/components/schemas/WineGrowingZoneCodeType'
        ThirdCountryOfOrigin:
          $ref: '../ie/types.yaml#/components/schemas/ThirdCountryOfOriginType'
        ThirdCountryOfDestination:
          $ref: '../ie/types.yaml#/components/schemas/ThirdCountryOfOriginType'
        OtherInformation:
          $ref: '#/components/schemas/LSDOtherInformationType1006'
        WineOperation:
          type: array
          maxItems: 99
          items:
            $ref: '#/components/schemas/WineOperationType1006'
      required:
        - WineProductCategory

    WineOperationType1006:
      type: object
      description: |
        | Nom de l'élément  | Référentiels | Règles | Conditions |
        |-------------------|--------------|--------|------------|
        | WineOperationCode |              | R065   | NA         |
      properties:
        WineOperationCode:
          $ref: '../ie/types.yaml#/components/schemas/WineOperationCodeType'
      required:
        - WineOperationCode
    
    LSDComplementaryInformationType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/ComplementaryInformationType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - _content_
        - __language
    
    LSDFiscalMarkType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/FiscalMarkType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_
    
    LSDDesignationOfOriginType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/DesignationOfOriginType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_

    LSDIndependentSmallProducersDeclarationType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/IndependentSmallProducersDeclarationType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_


    LSDBrandNameOfProductsType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/BrandNameOfProductsType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_

    LSDCommercialDescriptionType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/CommercialDescriptionType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_
    
    LSDMaturationPeriodOrAgeOfProductsType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/MaturationPeriodOrAgeOfProductsType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_

    LSDSealInformationType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/SealInformationType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_

    ReferenceOfTaxWarehouseType1006:
      type: string
      minLength: 10
      maxLength: 13
      pattern: ^([a-zA-Z]{2}[a-zA-Z0-9]{11})|([0-9]{9}[a-zA-Z0-9]{1})$
      description: Reference Of Tax Warehouse

    LSDOtherInformationType1006:
      type: object
      properties:
        _content_:
          $ref: '../ie/types.yaml#/components/schemas/OtherInformationType'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - __language
        - _content_
