{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woolworths-group/main/json-schema/woolworths-group-order-data-dto-schema.json",
  "title": "OrderDataDto",
  "x-generated": "2026-10-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/woolworths-group-wpay-gifting-client-openapi.yml#/components/schemas/OrderDataDto",
  "required": [
    "clientOrderNumber",
    "correlationId",
    "giftItemsData",
    "orderId",
    "orderProcessingStatus"
  ],
  "type": "object",
  "properties": {
    "orderId": {
      "minLength": 1,
      "type": "string",
      "description": "Id representing the Gift Order"
    },
    "clientOrderNumber": {
      "minLength": 1,
      "type": "string",
      "description": "Unique order reference identifier you generate and supply"
    },
    "originalClientOrderNumber": {
      "type": [
        "string",
        "null"
      ],
      "description": "Used to associate related orders. For example, linking a refund to the original order."
    },
    "clientTransactionId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Unique transaction identifier you generate and supply"
    },
    "correlationId": {
      "minLength": 1,
      "type": "string",
      "description": "Unique correlation identifier sent in the request"
    },
    "giftItemsData": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GiftItemDataDto"
      }
    },
    "orderNote": {
      "$ref": "#/$defs/NoteInfoDto"
    },
    "orderProcessingStatus": {
      "$ref": "#/$defs/OrderProcessingStatus"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AddressDto": {
      "required": [
        "country",
        "line1",
        "postalCode",
        "state",
        "suburb"
      ],
      "type": "object",
      "properties": {
        "line1": {
          "minLength": 1,
          "type": "string",
          "description": "Address Line 1"
        },
        "line2": {
          "type": [
            "string",
            "null"
          ],
          "description": "Address Line 2"
        },
        "suburb": {
          "minLength": 1,
          "type": "string",
          "description": "Suburb"
        },
        "state": {
          "minLength": 1,
          "type": "string",
          "description": "State"
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "City"
        },
        "postalCode": {
          "minLength": 1,
          "type": "string",
          "description": "Postal code"
        },
        "country": {
          "minLength": 1,
          "type": "string",
          "description": "Country"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "E.164 format phone number"
        },
        "extension": {
          "type": [
            "string",
            "null"
          ],
          "description": "Phone extension code"
        },
        "mobile": {
          "pattern": "^\\+[1-9]\\d{1,14}$",
          "type": [
            "string",
            "null"
          ],
          "description": "E.164 format Mobile number"
        }
      },
      "additionalProperties": false
    },
    "CardFormatType": {
      "type": "string",
      "enum": [
        "CODE128",
        "CA128",
        "TWOD_QRCODE",
        "TWOD_PDF417",
        "ONED_CA128",
        "ACTIVATION_CODE"
      ]
    },
    "CurrencyCode": {
      "type": "string",
      "enum": [
        "AUD",
        "NZD"
      ]
    },
    "DeliverMode": {
      "type": "string",
      "enum": [
        "EMAIL",
        "SMS",
        "POST",
        "COURIER"
      ]
    },
    "DeliveryDataDto": {
      "required": [
        "deliveryId",
        "deliveryMode",
        "firstName"
      ],
      "type": "object",
      "properties": {
        "deliveryMode": {
          "$ref": "#/$defs/DeliverMode"
        },
        "deliveryId": {
          "type": "string",
          "description": "Delivery Id",
          "format": "uuid"
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "description": "Recipient's email address when the delivery is to be made via email",
          "format": "email"
        },
        "mobile": {
          "pattern": "^\\+[1-9]\\d{1,14}$",
          "type": [
            "string",
            "null"
          ],
          "description": "E.164 format mobile number  where the delivery is to be made using SMS"
        },
        "firstName": {
          "minLength": 1,
          "type": "string",
          "description": "First name of the receipient"
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Last name of the receipient"
        },
        "address": {
          "$ref": "#/$defs/AddressDto"
        },
        "deliveryNote": {
          "type": [
            "string",
            "null"
          ],
          "description": "Delivery note when physical cards are being delivered"
        }
      },
      "additionalProperties": false
    },
    "DeliveryScheduleDto": {
      "required": [
        "scheduleType"
      ],
      "type": "object",
      "properties": {
        "scheduleType": {
          "$ref": "#/$defs/ScheduleType"
        },
        "deliveryDate": {
          "type": [
            "string",
            "null"
          ],
          "description": "Date (yyyy-mm-dd) the delivery is to be made for scheduled delivery",
          "format": "date"
        }
      },
      "additionalProperties": false
    },
    "GiftCardDataDto": {
      "required": [
        "activatedBalance",
        "activationDatetime",
        "currencyCode"
      ],
      "type": "object",
      "properties": {
        "cardNumber": {
          "type": [
            "string",
            "null"
          ],
          "description": "Gift card number assigned. This will be returned depending on client configurations."
        },
        "pin": {
          "type": [
            "string",
            "null"
          ],
          "description": "Gift card pin assigned. This will be returned depending on client configurations."
        },
        "activatedBalance": {
          "type": "number",
          "description": "Balance that the gift card has been activated with",
          "format": "double"
        },
        "activationDatetime": {
          "type": "string",
          "description": "Date time that the gift card was activated",
          "format": "date-time"
        },
        "issueDate": {
          "type": [
            "string",
            "null"
          ],
          "description": "Date that the gift card was issued",
          "format": "date"
        },
        "expiryDate": {
          "type": [
            "string",
            "null"
          ],
          "description": "Date that the gift card will expire",
          "format": "date"
        },
        "currencyCode": {
          "$ref": "#/$defs/CurrencyCode"
        },
        "giftCardFormats": {
          "type": [
            "array",
            "null"
          ],
          "description": "Alternate Card Number formats",
          "items": {
            "$ref": "#/$defs/GiftCardFormat"
          }
        }
      },
      "additionalProperties": false
    },
    "GiftCardFormat": {
      "required": [
        "cardFormatType",
        "cardFormatValue"
      ],
      "type": "object",
      "properties": {
        "cardFormatType": {
          "$ref": "#/$defs/CardFormatType"
        },
        "cardFormatValue": {
          "minLength": 1,
          "type": "string",
          "description": "Card Code Value"
        }
      },
      "additionalProperties": false
    },
    "GiftDataDto": {
      "required": [
        "giftId",
        "giftType"
      ],
      "type": "object",
      "properties": {
        "giftId": {
          "minLength": 1,
          "type": "string",
          "description": "Id representing the gift"
        },
        "giftType": {
          "$ref": "#/$defs/GiftType"
        },
        "giftCardData": {
          "$ref": "#/$defs/GiftCardDataDto"
        }
      },
      "additionalProperties": false
    },
    "GiftItemDataDto": {
      "required": [
        "designId",
        "itemId",
        "itemProcessingStatus",
        "productId",
        "sendAsGift"
      ],
      "type": "object",
      "properties": {
        "itemId": {
          "type": "string",
          "description": "Item identifier you generate and supply",
          "format": "uuid"
        },
        "sendAsGift": {
          "type": "boolean",
          "description": "Flag to indicate whether the item was purchased as a gift."
        },
        "productId": {
          "type": "string",
          "description": "Identifier for the product that was ordered. This value must match an identifier from our Gifting Catalogue.",
          "format": "uuid"
        },
        "designId": {
          "minLength": 1,
          "type": "string",
          "description": "Identifier for the design of a product that was ordered. This value must match an identifier from our Gifting Catalogue."
        },
        "personalisationData": {
          "$ref": "#/$defs/PersonalisationDataDto"
        },
        "giftData": {
          "$ref": "#/$defs/GiftDataDto"
        },
        "fulfillmentData": {
          "$ref": "#/$defs/OrderItemFulfillmentDataDto"
        },
        "itemNotes": {
          "type": [
            "array",
            "null"
          ],
          "description": "Item Notes",
          "items": {
            "$ref": "#/$defs/NoteDetailsDto"
          }
        },
        "processorOrderReferenceId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Order Reference Id by Processor"
        },
        "itemProcessingStatus": {
          "$ref": "#/$defs/ItemProcessingStatus"
        }
      },
      "additionalProperties": false
    },
    "GiftType": {
      "type": "string",
      "enum": [
        "GIFT_CARD",
        "SWAP",
        "PHYSICAL_GIFTCARD"
      ]
    },
    "ItemProcessingStatus": {
      "type": "string",
      "description": "Processing status of each item in the order",
      "enum": [
        "PENDING",
        "COMPLETED",
        "FAILED"
      ]
    },
    "NoteDetailsDto": {
      "required": [
        "detail",
        "noteDatetime"
      ],
      "type": "object",
      "properties": {
        "detail": {
          "minLength": 1,
          "type": "string",
          "description": "Note added to the order"
        },
        "operatorId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Operator identifier of the operator who added the note"
        },
        "noteDatetime": {
          "type": "string",
          "description": "Date the note was made",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "NoteInfoDto": {
      "required": [
        "detail"
      ],
      "type": "object",
      "properties": {
        "detail": {
          "minLength": 1,
          "type": "string",
          "description": "Note added to the order"
        },
        "operatorId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Operator identifier of the operator who added the note"
        }
      },
      "additionalProperties": false
    },
    "OrderItemFulfillmentDataDto": {
      "required": [
        "deliveryData",
        "deliverySchedule"
      ],
      "type": "object",
      "properties": {
        "senderData": {
          "$ref": "#/$defs/SenderDataDto"
        },
        "deliveryData": {
          "type": "array",
          "description": "Delivery Details",
          "items": {
            "$ref": "#/$defs/DeliveryDataDto"
          }
        },
        "deliveryFee": {
          "type": [
            "number",
            "null"
          ],
          "description": "Delivery fee applicable to the delivery of the Gift",
          "format": "double"
        },
        "deliverySchedule": {
          "$ref": "#/$defs/DeliveryScheduleDto"
        }
      },
      "additionalProperties": false
    },
    "OrderProcessingStatus": {
      "type": "string",
      "description": "Processing status of complete order",
      "enum": [
        "PENDING",
        "COMPLETED"
      ]
    },
    "PersonalisationAssetsDto": {
      "required": [
        "images"
      ],
      "type": "object",
      "properties": {
        "images": {
          "type": "array",
          "description": "Images",
          "items": {
            "$ref": "#/$defs/PersonalisationImageDto"
          }
        }
      },
      "additionalProperties": false
    },
    "PersonalisationDataDto": {
      "required": [
        "personalisationType"
      ],
      "type": "object",
      "properties": {
        "personalisationType": {
          "$ref": "#/$defs/PersonalisationType"
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "Personalisation message added to the gift card by the customer"
        },
        "assets": {
          "$ref": "#/$defs/PersonalisationAssetsDto"
        }
      },
      "additionalProperties": false
    },
    "PersonalisationImageDto": {
      "required": [
        "imageType",
        "location"
      ],
      "type": "object",
      "properties": {
        "imageType": {
          "$ref": "#/$defs/PersonalisationImageType"
        },
        "location": {
          "minLength": 1,
          "type": "string",
          "description": "Image location"
        }
      },
      "additionalProperties": false
    },
    "PersonalisationImageType": {
      "type": "string",
      "enum": [
        "DIGITAL_TEMPLATE",
        "CARD_SKIN"
      ]
    },
    "PersonalisationType": {
      "type": "string",
      "enum": [
        "TEXT",
        "IMAGE",
        "VIDEO",
        "TEXT_IMAGE",
        "TEXT_VIDEO",
        "TEXT_IMAGE_VIDEO"
      ]
    },
    "ScheduleType": {
      "type": "string",
      "enum": [
        "NOW",
        "DELAYED"
      ]
    },
    "SenderDataDto": {
      "required": [
        "firstName"
      ],
      "type": "object",
      "properties": {
        "firstName": {
          "minLength": 1,
          "type": "string",
          "description": "First name of the sender"
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Last name of the sender"
        }
      },
      "additionalProperties": false
    }
  }
}