{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/meld/json-schema/meld-payment-transaction-response20250304-schema.json",
  "title": "PaymentTransactionResponse20250304",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/meld-retail-ramp-api-openapi.yml#/components/schemas/PaymentTransactionResponse20250304",
  "type": "object",
  "properties": {
    "transaction": {
      "description": "Payment transaction information",
      "allOf": [
        {
          "$ref": "#/$defs/PaymentTransactionOutput20250304"
        }
      ]
    }
  },
  "$defs": {
    "CryptoDetails20250304": {
      "type": "object",
      "properties": {
        "blockchainTransactionId": {
          "type": "string",
          "description": "The transaction id on the blockchain"
        },
        "chainId": {
          "type": "string",
          "description": "A unique identifier that represents a blockchain network. The chainId of a particular network is standard everywhere."
        },
        "destinationWalletAddress": {
          "type": "string",
          "description": "The wallet address that the crypto is sent to. This is usually the user's wallet address for buy and transfer transactions, and the onramp's wallet address for sell transactions."
        },
        "institution": {
          "type": "string",
          "description": "The institution used to execute the transaction. Only applicable for transfers currently."
        },
        "networkFee": {
          "type": "number",
          "description": "This fee is paid to cryptocurrency miners, which are the systems that process the transactions"
        },
        "networkFeeInUsd": {
          "type": "number",
          "description": "This network fee in USD"
        },
        "partnerFee": {
          "type": "number",
          "description": "The partner fee amount"
        },
        "partnerFeeInUsd": {
          "type": "number",
          "description": "The partner fee in USD"
        },
        "sessionWalletAddress": {
          "type": "string",
          "description": "The wallet address passed into the /widget endpoint, typically of the user. This will often be the same as either the sourceWalletAddress or the destinationWalletAddress."
        },
        "sourceWalletAddress": {
          "type": "string",
          "description": "The wallet address that the crypto comes from. This is usually the onramp's wallet address for buy transactions, and the user's wallet address for transfer and sell transactions."
        },
        "swapFee": {
          "type": "number",
          "description": "The swap fee amount charged by the swap provider for ramp+swap transactions"
        },
        "swapFeeInUsd": {
          "type": "number",
          "description": "The swap fee in USD"
        },
        "totalFee": {
          "type": "number",
          "description": "The total amount of fees that will be charged"
        },
        "totalFeeInUsd": {
          "type": "number",
          "description": "The total fee in USD"
        },
        "transactionFee": {
          "type": "number",
          "description": "The fee amount charged by the service provider to process your customer's purchase"
        },
        "transactionFeeInUsd": {
          "type": "number",
          "description": "The transaction fee in USD"
        }
      }
    },
    "MultiFactorAuthorizationStatusOutput": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "description": "How the card details were authorized",
          "enum": [
            "SMS",
            "CARD",
            "EMAIL",
            "THREE_DS"
          ]
        },
        "submitted": {
          "type": "boolean",
          "default": false,
          "description": "Return ***True*** if the information was submitted"
        },
        "successful": {
          "type": "boolean",
          "default": false,
          "description": "Return ***True*** if the submitted information is a match"
        },
        "url": {
          "type": "string",
          "description": "URL used to perform authorization (if applicable)"
        }
      }
    },
    "PaymentDetails": {
      "type": "object",
      "properties": {
        "authAmount": {
          "type": "number",
          "description": "The amount authorized to be charged (must be greater than the amount intended to be collected.) Note that the number of digits with a decimal point varies with the currency. Reference the list of active codes of official ISO 4217 currency names."
        },
        "captureAmount": {
          "type": "number",
          "description": "The amount captured (can be less than the amount intended to be collected.) Note that the number of digits with a decimal point varies with the currency. Reference the list of active codes of official ISO 4217 currency names."
        }
      }
    },
    "PaymentTransactionOutput20250304": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "Your account Id"
        },
        "countryCode": {
          "type": "string",
          "description": "The ISO 3166 2-digit country code."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "An ISO 8601 DateTime at which the object was created."
        },
        "cryptoDetails": {
          "description": "Details of the crypto currency purchase, sale, or transfer",
          "allOf": [
            {
              "$ref": "#/$defs/CryptoDetails20250304"
            }
          ]
        },
        "customer": {
          "description": "Your customer's details"
        },
        "description": {
          "type": "string",
          "description": "An arbitrary string which you can attach to this transaction. It is displayed when in the web interface alongside the charge."
        },
        "destinationAmount": {
          "type": "number",
          "description": "The destination amount of the transaction, e.g. the amount of crypto currency purchased"
        },
        "destinationCurrencyCode": {
          "type": "string",
          "description": "Three-letter ISO currency code. Must be a supported currency"
        },
        "externalCustomerId": {
          "type": "string",
          "description": "Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity."
        },
        "externalReferenceId": {
          "type": "string",
          "description": "Your optional reference id provided during transaction creation"
        },
        "externalSessionId": {
          "type": "string",
          "description": "The external Id of the session."
        },
        "externalSubaccountCustomerId": {
          "type": "string",
          "description": "Optional external identifier for the sub-account customer this transaction belongs to. Used for tracking when multiple businesses operate under one Meld account. A sub-account customer must be created first before it can be referenced."
        },
        "fiatAmountInUsd": {
          "type": "number",
          "description": "The fiat amount of the transaction in usd"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for this transaction"
        },
        "isImported": {
          "type": "boolean",
          "default": false,
          "description": "Return ***True*** if this transaction was initiated outside Meld"
        },
        "isPassthrough": {
          "type": "boolean",
          "default": false,
          "description": "Return ***True*** if the passthrough credentials were used"
        },
        "key": {
          "type": "string",
          "description": "Pagination key, may be used with the \"after\" parameter in search requests.  Only set and relevant for paginated calls"
        },
        "multiFactorAuthorizationStatus": {
          "type": "array",
          "description": "The transaction required multi-factor authentication methods, and their current status. When required, must be approved for the purchase tobe completed successfully.",
          "items": {
            "$ref": "#/$defs/MultiFactorAuthorizationStatusOutput"
          },
          "uniqueItems": true
        },
        "orderId": {
          "type": "string",
          "description": "Unique identifier for the order associated with this transaction, when applicable"
        },
        "parentPaymentTransactionId": {
          "type": "string",
          "description": "The Id of the associated object for this line item"
        },
        "passthroughReference": {
          "type": "string",
          "description": "The unique reference you use to identify the partner on whose behalf you created this transaction.  This might be a String or UUID in your system to identify a merchant or partner.  This is needed so that you can associate passthrough transactions to your partners who may not be registered with Meld"
        },
        "paymentDetails": {
          "description": "payment details",
          "allOf": [
            {
              "$ref": "#/$defs/PaymentDetails"
            }
          ]
        },
        "paymentMethodType": {
          "type": "string",
          "description": "Payment Method type used for this transaction."
        },
        "serviceProvider": {
          "type": "string",
          "description": "The service provider used for this transaction"
        },
        "serviceProviderCreatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The ISO 8601 DateTime when the transaction was created on the service provider's side"
        },
        "serviceProviderDetails": {
          "type": "object",
          "additionalProperties": {},
          "description": "The service provider's details"
        },
        "serviceProviderTransactionUrl": {
          "type": "string",
          "description": "A link to the resource on the Service Provider, may not be present"
        },
        "serviceTransactionId": {
          "type": "string",
          "description": "The service provider's unique identifier for this transaction"
        },
        "sessionClientTags": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A map of client tags"
        },
        "sessionId": {
          "type": "string",
          "description": "The Id of the session."
        },
        "sourceAmount": {
          "type": "number",
          "description": "The amount of the transaction"
        },
        "sourceCurrencyCode": {
          "type": "string",
          "description": "Three-letter ISO currency code. Must be a supported currency"
        },
        "status": {
          "type": "string",
          "description": "The current status of the transaction"
        },
        "subaccountCustomerId": {
          "type": "string",
          "description": "Optional Meld customer id used to track the business sub-account this transaction belongs to when multiple businesses operate under one Meld account."
        },
        "transactionType": {
          "type": "string",
          "description": "The transaction's type"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Time at which the object was last updated. Measured in seconds since the Unix epoch."
        }
      },
      "required": [
        "createdAt",
        "id",
        "serviceProvider",
        "sessionId",
        "status",
        "transactionType",
        "updatedAt"
      ]
    }
  }
}