Class CreateTaxDocumentRequest
- Namespace
- Integrations.Contracts.Tax
- Assembly
- Integrations.Contracts.dll
Create (or, while not committed, replace) a tax document. Idempotent on
(EntityId, SourceSystem, SourceDocumentId, Direction): resending the same content returns the
existing document. FxLockId is required only when the caller already locked the rate; otherwise the daily
rate for Date is locked automatically when the currency differs from the entity's base currency.
public sealed record CreateTaxDocumentRequest : IEquatable<CreateTaxDocumentRequest>
- Inheritance
-
CreateTaxDocumentRequest
- Implements
- Inherited Members
Constructors
CreateTaxDocumentRequest(string, TaxDirection, string, string, string, AddressDto, IReadOnlyList<TaxLineRequest>, DateOnly?, bool, string?, string?, Guid?, AddressDto?, string?, string?, string?, string?, string?, decimal?)
Create (or, while not committed, replace) a tax document. Idempotent on
(EntityId, SourceSystem, SourceDocumentId, Direction): resending the same content returns the
existing document. FxLockId is required only when the caller already locked the rate; otherwise the daily
rate for Date is locked automatically when the currency differs from the entity's base currency.
public CreateTaxDocumentRequest(string EntityId, TaxDirection Direction, string SourceSystem, string SourceDocumentId, string CounterpartyCode, AddressDto JobSite, IReadOnlyList<TaxLineRequest> Lines, DateOnly? Date = null, bool Commit = false, string? CounterpartyName = null, string? CurrencyCode = null, Guid? FxLockId = null, AddressDto? ShipFrom = null, string? ExemptionNumber = null, string? EntityUseCode = null, string? WorkOrderNumber = null, string? PurchaseOrderNumber = null, string? InvoiceNumber = null, decimal? VendorChargedTax = null)
Parameters
EntityIdstringEntity the document belongs to.
DirectionTaxDirectionReceivable (client invoice) or payable (vendor bill).
SourceSystemstringCalling system, e.g.
legacyormodernization; part of the idempotency key.SourceDocumentIdstringCaller's document id (invoice or bill id); part of the idempotency key.
CounterpartyCodestringClient or vendor code.
JobSiteAddressDtoWhere the work happens; this decides the tax jurisdictions.
LinesIReadOnlyList<TaxLineRequest>1 to 1000 lines.
DateDateOnly?Document and tax date; defaults to today.
CommitboolCommit straight away (reportable). Otherwise the document is saved and can be replaced.
CounterpartyNamestringClient or vendor name, for reports.
CurrencyCodestringISO 4217 document currency; defaults to the entity's base currency.
FxLockIdGuid?Exchange-rate lock the caller already holds for this document.
ShipFromAddressDtoWhere materials ship from, when relevant to sourcing rules.
ExemptionNumberstringExemption certificate number to apply.
EntityUseCodestringAvalara entity use code for an exempt buyer.
WorkOrderNumberstringWork order reference (shown on reports and in AvaTax).
PurchaseOrderNumberstringPO reference (shown on reports and in AvaTax).
InvoiceNumberstringInvoice or bill number (shown on reports and in AvaTax).
VendorChargedTaxdecimal?AP only: tax the vendor put on the bill, to compare with the calculated tax.
Properties
Commit
Commit straight away (reportable). Otherwise the document is saved and can be replaced.
public bool Commit { get; init; }
Property Value
CounterpartyCode
Client or vendor code.
public string CounterpartyCode { get; init; }
Property Value
CounterpartyName
Client or vendor name, for reports.
public string? CounterpartyName { get; init; }
Property Value
CurrencyCode
ISO 4217 document currency; defaults to the entity's base currency.
public string? CurrencyCode { get; init; }
Property Value
Date
Document and tax date; defaults to today.
public DateOnly? Date { get; init; }
Property Value
Direction
Receivable (client invoice) or payable (vendor bill).
public TaxDirection Direction { get; init; }
Property Value
EntityId
Entity the document belongs to.
public string EntityId { get; init; }
Property Value
EntityUseCode
Avalara entity use code for an exempt buyer.
public string? EntityUseCode { get; init; }
Property Value
ExemptionNumber
Exemption certificate number to apply.
public string? ExemptionNumber { get; init; }
Property Value
FxLockId
Exchange-rate lock the caller already holds for this document.
public Guid? FxLockId { get; init; }
Property Value
- Guid?
InvoiceNumber
Invoice or bill number (shown on reports and in AvaTax).
public string? InvoiceNumber { get; init; }
Property Value
JobSite
Where the work happens; this decides the tax jurisdictions.
public AddressDto JobSite { get; init; }
Property Value
Lines
1 to 1000 lines.
public IReadOnlyList<TaxLineRequest> Lines { get; init; }
Property Value
PurchaseOrderNumber
PO reference (shown on reports and in AvaTax).
public string? PurchaseOrderNumber { get; init; }
Property Value
ShipFrom
Where materials ship from, when relevant to sourcing rules.
public AddressDto? ShipFrom { get; init; }
Property Value
SourceDocumentId
Caller's document id (invoice or bill id); part of the idempotency key.
public string SourceDocumentId { get; init; }
Property Value
SourceSystem
Calling system, e.g. legacy or modernization; part of the idempotency key.
public string SourceSystem { get; init; }
Property Value
VendorChargedTax
AP only: tax the vendor put on the bill, to compare with the calculated tax.
public decimal? VendorChargedTax { get; init; }
Property Value
WorkOrderNumber
Work order reference (shown on reports and in AvaTax).
public string? WorkOrderNumber { get; init; }