{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-gift-certificate-schema.json",
  "title": "GiftCertificate",
  "description": "Document representing a gift certificate.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-gift-certificates-api-openapi.yml#/components/schemas/GiftCertificate",
  "type": "object",
  "properties": {
    "amount": {
      "description": "The gift certificate amount.\n The user cannot change the gift certificate amount after the creation of the gift certificate.",
      "allOf": [
        {
          "$ref": "#/$defs/Money"
        }
      ]
    },
    "balance": {
      "type": "object",
      "description": "The gift certificate balance.\n This is a computed attribute and cannot be modified.",
      "allOf": [
        {
          "$ref": "#/$defs/Money"
        }
      ]
    },
    "creationDate": {
      "type": "string",
      "description": "Returns the value of attribute 'creationDate'.",
      "format": "date-time"
    },
    "description": {
      "maxLength": 4000,
      "type": "string",
      "description": "The description of the gift certificate."
    },
    "enabled": {
      "type": "boolean",
      "description": "The enabled flag of the gift certificate."
    },
    "lastModified": {
      "type": "string",
      "description": "Returns the value of attribute 'lastModified'.",
      "format": "date-time"
    },
    "maskedGiftCertificateCode": {
      "type": "string",
      "description": "Masked code."
    },
    "merchantId": {
      "type": "string",
      "description": "The merchant ID of the gift certificate.\n This is a unique attribute.\n This is a computed attribute and cannot be modified.\n This is used to get, update and the delete gift certificates."
    },
    "message": {
      "maxLength": 4000,
      "type": "string",
      "description": "The message to the recipient of the gift certificate."
    },
    "orderNo": {
      "type": "string",
      "description": "The order number of the gift certificate."
    },
    "recipientEmail": {
      "type": "string",
      "description": "The email address of the recipient of the gift certificate."
    },
    "recipientName": {
      "maxLength": 256,
      "type": "string",
      "description": "The recipient of the gift certificate."
    },
    "senderName": {
      "maxLength": 256,
      "type": "string",
      "description": "The sender of the gift certificate."
    },
    "status": {
      "type": "string",
      "description": "The status of the gift certificate.\n While creating a gift certificate, user can set the status\n to either \"pending\" or \"issued\" only.",
      "enum": [
        "issued",
        "partially_redeemed",
        "pending",
        "redeemed"
      ]
    },
    "transactions": {
      "items": {
        "$ref": "#/$defs/AccountTransaction"
      },
      "type": "array",
      "description": "The transactions of the gift certificate."
    }
  },
  "$defs": {
    "AccountTransaction": {
      "type": "object",
      "required": [
        "amount",
        "orderNo",
        "timestamp",
        "typeCode"
      ],
      "properties": {
        "amount": {
          "$ref": "#/$defs/Money"
        },
        "orderNo": {
          "type": "string",
          "description": "The order number of the gift certificate."
        },
        "timestamp": {
          "type": "string",
          "description": "The timestamp of the transaction of the gift certificate.",
          "format": "date-time"
        },
        "typeCode": {
          "type": "string",
          "description": "The type code of the gift certificate.",
          "enum": [
            "create",
            "redeem",
            "delete",
            "enable",
            "disable"
          ]
        }
      },
      "description": "Document representing an account transaction."
    },
    "CurrencyCode": {
      "description": "A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.",
      "pattern": "^([A-Z][A-Z][A-Z]|N/A)$",
      "type": "string"
    },
    "Money": {
      "description": "A combination of a Currency and an amount of that Currency.",
      "type": "object",
      "properties": {
        "currencyMnemonic": {
          "$ref": "#/$defs/CurrencyCode"
        },
        "value": {
          "format": "double",
          "description": "The amount of money for the given currency.",
          "type": "number"
        }
      }
    }
  }
}