{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rozo-ai/json-schema/rozo-ai-payment-response-schema.json",
  "title": "PaymentResponse",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rozo-ai-openapi-v2.0.0.yaml#/components/schemas/PaymentResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "appId": {
      "type": "string"
    },
    "orderId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "payment_unpaid",
        "payment_started",
        "payment_payin_completed",
        "payment_payout_completed",
        "payment_completed",
        "payment_bounced",
        "payment_expired",
        "payment_refunded"
      ]
    },
    "errorCode": {
      "type": "string",
      "description": "Legacy error code, kept for backward compatibility. Prefer `bounceCode`."
    },
    "errorMessage": {
      "type": "string"
    },
    "bounceCode": {
      "type": "string",
      "description": "Present only when `status = payment_bounced`. A public reason\ncode, for example `destination_no_trustline`,\n`payout_below_minimum`, `underpaid` or `payout_delayed`; a reason\nthat cannot be shown publicly is reported under a related public\ncode where one exists, otherwise as `internal_error`. New codes\nmay be added, so handle unknown values.\n"
    },
    "refundStatus": {
      "type": "string",
      "enum": [
        "none",
        "pending",
        "sent",
        "confirmed"
      ],
      "description": "Refund state at the time of the response or event."
    },
    "refundTxHash": {
      "type": "string",
      "description": "Present only when a refund transaction is known."
    },
    "type": {
      "type": "string",
      "enum": [
        "exactIn",
        "exactOut"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "display": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "source": {
      "type": "object",
      "properties": {
        "chainId": {
          "type": "string"
        },
        "tokenSymbol": {
          "type": "string"
        },
        "tokenAddress": {
          "type": "string"
        },
        "amount": {
          "type": "string"
        },
        "receiverAddress": {
          "type": "string",
          "description": "Deposit address"
        },
        "receiverMemo": {
          "type": "string"
        },
        "fee": {
          "type": "string"
        },
        "senderAddress": {
          "type": "string"
        },
        "txHash": {
          "type": "string"
        },
        "amountReceived": {
          "type": "string"
        },
        "confirmedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "destination": {
      "type": "object",
      "properties": {
        "chainId": {
          "type": "string"
        },
        "receiverAddress": {
          "type": "string"
        },
        "receiverMemo": {
          "type": "string"
        },
        "tokenSymbol": {
          "type": "string"
        },
        "tokenAddress": {
          "type": "string"
        },
        "amount": {
          "type": "string"
        },
        "txHash": {
          "type": "string"
        },
        "confirmedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "webhookSecret": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    }
  }
}