Self-checkout FAQ
Table of contents
How do I show a tax preview on my checkout page?
Before collecting payment, it’s common to show a preview of the tax amount that will be added to the transaction. Anrok’s createEphemeral endpoint can be used to generate this tax preview. This endpoint accepts the details of your transaction and returns the tax amount to collect.
To calculate tax, you first need to collect:
- The customer’s taxable address (billing or shipping address).
- The product(s) that the customer is purchasing.
- Any exemption certificates or tax identifiers (if necessary).
How do I add a finalized transaction to Anrok?
Once payment is complete, the finalized transaction can be added to Anrok using the createOrUpdate endpoint. This endpoint accepts the same transaction details as createEphemeral, but instead of just returning the tax amount to collect, this endpoint also saves the transaction in Anrok and associates it with the appropriate tax return.
How do I record refunds in Anrok?
Option 1: Update the original transaction with new transaction details.
- Use createOrUpdate endpoint to update the transaction.
This option is best when the transaction has been created recently and has not yet been added to a finalized tax return. If the transaction has been frozen for filing and can no longer be updated, this endpoint will return the response transactionFrozenForFiling
.
Option 2: Create a negative transaction for each refund. Do not modify the original transaction.
- Use createOrUpdate endpoint to create a negative transaction representing the refund.
This option is best when you prefer to see refunds represented as separate transactions in Anrok. Each time a refund is created, you can create a new negative transaction. This behavior matches the credit-note behavior of many billing systems.
Option 3: Negate the original transaction and create a new transaction with the new balance.
- Use createNegation endpoint to negate the original transaction.
- Use createOrUpdate endpoint to create a new version of the partially refunded transaction.
This option is best when you prefer to associate refunds with the original transaction instead of creating separate transactions for each refund as described in Option 2.