> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulate a card authorization

> Triggers a card authorization against a real card, exactly as if a merchant had initiated it. Use this to test authorization flows, webhook handling, and decline scenarios end-to-end.

**Sandbox only.** This endpoint returns `404 Not Found` in production environments.



## OpenAPI

````yaml /openapi.json post /simulate/transactions/authorize
openapi: 3.0.3
info:
  title: Issuing API
  description: This is the specification for Rain's Issuing API.
  termsOfService: https://www.rain.xyz/legal/authorized-user-terms
  contact:
    email: support@rain.xyz
  version: 1.3.0
servers:
  - url: https://api-dev.rain.xyz/v1
    description: Sandbox server
  - url: https://api.rain.xyz/v1
    description: Production server
security: []
tags:
  - name: paymentRoutes
    description: >-
      **Endpoint Migration:** The `/v1/automations` endpoints have been renamed
      to `/v1/payment-routes`. The old `/v1/automations` paths remain available
      as deprecated aliases during migration. Update your integrations to use
      `/v1/payment-routes` as the deprecated endpoints will be removed in a
      future release.
  - name: simulate
    description: >-
      Transaction simulation endpoints for testing integration flows in
      non-production environments. These endpoints let you trigger transaction
      events programmatically to automate integration tests and verify webhook
      handling without depending on external systems or staging real deposits.
      **Sandbox only** — all simulation endpoints return `404 Not Found` in
      production.
  - name: raindrops
    description: >-
      Rewards and points management endpoints. Custom API keys need
      `raindrops:read`/`raindrops:write` for general rewards endpoints and
      `raindrops-travel:read`/`raindrops-travel:write` for travel redemption
      endpoints.
    x-group: rewards
paths:
  /simulate/transactions/authorize:
    post:
      tags:
        - simulate
      summary: Simulate a card authorization
      description: >-
        Triggers a card authorization against a real card, exactly as if a
        merchant had initiated it. Use this to test authorization flows, webhook
        handling, and decline scenarios end-to-end.


        **Sandbox only.** This endpoint returns `404 Not Found` in production
        environments.
      operationId: simulateTransactionAuthorize
      requestBody:
        description: Card authorization simulation request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulateAuthorizeRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateTransactionResponse'
        '400':
          description: >-
            Invalid body — missing required fields, invalid cardId format, or
            invalid declineReason value
        '404':
          description: >-
            Endpoint not available in production, access is not enabled for your
            tenant, or the card does not exist
        '500':
          description: >-
            Card validation failed, invalid currency, or unhandled error during
            simulation
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SimulateAuthorizeRequest:
      type: object
      required:
        - cardId
        - amount
        - currency
        - merchantName
        - merchantCategoryCode
      properties:
        cardId:
          type: string
          format: uuid
          description: >-
            The Rain card ID to authorize against. Must belong to the calling
            tenant.
        amount:
          type: integer
          minimum: 1
          description: >-
            The transaction amount in cents (merchant currency). Must be a
            positive integer.
        currency:
          type: string
          description: The merchant currency code (for example, USD, EUR, GBP).
        merchantName:
          type: string
          description: The merchant name.
        merchantCategoryCode:
          type: string
          description: >-
            The merchant category code (MCC). For example, 5814 for fast food
            restaurants.
        declineReason:
          type: string
          description: Simulate a declined authorization.
          enum:
            - account_credit_limit_exceeded
            - card_locked
            - card_canceled
            - card_not_activated
            - blocked_mcc
            - blocked_merchant
            - balance_inquiry_not_permitted
            - expiry_mismatch
            - cvv_mismatch
            - invalid_pin
            - restricted_country
    SimulateTransactionResponse:
      type: object
      required:
        - transactionId
        - status
      properties:
        transactionId:
          type: string
          format: uuid
          description: The transaction ID.
        status:
          type: string
          enum:
            - authorized
            - declined
            - settled
          description: The transaction status.
        declinedReason:
          type: string
          description: Present when status is declined. The reason for the decline.
        completionReason:
          type: string
          enum:
            - SETTLEMENT
            - REFUND
          description: Present when status is settled. Either SETTLEMENT or REFUND.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Api-Key
      in: header

````