Skip to content
Gallery
API | Direct Integration Guides
Share
Explore
API | Direct Integration Guides

icon picker
Understanding Complyt API: From Transactions to Refunds

The Complyt API offers a range of functions to ensure that transactions are handled accurately and efficiently. We have gathered comprehensive guidelines on how to effectively employ the API for managing transaction processes and refunds.

1. Introduction

Complyt's API is primarily designed to handle transactions decoupled from the actual payment, especially in terms of sales tax. The distinct phases of transaction, such as creation of invoices and recording of refunds, are catered through specific API calls.

2. Payment Transaction Process

When a payment is about to be processed:
Send a PUT /transaction request before the buyer completes the transaction.
No subsequent request is needed to confirm a payment was successful. The invoicing process does not rely directly on the payment.
It's worth noting that an invoice might be issued, inclusive of sales tax, days or even weeks before the payment is processed. However, the sales tax is reported as soon as the invoice is raised.

3. Handling Payment Failures

In the event that a payment fails:
Cancel the invoice using the DELETE method. This will cancel the invoice in the Complyt system.

4. Managing Payment Refunds

In case a payment refund is issued:
Initiate a PUT /transaction call.
Use the same payload details as before (Items, amounts, customer details, etc.).
Adjust the transaction type to 'REFUND'.
Ensure the dates reflect the current scenario and do not repeat the dates from the original transaction.
It is also beneficial to utilize the 'createFrom' field, indicating the original transaction that the refund pertains to. This aids in reconciliation and ensures clarity.

5. Transaction Status (Optional)

Once payment has been processed:
An optional PUT /transaction call can be made to alter the status to 'PAID'.
Use the same payload details as before (Items, amounts, customer details, etc.) - change
This step isn't obligatory but can be useful for businesses that prefer to keep a detailed record of their transactions within the Complyt system.

6. Understanding Tax Calculations

Tax calculations can be intricate, considering factors such as address and product type (defined by tax codes).
The GET rates endpoint only requires an address and provides a basic sales tax rate.
In contrast, the PUT Transaction method takes multiple inputs, including address and an array of line items with respective tax codes. This results in a more precise tax calculation.
Example: Imagine a business located in New York City selling both electronics and clothing. While the basic sales tax rate for New York City might be 8.875%, there are nuances to consider:
An electronic item like a laptop might be taxed at the full 8.875%.
Clothing items priced under $110, however, are exempt from New York's state sales tax, meaning they might be taxed at a lower rate or not at all.
Using the PUT Transaction method, the business can input the address (New York City) and an array of line items that includes both a laptop (with its electronic tax code) and a shirt (with its clothing tax code). The Complyt API will then return the appropriate tax rate for each item, providing a comprehensive and accurate tax calculation for the entire transaction.
For a more direct and simplified calculation:
Use the ESTIMATE transaction type through the PUT method. This provides a full calculation and incorporates the tax code, without needing to be reported as a taxable sale.

7. Conclusion

Navigating the intricacies of tax implications during transactions can be challenging. With Complyt's API, businesses have a streamlined approach to ensure accuracy and efficiency in this crucial aspect of their operations. Utilizing the aforementioned guidelines will assist businesses in maximizing the potential of the API, leading to smoother financial operations.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.