API Docs
API Docs
  1. Getting Started
  • Getting Started
    • Introduction to Sales Tax Calculation
    • Step By Step - Creating your first transaction
    • Step By Step - Creating VAT / Global Tax Transaction
  • Endpoints
    • Authentication
      • Authentication - Getting Started
      • Create JWT
    • Customers
      • Get to Know
      • Get Customer
      • Get All Customers
      • Upsert Customer
      • Update Customer
    • Exemptions
      • Get to Know
      • Get All Exemptions
      • Post Exemption
      • Update Exemption
      • Patch Exemption
    • Transactions
      • Get to Know
      • The Importance of Shipping Address
      • How to Use Credit Memos
      • Get Transaction (thin)
      • Get Transaction
      • Upsert Transaction
      • Delete Transaction
      • Get All Transactions (thin)
      • Get All Transactions
      • Upsert VAT / GT Transactio
    • Address Validation
      • Address Validation Intro
      • Validate Address
    • Sales Tax Rates
      • Get Sales Tax Rates
    • Vat Validation
      • Validate Vat
  • Special Features
    • Global Tax Rate
    • Partial Address
    • Discounts
    • Inclusive Tax
    • Vat Validation
    • Post exemptions from CSV
      POST
  1. Getting Started

Step By Step - Creating VAT / Global Tax Transaction

In addition of supporting United State's sales tax, we also support VAT / Global Tax. Those taxes may apply to international transactions.
In this guide we show case an example of a transaction that is being shipped to Canada.

Create Transaction#

Request#

