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
- Customer clicks Request Tax Exemption in your application.
- Your backend calls the TaxWisp Customer Session API.
- TaxWisp returns a secure
redirectUrl. - Your frontend redirects the customer to the TaxWisp Customer Portal.
- 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.
| Header | Value |
|---|---|
Content-Type | application/json |
X-TaxWisp-Api-Key | YOUR_CLIENT_SECRET |
Request Body
{
"customerId": "customer-12345",
"customerEmail": "customer@example.com"
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
customerId | String | Yes | Your unique customer identifier. |
customerEmail | String | Yes | Customer'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
| Field | Description |
|---|---|
redirectUrl | Secure URL that redirects the customer into the TaxWisp Customer Portal. |
token | Session token generated by TaxWisp. This value is not required for this integration and can be ignored. |
Note: Only
redirectUrlis 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.
| Step | Customer Action |
|---|---|
| 1 | Clicks Request Tax Exemption. |
| 2 | Is redirected securely to the TaxWisp Customer Portal. |
| 3 | Selects the applicable tax exemption jurisdiction. |
| 4 | Uploads exemption certificates and supporting documents. |
| 5 | Reviews 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-Keyor client secret in frontend code or mobile applications. - Only return the
redirectUrlfrom your backend to your frontend. - Use HTTPS for all communication between your application and TaxWisp.
API Summary
| Method | Endpoint | Purpose |
|---|---|---|
POST | /api/v1/external/customer-sessions | Create a secure TaxWisp customer session and receive a redirect URL. |