{
  "openapi": "3.0.1",
  "info": {
    "title": "Calendar Global Content Management API",
    "description": "Calendar Global Content Management API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.onesourcetax.com"
    },
    {
      "url": "https://api-apac.onesourcetax.com"
    },
    {
      "url": "https://api-emea.onesourcetax.com"
    }
  ],
  "paths": {
    "/calendar/obligations/v1": {
      "get": {
        "tags": [
          "Obligations"
        ],
        "summary": "Get information for multiple obligations that match the query.",
        "parameters": [
          {
            "name": "Id",
            "in": "query",
            "description": "The obligation record ID.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "DomainType",
            "in": "query",
            "description": "Obligations with one or more of the domain types specified.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "TaxType",
            "in": "query",
            "description": "Obligations with one or more of the tax types specified.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "DeliverableType",
            "in": "query",
            "description": "Obligations with one or more of the deliverable types specified.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "ObligationType",
            "in": "query",
            "description": "Obligations with one or more of the obligation types specified.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Jurisdiction",
            "in": "query",
            "description": "Obligations with the Jurisidiction ID provided. Example - http://ontology.onesourcetax.com/core/jurisdiction:USA",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "TaxedAs",
            "in": "query",
            "description": "Obligations with one or more of the taxed as values specified.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "UsReturnType",
            "in": "query",
            "description": "Obligations with one or more of the US return type values specified.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Frequency",
            "in": "query",
            "description": "Obligations with the frequency specified.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Form",
            "in": "query",
            "description": "Obligations with one or more of the forms specified.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "TaxYearStartDate",
            "in": "query",
            "description": "Obligations valid for tax years starting on or after this date. UTC format should be used.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "TaxYearEndDate",
            "in": "query",
            "description": "Obligations valid for tax years ending on or before this date. UTC format should be used.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "ModifiedGte",
            "in": "query",
            "description": "Obligations that were last modified on or after the date specified. UTC format should be used.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "Offset",
            "in": "query",
            "description": "Offset based pagination - zero-based index specifying the first item in the collection to return. It cannot be a negative value. Default value of 0.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Limit",
            "in": "query",
            "description": "Offset based pagination - maximum number of records to appear in the result. Default value of 10. Maximum value of 100.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObligationSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/calendar/obligations/v1/{id}/calculated-due-dates": {
      "post": {
        "tags": [
          "Obligations"
        ],
        "summary": "Provide due dates for an obligation based on calculation parameters.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the obligation",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "Calculation parameters",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateDueDateRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateDueDateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateDueDateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateDueDateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CalculatedDueDateResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CalculateDueDateRequest": {
        "type": "object",
        "properties": {
          "TaxYearStartDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "TaxYearEndDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "PeriodEndDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "IssueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "IssueDay": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "IncorporationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "QualificationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "TaxId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CalculatedDueDateResponse": {
        "type": "object",
        "properties": {
          "Sequence": {
            "type": "integer",
            "description": "Sequence for the due date",
            "format": "int32"
          },
          "OriginalDueDate": {
            "type": "string",
            "description": "The original due date for the due date sequence",
            "format": "date-time"
          },
          "Extensions": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date-time"
            },
            "description": "All available extensions for the due date sequence",
            "nullable": true
          },
          "IsLookupListAvailable": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContentUpdates": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "nullable": true
          },
          "replacementObligations": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DynamicAttribute": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EffectiveDate": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "reference": {
            "$ref": "#/components/schemas/EffectiveDateReference"
          }
        },
        "additionalProperties": false
      },
      "EffectiveDateReference": {
        "enum": [
          "taxYearEndDate",
          "taxYearStartDate"
        ],
        "type": "string"
      },
      "FrequencyType": {
        "enum": [
          "annual",
          "monthly",
          "quarterly",
          "semiAnnual",
          "fourMonthly",
          "biMonthly",
          "semiMonthly",
          "nonStandard",
          "biennial",
          "weekly"
        ],
        "type": "string"
      },
      "JurisdictionResponse": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "string",
            "nullable": true
          },
          "Name": {
            "type": "string",
            "nullable": true
          },
          "Type": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Meta": {
        "type": "object",
        "properties": {
          "totalItems": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ObligationCalculationRule": {
        "type": "object",
        "properties": {
          "ruleId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "taxYearRange": {
            "type": "string",
            "nullable": true
          },
          "dataRequiredForCalculation": {
            "$ref": "#/components/schemas/RequiredForCalculation"
          }
        },
        "additionalProperties": false
      },
      "ObligationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The obligation record ID.",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "The name of the obligation.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "The description of the obligation.",
            "nullable": true
          },
          "jurisdiction": {
            "$ref": "#/components/schemas/JurisdictionResponse"
          },
          "domainType": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The domain types associated with the obligation.",
            "nullable": true
          },
          "taxType": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The tax types associated with the obligation.",
            "nullable": true
          },
          "deliverableType": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The deliverable types associated with the obligation.",
            "nullable": true
          },
          "obligationType": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The obligation types associated with the obligation.",
            "nullable": true
          },
          "taxedAs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Taxed as values associated with the obligation.",
            "nullable": true
          },
          "usReturnType": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "US return types associated to this obligation.",
            "nullable": true
          },
          "form": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Forms associated to this obligation.",
            "nullable": true
          },
          "effectiveFrom": {
            "$ref": "#/components/schemas/EffectiveDate"
          },
          "effectiveTo": {
            "$ref": "#/components/schemas/EffectiveDate"
          },
          "dynamicAttributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DynamicAttribute"
            },
            "description": "Dynamic attributes applicable to the obligation.",
            "nullable": true
          },
          "frequency": {
            "$ref": "#/components/schemas/FrequencyType"
          },
          "contentUpdates": {
            "$ref": "#/components/schemas/ContentUpdates"
          },
          "created": {
            "type": "string",
            "description": "When this obligation was created, in UTC format.",
            "format": "date-time",
            "nullable": true
          },
          "modified": {
            "type": "string",
            "description": "When this obligation was last updated, in UTC format.",
            "format": "date-time",
            "nullable": true
          },
          "calculationRule": {
            "$ref": "#/components/schemas/ObligationCalculationRule"
          },
          "classicCalendarTemplate": {
            "type": "string",
            "description": "The template of the matching obligation in Calendar Classic.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ObligationSearchResponse": {
        "type": "object",
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObligationResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RequiredForCalculation": {
        "enum": [
          "TaxId",
          "IncorporationDate",
          "QualificationDate",
          "IssueDay"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "Enter the authorization token here. Example: Bearer ABC",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ]
}
