{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-gift-card-schema.json",
  "title": "GiftCard",
  "description": "Gift card details",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-gift-cards-api-openapi.yml#/components/schemas/GiftCard",
  "type": "object",
  "properties": {
    "id": {
      "title": "Gift card ID",
      "type": "string",
      "maxLength": 13,
      "readOnly": true
    },
    "object": {
      "title": "Object type",
      "type": "string",
      "readOnly": true
    },
    "gifter_account_id": {
      "title": "Gifter account ID",
      "type": "string",
      "maxLength": 13,
      "description": "The ID of the account that purchased the gift card."
    },
    "recipient_account_id": {
      "title": "Recipient account ID",
      "type": "string",
      "maxLength": 13,
      "description": "The ID of the account that redeemed the gift card redemption code.  Does not have a value until gift card is redeemed."
    },
    "purchase_invoice_id": {
      "title": "Purchase invoice ID",
      "type": "string",
      "maxLength": 13,
      "description": "The ID of the invoice for the gift card purchase made by the gifter."
    },
    "redemption_invoice_id": {
      "title": "Redemption invoice ID",
      "type": "string",
      "maxLength": 13,
      "description": "The ID of the invoice for the gift card redemption made by the recipient.  Does not have a value until gift card is redeemed."
    },
    "redemption_code": {
      "title": "Redemption code",
      "type": "string",
      "description": "The unique redemption code for the gift card, generated by Recurly. Will be 16 characters, alphanumeric, displayed uppercase, but accepted in any case at redemption. Used by the recipient account to create a credit in the amount of the `unit_amount` on their account."
    },
    "balance": {
      "title": "Remaining balance",
      "type": "number",
      "format": "float",
      "description": "The remaining credit on the recipient account associated with this gift card. Only has a value once the gift card has been redeemed. Can be used to create gift card balance displays for your customers."
    },
    "product_code": {
      "title": "Product code",
      "type": "string",
      "description": "The product code or SKU of the gift card product."
    },
    "unit_amount": {
      "title": "Purchase unit amount",
      "type": "number",
      "format": "float",
      "description": "The amount of the gift card, which is the amount of the charge to the gifter account and the amount of credit that is applied to the recipient account upon successful redemption."
    },
    "currency": {
      "title": "Currency",
      "type": "string",
      "description": "3-letter ISO 4217 currency code.",
      "maxLength": 3
    },
    "delivery": {
      "title": "Delivery details",
      "description": "The delivery details for the gift card.",
      "readOnly": true,
      "$ref": "#/$defs/GiftCardDelivery"
    },
    "performance_obligation_id": {
      "type": "string",
      "title": "Performance Obligation ID",
      "description": "The ID of a performance obligation. Performance obligations are\nonly accessible as a part of the Recurly RevRec Standard and\nRecurly RevRec Advanced features.\n",
      "maxLength": 13
    },
    "liability_gl_account_id": {
      "type": "string",
      "title": "General Ledger Account ID",
      "description": "The ID of a general ledger account. General ledger accounts are\nonly accessible as a part of the Recurly RevRec Standard and\nRecurly RevRec Advanced features.\n",
      "maxLength": 13
    },
    "revenue_gl_account_id": {
      "type": "string",
      "title": "General Ledger Account ID",
      "description": "The ID of a general ledger account. General ledger accounts are\nonly accessible as a part of the Recurly RevRec Standard and\nRecurly RevRec Advanced features.\n",
      "maxLength": 13
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created at",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Last updated at",
      "readOnly": true
    },
    "delivered_at": {
      "type": "string",
      "format": "date-time",
      "title": "Delivered at",
      "readOnly": true,
      "description": "When the gift card was sent to the recipient by Recurly via email, if method was email and the \"Gift Card Delivery\" email template was enabled. This will be empty for post delivery or email delivery where the email template was disabled."
    },
    "redeemed_at": {
      "type": "string",
      "format": "date-time",
      "title": "Redeemed at",
      "readOnly": true,
      "description": "When the gift card was redeemed by the recipient."
    },
    "canceled_at": {
      "type": "string",
      "format": "date-time",
      "title": "Canceled at",
      "readOnly": true,
      "description": "When the gift card was canceled."
    }
  },
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "phone": {
          "type": "string",
          "title": "Phone number"
        },
        "street1": {
          "type": "string",
          "title": "Street 1",
          "maxLength": 50
        },
        "street2": {
          "type": "string",
          "title": "Street 2",
          "maxLength": 50
        },
        "city": {
          "type": "string",
          "title": "City"
        },
        "region": {
          "type": "string",
          "title": "State/Province",
          "description": "State or province."
        },
        "postal_code": {
          "type": "string",
          "title": "Zip/Postal code",
          "description": "Zip or postal code."
        },
        "country": {
          "type": "string",
          "title": "Country",
          "description": "Country, 2-letter ISO 3166-1 alpha-2 code."
        },
        "geo_code": {
          "type": "string",
          "maxLength": 20,
          "description": "Code that represents a geographic entity (location or object). Only returned when Vertex or Avalara for Communications is enabled."
        }
      }
    },
    "DeliveryMethodEnum": {
      "type": "string",
      "enum": [
        "email",
        "post"
      ]
    },
    "GiftCardDelivery": {
      "type": "object",
      "description": "Gift card delivery details",
      "properties": {
        "method": {
          "title": "Delivery method",
          "description": "Whether the delivery method is email or postal service.",
          "$ref": "#/$defs/DeliveryMethodEnum"
        },
        "email_address": {
          "title": "Recipient email address",
          "type": "string",
          "description": "The email address of the recipient."
        },
        "deliver_at": {
          "type": "string",
          "format": "date-time",
          "title": "Deliver at",
          "readOnly": true,
          "description": "When the gift card should be delivered to the recipient. If null, the gift card will be delivered immediately. If a datetime is provided, the delivery will be in an hourly window, rounding down. For example, 6:23 pm will be in the 6:00 pm hourly batch."
        },
        "first_name": {
          "title": "Recipient first name",
          "type": "string",
          "description": "The first name of the recipient."
        },
        "last_name": {
          "title": "Recipient last name",
          "type": "string",
          "description": "The last name of the recipient."
        },
        "recipient_address": {
          "title": "Recipient address",
          "description": "Address information for the recipient.",
          "$ref": "#/$defs/Address"
        },
        "gifter_name": {
          "title": "Gifter name",
          "type": "string",
          "description": "The name of the gifter for the purpose of a message displayed to the recipient."
        },
        "personal_message": {
          "title": "Personal message",
          "type": "string",
          "maxLength": 255,
          "description": "The personal message from the gifter to the recipient."
        }
      }
    }
  }
}