---
title: "Bulk add a list of Open-Positions"
url: "https://apiportal-qa.np.six-group.com/apis/simulator-ch-qa-v1/versions/c729661a-062a-4141-9704-f637226fa5f0/operations/bulkAddOpenPositions"
---

> Full API specification: https://apiportal-qa.np.six-group.com/apis/simulator-ch-qa-v1/versions/c729661a-062a-4141-9704-f637226fa5f0.md

# Bulk add a list of Open-Positions

`POST` `/simulations/{simulationId}/open-positions/bulk-add`

Operation ID: `bulkAddOpenPositions`

Given a list of Open-Positions (initially, with no limit), it inserts and update (similar to PUT) the elements in the array

## Path parameters

- `simulationId` (string, required) - Resource ID in **UUID** format

## Request body (required)

Content types: `application/vnd.api+json`

## Responses

- `204` - Ok
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `415` - Unsupported Media Type
- `500` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.0.2
info:
  title: DCleaR - Risk Simulator API - v1
  version: 1.0.0
servers:
  - url: https://api-qa.np.six-group.com/clearing/risk/simulator/dev/v1
  - url: https://api-qa.np.p2p.six-group.com/clearing/risk/simulator/dev/v1
  - url: https://api-qa.np.fip.six-group.com/clearing/risk/simulator/dev/v1
paths:
  /simulations/{simulationId}/open-positions/bulk-add:
    parameters:
      - name: simulationId
        in: path
        description: Resource ID in **UUID** format
        required: true
        style: simple
        explode: false
        schema:
          type: string
        examples:
          UUID:
            value: 95b1b467-bd69-4436-8181-96c16408c230
    post:
      tags:
        - Open-Positions
      summary: Bulk add a list of Open-Positions
      description: Given a list of Open-Positions (initially, with no limit), it
        inserts and update (similar to PUT) the elements in the array
      operationId: bulkAddOpenPositions
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: "#/components/schemas/OpenPositionsInputJsonApiType"
            examples:
              List Open-Positions:
                value:
                  data:
                    - attributes:
                        date: 2022-01-02
                        riskGroupId: C1
                        compensationMemberId: A2
                        guaranteeAccount: G00001A23S
                        contract: CLE93211A2
                        buyVolume: 190003.0434
                        sellVolume: 73882.1234
                        price: 1.234543
                      id: ffc8ace6-611e-4e85-83d9-234814fd5fd6
                      type: open-position
                    - attributes:
                        date: 2022-01-03
                        riskGroupId: C1
                        compensationMemberId: A2
                        guaranteeAccount: G00001A23S
                        contract: CLE93211A2
                        buyVolume: 190003.0434
                        sellVolume: 73882.1234
                        price: 1.234543
                      id: 7813cb2b-0b37-4488-ba4d-c1a6181b1ec8
                      type: open-position
        required: true
      responses:
        "204":
          $ref: "#/components/responses/204OkNoContent"
        "400":
          $ref: "#/components/responses/400ImportOpenPositionsErrorResponse"
        "401":
          $ref: "#/components/responses/401SecurityLayerErrorResponse"
        "403":
          $ref: "#/components/responses/403SecurityLayerErrorResponse"
        "415":
          $ref: "#/components/responses/415ErrorResponse"
        "500":
          $ref: "#/components/responses/500ErrorResponse"
