{
  "asyncapi": "3.0.0",
  "info": {
    "title": "Batch Relay Events API",
    "version": "1.0.0",
    "description": "Outbound, push-only Batch Relay lifecycle events. One CloudEvents 1.0 structured JSON body per HTTPS request."
  },
  "servers": {
    "webhook": {
      "host": "{destinationUrl}",
      "protocol": "https",
      "description": "The HTTPS webhook endpoint registered by the authorized Studio/API account.",
      "variables": {
        "destinationUrl": {
          "default": "webhooks.example.test/batch-relay/events"
        }
      }
    }
  },
  "channels": {
    "outboundWebhook": {
      "address": "{destinationUrl}",
      "messages": {
        "order_fulfillment_updated_v1": {
          "$ref": "#/components/messages/order_fulfillment_updated_v1"
        },
        "order_created_v1": {
          "$ref": "#/components/messages/order_created_v1"
        },
        "order_paid_v1": {
          "$ref": "#/components/messages/order_paid_v1"
        },
        "order_payment_failed_v1": {
          "$ref": "#/components/messages/order_payment_failed_v1"
        },
        "order_canceled_v1": {
          "$ref": "#/components/messages/order_canceled_v1"
        },
        "order_fulfillment_queued_v1": {
          "$ref": "#/components/messages/order_fulfillment_queued_v1"
        },
        "order_fulfillment_submitted_v1": {
          "$ref": "#/components/messages/order_fulfillment_submitted_v1"
        },
        "order_fulfillment_accepted_v1": {
          "$ref": "#/components/messages/order_fulfillment_accepted_v1"
        },
        "order_fulfillment_rejected_v1": {
          "$ref": "#/components/messages/order_fulfillment_rejected_v1"
        },
        "order_shipped_v1": {
          "$ref": "#/components/messages/order_shipped_v1"
        },
        "order_fulfilled_v1": {
          "$ref": "#/components/messages/order_fulfilled_v1"
        },
        "order_fulfillment_failed_v1": {
          "$ref": "#/components/messages/order_fulfillment_failed_v1"
        },
        "catalog_item_changed_v1": {
          "$ref": "#/components/messages/catalog_item_changed_v1"
        },
        "package_changed_v1": {
          "$ref": "#/components/messages/package_changed_v1"
        },
        "catalog_batch_completed_v1": {
          "$ref": "#/components/messages/catalog_batch_completed_v1"
        },
        "storefront_changed_v1": {
          "$ref": "#/components/messages/storefront_changed_v1"
        },
        "destination_test_v1": {
          "$ref": "#/components/messages/destination_test_v1"
        }
      }
    }
  },
  "operations": {
    "sendEvent": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/outboundWebhook"
      },
      "summary": "Batch Relay sends exactly one signed CloudEvent per HTTP POST request.",
      "bindings": {
        "http": {
          "type": "request",
          "method": "POST",
          "headers": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "webhook-id",
              "webhook-timestamp",
              "webhook-signature"
            ],
            "properties": {
              "webhook-id": {
                "type": "string"
              },
              "webhook-timestamp": {
                "type": "string"
              },
              "webhook-signature": {
                "type": "string"
              }
            }
          }
        }
      },
      "messages": [
        {
          "$ref": "#/components/messages/order_fulfillment_updated_v1"
        },
        {
          "$ref": "#/components/messages/order_created_v1"
        },
        {
          "$ref": "#/components/messages/order_paid_v1"
        },
        {
          "$ref": "#/components/messages/order_payment_failed_v1"
        },
        {
          "$ref": "#/components/messages/order_canceled_v1"
        },
        {
          "$ref": "#/components/messages/order_fulfillment_queued_v1"
        },
        {
          "$ref": "#/components/messages/order_fulfillment_submitted_v1"
        },
        {
          "$ref": "#/components/messages/order_fulfillment_accepted_v1"
        },
        {
          "$ref": "#/components/messages/order_fulfillment_rejected_v1"
        },
        {
          "$ref": "#/components/messages/order_shipped_v1"
        },
        {
          "$ref": "#/components/messages/order_fulfilled_v1"
        },
        {
          "$ref": "#/components/messages/order_fulfillment_failed_v1"
        },
        {
          "$ref": "#/components/messages/catalog_item_changed_v1"
        },
        {
          "$ref": "#/components/messages/package_changed_v1"
        },
        {
          "$ref": "#/components/messages/catalog_batch_completed_v1"
        },
        {
          "$ref": "#/components/messages/storefront_changed_v1"
        },
        {
          "$ref": "#/components/messages/destination_test_v1"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "order_fulfillment_updated_v1": {
        "name": "order.fulfillment_updated.v1",
        "title": "order.fulfillment_updated.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_fulfillment_updated_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_fulfillment_updated_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.fulfillment_updated.v1",
              "subject": "orders/order_id_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.fulfillment_updated/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 1,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "order_id_demo_01JABC123",
                "status": "fulfillment_updated",
                "digital_status": "pending",
                "lab_status": "not_required",
                "studio_status": "not_required",
                "changes": [
                  {
                    "field": "digital_status",
                    "previous": "not_required",
                    "current": "pending"
                  }
                ]
              }
            }
          }
        ]
      },
      "order_created_v1": {
        "name": "order.created.v1",
        "title": "order.created.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_created_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_created_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.created.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.created/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 1,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "created",
                "currency": "USD",
                "subtotal_minor_units": 5000,
                "discount_minor_units": 500,
                "shipping_minor_units": 499,
                "tax_minor_units": 350,
                "total_minor_units": 5349,
                "lines": [
                  {
                    "line_id": "lin_demo_01JABC123",
                    "package_id": "pkg_demo_01JABC123",
                    "display_name": "Varsity Keepsake Package",
                    "quantity": 1,
                    "unit_price_minor_units": 5000
                  }
                ]
              }
            }
          }
        ]
      },
      "order_paid_v1": {
        "name": "order.paid.v1",
        "title": "order.paid.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_paid_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_paid_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.paid.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.paid/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 2,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "paid",
                "currency": "USD",
                "subtotal_minor_units": 5000,
                "discount_minor_units": 500,
                "shipping_minor_units": 499,
                "tax_minor_units": 350,
                "total_minor_units": 5349,
                "lines": [
                  {
                    "line_id": "lin_demo_01JABC123",
                    "package_id": "pkg_demo_01JABC123",
                    "display_name": "Varsity Keepsake Package",
                    "quantity": 1,
                    "unit_price_minor_units": 5000
                  }
                ]
              }
            }
          }
        ]
      },
      "order_payment_failed_v1": {
        "name": "order.payment_failed.v1",
        "title": "order.payment_failed.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_payment_failed_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_payment_failed_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.payment_failed.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.payment_failed/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 2,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "payment_failed",
                "reason_code": "payment_declined"
              }
            }
          }
        ]
      },
      "order_canceled_v1": {
        "name": "order.canceled.v1",
        "title": "order.canceled.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_canceled_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_canceled_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.canceled.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.canceled/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 3,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "canceled"
              }
            }
          }
        ]
      },
      "order_fulfillment_queued_v1": {
        "name": "order.fulfillment_queued.v1",
        "title": "order.fulfillment_queued.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_fulfillment_queued_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_fulfillment_queued_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.fulfillment_queued.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.fulfillment_queued/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 3,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "fulfillment_queued"
              }
            }
          }
        ]
      },
      "order_fulfillment_submitted_v1": {
        "name": "order.fulfillment_submitted.v1",
        "title": "order.fulfillment_submitted.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_fulfillment_submitted_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_fulfillment_submitted_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.fulfillment_submitted.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.fulfillment_submitted/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 4,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "fulfillment_submitted"
              }
            }
          }
        ]
      },
      "order_fulfillment_accepted_v1": {
        "name": "order.fulfillment_accepted.v1",
        "title": "order.fulfillment_accepted.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_fulfillment_accepted_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_fulfillment_accepted_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.fulfillment_accepted.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.fulfillment_accepted/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 5,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "fulfillment_accepted"
              }
            }
          }
        ]
      },
      "order_fulfillment_rejected_v1": {
        "name": "order.fulfillment_rejected.v1",
        "title": "order.fulfillment_rejected.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_fulfillment_rejected_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_fulfillment_rejected_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.fulfillment_rejected.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.fulfillment_rejected/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 5,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "fulfillment_rejected",
                "reason_code": "provider_validation_failed"
              }
            }
          }
        ]
      },
      "order_shipped_v1": {
        "name": "order.shipped.v1",
        "title": "order.shipped.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_shipped_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_shipped_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.shipped.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.shipped/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 6,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "shipped",
                "carrier_code": "ups",
                "carrier_name": "UPS",
                "service_level": "Ground",
                "tracking_number": "1ZDEMO123",
                "tracking_url": "https://www.ups.com/track?tracknum=1ZDEMO123"
              }
            }
          }
        ]
      },
      "order_fulfilled_v1": {
        "name": "order.fulfilled.v1",
        "title": "order.fulfilled.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_fulfilled_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_fulfilled_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.fulfilled.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.fulfilled/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 7,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "fulfilled"
              }
            }
          }
        ]
      },
      "order_fulfillment_failed_v1": {
        "name": "order.fulfillment_failed.v1",
        "title": "order.fulfillment_failed.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.orders.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/order_fulfillment_failed_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_order_fulfillment_failed_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "order.fulfillment_failed.v1",
              "subject": "orders/ord_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/order.fulfillment_failed/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 5,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "order_id": "ord_demo_01JABC123",
                "status": "fulfillment_failed",
                "reason_code": "dispatch_retry_exhausted"
              }
            }
          }
        ]
      },
      "catalog_item_changed_v1": {
        "name": "catalog_item.changed.v1",
        "title": "catalog_item.changed.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.catalog.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/catalog_item_changed_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_catalog_item_changed_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "catalog_item.changed.v1",
              "subject": "catalog-items/cat_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/catalog_item.changed/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 4,
              "origin": "storefront",
              "correlationid": "cor_demo_catalog_batch_01JABC123",
              "actorkind": "system",
              "data": {
                "batch_id": "bat_demo_01JABC123",
                "catalog_item_id": "cat_demo_01JABC123",
                "action": "published",
                "state": {
                  "status": "published",
                  "availability": "active",
                  "display_name": "Varsity Basketball 8×10 Print",
                  "currency": "USD",
                  "price_minor_units": 2500,
                  "fulfillment_type": "print",
                  "tax_category": "physical_print",
                  "is_listed_on_storefront": true,
                  "is_available_standalone": true,
                  "is_available_in_packages": true,
                  "is_available_as_add_on": false
                },
                "changes": [
                  {
                    "field": "status",
                    "previous": "draft",
                    "current": "published"
                  }
                ]
              }
            }
          }
        ]
      },
      "package_changed_v1": {
        "name": "package.changed.v1",
        "title": "package.changed.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.catalog.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/package_changed_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_package_changed_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "package.changed.v1",
              "subject": "packages/pkg_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/package.changed/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 3,
              "origin": "storefront",
              "correlationid": "cor_demo_catalog_batch_01JABC123",
              "actorkind": "system",
              "data": {
                "batch_id": "bat_demo_01JABC123",
                "package_id": "pkg_demo_01JABC123",
                "action": "updated",
                "state": {
                  "status": "published",
                  "availability": "active",
                  "display_name": "Varsity Keepsake Package",
                  "currency": "USD",
                  "price_minor_units": 5000,
                  "included_item_count": 3
                },
                "changes": [
                  {
                    "field": "included_item_count",
                    "previous": 2,
                    "current": 3
                  }
                ]
              }
            }
          }
        ]
      },
      "catalog_batch_completed_v1": {
        "name": "catalog_batch.completed.v1",
        "title": "catalog_batch.completed.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.catalog.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/catalog_batch_completed_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_catalog_batch_completed_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "catalog_batch.completed.v1",
              "subject": "catalog-batches/bat_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/catalog_batch.completed/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 1,
              "origin": "storefront",
              "correlationid": "cor_demo_catalog_batch_01JABC123",
              "actorkind": "system",
              "data": {
                "batch_id": "bat_demo_01JABC123",
                "operation": "bulk_edit",
                "counts": {
                  "created": 0,
                  "updated": 1,
                  "published": 1,
                  "archived": 0,
                  "restored": 0,
                  "deleted": 0
                },
                "changed_resources": [
                  {
                    "id": "cat_demo_01JABC123",
                    "resource_type": "catalog_item",
                    "resource_version": 4,
                    "action": "published"
                  },
                  {
                    "id": "pkg_demo_01JABC123",
                    "resource_type": "package",
                    "resource_version": 3,
                    "action": "updated"
                  }
                ]
              }
            }
          }
        ]
      },
      "storefront_changed_v1": {
        "name": "storefront.changed.v1",
        "title": "storefront.changed.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [
          "events.catalog.read"
        ],
        "payload": {
          "$ref": "#/components/schemas/storefront_changed_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_storefront_changed_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "storefront.changed.v1",
              "subject": "storefronts/stf_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/storefront.changed/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 2,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "storefront_id": "stf_demo_01JABC123",
                "action": "published",
                "state": {
                  "status": "published",
                  "availability": "available",
                  "audience": "public",
                  "checkout_mode": "public_live"
                },
                "changes": [
                  {
                    "field": "status",
                    "previous": "draft",
                    "current": "published"
                  }
                ]
              }
            }
          }
        ]
      },
      "destination_test_v1": {
        "name": "destination.test.v1",
        "title": "destination.test.v1",
        "contentType": "application/cloudevents+json",
        "x-visibility": "public",
        "x-required-capabilities": [],
        "payload": {
          "$ref": "#/components/schemas/destination_test_v1"
        },
        "examples": [
          {
            "name": "canonical",
            "payload": {
              "specversion": "1.0",
              "id": "evt_demo_destination_test_v1_01JABC123",
              "source": "https://api.batchrelay.com/event-sources/studios/stu_demo_01JABC123",
              "type": "destination.test.v1",
              "subject": "destinations/tst_demo_01JABC123",
              "time": "2026-08-16T18:42:31.123Z",
              "datacontenttype": "application/json",
              "dataschema": "https://api.batchrelay.com/schemas/events/destination.test/v1",
              "tenanttype": "studio",
              "tenantid": "stu_demo_01JABC123",
              "environment": "sandbox",
              "resourceversion": 1,
              "origin": "storefront",
              "correlationid": "cor_demo_order_01JABC123",
              "actorkind": "system",
              "data": {
                "test_id": "tst_demo_01JABC123",
                "message": "Batch Relay event destination verification."
              }
            }
          }
        ]
      }
    },
    "schemas": {
      "envelope": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/envelope/v1",
        "title": "Batch Relay Events 1.0 CloudEvents envelope",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "specversion",
          "id",
          "source",
          "type",
          "subject",
          "time",
          "datacontenttype",
          "dataschema",
          "tenanttype",
          "tenantid",
          "environment",
          "resourceversion",
          "origin",
          "correlationid",
          "actorkind",
          "data"
        ],
        "properties": {
          "specversion": {
            "const": "1.0"
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "source": {
            "type": "string",
            "format": "uri"
          },
          "type": {
            "type": "string"
          },
          "subject": {
            "type": "string",
            "pattern": "^[a-z-]+/[A-Za-z0-9_-]+$"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "datacontenttype": {
            "const": "application/json"
          },
          "dataschema": {
            "type": "string",
            "format": "uri"
          },
          "tenanttype": {
            "enum": [
              "studio",
              "api_account"
            ]
          },
          "tenantid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "environment": {
            "enum": [
              "sandbox",
              "production"
            ]
          },
          "resourceversion": {
            "type": "integer",
            "minimum": 1
          },
          "origin": {
            "enum": [
              "storefront",
              "developer_api",
              "system"
            ]
          },
          "correlationid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "batchid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "causationid": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "actorkind": {
            "enum": [
              "system",
              "staff",
              "api",
              "provider",
              "guardian"
            ]
          },
          "data": {
            "type": "object"
          }
        }
      },
      "topic_data": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/topic-data/v1",
        "$defs": {
          "catalogBatchCompleted": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "batch_id",
              "operation",
              "counts",
              "changed_resources"
            ],
            "properties": {
              "batch_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "operation": {
                "enum": [
                  "availability",
                  "bulk_edit",
                  "import"
                ]
              },
              "counts": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "created",
                  "updated",
                  "published",
                  "archived",
                  "restored",
                  "deleted"
                ],
                "properties": {
                  "created": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "updated": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "published": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "archived": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "restored": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "deleted": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                }
              },
              "changed_resources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "resource_type",
                    "resource_version",
                    "action"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "resource_type": {
                      "enum": [
                        "catalog_item",
                        "package"
                      ]
                    },
                    "resource_version": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "action": {
                      "enum": [
                        "created",
                        "updated",
                        "published",
                        "archived",
                        "restored",
                        "deleted"
                      ]
                    }
                  }
                },
                "minItems": 1,
                "maxItems": 200,
                "x-br-unique-by": [
                  "resource_type",
                  "id"
                ]
              }
            },
            "x-br-counts": {
              "array": "changed_resources",
              "key": "action",
              "counts": "counts"
            }
          },
          "catalogChange": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "field"
                ],
                "properties": {
                  "field": {
                    "enum": [
                      "availability",
                      "status",
                      "canonical_product_id",
                      "canonical_product_revision",
                      "currency",
                      "fulfillment_type",
                      "tax_category",
                      "is_listed_on_storefront",
                      "is_available_standalone",
                      "is_available_in_packages",
                      "is_available_as_add_on",
                      "price_minor_units"
                    ]
                  },
                  "previous": {
                    "$ref": "#/components/schemas/topic_data/$defs/safeScalar"
                  },
                  "current": {
                    "$ref": "#/components/schemas/topic_data/$defs/safeScalar"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "field"
                ],
                "properties": {
                  "field": {
                    "enum": [
                      "display_name",
                      "description",
                      "image_urls",
                      "photo_configurations",
                      "option_selections",
                      "role_bindings",
                      "variant_label",
                      "variant_group_name"
                    ]
                  }
                }
              }
            ]
          },
          "catalogItemChanged": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "catalog_item_id",
              "action",
              "state",
              "changes"
            ],
            "properties": {
              "batch_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "catalog_item_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "action": {
                "enum": [
                  "created",
                  "updated",
                  "published",
                  "archived",
                  "restored",
                  "deleted"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/topic_data/$defs/catalogItemState"
              },
              "changes": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/topic_data/$defs/catalogChange"
                },
                "x-br-unique-by": [
                  "field"
                ],
                "maxItems": 100
              }
            }
          },
          "catalogItemState": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "availability"
            ],
            "properties": {
              "status": {
                "enum": [
                  "draft",
                  "published",
                  "archived",
                  "deleted"
                ]
              },
              "availability": {
                "enum": [
                  "active",
                  "inactive"
                ]
              },
              "display_name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "currency": {
                "const": "USD"
              },
              "price_minor_units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "canonical_product_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "canonical_product_revision": {
                "type": "integer",
                "minimum": 1
              },
              "fulfillment_type": {
                "enum": [
                  "print",
                  "digital",
                  "banner",
                  "other"
                ]
              },
              "tax_category": {
                "enum": [
                  "physical_print",
                  "digital_download",
                  "banner",
                  "other"
                ]
              },
              "is_listed_on_storefront": {
                "type": "boolean"
              },
              "is_available_standalone": {
                "type": "boolean"
              },
              "is_available_in_packages": {
                "type": "boolean"
              },
              "is_available_as_add_on": {
                "type": "boolean"
              }
            }
          },
          "destinationTest": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "test_id",
              "message"
            ],
            "properties": {
              "test_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "message": {
                "const": "Batch Relay event destination verification."
              }
            }
          },
          "orderLine": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "line_id",
                  "display_name",
                  "quantity",
                  "unit_price_minor_units"
                ],
                "properties": {
                  "line_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "unit_price_minor_units": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "canonical_product_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "catalog_item_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "package_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "event_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "canonical_product_id"
                    ]
                  },
                  {
                    "required": [
                      "catalog_item_id"
                    ]
                  },
                  {
                    "required": [
                      "package_id"
                    ]
                  }
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "canonical_product_id",
                  "quantity"
                ],
                "properties": {
                  "canonical_product_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "x-br-origins": [
                  "developer_api"
                ]
              }
            ]
          },
          "orderShipped": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "order_id",
              "status"
            ],
            "properties": {
              "order_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "status": {
                "const": "shipped"
              },
              "carrier_code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 96,
                "pattern": "^[a-z0-9_]+$"
              },
              "carrier_name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "service_level": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "tracking_number": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "tracking_url": {
                "type": "string",
                "format": "uri",
                "pattern": "^https://",
                "maxLength": 2048,
                "x-br-public-tracking-url": true
              }
            }
          },
          "orderSummary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "order_id",
              "status",
              "currency",
              "subtotal_minor_units",
              "discount_minor_units",
              "shipping_minor_units",
              "tax_minor_units",
              "total_minor_units",
              "lines"
            ],
            "properties": {
              "buyer_ref": {
                "type": "string",
                "pattern": "^buyer_[a-f0-9]{64}$"
              },
              "order_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "status": {
                "enum": [
                  "created",
                  "paid"
                ]
              },
              "currency": {
                "const": "USD"
              },
              "subtotal_minor_units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "discount_minor_units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "shipping_minor_units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tax_minor_units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "total_minor_units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lines": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/topic_data/$defs/orderLine"
                },
                "maxItems": 100
              }
            },
            "x-br-money": true
          },
          "packageChange": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "field"
                ],
                "properties": {
                  "field": {
                    "enum": [
                      "availability",
                      "currency",
                      "included_item_count",
                      "price_minor_units",
                      "status"
                    ]
                  },
                  "previous": {
                    "$ref": "#/components/schemas/topic_data/$defs/safeScalar"
                  },
                  "current": {
                    "$ref": "#/components/schemas/topic_data/$defs/safeScalar"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "field"
                ],
                "properties": {
                  "field": {
                    "enum": [
                      "display_name",
                      "description",
                      "included_items",
                      "add_ons",
                      "variant_label",
                      "variant_group_name"
                    ]
                  }
                }
              }
            ]
          },
          "packageChanged": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "package_id",
              "action",
              "state",
              "changes"
            ],
            "properties": {
              "batch_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "package_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "action": {
                "enum": [
                  "created",
                  "updated",
                  "published",
                  "archived",
                  "restored",
                  "deleted"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/topic_data/$defs/packageState"
              },
              "changes": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/topic_data/$defs/packageChange"
                },
                "x-br-unique-by": [
                  "field"
                ],
                "maxItems": 100
              }
            }
          },
          "packageState": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "availability",
              "display_name",
              "currency",
              "price_minor_units",
              "included_item_count"
            ],
            "properties": {
              "status": {
                "enum": [
                  "draft",
                  "published",
                  "archived",
                  "deleted"
                ]
              },
              "availability": {
                "enum": [
                  "active",
                  "inactive"
                ]
              },
              "display_name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "currency": {
                "const": "USD"
              },
              "price_minor_units": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "included_item_count": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "safeScalar": {
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ]
          },
          "storefrontChange": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "field"
                ],
                "properties": {
                  "field": {
                    "enum": [
                      "availability",
                      "hostname",
                      "checkout_mode",
                      "audience",
                      "guardian_join_mode",
                      "provider_submission_enabled",
                      "publication_status",
                      "status"
                    ]
                  },
                  "previous": {
                    "$ref": "#/components/schemas/topic_data/$defs/safeScalar"
                  },
                  "current": {
                    "$ref": "#/components/schemas/topic_data/$defs/safeScalar"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "field"
                ],
                "properties": {
                  "field": {
                    "enum": [
                      "brand_name",
                      "brand_description",
                      "brand_logo",
                      "brand_image",
                      "brand_colors",
                      "website",
                      "custom_domain"
                    ]
                  }
                }
              }
            ]
          },
          "storefrontChanged": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "storefront_id",
              "action",
              "state",
              "changes"
            ],
            "properties": {
              "storefront_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "action": {
                "enum": [
                  "created",
                  "updated",
                  "published",
                  "archived",
                  "restored",
                  "deleted"
                ]
              },
              "state": {
                "$ref": "#/components/schemas/topic_data/$defs/storefrontState"
              },
              "changes": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/topic_data/$defs/storefrontChange"
                },
                "x-br-unique-by": [
                  "field"
                ],
                "maxItems": 100
              }
            }
          },
          "storefrontState": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "availability"
            ],
            "properties": {
              "status": {
                "enum": [
                  "draft",
                  "published",
                  "archived"
                ]
              },
              "availability": {
                "enum": [
                  "available",
                  "unavailable",
                  "restricted"
                ]
              },
              "hostname": {
                "type": "string",
                "pattern": "^[A-Za-z0-9.-]+$"
              },
              "checkout_mode": {
                "enum": [
                  "public_live",
                  "restricted_live",
                  "disabled"
                ]
              },
              "audience": {
                "enum": [
                  "public",
                  "restricted"
                ]
              },
              "guardian_join_mode": {
                "enum": [
                  "invite_link",
                  "explicit_grant_only"
                ]
              },
              "provider_submission_enabled": {
                "type": "boolean"
              },
              "publication_status": {
                "enum": [
                  "draft",
                  "published"
                ]
              }
            }
          }
        }
      },
      "order_fulfillment_updated_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.fulfillment_updated/v1",
        "title": "Batch Relay order.fulfillment_updated.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status",
                  "digital_status",
                  "lab_status",
                  "studio_status",
                  "changes"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "fulfillment_updated"
                  },
                  "digital_status": {
                    "enum": [
                      "not_required",
                      "pending",
                      "fulfilled",
                      "failed"
                    ]
                  },
                  "lab_status": {
                    "enum": [
                      "not_required",
                      "pending",
                      "fulfilled",
                      "failed"
                    ]
                  },
                  "studio_status": {
                    "enum": [
                      "not_required",
                      "pending",
                      "fulfilled",
                      "failed"
                    ]
                  },
                  "changes": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "field",
                        "previous",
                        "current"
                      ],
                      "properties": {
                        "field": {
                          "enum": [
                            "digital_status",
                            "lab_status",
                            "studio_status"
                          ]
                        },
                        "previous": {
                          "enum": [
                            "not_required",
                            "pending",
                            "fulfilled",
                            "failed"
                          ]
                        },
                        "current": {
                          "enum": [
                            "not_required",
                            "pending",
                            "fulfilled",
                            "failed"
                          ]
                        }
                      }
                    },
                    "x-br-unique-by": [
                      "field"
                    ]
                  }
                },
                "x-br-current-changes": true
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "digital_status",
                      "lab_status",
                      "studio_status",
                      "changes"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_updated"
                      },
                      "digital_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "lab_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "studio_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 3,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "field",
                            "previous",
                            "current"
                          ],
                          "properties": {
                            "field": {
                              "enum": [
                                "digital_status",
                                "lab_status",
                                "studio_status"
                              ]
                            },
                            "previous": {
                              "enum": [
                                "not_required",
                                "pending",
                                "fulfilled",
                                "failed"
                              ]
                            },
                            "current": {
                              "enum": [
                                "not_required",
                                "pending",
                                "fulfilled",
                                "failed"
                              ]
                            }
                          }
                        },
                        "x-br-unique-by": [
                          "field"
                        ]
                      }
                    },
                    "x-br-current-changes": true
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "digital_status",
                      "lab_status",
                      "studio_status",
                      "changes"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_updated"
                      },
                      "digital_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "lab_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "studio_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 3,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "field",
                            "previous",
                            "current"
                          ],
                          "properties": {
                            "field": {
                              "enum": [
                                "digital_status",
                                "lab_status",
                                "studio_status"
                              ]
                            },
                            "previous": {
                              "enum": [
                                "not_required",
                                "pending",
                                "fulfilled",
                                "failed"
                              ]
                            },
                            "current": {
                              "enum": [
                                "not_required",
                                "pending",
                                "fulfilled",
                                "failed"
                              ]
                            }
                          }
                        },
                        "x-br-unique-by": [
                          "field"
                        ]
                      }
                    },
                    "x-br-current-changes": true
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "digital_status",
                      "lab_status",
                      "studio_status",
                      "changes"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_updated"
                      },
                      "digital_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "lab_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "studio_status": {
                        "enum": [
                          "not_required",
                          "pending",
                          "fulfilled",
                          "failed"
                        ]
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 3,
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "field",
                            "previous",
                            "current"
                          ],
                          "properties": {
                            "field": {
                              "enum": [
                                "digital_status",
                                "lab_status",
                                "studio_status"
                              ]
                            },
                            "previous": {
                              "enum": [
                                "not_required",
                                "pending",
                                "fulfilled",
                                "failed"
                              ]
                            },
                            "current": {
                              "enum": [
                                "not_required",
                                "pending",
                                "fulfilled",
                                "failed"
                              ]
                            }
                          }
                        },
                        "x-br-unique-by": [
                          "field"
                        ]
                      }
                    },
                    "x-br-current-changes": true
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.fulfillment_updated.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.fulfillment_updated/v1"
          }
        }
      },
      "order_created_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.created/v1",
        "title": "Batch Relay order.created.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/topic_data/$defs/orderSummary"
                  },
                  {
                    "properties": {
                      "status": {
                        "const": "created"
                      }
                    }
                  }
                ]
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "allOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "order_id",
                          "status",
                          "currency",
                          "subtotal_minor_units",
                          "discount_minor_units",
                          "shipping_minor_units",
                          "tax_minor_units",
                          "total_minor_units",
                          "lines"
                        ],
                        "properties": {
                          "buyer_ref": {
                            "type": "string",
                            "pattern": "^buyer_[a-f0-9]{64}$"
                          },
                          "order_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "status": {
                            "enum": [
                              "created",
                              "paid"
                            ]
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "subtotal_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "discount_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "shipping_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "tax_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "total_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lines": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "line_id",
                                    "display_name",
                                    "quantity",
                                    "unit_price_minor_units"
                                  ],
                                  "properties": {
                                    "line_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "unit_price_minor_units": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "catalog_item_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "package_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "event_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "anyOf": [
                                    {
                                      "required": [
                                        "canonical_product_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "catalog_item_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "package_id"
                                      ]
                                    }
                                  ]
                                },
                                false
                              ]
                            },
                            "maxItems": 100
                          }
                        },
                        "x-br-money": true
                      },
                      {
                        "properties": {
                          "status": {
                            "const": "created"
                          }
                        }
                      }
                    ]
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "allOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "order_id",
                          "status",
                          "currency",
                          "subtotal_minor_units",
                          "discount_minor_units",
                          "shipping_minor_units",
                          "tax_minor_units",
                          "total_minor_units",
                          "lines"
                        ],
                        "properties": {
                          "buyer_ref": {
                            "type": "string",
                            "pattern": "^buyer_[a-f0-9]{64}$"
                          },
                          "order_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "status": {
                            "enum": [
                              "created",
                              "paid"
                            ]
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "subtotal_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "discount_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "shipping_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "tax_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "total_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lines": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "line_id",
                                    "display_name",
                                    "quantity",
                                    "unit_price_minor_units"
                                  ],
                                  "properties": {
                                    "line_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "unit_price_minor_units": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "catalog_item_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "package_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "event_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "anyOf": [
                                    {
                                      "required": [
                                        "canonical_product_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "catalog_item_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "package_id"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "canonical_product_id",
                                    "quantity"
                                  ],
                                  "properties": {
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    }
                                  },
                                  "x-br-origins": [
                                    "developer_api"
                                  ]
                                }
                              ]
                            },
                            "maxItems": 100
                          }
                        },
                        "x-br-money": true
                      },
                      {
                        "properties": {
                          "status": {
                            "const": "created"
                          }
                        }
                      }
                    ]
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "allOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "order_id",
                          "status",
                          "currency",
                          "subtotal_minor_units",
                          "discount_minor_units",
                          "shipping_minor_units",
                          "tax_minor_units",
                          "total_minor_units",
                          "lines"
                        ],
                        "properties": {
                          "buyer_ref": {
                            "type": "string",
                            "pattern": "^buyer_[a-f0-9]{64}$"
                          },
                          "order_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "status": {
                            "enum": [
                              "created",
                              "paid"
                            ]
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "subtotal_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "discount_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "shipping_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "tax_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "total_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lines": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "line_id",
                                    "display_name",
                                    "quantity",
                                    "unit_price_minor_units"
                                  ],
                                  "properties": {
                                    "line_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "unit_price_minor_units": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "catalog_item_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "package_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "event_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "anyOf": [
                                    {
                                      "required": [
                                        "canonical_product_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "catalog_item_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "package_id"
                                      ]
                                    }
                                  ]
                                },
                                false
                              ]
                            },
                            "maxItems": 100
                          }
                        },
                        "x-br-money": true
                      },
                      {
                        "properties": {
                          "status": {
                            "const": "created"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.created.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.created/v1"
          }
        }
      },
      "order_paid_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.paid/v1",
        "title": "Batch Relay order.paid.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/topic_data/$defs/orderSummary"
                  },
                  {
                    "properties": {
                      "status": {
                        "const": "paid"
                      }
                    }
                  }
                ]
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "allOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "order_id",
                          "status",
                          "currency",
                          "subtotal_minor_units",
                          "discount_minor_units",
                          "shipping_minor_units",
                          "tax_minor_units",
                          "total_minor_units",
                          "lines"
                        ],
                        "properties": {
                          "buyer_ref": {
                            "type": "string",
                            "pattern": "^buyer_[a-f0-9]{64}$"
                          },
                          "order_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "status": {
                            "enum": [
                              "created",
                              "paid"
                            ]
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "subtotal_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "discount_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "shipping_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "tax_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "total_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lines": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "line_id",
                                    "display_name",
                                    "quantity",
                                    "unit_price_minor_units"
                                  ],
                                  "properties": {
                                    "line_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "unit_price_minor_units": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "catalog_item_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "package_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "event_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "anyOf": [
                                    {
                                      "required": [
                                        "canonical_product_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "catalog_item_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "package_id"
                                      ]
                                    }
                                  ]
                                },
                                false
                              ]
                            },
                            "maxItems": 100
                          }
                        },
                        "x-br-money": true
                      },
                      {
                        "properties": {
                          "status": {
                            "const": "paid"
                          }
                        }
                      }
                    ]
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "allOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "order_id",
                          "status",
                          "currency",
                          "subtotal_minor_units",
                          "discount_minor_units",
                          "shipping_minor_units",
                          "tax_minor_units",
                          "total_minor_units",
                          "lines"
                        ],
                        "properties": {
                          "buyer_ref": {
                            "type": "string",
                            "pattern": "^buyer_[a-f0-9]{64}$"
                          },
                          "order_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "status": {
                            "enum": [
                              "created",
                              "paid"
                            ]
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "subtotal_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "discount_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "shipping_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "tax_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "total_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lines": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "line_id",
                                    "display_name",
                                    "quantity",
                                    "unit_price_minor_units"
                                  ],
                                  "properties": {
                                    "line_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "unit_price_minor_units": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "catalog_item_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "package_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "event_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "anyOf": [
                                    {
                                      "required": [
                                        "canonical_product_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "catalog_item_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "package_id"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "canonical_product_id",
                                    "quantity"
                                  ],
                                  "properties": {
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    }
                                  },
                                  "x-br-origins": [
                                    "developer_api"
                                  ]
                                }
                              ]
                            },
                            "maxItems": 100
                          }
                        },
                        "x-br-money": true
                      },
                      {
                        "properties": {
                          "status": {
                            "const": "paid"
                          }
                        }
                      }
                    ]
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "allOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "order_id",
                          "status",
                          "currency",
                          "subtotal_minor_units",
                          "discount_minor_units",
                          "shipping_minor_units",
                          "tax_minor_units",
                          "total_minor_units",
                          "lines"
                        ],
                        "properties": {
                          "buyer_ref": {
                            "type": "string",
                            "pattern": "^buyer_[a-f0-9]{64}$"
                          },
                          "order_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "status": {
                            "enum": [
                              "created",
                              "paid"
                            ]
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "subtotal_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "discount_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "shipping_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "tax_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "total_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lines": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "required": [
                                    "line_id",
                                    "display_name",
                                    "quantity",
                                    "unit_price_minor_units"
                                  ],
                                  "properties": {
                                    "line_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "display_name": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "quantity": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "unit_price_minor_units": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "canonical_product_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "catalog_item_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "package_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    },
                                    "event_id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 512
                                    }
                                  },
                                  "anyOf": [
                                    {
                                      "required": [
                                        "canonical_product_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "catalog_item_id"
                                      ]
                                    },
                                    {
                                      "required": [
                                        "package_id"
                                      ]
                                    }
                                  ]
                                },
                                false
                              ]
                            },
                            "maxItems": 100
                          }
                        },
                        "x-br-money": true
                      },
                      {
                        "properties": {
                          "status": {
                            "const": "paid"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.paid.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.paid/v1"
          }
        }
      },
      "order_payment_failed_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.payment_failed/v1",
        "title": "Batch Relay order.payment_failed.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status",
                  "reason_code"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "payment_failed"
                  },
                  "reason_code": {
                    "enum": [
                      "insufficient_funds",
                      "payment_declined",
                      "payment_method_required",
                      "payment_not_completed",
                      "unknown"
                    ]
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "payment_failed"
                      },
                      "reason_code": {
                        "enum": [
                          "insufficient_funds",
                          "payment_declined",
                          "payment_method_required",
                          "payment_not_completed",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "payment_failed"
                      },
                      "reason_code": {
                        "enum": [
                          "insufficient_funds",
                          "payment_declined",
                          "payment_method_required",
                          "payment_not_completed",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "payment_failed"
                      },
                      "reason_code": {
                        "enum": [
                          "insufficient_funds",
                          "payment_declined",
                          "payment_method_required",
                          "payment_not_completed",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.payment_failed.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.payment_failed/v1"
          }
        }
      },
      "order_canceled_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.canceled/v1",
        "title": "Batch Relay order.canceled.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "canceled"
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "canceled"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "canceled"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "canceled"
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.canceled.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.canceled/v1"
          }
        }
      },
      "order_fulfillment_queued_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.fulfillment_queued/v1",
        "title": "Batch Relay order.fulfillment_queued.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "fulfillment_queued"
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_queued"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_queued"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_queued"
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.fulfillment_queued.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.fulfillment_queued/v1"
          }
        }
      },
      "order_fulfillment_submitted_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.fulfillment_submitted/v1",
        "title": "Batch Relay order.fulfillment_submitted.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "fulfillment_submitted"
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_submitted"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_submitted"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_submitted"
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.fulfillment_submitted.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.fulfillment_submitted/v1"
          }
        }
      },
      "order_fulfillment_accepted_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.fulfillment_accepted/v1",
        "title": "Batch Relay order.fulfillment_accepted.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "fulfillment_accepted"
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_accepted"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_accepted"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_accepted"
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.fulfillment_accepted.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.fulfillment_accepted/v1"
          }
        }
      },
      "order_fulfillment_rejected_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.fulfillment_rejected/v1",
        "title": "Batch Relay order.fulfillment_rejected.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status",
                  "reason_code"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "fulfillment_rejected"
                  },
                  "reason_code": {
                    "enum": [
                      "provider_rejected",
                      "provider_hold_nonretryable",
                      "provider_unavailable",
                      "provider_validation_failed",
                      "unknown"
                    ]
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_rejected"
                      },
                      "reason_code": {
                        "enum": [
                          "provider_rejected",
                          "provider_hold_nonretryable",
                          "provider_unavailable",
                          "provider_validation_failed",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_rejected"
                      },
                      "reason_code": {
                        "enum": [
                          "provider_rejected",
                          "provider_hold_nonretryable",
                          "provider_unavailable",
                          "provider_validation_failed",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_rejected"
                      },
                      "reason_code": {
                        "enum": [
                          "provider_rejected",
                          "provider_hold_nonretryable",
                          "provider_unavailable",
                          "provider_validation_failed",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.fulfillment_rejected.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.fulfillment_rejected/v1"
          }
        }
      },
      "order_shipped_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.shipped/v1",
        "title": "Batch Relay order.shipped.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/topic_data/$defs/orderShipped"
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "shipped"
                      },
                      "carrier_code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 96,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "carrier_name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "service_level": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "tracking_number": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "tracking_url": {
                        "type": "string",
                        "format": "uri",
                        "pattern": "^https://",
                        "maxLength": 2048,
                        "x-br-public-tracking-url": true
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "shipped"
                      },
                      "carrier_code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 96,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "carrier_name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "service_level": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "tracking_number": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "tracking_url": {
                        "type": "string",
                        "format": "uri",
                        "pattern": "^https://",
                        "maxLength": 2048,
                        "x-br-public-tracking-url": true
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "shipped"
                      },
                      "carrier_code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 96,
                        "pattern": "^[a-z0-9_]+$"
                      },
                      "carrier_name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "service_level": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "tracking_number": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "tracking_url": {
                        "type": "string",
                        "format": "uri",
                        "pattern": "^https://",
                        "maxLength": 2048,
                        "x-br-public-tracking-url": true
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.shipped.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.shipped/v1"
          }
        }
      },
      "order_fulfilled_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.fulfilled/v1",
        "title": "Batch Relay order.fulfilled.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "fulfilled"
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfilled"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfilled"
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfilled"
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.fulfilled.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.fulfilled/v1"
          }
        }
      },
      "order_fulfillment_failed_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/order.fulfillment_failed/v1",
        "title": "Batch Relay order.fulfillment_failed.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_id",
                  "status",
                  "reason_code"
                ],
                "properties": {
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "status": {
                    "const": "fulfillment_failed"
                  },
                  "reason_code": {
                    "enum": [
                      "approval_or_hold_changed",
                      "dispatch_claim_expired_ambiguous",
                      "dispatch_precondition_failed",
                      "dispatch_retry_exhausted",
                      "fulfillment_failed",
                      "provider_hold_nonretryable",
                      "provider_not_live",
                      "snapshot_not_ready",
                      "unknown"
                    ]
                  }
                }
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_failed"
                      },
                      "reason_code": {
                        "enum": [
                          "approval_or_hold_changed",
                          "dispatch_claim_expired_ambiguous",
                          "dispatch_precondition_failed",
                          "dispatch_retry_exhausted",
                          "fulfillment_failed",
                          "provider_hold_nonretryable",
                          "provider_not_live",
                          "snapshot_not_ready",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_failed"
                      },
                      "reason_code": {
                        "enum": [
                          "approval_or_hold_changed",
                          "dispatch_claim_expired_ambiguous",
                          "dispatch_precondition_failed",
                          "dispatch_retry_exhausted",
                          "fulfillment_failed",
                          "provider_hold_nonretryable",
                          "provider_not_live",
                          "snapshot_not_ready",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "order_id",
                      "status",
                      "reason_code"
                    ],
                    "properties": {
                      "order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "status": {
                        "const": "fulfillment_failed"
                      },
                      "reason_code": {
                        "enum": [
                          "approval_or_hold_changed",
                          "dispatch_claim_expired_ambiguous",
                          "dispatch_precondition_failed",
                          "dispatch_retry_exhausted",
                          "fulfillment_failed",
                          "provider_hold_nonretryable",
                          "provider_not_live",
                          "snapshot_not_ready",
                          "unknown"
                        ]
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "order.fulfillment_failed.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/order.fulfillment_failed/v1"
          }
        }
      },
      "catalog_item_changed_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/catalog_item.changed/v1",
        "title": "Batch Relay catalog_item.changed.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/topic_data/$defs/catalogItemChanged"
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "catalog_item_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "catalog_item_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived",
                              "deleted"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "display_name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "price_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "canonical_product_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "canonical_product_revision": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "fulfillment_type": {
                            "enum": [
                              "print",
                              "digital",
                              "banner",
                              "other"
                            ]
                          },
                          "tax_category": {
                            "enum": [
                              "physical_print",
                              "digital_download",
                              "banner",
                              "other"
                            ]
                          },
                          "is_listed_on_storefront": {
                            "type": "boolean"
                          },
                          "is_available_standalone": {
                            "type": "boolean"
                          },
                          "is_available_in_packages": {
                            "type": "boolean"
                          },
                          "is_available_as_add_on": {
                            "type": "boolean"
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "status",
                                    "canonical_product_id",
                                    "canonical_product_revision",
                                    "currency",
                                    "fulfillment_type",
                                    "tax_category",
                                    "is_listed_on_storefront",
                                    "is_available_standalone",
                                    "is_available_in_packages",
                                    "is_available_as_add_on",
                                    "price_minor_units"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "display_name",
                                    "description",
                                    "image_urls",
                                    "photo_configurations",
                                    "option_selections",
                                    "role_bindings",
                                    "variant_label",
                                    "variant_group_name"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "catalog_item_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "catalog_item_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived",
                              "deleted"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "display_name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "price_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "canonical_product_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "canonical_product_revision": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "fulfillment_type": {
                            "enum": [
                              "print",
                              "digital",
                              "banner",
                              "other"
                            ]
                          },
                          "tax_category": {
                            "enum": [
                              "physical_print",
                              "digital_download",
                              "banner",
                              "other"
                            ]
                          },
                          "is_listed_on_storefront": {
                            "type": "boolean"
                          },
                          "is_available_standalone": {
                            "type": "boolean"
                          },
                          "is_available_in_packages": {
                            "type": "boolean"
                          },
                          "is_available_as_add_on": {
                            "type": "boolean"
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "status",
                                    "canonical_product_id",
                                    "canonical_product_revision",
                                    "currency",
                                    "fulfillment_type",
                                    "tax_category",
                                    "is_listed_on_storefront",
                                    "is_available_standalone",
                                    "is_available_in_packages",
                                    "is_available_as_add_on",
                                    "price_minor_units"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "display_name",
                                    "description",
                                    "image_urls",
                                    "photo_configurations",
                                    "option_selections",
                                    "role_bindings",
                                    "variant_label",
                                    "variant_group_name"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "catalog_item_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "catalog_item_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived",
                              "deleted"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "display_name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "price_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "canonical_product_id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "canonical_product_revision": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "fulfillment_type": {
                            "enum": [
                              "print",
                              "digital",
                              "banner",
                              "other"
                            ]
                          },
                          "tax_category": {
                            "enum": [
                              "physical_print",
                              "digital_download",
                              "banner",
                              "other"
                            ]
                          },
                          "is_listed_on_storefront": {
                            "type": "boolean"
                          },
                          "is_available_standalone": {
                            "type": "boolean"
                          },
                          "is_available_in_packages": {
                            "type": "boolean"
                          },
                          "is_available_as_add_on": {
                            "type": "boolean"
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "status",
                                    "canonical_product_id",
                                    "canonical_product_revision",
                                    "currency",
                                    "fulfillment_type",
                                    "tax_category",
                                    "is_listed_on_storefront",
                                    "is_available_standalone",
                                    "is_available_in_packages",
                                    "is_available_as_add_on",
                                    "price_minor_units"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "display_name",
                                    "description",
                                    "image_urls",
                                    "photo_configurations",
                                    "option_selections",
                                    "role_bindings",
                                    "variant_label",
                                    "variant_group_name"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "catalog_item.changed.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/catalog_item.changed/v1"
          }
        }
      },
      "package_changed_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/package.changed/v1",
        "title": "Batch Relay package.changed.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/topic_data/$defs/packageChanged"
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "package_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "package_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability",
                          "display_name",
                          "currency",
                          "price_minor_units",
                          "included_item_count"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived",
                              "deleted"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "display_name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "price_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "included_item_count": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "currency",
                                    "included_item_count",
                                    "price_minor_units",
                                    "status"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "display_name",
                                    "description",
                                    "included_items",
                                    "add_ons",
                                    "variant_label",
                                    "variant_group_name"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "package_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "package_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability",
                          "display_name",
                          "currency",
                          "price_minor_units",
                          "included_item_count"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived",
                              "deleted"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "display_name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "price_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "included_item_count": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "currency",
                                    "included_item_count",
                                    "price_minor_units",
                                    "status"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "display_name",
                                    "description",
                                    "included_items",
                                    "add_ons",
                                    "variant_label",
                                    "variant_group_name"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "package_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "package_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability",
                          "display_name",
                          "currency",
                          "price_minor_units",
                          "included_item_count"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived",
                              "deleted"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "active",
                              "inactive"
                            ]
                          },
                          "display_name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "currency": {
                            "const": "USD"
                          },
                          "price_minor_units": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "included_item_count": {
                            "type": "integer",
                            "minimum": 0
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "currency",
                                    "included_item_count",
                                    "price_minor_units",
                                    "status"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "display_name",
                                    "description",
                                    "included_items",
                                    "add_ons",
                                    "variant_label",
                                    "variant_group_name"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "package.changed.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/package.changed/v1"
          }
        }
      },
      "catalog_batch_completed_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/catalog_batch.completed/v1",
        "title": "Batch Relay catalog_batch.completed.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/topic_data/$defs/catalogBatchCompleted"
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "batch_id",
                      "operation",
                      "counts",
                      "changed_resources"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "operation": {
                        "enum": [
                          "availability",
                          "bulk_edit",
                          "import"
                        ]
                      },
                      "counts": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ],
                        "properties": {
                          "created": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "updated": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "published": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "archived": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "restored": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "deleted": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        }
                      },
                      "changed_resources": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "id",
                            "resource_type",
                            "resource_version",
                            "action"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "resource_type": {
                              "enum": [
                                "catalog_item",
                                "package"
                              ]
                            },
                            "resource_version": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "action": {
                              "enum": [
                                "created",
                                "updated",
                                "published",
                                "archived",
                                "restored",
                                "deleted"
                              ]
                            }
                          }
                        },
                        "minItems": 1,
                        "maxItems": 200,
                        "x-br-unique-by": [
                          "resource_type",
                          "id"
                        ]
                      }
                    },
                    "x-br-counts": {
                      "array": "changed_resources",
                      "key": "action",
                      "counts": "counts"
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "batch_id",
                      "operation",
                      "counts",
                      "changed_resources"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "operation": {
                        "enum": [
                          "availability",
                          "bulk_edit",
                          "import"
                        ]
                      },
                      "counts": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ],
                        "properties": {
                          "created": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "updated": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "published": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "archived": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "restored": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "deleted": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        }
                      },
                      "changed_resources": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "id",
                            "resource_type",
                            "resource_version",
                            "action"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "resource_type": {
                              "enum": [
                                "catalog_item",
                                "package"
                              ]
                            },
                            "resource_version": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "action": {
                              "enum": [
                                "created",
                                "updated",
                                "published",
                                "archived",
                                "restored",
                                "deleted"
                              ]
                            }
                          }
                        },
                        "minItems": 1,
                        "maxItems": 200,
                        "x-br-unique-by": [
                          "resource_type",
                          "id"
                        ]
                      }
                    },
                    "x-br-counts": {
                      "array": "changed_resources",
                      "key": "action",
                      "counts": "counts"
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "batch_id",
                      "operation",
                      "counts",
                      "changed_resources"
                    ],
                    "properties": {
                      "batch_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "operation": {
                        "enum": [
                          "availability",
                          "bulk_edit",
                          "import"
                        ]
                      },
                      "counts": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ],
                        "properties": {
                          "created": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "updated": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "published": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "archived": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "restored": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "deleted": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        }
                      },
                      "changed_resources": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "id",
                            "resource_type",
                            "resource_version",
                            "action"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "resource_type": {
                              "enum": [
                                "catalog_item",
                                "package"
                              ]
                            },
                            "resource_version": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "action": {
                              "enum": [
                                "created",
                                "updated",
                                "published",
                                "archived",
                                "restored",
                                "deleted"
                              ]
                            }
                          }
                        },
                        "minItems": 1,
                        "maxItems": 200,
                        "x-br-unique-by": [
                          "resource_type",
                          "id"
                        ]
                      }
                    },
                    "x-br-counts": {
                      "array": "changed_resources",
                      "key": "action",
                      "counts": "counts"
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "catalog_batch.completed.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/catalog_batch.completed/v1"
          }
        }
      },
      "storefront_changed_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/storefront.changed/v1",
        "title": "Batch Relay storefront.changed.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/topic_data/$defs/storefrontChanged"
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "storefront_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "storefront_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "available",
                              "unavailable",
                              "restricted"
                            ]
                          },
                          "hostname": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9.-]+$"
                          },
                          "checkout_mode": {
                            "enum": [
                              "public_live",
                              "restricted_live",
                              "disabled"
                            ]
                          },
                          "audience": {
                            "enum": [
                              "public",
                              "restricted"
                            ]
                          },
                          "guardian_join_mode": {
                            "enum": [
                              "invite_link",
                              "explicit_grant_only"
                            ]
                          },
                          "provider_submission_enabled": {
                            "type": "boolean"
                          },
                          "publication_status": {
                            "enum": [
                              "draft",
                              "published"
                            ]
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "hostname",
                                    "checkout_mode",
                                    "audience",
                                    "guardian_join_mode",
                                    "provider_submission_enabled",
                                    "publication_status",
                                    "status"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "brand_name",
                                    "brand_description",
                                    "brand_logo",
                                    "brand_image",
                                    "brand_colors",
                                    "website",
                                    "custom_domain"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "storefront_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "storefront_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "available",
                              "unavailable",
                              "restricted"
                            ]
                          },
                          "hostname": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9.-]+$"
                          },
                          "checkout_mode": {
                            "enum": [
                              "public_live",
                              "restricted_live",
                              "disabled"
                            ]
                          },
                          "audience": {
                            "enum": [
                              "public",
                              "restricted"
                            ]
                          },
                          "guardian_join_mode": {
                            "enum": [
                              "invite_link",
                              "explicit_grant_only"
                            ]
                          },
                          "provider_submission_enabled": {
                            "type": "boolean"
                          },
                          "publication_status": {
                            "enum": [
                              "draft",
                              "published"
                            ]
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "hostname",
                                    "checkout_mode",
                                    "audience",
                                    "guardian_join_mode",
                                    "provider_submission_enabled",
                                    "publication_status",
                                    "status"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "brand_name",
                                    "brand_description",
                                    "brand_logo",
                                    "brand_image",
                                    "brand_colors",
                                    "website",
                                    "custom_domain"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "storefront_id",
                      "action",
                      "state",
                      "changes"
                    ],
                    "properties": {
                      "storefront_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "action": {
                        "enum": [
                          "created",
                          "updated",
                          "published",
                          "archived",
                          "restored",
                          "deleted"
                        ]
                      },
                      "state": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "availability"
                        ],
                        "properties": {
                          "status": {
                            "enum": [
                              "draft",
                              "published",
                              "archived"
                            ]
                          },
                          "availability": {
                            "enum": [
                              "available",
                              "unavailable",
                              "restricted"
                            ]
                          },
                          "hostname": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9.-]+$"
                          },
                          "checkout_mode": {
                            "enum": [
                              "public_live",
                              "restricted_live",
                              "disabled"
                            ]
                          },
                          "audience": {
                            "enum": [
                              "public",
                              "restricted"
                            ]
                          },
                          "guardian_join_mode": {
                            "enum": [
                              "invite_link",
                              "explicit_grant_only"
                            ]
                          },
                          "provider_submission_enabled": {
                            "type": "boolean"
                          },
                          "publication_status": {
                            "enum": [
                              "draft",
                              "published"
                            ]
                          }
                        }
                      },
                      "changes": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "availability",
                                    "hostname",
                                    "checkout_mode",
                                    "audience",
                                    "guardian_join_mode",
                                    "provider_submission_enabled",
                                    "publication_status",
                                    "status"
                                  ]
                                },
                                "previous": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "current": {
                                  "type": [
                                    "string",
                                    "number",
                                    "boolean",
                                    "null"
                                  ]
                                }
                              }
                            },
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "field"
                              ],
                              "properties": {
                                "field": {
                                  "enum": [
                                    "brand_name",
                                    "brand_description",
                                    "brand_logo",
                                    "brand_image",
                                    "brand_colors",
                                    "website",
                                    "custom_domain"
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        "x-br-unique-by": [
                          "field"
                        ],
                        "maxItems": 100
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "storefront.changed.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/storefront.changed/v1"
          }
        }
      },
      "destination_test_v1": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "https://api.batchrelay.com/schemas/events/destination.test/v1",
        "title": "Batch Relay destination.test.v1",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/envelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/topic_data/$defs/destinationTest"
              }
            }
          },
          {
            "oneOf": [
              {
                "properties": {
                  "origin": {
                    "const": "storefront"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "test_id",
                      "message"
                    ],
                    "properties": {
                      "test_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "message": {
                        "const": "Batch Relay event destination verification."
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "developer_api"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "test_id",
                      "message"
                    ],
                    "properties": {
                      "test_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "message": {
                        "const": "Batch Relay event destination verification."
                      }
                    }
                  }
                }
              },
              {
                "properties": {
                  "origin": {
                    "const": "system"
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "test_id",
                      "message"
                    ],
                    "properties": {
                      "test_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "message": {
                        "const": "Batch Relay event destination verification."
                      }
                    }
                  }
                }
              }
            ]
          }
        ],
        "properties": {
          "type": {
            "const": "destination.test.v1"
          },
          "dataschema": {
            "const": "https://api.batchrelay.com/schemas/events/destination.test/v1"
          }
        }
      }
    }
  }
}
