PeptidesPayment Docs
Payment ContainerTax

Get the sales-tax / VAT rate for a ship-to address

POST/tax/calculate

Returns the tax rate (a fraction, e.g. 0.07 = 7%) for a ship-to address, computed with our own engine - the same combined state + county + city + district rate (statutory VAT outside the US) that the post-payment verifier uses.

How to use it

  1. Send the buyer's shipping_address (address only - no items or amounts).
  2. We return tax_rate.
  3. Compute tax = round(tax_rate × taxable_base), where the base is the items subtotal (net of discounts) + shipping, only where the destination taxes freight.
  4. Display the computed tax to the buyer as its own labeled line item (for example "Tax" or "VAT") in the checkout totals before payment - do not fold it silently into the grand total. The buyer must be able to see the amount they are being charged as tax.
  5. Charge the buyer, then send that same tax back on the order in merchant_supplied_totals.tax_cents.

Because the quote and the post-payment verification run the same engine, charging this number means no tax-shortfall correction is applied to your payout. A tax-free destination returns tax_rate: 0 - collect no tax.

override_enabled tells you whether PeptidesPayment expects to apply this tax for you: false means your store is configured to compute its own tax, so leave your own tax in place and ignore tax_rate. It is true for every other store (including tax-free destinations, where tax_rate is 0).

Authorization

ApiKeyAuth
x-api-key<token>

Your API key, issued by PeptidesPayment. Send it in the x-api-key header. Keep it server-side and never expose it in browser code.

In: header

Header Parameters

x-merchant-id*string

Your merchant id, supplied by PeptidesPayment at integration time.

Request Body

application/json

Request body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/tax/calculate" \  -H "x-merchant-id: string" \  -H "Content-Type: application/json" \  -d '{    "shipping_address": {      "address_1": "1 Main St",      "city": "Miami",      "province": "FL",      "postal_code": "33101",      "country_code": "US"    }  }'
{  "quote_id": "string",  "tax_rate": 0,  "jurisdiction": "string",  "override_enabled": true}