Skip to main content

Redirect the Customer to TaxWisp Portal

Enable customers to request tax exemption by securely redirecting them from your ecommerce application to the TaxWisp Customer Portal.


Overview​

This integration allows your application to redirect customers to TaxWisp, where they can securely complete and submit their tax exemption documents.

Integration Flow​

  1. Customer clicks Request Tax Exemption in your application.
  2. Your backend calls the TaxWisp Customer Session API.
  3. TaxWisp returns a secure redirectUrl.
  4. Your frontend redirects the customer to the TaxWisp Customer Portal.
  5. Customer uploads and submits tax exemption documents through TaxWisp.

Important: The API request must be made from your server/backend because it requires your TaxWisp API key (X-TaxWisp-Api-Key). Never expose this key in frontend code.


Step 1: Create a Customer Session​

Create a customer session using the TaxWisp Integration API.

Endpoint​

POST https://taxwisp.ai/api/v1/external/customer-sessions

Authentication​

Pass your TaxWisp Client Secret as an API key in the request header.

HeaderValue
Content-Typeapplication/json
X-TaxWisp-Api-KeyYOUR_CLIENT_SECRET

Request Body​

{
"customerId": "customer-12345",
"customerEmail": "customer@example.com"
}

Request Parameters​

FieldTypeRequiredDescription
customerIdStringYesYour unique customer identifier.
customerEmailStringYesCustomer's email address.

Step 2: Handle the API Response​

If the request is successful, TaxWisp returns a secure redirect URL.

Success Response​

{
"redirectUrl": "https://customer.taxwisp.ai/session/abc123...",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Response Fields​

FieldDescription
redirectUrlSecure URL that redirects the customer into the TaxWisp Customer Portal.
tokenSession token generated by TaxWisp. This value is not required for this integration and can be ignored.

Note: Only redirectUrl is needed for the redirect flow.


Step 3: Redirect the Customer​

Return the redirectUrl from your backend to your frontend.

Frontend Example​

window.location.href = redirectUrl;

This redirects the customer into the TaxWisp Customer Portal.


Example Integration​

Backend Example (Node.js / Express)​

app.post("/api/request-tax-exemption", async (req, res) => {
const response = await fetch(
"https://taxwisp.ai/api/v1/external/customer-sessions",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-TaxWisp-Api-Key": process.env.TAXWISP_CLIENT_SECRET
},
body: JSON.stringify({
customerId: req.body.customerId,
customerEmail: req.body.customerEmail
})
}
);

const data = await response.json();

res.json({
redirectUrl: data.redirectUrl
});
});

Frontend Example​

async function requestTaxExemption(customerId, customerEmail) {
const response = await fetch("/api/request-tax-exemption", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
customerId,
customerEmail
})
});

const { redirectUrl } = await response.json();

window.location.href = redirectUrl;
}

Customer Experience​

After redirecting to TaxWisp, the customer completes the tax exemption workflow.

StepCustomer Action
1Clicks Request Tax Exemption.
2Is redirected securely to the TaxWisp Customer Portal.
3Selects the applicable tax exemption jurisdiction.
4Uploads exemption certificates and supporting documents.
5Reviews and submits the exemption request.

TaxWisp handles document collection and submission securely.


Security Best Practices​

  • Always call the Customer Session API from your backend.
  • Never expose your X-TaxWisp-Api-Key or client secret in frontend code or mobile applications.
  • Only return the redirectUrl from your backend to your frontend.
  • Use HTTPS for all communication between your application and TaxWisp.

API Summary​

MethodEndpointPurpose
POST/api/v1/external/customer-sessionsCreate a secure TaxWisp customer session and receive a redirect URL.