Table of Contents

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

EntityId string

Entity the document belongs to.

Direction TaxDirection

Receivable (client invoice) or payable (vendor bill).

SourceSystem string

Calling system, e.g. legacy or modernization; part of the idempotency key.

SourceDocumentId string

Caller's document id (invoice or bill id); part of the idempotency key.

CounterpartyCode string

Client or vendor code.

JobSite AddressDto

Where the work happens; this decides the tax jurisdictions.

Lines IReadOnlyList<TaxLineRequest>

1 to 1000 lines.

Date DateOnly?

Document and tax date; defaults to today.

Commit bool

Commit straight away (reportable). Otherwise the document is saved and can be replaced.

CounterpartyName string

Client or vendor name, for reports.

CurrencyCode string

ISO 4217 document currency; defaults to the entity's base currency.

FxLockId Guid?

Exchange-rate lock the caller already holds for this document.

ShipFrom AddressDto

Where materials ship from, when relevant to sourcing rules.

ExemptionNumber string

Exemption certificate number to apply.

EntityUseCode string

Avalara entity use code for an exempt buyer.

WorkOrderNumber string

Work order reference (shown on reports and in AvaTax).

PurchaseOrderNumber string

PO reference (shown on reports and in AvaTax).

InvoiceNumber string

Invoice or bill number (shown on reports and in AvaTax).

VendorChargedTax decimal?

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

bool

CounterpartyCode

Client or vendor code.

public string CounterpartyCode { get; init; }

Property Value

string

CounterpartyName

Client or vendor name, for reports.

public string? CounterpartyName { get; init; }

Property Value

string

CurrencyCode

ISO 4217 document currency; defaults to the entity's base currency.

public string? CurrencyCode { get; init; }

Property Value

string

Date

Document and tax date; defaults to today.

public DateOnly? Date { get; init; }

Property Value

DateOnly?

Direction

Receivable (client invoice) or payable (vendor bill).

public TaxDirection Direction { get; init; }

Property Value

TaxDirection

EntityId

Entity the document belongs to.

public string EntityId { get; init; }

Property Value

string

EntityUseCode

Avalara entity use code for an exempt buyer.

public string? EntityUseCode { get; init; }

Property Value

string

ExemptionNumber

Exemption certificate number to apply.

public string? ExemptionNumber { get; init; }

Property Value

string

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

string

JobSite

Where the work happens; this decides the tax jurisdictions.

public AddressDto JobSite { get; init; }

Property Value

AddressDto

Lines

1 to 1000 lines.

public IReadOnlyList<TaxLineRequest> Lines { get; init; }

Property Value

IReadOnlyList<TaxLineRequest>

PurchaseOrderNumber

PO reference (shown on reports and in AvaTax).

public string? PurchaseOrderNumber { get; init; }

Property Value

string

ShipFrom

Where materials ship from, when relevant to sourcing rules.

public AddressDto? ShipFrom { get; init; }

Property Value

AddressDto

SourceDocumentId

Caller's document id (invoice or bill id); part of the idempotency key.

public string SourceDocumentId { get; init; }

Property Value

string

SourceSystem

Calling system, e.g. legacy or modernization; part of the idempotency key.

public string SourceSystem { get; init; }

Property Value

string

VendorChargedTax

AP only: tax the vendor put on the bill, to compare with the calculated tax.

public decimal? VendorChargedTax { get; init; }

Property Value

decimal?

WorkOrderNumber

Work order reference (shown on reports and in AvaTax).

public string? WorkOrderNumber { get; init; }

Property Value

string