{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/entur/main/json-schema/entur-transaction-by-order-schema.json",
  "title": "TransactionByOrder",
  "description": "A transaction",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-personalisation-client-openapi.yml#/components/schemas/TransactionByOrder",
  "required": [
    "amount",
    "createdAt",
    "id",
    "memberId",
    "pointDefinitionId",
    "programId",
    "validFrom"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Generated identifier",
      "format": "int64"
    },
    "programId": {
      "type": "integer",
      "description": "The id of the program this transaction belongs to",
      "format": "int64"
    },
    "memberId": {
      "type": "integer",
      "description": "The ID of the member in the program this transaction belongs to",
      "format": "int64"
    },
    "amount": {
      "type": "number",
      "description": "The number of points of the definition this transaction gives"
    },
    "pointDefinitionId": {
      "type": "integer",
      "description": "The id of the point definition this transaction gives points of",
      "format": "int64"
    },
    "pointDefinitionReference": {
      "type": [
        "string",
        "null"
      ],
      "description": "The reference of the point definition this transaction gives points of"
    },
    "pointPeriodId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The id of the point period this transaction belongs to, if applicable",
      "format": "int64"
    },
    "createdAt": {
      "type": "string",
      "description": "The date and time when the transaction was created",
      "format": "date-time"
    },
    "updatedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time when the transaction was last updated",
      "format": "date-time"
    },
    "expireAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time when the transaction expires. If null, the transaction never expires.",
      "format": "date-time"
    },
    "cancelledAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time when the transaction was cancelled. If not null, the transaction is valid until this time.",
      "format": "date-time"
    },
    "validFrom": {
      "type": "string",
      "description": "The date and time the transaction is valid from.",
      "format": "date-time"
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "Metadata for the transaction"
    }
  }
}