To create a vat / gt applied transaction, take the customerId from the customer you created, and place it in this payload payload:
curl -X 'PUT' \
  'https://demo.complyt.io/v1/transactions/source/9/externalId/some-external-id' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIs....' \
  -H 'Content-Type: */*' \
  -d '{
    "complytId": null,
    "externalId": "some-external-id",
    "source": "9",
    "documentName": "some-document-name",
    "items": [
        {
            "unitPrice": 60000,
            "quantity": 2,
            "totalPrice": 120000,
            "description": "some description",
            "name": "some-name",
            "taxCode": "C1S1"
        }
    ],
    "billingAddress": null,
    "shippingAddress": {
        "country":"Canada",
        "region": "Quebec"
    },
    "customerId": {{customerComplytId}},
    "transactionStatus": "ACTIVE",
    "externalTimestamps": {
        "createdDate": "2024-05-27T09:47:57.625803",
        "updatedDate": "2024-05-27T09:47:57.625809"
    },
    "transactionType": "INVOICE",
   "shippingFee": {
        "manualSalesTax":false,
        "manualSalesTaxRate":0,
        "taxCode":"C6S1",
        "totalPrice":"100"
    },
    "transactionLevelDiscount": 0,
    "transactionFilingStatus": "NOT_FILED",
    "currency":"cad", //not mandatory
    "isTaxInclusive":false
}'
Required Fields
Field NameData TypeRequiredDescriptionExample
externalIdStringYesThe ID of the transaction in your system."ABC-123"
sourceIntegerYesDistinguishes between multiple systems. Select the relevant source number from the provided list.1
unitPriceDecimalYesThe price per unit of the item.19.99
quantityIntegerYesThe number of units purchased.2
totalPriceDecimalYesThe total price of the transaction before taxes.39.98
transactionLevelDiscountDecimalNoThe discount to apply on the overall transaction.10
taxCodeStringYesRepresents the category of the item to determine the tax rate."GST"
customerIdStringYesThe ID of the customer who made the purchase."CUST-456"
createdDateDateYesThe date the transaction was created in your system.2024-06-25
shippingAddressStringYesThe shipping address of the customer."123 Main St"
countryStringYesThe country of the customer (excluding USA)."Canada"
regionStringNoThe region or state of the customer."Ontario"
updatedDateDateYesThe date the transaction was last updated in your system.2024-06-25
createdFromStringNoReference to a previous transaction for credit memos, refunds, or sales orders."REF-789"
transactionStatusStringYesThe current status of the transaction (ACTIVE or CANCELLED). Use the DELETE endpoint for cancelled transactions."ACTIVE"

Response#

A successful request will result in a 200/201 HTTP response in the following format:
    "complytId": "{{transactionComplytId}}",
    "externalId": "some-external-id",
    "source": "9",
    "documentName": "some-document-name",
    "items": [
        {
            "unitPrice": 60000,
            "quantity": 2,
            "totalPrice": 120000,
            "calculatedTotal": 120000,
            "description": "some description",
            "name": "some-name",
            "taxCode": "C3S1",
            "jurisdictionalSalesTaxRules": {
                "name": "Canada",
                "abbreviation": "CA",
                "taxable": true,
                "specialTreatment": false,
                "calculationType": "FIXED",
                "description": "description3",
                "calculationValue": 0,
                "cities": null,
                "regions": {
                    "Quebec": {
                        "name": "Quebec",
                        "abbreviation": "Quebec",
                        "taxable": true,
                        "specialTreatment": false,
                        "calculationType": "FIXED",
                        "description": "description3",
                        "calculationValue": 0
                    },
                    "British Columbia": {
                        "name": "British Columbia",
                        "abbreviation": "British Columbia",
                        "taxable": true,
                        "specialTreatment": false,
                        "calculationType": "FIXED",
                        "description": "description3",
                        "calculationValue": 0
                    }
                }
            },
            "salesTaxRates": null,
            "gtRates": {
                "countryRate": 0.05,
                "regionRate": 0.0975,
                "taxRate": 0.1475
            },
            "manualSalesTax": false,
            "manualSalesTaxRate": 0,
            "discount": null,
            "tangibleCategory": "TANGIBLE",
            "taxableCategory": "TAXABLE"
        }
    ],
    "isTaxInclusive": false,
    "billingAddress": null,
    "shippingAddress": {
        "city": null,
        "country": "Canada",
        "county": null,
        "state": null,
        "street": null,
        "region": "Quebec",
        "zip": null,
        "isPartial": false
    },
    "customerId": "{{customerComplytId}}",
    "customer": {
        "complytId": "{{customerComplytId}}",
        "externalId": "{{customerExternalId}}",
        "source": "9",
        "name": "Customer Name",
        "address": {
            "city": "fresno",
            "country": "US",
            "county": null,
            "state": "CA",
            "street": "7498 N Remington Ave",
            "region": null,
            "zip": "93711-5508",
            "isPartial": false
        },
        "email": null,
        "customerType": "RETAIL",
        "internalTimestamps": {
            "createdDate": "2022-01-01T00:00",
            "updatedDate": "2024-03-17T14:33:16.725"
        },
        "externalTimestamps": {
            "createdDate": "2023-06-14T07:58:02.410",
            "updatedDate": "2023-06-14T07:58:02.410"
        },
        "comment": null
    },
    "salesTax": {
        "amount": 17714.7500,
        "rate": 0.14975,
        "salesTaxRates": null,
        "gtRates": {
            "countryRate": 0.05,
            "regionRate": 0.0975,
            "taxRate": 0.14975
        }
    },
    "transactionStatus": "ACTIVE",
    "internalTimestamps": {
        "createdDate": "2024-06-20T14:12:06.794024",
        "updatedDate": "2024-06-20T14:12:06.794024"
    },
    "externalTimestamps": {
        "createdDate": "2024-05-27T09:47:57.625803",
        "updatedDate": "2024-05-27T09:47:57.625809"
    },
    "transactionType": "INVOICE",
    "shippingFee": {
        "manualSalesTax": false,
        "manualSalesTaxRate": 0,
        "totalPrice": 100,
        "calculatedTotal": 100,
        "jurisdictionalSalesTaxRules": {
            "name": "Canada",
            "abbreviation": "CA",
            "taxable": true,
            "specialTreatment": false,
            "calculationType": "FIXED",
            "description": "description3",
            "calculationValue": 0,
            "cities": null,
            "regions": {
                "Quebec": {
                    "name": "Quebec",
                    "abbreviation": "Quebec",
                    "taxable": true,
                    "specialTreatment": false,
                    "calculationType": "FIXED",
                    "description": "description3",
                    "calculationValue": 0
                },
                "British Columbia": {
                    "name": "British Columbia",
                    "abbreviation": "British Columbia",
                    "taxable": true,
                    "specialTreatment": false,
                    "calculationType": "FIXED",
                    "description": "description3",
                    "calculationValue": 0
                }
            }
        },
        "salesTaxRates": null,
        "gtRates": {
            "countryRate": 0.05,
            "regionRate": 0.0975,
            "taxRate": 0.1475
        },
        "taxCode": "C6S1",
        "taxableCategory": "TAXABLE",
        "tangibleCategory": "INTANGIBLE"
    },
    "createdFrom": null,
    "taxableItemsAmount": 120100,
    "tangibleItemsAmount": 120000,
    "totalItemsAmount": 120100,
    "totalDiscount": 0,
    "transactionLevelDiscount": 0,
    "finalTransactionAmount": 120100,
    "transactionFilingStatus": "NOT_FILED",
    "currency": "cad",
    "subsidiary": null
}
Sales Tax Amount - the bottom line of our calculation, this is what you usually want to add to your invoice 🎯. After adding a transaction to Complyt’s API, you can retrieve the calculated Sales Tax Amount at salesTax.amount.
Tax Rate - the rate that was applied to the transaction. In this case, this is the final rate that was calculated for a transcation that is being shipped to Quebec, Canada. you can find the rate in salesTax.rate. You can also see the different percentages that accumulate to the final rate in salesTax.gtRates.
Previous
Step By Step - Creating your first transaction
Next
Authentication - Getting Started
Built with