> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.taxcloud.com/api-v-3/guides/workflows/real-time-api/handle-exemptions/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.taxcloud.com/_mcp/server. # Handling Exemptions Sales tax exemptions apply when customers such as non-profits, resellers, and government agencies provide a valid exemption certificate. To ensure compliance, you must attach that certificate (or mark the order as exempt) when creating your cart; once an order is finalized, you cannot retroactively add exemptions. This guide walks you through: * What you need before attaching an exemption certificate * Two ways to apply an exemption: directly by certificate ID or automatically through matching. * Best practices and common errors to avoid. By following these steps, you can ensure exempt transactions are processed smoothly and remain compliant with state requirements. ## What You'll Need * A certificate already created in TaxCloud and showing an “Active” status. (Use the [Create Exemption Certificate](https://docs.taxcloud.com/api-reference/api-reference/sales-tax-api/exemption-certificate/create-exemption-certificate) endpoint if you don't have the certificate yet). * Either the certificate’s ID or enough matching data: `customerID`, destination.state, and your `connectionID`, for auto-match to work. ## Applying Exemption Certificates Once you have an active certificate, you can apply it to a cart in one of three ways: ### Option A – Direct attach by ID Add an exemption object with `exemptionID` to the same cart payload you used earlier. #### Sample Request (Python) ```py payload = { "items": [ { "currency": { "currencyCode": "USD" }, "customerId": "customer-453", "destination": { "city": "Austin", "state": "TX", "zip": "78701" }, "origin": { "city": "Austin", "state": "TX", "zip": "78701" }, "exemption": { "exemptionId": "a1b2c3d4-ID" }, "lineItems": [ { "index": 0, "itemId": "item-1", "price": 100, "quantity": 1, "tic": 0 } ] } ] } ``` TaxCloud validates the certificate ID, confirms it is active for that destination state, and returns zero tax on the response. ### Option B – Auto-match If you don’t know the certificate ID, set “exemption”: `“isExempt”: true` in your cart. TaxCloud will try to find an active certificate that matches the same `connectionID`, `customerID`, and destination state. If a match is found, tax is zeroed. If no certificate exists, the cart (and later the order) is flagged **Exempt—No certificate** and will need manual resolution before filing. ## Best Practices * Store certificate IDs in your customer profile so you can attach them explicitly and avoid auto-match surprises. * Certificates can expire; monitor expiry dates and renew as needed. * A single buyer might hold multiple, state-specific certificates—always match the destination state. * If you mistakenly mark `isExempt: true` and no valid certificate exists, TaxCloud flags the order as **Exempt—No certificate**, which must be resolved before the transaction can be filed. ## Common Errors * 400 CertificateNotValid – Invalid Certificate ID. * 422 IncorrectCertificate– Missing certificate details. ## Next Step With tax (or zero tax) confirmed, proceed to [Convert Carts to Orders](https://docs.taxcloud.com/guides/workflows/real-time-api/convert-carts-to-orders) to convert the transaction, and if complete, record the liability. For comprehensive knowledge on managing your tax exemptions, please see our [guide here](https://docs.taxcloud.com/guides/core-concepts/managing-tax-exemptions).