{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.fideliyapass.com/schemas/webhooks/2026-11/gift_card.sent.json",
  "type": "object",
  "properties": {
    "gift_card_id": {
      "type": "string",
      "minLength": 1
    },
    "template_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "recipient_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "recipient_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "amount": {
      "type": "number"
    },
    "balance": {
      "type": "number"
    },
    "currency": {
      "type": "string"
    },
    "locale": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string"
    },
    "resend": {
      "type": "boolean",
      "description": "True when this is a resend of a card already issued."
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "recipient_deleted": {
      "description": "Present, and true, once the business deleted the recipient (a customer of theirs): their name and contact details are removed from this event (null), and a resend carries none. Show \"Deleted customer\".",
      "type": "boolean",
      "const": true
    },
    "recipient_deleted_at": {
      "description": "When the business deleted the recipient. Present with the flag above.",
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  },
  "required": [
    "gift_card_id",
    "template_id",
    "recipient_email",
    "recipient_name",
    "amount",
    "balance",
    "currency",
    "locale",
    "status",
    "resend",
    "timestamp"
  ],
  "description": "A gift card email was accepted for delivery (issued, or resent).",
  "examples": [
    {
      "gift_card_id": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a",
      "template_id": null,
      "recipient_email": "sam@example.com",
      "recipient_name": "Sam",
      "amount": 25,
      "balance": 25,
      "currency": "EUR",
      "locale": "en",
      "status": "active",
      "resend": false,
      "timestamp": "2026-11-03T10:15:00.000Z"
    }
  ]
}
