> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ezytail.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Push new procurements

> Will import all procurements into the system and return errors if any



## OpenAPI

````yaml post /procurements
openapi: 3.0.4
info:
  title: EzyConnect API
  description: API to Ezytail Logistics Platform
  contact:
    name: Ezytail
    url: https://ezytail.com
    email: contact@ezytail.com
  version: v1
servers: []
security:
  - Bearer: []
paths:
  /procurements:
    post:
      tags:
        - Procurements
      summary: Push new procurements
      description: Will import all procurements into the system and return errors if any
      operationId: AddProcurement
      parameters:
        - name: validationOnly
          in: query
          schema:
            type: boolean
            default: false
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Procurement'
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Procurement'
          application/*+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Procurement'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/OperationResult'
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
            text/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
        '206':
          description: Partial Content
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
        default:
          description: Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    Procurement:
      required:
        - activityCode
        - activityName
        - expectedReceiptDate
        - procurementEntries
        - uniqueProcurementID
      type: object
      properties:
        activityCode:
          maxLength: 3
          minLength: 1
          type: string
        activityName:
          maxLength: 30
          minLength: 1
          type: string
        dateCreation:
          type: string
          format: date-time
          nullable: true
        dateLastUpdate:
          type: string
          format: date-time
          nullable: true
        uniqueProcurementID:
          maxLength: 20
          minLength: 1
          type: string
          x-tags:
            - Entête Procurement
        supplierOrderNumberDO:
          maxLength: 30
          type: string
          nullable: true
        ownerCode:
          maxLength: 3
          type: string
          nullable: true
        procurementTypeCode:
          maxLength: 3
          type: string
          nullable: true
        procurementGroup:
          maxLength: 14
          type: string
          nullable: true
        procurementGroupDescription:
          maxLength: 80
          type: string
          nullable: true
        supplierCode:
          maxLength: 13
          type: string
          nullable: true
        supplierName:
          maxLength: 30
          type: string
          nullable: true
        expectedReceiptDate:
          type: string
          format: date-time
          x-tags:
            - Entête Procurement
        customField1:
          maxLength: 200
          type: string
          nullable: true
        customField2:
          maxLength: 200
          type: string
          nullable: true
        customField3:
          maxLength: 256
          type: string
          nullable: true
        customField4:
          maxLength: 256
          type: string
          nullable: true
        customField5:
          maxLength: 256
          type: string
          nullable: true
        customField6:
          maxLength: 256
          type: string
          nullable: true
        customField7:
          maxLength: 256
          type: string
          nullable: true
        customField8:
          maxLength: 256
          type: string
          nullable: true
        procurementEntries:
          type: array
          items:
            $ref: '#/components/schemas/ProcurementEntry'
          x-tags:
            - Entête Procurement
        id:
          type: string
          nullable: true
          readOnly: true
      additionalProperties: false
    OperationResult:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/StatusEnum'
        operationId:
          type: string
          nullable: true
          readOnly: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/OperationError'
          nullable: true
          readOnly: true
        passed:
          type: array
          items:
            type: string
          nullable: true
          readOnly: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    ProcurementEntry:
      required:
        - articleReference
        - expectedQuantity
        - lineID
      type: object
      properties:
        id:
          type: integer
          format: int64
        activityCode:
          title: CODACTI
          maxLength: 3
          type: string
          description: Code de l'activité
          nullable: true
          x-tags:
            - Activité
        dateCreation:
          title: DATECREATION
          type: string
          description: ''
          format: date-time
        dateLastUpdate:
          title: DATELASTUPDATE
          type: string
          description: ''
          format: date-time
        uniqueProcurementID:
          title: IDRECEP
          maxLength: 20
          type: string
          description: Identifiant unique de l'approvisionnement
          nullable: true
        lineID:
          title: IDLIGNE
          maxLength: 35
          minLength: 1
          type: string
          description: N° de ligne de commande
        articleReference:
          title: CODARTI
          maxLength: 16
          minLength: 1
          type: string
          description: Référence article
          x-tags:
            - Entête Article
        expectedQuantity:
          title: QTTEATT
          type: integer
          description: Quantité attendue sur la réception
          format: int32
        supplierOrderNumberDO:
          title: COMFOUR
          maxLength: 30
          type: string
          description: N° de commande fournisseur chez le DO
          nullable: true
        receptionUnitOfMeasure:
          title: UNITREC
          maxLength: 3
          type: string
          description: Unité d'œuvre de la réception
          nullable: true
        articlePriceAtReception:
          title: PRIXREC
          type: integer
          description: Prix attaché a l'article a la réception
          format: int32
          nullable: true
        expectedLotNumber:
          title: ARTILOT
          maxLength: 50
          type: string
          description: N° de lot attendu pour la ligne
          nullable: true
        announcedArticleDate:
          title: DATEART
          type: string
          description: Date annoncée pour l'article
          format: date-time
          nullable: true
        articleShippingDeadline:
          title: DFVARTI
          type: string
          description: Date limite d'expédition de l'article
          format: date-time
          nullable: true
        articlePCB:
          title: PCBARTI
          type: integer
          description: PCB de l'article
          format: int32
          nullable: true
          x-tags:
            - PCB
        articleSPCB:
          title: SPCARTI
          type: integer
          description: SPCB de l'article
          format: int32
          nullable: true
          x-tags:
            - SPCB
        lineMessage:
          title: MESGLIG
          maxLength: 30
          type: string
          description: 'Message à la ligne '
          nullable: true
        customField1:
          title: SPECIF1
          maxLength: 200
          type: string
          description: Champ spécifique disponible
          nullable: true
        customField2:
          title: SPECIF2
          maxLength: 200
          type: string
          description: Champ spécifique disponible
          nullable: true
        customField3:
          title: SPECIF3
          maxLength: 256
          type: string
          description: Champ spécifique disponible
          nullable: true
        customField4:
          title: SPECIF4
          maxLength: 256
          type: string
          description: Champ spécifique disponible
          nullable: true
        customField5:
          title: SPECIF5
          maxLength: 256
          type: string
          description: Champ spécifique disponible
          nullable: true
        customField6:
          title: SPECIF6
          maxLength: 256
          type: string
          description: Champ spécifique disponible
          nullable: true
        customField7:
          title: SPECIF7
          maxLength: 256
          type: string
          description: Champ spécifique disponible
          nullable: true
        customField8:
          title: SPECIF8
          maxLength: 256
          type: string
          description: Champ spécifique disponible
          nullable: true
        dateProcessed:
          title: DATEPROCESSED
          type: string
          description: ''
          format: date-time
          nullable: true
        gradeCode:
          title: R_CODEQUALITE
          maxLength: 3
          type: string
          description: Code qualite du stock
          nullable: true
      additionalProperties: false
    StatusEnum:
      enum:
        - 0
        - 1
        - 2
      type: integer
      format: int32
    OperationError:
      type: object
      properties:
        code:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: oauth2
      description: |-
        JWT Authorization header using the Bearer scheme. \r\n\r\n 
                          Enter 'Bearer' [space] and then your token in the text input below.
                          \r\n\r\nExample: 'Bearer 12345abcdef'
      flows:
        authorizationCode:
          authorizationUrl: https://auth.ezytail.com/connect/authorize
          tokenUrl: https://auth.ezytail.com/connect/token
          scopes:
            ezy_connect: EzyConnect API Scope

````