With your consent, we measure how people use our site and which campaigns bring them here, and identify visiting companies so our team can follow up. Privacy Policy
Tools and providers
Plausible · Analytics, only after Accept
Counts visits and which campaigns bring them.
Stores nothing on your device. The identifier it uses to count unique visitors changes every 24 hours.
Leadfeeder · Marketing, only after Accept
Identifies the company you may be browsing from, so our sales team can follow up.
Leadfeeder data is kept for 12 months in our Leadfeeder account. What it keeps on your device is listed below.
_lfa, _lfa_expiry · Cookie and local storage
A visitor ID. The cookie is kept for 1 year. The local storage copy is not used after 1 year and stays until you clear it. Withdrawing removes both.
_lfa_consent · Cookie and local storage
Records that you accepted. The cookie is kept for 1 year, the local storage copy until you clear it. Withdrawing removes both.
ldfdr_opt_out, ldfdr_opt_out_expiry · Cookie and local storage
Set when you withdraw after accepting, or your Accept runs out on an open page, so Leadfeeder stays off. The cookie is kept for 10 years, or until you close your browser if Leadfeeder never loaded. The local storage copy stays until you clear it. Accepting again removes both.
_lfa_test_cookie_stored · Cookie
Checks that your browser accepts cookies. Deleted straight away.
Outpost · Always, to remember your choice
Keeps your choice, so we do not ask on every page.
outpost-consent · Local storage
Your choice, when you made it, the version of this notice and a random ID. We do not store the ID on our side. Your choice applies for 365 days, then we ask again. The entry stays on your device until you clear it or make a new choice.
outpost-consent-declined · Cookie
Records when you rejected, only if your browser cannot save your choice. Kept for 365 days.
Outpost Tax of Record provides a REST API that automates tax registration, calculation, and filings for the merchants on your platform. You call it with your own partner credentials on behalf of a named merchant, so your merchants never hold Outpost credentials of their own. The integration is server-to-server - no browser calls Outpost directly.
Build with AI
Copy the full integration brief and paste it into your AI coding assistant to scaffold the integration automatically.
One-click brief for your AI agent.
Integration Flow
Frontend→Your Platform→Outpost API
The merchant's checkout calls your platform
Your platform authenticates with Outpost using OAuth2 client_credentials
Your platform calculates tax for the merchant and returns it to the checkout
After payment succeeds, your platform stores the transaction against that merchant
Outpost handles all tax filing, compliance, and liability, and collects tax and fees from the merchant by direct debit
Security & Operational Principles
Server-only secrets - OUTPOST_CLIENT_SECRET must never be exposed to browsers or logs
Token management - Cache access tokens with TTL, refresh on expiry or 401 responses
Idempotency - Store and refund replay safely on merchantTransactionReference / merchantRefundReference: an identical retry returns the original result with 200, never a duplicate
Timeouts & retries - 5s timeout per request, retry transient errors (network/5xx) with bounded backoff
Production gates - Store calls only after PSP authorization/capture succeeds
Environment Setup
Variable
Value
Notes
API_BASE_URL
https://api.outpostanywhere.com
Base URL for all API endpoints
CLIENT_ID
Your client ID
Non-sensitive, can be inlined
OUTPOST_CLIENT_SECRET
-
Store in environment variables or secret manager
Authentication
Outpost uses OAuth2 client_credentials for server-to-server calls. Your backend exchanges a client_id and api_token for an access_token, then sends it as a Bearer token on every API request.
Create and manage your API credentials in the Partner Portal, under Settings → Developer → API Keys. One credential pair covers every merchant linked to your partner account.
How-to and operational notes live on the Authentication page - the shapes below are the reference copy.
Flow
Request an access_token with your client_id and api_token
Read access_token and expires_in from the response
Cache the token server-side with TTL expires_in - 300s
Refresh on expiry or on a 401, then retry the request once
Send Authorization: Bearer <access_token> on every API call
Get access token
POST/oauth2/token
Host: https://access.outpostanywhere.com
Do not send token requests to the API host (https://api.outpostanywhere.com).
Send your api_token as the OAuth client_secret form field - that is the wire name for this grant.
Run from your server. Never expose your api_token in the browser.
Every endpoint below is scoped to a single merchant through the merchantId path parameter. Outpost checks that the merchant is linked to your partner account before the request reaches the tax engine. If it is not - or if the merchant does not exist at all - you get 404, not 403, so that merchant ids cannot be discovered by probing.
Creates a tax calculation for a given set of line items and customer information. The calculation determines applicable tax rates based on the customer's location and can be used to create a transaction after the successful payment.
Path Parameters
Parameter
Type
Required
Description
merchantId
string
Yes
Outpost identifier of the merchant you are acting for. Returned when you create the merchant during onboarding.
Request Headers
Parameter
Type
Required
Description
Authorization
-
Yes
Bearer token for authentication
Content-Type
-
Yes
application/json
Request Body Parameters
One endpoint, two product cases: the request shape below covers both digital goods and physical goods with cross-border import duty. Declare the case per line with productType. Worked examples for each case follow the parameter table.
Parameter
Type
Required
Description
currency
string
Yes
ISO 4217 currency code (e.g., EUR, USD, GBP, BRL). Brazil B2C NFS-e requires BRL.
taxBehavior
string enum
No
Allowed values: EXCLUSIVE, INCLUSIVE. Defaults to EXCLUSIVE. With INCLUSIVE, unitPrice is the gross amount and tax is extracted from it.
customer
object
Yes
Customer information object
customer.merchantCustomerReference
string
No
Your internal customer identifier
customer.firstName
string
Customer's first name.
customer.lastName
string
Customer's last name.
customer.legalName
string
A company’s legal name as one value.
customer.email
string
No
Customer's email address
customer.taxIdentifiers
array
Customer tax identifiers, discriminated on type.
customer.taxIdentifiers[].type
string enum
Conditional
Identifier type: BR_CPF, BR_CNPJ, EU_VAT, GB_VAT, or US_EIN. The jurisdiction is part of the type - there is no country field. Unknown types are rejected. Brazil requires exactly one BR_CPF or BR_CNPJ; other types may accompany it.
customer.taxIdentifiers[].code
string
Conditional
Identifier value. Format/check-digit validated for BR_CPF and BR_CNPJ (not against Receita Federal registration). VIES format with a two-letter country prefix for EU_VAT. GB_VAT and US_EIN are informational and recorded as provided. Formatted or bare codes accepted.
Customer's shipping address. The destination drives US sales-tax sourcing.
customer.shippingAddress.line1
string
Primary address line.
customer.shippingAddress.line2
string
No
Secondary address line
customer.shippingAddress.city
string
City name.
customer.shippingAddress.state
string
State/province code.
customer.shippingAddress.postalCode
string
Postal/ZIP code.
customer.shippingAddress.country
string
Conditional
ISO 3166-1 alpha-2 country code. Required whenever the shipping address is present.
lineItems
array
Yes
Array of line items (minimum 1)
lineItems[].merchantLineItemReference
string
Yes
Your internal line item identifier
lineItems[].productCode
string
Yes
Product/service code for tax classification
lineItems[].title
string
Product title - the primary classification text.
lineItems[].description
string
Detailed product description. Improves HS code prediction together with title, and is printed on fiscal documents (falls back to title when absent).
lineItems[].unitPrice
decimal
Yes
Price per unit (must be ≥ 0)
lineItems[].quantity
integer
No
Quantity (default: 1, must be > 0)
lineItems[].discountAmount
decimal
No
Discount amount per unit. For quantity 3 and discountAmount 2.00, the total discount is 6.00; applied before tax calculation.
lineItems[].productType
string enum
Recommended
Allowed values: PHYSICAL, DIGITAL, SERVICES. Pass it explicitly on every line. Lines without productType are treated as DIGITAL for backward compatibility - do not rely on that. Drives tax engine selection: physical goods are priced with import duty on the cross-border path. SERVICES is a fee or service charge on a goods order and requires ancillaryType.
lineItems[].ancillaryType
string enum
What kind of fee a SERVICES line is. COMMISSION - your commission or service fee on the purchase. SHIPPING_COST - the delivery charge. HANDLING - handling or processing of the order. PACKAGING - packing materials. OTHER - any other fee. Rejected on PHYSICAL and DIGITAL lines.
lineItems[].countryOfOrigin
string
ISO 3166-1 alpha-2 country of manufacture. Requires productType PHYSICAL.
lineItems[].hsCode
string
No
Destination-qualified full HS code to classify the line with: 6-14 digits, dot separators allowed (normalized to digits). Requires productType PHYSICAL. When absent, Outpost predicts the code from title, description, and category.
lineItems[].category
string
No
Free-text product category (e.g. "Watches", "Trading Cards"). Improves HS code prediction accuracy when hsCode is not provided; ignored otherwise.
lineItems[].images
array
No
Public product image URLs. Stored with the product classification for future model training; not sent to the classification engine.
shipFrom
object
No
Ship-from origin address for cross-border duty. Requires at least one PHYSICAL line item. When the origin country differs from the destination, the cart routes to the duty provider.
shipFrom.line1
string
No
Primary address line
shipFrom.line2
string
No
Secondary address line
shipFrom.city
string
No
City name
shipFrom.state
string
No
State/province code
shipFrom.postalCode
string
No
Postal/ZIP code
shipFrom.country
string
Conditional
ISO 3166-1 alpha-2 country code. Required whenever shipFrom is present.
evidence
object
Tax evidence.
evidence.billingCountry
string
ISO 3166-1 alpha-2 billing country code. If provided for Brazil, must be BR.
evidence.ipAddress
string
Customer's IP address.
evidence.paymentMethodCountry
string
No
Payment method country code
Digital and physical goods
Pass productType explicitly on every line: DIGITAL for digital products and services, PHYSICAL for goods that ship. Any PHYSICAL line requires customer.shippingAddress - physical-goods tax is destination-based.
For a PHYSICAL line, pass as much product data as you can: title, description, category, images, countryOfOrigin. The richer the product text, the more accurate the predicted HS code, and so the duty and tax rates. Already know the full HS code for the destination? Pass hsCode to skip prediction and price duty straight from your code.
Adding shipFrom with an origin country that differs from the destination puts the cart on the cross-border duty path: each PHYSICAL line then needs countryOfOrigin and at least one of title or description, and the response prices import duty per line. Mixed carts are fine - digital lines carry no duty and skip these requirements. Physical goods to the US cannot be priced yet (409 physical_goods_not_supported).
Put each fee or service charge on a goods order - shipping, handling, packaging, your commission - on its own line with SERVICES and an ancillaryType. Outpost taxes a SERVICES line at the rate of the goods it accompanies: it splits the fee across the PHYSICAL lines in proportion to their net amounts and applies each line's rate to its share, so tax.rate on a SERVICES line is the weighted rate. SERVICES lines carry no duty. A cart with a SERVICES line must contain at least one PHYSICAL line priced above zero; otherwise Outpost rejects it with 400 invalid_argument. A digital service sold on its own stays DIGITAL.
For Brazil
Brazil is supported for services, invoiced as an NFS-e under ISS. Telecom and communication services - an eSIM, for example - are not: those need NFCom, which Outpost does not issue yet.
Set taxBehavior to INCLUSIVE when the line amount you send should stand as the service value and the ISS tax base.
CPF and CNPJ are checked for format and check digits only. A well-formed identifier can still be rejected when the e-invoice reaches the authority.
Digital Goods Example
For digital goods pass productType: DIGITAL per line. No shipping address, no duty fields; tax is quoted from the customer's location and evidence. A Dutch consumer buying an annual subscription: 21% VAT on the discounted net amount.
Brazil B2C NFS-e calculations require BRL, customer first and last name, and a BR_CPF tax identifier. In inclusive mode, the submitted line amount remains the service value and ISS tax base; tax is not backed out of the line amount. The response keeps unit price, subtotal, net amount, and total amount at the submitted amount and reports ISS separately.
Brazil requires exactly one BR_CPF or BR_CNPJ identifier. Use BR_CPF for B2C and BR_CNPJ for B2B. If no Brazilian identifier is present, if more than one is present, or if the value fails check-digit validation, the calculation request is rejected before tax is calculated.
{
"code": "invalid_argument",
"errors": [
{
"field": "customer.taxIdentifiers[0].code",
"message": "must be a valid CPF" }
]
}
Physical Goods Example (Cross-Border Duty)
A Japanese wristwatch shipped to a customer in the Netherlands. The cart is on the cross-border duty path: shipFrom (JP) differs from the shipping destination (NL) and the line is PHYSICAL. The line carries no hsCode, so Outpost classifies the product from its title, description, and category and prices duty from the resulting destination-qualified HS code (dutyBasis CLASSIFIED).
Duty (4.5% of the €200.00 net amount = €9.00) is added to the customs value before VAT, so the 21% Dutch VAT applies to goods + duty (21% of €209.00 = €43.89). itemTotalAmount and totalAmount include tax and duty (€252.89); totalDutyAmount reports duty separately and is never folded into taxAmount.
Outpost compares the goods value of the order with the destination's de minimis threshold: €150 in the EU and £135 in the UK, per consignment. Only PHYSICAL lines count towards it - SERVICES and DIGITAL lines, shipping and duty don't. Where a destination applies its threshold per item, Outpost compares the highest unit value instead. Outpost converts the goods value into the threshold's currency when the order is in another currency. With taxBehaviorINCLUSIVE, Outpost compares the value net of the included tax. A destination without a threshold always returns COLLECTING.
Above the threshold the calculation still succeeds with 201 Created: taxCollection is NOT_COLLECTING, taxabilityReason is ABOVE_DE_MINIMIS_THRESHOLD, every line carries 0 tax, and no duty is priced. A tax transaction created from the calculation carries the same two fields. Drive your checkout display from taxCollection, not from a taxAmount of 0: a COLLECTING order can also carry 0 tax.
Response Fields
Parameter
Type
Required
Description
taxCalculationId
string
-
Unique identifier for the calculation
createdAt
string
-
ISO 8601 timestamp when calculation was created
expiresAt
string
-
ISO 8601 timestamp when calculation expires
currency
string
-
Currency code
subTotalAmount
decimal
-
Sum of line item amounts before discounts
discountAmount
decimal
-
Total discount amount applied
netAmount
decimal
-
Amount after discounts, before tax
taxAmount
decimal
-
Total tax amount
totalAmount
decimal
-
Final amount including tax
customer
object
-
Customer information
totalDutyAmount
decimal
-
Total import duty across all line items. Omitted when no line carries duty.
lineItems
array
-
Calculated line items with tax details
lineItems[].tax.rate
decimal
-
Effective tax rate applied to the line
lineItems[].tax.taxAmount
decimal
-
Tax amount for the line
lineItems[].tax.dutyAmount
decimal
-
Import duty for the line. Omitted when the line carries no duty.
lineItems[].tax.dutyRate
decimal
-
Duty rate applied to the line
lineItems[].tax.dutyBasis
string enum
-
How the duty was priced: CLASSIFIED (from a destination-qualified HS code, supplied or predicted) or FALLBACK_ESTIMATE (a conservative per-destination rate used when the line could not be classified).
lineItems[].tax.appliedHsCode
string
-
Destination-qualified HS code the line was actually priced with. Omitted on the FALLBACK_ESTIMATE tier.
lineItems[].tax.charges
array
-
Jurisdiction-level breakdown. Always present. See the charges note below before using it.
evidence
object
-
Tax evidence used for calculation
entity
object
-
The Outpost legal entity acting as the recording seller (present when Tax of Record / liability transfer applies).
entity.companyName
string
-
Legal company name of the recording entity.
taxCollection
string enum
-
Whether Outpost collects tax on this order. COLLECTING - Outpost collects the tax in taxAmount, which can be 0. NOT_COLLECTING - the order's goods value is above the destination's de minimis threshold; every line carries 0 tax and no duty. Always present.
taxabilityReason
string enum
-
Why Outpost doesn't collect tax. ABOVE_DE_MINIMIS_THRESHOLD - the order's goods value is above the destination's de minimis threshold. Omitted when taxCollection is COLLECTING.
Amount and rate fields in responses are returned as decimal strings to preserve precision. Request examples may send decimal values as JSON numbers.
Fields with no value are omitted from the response rather than returned as null. Check whether a key is present, not whether it equals null.
A calculation is valid for 7 days from createdAt. After expiresAt it can no longer be converted into a transaction - create a new one.
Charge Breakdown
Every line item carries a tax.charges array describing the individual jurisdiction-level charges behind the line totals.
Parameter
Type
Required
Description
kind
string enum
-
TAX, IMPORT_DUTY, or IMPORT_FEE
name
string
-
Charge display name as reported by the provider (e.g. "CA STATE TAX", "Standard Rate", "Import Duty")
jurisdiction
string
-
Jurisdiction the charge belongs to. Omitted for duty and fees.
jurisdictionLevel
string enum
-
COUNTRY, STATE, COUNTY, CITY, or DISTRICT. Omitted for duty and fees.
country
string
-
ISO 3166-1 alpha-2 country code
taxType
string enum
-
Normalized tax type: VAT, GST, SALES_TAX, IMPORT_VAT, or OTHER. Omitted for duty and fees.
providerTaxType
string
-
The tax provider's own type label (e.g. "Output", "ImportDuty", "MPF"), passed through unchanged
rate
decimal
-
Rate for this charge
amount
decimal
-
Amount for this charge
taxableAmount
decimal
-
Amount this charge was calculated on
Use taxAmount and dutyAmount for money flows. TAX entries sum to taxAmount and IMPORT_* entries sum to dutyAmount, but the breakdown is for display and reconciliation - do not derive amounts by filtering this list.
Error Responses
HTTP
Code
Description
400
invalid_argument
Missing or invalid field - check field requirements. A malformed body, or an unknown tax identifier type, is reported on the field "body". Includes legacy tax-identifier shapes (e.g. type "CPF" without the BR_ prefix).
400
missing_country_of_origin
A physical line item on a cross-border order has no countryOfOrigin. The field names the line index.
400
missing_classification_text
A physical line item on a cross-border order has neither title nor description - at least one is required to classify the product. The field names the line index.
400
shipping_address_required
The cart contains a PHYSICAL line item but no customer.shippingAddress
400
invalid_state
Please activate Outpost Taxes / Tax of Record to process transactions
409
region_not_activated
Merchant not activated for the customer's tax jurisdiction
409
region_not_supported
Customer location outside supported jurisdictions
409
physical_goods_not_supported
Physical goods cannot be priced for that destination yet
409
integration_credentials_invalid
The tax provider rejected the configured integration credentials
409
integration_not_configured
Tax compliance integration is not configured
422
nfse_validation_failed
Brazil NFS-e pre-payment validation rejected the customer data. Each reason is returned on the field "customer".
502
tax_provider_unavailable
The tax provider is temporarily unavailable. Safe to retry with backoff - this is the only retryable failure on this endpoint.
401
-
Invalid or missing Authorization token
404
not_found
The merchant does not exist, or is not linked to your partner account. Both cases return 404 with an empty errors array - never 403.
Code Example
# Step 2: Calculate tax for the transactioncurl -X POST "https://api.outpostanywhere.com/partner/api/merchants/{merchantId}/tax/calculations" \
-H "Authorization: Bearer $OUTPOST_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"currency": "EUR",
"taxBehavior": "EXCLUSIVE",
"customer": {
"merchantCustomerReference": "CUST-001",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"billingAddress": {
"line1": "123 Main St",
"city": "Berlin",
"postalCode": "10115",
"country": "DE"
}
},
"lineItems": [
{
"merchantLineItemReference": "ITEM-001",
"productCode": "SKU-123",
"description": "Sample Product",
"productType": "DIGITAL",
"unitPrice": 19.99,
"quantity": 1
}
],
"evidence": {
"billingCountry": "DE",
"ipAddress": "192.168.1.1",
"paymentMethodCountry": "DE"
}
}' | jq
# Response: 201 Created with taxCalculationId# Save the taxCalculationId for the Store step
Converts a valid tax calculation into a confirmed tax transaction. This endpoint should be called when an order is finalized/paid. Only call after payment authorization/capture succeeds.
Idempotent by merchantTransactionReference: retrying with the same taxCalculationId and reference returns the already-created transaction with 200 - safe to resend after a timeout or lost response, and no duplicate is recorded. Reusing the reference with a different calculation returns 400 invalid_state.
On create, Outpost validates structure and required fields synchronously and rejects malformed requests immediately. Authority clearance (signed submission / e-invoice authorization) is asynchronous. Retrieve invoices and e-invoice documents from Invoicing, and explicit pending/cleared/rejected status and webhooks are on the roadmap.
Path Parameters
Parameter
Type
Required
Description
merchantId
string
Yes
Outpost identifier of the merchant you are acting for. Returned when you create the merchant during onboarding.
ID of the tax calculation generated by Outpost to convert
merchantTransactionReference
string
Yes
Your unique order/transaction reference. Also the idempotency key: retrying with the same reference and taxCalculationId returns the existing transaction with 200; reusing it with a different calculation returns 400.
payment
object
No
Payment processor information
payment.processor
string
No
Payment processor name (e.g., "stripe", "adyen")
payment.paymentReference
string
No
Payment processor transaction ID
Response 200 OK
The transaction carries the taxCollection and taxabilityReason of the calculation it was created from - see De Minimis Threshold.
Missing or invalid field - check field requirements. taxCalculationId must be a valid UUID.
400
invalid_state
Tax calculation has expired. Returned on the field taxCalculationId - create a new calculation.
400
invalid_state
Tax calculation has already been used - under a different merchantTransactionReference. Returned on the field taxCalculationId. An identical retry (same calculation, same reference) returns 200 with the existing transaction instead.
400
invalid_state
Transaction with that merchantTransactionReference already exists - created from a different taxCalculationId. Returned on the field merchantTransactionReference. An identical retry returns 200 with the existing transaction instead - see Idempotency.
400
invalid_state
Please activate Outpost Taxes / Tax of Record to process transactions. Returned on the field status.
400
invalid_state
The transaction comes from a customer location that is not activated by Outpost. Note this is a 400 here, not the 409 region_not_activated returned by Create Tax Calculation.
400
invalid_state
MoR product is already enabled in this region
404
not_found
Tax calculation not found
404
not_found
The merchant does not exist, or is not linked to your partner account. Both cases return 404 with an empty errors array - never 403.
Code Example
# Step 3: Store the transaction using taxCalculationId from calculate responsecurl -X POST "https://api.outpostanywhere.com/partner/api/merchants/{merchantId}/tax/transactions" \
-H "Authorization: Bearer $OUTPOST_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"taxCalculationId": "'"$TAX_CALCULATION_ID"'",
"merchantTransactionReference": "TXN-001",
"payment": {
"paymentReference": "PAY-001",
"processor": "stripe"
}
}' | jq
# Response: 200 OK with TaxTransactionResponse
Creates a refund for one or more line items in an existing transaction. Outpost nets the refund against the merchant's next direct debit.
Each refund line refunds the full remaining amount of the original line by default. To refund only part of a line, set amount on that line - a line may be refunded several times, cumulatively up to its original total. The request-level taxBehavior decides how those amounts are read: EXCLUSIVE (the default) treats them as net of tax, INCLUSIVE as gross including tax. It is ignored for lines without an amount.
Idempotent by merchantRefundReference: retrying with the same reference, transaction, and refund line items returns the already-created refund with 200. Reusing the reference against a different transaction, or with different line items or amounts, returns 400 invalid_state.
Path Parameters
Parameter
Type
Required
Description
merchantId
string
Yes
Outpost identifier of the merchant you are acting for. Returned when you create the merchant during onboarding.
Your unique refund reference. Also the idempotency key: an identical retry (same transaction and refund line items) returns the existing refund with 200; reusing it with different content returns 400.
refundDate
string
No
ISO 8601 date/time of the refund
taxBehavior
string enum
No
Allowed values: EXCLUSIVE, INCLUSIVE. Defaults to EXCLUSIVE. Sets how refund line amount values are read: EXCLUSIVE treats them as net of tax, INCLUSIVE as gross including tax. Ignored for lines without an amount.
refundLineItems
array
Yes
Array of line items to refund (minimum 1)
refundLineItems[].lineItemId
string
Yes
ID of the original line item
refundLineItems[].refundLineItemReference
string
Yes
Your unique reference for this refund item
refundLineItems[].refundReason
string
Yes
Reason for the refund
refundLineItems[].amount
string
No
Amount to refund for this line, interpreted per the request-level taxBehavior. Omit to refund the line's full remaining amount. A line may be refunded multiple times cumulatively up to its total.
Partial Refund Example
Refunds 40.00 net of tax against a line that was originally sold for 99.99. The remaining 59.99 stays refundable under a later refund reference.
The merchant does not exist, or is not linked to your partner account. Both cases return 404 with an empty errors array - never 403.
400
invalid_argument
Missing or invalid field. refundDate must match yyyy-MM-ddTHH:mm:ssZ and cannot be later than today.
400
invalid_state
Refund with that merchantRefundReference already exists - on a different transaction or with different line items/amounts. Returned on the field merchantRefundReference. An identical retry returns 200 with the existing refund instead.
Response202 Accepted - Invoice is still being generated. Retry after a short delay.
The url is a signed link that expires one hour after the response. Download the file rather than storing the link.
Error Responses
HTTP
Code
Description
404
not_found
The merchant does not exist, or is not linked to your partner account. Both cases return 404 with an empty errors array - never 403.
400
invalid_argument
transaction_id is not a valid transaction id
404
not_found
Transaction not found
Billing & collections
Your merchant keeps its PSP and its settlement. Outpost collects tax and the Tax of Record fee from the merchant directly, not from your platform.
How the money moves
The shopper pays the total from the tax calculation, including tax, through the merchant's PSP
The PSP settles the full amount, including tax, to the merchant
You create the tax transaction after the payment succeeds. Outpost becomes liable for the tax on that transaction at this point. A tax calculation alone creates no liability
Outpost periodically direct-debits the merchant for the tax on its transactions and for the Tax of Record fee
Outpost files and remits at least monthly, in the local currency each tax authority requires
Direct debit mandate
The merchant must authorize a direct debit mandate before Outpost can approve it for Tax of Record. The mandate allows Outpost to debit the merchant's bank account for tax and fees. With Hosted Onboarding, the merchant authorizes the mandate in the hosted flow.
Refunds
Outpost nets refunds against the merchant's next debit. Report refunds with Create Refund Transaction.
Merchant invoices
Outpost invoices the merchant directly and shows tax collected and the Tax of Record fee separately. This invoice is separate from any invoice you send the merchant for your own services, and from the shopper invoice returned by Get Transaction Invoice.
Pricing and partner revenue
Outpost sets the Tax of Record fee the merchant pays and pays you a revenue share, as set out in your commercial agreement. To bill the Tax of Record fee to your merchants yourself, contact your Outpost representative.
Who does what
Area
Merchant
Your platform
Outpost
Shopper payment
Receives funds through its PSP
Runs checkout and payment
Not involved
Tax calculation and transactions
Provides accurate order data
Calls the Outpost API
Calculates and records tax
Direct debit mandate
Authorizes it
Directs the merchant to authorize it
Collects and holds it
Tax and fee collection
Keeps its account funded
Not involved
Debits the merchant
Filing and remittance
Not involved
Not involved
Files and remits
Tax of Record fee invoice
Receives it
Not involved
Issues it
Checkout sequence
Authenticate, calculate, charge on your PSP, then commit. The critical handoff is round-tripping taxCalculationId through the PSP so the payment webhook can reconcile the paid order to the quote before you commit. Auth details live on Authentication, and endpoint schemas live in the API reference.
Steps
Resolve the Outpost merchantId for the merchant you are acting for
Authenticate - get/refresh an access token (cache with TTL)
Calculate - POST /partner/api/merchants/{merchantId}/tax/calculations, capture taxCalculationId, show taxAmount at checkout
Round-trip - attach taxCalculationId to the PSP payment as metadata/custom field
Pay - charge via your PSP (Stripe, Adyen, Nuvei, …)
Commit - on payment success webhook, POST /partner/api/merchants/{merchantId}/tax/transactions with taxCalculationId and payment details
Clear - e-invoice / authority clearance runs asynchronously after commit
One access token covers every merchant linked to your partner account. The merchant is chosen per request through the merchantId path parameter, so cache the token once and reuse it across merchants. You get the merchantId when you create the merchant during onboarding.
PSP round-trip
After Calculate, attach taxCalculationId to the payment request (e.g. Stripe metadata, Nuvei customField1). When the payment webhook fires, read that field back and call commit. Without the round-trip you cannot reliably connect a successful charge to the tax shown at checkout.
Pseudocode
async function processCheckout(orderData) {
const token = await getAccessToken();
const taxResponse = await calculateTax(orderData, token);
const taxCalculationId = taxResponse.taxCalculationId;
await persistCalculationMapping(orderData.orderId, taxCalculationId);
const paymentResult = await processPayment(orderData, {
amount: taxResponse.totalAmount,
metadata: { taxCalculationId },
});
// Often from the PSP webhook - only after payment succeeds
if (paymentResult.success) {
await storeTransaction({
taxCalculationId,
merchantTransactionReference: orderData.orderId,
payment: {
paymentReference: paymentResult.paymentReference,
processor: paymentResult.processor, // e.g. "stripe", "adyen", "nuvei"
},
}, token);
}
return { success: paymentResult.success, taxResponse };
}
Idempotency
merchantTransactionReference is the idempotency key for Create Tax Transaction: retrying with the same taxCalculationId and reference returns the already-created transaction with 200 - no duplicate is ever recorded
merchantRefundReference works the same way for refunds: an identical retry (same transaction, same refund line items and amounts) returns the original refund with 200
Retries are safe after a timeout or lost response - resend the exact same request body; a changed payment block on a transaction retry still replays
Reusing a reference with different content is a conflict, not a replay: a different taxCalculationId under the same reference, or different line items/amounts under the same refund reference, returns 400 invalid_state on that field
A calculation converts once. Reusing it under a different reference returns 400 invalid_state on taxCalculationId
References match exactly (case-sensitive, no trimming) - send the identical string on retry
Persist merchantTransactionReference → taxCalculationId before charging so a retry can resend the identical request; if the response is lost entirely, resolve the reference with GET /tax/transactions?merchantTransactionReference=
Error handling
Classify by HTTP status. Do not retry 4xx blindly - they are client mistakes. Token refresh on 401 is covered under Authentication.
4xx - client
401 - refresh the token and retry once (see Authentication)
400 invalid_argument - fail fast (malformed fields, legacy tax-id shapes like type "CPF" without a jurisdiction prefix)
400 missing_country_of_origin / missing_classification_text / shipping_address_required - the physical-goods contract is incomplete. Fix the cart data (see Create Tax Calculation)
400 invalid_state - calculation expired, product not activated, or a reference/calculation reused with different content (an identical retry replays with 200 instead - see Idempotency)
404 - calculation not found (check taxCalculationId on commit)
409 - configuration or coverage problem, not a client bug. Do not retry; the region, product or provider integration needs changing
422 nfse_validation_failed - Brazil NFS-e rejected the customer data. Fix the data before retrying
404 not_found - The merchant does not exist, or is not linked to your partner account. Both cases return 404 with an empty errors array - never 403.
5xx - server
Usually temporary. Retrying a read is always safe. Commit and refund writes are idempotent on their references, so retrying the identical request is safe too - a committed write replays with 200 instead of duplicating.
502 tax_provider_unavailable - the provider is temporarily down. Safe to retry with exponential backoff (e.g. 1s, 2s, 4s, with jitter)
Cap retries - typically three attempts - then fail and alert
504 request_timeout on commit - safe to retry the identical request: commit and refund are idempotent on merchantTransactionReference / merchantRefundReference, so a retry of a committed write returns the original result with 200; alternatively resolve the reference via GET /tax/transactions?merchantTransactionReference=
Tax identifiers
Identifier types are jurisdiction-prefixed: BR_CPF, BR_CNPJ, EU_VAT, GB_VAT, US_EIN - shapes without the prefix return 400 invalid_argument
CPF/CNPJ checks are format and check-digit only - a format-valid ID can still fail later at NFS-e issuance
Malformed calculate requests return a structured 400 with field-level errors - not a 500
Token refresh on 401
// On 401 response:
// 1. Clear cached token
// 2. Request new access token
// 3. Retry the original request once with new token
// 4. If still 401, fail and alert
Success rates - percentage of successful calculate/commit operations
Latency - P95/P99 response times for each endpoint
Error rates - 4xx vs 5xx error breakdown by endpoint
Token refresh frequency - monitor auth token lifecycle
Alert conditions
Success rate drops below 95%
P95 latency exceeds 2 seconds
5xx error rate exceeds 1%
Commit rate significantly lower than calculate rate
Token refresh failures
Testing & rollout
Prove calculate → round-trip → commit against staging, then enable commit gradually in production.
Environments
There are two environments, staging and production, each with its own credentials. Build and test against staging, then switch both base URLs and the credential pair to go live. There is no separate sandbox environment and no test mode within production.
Environment
API base URL
Auth base URL
Staging
https://api.outpostnow.tech
https://access.outpostnow.tech
Production
https://api.outpostanywhere.com
https://access.outpostanywhere.com
What to test
Format-valid Brazilian IDs still do not guarantee NFS-e issuance - registration is confirmed only when the e-invoice is submitted.
Auth - token acquisition and refresh
Calculate - include a valid-format tax identifier for Brazil (BR_CPF / BR_CNPJ) - omitting it can silently return zero tax
Commit - only after a successful payment, with the same taxCalculationId
Errors - exercise timeout, retry, and representative 4xx/5xx cases
Rollout
Phase 1Calculate only (commit disabled) until quotes look right
Phase 2Enable commit for 1% of successful payments
Phase 3Gradually increase to 10%, 50%, 100%
RollbackFeature flags to disable commit calls quickly if needed
Acceptance checklist
Auth token acquisition works
Token caching and refresh logic implemented
Calculate returns a taxCalculationId
taxCalculationId round-trips through the PSP and is stored with the order
Commit includes paymentReference and processor
Commit runs only after successful payment
Brazil cases include a valid-format CPF/CNPJ
Timeout and retry logic implemented
4xx fail fast; 5xx retry with backoff
Logging includes correlation IDs
Monitoring and alerting configured
Merchant is linked to your partner account before the first tax call
Ready to integrate?
Copy the complete integration plan for your AI coding assistant, or contact us for white-glove onboarding.