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

# Worksite creation



## OpenAPI

````yaml /api-reference/partners/api.json post /v1/worksites
openapi: 3.1.0
info:
  title: Laravel
  version: 0.0.1
servers:
  - url: https://api.opx.co/partners
    description: Production
security: []
paths:
  /v1/worksites:
    post:
      tags:
        - Worksites
      summary: Worksite creation
      operationId: partners.worksites.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorksitesStoreRequest'
      responses:
        '200':
          description: '`WorksiteResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WorksiteResource'
                required:
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    WorksitesStoreRequest:
      type: object
      properties:
        external_reference:
          type:
            - string
            - 'null'
        convention_id:
          type: integer
        beneficiary_id:
          type: integer
        incentive_type:
          type:
            - string
            - 'null'
          enum:
            - direct
            - indirect
        precarity_type:
          type:
            - string
            - 'null'
          description: >-
            type de précarité, par défaut "classic". Seul "classic" est accepté
            pour les chantiers b2b
          enum:
            - very-low
            - low
            - mid
            - classic
        address:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        zipcode:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
        additional_address:
          type:
            - string
            - 'null'
        indivision:
          type:
            - boolean
            - 'null'
        cadastral_parcel:
          type:
            - string
            - 'null'
          description: >-
            référence cadastrale de la parcelle (préfixe-section-numéro) :
            "O11-AD-250"
        fiscal_informations:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              firstname:
                type: string
              lastname:
                type: string
              fiscal_number:
                type:
                  - string
                  - 'null'
              fiscal_reference:
                type:
                  - string
                  - 'null'
            required:
              - firstname
              - lastname
      required:
        - convention_id
        - beneficiary_id
      title: WorksitesStoreRequest
    WorksiteResource:
      type: object
      properties:
        id:
          type: integer
        reference:
          type: string
        external_reference:
          type:
            - string
            - 'null'
        convention_id:
          type: integer
        beneficiary_id:
          type: integer
        installer_name:
          type: string
        zipcode:
          type: string
        address:
          type: string
        city:
          type: string
        status:
          type: string
        created_at:
          type: string
        precarity_type:
          type: string
        fiscal_informations:
          $ref: '#/components/schemas/FiscalDeclarationCollection'
        indivision:
          type: boolean
      required:
        - id
        - reference
        - external_reference
        - convention_id
        - beneficiary_id
        - installer_name
        - zipcode
        - address
        - city
        - status
        - created_at
        - precarity_type
        - fiscal_informations
        - indivision
      title: WorksiteResource
    FiscalDeclarationCollection:
      type: array
      items:
        $ref: '#/components/schemas/FiscalDeclarationResource'
      title: FiscalDeclarationCollection
    FiscalDeclarationResource:
      type: object
      properties:
        firstname:
          type: string
        lastname:
          type: string
        fiscal_number:
          type: string
        fiscal_reference:
          type: string
      required:
        - firstname
        - lastname
        - fiscal_number
        - fiscal_reference
      title: FiscalDeclarationResource
  responses:
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````