{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woolworths-group/main/json-schema/woolworths-group-activated-cards-response-schema.json",
  "title": "ActivatedCardsResponse",
  "x-generated": "2026-10-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/woolworths-group-wpay-gift-card-partner-openapi.yml#/components/schemas/ActivatedCardsResponse",
  "type": "object",
  "required": [
    "deliveryMode",
    "barcodeFormats"
  ],
  "properties": {
    "products": {
      "$ref": "#/$defs/productsMapObject",
      "description": "This field is a map of type string/object. The key is the product identifier (SKU), while the value is an object representing the product attributes."
    },
    "cards": {
      "type": "array",
      "description": "This array contains the details of each activated gift card.",
      "items": {
        "$ref": "#/$defs/cardDetailsObject"
      }
    },
    "currency": {
      "$ref": "#/$defs/currencyObject"
    },
    "deliveryMode": {
      "type": "string",
      "description": "Delivery mode"
    },
    "total_cards": {
      "type": "number",
      "description": "The total number of activated cards in this order. Use this in conjuntion with the offset and limit request parameters to achieve pagination."
    }
  },
  "$defs": {
    "cardDetailsObject": {
      "type": "object",
      "properties": {
        "sku": {
          "type": "string",
          "description": "The gift card identifier."
        },
        "productName": {
          "type": "string",
          "description": "The name of the gift card"
        },
        "labels": {
          "type": "object",
          "required": [
            "cardNumber",
            "cardPin",
            "activationCode"
          ],
          "properties": {
            "cardNumber": {
              "type": "string",
              "description": "The human readable label for the card number"
            },
            "cardPin": {
              "type": "string",
              "description": "The human readable label for the card PIN"
            },
            "activationCode": {
              "type": "string",
              "description": "The human readable label for the card activation code"
            },
            "validity": {
              "type": "string",
              "description": "The human readable label for the card validity"
            }
          }
        },
        "cardNumber": {
          "type": "string",
          "description": "The gift card number"
        },
        "cardPin": {
          "type": "string",
          "description": "The gift card PIN"
        },
        "activationCode": {
          "type": "string",
          "description": "The gift card activation code"
        },
        "activationUrl": {
          "type": "string",
          "description": "The URL of the gift card activation page"
        },
        "barcode": {
          "type": "string",
          "description": "The gift card barcode"
        },
        "formats": {
          "type": "array",
          "description": "A list of barcode formats for this card. Each item in the list is a key/value pair.",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "description": "The barcode format.",
                "enum": [
                  "CNONLY",
                  "CA128",
                  "QRCODE",
                  "PDF417",
                  "INT2OF5",
                  "DATAMATRIX",
                  "QCGTINBARCODE-32",
                  "QCBARCODE-31-V1",
                  "TRACK2"
                ]
              },
              "value": {
                "type": "string",
                "description": "The barcode value for this format. The field type is a string, althought the content of this string is a decimal."
              }
            }
          }
        },
        "amount": {
          "type": "string",
          "description": "The amount loaded onto the card."
        },
        "validity": {
          "type": "string",
          "description": "The expiry date of the gift card in (ISO 8601) format."
        },
        "issuanceDate": {
          "type": "string",
          "description": "The date the gift card was activated in (ISO 8601) format."
        },
        "cardId": {
          "type": "number",
          "description": "This field is unused."
        },
        "theme": {
          "type": "string",
          "description": "This field is unused."
        },
        "recipientDetails": {
          "type": "object",
          "description": "This field is unused.",
          "properties": {
            "name": {
              "type": "string",
              "description": "Recipient full name"
            },
            "firstname": {
              "type": "string",
              "description": "Recipient first name"
            },
            "lastname": {
              "type": "string",
              "description": "Recipient last name"
            },
            "email": {
              "type": "string",
              "description": "Recipient email address"
            },
            "mobileNumber": {
              "type": "string",
              "description": "Recipient mobile phone number"
            },
            "status": {
              "type": "string",
              "description": "Message delivery status"
            }
          }
        }
      }
    },
    "currencyObject": {
      "type": "object",
      "description": "Contains details about the gift card currency.",
      "properties": {
        "code": {
          "type": "string",
          "description": "Currency code"
        },
        "numericCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3,
          "description": "Currency numeric code as per https://en.wikipedia.org/wiki/ISO_4217"
        },
        "symbol": {
          "type": "string",
          "description": "Currency symbol"
        }
      }
    },
    "productsMapObject": {
      "type": "object",
      "required": [
        "default"
      ],
      "properties": {
        "sku": {
          "type": "string",
          "description": "The product identifier (SKU). One item in the map will be present for each unique SKU."
        }
      },
      "additionalProperties": {
        "type": "object",
        "description": "Product information, including artwork for each gift card SKU ordered.",
        "minItems": 1,
        "maxItems": 1,
        "required": [
          "cardBehaviour",
          "barcodeFormats"
        ],
        "properties": {
          "sku": {
            "type": "string",
            "description": "The product identifier (SKU). This field is a repeat of the hash map key."
          },
          "name": {
            "type": "string",
            "description": "The product name"
          },
          "balanceEnquiryInstruction": {
            "type": "string",
            "description": "This field is unused."
          },
          "specialInstruction": {
            "description": "This field is unused.",
            "oneOf": [
              {
                "type": "string",
                "default": ""
              },
              {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "This field is unused."
                  },
                  "url": {
                    "type": "string",
                    "description": "This field is unused."
                  }
                }
              }
            ],
            "type": "string"
          },
          "images": {
            "type": "object",
            "description": "This field is unused.",
            "properties": {
              "base": {
                "type": "string"
              },
              "small": {
                "type": "string"
              },
              "thumbnail": {
                "type": "string"
              },
              "mobile": {
                "type": "string"
              }
            }
          },
          "cardBehaviour": {
            "type": "string",
            "description": "This field is unused."
          }
        }
      }
    }
  }
}