{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paidnice-com/json-schema/paidnice-com-stripe-payment-schema.json",
  "title": "StripePayment",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paidnice-com-openapi.json#/components/schemas/StripePayment",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Paidnice Stripe payment id"
    },
    "status": {
      "type": "string",
      "enum": [
        "paid",
        "processing",
        "requires_action",
        "expired",
        "failed",
        "unknown",
        "started",
        "abandoned"
      ],
      "description": "paid, processing (bank debits clearing), requires_action (waiting on the customer), failed, unknown, started (checkout opened in the last 10 minutes), abandoned or expired (checkout not completed)"
    },
    "contactId": {
      "type": "integer",
      "description": "Id of the paying contact, as used by get_contact"
    },
    "contactName": {
      "type": "string",
      "description": "Name of the paying contact"
    },
    "date": {
      "type": "string",
      "description": "When the customer paid, or opened the checkout if they have not paid"
    },
    "amount": {
      "type": "number",
      "description": "Amount charged including any surcharge, in currency"
    },
    "currency": {
      "type": "string",
      "description": "ISO currency code of amount"
    },
    "surchargeAmount": {
      "type": "number",
      "description": "Card surcharge passed on to the customer, in currency"
    },
    "transactionAmount": {
      "type": "number",
      "description": "Amount in the currency Stripe charged, when it differs"
    },
    "transactionCurrency": {
      "type": "string",
      "description": "ISO currency code Stripe charged in, when it differs"
    },
    "stripeFeeAmount": {
      "type": "number",
      "description": "Stripe's fee, in the transaction currency"
    },
    "paymentMethodType": {
      "type": "string",
      "description": "Stripe payment method type"
    },
    "stripePaymentIntentId": {
      "type": "string",
      "description": "Stripe PaymentIntent id, to look the payment up in Stripe"
    },
    "receiptUrl": {
      "type": "string",
      "description": "Stripe receipt page for the payment"
    },
    "accountingSyncFailed": {
      "type": "boolean",
      "description": "True when recording the payment in Xero or QuickBooks failed"
    },
    "invoices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "Id of the invoice, as used by get_invoice"
          },
          "invoiceNumber": {
            "type": "string",
            "description": "Invoice number shown to the customer"
          },
          "amount": {
            "type": "number",
            "description": "Amount of the payment that went to this invoice"
          },
          "currency": {
            "type": "string",
            "description": "ISO currency code of amount"
          }
        },
        "required": [
          "invoiceId",
          "amount",
          "currency"
        ]
      },
      "description": "The invoices the payment was for and how much went to each"
    }
  },
  "required": [
    "id",
    "status",
    "contactId",
    "contactName",
    "date",
    "amount",
    "currency",
    "accountingSyncFailed",
    "invoices"
  ]
}