Add Transaction with Local Currency

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Lets you add transactions with a different currency using the currency conversion ratio. The following are the prerequisites or checklists for the API.

Important

All monetary fields in transaction line items (such as amount, rate, value, and discount) are rounded based on the AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES configuration. If this configuration is set to a value greater than or equal to 0, the system rounds all monetary fields to the specified number of decimal places using rounding down. For example, a value of 38.98 may become 38.97 if the configuration is set to 2 decimal places.

To ensure correct storage and retrieval of decimal values in transaction APIs, set AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES to one more than the value of CONF_DECIMAL_PLACES_FOR_BASE_CURRENCY. For example, if CONF_DECIMAL_PLACES_FOR_BASE_CURRENCY is set to 2, set AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES to 3.

📘

Notes

  • Enable CONF_CURRENCY_CONVERSION_ENABLE on the Billing Configuration page of InTouch Profile > Organization Settings > Systems & Deployment > InTouch POS Configurations>Billing.
  • Configure org’s base currency and supported currencies on the Organization Setup page of InTouch Profile > Organization Settings > Organization Setup > Organization Profile.
  • If no currency code is provided, the system will use the store's default currency.
  • All monetary values should be provided in the local currency format.
  • The API automatically handles conversion between local and base currency.
  • The response includes both local and base currency values for all monetary fields.
  • Add relevant currency conversion ratios in the back-end either through /v2/currencyratio API or through Data Import.
  • The issual of points/coupon or redemption is calculated automatically as per the destination currency.
  • Negative values for transaction values such as amount, discount are not considered.

Example request

curl --location 'https://eu.api.capillarytech.com/v1.1/transaction/add_with_local_currency?format=json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGpfY2FwaWxsYXJ5OjVjMTc3MDJlOTI5NjQ4MjUzZTY3ZDJiMGM2ZTk5ZjE5' \
--header 'Cookie: _cfuvid=vExzxUfM1yVs0RkX2QTpuwcO53_TtBBvj4IQ3.2hA38-1739337355889-0.0.1.1-604800000; _cfuvid=TSCGvpdRkTXfEHaK7wh4GeeIIboDUZw.MFvq2rh0bhE-1739505014810-0.0.1.1-604800000; _cfuvid=Fa2ZZlikT6UXCljFwOpFWmmpr_ln0Nfz0KVEXjICAXM-1744170473439-0.0.1.1-604800000' \
--data-raw '{
    "root": {
        "transaction": [
            {
                "line_items": {
                    "line_item": [
                        {
                            "type": "Regular",
                            "serial": 1,
                            "value": 20,
                            "description": "Steel Bottle",
                            "item_code": "model_id_001",
                            "qty": 4,
                            "discount": 0,
                            "rate": 5,
                            "amount": 20,
                            "transaction_date": "2025-02-26 09:00:00",
                            "transaction_number": "test00transact064"
                        }    
                    ]
                },
                "type": "regular",
                "currency_code": "USD",
                "customer": {
                    "mobile": "919999988886",
                    "email": "[email protected]",
                    "firstname": "Tjuser",
                    "lastname": "Eightysix"
                },
                "credit_note": {
                    "amount": "60",
                    "notes": "Reason for credit",
                    "number": "test00transact064"
                },
                "number": "test00transact074",
                "amount": 60,
                "billing_time": "2025-04-08 17:30:00",
                "notes": "Transaction Number 74",
                "gross_amount": 60,
                "discount": 0
            }
        ]
    }
}'

Rate Limit

RegionDefault Limit (RPM)
Asia-2 (Singapore)1500
Asia-1 (N. Virginia)1500
EMEA (Ireland)700

Request Body Parameters

ParameterTypeDescription
typeEnumType of transaction. regular for loyalty transaction, ``not_interested` for non-loyalty or not-interested transactions.
credit_noteobjDetails of credit note
currency_codestringCurrency code applicable in ISO format.
notesstringAdditional information about the transaction.
qtydoubleQuantity of the current line-item.
ratefloatPrice of each line-item. This value is rounded based on the AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES configuration if set. The system rounds down to the specified number of decimal places.
valuefloatRepresents the pre-discount total for a single line item. Calculated as: value = rate × quantity. Example: If a line item has a rate of $10 and quantity of 2, value would be $20. This value is rounded based on the AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES configuration if set.
amountdoubleNet transaction amount. The actual transaction amount after discount. This value is rounded based on the AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES configuration if set.
billing_timedate-timeDate and time of the transaction. By default, the current system date and time will be considered.
gross_amountdoubleRepresents the total transaction amount before any discounts are applied. It's the sum of all line items' values before discounts. Used in calculations involving the total transaction value. This value is rounded based on the AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES configuration if set.
discountdoubleDiscount availed for the transaction (discount amount). This value is rounded based on the AMOUNT_ROUNDING_OFF_TO_DECIMAL_PLACES configuration if set.
outlier_statusEnumPass the outlier status of the transaction at transaction level, and outlier status of the line-item at line-item level.
Values: INTERNAL, NORMAL, INVALID, OUTLIER, FAILED``, DELETED, RETRO, FRAUD, TEST, OTHER```.
sourceEnumSource from which the transaction is made.
Values: INSTORE (for InStore), WECHAT (WeChat), MARTJACK (AnywhereCommerce), WEB_ENGAGE (Web-engage integration), ECOMMERCE (ECOMMERCE), JD (JD), TAOBAO (Taobao), TMALL (TMall), FACEBOOK (Facebook), WEBSITE (other website), OTHERS (any other source).
not_interested_reasonstringReason why the customer is not interested to register. Applicable only for not-interested transactions.
customerobjPass customer information. Applicable for non-loyalty and not-interested transactions.
extended_fieldsobjValid transaction level extended field details in name and value pairs. You can also pass line-item level extended field details in line_item object.

customer object

ParameterTypeDescription
mobile/email/id/external_idstringPass any of the registered identifiers of the customer. Required for regular transaction.
firstnamestringFirst name of the customer.
lastnamestringLast name of the customer.

credit_note object

ParameterTypeDescription
amountdoubleNet transaction amount of the original bill. Represents the final amount after discounts are applied. For line items: amount = value - discount. For transactions: amount = gross_amount - total_discount
notesstringAdditional information about the transaction.
number*stringUnique transaction number. The uniqueness depends on the configuration CONF_LOYALTY_BILL_NUMBER_UNIQUE_IN_DAYS set in InTouch Settings > System & Deployment > InTouch POS Configuration > Billing.
  • Note*: The maximum length for a bill number is 50 characters.

Error Codes

CodeDescription
400Bad Request - Invalid input parameters
401Unauthorized - Invalid or missing authentication
403Forbidden - Insufficient permissions
404Not Found - Resource not found
500Internal Server Error
Body Params
json
Response

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json