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

# Send test authorization reversal request



## OpenAPI

````yaml test post /v1/authorizations/reversal
openapi: 3.0.3
info:
  version: '1'
  title: Test API
  description: >
    This API is only available in DEMO environment and intended solely for
    testing purposes.


    The API has two categories of endpoints:

    - **Endpoints for generating authorization message bodies from templates**
    (e.g. /v1/authorization-templates/request/retail-offline-pin,
    /v1/authorization-templates/request/retail-ecommerce)

      Calls to these endpoints DO NOT simulate sending of authorization messages. They only generate the correct message for endpoints of the second type based on a small number of Request parameters. The generated Response message should then be supplied into the next type of endpoints (described below) to actually simulate sending an authorization.

    - **Endpoints for sending authorization messages** (e.g.
    /v1/authorizations/request, /v1/authorizations/reversal)

      Calling these endpoints simulates an authorization coming from a payment scheme to Enfuce. These endpoints are characterized by a bigger number of Request parameters. For the Request Body, you can use the Response generated by the first type of endpoints.
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: https://integration-api-cat2.demo.ext.test.cia.enfuce.com/test-api
security: []
paths:
  /v1/authorizations/reversal:
    post:
      tags:
        - test-authorizations
      summary: Send test authorization reversal request
      operationId: postReversalRequest
      parameters:
        - name: auditUser
          in: query
          description: The audit user to log the request
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/reversalRequest'
      responses:
        '200':
          description: Reversal request succesfully executed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/authResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '500':
          description: API is having problems
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
components:
  requestBodies:
    reversalRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/reversalRequest'
  schemas:
    authResponse:
      description: Response on the authorisation request.
      type: object
      required:
        - metadata
        - transactionData
      properties:
        metadata:
          required:
            - mti
            - id
          properties:
            mti:
              $ref: '#/components/schemas/mti'
            id:
              $ref: '#/components/schemas/docId'
        transactionData:
          type: object
          required:
            - authResponseCode
            - retrievalReferenceNumber
          properties:
            authResponseCode:
              $ref: '#/components/schemas/authResponseCode'
            retrievalReferenceNumber:
              $ref: '#/components/schemas/retrievalReferenceNumber'
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred
    reversalRequest:
      type: object
      description: Reversal request
      required:
        - id
      properties:
        id:
          $ref: '#/components/schemas/docId'
        partialAmount:
          $ref: '#/components/schemas/money'
          description: >-
            In case of partial reversal, denotes the partial amount to reverse
            (expressed in transaction currency).
    mti:
      description: Message type indicator for authorisation message.
      type: string
      maxLength: 4
    docId:
      description: Unique identifier of authorisation request.
      type: string
      maxLength: 18
    authResponseCode:
      description: >
        Response to the authorisation. Indicates to the merchant if the
        authorisation was approved or declined.
      type: string
      maxLength: 2
    retrievalReferenceNumber:
      description: >
        Merchant/acquiring generated reference number for a purchase.

        Commonly used as the one of the main variables, in addition to cardId,
        to uniquely identify a transaction.

        Reference number is expected to remain the same for all messages during
        the transaction lifecycle (authorisation, clearing, reversals).


        This information can be used as one variable to match the authorisation
        message to purchase receipt data.
      type: string
      maxLength: 12
    money:
      description: Amount including currency.
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          example: 3.14
          minimum: 0
        currency:
          type: string
          format: iso4217-currencycode
          description: A valid ISO 4217 currency code
          example: EUR

````