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
  /829:
    post:
      summary: Définition d'un message 829
      operationId: message829
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BodyType829'
      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:
    BodyType829:
      type: object
      properties:
        NotificationOfAcceptedExport:
          $ref: '#/components/schemas/NotificationOfAcceptedExportType'
      required:
        - NotificationOfAcceptedExport

    NotificationOfAcceptedExportType:
      type: object
      properties:
        Attributes:
          $ref: '#/components/schemas/AttributesType829'
        ConsigneeTrader:
          $ref: '#/components/schemas/ConsigneeTraderType829'
        ExciseMovement:
          type: array
          minItems: 1
          maxItems: 999
          items:
            $ref: '#/components/schemas/ExciseMovementType829'
        ExportPlaceCustomsOffice:
          $ref: '#/components/schemas/ExportPlaceCustomsOfficeType829'
        ExportDeclarationAcceptanceRelease:
          $ref: '#/components/schemas/ExportDeclarationAcceptanceReleaseType829'
      required:
        - Attributes
        - ConsigneeTrader
        - ExciseMovementEad
        - ExportDeclarationAcceptanceRelease

    AttributesType829:
      type: object
      description: |
        | Nom de l'élément      | Référentiels | Règles | Conditions |
        |-----------------------|--------------|--------|------------|
        | DateAndTimeOfIssuance |              |        |            |
      properties:
        DateAndTimeOfIssuance:
          $ref: '../ie/types.yaml#/components/schemas/DateTimeType'

    ConsigneeTraderType829:
      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 | IC_RG_C010 |
        | TraderName       |               |                                        |            |
        | StreetName       |               |                                        |            |
        | StreetNumber     |               |                                        |            |
        | PostCode         |               |                                        |            |
        | City             |               |                                        |            |
        | language         | BC12 (Ref_28) |                                        |            |
        | 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'
        __language:
          $ref: '../ie/types.yaml#/components/schemas/LanguageCodeType'
      required:
        - TraderName
        - StreetName
        - Postcode
        - City
        - __language

    ExciseMovementType829:
      type: object
      description: |
        | Nom de l'élément                       | Référentiels  | Règles     | Conditions |
        |----------------------------------------|---------------|------------|------------|
        | AdministrativeReferenceCode            |               | IC_RG_R273 |            |
        | SequenceNumber                         |               | IC_RG_R272 |            |
        | ExportDeclarationAcceptanceReleaseType | TC27 (Ref_99) |            |            |
      properties:
        AdministrativeReferenceCode:
          $ref: '../ie/types.yaml#/components/schemas/AdministrativeReferenceCodeType'
        SequenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/SequenceNumberType'
        ExportDeclarationAcceptanceOrGoodsReleasedForExport:
          $ref: '../ie/tcl.yaml#/components/schemas/Flag'
      required:
        - AdministrativeReferenceCode
        - SequenceNumber
        - ExportDeclarationAcceptanceOrGoodsReleasedForExport

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

    ExportDeclarationAcceptanceReleaseType829:
      type: object
      description: |
        | Nom de l'élément                     | Référentiels | Règles                   | Conditions |
        |--------------------------------------|--------------|--------------------------|------------|
        | ReferenceNumberOfSenderCustomsOffice |              | IC_RG_R032<br>IC_RG_R236 |            |
        | IdentificationOfSenderCustomsOfficer |              |                          |            |
        | DateOfAcceptance                     |              |                          | IC_RG_C222 |
        | DateOfRelease                        |              |                          | IC_RG_C222 |
        | DocumentReferenceNumber              |              | IC_RG_R100               |            |
      properties:
        ReferenceNumberOfSenderCustomsOffice:
          $ref: '../ie/types.yaml#/components/schemas/ExciseOfficeCodeType'
        IdentificationOfSenderCustomsOfficer:
          $ref: '../ie/types.yaml#/components/schemas/IdentificationOfSenderCustomsOfficerType'
        DateOfAcceptance:
          $ref: '../ie/types.yaml#/components/schemas/DateType'
        DateOfRelease:
          $ref: '../ie/types.yaml#/components/schemas/DateType'
        DocumentReferenceNumber:
          $ref: '../ie/types.yaml#/components/schemas/DocumentReferenceNumberType'
      required:
        - ReferenceNumberOfSenderCustomsOffice
        - DocumentReferenceNumber
