Transaction Policies
Transaction Category
Transactions on which policies are applied must be grouped before the actual policy is created and mapped. This is done by creating a Transaction Category and specifying the grouping criteria.
API Parameters:
code
: Unique alphanumeric ID for the Transaction Category.attrKey
: System generated key that defines the grouping criteria. Used in conjunction withattrVal
parameter. Example: super-card.txn-type for grouping transactions based on transaction type.attrVal
: Value according to the key mentioned inattrKey
. Example: ECOM for e-commerce transaction category.txnCategoryComparator
: Transaction Category comparator. Supported values:
-EQUALS
: Exact match.
-CONTAINS
: substring match.
Example: Create and assign a Transaction Category for an Account Holder, based on the following criteria:
- Apply user level transaction policy on ECOM transaction.
- Apply user level transaction 4. category on merchant level.
- Apply user level transaction category on POS/ATM transaction.
Create Transaction Category
Below are the list of mandatory parameters that need to be added in the request body:
Parameters | Description |
---|---|
X-Zeta-AuthToken | It should be same as mentioned in the prerequisite table. |
ifiID | Unique identifier of the IFI. |
accountHolderId | Individual id received while creating an account holder. |
code | code is unique for every request. |
transactionAttributes | attrKey, attrVal, txnCategoryComparator need to be passed for the user. |
curl --location --request POST 'https://fusion.gw.zetapay.in/api/v1/ifi/304876/accountHolders/530ac1a8-99a1-4c2a-962f-71a37087fed1/transactionCategories' \
--header 'X-Zeta-AuthToken: {{token}}' \
--header 'Cookie: {{cookie}}' \
--data-raw '{
"ifi": 304876,
"accountHolderId": "530ac1a8-99a1-4c2a-962f-71a37087fed1",
"code": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"description": "Group to identify ECOM transactions",
"transactionAttributes": [
{
"attrKey": "super-card.txn-type",
"attrVal": "ECOM",
"txnCategoryComparator": "EQUALS"
}
]
}'
Get Transaction Category by Code
Below are the list of mandatory parameters that need to be added in the request body:
Parameters | Description |
---|---|
X-Zeta-AuthToken | It should be same as mentioned in the prerequisite table. |
ifiID | Unique identifier of the IFI. |
accountHolderId | Individual id received while creating an account holder. |
curl --location --request GET 'https://fusion.gw.zetapay.in/api/v1/ifi/304876/accountHolders/530ac1a8-99a1-4c2a-962f-71a37087fed1/transactionCategory' \
--header 'X-Zeta-AuthToken: {{token}}' \
--header 'Cookie: {{cookie}}'
Create Transaction Policy
This API returns created transaction policies. Below are the list of mandatory parameters that need to be added in the request body:
Parameters | Description |
---|---|
X-Zeta-AuthToken | It should be same as mentioned in the prerequisite table. |
ifiID | Unique identifier of the IFI. |
accountHolderID | This is received as a response to newIndividual API. |
code | code is unique for every request. |
curl --location --request POST 'https://fusion.gw.zetapay.in/api/v1/ifi/304876/accountHolders/530ac1a8-99a1-4c2a-962f-71a37087fed1/transactionPolicies' \
--header 'X-Zeta-AuthToken: {{token}}' \
--header 'Cookie: {{cookie}}' \
--data-raw '{
"code": "ECOM_TXN_CODE_AB_TEST_POL_03",
"description": "Apply eCOM limits on account holder",
"scope": "AGGREGATE_OF_ALL_ACCOUNTS_OF_ACCOUNT_HOLDER",
"coaID": 6221687368577586252,
"transactionConstraints": [
{
"action": "DEBIT",
"allowedTransactionCategoryCodes": ["*"],
"disallowedTransactionCategoryCodes": [],
"allowedTimeSlices": [],
"disallowedTimeSlices": [],
"errorCode": "GENERIC_ERROR"
}
],
"transactionRules": [
{
"action": "DEBIT",
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"minRequiredAmount": 100,
"maxAllowedAmount": 200000,
"errorCode": "GENERIC_ERROR"
}
],
"balanceRules": [
{
"action": "DEBIT",
"minRequiredBalanceAfter": 10000,
"maxAllowedBalanceAfter": 1000000,
"minRequiredBalanceBefore": 10000,
"maxAllowedBalanceBefore": 1000000,
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"errorCode": "GENERIC_ERROR"
}
],
"aggregateRules": [
{
"action": "DEBIT",
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"aggExpressionCode": "1",
"dailyLimit": 10000,
"weeklyLimit": 70000,
"monthlyLimit": 300000,
"quarterlyLimit": 900000,
"yearlyLimit": 3600000,
"errorCode": "GENERIC_ERROR",
"type": "VOLUME"
},
{
"action": "DEBIT",
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"aggExpressionCode": "3",
"dailyLimit": 10,
"monthlyLimit": 200,
"yearlyLimit": 360,
"errorCode": "GENERIC_ERROR",
"type": "VELOCITY"
}
],
"effectiveFrom": "2020-09-01T00:00:00.000Z",
"expiresAt": "2020-12-31T00:00:00.000Z",
"violationAction": "DECLINE_AND_NOTIFY",
"attributes": {
"dummy-attribute-key": "dummy-attribute-value"
},
"accountsApplicableTo": {
"account.pd-id": "6178734290235544095"
}
}'
Get Transaction Policy
This API is used to retrieve the list of transaction policies which are implemented for a particular account holder.
curl --location --request GET 'https://fusion.gw.zetapay.in/api/v1/ifi/304876/accountHolders/530ac1a8-99a1-4c2a-962f-71a37087fed1/transactionPolicies/6424111537295695576' \
--header 'X-Zeta-AuthToken: {{token}}' \
--header 'Cookie: {{cookie}}' \
--data-raw ''
Update Transaction Policy
This API is used to update the transaction policies. Below are the list of mandatory parameters that need to be added in the request body:
Parameters | Description |
---|---|
X-Zeta-AuthToken | It should be same as mentioned in the prerequisite table. |
ifiID | Unique identifier of the IFI. |
accountHolderID | This is received as a response to newIndividual API. |
code | code is unique for every request. |
curl --location --request PUT 'https://fusion.gw.zetapay.in/api/v1/ifi/304876/accountHolders/530ac1a8-99a1-4c2a-962f-71a37087fed1/transactionPolicies/6424111537295695576' \
--header 'X-Zeta-AuthToken: {{token}}' \
--header 'Cookie: {{cookie}}' \
--data-raw '{
"code": "ECOM_TXN_CODE_AB_TEST_POL_02",
"description": "Apply eCOM limits on account holder",
"scope": "AGGREGATE_OF_ALL_ACCOUNTS_OF_ACCOUNT_HOLDER",
"coaID": 6221687368577586252,
"transactionConstraints": [
{
"action": "DEBIT",
"allowedTransactionCategoryCodes": ["ECOM_TXN_CODE_AB_TEST_CAT_02"],
"disallowedTransactionCategoryCodes": [],
"allowedTimeSlices": [],
"disallowedTimeSlices": [],
"errorCode": "GENERIC_ERROR"
}
],
"transactionRules": [
{
"action": "DEBIT",
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"minRequiredAmount": 100,
"maxAllowedAmount": 20000,
"errorCode": "GENERIC_ERROR"
}
],
"balanceRules": [
{
"action": "DEBIT",
"minRequiredBalanceAfter": 10000,
"maxAllowedBalanceAfter": 1000000,
"minRequiredBalanceBefore": 10000,
"maxAllowedBalanceBefore": 1000000,
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"errorCode": "GENERIC_ERROR"
}
],
"aggregateRules": [
{
"action": "DEBIT",
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"aggExpressionCode": "1",
"dailyLimit": 10000,
"weeklyLimit": 70000,
"monthlyLimit": 300000,
"quarterlyLimit": 900000,
"yearlyLimit": 3600000,
"errorCode": "GENERIC_ERROR",
"type": "VOLUME"
},
{
"action": "DEBIT",
"transactionCategoryCode": "ECOM_TXN_CODE_AB_TEST_CAT_02",
"aggExpressionCode": "3",
"dailyLimit": 10,
"monthlyLimit": 200,
"yearlyLimit": 360,
"errorCode": "GENERIC_ERROR",
"type": "VELOCITY"
}
],
"effectiveFrom": "2020-10-01T00:00:00.000Z",
"expiresAt": "2020-12-31T00:00:00.000Z",
"violationAction": "DECLINE_AND_NOTIFY",
"attributes": {
"dummy-attribute-key": "dummy-attribute-value"
},
"accountsApplicableTo": {
"account.pd-id": "6178734290235544095"
}
}'