• Credit

    US flag
  • Credit

    US flag

Jane holds a credit card provided by XYZ fintech in partnership with ABC Bank.

Jane’s credit card statement reflected a late payment fee of $24.78 including taxes. She contacted XYZ fintech’s customer care and requested a reversal of the late payment fee. Jane is a long time customer of XYZ fintech and her transaction history did not show any defaults in the last 12 months.

The customer care executive decided to reverse the late payment fee. He then took Jane’s phone number to fetch her account details.

In this cookbook, we will see how XYZ fintech fetches Jane’s account details and reverses the charge of $24.78.

This API returns the account holder details based on a vector value like the account holder’s phone number.

GET/api/v1/ifi/{ifiID}/individualByVector/{vectorType}/{vectorValue}

In our case, Jane has shared her mobile phone number to the customer care executive. The customer care executive fetches the account holder details using the phone number.

cURL command
Switch Theme
Expand More
Copy
curl -X GET 'https://fusion.preprod.zeta.in/api/v1/ifi/140827/individualByVector/p/+914071839645' 
-H 'X-Zeta-AuthToken: {{AUTH_TOKEN}}' 
-H 'Content-Type: application/json'
Code Copied
JSON sample
Switch Theme
Expand More
Copy
{
    {
  "requestID": "78c1232f-7b15-47ca-be7e-c591e40406de",
  "id": "3cfa87dc-2ae2-43f7-9adc-3d2fa0fb1f50",
  "ifiID": 140827,
  "accountHolderProviderID": "862bb162-b5ad-4112-9d73-bb2306546a36",
  "vectors": [
      {
          "id": "001703c8-d40f-453d-b675-7f1f05954c26",
          "accountHolderID": "3cfa87dc-2ae2-43f7-9adc-3d2fa0fb1f50",
          "ifiID": 140827,
          "status": "ENABLED",
          "type": "p",
          "value": "+914071839645",
          "createdAt": "Dec 10, 2019 2:05:40 PM",
          "attributes": {
              "additionalProp1": "string",
              "additionalProp2": "string",
              "additionalProp3": "string"
          },
          "headers": {}
      }
  ],
  "type": "REAL",
  "status": "ENABLED",
  "firstName": "Jim",
  "middleName": "Hilton",
  "lastName": "Carry",
  "profilePicURL": "http://mypic.picland.somewhere.com/profile_pic.jpg",
  "gender": "Male",
  "pops": [],
  "attributes": {},
  "createdAt": {
      "date": {
          "year": 2019,
          "month": 12,
          "day": 10
      },
      "time": {
          "hour": 14,
          "minute": 5,
          "second": 40,
          "nano": 766431000
      }
  },
  "headers": {}
}

}

Code Copied

This API returns the credit account ID and other details of the accounts held by the account holder. You can use this API to validate the authenticity of the caller.

You must provide the account holder ID received in the previous step as a parameter for this API call.

GET{{rubyUrl}}/tenants/{{rubyTenantID}}/products/{{productId}}/accounts?accountHolderID={{accountHolderID}}
cURL command
Switch Theme
Expand More
Copy
curl --location --request GET 'http://ruby.internal.mum1-stage.zetaapps.in/ruby/tenants/1478259/products/2703641852851877968/accounts?accountHolderID=3cfa87dc-2ae2-43f7-9adc-3d2fa0fb1f50' \
--header 'Content-Type:  application/json' \
--header 'X-Zeta-AuthToken:  {{authToken}}'
Code Copied
JSON sample
Switch Theme
Expand More
Copy
{
[
    {
        "requestID": "dc346fd7-16ca-4465-8196-4260c2c2c645",
        "tenantID": 1478259,
        "productID": 2703641852851877968,
        "id": "dc346fd7-16ca-4465-8196-4260c2c2c645",
        "accountHolderID": "3cfa87dc-2ae2-43f7-9adc-3d2fa0fb1f50",
        "name": "Credit card account",
        "currency": "USD",
        "creditLimit": 500000,
        "sanctionedLimit": 100000,
        "openDate": "2021-05-28",
        "attributes": {
            "currency": "USD"
        },
        "flags": {
            "delinquent": false,
            "foreclosed": false,
            "debitBlocked": false,
            "dontAllowJit": false,
            "dontPostFees": false,
            "creditBlocked": false,
            "dontAllowHold": false,
            "dontAllowLien": false,
            "dontAllowMemo": false,
            "dontAssessFees": false,
            "dontAllowMandate": false,
            "dontPostInterest": false,
            "dontAssessInterest": false,
            "disableTransactionPolicyChecks": false
        },
        "statementPreferences": {
            "id": "d989f782-43ab-4ae3-8018-71f6cee86389",
            "cycleID": 5808039957060770441,
            "cycleCode": "1234567890",
            "dispatchModes": [
                "EMAIL",
                "WHATSAPP"
            ],
            "attributes": {
                "someKey": "someValue"
            }
        }
    }
]

}

Code Copied

This API returns the details of all credits and debits including interest and fees based on the account ID for a specific period.

The response contains all the transactions posted within the specific period. The customer care executive at the bank examines the response and notes down the transaction ID of the late payment fee posted in the previous payment period.

