{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.datashift.com.au/edi/contracts/releases/1.0.4/schemas/purchase-order-acknowledgement.schema.json",
  "title": "Purchase Order Acknowledgement (POA) Canonical Schema",
  "description": "Public canonical Purchase Order Acknowledgement contract used by suppliers to accept, reject, backorder, or qualify purchase order lines.",
  "version": "1.0.4",
  "type": "object",
  "required": [
    "docType",
    "correlationId",
    "timestamp",
    "metadata",
    "data"
  ],
  "properties": {
    "docType": {
      "const": "POA",
      "x-datashift-managed": true,
      "x-datashift-system": true,
      "description": "Canonical document type. For purchase order acknowledgements this value is POA.",
      "x-order": 1
    },
    "correlationId": {
      "type": "string",
      "format": "uuid",
      "x-datashift-managed": true,
      "x-datashift-system": true,
      "description": "Stable UUID used to trace this acknowledgement against the purchase order lifecycle.",
      "x-order": 2
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "UTC timestamp indicating when DataShift created the canonical acknowledgement.",
      "x-datashift-managed": true,
      "x-datashift-system": true,
      "x-order": 3
    },
    "metadata": {
      "type": "object",
      "description": "Public source metadata retained for integration troubleshooting.",
      "required": [
        "sourceLanguage",
        "sourceVersion",
        "userAgent"
      ],
      "properties": {
        "sourceLanguage": {
          "type": "string",
          "enum": [
            "json",
            "cxml"
          ],
          "x-order": 1
        },
        "sourceVersion": {
          "type": "string",
          "x-order": 2
        },
        "payloadId": {
          "type": "string",
          "description": "Original cXML payload ID",
          "x-order": 3
        },
        "userAgent": {
          "type": "string",
          "description": "System that generated the document",
          "x-order": 4
        }
      },
      "additionalProperties": false,
      "x-order": 4
    },
    "data": {
      "type": "object",
      "required": [
        "poNumber",
        "noticeDate",
        "lineItems",
        "poaNumber",
        "confirmationType"
      ],
      "properties": {
        "poaNumber": {
          "type": "string",
          "description": "Supplier-assigned acknowledgement identifier used for duplicate detection and support references.",
          "x-order": 1
        },
        "confirmationType": {
          "type": "string",
          "enum": [
            "accept",
            "reject",
            "except",
            "detail",
            "backordered",
            "allDetail",
            "replace"
          ],
          "description": "Order-level acknowledgement outcome calculated from line-level status and tolerance validation.",
          "x-datashift-managed": true,
          "x-datashift-system": true,
          "x-enum-descriptions": {
            "accept": "The order is accepted without exceptions.",
            "reject": "The order is rejected.",
            "except": "The order is accepted with exceptions.",
            "detail": "The response contains line-level detail updates.",
            "backordered": "The order or line is backordered.",
            "allDetail": "Every line is acknowledged with detail.",
            "replace": "This acknowledgement replaces an earlier acknowledgement."
          },
          "x-order": 2
        },
        "operation": {
          "type": "string",
          "enum": [
            "new",
            "update",
            "delete"
          ],
          "default": "new",
          "description": "Whether this creates, updates, or deletes a confirmation",
          "x-order": 3
        },
        "noticeDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time the supplier created the acknowledgement.",
          "x-order": 4
        },
        "poNumber": {
          "type": "string",
          "description": "Purchase order number being acknowledged.",
          "x-order": 5
        },
        "poVersion": {
          "type": "string",
          "description": "Purchase order version being acknowledged.",
          "x-order": 6
        },
        "orderReference": {
          "type": "object",
          "description": "Reference to the original purchase order document",
          "properties": {
            "documentId": {
              "type": "string",
              "x-order": 1
            },
            "payloadId": {
              "type": "string",
              "x-order": 2
            },
            "orderDate": {
              "type": "string",
              "format": "date-time",
              "x-order": 3
            }
          },
          "additionalProperties": false,
          "x-order": 7
        },
        "documentReference": {
          "type": "object",
          "description": "Reference to previous confirmation (required for operation=update/delete)",
          "properties": {
            "documentId": {
              "type": "string",
              "x-order": 1
            },
            "payloadId": {
              "type": "string",
              "x-order": 2
            }
          },
          "additionalProperties": false,
          "x-order": 8
        },
        "deliveryDate": {
          "type": "string",
          "format": "date-time",
          "description": "Expected delivery business date-time. Valid ISO offsets are allowed.",
          "x-order": 9
        },
        "dropship": {
          "type": "boolean",
          "description": "Indicates if this is a direct ship/dropship order",
          "x-order": 10
        },
        "invoiceId": {
          "type": "string",
          "description": "Optional supplier-generated invoice ID associated with this confirmation",
          "x-order": 11
        },
        "shipping": {
          "type": "object",
          "description": "Commercial freight charges and instructions.",
          "properties": {
            "amount": {
              "type": "number",
              "multipleOf": 0.01,
              "x-order": 1
            },
            "currency": {
              "title": "Currency Enumeration",
              "description": "ISO 4217 currency codes supported by DataShift canonical schemas",
              "type": "string",
              "enum": [
                "AUD"
              ],
              "x-order": 2
            },
            "carrier": {
              "type": "string",
              "description": "Carrier name",
              "x-order": 3
            },
            "route": {
              "type": "string",
              "description": "Shipping route method",
              "x-order": 4
            },
            "shippingInstructions": {
              "type": "string",
              "description": "Detailed shipping instructions",
              "x-order": 5
            },
            "buyerAcctNumber": {
              "type": "string",
              "description": "Buyer's shipping account number",
              "x-order": 6
            },
            "incoTerms": {
              "type": "string",
              "enum": [
                "cfr",
                "cif",
                "cip",
                "cpt",
                "daf",
                "dap",
                "ddp",
                "ddu",
                "dpu",
                "deq",
                "des",
                "exw",
                "fas",
                "fca",
                "fob"
              ],
              "description": "International Commercial Terms",
              "x-order": 7
            }
          },
          "additionalProperties": false,
          "x-order": 12
        },
        "tax": {
          "type": "object",
          "description": "Tax adjustments from original order",
          "properties": {
            "amount": {
              "type": "number",
              "multipleOf": 0.01,
              "x-order": 1
            },
            "currency": {
              "title": "Currency Enumeration",
              "description": "ISO 4217 currency codes supported by DataShift canonical schemas",
              "type": "string",
              "enum": [
                "AUD"
              ],
              "x-order": 2
            }
          },
          "additionalProperties": false,
          "x-order": 13
        },
        "total": {
          "type": "object",
          "description": "Order total adjustments",
          "properties": {
            "amount": {
              "type": "number",
              "multipleOf": 0.01,
              "x-order": 1
            },
            "currency": {
              "title": "Currency Enumeration",
              "description": "ISO 4217 currency codes supported by DataShift canonical schemas",
              "type": "string",
              "enum": [
                "AUD"
              ],
              "x-order": 2
            }
          },
          "additionalProperties": false,
          "x-order": 14
        },
        "contacts": {
          "type": "array",
          "description": "Contact information for various roles",
          "items": {
            "type": "object",
            "required": [
              "role"
            ],
            "properties": {
              "role": {
                "type": "string",
                "enum": [
                  "shipFrom",
                  "shipTo",
                  "billTo",
                  "technicalSupport",
                  "customerService",
                  "sales",
                  "buyer"
                ],
                "x-order": 1
              },
              "name": {
                "type": "string",
                "x-order": 2
              },
              "email": {
                "type": "string",
                "anyOf": [
                  {
                    "format": "email"
                  },
                  {
                    "const": ""
                  }
                ],
                "x-order": 3
              },
              "phone": {
                "type": "string",
                "x-order": 4
              }
            },
            "additionalProperties": false
          },
          "x-order": 15
        },
        "billTo": {
          "title": "Address Definition",
          "description": "Standard address structure for DataShift canonical documents",
          "type": "object",
          "properties": {
            "addressId": {
              "type": "string",
              "x-order": 1
            },
            "addressee": {
              "type": "string",
              "x-order": 2
            },
            "street1": {
              "type": "string",
              "x-order": 3
            },
            "street2": {
              "type": "string",
              "x-order": 4
            },
            "city": {
              "type": "string",
              "x-order": 5
            },
            "state": {
              "type": "string",
              "x-order": 6
            },
            "postalCode": {
              "type": "string",
              "x-order": 7
            },
            "country": {
              "type": "string",
              "enum": [
                "AU"
              ],
              "x-order": 8
            }
          },
          "required": [
            "addressee",
            "street1",
            "city",
            "state",
            "postalCode",
            "country"
          ],
          "additionalProperties": false,
          "x-order": 16
        },
        "shipTo": {
          "title": "Address Definition",
          "description": "Standard address structure for DataShift canonical documents",
          "type": "object",
          "properties": {
            "addressId": {
              "type": "string",
              "x-order": 1
            },
            "addressee": {
              "type": "string",
              "x-order": 2
            },
            "street1": {
              "type": "string",
              "x-order": 3
            },
            "street2": {
              "type": "string",
              "x-order": 4
            },
            "city": {
              "type": "string",
              "x-order": 5
            },
            "state": {
              "type": "string",
              "x-order": 6
            },
            "postalCode": {
              "type": "string",
              "x-order": 7
            },
            "country": {
              "type": "string",
              "enum": [
                "AU"
              ],
              "x-order": 8
            }
          },
          "required": [
            "addressee",
            "street1",
            "city",
            "state",
            "postalCode",
            "country"
          ],
          "additionalProperties": false,
          "x-order": 17
        },
        "comments": {
          "type": "string",
          "maxLength": 2000,
          "description": "Human-readable notes about this confirmation",
          "x-order": 18
        },
        "lineItems": {
          "type": "array",
          "minItems": 1,
          "description": "Acknowledgement lines. DataShift manages uniqueLineKey correlation where needed.",
          "items": {
            "type": "object",
            "required": [
              "lineNumber",
              "supplierLineStatus"
            ],
            "properties": {
              "lineNumber": {
                "type": "integer",
                "description": "Line number from the original purchase order.",
                "x-order": 1
              },
              "uniqueLineKey": {
                "type": "string",
                "description": "DataShift-managed stable line key from the original purchase order, used by internal connectors for cross-document correlation.",
                "x-datashift-managed": true,
                "x-datashift-system": true,
                "x-order": 2
              },
              "statusType": {
                "type": "string",
                "enum": [
                  "accept",
                  "reject",
                  "backordered",
                  "unknown",
                  "detail",
                  "allDetail"
                ],
                "description": "System-calculated status based on tolerance validation. Not mappable by sender; use supplierLineStatus for sender intent.",
                "x-datashift-managed": true,
                "x-datashift-system": true,
                "x-order": 3
              },
              "supplierLineStatus": {
                "type": "string",
                "enum": [
                  "accept",
                  "reject",
                  "backordered",
                  "unknown"
                ],
                "description": "Supplier-provided line acknowledgement intent.",
                "x-enum-descriptions": {
                  "accept": "The line is accepted.",
                  "reject": "The line is rejected.",
                  "backordered": "The line is backordered.",
                  "unknown": "The supplier cannot confirm the line status."
                },
                "x-order": 4
              },
              "supplierItemId": {
                "type": "string",
                "description": "Supplier's part/item number",
                "x-order": 5
              },
              "supplierItemAuxiliaryId": {
                "type": "string",
                "description": "Supplier's alternate/auxiliary part ID",
                "x-order": 6
              },
              "buyerItemId": {
                "type": "string",
                "description": "Buyer's part/item number",
                "x-order": 7
              },
              "gtin": {
                "type": "string",
                "pattern": "^[0-9]{8,14}$",
                "description": "Global Trade Item Number (GTIN-8, GTIN-12, GTIN-13, or GTIN-14)",
                "x-order": 8
              },
              "description": {
                "type": "string",
                "description": "Item description",
                "x-order": 9
              },
              "originalQuantity": {
                "type": "number",
                "multipleOf": 0.01,
                "description": "Quantity originally ordered",
                "x-order": 10
              },
              "confirmedQuantity": {
                "type": "number",
                "multipleOf": 0.01,
                "description": "Quantity the supplier confirms for this line.",
                "x-order": 11
              },
              "quantityBackordered": {
                "type": "number",
                "multipleOf": 0.01,
                "description": "Quantity backordered by the supplier",
                "x-order": 12
              },
              "unitOfMeasure": {
                "title": "REC20 Unit of Measure Codes",
                "description": "UN/ECE Recommendation 20 unit of measure codes for DataShift canonical documents",
                "type": "string",
                "enum": [
                  "AY",
                  "BG",
                  "BL",
                  "BR",
                  "BLL",
                  "E2",
                  "BO",
                  "BX",
                  "BJ",
                  "BE",
                  "KA",
                  "CA",
                  "CG",
                  "CT",
                  "CQ",
                  "CS",
                  "CMT",
                  "CL",
                  "CH",
                  "MTQ",
                  "CY",
                  "DAY",
                  "DC",
                  "DZN",
                  "DR",
                  "EA",
                  "FOT",
                  "GRM",
                  "HUR",
                  "CEN",
                  "INH",
                  "JR",
                  "KGM",
                  "KMT",
                  "KT",
                  "LN",
                  "LK",
                  "LTR",
                  "MTR",
                  "TNE",
                  "MLT",
                  "MMT",
                  "MON",
                  "PK",
                  "PD",
                  "PL",
                  "PR",
                  "D97",
                  "C62",
                  "PG",
                  "LBR",
                  "RL",
                  "RO",
                  "SA",
                  "SE",
                  "SET",
                  "ST",
                  "SO",
                  "MTK",
                  "U3",
                  "MIL",
                  "TU",
                  "WEE"
                ],
                "x-order": 13
              },
              "unitPrice": {
                "type": "number",
                "multipleOf": 0.01,
                "description": "Confirmed unit price (if different from order)",
                "x-order": 14
              },
              "currency": {
                "title": "Currency Enumeration",
                "description": "ISO 4217 currency codes supported by DataShift canonical schemas",
                "type": "string",
                "enum": [
                  "AUD"
                ],
                "x-order": 15
              },
              "unitPriceUom": {
                "type": "string",
                "description": "Unit of measure for price basis (e.g., price per 100)",
                "x-order": 16
              },
              "lineTotalExTax": {
                "type": "number",
                "x-order": 17
              },
              "lineTotalInclTax": {
                "type": "number",
                "x-order": 18
              },
              "classificationDomain": {
                "type": "string",
                "description": "Product classification domain",
                "x-order": 19
              },
              "classificationCode": {
                "type": "string",
                "description": "Product classification code",
                "x-order": 20
              },
              "shipmentDate": {
                "type": "string",
                "format": "date-time",
                "description": "Expected or actual shipment date for this line",
                "x-order": 21
              },
              "deliveryDate": {
                "type": "string",
                "format": "date-time",
                "description": "Expected delivery date for this line",
                "x-order": 22
              },
              "rejectionReason": {
                "type": "string",
                "description": "Reason for rejection or backorder",
                "x-order": 23
              },
              "substitution": {
                "type": "object",
                "description": "Substitute item details if supplier is offering an alternative",
                "properties": {
                  "supplierItemId": {
                    "type": "string",
                    "x-order": 1
                  },
                  "buyerItemId": {
                    "type": "string",
                    "x-order": 2
                  },
                  "description": {
                    "type": "string",
                    "x-order": 3
                  },
                  "quantity": {
                    "type": "number",
                    "multipleOf": 0.01,
                    "x-order": 4
                  },
                  "unitOfMeasure": {
                    "title": "REC20 Unit of Measure Codes",
                    "description": "UN/ECE Recommendation 20 unit of measure codes for DataShift canonical documents",
                    "type": "string",
                    "enum": [
                      "AY",
                      "BG",
                      "BL",
                      "BR",
                      "BLL",
                      "E2",
                      "BO",
                      "BX",
                      "BJ",
                      "BE",
                      "KA",
                      "CA",
                      "CG",
                      "CT",
                      "CQ",
                      "CS",
                      "CMT",
                      "CL",
                      "CH",
                      "MTQ",
                      "CY",
                      "DAY",
                      "DC",
                      "DZN",
                      "DR",
                      "EA",
                      "FOT",
                      "GRM",
                      "HUR",
                      "CEN",
                      "INH",
                      "JR",
                      "KGM",
                      "KMT",
                      "KT",
                      "LN",
                      "LK",
                      "LTR",
                      "MTR",
                      "TNE",
                      "MLT",
                      "MMT",
                      "MON",
                      "PK",
                      "PD",
                      "PL",
                      "PR",
                      "D97",
                      "C62",
                      "PG",
                      "LBR",
                      "RL",
                      "RO",
                      "SA",
                      "SE",
                      "SET",
                      "ST",
                      "SO",
                      "MTK",
                      "U3",
                      "MIL",
                      "TU",
                      "WEE"
                    ],
                    "x-order": 5
                  },
                  "unitPrice": {
                    "type": "number",
                    "multipleOf": 0.01,
                    "x-order": 6
                  }
                },
                "additionalProperties": false,
                "x-order": 24
              },
              "comments": {
                "type": "string",
                "maxLength": 500,
                "description": "Line-level comments",
                "x-order": 25
              }
            },
            "additionalProperties": false
          },
          "x-order": 19
        },
        "extrinsics": {
          "type": "object",
          "description": "Partner-specific extension fields that are not part of the canonical core contract.",
          "additionalProperties": {
            "x-additionalPropertiesName": "extensionField",
            "description": "Partner-specific extension value."
          },
          "x-order": 20
        }
      },
      "additionalProperties": false,
      "description": "Business payload for the acknowledgement.",
      "x-order": 5
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "docType": "POA",
      "correlationId": "347ed126-1456-4f0e-84f4-b16f018f6e61",
      "timestamp": "2026-05-16T01:00:00Z",
      "metadata": {
        "sourceLanguage": "cxml",
        "sourceVersion": "1.2.067",
        "payloadId": "poa-example-10001",
        "userAgent": "Example Supplier Gateway"
      },
      "data": {
        "poaNumber": "POA-10001",
        "confirmationType": "accept",
        "noticeDate": "2026-05-16T01:00:00Z",
        "poNumber": "PO-10001",
        "poVersion": "1",
        "deliveryDate": "2026-05-23T00:00:00Z",
        "lineItems": [
          {
            "lineNumber": 1,
            "uniqueLineKey": "PO-10001-1",
            "supplierLineStatus": "accept",
            "supplierItemId": "SUP-001",
            "buyerItemId": "BUY-001",
            "originalQuantity": 12,
            "confirmedQuantity": 12,
            "unitOfMeasure": "EA",
            "unitPrice": 25,
            "currency": "AUD"
          }
        ],
        "extrinsics": {
          "supplierPortalReference": "ACK-7788"
        }
      }
    }
  ]
}
