{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woolworths-group/main/json-schema/woolworths-group-physical-order-request-schema.json",
  "title": "PhysicalOrderRequest",
  "description": "The JSON request structure of the Physical card activation Order endpoint.",
  "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/PhysicalOrderRequest",
  "required": [
    "refno",
    "syncOnly"
  ],
  "type": "object",
  "properties": {
    "payments": {
      "$ref": "#/$defs/paymentsObject"
    },
    "products": {
      "type": "array",
      "description": "Only one single physical card may be activated per API call.",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "required": [
          "cardNumber"
        ],
        "$ref": "#/$defs/physicalCardActivateCardObject"
      }
    },
    "refno": {
      "type": "string",
      "description": "A unique order reference identifier you generate and supply.",
      "maxLength": 55
    },
    "outletName": {
      "type": "string",
      "description": "The outlet name from where the gift card activation is triggered. This is required for partners who have multiple outlets"
    },
    "orderType": {
      "type": "string",
      "description": "Physical card activations require the value 'FULFILLMENT_BY_SELLER'.",
      "default": "FULFILLMENT_BY_SELLER"
    },
    "syncOnly": {
      "type": "boolean",
      "description": "Always supply the value of `true`",
      "default": true
    }
  },
  "$defs": {
    "cardPurchaseObject": {
      "type": "object",
      "required": [
        "sku",
        "price",
        "qty",
        "currency"
      ],
      "properties": {
        "sku": {
          "type": "string",
          "description": "The gift card identifier (SKU). The list of gift cards you may order will be predefined and shared during the onboarding process."
        },
        "price": {
          "type": "number",
          "description": "The currency amount to load onto the gift card."
        },
        "qty": {
          "type": "number",
          "description": "The number of gift cards you wish to order with this SKU and price combination."
        },
        "currency": {
          "type": "string",
          "description": "Use 036 for AUD currency. The full list of valid codes is defined at  https://en.wikipedia.org/wiki/ISO_4217",
          "minLength": 3,
          "maxLength": 3
        }
      }
    },
    "paymentsObject": {
      "description": "The account the gift card amounts will be deducted from. Requires one single element to indicate the payment will be made using the SVA.",
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "required": [
          "code",
          "amount"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Always use the code 'svc'.",
            "default": "svc",
            "enum": [
              "svc"
            ]
          },
          "amount": {
            "type": "number",
            "description": "The payment amount for the order. This value must match the sum of 'price' times 'qty' for all cards in this order."
          }
        }
      }
    },
    "physicalCardActivateCardObject": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/cardPurchaseObject"
        },
        {
          "type": "object",
          "properties": {
            "qty": {
              "description": "Only 1 physical card may be activated per API call.",
              "type": "number",
              "default": 1
            },
            "cardNumber": {
              "type": "string",
              "description": "The card number of the gift card to be activated"
            },
            "trackData": {
              "type": "string",
              "description": "The trackData or barcode of the gift card"
            }
          }
        }
      ]
    }
  }
}