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

# Post transactionsscenarios run

> Runs one scenario against a card and returns the result of each step.



## OpenAPI

````yaml https://core.sandbox.gnosispay.in/simulator-api/openapi.json post /transactions/scenarios/{name}/run
openapi: 3.2.0
info:
  title: Simulator Service
  description: >-
    Card transaction simulator for sandbox/staging environments; the server
    never runs in production. Authenticates via HTTP Basic Auth with username
    "simulator" and the configured password.
  version: 0.0.0
servers: []
security:
  - BasicAuth: []
tags:
  - name: Simulator
paths:
  /transactions/scenarios/{name}/run:
    post:
      tags:
        - Simulator
      description: Runs one scenario against a card and returns the result of each step.
      operationId: TransactionScenarios_run
      parameters:
        - name: name
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ScenarioName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunScenarioRequest'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunScenarioResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ScenarioName:
      type: string
      enum:
        - purchase_auth_equal_clearing
        - purchase_overcapture
        - purchase_undercapture
        - purchase_reversal
        - purchase_bigger_replacement
        - purchase_lower_replacement
        - purchase_auth_only
        - purchase_partial_cancellation_part_1
        - purchase_partial_cancellation_part_2
        - purchase_full_cancellation_part_1
        - purchase_full_cancellation_part_2
        - national_withdrawal_auth_clearing
        - international_purchase_auth_clearing
        - international_withdrawal_auth_clearing
        - credit_voucher_auth_confirmation
        - international_credit_voucher_auth_confirmation
        - brl_cross_currency_auth_clearing
        - brl_cross_currency_reversal
      description: >-
        Name of a simulation scenario available to run. Amounts are in the run
        currency unless the scenario names one.
    RunScenarioRequest:
      type: object
      required:
        - card_id
      properties:
        card_id:
          $ref: '#/components/schemas/uuid'
          description: Card to run the scenario against
        authorization_code:
          type: string
          description: >-
            Authorization code from a previous run. Required when the scenario
            requires it; seeds the first step when that step is not an
            authorization.
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: >-
            ISO 4217 alphabetic currency code of the scenario steps; any code
            the card processor accepts. Steps pinned to a currency, such as the
            BRL cross-currency scenarios, keep their own.
          default: USD
    RunScenarioResponse:
      type: object
      required:
        - scenario_name
        - status
        - steps
        - steps_requests
      properties:
        scenario_name:
          type: string
          description: Name of the scenario that ran
        status:
          $ref: '#/components/schemas/ScenarioRunStatus'
          description: >-
            "passed" when every step ran and matched its expectation, "failed"
            otherwise
        steps:
          type: array
          items:
            $ref: '#/components/schemas/ScenarioStepResult'
          description: >-
            Result of each executed step. A failed step stops the run, so later
            steps are absent.
        steps_requests:
          type: array
          items:
            $ref: '#/components/schemas/SimulateTransactionRequest'
          description: >-
            Payload sent to /transactions/simulate for each executed step, in
            order.

            Each entry can be replayed as-is against /transactions/simulate.
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
    uuid:
      type: string
      format: uuid
    ScenarioRunStatus:
      type: string
      enum:
        - passed
        - failed
      description: Overall outcome of a scenario run.
    ScenarioStepResult:
      type: object
      required:
        - index
        - transaction_type
        - amount
        - currency
      properties:
        index:
          type: integer
          format: int32
          description: Zero-based position of the step in the scenario
        transaction_type:
          $ref: '#/components/schemas/TransactionType'
          description: Type of transaction the step simulated
        amount:
          type: string
          description: Transaction amount in major units
        currency:
          type: string
          description: ISO 4217 currency code
        operation:
          $ref: '#/components/schemas/TransactionOperation'
          description: Transaction operation, when the step set one
        replacement_amount:
          type: string
          description: New amount for a replacement step
        status:
          $ref: '#/components/schemas/SimulationStatus'
          description: >-
            Simulation status. Absent when the simulator call itself failed (see
            error).
        authorization_code:
          type: string
          description: Authorization code the step returned
        denial_code:
          type: string
          description: Denial code. Only present when the step was denied.
        denial_reason:
          type: string
          description: >-
            Human-readable reason for denial. Only present when the step was
            denied.
        expected_status:
          $ref: '#/components/schemas/SimulationStatus'
          description: Status the step was expected to return
        matched_expectation:
          type: boolean
          description: >-
            Whether the actual status matched expected_status. Only present when
            the step carries an expectation.
        error:
          type: string
          description: Error message when the simulator call itself failed
      description: Result of one executed scenario step.
    SimulateTransactionRequest:
      type: object
      required:
        - transaction_type
        - card_id
        - amount
        - currency
      properties:
        transaction_type:
          $ref: '#/components/schemas/TransactionType'
          description: Type of transaction to simulate
        card_id:
          $ref: '#/components/schemas/uuid'
          description: Card ID
        amount:
          type: string
          description: Transaction amount in major units (e.g., "100.50" for $100.50)
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: ISO 4217 alphabetic currency code (e.g. USD, EUR, BRL, JPY)
        authorization_code:
          type: string
          description: >-
            Authorization code from previous authorization (required for
            reversal, replacement, clearing, and clearing_cancellation)
        replacement_amount:
          type: string
          description: New amount for replacement (required for replacement type)
        merchant_name:
          type: string
          description: Merchant name (defaults to "TEST MERCHANT")
        merchant_code:
          type: string
          description: Merchant Category Code (defaults to "5541")
        operation:
          $ref: '#/components/schemas/TransactionOperation'
          description: >-
            Transaction operation type. Determines the processing code sent to
            the network.

            When omitted, defaults to "purchase" for debit transactions.
        3ds:
          type: boolean
          description: >-
            Require an out-of-band 3DS decision before sending the authorization
            to the card processor.
      examples:
        - transaction_type: authorization
          card_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
          amount: '100.50'
          currency: USD
          merchant_name: COFFEE SHOP
          merchant_code: '5812'
    TransactionType:
      type: string
      enum:
        - authorization
        - reversal
        - replacement
        - clearing
        - clearing_cancellation
    TransactionOperation:
      type: string
      enum:
        - credit_reversal
        - credit_transfer
        - credit_voucher
        - debit_reversal
        - debit_transfer
        - deposit_by_bill
        - international_credit_voucher
        - international_purchase
        - international_purchase_reversal
        - international_withdrawal
        - national_withdrawal
        - purchase
        - purchase_quasi_cash
        - refund_purchase
        - reversal_international_withdrawal
        - reversal_purchase_quasi_cash
        - reverse_national_withdrawal
        - utilities_payment
      description: >-
        Transaction operation determines the processing code sent to the card
        network.
    SimulationStatus:
      type: string
      enum:
        - approved
        - denied
  securitySchemes:
    BasicAuth:
      type: http
      scheme: Basic

````

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