{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/marketsdk/json-schema/marketsdk-payment-object-schema.json",
  "title": "PaymentObject",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/marketsdk-openapi.json#/components/schemas/PaymentObject",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "payment"
      ]
    },
    "id": {
      "type": "string"
    },
    "order": {
      "type": "string"
    },
    "method": {
      "type": "string",
      "enum": [
        "checkout_session",
        "payment_intent"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "awaiting_payment",
        "succeeded",
        "canceled"
      ]
    },
    "amount": {
      "type": "number",
      "description": "Minor units."
    },
    "fee_amount": {
      "type": "number",
      "description": "The customer's platform fee. Minor units."
    },
    "currency": {
      "type": "string"
    },
    "checkout_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stripe-hosted checkout. Shown only while payment is due."
    },
    "client_secret": {
      "type": [
        "string",
        "null"
      ],
      "description": "For Stripe Elements on your own page. Shown only while payment is due."
    },
    "last_failure": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stripe's message for the last failed attempt to pay."
    },
    "amount_refunded": {
      "type": "number",
      "description": "Refunded or being refunded. Minor units."
    },
    "release": {
      "$ref": "#/$defs/PaymentReleaseObject"
    },
    "stripe": {
      "description": "Ids of the objects on your Stripe account.",
      "allOf": [
        {
          "$ref": "#/$defs/PaymentStripeObject"
        }
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "paid_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "canceled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "object",
    "id",
    "order",
    "method",
    "status",
    "amount",
    "fee_amount",
    "currency",
    "checkout_url",
    "client_secret",
    "last_failure",
    "amount_refunded",
    "release",
    "stripe",
    "metadata",
    "paid_at",
    "canceled_at",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "PaymentReleaseObject": {
      "type": "object",
      "properties": {
        "status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "held",
            "releasing",
            "released",
            "failed",
            "nothing_to_release",
            null
          ],
          "description": "Null until the buyer pays."
        },
        "amount": {
          "type": "number",
          "description": "Transferred to the seller's Stripe account. Minor units."
        },
        "amount_reversed": {
          "type": "number",
          "description": "Taken back from the seller for refunds after release. Minor units."
        },
        "failure": {
          "type": [
            "string",
            "null"
          ]
        },
        "released_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "status",
        "amount",
        "amount_reversed",
        "failure",
        "released_at"
      ]
    },
    "PaymentStripeObject": {
      "type": "object",
      "properties": {
        "payment_intent": {
          "type": [
            "string",
            "null"
          ]
        },
        "checkout_session": {
          "type": [
            "string",
            "null"
          ]
        },
        "charge": {
          "type": [
            "string",
            "null"
          ]
        },
        "transfer": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "payment_intent",
        "checkout_session",
        "charge",
        "transfer"
      ]
    }
  }
}