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

# Simulate clearing or refund

> Simulate an `authorization.clearing` type transaction by including the `original_transaction_token` and `amount` in your request. To simulate a refund type transaction, set the `is_refund` field to true.




## OpenAPI

````yaml openapi-v1.json post /cards/transaction_simulations/clearing
openapi: 3.0.3
info:
  description: >-
    This is the official reference documentation for Synctera APIs. If you need
    something specific or have a question, <a class='text-blue-600'
    href='https://synctera.com/contact-us' target='_blank'
    rel='noreferrer'>contact us</a>.</p>
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  title: Synctera API
  version: 1.181.0
servers:
  - description: Production
    url: https://api.synctera.com/v1
  - description: Sandbox (no real world financial impact)
    url: https://api-sandbox.synctera.com/v1
security:
  - bearerAuth: []
tags:
  - description: |
      Requests to create and manage Rewards
    name: Rewards (beta)
  - description: Requests to generate simulated webhooks
    name: Card Webhook Simulations
  - description: >-
      Testing endpoints to simulate in-store cash deposits. Available in sandbox
      environments only.
    name: In-Store Cash Deposit Simulations
  - description: Create and manage spending controls
    name: Spend Controls (beta)
  - description: Rates
    name: Rates
  - description: Requests to create and manage webhooks
    name: Webhooks
  - description: Tenant Config
    name: Tenant Config
  - description: FDX authentication and data transfer using Plaid Core Exchange
    name: Plaid Core Exchange (beta)
  - description: Create and manage disputes
    name: Disputes
  - description: Requests to simulate card payments
    name: Card Simulations
  - description: |
      Manage fee products and fee configs for automated fee collection
    name: Fee Products
  - description: Apple Pay APIs
    name: Apple Pay
  - description: Lending Config
    name: Lending Config
  - description: Payments related to lending accounts
    name: Payments
  - description: Manage negative balance processes
    name: Negative Balance
  - description: Configuration for mapping LoanPro events to Payola transaction parameters
    name: LoanPro Transaction Event Config
  - description: Requests to generate simulated transactions
    name: Cash Transaction Simulations (alpha)
  - description: Create and manage transactions
    name: Transactions (beta)
  - description: Autopay payment records for billing periods
    name: Autopays
  - description: Create and manage accounts
    name: Accounts
  - description: |
      Requests to create and manage batch payments
    name: Batch Payments (alpha)
  - description: Billing rates
    name: Billing Rates
  - description: Bank Delinquency Configuration
    name: Bank Delinquency Configuration
  - description: >-
      Rules that map a posted payment transaction (bank/partner + transaction
      attributes) to a regulatory payment code. NULL match columns act as
      wildcards.
    name: Payment Code Configuration
  - description: Create and manage Synctera Pay templates
    name: SyncteraPay
  - description: |
      Manage reward products and reward configs for automated cashback rewards
    name: Reward Products
  - description: Requests to create and manage card disputes
    name: Card Disputes
  - description: >-
      Per bank/partner account-type mapping to FFIEC collateral codes used for
      regulatory call report furnishment.
    name: Collateral Code Configuration
  - description: Bulk card issuance
    name: Bulk Issuance
  - description: Autopay configuration management for lending accounts
    name: Autopay Configs
  - description: Request to create and manage exclusions
    name: Statements
  - description: Create and manage barcodes for in-store cash deposits
    name: In-Store Cash Deposits
  - description: Customer Service Details for disputes and billing inquiries
    name: Customer Service Details
  - description: Create a credit application.
    name: Applications (beta)
  - description: Requests to generate simulated transactions
    name: Card Transaction Simulations
  - description: Billing period summaries
    name: Billing Period Summaries
  - description: Requests to issue and manage cards
    name: Cards
  - description: Push and pull from cards
    name: External Cards
  - description: |
      Requests to create and manage fees
    name: Fees (beta)
