{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/zettle/main/json-schema/zettle-transaction.json",
  "title": "Zettle Transaction",
  "description": "A financial transaction in a merchant's Zettle preliminary or liquid account.",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "description": "The time when the transaction is made in the merchant's Zettle account (UTC).",
      "example": "2022-03-01T12:42:10"
    },
    "amount": {
      "type": "string",
      "description": "The amount of the transaction in the currency's smallest unit. Can be negative for refunds.",
      "example": "300"
    },
    "originatorTransactionType": {
      "type": "string",
      "description": "The type of the originating transaction.",
      "enum": [
        "ADJUSTMENT",
        "ADVANCE",
        "ADVANCE_DOWNPAYMENT",
        "ADVANCE_FEE_DOWNPAYMENT",
        "CASHBACK",
        "FAILED_PAYOUT",
        "FROZEN_FUNDS",
        "INVOICE_PAYMENT",
        "INVOICE_PAYMENT_FEE",
        "PAYMENT",
        "PAYMENT_FEE",
        "PAYMENT_PAYOUT",
        "PAYOUT"
      ],
      "example": "PAYOUT"
    },
    "originatorTransactionUuid": {
      "type": "string",
      "description": "The UUID v1 identifier of the originating transaction.",
      "format": "uuid",
      "example": "5e8673e4-a52f-11ec-b909-0242ac120002"
    }
  },
  "required": ["timestamp", "amount", "originatorTransactionType"]
}
