• Credit

    US flag
  • Credit

    US flag

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

Jane contacted XYZ fintech’s customer care service and requested them to mail her a hard copy of her previous month’s credit card statement. She shared her full name, phone number, and email address with the customer care executive.

XYZ fintech’s business policy allows them to collect a fee of $5 for mailing hard copies of the credit card account statements.

In this cookbook, we will see how XYZ fintech fetches Jane’s account details and records the fee of $5 as a miscellaneous debit.

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}
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": "Jane",
  "middleName": "Hilton",
  "lastName": "Carry",
  "profilePicURL": "http://mypic.picland.somewhere.com/profile_pic.jpg",
  "gender": "Female",
  "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 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

Posts a debit transaction for a specific amount, $5 in our case.

POST{{rubyUrl}}/tenants/{{tenantId}}/products/{{productId}}/accounts/{{accountId}}/debits
cURL command
Switch Theme
Expand More
Copy
curl -X POST "https://ruby.internal.mum1-pp.zetaapps.in/ruby/tenants/1478259/products/2703641852851877968/accounts/dc346fd7-16ca-4465-8196-4260c2c2c645/debits" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 -d {
    "requestID": "d573ab86-25a3-11ec-9621-0242ac130002",
    "systemLedgerID": "3510506205318709231",
    "remarks": "Towards foreclosure adjustment",
    "categoryType": "CASH",
    "value": {
        "amount": 500,
        "currency": "USD"
    },
    "bookTime": "2021-01-30 08:30:00",
    "valueTime": "2021-01-30 08:30:00",
    "attributes": {}
}
Code Copied
JSON sample
Switch Theme
Expand More
Copy
{
    "requestID": "d573ab86-25a3-11ec-9621-0242ac130002",
    "transactionID": "12345184-bd0b-4181-9674-126dd5f072bc",
    "status": "SUCCESS"
}
Code Copied