Tax Implementation

Tax integration

📘

Steps to enable tax integration

  1. Obtain tax product code for your business.
  2. Configure account to enable tax integration.
  3. Add address to the customer record.
  4. Call the Tax API to compute sales tax for a customer with the invoice amount.

Tax Product Codes

Get a list of all tax product codes and pick one for your business.
View API Reference

curl --location --request GET 'https://app.amberflo.io/tax/product-codes' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: xyz' \
--data-raw ''

Response from API

[
  {
    "name": "Cloud-based platform as a service (PaaS) - Business Use",
    "productCode": "81162100A9000",
    "description": "Cloud-based platform as a service (PaaS) - Business Use"
  },
  {
    "name": "Cloud-based infrastructure as a service (IaaS) - Personal Use",
    "productCode": "81162200A0000",
    "description": "Cloud-based Infrastructure as a service (IaaS) - Personal Use"
  },  
  ....
]

Account Configuration

Enable tax integration at the account level.

PropertyTypeFunction
enableTaxIntegration booleanEnables tax integration
address {
"line1": "420 W Surf St",
"city": "Chicago",
"state": "IL",
"postalCode": "60657",
"country": "US"
},
Account's address. This address will be validated and scrubbed.
taxProductCode stringSee previous section.
curl --location --request PUT 'https://app.amberflo.io/account-setting' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: xyz' \
--data-raw '
    {
        "roles": [
            "Engineering"
        ],
        "onboardingStatus": {
            "createdMeter": "214eb8d0-0a1d-11ed-8a50-c739fc9818e0",
            "activeStep": 2,
            "createdCustomer": "a.1",
            "isCompleted": true
        },
        "plansView": true,
        "promotionsView": false,
        "revenueExplorerView": true,
        "id": "833c72f0-5869-11ec-9ae4-035fecbb447b",
        "billingView": true,
        "priceModelingView": true,
        "enableTaxIntegration": true,
        "address": {
        	"line1": "4500 Great America Parkway",
        	"postalCode": "95054",
        	"city": "Santa Clara",
        	"state": "CA",
        	"country": "US"
    		},
        "taxProductCode": "81162100A9000"
    }'

Customer Setup

Update customer record with address.
View Api Reference

curl --location --request PUT 'https://app.amberflo.io/customers' \
--header 'X-API-KEY: xyz' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customerName": "Stark Industries",
    "enabled": true,
    "updateTime": 1657649484123,
    "createTime": 1645807328893,
    "customerEmail": "[email protected]",
    "id": "eda5be25-f145-4448-b85c-6dc6dce1a2ac",
    "customerId": "eda5be25-f145-4448-b85c-6dc6dce1a2ac",
    "address": {
        "line1": "1 N State St",
        "city": "Chicago",
        "state": "IL",
        "postalCode": "60602",
        "country": "US"
    }
}'

Compute Tax for Invoice Amount and Customer

Call Tax API for a customer with the invoice amount.
View API Reference

curl --location --request POST 'https://app.amberflo.io/tax' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: xyz' \
--data-raw '{
    "customerId": "eda5be25-f145-4448-b85c-6dc6dce1a2ac",
    "totalAmount": 7000
}'

Response below:

{
    "taxedOwed": 87.5,
    "taxableAmount": 7000,
    "totalAmount": 7000,
    "customerAddress": {
        "line1": "1 N State St",
        "line2": "",
        "postalCode": "60602-3302",
        "city": "Chicago",
        "state": "IL",
        "country": "US"
    },
    "accountAddress": {
        "line1": "4500 Great America Parkway",
        "line2": "",
        "postalCode": "95054-1283",
        "city": "Santa Clara",
        "state": "CA",
        "country": "US"
    },
    "productTaxCode": "81162100A9000",
    "taxRate": 0.0125,
    "taxSource": "origin",
    "customerId": "eda5be25-f145-4448-b85c-6dc6dce1a2ac"
}