{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/silvercar/json-schema/silvercar-admin-contract-payment-response-schema.json",
  "title": "AdminContractPaymentResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/silvercar-invoicing-api-openapi.yml#/components/schemas/AdminContractPaymentResponse",
  "type": "object",
  "required": [
    "id",
    "created_at",
    "amount",
    "refundable_amount",
    "status",
    "provider",
    "links"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "description": "Payment ID"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Time that payment was created"
    },
    "last_four": {
      "type": "string",
      "description": "Last four digits of the payment method"
    },
    "card_type": {
      "type": "string",
      "description": "Card type of the payment method"
    },
    "amount": {
      "type": "number",
      "format": "float",
      "description": "Total payment amount"
    },
    "error_code": {
      "type": "number",
      "description": "payment code returned by the payment processor on failed payments"
    },
    "provider": {
      "type": "string",
      "description": "Payment processor provider"
    },
    "refund_of_id": {
      "type": "integer",
      "description": "If this payment is a refund, the ID of the original payment"
    },
    "refundable_amount": {
      "type": "number",
      "format": "float",
      "description": "If this payment is a refund, the total amount refunded so far on the original payment"
    },
    "status": {
      "type": "string",
      "description": "Status of the payment transaction",
      "enum": [
        "authorization_expired",
        "authorized",
        "completed",
        "failed",
        "pending"
      ]
    },
    "links": {
      "properties": {
        "contract": {
          "$ref": "#/$defs/HypermediaLink"
        }
      }
    }
  },
  "$defs": {
    "HypermediaLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the associated resource"
        },
        "href": {
          "type": "string",
          "description": "Link to the associated resource"
        }
      }
    }
  }
}