{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gsma/json-schema/gsma-create-refund-schema.json",
  "title": "CreateRefund",
  "description": "Information to create a Refund resource.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gsma-refund-api-openapi.yml#/components/schemas/CreateRefund",
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string",
      "description": "Type of refund.\n- `total` stands for a final refund, where whole amount is refunded so as it is not indicated by API Consumer. No more refunds are allowed for that `paymentId`.\n- `partial` stands for a partial refund, whose amount is indicated by API Consumer. More refunds are allowed for that `paymentId`.",
      "enum": [
        "total",
        "partial"
      ]
    },
    "reason": {
      "type": "string",
      "description": "Reason provided to request the refund. Optionally provided by the user or the merchant."
    },
    "sink": {
      "type": "string",
      "format": "uri",
      "pattern": "^https:\\/\\/.+$",
      "description": "The address to which events shall be delivered, using the HTTP protocol."
    },
    "sinkCredential": {
      "allOf": [
        {
          "description": "A sink credential provides authentication or authorization information necessary to enable delivery of events to a target."
        },
        {
          "$ref": "#/$defs/SinkCredential"
        }
      ]
    }
  },
  "$defs": {
    "SinkCredential": {
      "type": "object",
      "properties": {
        "credentialType": {
          "type": "string",
          "enum": [
            "PLAIN",
            "ACCESSTOKEN",
            "REFRESHTOKEN"
          ],
          "description": "The type of the credential. Only `ACCESSTOKEN` is supported so far."
        }
      },
      "required": [
        "credentialType"
      ]
    }
  }
}