{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/timbrix-mx/json-schema/timbrix-mx-organization-response-dto-schema.json",
  "title": "OrganizationResponseDto",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/timbrix-mx-openapi.yaml#/components/schemas/OrganizationResponseDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "logo_url": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "is_production_ready": {
      "type": "boolean"
    },
    "pending_steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PendingStepDto"
      }
    },
    "legal": {
      "$ref": "#/$defs/LegalDto"
    },
    "customization": {
      "$ref": "#/$defs/CustomizationDto"
    },
    "certificate": {
      "$ref": "#/$defs/CertificateDto"
    },
    "fiel": {
      "$ref": "#/$defs/FielDto"
    },
    "receipts": {
      "$ref": "#/$defs/ReceiptsDto"
    },
    "self_invoice": {
      "$ref": "#/$defs/SelfInvoiceDto"
    },
    "closed_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "TIM-160: when the organization was closed (read-only). Null if it is open."
    },
    "retained_until": {
      "type": [
        "string",
        "null"
      ],
      "description": "TIM-160: for a closed organization, the date until which its CFDI are retained and downloadable. Null if it is open."
    },
    "data_purge_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "TIM-162: for a closed organization, the date on which its customers, products, webhooks, API keys, OAuth apps and invites are deleted (90 days after closing). Invoices are kept. Null if it is open."
    },
    "data_purged_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "TIM-162: when that data was deleted. Null if it has not been deleted yet."
    }
  },
  "required": [
    "id",
    "slug",
    "timezone",
    "created_at",
    "updated_at",
    "is_production_ready",
    "legal",
    "customization",
    "certificate",
    "fiel",
    "receipts",
    "self_invoice",
    "closed_at",
    "retained_until",
    "data_purge_at",
    "data_purged_at"
  ],
  "$defs": {
    "AddressDto": {
      "type": "object",
      "properties": {
        "street": {
          "type": "string"
        },
        "exterior": {
          "type": "string"
        },
        "interior": {
          "type": "string"
        },
        "neighborhood": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "municipality": {
          "type": "string"
        },
        "zip": {
          "type": "string"
        },
        "state": {
          "type": "string"
        }
      }
    },
    "CertificateDto": {
      "type": "object",
      "properties": {
        "has_certificate": {
          "type": "boolean"
        },
        "updated_at": {
          "type": "string"
        },
        "expires_at": {
          "type": "string"
        },
        "serial_number": {
          "type": "string"
        }
      },
      "required": [
        "has_certificate"
      ]
    },
    "CustomizationDto": {
      "type": "object",
      "properties": {
        "has_logo": {
          "type": "boolean"
        },
        "color": {
          "type": "string"
        },
        "next_folio_number": {
          "type": "number"
        },
        "next_folio_number_test": {
          "type": "number"
        },
        "pdf_extra": {
          "$ref": "#/$defs/PdfExtraOptionsDto"
        }
      },
      "required": [
        "has_logo"
      ]
    },
    "FielDto": {
      "type": "object",
      "properties": {
        "has_fiel": {
          "type": "boolean"
        },
        "updated_at": {
          "type": "string"
        },
        "expires_at": {
          "type": "string"
        },
        "serial_number": {
          "type": "string"
        }
      },
      "required": [
        "has_fiel"
      ]
    },
    "LegalDto": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "legal_name": {
          "type": "string"
        },
        "tax_system": {
          "type": "string"
        },
        "website": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "rfc": {
          "type": "string"
        },
        "zip": {
          "type": "string"
        },
        "address": {
          "$ref": "#/$defs/AddressDto"
        }
      }
    },
    "PdfExtraOptionsDto": {
      "type": "object",
      "properties": {
        "codes": {
          "type": "boolean"
        },
        "address_codes": {
          "type": "boolean"
        },
        "product_key": {
          "type": "boolean"
        },
        "round_unit_price": {
          "type": "boolean"
        },
        "tax_breakdown": {
          "type": "boolean"
        },
        "ieps_breakdown": {
          "type": "boolean"
        },
        "render_carta_porte": {
          "type": "boolean"
        },
        "repeat_signature": {
          "type": "boolean"
        }
      }
    },
    "PendingStepDto": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "description"
      ]
    },
    "ReceiptsDto": {
      "type": "object",
      "properties": {
        "periodicity": {
          "type": "string",
          "enum": [
            "day",
            "week",
            "month"
          ]
        },
        "duration_days": {
          "type": "number"
        },
        "next_folio_number": {
          "type": "number"
        },
        "next_folio_number_test": {
          "type": "number"
        }
      }
    },
    "SelfInvoiceDto": {
      "type": "object",
      "properties": {
        "allowed_cfdi_uses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "apply_resico_isr": {
          "type": "boolean"
        },
        "support_email": {
          "type": "string"
        },
        "support_email_verified": {
          "type": "boolean"
        }
      }
    }
  }
}