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
  /825:
    post:
      summary: Définition d'un message 825
      operationId: message825
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType825'
      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:
    BodyType825:
      type: object
      properties:
        SubmittedDraftOfSplittingOperation:
          $ref: '#/components/schemas/SubmittedDraftOfSplittingOperationType825'
      required:
        - SubmittedDraftOfSplittingOperation

    SubmittedDraftOfSplittingOperationType825:
      type: object
      properties:
        SplittingEad:
          $ref: '#/components/schemas/SplittingEadType825'
        SplitDetailsEad:
          type: array
          minItems: 1
          maxItems: 9
          items:
            $ref: '#/components/schemas/SplitDetailsEadType825'
        MsaOfSplitting:
          $ref: '#/components/schemas/MsaOfSplittingType825'
      required:
        - SplittingEad
        - SplitDetailsEad
        - MsaOfSplitting

    SplittingEadType825:
      type: object
      description: |
        | **Nom de l'élément** | **Référentiels** | **Règles**                | **Conditions** |
        |----------------------|------------------|---------------------------|----------------|
        | UpstreamArc          |                  | IC_RG_R030<br>IC_RG_BR020 |                |
      properties:
        UpstreamArc:
          $ref: '../ie/types.yaml#/components/schemas/UpstreamArcType'
      required:
        - UpstreamArc

    SplitDetailsEadType825:
      type: object
      description: |
        | Nom de l'élément            | Référentiels  | Règles                    | Conditions |
        |-----------------------------|---------------|---------------------------|------------|
        | LocalReferenceNumber        |               |                           |            |
        | JourneyTime                 |               | IC_RG_BR007<br>IC_RG_R054 |            |
        | ChangedTransportArrangement | Ref_51 (TC70) |                           |            |
        | DestinationChanged          |               |                           |            |
        | NewConsigneeTrader          |               |                           | IC_RG_C158 |
        | DeliveryPlaceTrader         |               |                           | IC_RG_C164 |
        | DeliveryPlaceCustomsOffice  |               |                           | IC_RG_C164 |
        | NewTransportArrangerTrader  |               |                           | IC_RG_C104 |
        | NewTransporterTrader        |               |                           |            |
        | TransportDetails            |               |                           |            |
        | BodyEad                     |               |                           |            |
      properties:
        LocalReferenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/LocalReferenceNumberType'
        JourneyTime:
          $ref: '../ie/types.yaml#/components/schemas/JourneyTimeType'
        ChangedTransportArrangement:
          $ref: '../ie/tcl.yaml#/components/schemas/TransportArrangement'
        DestinationChanged:
          $ref: '#/components/schemas/DestinationChangedType825'
        NewConsigneeTrader:
          $ref: '#/components/schemas/NewConsigneeTraderType825'
        DeliveryPlaceTrader:
          $ref: '#/components/schemas/DeliveryPlaceTraderType825'
        DeliveryPlaceCustomsOffice:
          $ref: '#/components/schemas/DeliveryPlaceCustomsOfficeType825'
        NewTransportArrangerTrader:
          $ref: '#/components/schemas/NewTransportArrangerTraderType825'
        NewTransporterTrader:
          $ref: '#/components/schemas/NewTransporterTraderType825'
        TransportDetails:
          type: array
          minItems: 0
          maxItems: 99
          items:
            $ref: '#/components/schemas/TransportDetailsType825'
        BodyEad:
          type: array
          minItems: 1
          maxItems: 999
          items:
            $ref: '#/components/schemas/BodyEadType825'
      required:
        - LocalReferenceNumber
        - DestinationChanged
        - BodyEad

    DestinationChangedType825:
      type: object
      description: |
        | Nom de l'élément    | Référentiels | Règles      | Conditions |
        |---------------------|--------------|-------------|------------|
        | DestinationTypeCode | TC97         | IC_RG_BR034 |            |
      properties:
        DestinationTypeCode:
          $ref: '../ie/tcl.yaml#/components/schemas/SplittingDestinationTypeCode'
      required:
        - DestinationTypeCode

    NewConsigneeTraderType825:
      type: object
      description: |
        | Nom de l'élément | Référentiels  | Règles                                                                                                            | Conditions     |
        |------------------|---------------|-------------------------------------------------------------------------------------------------------------------|----------------|
        | Traderid         |               | IC_RG_BR011<br>IC_RG_BR014<br>IC_RG_BR015<br>IC_RG_BR016<br>IC_RG_BR030<br>IC_RG_R045<br>IC_RG_R271<br>IC_RG_R272 | IC_RG_C010<br> |
        | TraderName       |               |                                                                                                                   |                |
        | StreetName       |               |                                                                                                                   |                |
        | StreetNumber     |               |                                                                                                                   |                |
        | PostCode         |               |                                                                                                                   |                |
        | City             |               |                                                                                                                   |                |
        | EoriNumber       |               |                                                                                                                   | IC_RG_C180     |
        | LanguageCode     | Ref_28 (BC12) |                                                                                                                   |                |
      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'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - TraderName
        - StreetName
        - Postcode
        - City
        - __language

    DeliveryPlaceTraderType825:
      type: object
      description: |
        | Nom de l'élément | Référentiels  | Règles                                                                               | Conditions |
        |------------------|---------------|--------------------------------------------------------------------------------------|------------|
        | TraderId         |               | IC_RG_R045<br>IC_RG_R271<br>IC_RG_R272<br>IC_RG_BR012<br>IC_RG_BR013<br>IC_RG_BR030  | IC_RG_C074 |
        | TraderName       |               |                                                                                      | IC_RG_C079 |
        | StreetName       |               |                                                                                      | IC_RG_C078 |
        | StreetNumber     |               |                                                                                      |            |
        | PostCode         |               |                                                                                      | IC_RG_C078 |
        | City             |               |                                                                                      | IC_RG_C078 |
        | language         | Ref_28 (BC12) |                                                                                      | IC_RG_C002 |
      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'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'

    DeliveryPlaceCustomsOfficeType825:
      type: object
      description: |
        | Nom de l'élément | Référentiels | Règles                                           | Conditions |
        |------------------|--------------|--------------------------------------------------|------------|
        | ReferenceNumber  |              | IC_RG_BR017 IC_RG_BR030 IC_RG_R032<br>IC_RG_R236 |            |
      properties:
        ReferenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/ExciseOfficeCodeType'
      required:
        - ReferenceNumber

    NewTransportArrangerTraderType825:
      type: object
      description: |
        | **Nom de l'élément** | **Référentiels** | **Règles** | **Conditions** |
        |----------------------|------------------|------------|----------------|
        | VatNumber            |                  |            |                |
        | TraderName           |                  |            |                |
        | StreetName           |                  |            |                |
        | StreetNumber         |                  |            |                |
        | PostCode             |                  |            |                |
        | City                 |                  |            |                |
        | language             | Ref_28 (BC12)    |            |                |
      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'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - TraderName
        - StreetName
        - Postcode
        - City
        - __language

    NewTransporterTraderType825:
      type: object
      description: |
        | **Nom de l'élément** | **Référentiels** | **Règles** | **Conditions** |
        |----------------------|------------------|------------|----------------|
        | VatNumber            |                  |            |                |
        | TraderName           |                  |            |                |
        | StreetName           |                  |            |                |
        | StreetNumber         |                  |            |                |
        | PostCode             |                  |            |                |
        | City                 |                  |            |                |
        | language             | Ref_28 (BC12)    |            |                |
      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'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - TraderName
        - StreetName
        - Postcode
        - City
        - __language

    TransportDetailsType825:
      type: object
      description: |
        | **Nom de l'élément**         | **Référentiels** | **Règles** | **Conditions** |
        |------------------------------|------------------|------------|----------------|
        | TransportUnitCode            | Ref_53  (BC35)   |            |                |
        | IdentityOfTransportUnits     |                  |            | IC_RG_C156     |
        | CommercialSealIdentification |                  |            |                |
        | ComplementaryInformation     |                  |            |                |
        | SealInformation              |                  |            |                |
      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/LSDComplementaryInformationType825'
        SealInformation:
          $ref: '#/components/schemas/LSDSealInformationType825'
      required:
        - TransportUnitCode

    BodyEadType825:
      type: object
      description: |
        | **Nom de l'élément**      | **Référentiels** | **Règles**                              | **Conditions** |
        |---------------------------|------------------|-----------------------------------------|----------------|
        | BodyRecordUniqueReference |                  | IC_RG_R232<br>IC_RG_R194                |                |
        | ExciseProductCode         | Ref_21 (BC36)    | IC_RG_BR031<br>IC_RG_BR032              |                |
        | CnCode                    |                  | IC_RG_R211<br>IC_RG_R232<br>IC_RG_BR018 |                |
        | Quantity                  |                  | IC_RG_R232 <br>IC_RG_BR033              |                |
        | GrossMass                 |                  | IC_RG_R232<br>IC_RG_R219                |                |
        | NetMass                   |                  | IC_RG_R232<br>IC_RG_R219                |                |
        | FiscalMark                |                  |                                         |                |
        | FiscalMarkUsedFlag        | Ref_99 (TC27)    |                                         |                |
        | Density                   | Ref_20 (BC66)    | IC_RG_R232                              | IC_RG_C049     |
        | CommercialDescription     |                  |                                         |                |
        | BrandNameOfProducts       |                  |                                         |                |
        | Package                   |                  |                                         |                |
      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'
        Quantity:
          $ref: '../ie/types.yaml#/components/schemas/QuantityType'
        GrossMass:
          $ref: '../ie/types.yaml#/components/schemas/GrossMassType'
        NetMass:
          $ref: '../ie/types.yaml#/components/schemas/NetMassType'
        FiscalMark:
          $ref: '#/components/schemas/LSDFiscalMarkType825'
        FiscalMarkUsedFlag:
          $ref: '../ie/tcl.yaml#/components/schemas/Flag'
        Density:
          $ref: '../ie/types.yaml#/components/schemas/DensityType'
        CommercialDescription:
          $ref: '#/components/schemas/LSDCommercialDescriptionType825'
        BrandNameOfProducts:
          $ref: '#/components/schemas/LSDBrandNameOfProductsType825'
        Package:
          type: array
          minItems: 1
          maxItems: 99
          items:
            $ref: '#/components/schemas/PackageType825'
      required:
        - BodyRecordUniqueReference*
        - ExciseProductCode
        - CnCode
        - Quantity
        - GrossMass
        - NetMass
        - Package

    PackageType825:
      type: object
      description: |
        | **Nom de l'élément**         | **Référentiels** | **Règles** | **Conditions** |
        |------------------------------|------------------|------------|----------------|
        | KindOfPackages               | Ref_38 (BC17)    |            |                |
        | NumberOfPackages             |                  | IC_RG_R251 | IC_RG_C073     |
        | ShippingMarks                |                  |            | IC_RG_C203     |
        | CommercialSealIdentification |                  |            |                |
        | SealInformation              |                  |            |                |
        | language                     | Ref_28 (BC12)    |            | IC_RG_C002     |
      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/LSDSealInformationType825'
      required:
        - KindOfPackages

    MsaOfSplittingType825:
      type: object
      description: |
        | **Nom de l'élément** | **Référentiels** | **Règles** | **Conditions** |
        |----------------------|------------------|------------|----------------|
        | MemberStateCode      | Ref_31 (BC11)    |            |                |
      properties:
        MemberStateCode:
          $ref: '../ie/types.yaml#/components/schemas/MemberStateCodeType'
      required:
        - MemberStateCode

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

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

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

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

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