{
  "openapi": "3.0.4",
  "info": {
    "title": "G-eFac Tenant API",
    "description": "Tenant-facing API for e-CF emission and consulta. Tenant identity comes from the access token\u0027s \u0060tenant\u0060 claim, never from the URL. Errors use RFC 7807 (\u0060application/problem\u002Bjson\u0060).\n\n**\u0060/v1\u0060 is PROVISIONAL \u2014 not yet frozen.** The compatibility promise, freeze trigger and deprecation timeline are in docs/API-VERSIONING-POLICY.md.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.g-efac.com/",
      "description": "Production (placeholder \u2014 confirm before the freeze trigger)"
    }
  ],
  "paths": {
    "/v1/events": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "List events for this tenant since a cursor.",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter to these event types. Repeat the parameter for more than one. An unknown value is a 400; a known one this tenant has no events of is an empty page.",
            "schema": {
              "type": "array",
              "items": {
                "enum": [
                  "invoice.accepted",
                  "invoice.rejected",
                  "invoice.received",
                  "commercial_approval.received",
                  "contingency.activated",
                  "sequence.low",
                  "certificate.expiring"
                ],
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventFeedDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "Gone",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Register a callback endpoint. The signing secret is returned ONCE.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreatedDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "List this tenant\u0027s callback endpoints for the token\u0027s environment.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookDto"
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Read one callback endpoint.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Update a callback endpoint\u0027s URL, subscriptions, or enabled state.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Delete a callback endpoint.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "List an endpoint\u0027s recent delivery attempts. Observability only \u2014 no payload body.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookDeliveryDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Issue a new signing secret; the previous one stays valid for the grace window.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sequences": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Authorize an e-NCF sequence range",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SequenceConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SequencesDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Inspect authorized e-NCF ranges for a tipo",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SequencesDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sequences/all": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "List every authorized e-NCF range set for this tenant",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SequenceListDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/directory-registration": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "This tenant\u0027s own published directory descriptor",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantDirectory"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/certificate": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Read this tenant\u0027s current signing certificate summary",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertificateSummaryDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "501": {
            "description": "This deployment cannot read certificate metadata \u2014 no certificate reader is configured on this host. This is distinct from 404: the caller MUST NOT treat it as \u0022no certificate on file\u0022; it means the host has no way to know."
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/directory/{rnc}": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Look up a counterparty in the DGII directory",
        "parameters": [
          {
            "name": "rnc",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryLookupDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/void-requests": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Anular a range of e-NCFs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoidResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/commercial-approvals": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Send a commercial approval (or rejection) response for a received e-CF",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommercialApprovalDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommercialApprovalResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Emit an e-CF",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional client-supplied key enabling safe retries. Resending the same key with an identical request body replays the original response verbatim, with \u0060Idempotent-Replayed: true\u0060, instead of re-emitting the e-CF. A blank key or one longer than 255 characters returns 400; reusing the key with a different request body, or while an emission under that key is still in progress, returns 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceSummaryDto"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "headers": {
              "Location": {
                "description": "The URL of what this request produced: \u0060/v1/held-invoices/{id}\u0060 for a hold; \u0060/v1/invoices/{encf}\u0060 for an e-CF that is queued rather than terminal.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and set to \u0060true\u0060 only when this response replays a prior request that used the same \u0060Idempotency-Key\u0060.",
                "schema": {
                  "type": "boolean"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceSummaryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "This tenant\u0027s queued invoices",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuedInvoicesPageDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/held-invoices": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Hold a tipo-32 invoice: sign it provisionally without consuming an e-NCF",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional client-supplied key enabling safe retries. Resending the same key with an identical request body replays the original response verbatim, with \u0060Idempotent-Replayed: true\u0060, instead of re-emitting the e-CF. A blank key or one longer than 255 characters returns 400; reusing the key with a different request body, or while an emission under that key is still in progress, returns 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "The URL of what this request produced: \u0060/v1/held-invoices/{id}\u0060 for a hold; \u0060/v1/invoices/{encf}\u0060 for an e-CF that is queued rather than terminal.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and set to \u0060true\u0060 only when this response replays a prior request that used the same \u0060Idempotency-Key\u0060.",
                "schema": {
                  "type": "boolean"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldInvoiceDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "List held invoices, oldest first",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldInvoicesPageDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/held-invoices/{id}": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "One held invoice: status, provisional fields, the stored request, and the e-NCF once emitted",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldInvoiceDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Abandon a held invoice. Idempotent; refused once emitted",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/held-invoices/{id}/qr": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Provisional QR of a held invoice \u2014 not verifiable at DGII, superseded on release",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldInvoiceQrDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "Gone",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/held-invoices/{id}/emit": {
      "post": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Release a held invoice: allocate its e-NCF and emit it exactly as POST /v1/invoices would",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional client-supplied key enabling safe retries. Resending the same key with an identical request body replays the original response verbatim, with \u0060Idempotent-Replayed: true\u0060, instead of re-emitting the e-CF. A blank key or one longer than 255 characters returns 400; reusing the key with a different request body, or while an emission under that key is still in progress, returns 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldInvoiceEmitRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "Location": {
                "description": "The URL of what this request produced: \u0060/v1/held-invoices/{id}\u0060 for a hold; \u0060/v1/invoices/{encf}\u0060 for an e-CF that is queued rather than terminal.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and set to \u0060true\u0060 only when this response replays a prior request that used the same \u0060Idempotency-Key\u0060.",
                "schema": {
                  "type": "boolean"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceSummaryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "410": {
            "description": "Gone",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices/{encf}": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Status of an issued e-CF, local and at DGII",
        "parameters": [
          {
            "name": "encf",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedConsultaDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices/{encf}/qr": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "QR / Representaci\u00F3n Impresa ingredients for an already-emitted e-CF",
        "parameters": [
          {
            "name": "encf",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceQrDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issued-invoices": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "List this tenant\u0027s issued e-CF (history, paged, searchable)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tipo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "estado",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedInvoicesPageDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/archive/years": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "The 10-year fiscal-archive window with per-year totals",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ArchiveYearDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/archive/{year}": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Per-month document counts for an archive year (future months null)",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ArchiveMonthDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/archive/{year}/{month}": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Issued documents archived in a given year/month",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IssuedInvoiceDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/received-documents": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "Integrity check of a received e-CF",
        "parameters": [
          {
            "name": "sellerRnc",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "encf",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceivedConsultaDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/received-invoices": {
      "get": {
        "tags": [
          "Efac.Api"
        ],
        "summary": "List this tenant\u0027s received e-CF",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReceivedInvoiceDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem\u002Bjson": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AdjustmentDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "tax": {
            "$ref": "#/components/schemas/TaxTreatment"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ArchiveMonthDto": {
        "type": "object",
        "properties": {
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "count": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ArchiveYearDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "retentionExpiry": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "BuyerDto": {
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "foreignId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CertificateSummaryDto": {
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "thumbprint": {
            "type": "string",
            "nullable": true
          },
          "notAfter": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "CommercialApprovalCopyDto": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "boolean"
          },
          "motivo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CommercialApprovalDto": {
        "type": "object",
        "properties": {
          "sellerRnc": {
            "type": "string",
            "nullable": true
          },
          "encf": {
            "type": "string",
            "nullable": true
          },
          "approve": {
            "type": "boolean"
          },
          "rejectionReason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CommercialApprovalResultDto": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "boolean"
          },
          "accepted": {
            "type": "boolean"
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "codigo": {
            "type": "string",
            "nullable": true
          },
          "mensajes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "copiaDgii": {
            "$ref": "#/components/schemas/CommercialApprovalCopyDto"
          }
        },
        "additionalProperties": false
      },
      "DgiiSnapshotDto": {
        "type": "object",
        "properties": {
          "disponible": {
            "type": "boolean"
          },
          "motivo": {
            "type": "string",
            "nullable": true
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "codigo": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "montoTotal": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totalITBIS": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "fechaEmision": {
            "type": "string",
            "nullable": true
          },
          "fechaFirma": {
            "type": "string",
            "nullable": true
          },
          "rncComprador": {
            "type": "string",
            "nullable": true
          },
          "codigoSeguridad": {
            "type": "string",
            "nullable": true
          },
          "idExtranjero": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DirectoryLookupDto": {
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "found": {
            "type": "boolean"
          },
          "nombreComercial": {
            "type": "string",
            "nullable": true
          },
          "urlRecepcion": {
            "type": "string",
            "nullable": true
          },
          "urlAceptacion": {
            "type": "string",
            "nullable": true
          },
          "urlOpcional": {
            "type": "string",
            "nullable": true
          },
          "ambiente": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EventEnvelopeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "enum": [
              "invoice.accepted",
              "invoice.rejected",
              "invoice.received",
              "commercial_approval.received",
              "contingency.activated",
              "sequence.low",
              "certificate.expiring"
            ],
            "type": "string",
            "description": "The event\u0027s wire name. Never the C# member name \u2014 these seven strings are the vocabulary.",
            "nullable": true
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "environment": {
            "type": "string",
            "nullable": true
          },
          "data": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EventFeedDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventEnvelopeDto"
            },
            "nullable": true
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HeldInvoiceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "encf": {
            "type": "string",
            "nullable": true
          },
          "securityCode": {
            "type": "string",
            "nullable": true
          },
          "qrUrl": {
            "type": "string",
            "nullable": true
          },
          "qrImage": {
            "type": "string",
            "nullable": true
          },
          "montoTotal": {
            "type": "number",
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "emittedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "emittedEncf": {
            "type": "string",
            "nullable": true
          },
          "abandonedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "request": {
            "$ref": "#/components/schemas/InvoiceRequest"
          }
        },
        "additionalProperties": false
      },
      "HeldInvoiceEmitRequest": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HeldInvoiceQrDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "rncEmisor": {
            "type": "string",
            "nullable": true
          },
          "rncComprador": {
            "type": "string",
            "nullable": true
          },
          "fechaEmision": {
            "type": "string",
            "nullable": true
          },
          "fechaFirma": {
            "type": "string",
            "nullable": true
          },
          "montoTotal": {
            "type": "number",
            "format": "double"
          },
          "codigoSeguridad": {
            "type": "string",
            "nullable": true
          },
          "provisional": {
            "type": "boolean"
          },
          "qrUrl": {
            "type": "string",
            "nullable": true
          },
          "qrImage": {
            "type": "string",
            "nullable": true
          },
          "qrImageBmp": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HeldInvoiceSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "montoTotal": {
            "type": "number",
            "format": "double"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "emittedEncf": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HeldInvoicesPageDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeldInvoiceSummaryDto"
            },
            "nullable": true
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "InvoiceItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "isService": {
            "type": "boolean"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "tax": {
            "$ref": "#/components/schemas/TaxTreatment"
          },
          "amount": {
            "type": "number",
            "description": "MontoItem. Optional \u2014 always derived by the server as quantity \u00D7 unitPrice \u2212 discountAmount \u002B surchargeAmount. A supplied value must equal the derived one exactly or the request is refused with 400; it is never silently replaced. Integrators that display their own totals should keep sending it: that turns any rounding disagreement into a 400 during integration instead of a quiet difference between their screen and the e-CF.",
            "format": "double",
            "nullable": true
          },
          "withholding": {
            "$ref": "#/components/schemas/WithholdingDto"
          },
          "propinaLegal": {
            "type": "boolean"
          },
          "discountAmount": {
            "type": "number",
            "description": "DescuentoMonto, pesos, \u003E= 0, default 0 (a zero writes no element). Included in the amount derivation above. Refused on tipos 43 and 47, whose schemas have no such element.",
            "format": "double"
          },
          "surchargeAmount": {
            "type": "number",
            "description": "RecargoMonto, pesos, \u003E= 0, default 0 (a zero writes no element). Included in the amount derivation above. Refused on tipos 43 and 47, whose schemas have no such element.",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "InvoiceQrDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "rncEmisor": {
            "type": "string",
            "nullable": true
          },
          "rncComprador": {
            "type": "string",
            "nullable": true
          },
          "fechaEmision": {
            "type": "string",
            "nullable": true
          },
          "fechaFirma": {
            "type": "string",
            "nullable": true
          },
          "montoTotal": {
            "type": "number",
            "format": "double"
          },
          "codigoSeguridad": {
            "type": "string",
            "nullable": true
          },
          "emittedInContingency": {
            "type": "boolean"
          },
          "qrUrl": {
            "type": "string",
            "nullable": true
          },
          "qrImage": {
            "type": "string",
            "nullable": true
          },
          "qrImageBmp": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InvoiceRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "seller": {
            "$ref": "#/components/schemas/SellerDto"
          },
          "buyer": {
            "$ref": "#/components/schemas/BuyerDto"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceItemDto"
            },
            "nullable": true
          },
          "payment": {
            "$ref": "#/components/schemas/PaymentDto"
          },
          "issueDate": {
            "type": "string",
            "nullable": true
          },
          "sequenceExpiry": {
            "type": "string",
            "nullable": true
          },
          "modifies": {
            "$ref": "#/components/schemas/ModifiedDocumentDto"
          },
          "encf": {
            "type": "string",
            "nullable": true
          },
          "adjustments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdjustmentDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InvoiceSummaryDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "trackId": {
            "type": "string",
            "nullable": true
          },
          "securityCode": {
            "type": "string",
            "nullable": true
          },
          "qrUrl": {
            "type": "string",
            "nullable": true
          },
          "qrImage": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "IssuedConsultaDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "rncEmisor": {
            "type": "string",
            "nullable": true
          },
          "discrepancia": {
            "type": "boolean"
          },
          "local": {
            "$ref": "#/components/schemas/IssuedLocalDto"
          },
          "dgii": {
            "$ref": "#/components/schemas/DgiiSnapshotDto"
          }
        },
        "additionalProperties": false
      },
      "IssuedInvoiceDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "receptorNombre": {
            "type": "string",
            "nullable": true
          },
          "receptorRnc": {
            "type": "string",
            "nullable": true
          },
          "monto": {
            "type": "number",
            "format": "double"
          },
          "moneda": {
            "type": "string",
            "nullable": true
          },
          "fechaEmision": {
            "type": "string",
            "format": "date-time"
          },
          "estado": {
            "type": "string",
            "nullable": true
          },
          "trackId": {
            "type": "string",
            "nullable": true
          },
          "codigoSeguridad": {
            "type": "string",
            "nullable": true
          },
          "emitidoPorSocio": {
            "type": "string",
            "nullable": true
          },
          "qrUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "IssuedInvoicesPageDto": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IssuedInvoiceDto"
            },
            "nullable": true
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "IssuedLocalDto": {
        "type": "object",
        "properties": {
          "estado": {
            "type": "string",
            "nullable": true
          },
          "trackId": {
            "type": "string",
            "nullable": true
          },
          "ruta": {
            "type": "string",
            "nullable": true
          },
          "intentos": {
            "type": "integer",
            "format": "int32"
          },
          "bloqueadoPor": {
            "type": "string",
            "nullable": true
          },
          "enContingencia": {
            "type": "boolean"
          },
          "generadoEn": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ModifiedDocumentDto": {
        "type": "object",
        "properties": {
          "ncf": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "modificationCode": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "otherTaxpayerRnc": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PaymentDto": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "nullable": true
          },
          "dueDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "QueuedInvoiceDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "horasRestantes": {
            "type": "number",
            "format": "double"
          },
          "enContingencia": {
            "type": "boolean"
          },
          "intentos": {
            "type": "integer",
            "format": "int32"
          },
          "bloqueadoPor": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QueuedInvoicesPageDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueuedInvoiceDto"
            },
            "nullable": true
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ReceivedConsultaDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "rncEmisor": {
            "type": "string",
            "nullable": true
          },
          "discrepancia": {
            "type": "boolean"
          },
          "codigoDifiere": {
            "type": "boolean"
          },
          "local": {
            "$ref": "#/components/schemas/ReceivedLocalDto"
          },
          "dgii": {
            "$ref": "#/components/schemas/DgiiSnapshotDto"
          }
        },
        "additionalProperties": false
      },
      "ReceivedInvoiceDto": {
        "type": "object",
        "properties": {
          "encf": {
            "type": "string",
            "nullable": true
          },
          "tipo": {
            "type": "string",
            "nullable": true
          },
          "emisor": {
            "type": "string",
            "nullable": true
          },
          "emisorRnc": {
            "type": "string",
            "nullable": true
          },
          "monto": {
            "type": "number",
            "format": "double"
          },
          "moneda": {
            "type": "string",
            "nullable": true
          },
          "fecha": {
            "type": "string",
            "format": "date-time"
          },
          "arecf": {
            "type": "string",
            "nullable": true
          },
          "acecf": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ReceivedLocalDto": {
        "type": "object",
        "properties": {
          "presente": {
            "type": "boolean"
          },
          "montoTotal": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totalITBIS": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "fechaEmision": {
            "type": "string",
            "nullable": true
          },
          "fechaFirma": {
            "type": "string",
            "nullable": true
          },
          "codigoSeguridad": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SellerDto": {
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SequenceConfigDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "from": {
            "type": "integer",
            "format": "int64"
          },
          "to": {
            "type": "integer",
            "format": "int64"
          },
          "expiry": {
            "type": "string",
            "nullable": true
          },
          "environment": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SequenceListDto": {
        "type": "object",
        "properties": {
          "sequences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SequencesDto"
            },
            "nullable": true
          },
          "externalNumbering": {
            "type": "boolean"
          },
          "environment": {
            "type": "string",
            "nullable": true
          },
          "nextEnvironment": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SequenceRangeDto": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "format": "int64"
          },
          "next": {
            "type": "integer",
            "format": "int64"
          },
          "to": {
            "type": "integer",
            "format": "int64"
          },
          "expiry": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SequencesDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "ranges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SequenceRangeDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxTreatment": {
        "enum": [
          "Itbis18",
          "Itbis16",
          "Itbis0",
          "Exento"
        ],
        "type": "string"
      },
      "TenantDirectory": {
        "type": "object",
        "properties": {
          "rnc": {
            "type": "string",
            "nullable": true
          },
          "urlRecepcion": {
            "type": "string",
            "nullable": true
          },
          "urlAceptacion": {
            "type": "string",
            "nullable": true
          },
          "urlAutenticacionSemilla": {
            "type": "string",
            "nullable": true
          },
          "urlAutenticacionValidacion": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "VoidRequestDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "from": {
            "type": "integer",
            "format": "int64"
          },
          "to": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "VoidResultDto": {
        "type": "object",
        "properties": {
          "voided": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "WebhookCreateRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WebhookCreatedDto": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/WebhookDto"
          },
          "secret": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WebhookDeliveryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "eventId": {
            "type": "string",
            "nullable": true
          },
          "eventType": {
            "type": "string",
            "nullable": true
          },
          "attemptCount": {
            "type": "integer",
            "format": "int32"
          },
          "lastStatusCode": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastError": {
            "type": "string",
            "nullable": true
          },
          "deliveredAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deadLetteredAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WebhookDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean"
          },
          "disabledReason": {
            "type": "string",
            "nullable": true
          },
          "disabledAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "WebhookSecretDto": {
        "type": "object",
        "properties": {
          "secret": {
            "type": "string",
            "nullable": true
          },
          "previousValidUntil": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "WebhookUpdateRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "WithholdingDto": {
        "type": "object",
        "properties": {
          "itbisRetenido": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "isrRetenido": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.g-efac.com/connect/token",
            "scopes": {
              "efac.v1": "Full access to this tenant\u0027s /v1 surface"
            }
          },
          "authorizationCode": {
            "authorizationUrl": "https://api.g-efac.com/connect/authorize",
            "tokenUrl": "https://api.g-efac.com/connect/token",
            "refreshUrl": "https://api.g-efac.com/connect/token",
            "scopes": {
              "efac.v1": "Full access to this tenant\u0027s /v1 surface"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": [
        "efac.v1"
      ]
    }
  ]
}