Invoices: Looks up a line's sales-tax rate from the merchant biller's tax provider.
POST
/api/invoicing/invoices/tax-rate-lookup
deprecated
Requires: Invoicing.Invoices, merchant scope.
Resolves the origin from the merchant's default shipping origin (falling back to `billerSnapshot`) and the destination from `recipientSnapshot` (falling back to a customer recipient's address on file), then asks the merchant's bound provider for the combined rate. The answer is in percent units (a provider rate of 0.0975 is returned as 9.75), ready to store as the line's `taxRatePercent` alongside `taxRateSource` = Provider and the returned `providerName`. The line's `taxCode` is never sent to the provider.
Signed in, you can send this request to your own sandbox merchant from the console and read the answer. Sign in to try it.
Example request
Every block below sends the same request. Replace {{BASE_URL}} with the address of the API you are calling and {{API_KEY}} with your own key.
The request body is a InvoiceTaxRateLookupInput. See the Request body section below for its fields.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
suppressNulls
required |
query | boolean | If true, omit properties with null values. |
Request body
application/json
, required
| Field | Type | Description |
|---|---|---|
billerId
required |
string (uuid) | The biller whose tax provider binding performs the lookup. Must be a merchant. |
billerType
required |
all of InvoicePartyType | The biller's party type. Anything other than `Merchant` is refused. |
recipientType
required |
all of InvoicePartyType | The recipient's party type. Only a `Customer` recipient has an address on file to fall back to. |
recipientId
required |
string (uuid) | The recipient, when one has been chosen. Optional: a supplied `recipientSnapshot` stands in for it. nullable |
recipientSnapshot
required |
all of InvoicePartySnapshotDto | Optional destination address. When supplied with a street and a state it is used as the destination instead of the recipient's address on file. Conditional: When RecipientSnapshot is not null. |
billerSnapshot
required |
all of InvoicePartySnapshotDto | Optional origin address. Used only when the merchant has no default shipping origin. Conditional: When BillerSnapshot is not null. |
This request body has no documented fields.
Responses
200 The provider's rate in percent units.
Body: InvoiceTaxRateLookupResultDto
Each item has these fields.
| Field | Type | Description |
|---|---|---|
ratePercent
required |
number (double) | The combined sales-tax rate in percent units, rounded to four decimals. |
jurisdiction
required |
string | One display string naming the jurisdictions the rate is built from, bounded to `MaxTaxJurisdictionLength` so it fits the line's jurisdiction field. nullable |
providerName
required |
string | The provider that answered, as the line records it in `TaxRateProviderName`. nullable |
normalizedAddress
required |
string | The provider's normalised form of the address it rated, when it reported one. nullable |
isFreightTaxable
required |
boolean | Whether the provider reports shipping as taxable at the rated location. |
This response has no documented body fields.
400 The biller is not a merchant (`Invoicing:TaxRateLookup:BillerNotMerchant`). Only a merchant holds a tax provider binding; a reseller or gateway-owner biller uses its own tax rate catalog instead.
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
404 The caller's biller scope does not cover the requested biller (`Invoicing:Biller:ForeignBillerNotAllowed`). Reported as not-found rather than forbidden so the response cannot be used to probe which billers exist.
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
409 The lookup cannot run as things stand: the merchant has no enabled, deployed provider (`Invoicing:TaxRateLookup:ProviderUnavailable`); no origin address could be resolved (`Invoicing:TaxRateLookup:NoOriginAddress`); no destination address could be resolved (`Invoicing:TaxRateLookup:NoDestinationAddress`); or the provider answered with a failure (`Invoicing:TaxRateLookup:ProviderFailed`), whose normalised error codes travel in the error's `data.errorCodes`.
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
403 Forbidden
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
401 Unauthorized
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
501 Not Implemented
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
500 Internal Server Error
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
default The request failed. The body carries the standard error envelope: a machine-readable `error.code`, a human-readable `error.message`, and `error.validationErrors` when the failure was a validation rejection. See the error-code reference in this document's description for the values `error.code` can take.
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
429 The request was refused because a rate limit was exceeded, or because something a later retry can clear stopped it. A rate limit refusal carries an `application/problem+json` body: wait at least the interval `Retry-After` names before retrying, then back off. Limits are tuned per deployment, so read the allowance from the response headers rather than assuming a fixed ceiling. Any other refusal carries the standard error envelope as `application/json`, and its `error.code` names the cause.
Body: RemoteServiceErrorResponse
Each item has these fields.
| Field | Type | Description |
|---|---|---|
error
required |
RemoteServiceErrorInfo |
This response has no documented body fields.
Errors
A failed request returns the platform error envelope. The
error reference lists every value
error.code can carry and shows the four response shapes.