GET{{rubyUrl}}/tenants/{{tenantID}}/products/{{productId}}/accounts/{{accountId}}/postings?startDate={{startDate}}&endDate={{endDate}}
cURL command
Switch Theme
Expand More
Copy
curl --location --request GET 'http://ruby.internal.mum1-stage.zetaapps.in/ruby/tenants/1478259/products/6766553634771425672/accounts/31b88c5b-6945-4381-88fd-c97fda30f23c/postings?startDate=2021-07-30T18:30:00.000Z&endDate=2021-08-31T18:30:00.000Z' \
--header 'Content-Type: application/json' \
--header 'X-Zeta-AuthToken: {{authToken}}
Code Copied
JSON sample
Switch Theme
Expand More
Copy
[
    {
        "period": {
            "cycleID": 1161824692942121740,
            "periodID": 9151286890202853786,
            "sequenceNumber": 5,
            "periodicity": "MONTH",
            "startTime": 1627756200000,
            "endTime": 1630434600000
        },
        "postings": [
            {
                "ledgerID": 7914513225711799086,
                "postingID": 929521,
                "transactionID": "20210816130839691_190_test_CARD_PURCHASE_2_1-1-2-3-4-71-2-25",
                "postingIndex": 0,
                "recordType": "DEBIT",
                "value": {
                    "currency": "USD",
                    "amount": 2478
                },
                "remarks": "Late Fee",
                "attributes": {
                    "account.pd-id": "6766553634771425672",
                    "account.provider": "ruby",
                    "rulesApplied": "[{\"ruleID\":\"Rule-7914513225711799086\",\"version\":\"1\"}]",
                    "account.pf-id": "5074817746971024822",
                    "policies": "{8283907830563187257,8575077394616002042}",
                    "dontAssessInterest": "true",
                    "journal.self": "false",
                    "currency": "USD",
                    "dontPostInterest": "true",
                    "isP2PTransfer": "false",
                    "isForced": "false"
                },
                "categories": [
                    {
                        "categoryCode": "LateFeeUnbilled",
                        "value": 2478,
                        "recordType": "DEBIT"
                    },
                    {
                        "categoryCode": "RetailUnbilled",
                        "value": 2478,
                        "recordType": "DEBIT"
                    }
                ],
                "bookTime": 1629119319691,
                "valueTime": 1629119319691,
                "postingTime": 1629119319691
            }
        ]
    }
]
Code Copied

Reverse the transaction using the transaction ID obtained in the previous step. On successful reversal, the amount gets credited back to the customer’s account.

POST{{url}}/journal/1.0/reverseTransaction
cURL command
Switch Theme
Expand More
Copy
curl --location -g --request POST '{{url}}/journal/1.0/reverseTransaction' \
--header 'Content-Type: application/json' \
--data-raw '{
    "requestID": 1bd34e38-21f5-46ff-ae0d-af530e001962,
    "transactionID": "20210816130839691_190_test_CARD_PURCHASE_2_1-1-2-3-4-71-2-25",
    "ifiID": 162583,
    "coaID": 3302529326426037626,
    "remarks": "Reverse Late Fee",
    "voucherCode": "REVERSAL",
    "transactionTime": 1603847011000,
    "isForced": true,
    "headers": {
        "signatoryJID": "10443@zetauser.zeta.in/1",
        "signature": "AAG/SsAwRQIgSqU9PvqShx1yvoAaq8qz7THz94h13nDas0H7TeNYhmYCIQDSHxxXhbFTSNbVqBpQmN9NjdTNAKsFnCDYFl+1UJJgJw=="
    }
}'
Code Copied
JSON sample
Switch Theme
Expand More
Copy
{
    "signedDoc": {
        "ifiID": 162583,
        "coaID": 3302529326426037626,
        "requestID": "revert_7d427db5-a451-4970-8176-8b2abf0d79af_75768e6a-5303-4fd2-9c29-315b44820b95",
        "transactionID": "20210816130839691_190_test_CARD_PURCHASE_2_1-1-2-3-4-71-2-25",
        "reversedTransactionID": "20200709050911375_8823_7d427db5-a451-4970-8176-8b2abf0d79af",
        "transactionTime": 1594273880803,
        "transactionLegs": [
            {
                "recordType": "CREDIT",
                "ledgerID": 5332800998942593653,
                "isForced": false,
                "ledgerType": "ACCOUNT_HOLDER",
                "value": {
                    "currency": "USD",
                    "amount": 2478
                },
                "newBalance": {
                    "currency": "USD",
                    "amount": 124500
                },
                "noteHash": "rmUHPg==",
                "postingID": 971515,
                "redeemedCoupons": [],
                "postingTime": 1594273880822
            },
            {
                "recordType": "DEBIT",
                "ledgerID": 1999960097063831765,
                "isForced": false,
                "ledgerType": "SYSTEM",
                "value": {
                    "currency": "USD",
                    "amount": 2478
                },
                "newBalance": {
                    "currency": "USD",
                    "amount": 8782
                },
                "noteHash": "NzYadw==",
                "postingID": 619809,
                "redeemedCoupons": [],
                "postingTime": 1594273880863
            }
        ],
        "headers": {
            "signatoryJID": "300253@journal.services.olympus",
            "signature": "AAFYOrUwRQIgYab1wb+6f2Vu0G6mnHmMhagfhEu6GZ332jK1w6Jff9sCIQDundash+vTZBzag9PeTZHMRj+j2u612xP8QSlS5aw0nw=="
        }
    },
    "version": 1,
    "headers": {}
}
Code Copied