A quick intro for direct integration | Make your first request
Authentication
Request
Use Complyt API to obtain Auth0 bearer token. To do this, you’ll need to send a POST request to complyt token endpoint, passing your client ID and client secret in the request body. Here’s an example cURL command to do this:
curl --request POST \
--url 'https://demo.complyt.io/v1/token' \
--header 'content-type: application/json' \
--data '{
"clientId": "A414......................GsFf87t",
"clientSecret": "HHCv..............gQ491nSVed35"
}'
Response
If the request is successful, you’ll receive a JSON response that includes an access token. The access token is your bearer token, which you can use to authenticate requests to your M2M application’s API. Here’s an example response:
This API request uses the HTTP PUT method to create a new customer in the Complyt system. The request includes the customer details in the JSON payload of the request body. The-H 'Authorization: Bearer ...'header includes the access token obtained from the previous step, which is used to authenticate the request to the Complyt API.
Required Fields
externalId - The ID of the customer in your system. Note that it needs to be filled in the URL & in the body.
source (integer) - Used to distinguish between multiple systems. Go
To create a transaction, take the customerId from the customer you created in the previous request and place it in the
(We are working on a single request that creates a transactions and a customer, once it’s available all clients will be updated)
tax_code - This is a tax code that represents the category of the item. This is used to determine the tax rate.
customerId -
createdDate - the date the transaction was created in your system.
updatedDate - the date the transaction was last updated in your system.
createdFrom - This is a reference to previous transaction. This is used to credit memos, refunds & sales orders
transactionStatus
ACTIVE
CANCELLED - For Cancelled Transaction status please use the DELETE endpoint
Response
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
A successful request will result in a 200/201 HTTP response in the following format: