Wire shape of an NFS-e invoice.
The SDK returns the invoice as a plain map with these string keys.
Summary
Types
Params for CorvoNfse.Resources.Invoices.create/3 and calculate/2
(camelCase wire keys, passed through unchanged)
Customer input for create_params.
Raw download body returned by pdf/2 and xml/2.
Environment wire value: "test" | "live".
A single entry of Invoices.events/3.
Stage wire value: "pending" | "authorized" | "documents_ready" | "completed" | "failed".
Types
@type create_params() :: map()
Params for CorvoNfse.Resources.Invoices.create/3 and calculate/2
(camelCase wire keys, passed through unchanged):
companyIdorcompanyTaxId(CNPJ) - the issuing companyservice(required) -%{code?:, municipalityCode?:, description?:};code(6 digits) defaults to the company's, then to100901amount(required) - BRL, positive, up to 2 decimal placescompetenceDate(required) -YYYY-MM-DDcustomer(optional) -%{taxId:, name?:, email?:, address?:}; when sent,taxId(CPF or CNPJ) is requireddiscount(optional) - unconditional discount, from 0 up toamountemail(optional) - boolean;options.email.sendwins when setoptions(optional) -%{email?: %{send: boolean}, type?: "IMMEDIATE" | "SCHEDULE"}externalId(optional)
@type customer_input() :: map()
Customer input for create_params.
Raw download body returned by pdf/2 and xml/2.
@type download_format() :: :pdf | :xml | String.t()
@type environment() :: String.t()
Environment wire value: "test" | "live".
@type event() :: map()
A single entry of Invoices.events/3.
@type stage() :: String.t()
Stage wire value: "pending" | "authorized" | "documents_ready" | "completed" | "failed".
@type status() :: String.t()
| Invoice status wire value: `"queued" | "processing" | "authorized" | |
| "rejected" | "retry_pending" | "reconciliation_required" |
"manual_review" | "failed"`.
@type t() :: %CorvoNfse.Types.Invoice{ accessKey: String.t() | nil, amount: number(), authorizedAt: String.t() | nil, companyId: String.t(), competenceDate: String.t(), createdAt: String.t(), currency: String.t(), customerSnapshot: map(), documentKeyVersion: integer(), documentsReadyAt: String.t() | nil, documentsStatus: String.t(), dpsId: String.t() | nil, dpsNumber: integer() | nil, dpsSeries: String.t() | nil, emailSnapshot: map(), emailStatus: String.t() | nil, environment: environment(), externalId: String.t() | nil, fiscalProvider: String.t() | nil, fiscalSchemaVersion: String.t() | nil, id: String.t(), idempotencyKey: String.t() | nil, issuedAt: String.t() | nil, lastEmailSentAt: String.t() | nil, lastEmailStatus: String.t() | nil, lastErrorCode: String.t() | nil, lastErrorMessage: String.t() | nil, lastErrorProvider: String.t() | nil, nfseNumber: integer() | nil, scheduledFor: String.t() | nil, serviceSnapshot: map(), stage: stage(), status: status(), taxSnapshot: map(), tenantId: String.t(), updatedAt: String.t() }