openapi: 3.0.1
info:
  title: API SAT PM SANDBOX
  description: <p>API SAT PM SANDBOX.<br/><br/><img src='https://developer.circulodecredito.com.mx/sites/default/files/2024-01/Logo-Swaggers.png' width='240'/></p>  
  termsOfService: https://developer.circulodecredito.com.mx/legal-mx
  contact:
    email: api@circulodecredito.com.mx
  license:
    name: Derechos reservados Circulo de Crédito 2020
    url: http://www.circulodecredito.com.mx
  version: "1.0"
servers:
- url: https://services.circulodecredito.com.mx/sandbox/v1/sat
paths:
  /login:
    post:
      tags:
      - Credentials
      operationId: CreateCredential
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialCiecInput'
        required: false
      responses:
        202:
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseCredential'
        404:
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        401:
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseUnauthorized'
      x-codegen-request-body-name: body
  /taxpayers/{id}/invoices:
    get:
      tags:
      - Invoices
      summary: ListTaxpayerInvoice
      description: List all taxpayer invoices
      operationId: ListTaxpayerInvoice
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
          nullable: false
      - name: x-request-id
        in: header
        description: id value returned in POST /login
        required: true
        schema:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          nullable: false
      - name: x-data-provider
        in: header
        description: Data provider ID
        required: true
        schema:
          type: string
          enum: ["A"]
          nullable: false
      - name: id
        in: path
        description: RFC (Registro Federal de Contribuyentes)
        required: true
        schema:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          nullable: false
      - name: uuid
        in: query
        description: Filter by UUID/Folio Fiscal (exact match)
        schema:
          type: string
          format: uuid
      - name: version
        in: query
        description: Filter by CFDI version (exact match)
        schema:
          type: number
          format: double
      - name: type
        in: query
        description: Filter by type (exact match)
        schema:
          type: string
          enum:
          - I
          - E
          - P
          - N
          - T
      - name: usage
        in: query
        description: Filter by usage (exact match)
        schema:
          type: string
      - name: paymentType
        in: query
        description: Filter by payment type (exact match)
        schema:
          type: string
          enum:
          - PUE
          - PPD
      - name: paymentMethod
        in: query
        description: Filter by payment method (exact match)
        schema:
          type: string
      - name: issuer.rfc
        in: query
        description: Filter by issuer RFC (partial match)
        schema:
          maxLength: 13
          minLength: 12
          type: string
      - name: issuer.name
        in: query
        description: Filter by issuer name (partial match)
        schema:
          maxLength: 254
          minLength: 1
          type: string
      - name: issuer.taxRegime
        in: query
        description: Filter by issuer tax regime (partial match)
        schema:
          type: number
          format: double
      - name: issuer.blacklistStatus
        in: query
        description: Filter by issuer blacklist status
        schema:
          type: string
          enum:
          - presumed
          - dismissed
          - definitive
          - favorable
      - name: isIssuer
        in: query
        description: Filter if the invoice issuer is the taxpayer from the link
        schema:
          type: boolean
      - name: receiver.rfc
        in: query
        description: Filter by receiver RFC (partial match)
        schema:
          maxLength: 13
          minLength: 12
          type: string
      - name: receiver.name
        in: query
        description: Filter by receiver name (partial match)
        schema:
          maxLength: 254
          minLength: 1
          type: string
      - name: receiver.blacklistStatus
        in: query
        description: Filter by receiver blacklist status
        schema:
          type: string
          enum:
          - presumed
          - dismissed
          - definitive
          - favorable
      - name: isReceiver
        in: query
        description: Filter if the invoice receiver is the taxpayer from the link
        schema:
          type: boolean
      - name: currency
        in: query
        description: Filter by currency code (exact match)
        schema:
          maxLength: 3
          minLength: 3
          type: string
      - name: status
        in: query
        description: Filter by status (exact match)
        schema:
          type: string
          enum:
          - VIGENTE
          - CANCELADO
      - name: pac
        in: query
        description: Filter by certification provider (partial match)
        schema:
          maxLength: 12
          minLength: 12
          type: string
      - name: cancellationStatus
        in: query
        description: Filter by cancellation status (partial match)
        schema:
          type: string
          enum:
          - Cancelable sin aceptación
          - Cancelable con aceptación
          - No cancelable
      - name: cancellationStatusProcess
        in: query
        description: Filter by cancellation process status (partial match)
        schema:
          type: string
          enum:
          - En proceso
          - Solicitud rechazada
          - Cancelado sin aceptación
          - Cancelado con aceptación
          - Plazo vencido
      - name: issuedAt[before]
        in: query
        description: Filter by issue date (less than or equal `<=`)
        schema:
          type: string
          format: date-time
      - name: issuedAt[strictly_before]
        in: query
        description: Filter by issue date (less than `<`)
        schema:
          type: string
          format: date-time
      - name: issuedAt[after]
        in: query
        description: Filter by issue date (greater than or equal `>=`)
        schema:
          type: string
          format: date-time
      - name: issuedAt[strictly_after]
        in: query
        description: Filter by issue date (greater than `>`)
        schema:
          type: string
          format: date-time
      - name: canceledAt[before]
        in: query
        description: Filter by cancellation date (less than or equal `<=`)
        schema:
          type: string
          format: date-time
      - name: canceledAt[strictly_before]
        in: query
        description: Filter by cancellation date (less than `<`)
        schema:
          type: string
          format: date-time
      - name: canceledAt[after]
        in: query
        description: Filter by cancellation date (greater than or equal `>=`)
        schema:
          type: string
          format: date-time
      - name: canceledAt[strictly_after]
        in: query
        description: Filter by cancellation date (greater than `>`)
        schema:
          type: string
          format: date-time
      - name: createdAt[before]
        in: query
        description: Filter by creation date (less than or equal `<=`)
        schema:
          type: string
      - name: createdAt[strictly_before]
        in: query
        description: Filter by creation date (less than `<`)
        schema:
          type: string
      - name: createdAt[after]
        in: query
        description: Filter by creation date (greater than or equal `>=`)
        schema:
          type: string
      - name: createdAt[strictly_after]
        in: query
        description: Filter by creation date (greater than `>`)
        schema:
          type: string
      - name: updatedAt[before]
        in: query
        description: Filter by update date (less than or equal `<=`)
        schema:
          type: string
      - name: updatedAt[strictly_before]
        in: query
        description: Filter by update date (less than `<`)
        schema:
          type: string
      - name: updatedAt[after]
        in: query
        description: Filter by update date (greater than or equal `>=`)
        schema:
          type: string
      - name: updatedAt[strictly_after]
        in: query
        description: Filter by update date (greater than `>`)
        schema:
          type: string
      - name: certifiedAt[before]
        in: query
        description: Filter by certified date (less than or equal `<=`)
        schema:
          type: string
          format: date-time
      - name: certifiedAt[strictly_before]
        in: query
        description: Filter by certified date (less than `<`)
        schema:
          type: string
          format: date-time
      - name: certifiedAt[after]
        in: query
        description: Filter by certified date (greater than or equal `>=`)
        schema:
          type: string
          format: date-time
      - name: certifiedAt[strictly_after]
        in: query
        description: Filter by certified date (greater than `>`)
        schema:
          type: string
          format: date-time
      - name: lastPaymentDate[before]
        in: query
        description: Filter by last payment date (less than or equal `<=`)
        schema:
          type: string
          format: date-time
      - name: lastPaymentDate[strictly_before]
        in: query
        description: Filter by last payment date (less than `<`)
        schema:
          type: string
          format: date-time
      - name: lastPaymentDate[after]
        in: query
        description: Filter by last payment date (greater than or equal `>=`)
        schema:
          type: string
          format: date-time
      - name: lastPaymentDate[strictly_after]
        in: query
        description: Filter by last payment date (greater than `>`)
        schema:
          type: string
          format: date-time
      - name: fullyPaidAt[before]
        in: query
        description: Filter by fully paid date (less than or equal `<=`)
        schema:
          type: string
          format: date-time
      - name: fullyPaidAt[strictly_before]
        in: query
        description: Filter by fully paid date (less than `<`)
        schema:
          type: string
          format: date-time
      - name: fullyPaidAt[after]
        in: query
        description: Filter by fully paid date (greater than or equal `>=`)
        schema:
          type: string
          format: date-time
      - name: fullyPaidAt[strictly_after]
        in: query
        description: Filter by fully paid date (greater than `>`)
        schema:
          type: string
          format: date-time
      - name: tax[between]
        in: query
        description: Filter by tax between two values
        schema:
          type: string
      - name: tax[gt]
        in: query
        description: Filter by tax (greater than `>`)
        schema:
          type: number
          format: double
      - name: tax[gte]
        in: query
        description: Filter by tax (greater than or equal `>=`)
        schema:
          type: number
          format: double
      - name: tax[lt]
        in: query
        description: Filter by tax (less than `<`)
        schema:
          type: number
          format: double
      - name: tax[lte]
        in: query
        description: Filter by tax (less than or equal `<=`)
        schema:
          type: number
          format: double
      - name: discount[between]
        in: query
        description: Filter by discount between two values
        schema:
          type: string
      - name: discount[gt]
        in: query
        description: Filter by discount (greater than `>`)
        schema:
          type: number
          format: double
      - name: discount[gte]
        in: query
        description: Filter by discount (greater than or equal `>=`)
        schema:
          type: number
          format: double
      - name: discount[lt]
        in: query
        description: Filter by discount (less than `<`)
        schema:
          type: number
          format: double
      - name: discount[lte]
        in: query
        description: Filter by discount (less than or equal `<=`)
        schema:
          type: number
          format: double
      - name: subtotal[between]
        in: query
        description: Filter by subtotal between two values
        schema:
          type: string
      - name: subtotal[gt]
        in: query
        description: Filter by subtotal (greater than `>`)
        schema:
          type: number
          format: double
      - name: subtotal[gte]
        in: query
        description: Filter by subtotal (greater than or equal `>=`)
        schema:
          type: number
          format: double
      - name: subtotal[lt]
        in: query
        description: Filter by subtotal (less than `<`)
        schema:
          type: number
          format: double
      - name: subtotal[lte]
        in: query
        description: Filter by subtotal (less than or equal `<=`)
        schema:
          type: number
          format: double
      - name: total[between]
        in: query
        description: Filter by total between two values
        schema:
          type: string
      - name: total[gt]
        in: query
        description: Filter by total (greater than `>`)
        schema:
          type: number
          format: double
      - name: total[gte]
        in: query
        description: Filter by total (greater than or equal `>=`)
        schema:
          type: number
          format: double
      - name: total[lt]
        in: query
        description: Filter by total (less than `<`)
        schema:
          type: number
          format: double
      - name: total[lte]
        in: query
        description: Filter by total (less than or equal `<=`)
        schema:
          type: number
          format: double
      - name: paidAmount[between]
        in: query
        description: Filter by paidAmount between two values
        schema:
          type: string
      - name: paidAmount[gt]
        in: query
        description: Filter by paidAmount (greater than `>`)
        schema:
          type: number
          format: double
      - name: paidAmount[gte]
        in: query
        description: Filter by paidAmount (greater than or equal `>=`)
        schema:
          type: number
          format: double
      - name: paidAmount[lt]
        in: query
        description: Filter by paidAmount (less than `<`)
        schema:
          type: number
          format: double
      - name: paidAmount[lte]
        in: query
        description: Filter by paidAmount (less than or equal `<=`)
        schema:
          type: number
          format: double
      - name: dueAmount[between]
        in: query
        description: Filter by dueAmount between two values
        schema:
          type: string
      - name: dueAmount[gt]
        in: query
        description: Filter by dueAmount (greater than `>`)
        schema:
          type: number
          format: double
      - name: dueAmount[gte]
        in: query
        description: Filter by dueAmount (greater than or equal `>=`)
        schema:
          type: number
          format: double
      - name: dueAmount[lt]
        in: query
        description: Filter by dueAmount (less than `<`)
        schema:
          type: number
          format: double
      - name: dueAmount[lte]
        in: query
        description: Filter by dueAmount (less than or equal `<=`)
        schema:
          type: number
          format: double
      - name: hasXml
        in: query
        description: Filter by invoices that have the CFDI available in XML format
        schema:
          type: boolean
      - name: hasPdf
        in: query
        description: Filter by invoices that have the CFDI available in PDF format
        schema:
          type: boolean
      - name: order[issuedAt]
        in: query
        description: Order by issue date
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: order[canceledAt]
        in: query
        description: Order by cancellation date
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: order[certifiedAt]
        in: query
        description: Order by certification date
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: order[amount]
        in: query
        description: Order by amount
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: page
        in: query
        description: The collection page number
        schema:
          type: integer
          format: int32
          default: 1
      - name: itemsPerPage
        in: query
        description: The number of items per page
        schema:
          maximum: 100
          exclusiveMaximum: false
          minimum: 1
          exclusiveMinimum: false
          type: integer
          format: int32
          default: 30
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseTaxPayerInvoice'
        404:
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      deprecated: false
  /tax-returns/{id}/data:
    get:
      tags:
      - TaxReturns
      summary: GetTaxReturnData
      description: Process a legal taxpayer annual tax return pdf and extracts the
        content from incomes statement and balance sheet
      operationId: GetTaxReturnData
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
          nullable: false
      - name: x-request-id
        in: header
        description: idA value returned in POST /login
        required: true
        schema:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          nullable: false
      - name: x-data-provider
        in: header
        description: Id Data Provider
        required : true
        schema: 
          type: string
          enum: ["A"]
          nullable: false
      - name: id
        in: path
        description: Tax Return ID
        required: true
        schema:
          type: string
          format: uuid
      responses:
        200:
          description: Annual tax return data response
          content:
            application/json:
              schema:
                type: object
              example:
                ESTADO DE RESULTADOS:
                  VENTAS Y/O SERVICIOS NACIONALES:
                    PARTES NO RELACIONADAS: 25447832
                    TOTAL: 25447832
                  VENTAS Y/O SERVICIOS EXTRANJEROS:
                    PARTES NO RELACIONADAS: 12340
                    TOTAL: 12340
                  DEVOLUCIONES, DESCUENTOS Y BONIFICACIONES SOBRE VENTAS NACIONALES:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  DEVOLUCIONES, DESCUENTOS Y BONIFICACIONES SOBRE VENTAS AL EXTRANJERO:
                    PARTES RELACIONADAS: 0
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INGRESOS NETOS:
                    PARTES RELACIONADAS: 0
                    PARTES NO RELACIONADAS: 17447933
                    TOTAL: 17447933
                  COMPRAS NETAS NACIONALES:
                    PARTES NO RELACIONADAS: 5100423
                    TOTAL: 5100423
                  COMPRAS NETAS DE IMPORTACIÓN:
                    PARTES NO RELACIONADAS: 1124038
                    TOTAL: 1124038
                  COSTO DE LAS MERCANCÍAS: 6024467
                  MANO DE OBRA:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  MAQUILAS:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  GASTOS INDIRECTOS DE FABRICACIÓN:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  COSTO DE VENTAS Y/O SERVICIOS:
                    PARTES RELACIONADAS: 6024467
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 6024467
                  UTILIDAD BRUTA: 9423466
                  PÉRDIDA BRUTA: 0
                  GASTOS DE OPERACIÓN:
                    PARTES NO RELACIONADAS: 8155730
                    TOTAL: 8155730
                  UTILIDAD DE OPERACIÓN: 267734
                  INTERESES DEVENGADOS A FAVOR NACIONALES:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INTERESES DEVENGADOS A FAVOR DEL EXTRANJERO:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INTERESES MORATORIOS A FAVOR NACIONALES:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INTERESES MORATORIOS A FAVOR DEL EXTRANJERO:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  GANANCIA CAMBIARIA:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INTERESES DEVENGADOS A CARGO NACIONALES:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INTERESES DEVENGADOS A CARGO DEL EXTRANJERO:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INTERESES MORATORIOS A CARGO NACIONALES:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  INTERESES MORATORIOS A CARGO DEL EXTRANJERO:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  PÉRDIDA CAMBIARIA:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  RESULTADO POR POSICIÓN MONETARIA FAVORABLE: {}
                  RESULTADO POR POSICIÓN MONETARIA DESFAVORABLE: {}
                  OTRAS OPERACIONES FINANCIERAS NACIONALES:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  OTRAS OPERACIONES FINANCIERAS EXTRANJERAS:
                    PARTES NO RELACIONADAS: 0
                    TOTAL: 0
                  OTRAS OPERACIONES FINANCIERAS: 0
                  RESULTADO INTEGRAL DE FINANCIAMIENTO: 0
                  OTROS GASTOS NACIONALES: 125381
                  OTROS GASTOS: 125381
                  OTROS PRODUCTOS NACIONALES: 0
                  OTROS PRODUCTOS EXTRANJEROS: 0
                  OTROS PRODUCTOS: 0
                  UTILIDAD ANTES DE IMPUESTOS: 82354
                  UTILIDAD NETA: 52355
                ESTADO DE POSICIÓN FINANCIERA (BALANCE):
                  ACTIVOS:
                    EFECTIVO EN CAJA Y DEPÓSITOS EN INSTITUCIONES DE CRÉDITO NACIONALES: 115202
                    CUENTAS Y DOCUMENTOS POR COBRAR NACIONALES:
                      PARTES NO RELACIONADAS: 230000
                      TOTAL: 230000
                    CUENTAS Y DOCUMENTOS POR COBRAR DEL EXTRANJERO:
                      PARTES NO RELACIONADAS: 0
                      TOTAL: 0
                    CONTRIBUCIONES A FAVOR: 43212
                    INVENTARIOS: 0
                    OTROS ACTIVOS CIRCULANTES: 5728
                    INVERSIONES EN ACCIONES DEL EXTRANJERO: 0
                    INVERSIONES EN ACCIONES (TOTAL): 0
                    SUMA ACTIVOS: 493142
                  PASIVOS:
                    CUENTAS Y DOCUMENTOS POR PAGAR NACIONALES:
                      PARTES NO RELACIONADAS: 976911
                      TOTAL: 976911
                    CUENTAS Y DOCUMENTOS POR PAGAR DEL EXTRANJERO:
                      PARTES NO RELACIONADAS: 0
                      TOTAL: 0
                    CONTRIBUCIONES POR PAGAR: 10474
                    ANTICIPOS DE CLIENTES:
                      PARTES NO RELACIONADAS: 0
                      TOTAL: 0
                    SUMA PASIVOS: 987385
                  CAPITAL CONTABLE:
                    CAPITAL SOCIAL PROVENIENTE DE APORTACIONES: 100000
                    UTILIDADES ACUMULADAS: 1399808
                    UTILIDAD DEL EJERCICIO: 62355
                    PÉRDIDAS ACUMULADAS: -2456702
                    INSUFICIENCIA EN LA ACTUALIZACIÓN DEL CAPITAL: 0
                    SUMA CAPITAL CONTABLE: -694233
                    SUMA PASIVO MÁS CAPITAL CONTABLE: 493132
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                errors:
                - code: "400"
                  message: Missign parameters {x-api-key}.
        401:
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseUnauthorized'
        404:
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      deprecated: false
  /taxpayers/{id}/tax-returns:
    get:
      tags:
      - TaxReturns
      summary: ListTaxpayerTaxReturn
      description: List all taxpayer tax returns
      operationId: ListTaxpayerTaxReturn
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
          nullable: false
      - name: x-request-id
        in: header
        description: idA value returned in POST /login
        required: true
        schema:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          nullable: false
      - name: x-data-provider
        in: header
        description: Id Data Provider
        required : true
        schema: 
          type: string
          enum: ["A"]
          nullable: false
      - name: id
        in: path
        description: RFC (Registro Federal de Contribuyentes)
        required: true
        schema:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
      - name: operationNumber
        in: query
        description: Filter by operation number (partial match)
        schema:
          type: number
          format: double
      - name: type
        in: query
        description: Filter by type (exact match)
        schema:
          type: string
          enum:
          - Complementaria
          - Complementaria Corrección Fiscal
          - Complementaria Dictamen
          - Normal
          - Normal por Corrección Fiscal
      - name: intervalUnit
        in: query
        description: Filter by interval unit (exact match)
        schema:
          type: string
          enum:
          - Anual
          - Mensual
          - RIF
      - name: complementary
        in: query
        description: Filter by interval unit (partial match)
        schema:
          type: string
          enum:
          - Declaración no Presentada
          - Dejar sin Efecto Declaración
          - Dejar sin Efecto Obligación
          - Esquema Anterior
          - Modificación de Declaración
          - Modificación de Obligaciones
          - Obligación no presentada
      - name: captureLine
        in: query
        description: Filter by payment code (partial match)
        schema:
          type: string
      - name: period
        in: query
        description: Filter by period (exact match)
        schema:
          type: string
      - name: presentedAt[before]
        in: query
        description: Filter by filing date (less than or equal `<=`)
        schema:
          type: string
          format: date-time
      - name: presentedAt[strictly_before]
        in: query
        description: Filter by filing date (less than `<`)
        schema:
          type: string
          format: date-time
      - name: presentedAt[after]
        in: query
        description: Filter by filing date (greater than or equal `>=`)
        schema:
          type: string
          format: date-time
      - name: presentedAt[strictly_after]
        in: query
        description: Filter by filing date (greater than `>`)
        schema:
          type: string
          format: date-time
      - name: fiscalYear
        in: query
        description: Filter by fiscal year (exact match)
        schema:
          type: string
      - name: order[period]
        in: query
        description: Order by period
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: order[presentedAt]
        in: query
        description: Order by filing date
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: page
        in: query
        description: The collection page number
        schema:
          type: integer
          format: int32
          default: 1
      - name: itemsPerPage
        in: query
        description: The number of items per page
        schema:
          maximum: 100
          exclusiveMaximum: false
          minimum: 1
          exclusiveMinimum: false
          type: integer
          format: int32
          default: 30
      responses:
        200:
          description: Taxpayer tax return collection response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseTaxpayerTaxReturnCollection'
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                errors:
                - code: "400"
                  message: Missign parameters {x-api-key}.
        401:
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseUnauthorized'
        404:
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      deprecated: false
  /taxpayers/{id}/tax-compliance-checks:
    get:
      tags:
      - TaxComplianceChecks
      summary: ListTaxpayerTaxComplianceCheck
      description: List all taxpayer tax compliance checks
      operationId: ListTaxpayerTaxComplianceCheck
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
          nullable: false
      - name: x-request-id
        in: header
        description: idA value returned in POST /login
        required: true
        schema:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          nullable: false
      - name: x-data-provider
        in: header
        description: Id Data Provider
        required : true
        schema: 
          type: string
          enum: ["A"]
          nullable: false
      - name: id
        in: path
        description: RFC (Registro Federal de Contribuyentes)
        required: true
        schema:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
      - name: internalIdentifier
        in: query
        schema:
          type: string
      - name: taxpayer.rfc
        in: query
        schema:
          maxLength: 13
          minLength: 12
          type: string
      - name: taxpayer.name
        in: query
        schema:
          maxLength: 254
          minLength: 1
          type: string
      - name: result
        in: query
        schema:
          type: string
          enum:
          - positive
          - negative
          - no_obligations
      - name: checkedAt[before]
        in: query
        description: Filter by check date (less than or equal `<=`)
        schema:
          type: string
      - name: checkedAt[strictly_before]
        in: query
        description: Filter by check date (less than `<`)
        schema:
          type: string
      - name: checkedAt[after]
        in: query
        description: Filter by check date (greater than or equal `>=`)
        schema:
          type: string
      - name: checkedAt[strictly_after]
        in: query
        description: Filter by check date (greater than `>`)
        schema:
          type: string
      - name: createdAt[before]
        in: query
        description: Filter by creation date (less than or equal `<=`)
        schema:
          type: string
      - name: createdAt[strictly_before]
        in: query
        description: Filter by creation date (less than `<`)
        schema:
          type: string
      - name: createdAt[after]
        in: query
        description: Filter by creation date (greater than or equal `>=`)
        schema:
          type: string
      - name: createdAt[strictly_after]
        in: query
        description: Filter by creation date (greater than `>`)
        schema:
          type: string
      - name: order[checkedAt]
        in: query
        description: Order by check date
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: order[createdAt]
        in: query
        description: Order by creation date
        schema:
          type: string
          enum:
          - asc
          - desc
      - name: page
        in: query
        description: The collection page number
        schema:
          type: integer
          format: int32
          default: 1
      - name: itemsPerPage
        in: query
        description: The number of items per page
        schema:
          maximum: 100
          exclusiveMaximum: false
          minimum: 1
          exclusiveMinimum: false
          type: integer
          format: int32
          default: 30
      responses:
        200:
          description: Taxpayer tax compliance check collection response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseTaxpayerTaxComplianceCheckCollection'
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                errors:
                - code: "400"
                  message: Missign parameters {x-api-key}.
        401:
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseUnauthorized'
        404:
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      deprecated: false
  /taxpayers/{id}/tax-status:
    get:
      tags:
      - TaxStatus
      summary: ListTaxpayerTaxStatus
      description: List all taxpayer´s tax status
      operationId: ListTaxpayerTaxStatus
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
          nullable: false
      - name: x-request-id
        in: header
        description: idA value returned in POST /login
        required: true
        schema:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          nullable: false
      - name: x-data-provider
        in: header
        description: Id Data Provider
        required : true
        schema: 
          type: string
          enum: ["A"]
          nullable: false
      - name: id
        in: path
        description: RFC (Registro Federal de Contribuyentes)
        required: true
        schema:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          nullable: false
      responses:
        200:
          description: Taxpayer tax status collection response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseTaxpayerTaxStatusCollection'
        401:
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseUnauthorized'
        404:
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      deprecated: false
  /rfc/validate/{id}:
    get:
      tags:
      - RFCValidator
      summary: GetRFCValidator
      description: RFC validator
      operationId: GetRFCValidator
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
          nullable: false
      - name: x-request-id
        in: header
        description: idA value returned in POST /login
        required: true
        schema:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          nullable: false
      - name: x-data-provider
        in: header
        description: Id Data Provider
        required : true
        schema: 
          type: string
          enum: ["A"]
          nullable: false
      - name: id
        in: path
        description: RFC (Registro Federal de Contribuyentes)
        required: true
        schema:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          nullable: false
      responses:
        200:
          description: RFC validator
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseRFCValidator'
      deprecated: false
  /scorepm/{id}:
    get:
      tags: 
        - Historical Score for PM
      summary: Historical Score for PM
      description: Get Historical Score for PM
      operationId: Historical Score for PM
      parameters:
      - name: x-api-key
        in: header
        description: ConsumerKey obtenido desde el portal de desarrolladores
        required: true
        schema:
          type: string
          nullable: false
      - name: x-request-id
        in: header
        description: ID value returned in POST /login
        required: true
        schema:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          nullable: false
      - name: x-data-provider
        in: header
        description: Id Data Provider
        required : true
        schema: 
          type: string
          enum: ["B"]
          nullable: false
      - name: id
        in: path
        description: RFC (Registro Federal de Contribuyentes)
        required: true
        schema:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
      responses:
        200:
          description: Historical finscore
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/historicalFinscoreResponse'
components:
  schemas:
    CredentialCiecInput:
      required:
      - password
      - rfc
      - type
      - email
      - requestId
      - dataProvider
      type: object
      properties:
        type:
          type: string
        rfc:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          description: Taxpayer ID (Registro Federal de Contribuyentes)
          example: PEIC211118IS0
        password:
          minLength: 8
          type: string
          description: CIEC's password
          example: secret123
        email:
          type: string
          description: personal corporate email
          pattern: '^([a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$'
          example: usuario@circulodecredito.com.mx
        requestId:
          type: string
          pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$'
          description: Optionad id to identify client request
          example: 14d8a4fd-89d2-460d-88ed-80b8a8747108
        dataProvider:
          type: string
          enum: ["A", "B"]
          example: A
      description: CIEC
    responseCredential:
      title: responseCredential
      type: object
      properties:
        '@context':
          type: string
          default: /contexts/Credential
        '@id':
          type: string
          description: Credential IRI reference
          readOnly: true
          example: /credentials/91106968-1abd-4d64-85c1-4e73d96fb997
        '@type':
          type: string
          readOnly: true
          default: Credential
        id:
          type: string
          format: uuid
          readOnly: true
          example: 91106968-1abd-4d64-85c1-4e73d96fb997
        type:
          $ref: '#/components/schemas/responseCredentialType'
        rfc:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          description: RFC (Registro Federal de Contribuyentes)
          example: PEIC211118IS0
        status:
          $ref: '#/components/schemas/responseCredentialStatus'
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        updatedAt:
          type: string
          description: Date and time the resource was last updated
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseCredentialType:
      title: CredentialType
      type: string
      example: ciec
      enum:
      - ciec
      - efirma
    responseCredentialStatus:
      title: CredentialStatus
      type: string
      description: The initial _status_ is always **pending**. After a few seconds,
        it changes to **valid** or **invalid** depending on SAT's response to our
        login attempt.
      example: pending
      enum:
      - pending
      - valid
      - invalid
      - deactivated
      - error
    responseCredential400:
      title: responseCredential400
      type: object
      properties:
        '@context':
          type: string
          default: /contexts/ConstraintViolationList
        '@type':
          type: string
          default: ConstraintViolationList
        hydra:title:
          type: string
          default: An error occurred
        hydra:description:
          type: string
          description: Concatenated violation messages
          example: 'exampleField: This value should not be blank.'
        violations:
          type: array
          items:
            $ref: '#/components/schemas/responseCredential400Violation'
    Error:
      type: object
      properties:
        code:
          type: string
          description: Error code.
          example: "400"
        message:
          maxLength: 120
          type: string
          description: Descriptive and human-readable error message.
          example: External data source not available.
      description: Error
    Errors:
      type: object
      properties:
        errors:
          type: array
          description: List of errors.
          items:
            $ref: '#/components/schemas/Error'
      description: A list of errors.
    responseCredential400Violation:
      title: responseCredential400Violation
      type: object
      properties:
        propertyPath:
          type: string
          description: Property access path
          example: exampleField
        message:
          type: string
          description: Validaton error message
          example: This value should not be blank.
    responseUnauthorized:
      title: responseUnauthorized
      type: object
      properties:
        message:
          type: string
    responseTaxPayerInvoice:
      title: responseTaxPayerInvoice
      type: object
      properties:
        '@context':
          type: string
          example: /contexts/Invoice
        '@id':
          type: string
          example: /taxpayers/PEIC211118IS0/invoices
        '@type':
          type: string
          default: hydra:Collection
        hydra:member:
          type: array
          items:
            $ref: '#/components/schemas/responseInvoice'
        hydra:totalItems:
          minimum: 0
          type: integer
          description: The total number of items found
          format: int32
          example: 1
    responseInvoice:
      title: responseInvoice
      type: object
      properties:
        '@id':
          type: string
          description: Invoice IRI reference
          readOnly: true
          example: /invoices/91106968-1abd-4d64-85c1-4e73d96fb997
        '@type':
          type: string
          readOnly: true
          default: Invoice
        id:
          type: string
          description: Invoice ID
          format: uuid
          readOnly: true
          example: 91106968-1abd-4d64-85c1-4e73d96fb997
        uuid:
          type: string
          description: Invoice UUID (Folio fiscal)
          format: uuid
          readOnly: true
          example: def404af-5eef-4112-aa99-d1ec8493b89a
        version:
          type: number
          description: CFDI version
          format: double
          example: 3.3
        reference:
          maxLength: 25
          type: string
          description: It is an open field for internal identification. Communly it
            is used to identify a branch
          example: Branch-A
        internalIdentifier:
          maxLength: 40
          type: string
          description: It is an open field for internal identification. Communly it
            is used to identify an invoice
          example: "00001"
        type:
          $ref: '#/components/schemas/responseInvoiceType'
        usage:
          type: string
          description: Invoice usage code from `c_UsoCFDI` catalog
          example: G03
        paymentType:
          $ref: '#/components/schemas/responseInvoicePaymentType'
        paymentMethod:
          type: string
          description: Payment method code from `c_FormaPago` catalog
          example: "04"
        placeOfIssue:
          type: string
          description: Postal code of the place of issue
          readOnly: true
          example: "01210"
        issuer:
          $ref: '#/components/schemas/responseInvoiceIssuer'
        isIssuer:
          type: boolean
          description: '`true` if the invoice issuer is the taxpayer from the link'
          readOnly: true
          example: true
        receiver:
          $ref: '#/components/schemas/responseInvoiceReceiver'
        isReceiver:
          type: boolean
          description: '`true` if the invoice receiver is the taxpayer from the link'
          readOnly: true
          example: false
        currency:
          maxLength: 3
          minLength: 3
          type: string
          description: ISO 4217 alphabetic currency code
          example: MXN
        discount:
          type: number
          description: Discount amount
          format: double
          example: 3324.0
        tax:
          type: number
          description: Tax amount
          format: double
          example: 5224.0
        subtotal:
          type: number
          description: Subtotal amount
          format: double
          example: 51349.8
        total:
          type: number
          description: Invoice total amount
          format: double
          example: 53249.8
        exchangeRate:
          type: number
          description: Set when *currency* is different than MXN (Mexican Peso).
          format: double
          example: 19.8
        paidAmount:
          type: number
          description: For a deferred invoice this field state the paid amount. (Applies
            only for "PPD" invoices).
          format: double
          example: 53249.8
        dueAmount:
          type: number
          description: For a deferred invoice this field state the due amount. (Applies
            only for "PPD" invoices).
          format: double
          example: 0.0
        lastPaymentDate:
          type: string
          description: This field is populated with the last related payment date
            (Applies only for "PPD" invoices).
          format: date-time
        fullyPaidAt:
          type: string
          description: This field is populated when the total debt is paid. (Applies
            only for "PPD" invoices).
          format: date-time
        paymentTermsRaw:
          type: string
          description: The invoice payment terms text exactly as it comes from the
            invoice, i.e. immediate, 30 days, cash, credit card, etc
          example: Tarjeta de crédito
        status:
          $ref: '#/components/schemas/responseInvoiceStatus'
        pac:
          maxLength: 12
          minLength: 12
          type: string
          description: Certification provider tax ID (Proveedor Autorizado de Certificación)
          example: SAT970701NN3
        issuedAt:
          type: string
          description: Invoice issue date
          format: date-time
          example: 2019-01-03T21:10:40Z
        certifiedAt:
          type: string
          description: Invoice certification date
          format: date-time
          example: 2019-01-03T21:10:41Z
        cancellationStatus:
          $ref: '#/components/schemas/responseInvoiceCancellationStatus'
        cancellationProcessStatus:
          $ref: '#/components/schemas/responseInvoiceCancellationStatusProcess'
        canceledAt:
          type: string
          description: Set when *status* is `CANCELADO`
          format: date-time
        items:
          type: array
          items:
            $ref: '#/components/schemas/responseInvoiceItem'
        relations:
          type: array
          items:
            $ref: '#/components/schemas/responseInvoiceRelation'
        appliedCredits:
          type: array
          items:
            $ref: '#/components/schemas/responseInvoiceCreditNote'
        issuedCredits:
          type: array
          items:
            $ref: '#/components/schemas/responseInvoiceCreditNote'
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        updatedAt:
          type: string
          description: Date and time the resource was last updated
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseHydraView:
      title: responseHydraView
      type: object
      properties:
        '@id':
          type: string
          description: Current page IRI reference
        '@type':
          type: string
          default: hydra:PartialCollectionView
        hydra:first:
          type: string
          description: First page IRI reference. This property is omitted if there
            is no pagination.
        hydra:next:
          type: string
          description: Next page IRI reference. This property is omitted if there
            is no pagination.
        hydra:last:
          type: string
          description: Last page IRI reference. This property is omitted if there
            is no pagination.
      description: Pagination information
    responseHydraSearch:
      title: responseHydraSearch
      type: object
      properties:
        '@type':
          type: string
        hydra:template:
          type: string
        hydra:variableRepresentation:
          type: string
        hydra:mapping:
          type: array
          items:
            $ref: '#/components/schemas/responseHydraMapping'
    responseHydraMapping:
      title: responseHydraMapping
      type: object
      properties:
        '@type':
          type: string
        variable:
          type: string
        property:
          type: string
        required:
          type: boolean
    responseInvoicePaymentType:
      title: responseInvoicePaymentType
      type: string
      description: Payment type code from `c_MetodoPago` catalog
      example: PUE
      externalDocs:
        url: https://sat.ws/docs/catalogs#c_metodopago
      enum:
      - PUE
      - PPD
    responseInvoiceType:
      title: responseInvoiceType
      type: string
      description: Invoice type code from `c_TipoDeComprobante` catalog
      externalDocs:
        url: https://sat.ws/docs/catalogs/#c_tipodecomprobante
      enum:
      - I
      - E
      - P
      - N
      - T
    responseInvoiceIssuer:
      title: responseInvoiceIssuer
      type: object
      properties:
        rfc:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          description: RFC (Registro Federal de Contribuyentes)
          example: PEIC211118IS0
        name:
          maxLength: 254
          minLength: 1
          type: string
          description: Taxpayer name
          example: Pedro Infante Cruz
        taxRegime:
          type: number
          description: Tax regime code from `c_RegimenFiscal` catalog
          format: double
          example: 601.0
        blacklistStatus:
          $ref: '#/components/schemas/responseTaxpayerBlacklistStatus'
      example:
        rfc: AOM920820BEA
        name: APPLE OPERATIONS MEXICO S.A. DE C.V.
        taxRegime: 601
    responseInvoiceReceiver:
      title: responseInvoiceReceiver
      type: object
      properties:
        rfc:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          description: RFC (Registro Federal de Contribuyentes)
          example: PEIC211118IS0
        name:
          maxLength: 254
          minLength: 1
          type: string
          description: Taxpayer name
          example: Pedro Infante Cruz
        blacklistStatus:
          $ref: '#/components/schemas/responseTaxpayerBlacklistStatus'
    responseTaxpayerBlacklistStatus:
      title: responseTaxpayerBlacklistStatus
      type: string
      description: Show the blacklist status if a taxpayer is found in the list 69-B
        from SAT
      example: presumed
      enum:
      - presumed
      - dismissed
      - definitive
      - favorable
    responseInvoiceCancellationStatusProcess:
      title: responseInvoiceCancellationStatusProcess
      type: string
      description: Set when the cancellation process starts
      example: En proceso
      enum:
      - En proceso
      - Solicitud rechazada
      - Cancelado sin aceptación
      - Cancelado con aceptación
      - Plazo vencido
    responseInvoiceCancellationStatus:
      title: responseInvoiceCancellationStatus
      type: string
      description: Whether or not the invoice can be canceled
      example: Cancelable con aceptación
      enum:
      - Cancelable sin aceptación
      - Cancelable con aceptación
      - No cancelable
    responseInvoiceStatus:
      title: responseInvoiceStatus
      type: string
      description: Whether the invoice is active or canceled
      example: VIGENTE
      enum:
      - VIGENTE
      - CANCELADO
    responseInvoiceItem:
      title: responseInvoiceItem
      type: object
      properties:
        identificationNumber:
          type: string
          example: Z0V0
        productIdentification:
          type: string
          example: "43211503"
        description:
          type: string
          example: MBP 15.4 SPACE GRAY
        unitAmount:
          type: number
          format: double
          example: 45905.0
        unitCode:
          type: string
          example: H87
        quantity:
          type: number
          format: double
          example: 1.0
        discountAmount:
          type: number
          format: double
          example: 0.0
        taxType:
          type: string
          example: "002"
        taxRate:
          type: number
          format: double
          example: 0.16
        taxAmount:
          type: number
          format: double
          example: 7344.8
        totalAmount:
          type: number
          format: double
          example: 45905.0
    responseInvoiceRelation:
      title: responseInvoiceRelation
      type: object
      properties:
        '@id':
          type: string
          description: Invoice relation IRI reference
          readOnly: true
          example: /invoices/relations/93a197e7-6baa-5dc5-bf8d-fb1645a770c1
        '@type':
          type: string
          readOnly: true
          default: InvoiceRelation
        id:
          type: string
          description: Invoice relation ID
          format: uuid
          readOnly: true
          example: 91106968-1abd-4d64-85c1-4e73d96fb997
        type:
          type: number
          description: Invoice relation type code from `c_TipoRelacion` catalog
          format: double
          example: 7.0
        invoice:
          type: string
          description: Invoice IRI reference
          example: /invoices/92106967-2abd-5d64-95c2-4e73d96fb998
        relatedInvoice:
          type: string
          description: Invoice IRI reference
          example: /invoices/92106967-2abd-5d64-95c2-4e73d96fb998
        relatedInvoiceUuid:
          type: string
          description: The related Invoice UUID (Folio fiscal)
          format: uuid
          readOnly: true
          example: def404af-5eef-4112-aa99-d1ec8493b89a
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        updatedAt:
          type: string
          description: Date and time the resource was last updated
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseInvoiceCreditNote:
      title: responseInvoiceCreditNote
      type: object
      properties:
        '@id':
          type: string
          description: Credit Note IRI reference
          readOnly: true
          example: /invoices/credit-note/91106968-1abd-4d64-85c1-4e73d96fb997
        '@type':
          type: string
          readOnly: true
          default: InvoicePayment
        appliedInvoice:
          type: string
          description: Invoice IRI reference
          readOnly: true
          example: /invoices/91106968-1abd-4d64-85c1-4e73d96fb997
        issuedInvoice:
          type: string
          description: Invoice IRI reference
          readOnly: true
          example: /invoices/91106968-1abd-4d64-85c1-4e73d96fb997
        issuedAt:
          type: string
          description: Set when the payment invoice is canceled
          format: date-time
        proportionalRate:
          type: number
          description: The proportional credit rate applied to the target invoice.
          format: double
          example: 19.8
        amount:
          type: number
          description: The total amount of credits applied to the target invoice.
          format: double
          example: 19.8
        issuedInvoiceTotal:
          type: number
          description: The total of the issued invoice that was taken into account
            to calculate the credit.
          format: double
          example: 19.8
        canceledAt:
          type: string
          description: Set when the payment invoice is canceled
          format: date-time
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        updatedAt:
          type: string
          description: Date and time the resource was last updated
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseNotFound:
      type: object
      properties:
        message:
          type: string
    responseTaxpayerTaxReturnCollection:
      title: TaxpayerTaxReturnCollection
      type: object
      properties:
        '@context':
          type: string
        '@id':
          type: string
          example: /taxpayers/PEIC211118IS0/tax-returns
        '@type':
          type: string
          default: hydra:Collection
        hydra:member:
          type: array
          items:
            $ref: '#/components/schemas/responseTaxReturn'
        hydra:totalItems:
          minimum: 0
          type: integer
          description: The total number of items found
          format: int32
          example: 1
    responseTaxReturn:
      title: responseTaxReturn
      type: object
      properties:
        '@id':
          type: string
          description: Tax return IRI reference
          readOnly: true
          example: /tax-returns/91106968-1abd-4d64-85c1-4e73d96fb997
        '@type':
          type: string
          readOnly: true
          default: TaxReturn
        id:
          type: string
          description: Tax Return ID
          format: uuid
          readOnly: true
          example: 91106968-1abd-4d64-85c1-4e73d96fb997
        taxpayer:
          $ref: '#/components/schemas/responseTaxpayer'
        operationNumber:
          type: number
          description: Tax return operation code generated by SAT (Número de operación)
          format: double
          readOnly: true
          example: 200100172932
        intervalUnit:
          $ref: '#/components/schemas/responseTaxReturnIntervalUnit'
        period:
          type: string
          description: Fiscal period. For an annual tax return, it is a year and for
            monthly tax return it is a month
          example: Diciembre
        fiscalYear:
          type: string
          description: Fiscal year
          readOnly: true
          example: "2019"
        type:
          $ref: '#/components/schemas/responseTaxReturnType'
        complementary:
          $ref: '#/components/schemas/responseTaxReturnComplementary'
        presentedAt:
          type: string
          description: Tax return filing date
          format: date-time
        captureLine:
          type: string
          description: Set when the an amount should be paid back to SAT
          example: 042007HZ795527888246
        payment:
          $ref: '#/components/schemas/responseTaxReturnPayment'
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        updatedAt:
          type: string
          description: Date and time the resource was last updated
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseTaxpayer:
      title: responseTaxpayer
      type: object
      properties:
        '@id':
          type: string
          description: Taxpayer IRI reference
          readOnly: true
          example: /taxpayers/PEIC211118IS0
        '@type':
          type: string
          readOnly: true
          default: Taxpayer
        id:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          description: RFC (Registro Federal de Contribuyentes)
          example: PEIC211118IS0
        personType:
          $ref: '#/components/schemas/responseTaxpayerPersonType'
        registrationDate:
          type: string
          format: date
        name:
          maxLength: 254
          minLength: 1
          type: string
          description: Taxpayer name
          example: Pedro Infante Cruz
    responseTaxpayerPersonType:
      title: responseTaxpayerPersonType
      type: string
      example: physical
      enum:
      - physical
      - legal
    responseTaxReturnIntervalUnit:
      title: responseTaxReturnIntervalUnit
      type: string
      example: Mensual
      enum:
      - Anual
      - Mensual
      - RIF
    responseTaxReturnType:
      title: responseTaxReturnType
      type: string
      example: Complementaria
      enum:
      - Complementaria
      - Complementaria Corrección Fiscal
      - Complementaria Dictamen
      - Normal
      - Normal por Corrección Fiscal
    responseTaxReturnComplementary:
      title: responseTaxReturnComplementary
      type: string
      description: Set when *type* is `complementaria*`
      example: Modificación de Obligaciones
      enum:
      - Declaración no Presentada
      - Dejar sin Efecto Declaración
      - Dejar sin Efecto Obligación
      - Esquema Anterior
      - Modificación de Declaración
      - Modificación de Obligaciones
      - Obligación no presentada
    responseFile:
      title: responseFile
      type: object
      properties:
        '@id':
          type: string
          description: File IRI reference
          readOnly: true
          example: /files/91106968-1abd-4d64-85c1-4e73d96fb997
        '@type':
          type: string
          readOnly: true
          default: File
        id:
          type: string
          format: uuid
          example: 91106968-1abd-4d64-85c1-4e73d96fb997
        type:
          type: string
        resource:
          type: string
        mimeType:
          type: string
        extension:
          type: string
        size:
          type: integer
          format: int32
          example: 40544
        filename:
          type: string
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        updatedAt:
          type: string
          description: Date and time the resource was last updated
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseTaxReturnPayment:
      title: responseTaxReturnPayment
      type: object
      properties:
        dueAmount:
          type: number
          format: double
          example: 53249.8
        dueDate:
          type: string
          format: date-time
          example: 2019-01-03T21:10:40Z
        code:
          type: string
          description: Payment code
          example: "0777555544443332222"
        bank:
          type: string
          description: Payer bank
          example: BBVA Bancomer, S.A.
        paidAmount:
          type: number
          description: Tax return paid amount
          format: double
        date:
          type: string
          description: Payment date
          format: date-time
        operationNumber:
          type: string
          example: "123456"
      description: Payment
    responseTaxpayerTaxComplianceCheckCollection:
      title: responseTaxpayerTaxComplianceCheckCollection
      type: object
      properties:
        '@context':
          type: string
        '@id':
          type: string
          example: /taxpayers/PEIC211118IS0/tax-compliance-checks
        '@type':
          type: string
          default: hydra:Collection
        hydra:member:
          type: array
          items:
            $ref: '#/components/schemas/responseTaxComplianceCheck'
        hydra:totalItems:
          minimum: 0
          type: integer
          description: The total number of items found
          format: int32
          example: 1
    responseTaxComplianceCheck:
      title: responseTaxComplianceCheck
      type: object
      properties:
        '@id':
          type: string
          description: Tax compliance check IRI reference
          readOnly: true
          example: /tax-compliance-checks/91106968-1abd-4d64-85c1-4e73d96fb997
        '@type':
          type: string
          readOnly: true
          default: TaxComplianceCheck
        id:
          type: string
          example: 91106968-1abd-4d64-85c1-4e73d96fb997
        internalIdentifier:
          type: string
          description: The internal identifier (folio) generated by the SAT
          example: 20NE1234567
        taxpayer:
          $ref: '#/components/schemas/responseTaxComplianceTaxpayer'
        result:
          $ref: '#/components/schemas/responseTaxComplianceCheckResult'
        checkedAt:
          type: string
          description: Check date
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseTaxComplianceTaxpayer:
      title: responseTaxComplianceTaxpayer
      type: object
      properties:
        rfc:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          description: RFC (Registro Federal de Contribuyentes)
          example: PEIC211118IS0
        name:
          maxLength: 254
          minLength: 1
          type: string
          description: Taxpayer name
          example: Pedro Infante Cruz
    responseTaxComplianceCheckResult:
      title: responseTaxComplianceCheckResult
      type: string
      example: no_obligations
      enum:
      - positive
      - negative
      - no_obligations
    responseTaxpayerTaxStatusCollection:
      title: responseTaxpayerTaxStatusCollection
      type: object
      properties:
        '@context':
          type: string
        '@id':
          type: string
          example: /taxpayers/PEIC211118IS0/tax-status
        '@type':
          type: string
          default: hydra:Collection
        hydra:member:
          type: array
          items:
            $ref: '#/components/schemas/responseTaxStatus'
        hydra:totalItems:
          minimum: 0
          type: integer
          description: The total number of items found
          format: int32
          example: 1
    responseTaxStatus:
      title: responseTaxStatus
      type: object
      properties:
        '@id':
          type: string
          description: Tax status IRI reference
          readOnly: true
          example: /tax-status/91106968-1abd-4d64-85c1-4e73d96fb997
        '@type':
          type: string
          readOnly: true
          default: TaxStatus
        id:
          type: string
          example: 91106968-1abd-4d64-85c1-4e73d96fb997
        rfc:
          maxLength: 13
          minLength: 12
          type: string
          pattern: '^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$'
          description: RFC (Registro Federal de Contribuyentes)
          example: PEIC211118IS0
        cif:
          type: string
          example: "20060152922"
        person:
          $ref: '#/components/schemas/responseTaxStatusPerson'
        company:
          $ref: '#/components/schemas/responseTaxStatusCompany'
        email:
          type: string
          example: my-email@test.com
        phone:
          maxLength: 10
          type: string
          example: "5512345678"
        address:
          $ref: '#/components/schemas/responseTaxStatusAddress'
        economicActivities:
          type: array
          items:
            $ref: '#/components/schemas/responseTaxStatusEconomicActivity'
        taxRegimes:
          type: array
          items:
            $ref: '#/components/schemas/responseTaxStatusTaxRegime'
        obligations:
          type: array
          items:
            $ref: '#/components/schemas/responseTaxStatusObligation'
        startedOperationsAt:
          type: string
          format: date-time
        status:
          type: string
          example: Activo
        statusUpdatedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          description: Date and time the resource was created
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
        updatedAt:
          type: string
          description: Date and time the resource was last updated
          readOnly: true
          example: 2020-01-01T12:15:00.000Z
    responseTaxStatusPerson:
      title: responseTaxStatusPerson
      type: object
      properties:
        fullName:
          type: string
          example: Pedro Infante Cruz
        firstName:
          type: string
          example: Pedro
        middleName:
          type: string
          example: Infante
        lastName:
          type: string
          example: Cruz
        curp:
          type: string
          example: PEIC90110UEYBVT85
      description: Person information. Null when the taxpayer is not a physical person.
    responseTaxStatusCompany:
      title: responseTaxStatusCompany
      type: object
      properties:
        legalName:
          type: string
          example: APPLE OPERATIONS MEXICO
        tradeName:
          type: string
          example: APPLE OPERATIONS MEXICO S.A. DE C.V.
        entityType:
          type: string
          example: SOCIEDAD ANONIMA DE CAPITAL VARIABLE
      description: Company information. Null when the taxpayer is not a legal person.
    responseTaxStatusAddress:
      title: responseTaxStatusAddress
      type: object
      properties:
        streetReferences:
          minItems: 1
          type: array
          items:
            type: string
        streetNumber:
          type: string
          example: "8124"
        buildingNumber:
          type: string
          example: "496"
        locality:
          type: string
          example: TUXTLA GUTIERREZ
        municipality:
          type: string
          example: TUXTLA GUTIERREZ
        postalCode:
          type: string
          example: "29000"
        state:
          type: string
          example: CHIAPAS
        streetName:
          type: string
          example: Plaza Jorge Luis
        streetType:
          type: string
          example: Calle
        neighborhood:
          type: string
          example: Paseo Ricardo
        statusRaw:
          type: string
          example: LOCALIZADO - Domicilio Localizado
    responseTaxStatusEconomicActivity:
      title: responseTaxStatusEconomicActivity
      type: object
      properties:
        name:
          type: string
          example: Asalariado
        order:
          type: string
          example: "1"
        percentage:
          type: string
          example: "100"
        endDate:
          type: string
          format: date
        startDate:
          type: string
          format: date
    responseTaxStatusTaxRegime:
      title: responseTaxStatusTaxRegime
      type: object
      properties:
        name:
          type: string
          example: Régimen de Sueldos y Salarios e Ingresos Asimilados a Salarios
        endDate:
          type: string
          format: date
        startDate:
          type: string
          format: date
    responseTaxStatusObligation:
      title: responseTaxStatusObligation
      type: object
      properties:
        description:
          type: string
          example: Pago definitivo mensual de IVA.
        dueDate:
          type: string
          example: A más tardar el día 17 del mes inmediato posterior al periodo que
            corresponda.
        endDate:
          type: string
          format: date
        startDate:
          type: string
          format: date
    responseRFCValidator:
      title: responseRFCValidator
      type: object
      properties:
        valid:
          type: boolean
          description: It is `true` if the format is correct
          example: true
        active:
          type: boolean
          description: Due to the removal of the service used to determine the active
            status of an RFC, the `active` field will always return `null`
        type:
          $ref: '#/components/schemas/responseRFCType'
        createdAt:
          type: string
    responseRFCType:
      title: responseRFCType
      type: string
      description: Taxpayer type
      example: physical
      enum:
      - physical
      - legal
    historicalFinscoreResponse:
      title: historicalFinscoreResponse
      type: object
      properties:
        applicantId: 
          type: string
          example: 1105600364
        refApplicantId: 
          type: string
          example: ''
          nullable: true
        HistoricalFinscores: 
          type: array
          items: 
            type: object
            properties: 
              Year: 
                type: integer
                format: int32
                example: 2023
              Month: 
                type: integer
                format: int32
                example: 3
              FinScore: 
                type: integer
                format: int32
                example: 595
          example: [
            {
            "Year": 2023,
            "Month": 3,
            "FinScore": 595.00
            },
            {
                "Year": 2023,
                "Month": 2,
                "FinScore": 610.00
            },
            {
                "Year": 2023,
                "Month": 1,
                "FinScore": 613.00
            },
            {
                "Year": 2022,
                "Month": 12,
                "FinScore": 581.00
            }
          ]
        Success: 
          type: boolean
        message: 
          type: string
          example: ''
          nullable: true

