{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/osis-co/json-schema/osis-co-payment-request-schema.json",
  "title": "PaymentRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/osis-co-openapi.json#/components/schemas/PaymentRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "agent_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "conversation_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "contact_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": [
        "string",
        "null"
      ]
    },
    "amount_cents": {
      "type": "integer",
      "description": "Amount in cents (or the currency's smallest unit). For Shopify, this is an estimate until the paid order is confirmed."
    },
    "currency": {
      "type": "string"
    },
    "amount_formatted": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "creator_name": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "paid",
        "canceled",
        "partially_refunded",
        "refunded"
      ],
      "description": "pending: waiting for payment. paid: the provider confirmed it. canceled: you canceled a Whop or Stripe request, or the order was canceled in Shopify. partially_refunded and refunded: part or all of a Shopify payment was refunded."
    },
    "refunded_cents": {
      "type": "integer",
      "minimum": 0,
      "description": "Total refunded so far, in the payment's currency. 0 if nothing was refunded. Only Shopify reports refunds for now."
    },
    "refunded_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the latest refund came in."
    },
    "canceled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the order was canceled in Shopify. Null for requests canceled in Comms."
    },
    "settlement": {
      "type": "string",
      "enum": [
        "org",
        "platform"
      ]
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "checkout_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "rail": {
      "type": "string",
      "enum": [
        "whop",
        "stripe",
        "shopify"
      ],
      "deprecated": true
    },
    "whop_plan_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "whop_checkout_config_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "whop_payment_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "stripe_checkout_session_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    },
    "paid_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "provider": {
      "type": "string",
      "enum": [
        "whop",
        "shopify",
        "stripe"
      ]
    }
  },
  "required": [
    "id",
    "amount_cents",
    "currency",
    "status",
    "rail",
    "url",
    "refunded_cents",
    "provider"
  ]
}