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

# Submit Structure Batch

> Submit up to 100 structuring actions as one structure batch.

Engrate applies all the actions or none of them. Today the only action is `create.supplier-switch`. For each new supplier switch, Engrate adds the accounting point to your organization if it is not there yet, and makes a request to the grid operator. Follow each switch with [List supplier switches](/api-reference/structuring/list-supplier-switches).

See [Supplier switches](/market-communication/structuring/supplier-switches).

Errors:

- `400`: your organization is not set up for the market of the actions.   Contact Engrate.

- `404`: your organization is not set up for market communication. Contact   Engrate.

- `409`: an action names an accounting point that already has an open switch,   or two actions name the same accounting point. Engrate applied nothing.   `conflicts` names the actions.

- `422`: the batch is not valid. For example, a MaLo-ID does not have 11   digits. `detail` names the fields.



## OpenAPI

````yaml /openapi.json post /market-access/v1alpha1/structure
openapi: 3.1.0
info:
  title: Engrate API
  version: 1.0.0
servers:
  - url: https://api.engrate.io
security:
  - apiKeyAuth: []
paths:
  /market-access/v1alpha1/structure:
    post:
      tags:
        - structuring
      summary: Submit Structure Batch
      description: >-
        Submit up to 100 structuring actions as one structure batch.


        Engrate applies all the actions or none of them. Today the only action
        is `create.supplier-switch`. For each new supplier switch, Engrate adds
        the accounting point to your organization if it is not there yet, and
        makes a request to the grid operator. Follow each switch with [List
        supplier switches](/api-reference/structuring/list-supplier-switches).


        See [Supplier
        switches](/market-communication/structuring/supplier-switches).


        Errors:


        - `400`: your organization is not set up for the market of the
        actions.   Contact Engrate.


        - `404`: your organization is not set up for market communication.
        Contact   Engrate.


        - `409`: an action names an accounting point that already has an open
        switch,   or two actions name the same accounting point. Engrate applied
        nothing.   `conflicts` names the actions.


        - `422`: the batch is not valid. For example, a MaLo-ID does not have
        11   digits. `detail` names the fields.
      operationId: structure_market_access_v1alpha1_structure_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StructureBatch'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructureResult'
          description: Engrate applied every action of the batch.
        '400':
          description: >-
            Your organization is not set up for the market of the actions.
            Contact Engrate.
        '404':
          description: >-
            Your organization is not set up for market communication. Contact
            Engrate.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructureConflictResponse'
          description: >-
            One or more actions are in conflict. Engrate applied nothing. Remove
            or change the actions that `conflicts` names, then submit the batch
            again.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    StructureBatch:
      additionalProperties: false
      description: 'Structuring actions that Engrate applies together: all of them or none.'
      properties:
        actions:
          description: The structuring actions of the batch, 1 to 100.
          items:
            discriminator:
              mapping:
                create.supplier-switch: '#/components/schemas/CreateSupplierSwitchAction'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/CreateSupplierSwitchAction'
          maxItems: 100
          minItems: 1
          title: Actions
          type: array
      required:
        - actions
      title: StructureBatch
      type: object
    StructureResult:
      description: What the structure batch created.
      properties:
        results:
          description: One result for each action, in the order of the actions.
          items:
            discriminator:
              mapping:
                create.supplier-switch: '#/components/schemas/CreateSupplierSwitchResult'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/CreateSupplierSwitchResult'
          maxItems: 100
          minItems: 1
          title: Results
          type: array
      required:
        - results
      title: StructureResult
      type: object
    StructureConflictResponse:
      description: >-
        Engrate did not apply the batch, because of one or more conflicts.
        Nothing in the batch was applied.
      properties:
        conflicts:
          description: Each conflict that stops the batch.
          items:
            discriminator:
              mapping:
                existing-open-switch: '#/components/schemas/ExistingOpenSwitchConflict'
                incompatible-actions: '#/components/schemas/IncompatibleActionsConflict'
              propertyName: kind
            oneOf:
              - $ref: '#/components/schemas/ExistingOpenSwitchConflict'
              - $ref: '#/components/schemas/IncompatibleActionsConflict'
          minItems: 1
          title: Conflicts
          type: array
        detail:
          description: A summary of the error.
          title: Detail
          type: string
      required:
        - conflicts
        - detail
      title: StructureConflictResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CreateSupplierSwitchAction:
      additionalProperties: false
      description: Create a supplier switch for an accounting point.
      properties:
        kind:
          const: create.supplier-switch
          description: The kind of structuring action.
          title: Kind
          type: string
        supplier-switch:
          description: >-
            The supplier switch to create. The `market` and
            `accounting_point_type` fields select its shape.
          discriminator:
            mapping:
              DE: '#/components/schemas/DeSupplierSwitchCreate'
            propertyName: market
          oneOf:
            - $ref: '#/components/schemas/DeSupplierSwitchCreate'
          title: Supplier-Switch
      required:
        - kind
        - supplier-switch
      title: CreateSupplierSwitchAction
      type: object
    CreateSupplierSwitchResult:
      description: The supplier switch that one action created.
      properties:
        accounting_point_id:
          description: The Engrate identifier of the accounting point.
          format: uuid
          title: Accounting Point Id
          type: string
        index:
          description: The position of the action in the batch, from 0.
          minimum: 0
          title: Index
          type: integer
        kind:
          const: create.supplier-switch
          description: The kind of structuring action.
          title: Kind
          type: string
        supplier_switch_id:
          description: >-
            The identifier of the new supplier switch. Use it to follow the
            switch with [List supplier
            switches](/api-reference/structuring/list-supplier-switches).
          format: uuid
          title: Supplier Switch Id
          type: string
      required:
        - accounting_point_id
        - index
        - kind
        - supplier_switch_id
      title: CreateSupplierSwitchResult
      type: object
    ExistingOpenSwitchConflict:
      description: The accounting point already has an open supplier switch.
      properties:
        accounting_point_market_identifier:
          description: The identifier that the market gives to the accounting point.
          title: Accounting Point Market Identifier
          type: string
        action_indexes:
          description: The positions of the actions that name the accounting point.
          items:
            minimum: 0
            type: integer
          minItems: 1
          title: Action Indexes
          type: array
        kind:
          const: existing-open-switch
          title: Kind
          type: string
        state:
          description: The state of the open switch.
          enum:
            - pending
            - requested
            - accepted
          examples:
            - requested
          title: State
          type: string
        switch_id:
          description: The identifier of the open switch.
          format: uuid
          title: Switch Id
          type: string
      required:
        - accounting_point_market_identifier
        - action_indexes
        - kind
        - state
        - switch_id
      title: ExistingOpenSwitchConflict
      type: object
    IncompatibleActionsConflict:
      description: >-
        Two or more actions of the batch cannot be applied together. For
        example, two supplier switches for one accounting point.
      properties:
        accounting_point_market_identifier:
          description: The identifier that the market gives to the accounting point.
          title: Accounting Point Market Identifier
          type: string
        action_indexes:
          description: The positions of the actions in the conflict.
          items:
            minimum: 0
            type: integer
          minItems: 2
          title: Action Indexes
          type: array
        detail:
          description: Why the actions cannot be applied together.
          title: Detail
          type: string
        kind:
          const: incompatible-actions
          title: Kind
          type: string
      required:
        - accounting_point_market_identifier
        - action_indexes
        - detail
        - kind
      title: IncompatibleActionsConflict
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    DeSupplierSwitchCreate:
      discriminator:
        mapping:
          consumption: '#/components/schemas/DeConsumptionSupplierSwitchCreate'
          production: '#/components/schemas/DeProductionSupplierSwitchCreate'
        propertyName: accounting_point_type
      oneOf:
        - $ref: '#/components/schemas/DeConsumptionSupplierSwitchCreate'
        - $ref: '#/components/schemas/DeProductionSupplierSwitchCreate'
    DeConsumptionSupplierSwitchCreate:
      additionalProperties: false
      description: A supplier switch for a German accounting point that consumes energy.
      properties:
        accounting_point_market_identifier:
          description: >-
            The market location ID (MaLo-ID) of the accounting point: 11 digits.
            Engrate adds the accounting point to your organization if it does
            not have it yet.
          examples:
            - '26611699793'
          pattern: ^\d{11}$
          title: Accounting Point Market Identifier
          type: string
        accounting_point_type:
          const: consumption
          description: The accounting point consumes energy.
          title: Accounting Point Type
          type: string
        balance_group:
          description: >-
            The EIC code of the balance group that you supply the accounting
            point in.
          examples:
            - 11XFC-CONS-----0
          title: Balance Group
          type: string
        customer:
          $ref: '#/components/schemas/DeSwitchCustomer'
        effective_date:
          description: >-
            The date from which you want to supply the accounting point. The
            request must reach the grid operator no later than the day before
            the last working day before this date. The grid operator decides if
            the request came in time.
          format: date
          title: Effective Date
          type: string
        enfg_eligibility:
          description: >-
            Whether the customer qualifies for reduced levies under the Energy
            Financing Act (Energiefinanzierungsgesetz, EnFG) at this accounting
            point. Required for a consumption accounting point.
          discriminator:
            mapping:
              customer_does_not_qualify: '#/components/schemas/DeEnfgCustomerDoesNotQualify'
              customer_qualifies: '#/components/schemas/DeEnfgCustomerQualifies'
              location_does_not_qualify: '#/components/schemas/DeEnfgLocationDoesNotQualify'
            propertyName: kind
          oneOf:
            - $ref: '#/components/schemas/DeEnfgCustomerQualifies'
            - $ref: '#/components/schemas/DeEnfgCustomerDoesNotQualify'
            - $ref: '#/components/schemas/DeEnfgLocationDoesNotQualify'
          title: Enfg Eligibility
        grid_operator:
          description: >-
            The 13-digit code of the grid operator that the accounting point
            connects to: its BDEW code number or its global location number
            (GLN).
          examples:
            - '9903123000007'
          pattern: ^\d{13}$
          title: Grid Operator
          type: string
        market:
          const: DE
          description: The market of the accounting point.
          title: Market
          type: string
      required:
        - accounting_point_market_identifier
        - accounting_point_type
        - balance_group
        - customer
        - effective_date
        - enfg_eligibility
        - grid_operator
        - market
      title: DeConsumptionSupplierSwitchCreate
      type: object
    DeProductionSupplierSwitchCreate:
      additionalProperties: false
      description: A supplier switch for a German accounting point that produces energy.
      properties:
        accounting_point_market_identifier:
          description: >-
            The market location ID (MaLo-ID) of the accounting point: 11 digits.
            Engrate adds the accounting point to your organization if it does
            not have it yet.
          examples:
            - '26611699793'
          pattern: ^\d{11}$
          title: Accounting Point Market Identifier
          type: string
        accounting_point_type:
          const: production
          description: The accounting point produces energy.
          title: Accounting Point Type
          type: string
        balance_group:
          description: >-
            The EIC code of the balance group that you supply the accounting
            point in.
          examples:
            - 11XFC-CONS-----0
          title: Balance Group
          type: string
        customer:
          $ref: '#/components/schemas/DeSwitchCustomer'
        effective_date:
          description: >-
            The date from which you want to supply the accounting point. The
            request must reach the grid operator no later than the day before
            the last working day before this date. The grid operator decides if
            the request came in time.
          format: date
          title: Effective Date
          type: string
        grid_operator:
          description: >-
            The 13-digit code of the grid operator that the accounting point
            connects to: its BDEW code number or its global location number
            (GLN).
          examples:
            - '9903123000007'
          pattern: ^\d{13}$
          title: Grid Operator
          type: string
        market:
          const: DE
          description: The market of the accounting point.
          title: Market
          type: string
      required:
        - accounting_point_market_identifier
        - accounting_point_type
        - balance_group
        - customer
        - effective_date
        - grid_operator
        - market
      title: DeProductionSupplierSwitchCreate
      type: object
    DeSwitchCustomer:
      additionalProperties: false
      description: >-
        The customer at the accounting point, as the grid operator knows it.
        Engrate sends these values in the request.
      properties:
        city:
          description: The city of the customer address.
          title: City
          type: string
        country_code:
          description: The country of the customer address, as an ISO 3166-1 alpha-2 code.
          examples:
            - DE
          title: Country Code
          type: string
        house_number:
          description: The house number of the customer address.
          title: House Number
          type: string
        name:
          description: The name of the customer.
          title: Name
          type: string
        postcode:
          description: The postcode of the customer address.
          title: Postcode
          type: string
        street:
          description: The street of the customer address.
          title: Street
          type: string
      required:
        - city
        - country_code
        - house_number
        - name
        - postcode
        - street
      title: DeSwitchCustomer
      type: object
    DeEnfgCustomerDoesNotQualify:
      additionalProperties: false
      description: The customer does not qualify for reduced levies.
      properties:
        kind:
          const: customer_does_not_qualify
          title: Kind
          type: string
      required:
        - kind
      title: DeEnfgCustomerDoesNotQualify
      type: object
    DeEnfgCustomerQualifies:
      additionalProperties: false
      description: >-
        The customer qualifies for reduced levies for the reasons given, and
        Engrate will say so in the registration message to the grid operator.
        The customer must still notify the grid operator itself, as § 52 of the
        Energy Financing Act (Energiefinanzierungsgesetz) requires.
      properties:
        kind:
          const: customer_qualifies
          title: Kind
          type: string
        privilege_reasons:
          description: >-
            The reasons the customer qualifies. Each is a code from [List EnFG
            privilege
            reasons](/api-reference/structuring/list-enfg-privilege-reasons),
            and each code can occur once.
          items:
            $ref: '#/components/schemas/EnfgPrivilegeReasonCode'
          minItems: 1
          title: Privilege Reasons
          type: array
      required:
        - kind
        - privilege_reasons
      title: DeEnfgCustomerQualifies
      type: object
    DeEnfgLocationDoesNotQualify:
      additionalProperties: false
      description: >-
        The accounting point does not qualify for reduced levies, so no
        statement is made about the customer.
      properties:
        kind:
          const: location_does_not_qualify
          title: Kind
          type: string
      required:
        - kind
      title: DeEnfgLocationDoesNotQualify
      type: object
    EnfgPrivilegeReasonCode:
      enum:
        - ZU5
        - ZU6
        - ZU7
        - ZU8
        - ZU9
        - ZV0
        - ZV1
        - ZV2
        - ZV3
      examples:
        - ZU5
      title: EnfgPrivilegeReasonCode
      type: string
  securitySchemes:
    apiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.