{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/BillingWorkflowCollectionSettings",
  "title": "Workflow collection settings",
  "description": "Workflow collection specifies how to collect the pending line items for an invoice.",
  "type": "object",
  "properties": {
    "alignment": {
      "description": "The alignment for collecting the pending line items into an invoice.",
      "type": "object",
      "default": {
        "type": "subscription"
      },
      "discriminator": {
        "propertyName": "type",
        "mapping": {
          "subscription": "#/components/schemas/BillingWorkflowCollectionAlignmentSubscription",
          "anchored": "#/components/schemas/BillingWorkflowCollectionAlignmentAnchored"
        }
      },
      "oneOf": [
        {
          "$ref": "#/components/schemas/BillingWorkflowCollectionAlignmentSubscription"
        },
        {
          "$ref": "#/components/schemas/BillingWorkflowCollectionAlignmentAnchored"
        }
      ]
    },
    "interval": {
      "description": "This grace period can be used to delay the collection of the pending line items specified in\nalignment.\n\nThis is useful, in case of multiple subscriptions having slightly different billing periods.",
      "type": "string",
      "format": "ISO8601",
      "example": "P1D",
      "default": "PT1H"
    }
  }
}