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

# Reject restriction order

> Rejects a restriction order to prevent execution.



## OpenAPI

````yaml post /api/v1/orders/{docId}:reject
openapi: 3.0.1
info:
  description: >
    # General info

    ## Base API URL for environments:

    * TEST: https://api.plais-sandbox.finventi.com

    * PROD: https://api.plais.finventi.com


    # Authentication

    <b>NOTE:</b> IP whitelisting is mandatory to gain access to our APIs in both
    TEST and PROD environments. To register your IPs, please contact
    `connectors-support@inventi.lt`.


    Our API uses OAuth 2.0 for authentication. To access the API, you need to
    obtain a bearer token from the authorization server.


    ### Obtain a Bearer Token

    To get a bearer token, use the following cURL command:


    ```

    curl -X POST \

    --location
    '<auth-server-url>/realms/<client-name>/protocol/openid-connect/token' \

    --header 'Content-Type: application/x-www-form-urlencoded' \

    --data-urlencode 'grant_type=client_credentials' \

    --data-urlencode 'client_id=api-plais-client' \

    --data-urlencode 'client_secret=<client-secret>'

    ```


    where:


    `<auth-server-url>` is either `https://auth.sandbox.finventi.com/` (TEST) or
    `https://auth.finventi.com/` (PROD).


    `<client-ID>` is a value of TenantID that was assigned by INVENTI team
    during initial configuration and could be found in Configuration Matrix that
    was shared to your representative.


    `<client-name>` is a value that can be obtained by logging into SEPA
    Dashboard UI and going to <i>User Management</i> -> <i>Clients</i> ->
    `api-plais-client` -> <i>Credentials</i> -> <i>Client Secret</i>.


    <b>NOTE:</b> The token is valid for 45 minutes.


    ### Include the Bearer Token in Requests

    Include the obtained token in the `Authorization` header of your API
    requests with the `Bearer` prefix:


    ```

    Authorization: Bearer <bearer-token>

    ```


    ### Example Request:

    ```

    curl --location --request POST
    'https://api.plais-sandbox.finventi.com/api/v1/orders' \

    --header 'Authorization: Bearer <bearer-token>' \

    ```
  title: PLAIS API
  version: 0.1.0
servers:
  - description: TEST environment
    url: https://api.plais-sandbox.finventi.com
security: []
paths:
  /api/v1/orders/{docId}:reject:
    post:
      tags:
        - Restriction orders
      summary: Reject restriction order
      description: Reject restriction order
      operationId: reject_1
      parameters:
        - description: Restriction order document ID
          in: path
          name: docId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectRestrictionOrderDto'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestrictionOrderAcceptedResponseDto'
          description: Result of restriction order confirmation
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Tenant does not have an access to the resource
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Restriction order is not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Restriction order already is confirmed or rejected
components:
  schemas:
    RejectRestrictionOrderDto:
      properties:
        reason:
          description: Rejection reason
          enum:
            - NO_ACCOUNT
            - PAYER_ERROR
            - PAYEE_ERROR
            - NO_AGREEMENT
            - NO_FUNDS
            - ILLEGAL_OPERATION
            - TO_CARD_FILE
            - NO_PRIMARY_DOC
            - ILLEGAL_AMOUNT
            - NO_PAYEE_CODE
            - NOT_UNIQUE
            - INCORRECT_RANGE
            - FORMAT_ERROR
            - EXECUTED
            - NO_ID
            - CLOSED_ID
            - ILLEGAL_ACCOUNT_TYPE
            - ILLEGAL_REFERENCE_CODE
            - ILLEGAL_CURRENCY
            - UNKNOWN_ERROR
          type: string
      required:
        - reason
      type: object
    RestrictionOrderAcceptedResponseDto:
      properties:
        result:
          $ref: '#/components/schemas/RestrictionOrderAcceptedDto'
      required:
        - result
      type: object
    ErrorResponse:
      description: Error response
      properties:
        code:
          description: Code of error
          type: string
        data:
          $ref: '#/components/schemas/ErrorResponseData'
        message:
          description: Error message
          type: string
      required:
        - code
      type: object
    RestrictionOrderAcceptedDto:
      description: Result of the restriction order posting
      properties:
        accepted:
          description: Message ID of the restriction order instruction
          type: string
      required:
        - accepted
      type: object
    ErrorResponseData:
      description: Error wrapper containing all occurred errors
      properties:
        errors:
          description: All occurred errors
          items:
            $ref: '#/components/schemas/ErrorResponseViolation'
          type: array
        message:
          description: Generic message for occurred errors
          type: string
      required:
        - errors
      type: object
    ErrorResponseViolation:
      description: Single error wrapper
      properties:
        code:
          description: Error code
          type: string
        field_name:
          description: Field name which failed
          type: string
        message:
          description: Error message
          type: string
        value:
          description: Value which was invalid
          type: string
      type: object

````