components:
  schemas:
    OpenPositionsInputJsonApiType:
      required:
        - data
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/OpenPositionType"
    OpenPositionType:
      type: object
      description: Data structure for all operations.
      allOf:
        - type: object
          properties:
            attributes:
              $ref: "#/components/schemas/OpenPositionAttributesType"
        - $ref: "#/components/schemas/BasicResourceType"
    UUIDType:
      pattern: ^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$
      type: string
      description: UUID type implementing the [RFC
        4122](https://www.ietf.org/rfc/rfc4122.txt).
      format: string
      example: 95b1b467-bd69-4436-8181-96c16408c230
    Error:
      required:
        - message
      type: object
      properties:
        message:
          type: string
          description: A human-readable explanation specific to this error.
          example: Unauthorized
        errorDetail:
          description: Additional information about the error.
          allOf:
            - $ref: "#/components/schemas/ErrorDetail"
      description: Description of an error to help remediation.
    OpenPositionAttributesType:
      type: object
      properties:
        date:
          type: string
          description: Creation date of the calculation
          format: date
          example: 2022-01-02
        riskGroupId:
          $ref: "#/components/schemas/RiskGroupIdType"
        compensationMemberId:
          pattern: ^[A-Z0-9]{2,3}$
          type: string
          description: Reference to compensation member
          example: A2
        guaranteeAccount:
          pattern: ^[A-Z0-9]{10}$
          type: string
          description: Guarantee account reference
          example: G00001A23S
        contract:
          pattern: ^[A-Z0-9]{10}$
          type: string
          description: Contract reference
          example: CLE93211A2
        buyVolume:
          type: number
          description: Buy Volume in traded currency defined in the account
          format: double
          example: 190003.0434
        sellVolume:
          type: number
          description: Buy Volume in traded currency defined in the account
          format: double
          example: 73882.1234
        price:
          type: number
          description: Contract price at date
          format: double
          example: 1.234543
      description: Basic attributes of the object.
    BasicResourceType:
      required:
        - type
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUIDType"
        type:
          type: string
          description: Type of the resource attributes being represented
          example: simulation
          enum:
            - simulation
            - calculation
            - result
            - open-position
            - import-open-positions
            - result-detail
            - report
    ErrorDetail:
      required:
        - status
      type: object
      properties:
        type:
          type: string
          description: >-
            A URI reference (RFC3986) that describes the problem type (in the
            context of the provided API).


            Should resolve to a human-readable document.
          format: uri
          default: about:blank
        title:
          type: string
          description: A short, human-readable summary of the problem type in English.
          example: Not Found
        status:
          maximum: 599
          minimum: 100
          type: integer
          description: The HTTP status code (RFC7231, Section 6) generated by the origin
            server for this occurrence of the problem.
          format: int32
          example: 400
        code:
          $ref: "#/components/schemas/ServerErrorCode"
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of the
            problem.
          example: ISIN 'US012071998' does not exist.
        instance:
          type: string
          description: A URI reference (RFC3986) that identifies the specific occurrence
            of the problem. It may or may not yield further information if
            dereferenced.
          format: uri
          example: https://www.example.com/books/1234
        missingParams:
          type: array
          items:
            $ref: "#/components/schemas/MissingParams"
        invalidParams:
          type: array
          items:
            $ref: "#/components/schemas/InvalidParams"
      description: Detailed description of an error to help remediation. It follows
        RFC 7807 (https://datatracker.ietf.org/doc/html/rfc7807).
    RiskGroupIdType:
      pattern: ^[A-Z0-9]{2}$
      type: string
      description: Risk Group ID Identification in DClear system.
      example: C1
    ServerErrorCode:
      pattern: ^[0-9A-Z_]{1,125}$
      type: string
      description: "An application specific error code that identifies univocally the
        error situation. "
      example: THIS_IS_ERROR_CODE
    MissingParams:
      type: object
      properties:
        in:
          $ref: "#/components/schemas/ParameterLocation"
        name:
          type: string
        reason:
          type: string
        code:
          $ref: "#/components/schemas/ServerErrorCode"
      description: "List of missing parameters.\r

        \r

        ***Please note that the API GW does syntax validation according to the
        OAS and will issue an error response in case of failure. Thus, this
        extension should only be used when the API server is not connected to
        via the API GW or if conditional presence conditions (that typically
        cannot be modeled in an OAS) are applicable.***"
      example:
        in: PATH
        name: paramName
        reason: The parameter 'paramName' is not present in PATH
        code: ERROR_INTERNAL
    InvalidParams:
      required:
        - in
        - name
        - value
      type: object
      properties:
        in:
          $ref: "#/components/schemas/ParameterLocation"
        name:
          type: string
          description: The name of the invalid parameter.
        reason:
          type: string
          description: The reason why the parameter's value is invalid.
        code:
          $ref: "#/components/schemas/ServerErrorCode"
        value:
          type: string
          description: The invalid value (as a string).
      description: "List of invalid parameters.\r

        \r

        ***Please note that the API GW does syntax validation according to the
        OAS and will issue an error response in case of failure. Thus, this
        extension should only be used when the API server is not connected to
        via the API GW or if additional (to what is defined in the OAS) checks
        are performed.***"
      example:
        in: PATH
        name: paramName
        reason: Internal functional validation has ended in failure
        value: "23.3"
        code: ERROR_INTERNAL
    ParameterLocation:
      type: string
      description: The location of the invalid parameter.
      enum:
        - BODY
        - PATH
        - QUERY
        - HEADER
  responses:
    204OkNoContent:
      description: Ok
      headers:
        X-Correlation-Id:
          style: simple
          explode: false
          schema:
            $ref: "#/components/schemas/UUIDType"
    400ImportOpenPositionsErrorResponse:
      description: Bad Request
      headers:
        X-Correlation-Id:
          style: simple
          explode: false
          schema:
            $ref: "#/components/schemas/UUIDType"
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            BadRequestMissingAttributes:
              value:
                message: Bad Requet
                errorDetail:
                  type: about:blank
                  title: Bad Request
                  status: 400
                  code: A123
                  detail: Wrong input value
                  missingParams:
                    - in: PATH
                      name: paramName
                      reason: The parameter 'paramName' is not present in PATH
                      code: ERROR_INTERNAL
                  invalidParams:
                    - in: PATH
                      name: paramName
                      reason: Internal functional validation has ended in failure
                      value: "23.3"
                      code: ERROR_INTERNAL
    401SecurityLayerErrorResponse:
      description: Unauthorized
      headers:
        X-Correlation-Id:
          style: simple
          explode: false
          schema:
            $ref: "#/components/schemas/UUIDType"
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            Unauthorized:
              value:
                message: No required TLS certificate was sent
                errorDetail:
                  title: Unauthorized
                  status: 401
                  detail: Client is not authenticated.
    403SecurityLayerErrorResponse:
      description: Forbidden
      headers:
        X-Correlation-Id:
          style: simple
          explode: false
          schema:
            $ref: "#/components/schemas/UUIDType"
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            Forbidden:
              value:
                message: Forbidden
                errorDetail:
                  title: Forbidden
                  status: 403
                  detail: Client is not authorized for this operation.
    415ErrorResponse:
      description: Unsupported Media Type
      headers:
        X-Correlation-Id:
          style: simple
          explode: false
          schema:
            $ref: "#/components/schemas/UUIDType"
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            UnsupportedMediaType:
              value:
                message: Unsupported Media Type
                errorDetail:
                  title: Unsupported Media Type
                  status: 415
                  detail: Content-Type is not compatible with application/vnd.api+json
    500ErrorResponse:
      description: Internal Server Error
      headers:
        X-Correlation-Id:
          style: simple
          explode: false
          schema:
            $ref: "#/components/schemas/UUIDType"
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            ServerError:
              value:
                message: Server error
                errorDetail:
                  title: Internal Server Error
                  status: 500
                  detail: Something went wrong.
```