paths:
  /cards/transaction_simulations/clearing:
    summary: Simulate Clearing or Refund
    post:
      tags:
        - Card Transaction Simulations
      summary: Simulate clearing or refund
      description: >
        Simulate an `authorization.clearing` type transaction by including the
        `original_transaction_token` and `amount` in your request. To simulate a
        refund type transaction, set the `is_refund` field to true.
      operationId: simulateClearing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/clearing_model'
        description: Transaction clearing or refund details
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/simulation_response_model'
          description: Success
        '400':
          $ref: '#/components/responses/bad_request'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internal_server_error'
components:
  schemas:
    clearing_model:
      example:
        amount: 80
        card_acceptor:
          address: address
          city: city
          country: country
          ecommerce_security_level_indicator: ecommerce_security_level_indicator
          mcc: mcc
          name: name
          partial_approval_capable: false
          state: state
          zip: zip
        force_post: false
        is_refund: false
        mid: mid
        network_fees:
          - amount: 123
            credit_debit: C
            type: ISSUER_FEE
          - amount: 123
            credit_debit: C
            type: ISSUER_FEE
        original_transaction_id: original_transaction_id
      properties:
        amount:
          description: >-
            The amount of the transaction in the smallest whole denomination of
            the applicable currency (eg. For USD use cents)
          type: integer
        card_acceptor:
          $ref: '#/components/schemas/card_acceptor_model'
        force_post:
          default: false
          type: boolean
        is_refund:
          default: false
          type: boolean
        mid:
          maxLength: 50
          minLength: 1
          type: string
        network_fees:
          items:
            $ref: '#/components/schemas/network_fee_model'
          type: array
        original_transaction_id:
          format: uuid
          type: string
      required:
        - amount
        - original_transaction_id
      type: object
    simulation_response_model:
      type: object
    card_acceptor_model:
      example:
        address: address
        city: city
        country: country
        ecommerce_security_level_indicator: ecommerce_security_level_indicator
        mcc: mcc
        name: name
        partial_approval_capable: false
        state: state
        zip: zip
      properties:
        address:
          maxLength: 255
          type: string
        city:
          maxLength: 40
          type: string
        country:
          type: string
        ecommerce_security_level_indicator:
          type: string
        mcc:
          maxLength: 5
          type: string
        name:
          maxLength: 50
          type: string
        partial_approval_capable:
          default: false
          type: boolean
        state:
          type: string
        zip:
          maxLength: 10
          type: string
      type: object
    network_fee_model:
      example:
        amount: 123
        credit_debit: C
        type: ISSUER_FEE
      properties:
        amount:
          description: >-
            The amount of the fee in the smallest whole denomination of the
            applicable currency (eg. For USD use cents)
          type: integer
        credit_debit:
          description: C = credit; D = debit
          enum:
            - C
            - D
          type: string
        type:
          enum:
            - ACQUIRER_FEE
            - CROSS_BORDER_ISSUER_FEE
            - CUR_CONV_CARDHOLDER_FEE
            - CUR_CONV_ISSUER_FEE
            - INTERCHANGE_FEE
            - ISSUER_FEE
            - PINDEBIT_ASSOC_FEE
            - SWITCH_FEE
          type: string
      required:
        - amount
        - type
      type: object
    error:
      description: Synctera error responses in API v1 implement a custom error schema.
      properties:
        code:
          description: >
            A machine-readable string that identifies the error for programmatic
            use.
          example: BAD_REQUEST_BODY
          type: string
        detail:
          description: |
            A human-readable string explaining this particular error.
          example: 'Missing required fields: first_name, dob'
          type: string
        status:
          description: HTTP status code for this response
          example: 400
          type: integer
      title: Synctera error response
      type: object
  responses:
    bad_request:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
      description: Bad request
    unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
      description: Unauthorized
    forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
      description: Forbidden
    internal_server_error:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
      description: Internal server error
  securitySchemes:
    bearerAuth:
      bearerFormat: api_key
      scheme: bearer
      type: http

````