# Loan Issuance APIs

<br />

## InitiateChallenge

This api initiates customer challenge from FI for specified context
using the specified challenge mechanism.
Currently we are defining only OTP as the challenge mechanism,
but can be extended to any new medium.

**Endpoint**

    POST v1/financialservices/user/initiateChallenge

### InitiateChallengeRequest

Request to bank to generate challenge token.

**For submitting application**

    {
      "requestHeader": {...},
      "data": {
        "userIdentifier": {
          "phoneNumber" : {
            "countryCode": "91",
            "nationalNumber": "9876543210"
          }
        },
        "challengeMechanism" : [
          {
            "type" : "SMS_OTP"
          },
          {
            "type" : "EMAIL_OTP"
          }
        ],
        "challengeContext" : {
          "submitApplicationContext": {}
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [InitiateChallengeRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateChallengeRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### InitiateChallengeRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Only one | Unique Identification for user. If the offerID is used by Partner to query the details, then the UserIdentifier can be ignored. |
| challengeContext | [CustomerChallengeContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CustomerChallengeContext) | Only one | Context sent by Google to bank. Authentication token is validated against this context reason and UserIdentifier. This will provide additional information for initiating the challenge that can be used by the partner to take action specific to the user journey step. |
| challengeMechanism | [InitiateChallengeRequest.Data.ChallengeMechanism](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateChallengeRequest.Data.ChallengeMechanism) | Only one | List of challenge mechanism type |

### InitiateChallengeResponse

Response from bank for generated challenge token call.

    {
      "responseHeader": { ... },
      "data": {
        "tokenReferenceId": "unique_reference_id",
        "tokenMetadata": {
          // oneof depending on the challenge mechanism.
          "smsOtpMetadata": {
            "format": {
              "length": 6,
              "messageRegex": "(\\d{6}) is OTP for your Credit application
                               through Google Pay app. OTPs are SECRET.
                               DO NOT disclose it to anyone.
                               Bank NEVER asks for OTP.",
            }
          }
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [InitiateChallengeResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateChallengeResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### InitiateChallengeResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| tokenReferenceId | string | Only one | A unique reference ID for this challenge initiation. This will be passed back while verifying the token, which can be used by the partner for correlation. |
| tokenMetadata | [InitiateChallengeResponse.Data.TokenMetadata](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateChallengeResponse.Data.TokenMetadata) | Only one | OTP message format. |

## ApproveUserForCredit

Send over all necessary information to trigger the risk assessment
process for an applicant.

The operation is asynchronous. The status of the approval process
can be periodically requested by Google using the
`GetApprovalStatus()` call.

**Endpoint**

    POST v1/financialservices/credit/offer/approveUser

### ApproveUserForCreditRequest

Request to bank to start approval process.

    {
      "requestHeader": {...},
      "data": {
        "googleApplicationId": "AB2134",
        "cKycId": "aabd123214214", // this field is present if
                                   // a CkycSearch call was made
        "productId": "AB2134",
        "challenge": {
          "tokenReferenceId": "unique_reference_id",
          "tokens": [
            {
              "type": "SMS_OTP",
              "value": "12345"
            } // more repetitions if provided
          ]
        },
        "userIdentifier": {
          "phoneNumber" : {
            "countryCode": "91",
            "nationalNumber": "9876543210"
          }
        },
        "loanDetails" : { // mandatory
          "amount": {
            "currencyCode": "INR",
            "amountMicros": 10000
          },
          "loanPurpose": "ONE_OF_LOAN_PURPOSE_STRINGS" // mandatory
        },
        "user": {
          "fullName": "Bruce Wayne", // mandatory
          "emailAddress":"bruce@gmail.com", // mandatory
          "type":"NEW_TO_BANK",
          "deviceLocation": { // optional
               "latitude": 123.213,
               "longitude": -75.436,
               "accuracy": 10
           }
          "addresses": [
           {  // mandatory
            "addressLine1": "101, building name",
            "addressLine2": "west of main road",
            "addressLine3": "west of main road",
            "landmark": "near famous watertower",
            "postalCode": "123456",
            "city": "somecity",
            "state": "somestate",
            "country": "somecountry",
            "addressTags": ["RESIDENTIAL_ADDRESS", "COMMUNICATION_ADDRESS"],
            "geoLocation": { // the geoLocation object is optional
               "latitude": 123.213,
               "longitude": -75.436
            }
          },{ // mandatory
            "companyName": "ABC",
            "addressLine1": "101, building name",
            "addressLine2": "west of main road",
            "addressLine3": "west of main road",
            "landmark": "near famous watertower",
            "postalCode": "123456",
            "city": "somecity",
            "state": "somestate",
            "country": "somecountry",
            "addressTags": ["OFFICE_ADDRESS"],
            "geoLocation": { // the geoLocation object is optional
               "latitude": 13.213,
               "longitude": 47.436
            }
          },
          { // optional, only if "residenceOwnership" is "RENTED"
            "companyName": "ABC",
            "addressLine1": "101, building name",
            "addressLine2": "west of main road",
            "addressLine3": "west of main road",
            "landmark": "near famous watertower",
            "postalCode": "123456",
            "city": "somecity",
            "state": "somestate",
            "country": "somecountry",
            "addressTags": ["PERMANENT_ADDRESS"],
            "geoLocation": { // the geoLocation object is optional
               "latitude": 12.213,
               "longitude": 77.436
            }
          }
          ],
          "pan": "PAQ123453", // mandatory
          "dateOfBirth": "1970-07-22", // mandatory
          "employmentInfo": {
            "employerName": "Toyota",  // mandatory
            "employerAddress": { // mandatory
              "addressTags": ["OFFICE_ADDRESS","COMMUNICATION_ADDRESS"],
              "companyName":"Aaa",
              "addressLine1": "101, building name",
              "addressLine2": "west of main road",
              "addressLine3": "west of main road",
              "landmark": "near famous watertower",
              "postalCode": "123456",
              "city": "somecity",
              "state": "somestate",
              "country": "somecountry",
              "geoLocation": { // the geoLocation object is optional
                 "latitude": 123,
                 "longitude": -47.436
              }
            },
            "workExperience": {
              "totalWorkExperienceYears": "4", // mandatory
            },
            "income": { // mandatory
               "periodType": "MONTH",
               "value": {
                 "currencyCode": "INR",
                 "amountMicros": 35000000000,
               }
             },
             "employmentType": {
               "salaried": {}
             }
          },
          "residenceInfo": { // mandatory
            "timeAtCurrentResidence": "20",
            "residenceOwnership": "RENTED" // or "OWNED"
          },
          "father": {
            "firstName": "Thomas",
            "lastName": "Wayne",
            "salutation": "MR", // one of MR, DR
          }, // mandatory
        }
        "extension": {
          "enabledFlags": [
            "eligibleForIncomeVerification",
          ]
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [ApproveUserForCreditRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### ApproveUserForCreditRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| googleApplicationId | string | Only one | A Google generated id for the request. |
| productId | string | Only one | Which product is the credit approval targeting. |
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Only one | Identifier for the user. |
| user | [ApproveUserForCreditRequest.Data.User](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditRequest.Data.User) | Only one | User details for the credit approval. |
| challenge | [Challenge](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Challenge) | Only one | Otp challenge. |
| loanDetails | [ApproveUserForCreditRequest.Data.LoanDetails](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditRequest.Data.LoanDetails) | Only one |   |
| cKycId | string | Zero or one | CKYC Id which was returned in the response SearchCKyc API. |

### ApproveUserForCreditResponse

Response from the bank for the start of the approval process.

    HTTP 200 OK

    # The approval application is in process state.
    {
      "responseHeader": { ... },
      "data": {
        "applicationState" : "IN_PROCESS",
        "partnerApplicationReferenceId": "123456",
        "inProcessStateContext": {}
      }
    }

    # The approval application is in income verification state.
    {
      "responseHeader": { ... },
      "data":  {
        "applicationState": "INCOME_VERIFICATION",
        "partnerApplicationReferenceId": "123456",
        "incomeVerificationContext": {}
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [ApproveUserForCreditResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### ApproveUserForCreditResponse.Data

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | applicationState | [CreditApprovalApplicationStateInfo.State](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.State) | Only one |   |
| Only one of these fields can be present | inProcessStateContext | [CreditApprovalApplicationStateInfo.InProcessStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.InProcessStateContext) | Zero or one |   |
| Only one of these fields can be present | approvedStateContext | [CreditApprovalApplicationStateInfo.ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.ApprovedStateContext) | Zero or one |   |
| Only one of these fields can be present | rejectedStateContext | [CreditApprovalApplicationStateInfo.RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.RejectedStateContext) | Zero or one |   |
| Only one of these fields can be present | incomeVerificationStateContext | [CreditApprovalApplicationStateInfo.IncomeVerificationStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.IncomeVerificationStateContext) | Zero or one |   |
|   | partnerApplicationReferenceId | string | Only one |   |

## GetApprovalStatus

> > [!NOTE]
> > **Note:**
>
> - If the user is not eligible for credit at all, rejected state must be accompanied by rejection reasons.
> - The offer provided in the response will be pre-approved.

**Endpoint**

    POST v1/financialservices/credit/offer/approveUser/getStatus

### GetApprovalStatusRequest

Request the bank to share the approval status.

    {
      "requestHeader": {...},
      "data": {
        "googleApplicationId": "AB2134",
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [GetApprovalStatusRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetApprovalStatusRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### GetApprovalStatusRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| googleApplicationId | string | Only one | Identifier for the user. |

### GetApprovalStatusResponse

Request the bank to share the approval status.

    # if User is approved, Vendor generates an approved Offer for the applicant
    and enables the eKYC flow.
    # If User doesn't need eKYC, kycToken is not present.
    {
      "responseHeader": { ... },
      "data" : {
        "applicationState": "APPROVED",
        "partnerApplicationReferenceId": "123456",
        "approvedStateContext": {
          "offerId": "123242323",
        }
      }
    }

    # if user is not eligible
    {
      "responseHeader": { ... },
      "data" : {
        "applicationState": "REJECTED",
        "partnerApplicationReferenceId": "123456",
        "rejectedStateContext": {
          "reason": "offer expired",
          "description": "The offer has expired"
        }
      }
    }

    # if a decision is pending
    {
      "responseHeader": { ... },
      "data": {
        "applicationState" : "IN_PROCESS",
        "partnerApplicationReferenceId": "123456",
        "inProcessStateContext": {}
      }
    }

    # The approval application is in income verification state.
    {
      "responseHeader": { ... },
      "data":  {
        "applicationState": "INCOME_VERIFICATION",
        "partnerApplicationReferenceId": "123456",
        "incomeVerificationContext": {}
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [GetApprovalStatusResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetApprovalStatusResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### GetApprovalStatusResponse.Data

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | applicationState | [CreditApprovalApplicationStateInfo.State](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.State) | Only one |   |
| Only one of these fields can be present | approvedStateContext | [CreditApprovalApplicationStateInfo.ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.ApprovedStateContext) | Zero or one |   |
| Only one of these fields can be present | rejectedStateContext | [CreditApprovalApplicationStateInfo.RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.RejectedStateContext) | Zero or one |   |
| Only one of these fields can be present | inProcessStateContext | [CreditApprovalApplicationStateInfo.InProcessStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.InProcessStateContext) | Zero or one |   |
| Only one of these fields can be present | incomeVerificationStateContext | [CreditApprovalApplicationStateInfo.IncomeVerificationStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CreditApprovalApplicationStateInfo.IncomeVerificationStateContext) | Zero or one |   |
|   | partnerApplicationReferenceId | string | Only one |   |

## FetchOffer

API to fetch the credit offer details from the partner for the given user
and offer id.

> [!NOTE]
> **Note:** This is optional in the call flow.

**Endpoint**

    POST v1/financialservices/credit/offer/get

### FetchOfferRequest

Request to bank to fetch offer for a given user.

    {
      "requestHeader": { ... },
      "data": {
        "userIdentifier": {
          "phoneNumber" : {
            "countryCode": "91",
            "nationalNumber": "9876543210"
          }
        },
        "offerId": "bank_offer_identifier"
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [FetchOfferRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.FetchOfferRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### FetchOfferRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| offerId | string | Zero or one | Unique identifier for a credit offer shared between Google and FI for the credit offer as part of user approval operation. |
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Only one | User objects to uniquely identify users in a bank's system. If the offerID is used by Partner to query the details, then the UserIdentifier can be ignored. |

### FetchOfferResponse

Response from bank for given offerId.

    {
      "responseHeader": { ... },
      "data": {
        "offer": {
          "productId": "product-id",
          "offerId": "OFFER01750",
          "creditLimit": {
            "variationStep": {
              "amountMicros": 5000000000,
              "currencyCode": "INR"
            },
            "maximumAmount": {
              "amountMicros": 30000000000,
              "currencyCode": "INR"
            },
            "minimumAmount": {
              "amountMicros": 10000000000,
              "currencyCode": "INR"
            }
          },
          "startTime": {
            "epochMillis": 1625810549692
          },
          "endTime": {
            "epochMillis": 1625810879692
          },
          "termCreditOfferDetails": {
            "tenureStructure": [
              {
                "maximumAmount": {
                  "amountMicros": 30000000000,
                  "currencyCode": "INR"
                },
                "minimumAmount": {
                  "amountMicros": 10000000000,
                  "currencyCode": "INR"
                },
                "tenureRange": {
                  "minimum": {
                    "periodType": "MONTH",
                    "length": 6
                  },
                  "maximum": {
                    "periodType": "MONTH",
                    "length": 12
                  },
                  // Variation step should be same across all
                  // tenure structures and the
                  // overall maximum tenure length across
                  // tenure structures should be
                  // reachable from the overall minimum using
                  // the given variation step.
                  "variationStep": {
                    "periodType": "MONTH",
                    "length": 6
                  }
                }
              }
            ],
            "interestStructure": {
              "fixed": {
                "interestCharge": {
                  "percentageValueE5": 2800000
                }
              }
            }
          }
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [FetchOfferResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.FetchOfferResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### FetchOfferResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| offer | [OfferSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.OfferSpec) | Only one |   |

## InitiateKycProcess

Initiates the KYC process.

Google will send Partner an identifier of the user application session.
Partner will return a token that Google will use to build
a personalized URL.

The KYC operation is asynchronous. Google will support
a callback URL called by Partner when the operation completes.
In addition to that, the status of the KYC process can be periodically
requested by Google using the `GetApplicationStatus()` call.

**Endpoint**

    POST v1/financialservices/credit/user/kyc/initiate

### InitiateKycProcessRequest

Request to bank to start Kyc process.

    {
      "requestHeader": {...},
      "data": {
       "userIdentifier": {
          "phoneNumber" : {
            "countryCode": "91",
            "nationalNumber": "9876543210"
          }
        "googleApplicationId": "AB2134",
         "callbackUrl":
         "https://gpay.app.goo.gl/?link=https%3A%2F%2Fmicroapps.google.com%2F14786908056087217361%3Flink%3Dloans%252Fcountry%252FIN%252Fkyc%253Fid%253DWyJjIAAAAAA"
        }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [InitiateKycProcessRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateKycProcessRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### InitiateKycProcessRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| googleApplicationId | string | Only one | Identifier for the user. |
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Zero or one |   |
| callbackUrl | string | Zero or one |   |
| externalMethodDetails | [ExternalMethodDetails](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ExternalMethodDetails) | Zero or one |   |

### InitiateKycProcessResponse

    {
      "responseHeader": { ... },
      "data" : {
        "authCode": "60e7e69fe57bf",
        "expirationTime": {
         "epochMillis": 1231241241241 // should be 60 seconds
       }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [InitiateKycProcessResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateKycProcessResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### InitiateKycProcessResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| urlToken | string | Zero or one | A vendor-generated token to redirect the user to complete Kyc. |
| authCode | string | Only one | A vendor-generated authorization code to identify user on redirection to partner surface to complete kyc process. |
| expirationTime | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one |   |

## InitiateRepaymentSetup

Initiates the repayment setup process (eMandate).

The user will send Partner the required details to pre-fill on the
Partner's website.
Partner will return a token that Google will use to build
a personalized URL.

The repayment setup operation is asynchronous.
Google will support a callback URL called by Partner when
the operation completes.
In addition to that, the status of the eMandate process can be
periodically requested by Google using the `GetApplicationStatus()` call.

**Endpoint**

    POST v1/financialservices/credit/application/initiateRepaymentSetup

### InitiateRepaymentSetupRequest

Request to bank to start repayment setup process.

    {
      "requestHeader": {...},
        "data": {
            "externalMethodDetails": {
                "callbackUrl":
                "https://gpay.app.goo.gl/?link=https%3A%2F%2Fmicroapps.google.com%2F14786908056087217361%3Flink%3Dloans%252Fcountry%252FIN%252Frepaymentsetup%253Fid%253DASRjIAAAAAA"
            },
            "googleApplicationId": "770a5404-e7b9-4d07-aa46-9d7e749638e6",
            "loanDetails": {
                "amount": {
                    "amountMicros": 3000,
                    "currencyCode": "INR"
                },
                "tenure": {
                    "length": 3,
                    "periodType": "MONTH"
                }
            }
        }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [InitiateRepaymentSetupRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateRepaymentSetupRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### InitiateRepaymentSetupRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| googleApplicationId | string | Only one | A Google generated id for the request. |
| loanDetails | [InitiateRepaymentSetupRequest.Data.LoanDetails](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateRepaymentSetupRequest.Data.LoanDetails) | Only one |   |
| externalMethodDetails | [InitiateRepaymentSetupRequest.Data.ExternalMethodDetails](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateRepaymentSetupRequest.Data.ExternalMethodDetails) | Zero or one |   |

### InitiateRepaymentSetupResponse

Request to bank to fetch offer for a given user.

    {
      "responseHeader": { ... },
      "data" : {
        "partnerApplicationReferenceId": "123456",
        "urlToken": "abc754uifsd",
        "authCode": "60e7e69fe57bf",
        "expirationTime": {
          "epochMillis": 1603298333942 // should be 60 seconds
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [InitiateRepaymentSetupResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateRepaymentSetupResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### InitiateRepaymentSetupResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| urlToken | string | Zero or one | A vendor-generated token to redirect the user to set up repayment. |
| authCode | string | Only one | A vendor-generated authorization code to identify user on redirection to partner surface to complete initiate repayment process. |
| expirationTime | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one |   |
| partnerApplicationReferenceId | string | Only one |   |

## GetAuthToken

This is a generic API which will be used to fetch auth token and
other details (like redirection for a process) for multiple processes
(KYC, Repayment, Income Verification) and entities
(Credit approval application, application, account, etc).
The auth token will be used for authenticating the user with the FI.

Google will send the partner an identifier of the entity for the user.

Google will support a callback URL in case the user needs
to be redirected to GPay after a relevant flow completes
on the partner's end.

**Endpoint**

    POST v1/financialservices/credit/user/getAuthToken

### GetAuthTokenRequest

Request to bank to generate and provide a secure auth token for the user.

    {
      "requestHeader": {...},
      "data": {
        "authContext": "INCOME_VERIFICATION"|"KYC"|"REPAYMENT_SETUP"
        "metadata": {
          "incomeVerification": {
            "callbackUrl": "...",
          },
        },
        "associatedEntity": {
          "type": "APPROVAL_APPLICATION|APPLICATION|ACCOUNT",
          "id": "AB2345",
        } ,
        "userIdentifier": {
          "phoneNumber": {"countryCode": "91", "nationalNumber": "9876543210"},
        },
      },
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [GetAuthTokenRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### GetAuthTokenRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| authContext | [GetAuthTokenRequest.Data.AuthContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.AuthContext) | Zero or one | Indicates the type of context for which the auth token is being requested. For example, token for income verification, KYC or other required types in the future. |
| metadata | [GetAuthTokenRequest.Data.Metadata](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.Metadata) | Zero or one | Metadata for the authContext. |
| associatedEntity | [GetAuthTokenRequest.Data.AssociatedEntity](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.AssociatedEntity) | Zero or one | Entity for which we need to get the auth token. |
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Only one | Identifier which can be used by the partner to associate the associatedEntity with the user. |
| newAuthContext | [GetAuthTokenRequest.Data.NewAuthContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.NewAuthContext) | Zero or one | auth context used in new API spec. |
| callbackUrl | string | Zero or one |   |
| newAssociatedEntity | [GetAuthTokenRequest.Data.NewAssociatedEntity](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.NewAssociatedEntity) | Zero or one | associated entity used in new API spec. |

### GetAuthTokenResponse

    HTTP 200 OK
    {
      "responseHeader": {...},
      "data": {
        "authCode": "60e7e69fe57bf",
        "expirationTime": {
          "epochMillis": 1231241241241  // should be 5 minutes
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [GetAuthTokenResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### GetAuthTokenResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| authCode | string | Only one | A vendor-generated authorization code to identify user on redirection to partner surface. |
| expirationTime | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one | Timestamp post which the auth token will not be valid. |
| redirectionUrl | string | Zero or one |   |

## SubmitApplication

This call will trigger the actual disbursement of credit.
Google will use this call after the user accepts the final e-agreement.

The operation is asynchronous. The status of the disbursement
can be periodically requested by Google using
`the GetApplicationStatus()` call.

**Endpoint**

    POST v1/financialservices/credit/application/submit

### SubmitApplicationRequest

Request to bank to submit application.

    {
      "requestHeader": {...},
      "data": {
        "googleApplicationId": "AB2134",
        "offerId": "loans-test-123",
        "productId": "PERSONAL_LOAN_AUTOPUSH_1",
        "userIdentifier": {
          "phoneNumber": {
            "countryCode": "91",
            "nationalNumber": "7358346320"
          }
        },
        "challenge": {
          "tokenReferenceId": "unique_reference_id",
          "tokens": [
            {
              "type": "SMS_OTP",
              "value": "12345"
            } // more repetitions if provided
          ]
        },
        "tncAcceptanceMetadata": [
          {
            "version":"version reference id",
            "type": "MITC",
            "acceptance": true
          },
          {
            "version":"version reference id",
            "type": "USER_DATA_SHARING_CONSENT",
            "acceptance": true
          }
        ],
        "user": {
          "type": "EXISTING_TO_BANK",
          "emailAddress": "user@email.com"
        }
        "loanApplicationDetails": {
          "calculatedEmiAmount": {
            "amountMicros": 1200000,
            "currencyCode": "INR"
          },
          "calculatedInterestAmount": {
            "amountMicros": 12000000,
            "currencyCode": "INR"
          },
          "calculatedApplicationFees": [
            {
              "feeType": "PROCESSING_FEE",
              "value": {
                "amountMicros": 1200000,
                "currencyCode": "INR"
              },
              "tax": [
                {
                  "taxType": "GST",
                  "amount": {
                    "amountMicros": 100000,
                    "currencyCode": "INR"
                  }
                },
                {
                  "taxType": "SERVICE_TAX",
                  "amount": {
                    "amountMicros": 100000,
                    "currencyCode": "INR"
                  }
                },
              ]
            },...
          ]
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [SubmitApplicationRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.SubmitApplicationRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### SubmitApplicationRequest.Data

NEXT ID: 20

| Field | Type | Cardinality | Description |
|---|---|---|---|
| googleApplicationId | string | Only one | The ID used to track this application. |
| offerId | string | Only one | The ID of the offer sent in FetchOffer. |
| productId | string | Only one | The ID used to uniquely identify the product between Google and the FI. |
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Only one |   |
| challenge | [Challenge](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Challenge) | Only one | Object containing the token that was generated by FI to authenticate the customer. |
| tncAcceptanceMetadata | [TncAcceptanceMetadata](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.TncAcceptanceMetadata) | One to many | Information about each of the Terms and Conditions, whether the user accepted them or not. |
| user | [SubmitApplicationRequest.Data.User](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.SubmitApplicationRequest.Data.User) | Only one |   |

### SubmitApplicationResponse

Response from bank after application is submitted.

    {
      "responseHeader": { ... },
      "data" : {
        "applicationState": "IN_PROCESS",
        "partnerApplicationReferenceId": "123456",
        "inProcessStateContext": {}
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [SubmitApplicationResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.SubmitApplicationResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### SubmitApplicationResponse.Data

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | applicationState | string | Only one |   |
| Only one of these fields can be present | inProcessStateContext | [InProcessStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InProcessStateContext) | Zero or one |   |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApprovedStateContext) | Zero or one |   |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.RejectedStateContext) | Zero or one |   |
| Only one of these fields can be present | accountCreatedStateContext | [AccountCreatedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.AccountCreatedStateContext) | Zero or one |   |
| Only one of these fields can be present | kycPendingStateContext | [KycPendingStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.KycPendingStateContext) | Zero or one |   |
| Only one of these fields can be present | counterOfferStateContext | [CounterOfferStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.CounterOfferStateContext) | Zero or one |   |
|   | partnerApplicationReferenceId | string | Only one |   |

## GetApplicationStatus

Fetches application status of a given application.
If the application is approved and processed,
response would contain the `accountId` of the activated product.
For any rejections, partners will provide a reason for the same.

**Endpoint**

    POST v1/financialservices/credit/application/getStatus

### GetApplicationStatusRequest

    {
      "requestHeader": {...},
      "data": {
        "googleApplicationId": "f54f834f-1b23-4b9c-b420-cc278d557ffe",
        "userIdentifier": {
          "phoneNumber": {
            "countryCode": "91",
            "nationalNumber": "7358312345"
          }
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [GetApplicationStatusRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetApplicationStatusRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### GetApplicationStatusRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| googleApplicationId | string | Only one |   |
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Only one |   |

### GetApplicationStatusResponse

**KYC is required**

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "responseHeader": { ... },
      "data" : {
        "applicationState": "KYC_PENDING",
        "kycPendingStateContext": {},
        "partnerApplicationReferenceId": "123456",
      }
    }

**eMandate is required**

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "responseHeader": { ... },
      "data" : {
        "applicationState": "REPAYMENT_SETUP_PENDING",
        "repaymentSetupPendingStateContext": {},
        "partnerApplicationReferenceId": "123456",
      }
    }

**eAgreement/last consent is required**

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "responseHeader": { ... },
      "data" : {
        "applicationState": "TERMS_AGREEMENT_PENDING",
        "partnerApplicationReferenceId": "123456",
        "agreementStateContext": {
          "agreementUrl": "TnC url"
        }
      }
    }

**Application was approved and loan disbursed**

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "responseHeader": { ... },
      "data" : {
        "applicationState": "ACCOUNT_CREATED",
        "partnerApplicationReferenceId": "123456",
        "accountCreatedStateContext": {
          "accountToken": "A1234"
        }
      }
    }

**Disbursal still in process, but loan has been approved**

    HTTP/1.1 200 OK
    Content-Type: application/json
    {
      "responseHeader": { ... },
      "data": {
        "applicationState": "APPROVED",
        "approvedStateContext": {},
        "partnerApplicationReferenceId": "123456"
      }
    }

**Loan application has been submitted, is being processed**

    HTTP/1.1 200 OK
    Content-Type: application/json
    {
      "responseHeader": { ... },
      "data": {
        "applicationState": "IN_PROCESS",
        "inProcessStateContext": {},
        "partnerApplicationReferenceId": "123456"
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [GetApplicationStatusResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetApplicationStatusResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### GetApplicationStatusResponse.Data

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | applicationState | string | Only one | State of the application. |
| Only one of these fields can be present | inProcessStateContext | [InProcessStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InProcessStateContext) | Zero or one |   |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApprovedStateContext) | Zero or one |   |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.RejectedStateContext) | Zero or one |   |
| Only one of these fields can be present | accountCreatedStateContext | [AccountCreatedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.AccountCreatedStateContext) | Zero or one |   |
| Only one of these fields can be present | kycPendingStateContext | [KycPendingStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.KycPendingStateContext) | Zero or one |   |
| Only one of these fields can be present | counterOfferStateContext | [CounterOfferStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.CounterOfferStateContext) | Zero or one |   |
| Only one of these fields can be present | agreementStateContext | [TermsAgreementPendingStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.TermsAgreementPendingStateContext) | Zero or one |   |
| Only one of these fields can be present | repaymentSetupPendingStateContext | [RepaymentSetupPendingStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.RepaymentSetupPendingStateContext) | Zero or one |   |
|   | partnerApplicationReferenceId | string | Only one | Unique ID generated on the partner side for the specific application to be passed back for correlation. |

## FetchAccount

Get loan account details after disbursal is approved,
associated with an AccountToken.
The account details are used to refresh the EMI schedule and
how much of the loan has been repaid or is still outstanding.

**Endpoint**

    POST v1/financialservices/credit/account/get

### FetchAccountRequest

Request to bank to fetch account for a given user.

    {
      "requestHeader": {...},
      "data": {
        "accountToken": "A45B",
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [FetchAccountRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.FetchAccountRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### FetchAccountRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| accountToken | string | Only one | Account Token uniquely representing the loan account. Sent by partner when Application state is ACCOUNT_CREATED. |

### FetchAccountResponse

    {
      "requestHeader": {...},
      "data": {
        "account": {
          "accountToken": "A45B",
          "accountState": {
            "state": "ACTIVE",
            "stateUpdateTimestamp": {
              "epochMillis" : 123141242234
            }
          },
          "creationTimestamp":{
            "epochMillis" : 123141242234
          },
          "accountType": "LOAN_ACCOUNT",
          "loanAccountDetails": {
            "accountNumber": "1234566445A",
            "approvedLoanAmount": {
              "amountMicros": 5000000000,
              "currencyCode": "INR"
            },
            "disbursedLoanAmount": {
              "amountMicros": 5000000000,
              "currencyCode": "INR"
            },
            "interestRateE5": 8800,
            "loanTenure": {
              "periodType": "MONTH",
              "length": 18
            },
            "disbursalDate": {
              "year": 2020,
              "month": 08,
              "day": 26
            },
            "totalInterestOwed": {
              "amountMicros": 1200000,
              "currencyCode": "INR"
            },
           "emis": [
            {
             "emiDate": {
                "year": 2020,
                "month": 10,
                "day": 26
             },
             "emiAmount": {
                "amountMicros": 1200000,
                "currencyCode": "INR"
             }
            },
            {
             "emiDate": {
                "year": 2020,
                "month": 11,
                "day": 26
              },
             "emiAmount": {
                "amountMicros": 1200000,
                "currencyCode": "INR"
             }
            },...
           ],
           "fees": [
              {
                "feeType": "PROCESSING_FEE",
                "feeValueStructure": {
                  "feeValue": {
                    "fixedFeeValue": {
                      "charge": {
                        "fixedValue": {
                          "amountMicros": 1200000,
                          "currencyCode": "INR"
                        },
                      }
                    }
                  },
                  "feeTaxStructure": [
                    {
                      "taxType": "GST",
                      "charge": {
                        "fixedValue": {
                          "amountMicros": 100000,
                          "currencyCode": "INR"
                        },
                      }
                    }
                  ]
                }
              },
              {
                "feeType": "BOUNCE_FEE",
                "feeValueStructure": {
                  "feeValue": {
                    "fixedFeeValue": {
                      "charge": {
                        "percentageValue": {
                          "percentageValueE5": 200000,
                          "minAmount": {
                            "amountMicros": 500,
                            "currencyCode": "INR"
                          },
                          "maxAmount": {
                            "amountMicros": 150000,
                            "currencyCode": "INR"
                          }
                        }
                      }
                    }
                  },
                }
              },...
            ]
          }
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [FetchAccountResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.FetchAccountResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### FetchAccountResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| account | [AccountSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.AccountSpec) | Only one |   |

## SearchCKycRecord

CkycSearch API will search for the CKYC record of the user and
return true if ckyc exists for the user.
If the Ckyc record exists, cKycId will be used to fetch the cKYC data
for the user in the `CkycDownload` API.

**Endpoint**

    POST v1/financialservices/credit/customer/searchCKycRecord

### SearchCKycRecordRequest

Request to credit partner to search ckyc record by calling CERSAI's
CKycSearch API.

    {
      "requestHeader": {...},
      "data": {
        "userIdentifier": {
          "pan": "PAQ123453",
          "phoneNumber": {
            "countryCode": "91",
            "nationalNumber": "9876543210"
          }
        },
        "productId": "1234",
        "tncAcceptanceMetadata": [
          {
            "type": "CKYC_DATA_FETCH",
            "acceptance": true
          }
        ]
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [SearchCKycRecordRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.SearchCKycRecordRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### SearchCKycRecordRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Only one | Unique identification for a user. The cKYC will be fetched with the help of user's PAN and mobile number (country code and national number). |
| productId | string | Only one | The ID that represents the product that the user is applying for. |
| tncAcceptanceMetadata | [TncAcceptanceMetadata](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.TncAcceptanceMetadata) | Only one | To indicate whether the user has consented to fetch cKYC data. For this request, the type field value should have the value "CKYC_DATA_FETCH", and the acceptance field value should be "true". See the sample payload. |

### SearchCKycRecordResponse

Response from credit partner for the SearchCKycRecord API

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "responseHeader": { ... },
      "data": {
        "cKycId": "session_id_generated_by_partner",
        "isCkycRecordPresent": boolean
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [SearchCKycRecordResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.SearchCKycRecordResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### SearchCKycRecordResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| cKycId | string | Only one | Unique Id to fetch user KYC data in the download API. Mandatory in case CKYC record is present, optional otherwise. |
| isCkycRecordPresent | bool | Only one | Tells if ckyc record was found for the user or not. |

## DownloadCKycRecord

The API will use the cKycId sent in the CkycSearch API
to fetch the user details.
**Endpoint**

    POST v1/financialservices/credit/customer/downloadCKycRecord

### DownloadCKycRecordRequest

Request to credit partner to download ckyc record by calling CERSAI's
CKycDownload API.

    {
      "requestHeader": {...},
      "data": {
        "cKycId": "session_id_generated_by_partner"
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [DownloadCKycRecordRequest.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.DownloadCKycRecordRequest.Data) | Only one |   |
| requestHeader | [RequestHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.RequestHeader) | Only one |   |

#### DownloadCKycRecordRequest.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| cKycId | string | Only one | Unique Id to fetch user KYC data in the download API. |

### DownloadCKycRecordResponse

Response from the credit partner for the DownloadCKycRecord API.

Success response:

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "responseHeader": { ... },
      "data": {
        "user": {
          "gender": "FEMALE", //acceptable values: [FEMALE|MALE|OTHERS]
          "dateOfBirth": "1992-03-24",//DOB format should be: YYYY-MM-DD
          "email": "kapooraditya@google.com",
          "name": {
            "salutation": "MRS", //acceptable values: ["MR", "MRS", "DR", "MS"]
            "firstName": "NAMRTA",
            "middleName": "NIMESH",
            "lastName": "SHAH",
            "fullName": "MRS NAMRTA NIMESH SHAH"
          },
          "father": {
            "salutation": "", //acceptable values: ["MR", "MRS", "DR", "MS"]
            "firstName": "HARISH",
            "middleName": "KUMAR",
            "lastName": "SHAH",
            "fullName": "MR HARISH KUMAR SHAH"
          },
          "mother": {
            "salutation": "MRS", //acceptable values: ["MR", "MRS", "DR", "MS"]
            "firstName": "MOTHER",
            "middleName": "",
            "lastName": "MOM",
            "fullName": "MRS MOTHER MOM"
          },
          "addresses": [ {
          "addressLine1": "101, building name",
          "addressLine2": "west of main road",
          "addressLine3": "west of main road",
          "landmark": "near famous watertower",
          "postalCode": "123456",
          "city": "somecity",
          "state": "somestate",
          "country": "somecountry",
          "addressTags": ["RESIDENTIAL_ADDRESS", "COMMUNICATION_ADDRESS"] // in
          case both are the same, otherwise two different addresses in this
          array.
        }]
        }
      }
    }

Error response - in case CKYC record is not found for the user

    HTTP/1.1 200 OK
    Content-Type: application/json
    {
      "responseHeader": { ... },
      "errorResponse": {
        "errorDescription": "Ckyc record not found for given user.",
        "paymentIntegratorErrorCode": "IL234",
        "errorResponseResult" : {
          "ckycDataNotFound": {
          }
        }
      }
    }

| Field | Type | Cardinality | Description |
|---|---|---|---|
| data | [DownloadCKycRecordResponse.Data](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.DownloadCKycRecordResponse.Data) | Only one |   |
| responseHeader | [ResponseHeader](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.ResponseHeader) | Only one |   |

#### DownloadCKycRecordResponse.Data

| Field | Type | Cardinality | Description |
|---|---|---|---|
| user | [DownloadCKycRecordResponse.Data.User](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.DownloadCKycRecordResponse.Data.User) | Only one |   |

## Supporting Objects and Enums

### AccountCreatedStateContext

ApplicationState specific context information given by during account
creation.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| accountToken | string | Only one | Account token sent by bank after successful creation of account. |

### AccountSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| accountToken | string | Only one | Unique identifier shared between FI and Google to refer to this account. This should not be a public identifier that anybody can use to identify a user's credit account with FI. |
| accountState | [AccountStateSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.AccountStateSpec) | Only one | State of account. |
| creationTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one | Creation time of account. |
| accountType | [AccountSpec.AccountType](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.AccountSpec.AccountType) | Only one | The type of credit account. |
| loanAccountDetails | [TermCreditAccountDetailsSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.TermCreditAccountDetailsSpec) | Only one | Details of term credit type of account |

### AccountStateSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| state | [AccountStateSpec.State](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.AccountStateSpec.State) | Only one |   |
| stateUpdateTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one |   |

### ApprovedStateContext

ApplicationState specific context information given by bank when application
got approved.

### ApproveUserForCreditRequest.Data.LoanDetails

The desired loan amount.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| amount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one |   |

### ApproveUserForCreditRequest.Data.User

| Field | Type | Cardinality | Description |
|---|---|---|---|
| fullName | string | Only one |   |
| addresses | [Address](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Address) | One to many |   |
| pan | string | Only one |   |
| dateOfBirth | string | Only one |   |
| employmentInfo | [ApproveUserForCreditRequest.Data.User.EmploymentInfo](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditRequest.Data.User.EmploymentInfo) | Only one |   |
| residenceInfo | [ApproveUserForCreditRequest.Data.User.ResidenceInfo](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditRequest.Data.User.ResidenceInfo) | Only one |   |
| father | [Person](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Person) | Zero or one |   |
| deviceLocation | [DeviceLocationSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.DeviceLocationSpec) | Zero or one | Current device location of the customer. |

### ApproveUserForCreditRequest.Data.User.EmploymentInfo

| Field | Type | Cardinality | Description |
|---|---|---|---|
| employerName | string | Only one |   |
| employerAddress | [Address](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Address) | Zero or one |   |
| workExperience | [ApproveUserForCreditRequest.Data.User.EmploymentInfo.WorkExperience](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditRequest.Data.User.EmploymentInfo.WorkExperience) | Only one |   |

### ApproveUserForCreditRequest.Data.User.EmploymentInfo.WorkExperience

| Field | Type | Cardinality | Description |
|---|---|---|---|
| totalWorkExperience | int32 | Only one |   |

### ApproveUserForCreditRequest.Data.User.ResidenceInfo

| Field | Type | Cardinality | Description |
|---|---|---|---|
| timeAtCurrentResidence | int32 | Only one |   |
| residenceOwnership | [ApproveUserForCreditRequest.Data.User.ResidenceInfo.ResidenceOwnership](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApproveUserForCreditRequest.Data.User.ResidenceInfo.ResidenceOwnership) | Only one |   |

### CounterOfferStateContext

ApplicationState specific context information given by bank when counter
offerId is provided.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| counterOfferId | string | Only one | Account token send by bank after successful creation of account. |

### CreditLimitSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| minAmount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one |   |
| maxAmount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one |   |
| stepValue | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one |   |

### DeviceLocationSpec

Device location of the user.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| latitude | double | Only one | Required. The latitude in degrees. |
| longitude | double | Only one | Required. The longitude in degrees. |
| accuracy | float | Zero or one | Optional. Estimated horizontal accuracy radius in meters of device location ([ref](https://developer.android.com/reference/android/location/Location#getAccuracy())). |

### ApprovedStateContext

Document submission step is approved by partner.

### AwaitingApprovalStateContext

Document has been submitted and pending approval from partner. No further
user action action is required.

### DocumentVerification

Document verification process, where user submits documents with the
financial institution. For e.g., In order to check creditworthiness of the
customer before applying for any credit product, financial institution may
ask for income related documents.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| onlineSubmission | [OnlineSubmission](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.OnlineSubmission) | Only one | Digital journey where user uploads the documents with the financial institution. |
| offlineSubmission | [OfflineSubmission](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.OfflineSubmission) | Only one | Offline submission of documents with the financial institution. |
| documentVerificationState | [DocumentVerification.DocumentVerificationState](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.DocumentVerification.DocumentVerificationState) | Only one |   |

### InProgressStateContext

An example case would be if user starts a doc upload but failure occurs due
to some temporary technical failure, partner is expected to specify the
reason associated with the temporary failure so that it can retried by user.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| reason | [InProgressStateContext.Reason](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.InProgressStateContext.Reason) | Only one | Specify the retryable reason associated with inprogress state for a given document verification step. |

### NotStartedStateContext

Document submission step has not started.

### OfflineSubmission

Offline submission of documents where user provides physical documents to
the financial institution.

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | lastUpdateTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one | Timestamp represent latest update made on partner system while processing documents received via offline method. |
|   | expirationTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp until user is allowed to provide physical documents to partner via offline method. |
| Only one of these fields can be present | notStartedStateContext | [NotStartedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.NotStartedStateContext) | Zero or one | User has not shared the physical documents with the partner. |
| Only one of these fields can be present | inProgressStateContext | [InProgressStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.InProgressStateContext) | Zero or one | User has started the document verification process but have not completed it yet. |
| Only one of these fields can be present | awaitingApprovalStateContext | [AwaitingApprovalStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.AwaitingApprovalStateContext) | Zero or one | User has shared the documents and it is pending approval from partner. No further user action is required. |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.ApprovedStateContext) | Zero or one | Physical copy of documents shared by user has been approved by partner. |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.RejectedStateContext) | Zero or one | Physical copy of the documents shared by user has been rejected by partner. |

### OnlineSubmission

Digital journey where user uploads the documents with the financial
institution.

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | lastUpdateTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one | Timestamp of the latest update made on partner system while processing documents. |
|   | expirationTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp until user is allowed to upload documents on google pay surface. The user might have to physically submit the documents for processing post this time. |
| Only one of these fields can be present | notStartedStateContext | [NotStartedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.NotStartedStateContext) | Zero or one | User has not uploaded any documents on partner surface. |
| Only one of these fields can be present | inProgressStateContext | [InProgressStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.InProgressStateContext) | Zero or one | User has started the document verification process but have not completed it yet. |
| Only one of these fields can be present | awaitingApprovalStateContext | [AwaitingApprovalStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.AwaitingApprovalStateContext) | Zero or one | User has uploaded the documents required in the step and partner is processing the documents before moving it to a terminal state. |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.ApprovedStateContext) | Zero or one | Documents uploaded by user has been approved by partner. |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.RejectedStateContext) | Zero or one | Documents uploaded by user has been rejected by partner. |

### RejectedStateContext

Document submission step is in a rejected state. User cannot submit the
document via specified method which gets rejected by the partner.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| reason | [RejectedStateContext.Reason](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.RejectedStateContext.Reason) | Only one | Specify the reason associated with rejection for a given document verification step. |

### DownloadCKycRecordResponse.Data.User

| Field | Type | Cardinality | Description |
|---|---|---|---|
| gender | [Gender](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#finance.platform.credit.Gender) | Only one |   |
| dateOfBirth | string | Only one | Should be in YYYY-MM-DD format. |
| email | string | Only one |   |
| name | [Person](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Person) | Only one |   |
| mother | [Person](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Person) | Only one |   |
| father | [Person](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Person) | Only one |   |
| addresses | [Address](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.Address) | One to many |   |

### EmiFrequencySpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| periodType | [CalendarPeriod](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#google.type.CalendarPeriod) | Zero or one | Period of time over which EMIs are to be paid, e.g. days or months. The initial support will cover MONTH only. |
| units | uint32 | Zero or one | How many units of the period_type over which EMIs are to be paid, e.g. 1 month. |

### EmiScheduleSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| emiDates | [DateSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.DateSpec) | Zero to many | The dates on which EMIs are due. |
| emiPaymentFrequency | [EmiFrequencySpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.EmiFrequencySpec) | Zero or one |   |
| totalNumberOfEmis | uint32 | Zero or one | The total number of EMIs for loan amount repayment. |

### ExternalMethodDetails

| Field | Type | Cardinality | Description |
|---|---|---|---|
| callbackUrl | string | Only one | A Google generated URL to redirect the user after repayment has been set up. |

### GetAuthTokenRequest.Data.AssociatedEntity

| Field | Type | Cardinality | Description |
|---|---|---|---|
| type | [GetAuthTokenRequest.Data.AssociatedEntity.AssociatedEntityType](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.AssociatedEntity.AssociatedEntityType) | Only one | The type of credit entity with which the auth token will be associated. |
| id | string | Only one | The ID of the credit entity with which the auth token will be associated. |

### GetAuthTokenRequest.Data.Metadata

| Field | Type | Cardinality | Description |
|---|---|---|---|
| incomeVerification | [GetAuthTokenRequest.Data.Metadata.IncomeVerification](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.Metadata.IncomeVerification) | Only one | Metadata for income verification flow. |

### GetAuthTokenRequest.Data.Metadata.IncomeVerification

| Field | Type | Cardinality | Description |
|---|---|---|---|
| callbackUrl | string | Only one | Callback URL that the partner should redirect the user to after the income verification flow is completed. |

### GetAuthTokenRequest.Data.NewAssociatedEntity

| Field | Type | Cardinality | Description |
|---|---|---|---|
| googleApplicationId | string | Zero or one |   |
| offerId | string | Zero or one |   |

### GetAuthTokenRequest.Data.NewAuthContext

| Field | Type | Cardinality | Description |
|---|---|---|---|
| incomeVerification | [GetAuthTokenRequest.Data.NewAuthContext.IncomeVerification](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.NewAuthContext.IncomeVerification) | Zero or one |   |
| topUpOffer | [GetAuthTokenRequest.Data.NewAuthContext.TopUpOffer](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.GetAuthTokenRequest.Data.NewAuthContext.TopUpOffer) | Zero or one |   |

### GetAuthTokenRequest.Data.NewAuthContext.IncomeVerification

### GetAuthTokenRequest.Data.NewAuthContext.TopUpOffer

### InitiateChallengeRequest.Data.ChallengeMechanism

Challenge mechanism used for activation of this product.
This will be an array of types with the values as the supported enums.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| type | [CustomerChallengeMechanism](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CustomerChallengeMechanism) | Only one | Acceptable values of type [CustomerChallengeMechanism](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CustomerChallengeMechanism) |

### InitiateChallengeResponse.Data.OtpFormat

| Field | Type | Cardinality | Description |
|---|---|---|---|
| length | int32 | Only one | Length of OTP. |
| messageRegex | string | Only one | Regex of sms message sent to user. |

### InitiateChallengeResponse.Data.SmsOtpMetadata

| Field | Type | Cardinality | Description |
|---|---|---|---|
| format | [InitiateChallengeResponse.Data.OtpFormat](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateChallengeResponse.Data.OtpFormat) | Only one | OTP Format. |

### InitiateChallengeResponse.Data.TokenMetadata

| Field | Type | Cardinality | Description |
|---|---|---|---|
| smsOtpMetadata | [InitiateChallengeResponse.Data.SmsOtpMetadata](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InitiateChallengeResponse.Data.SmsOtpMetadata) | Only one | Metadata about SMS OTP. |

### InitiateRepaymentSetupRequest.Data.ExternalMethodDetails

| Field | Type | Cardinality | Description |
|---|---|---|---|
| callbackUrl | string | Only one | A Google generated URL to redirect the user after repayment has been set up. |

### InitiateRepaymentSetupRequest.Data.LoanDetails

| Field | Type | Cardinality | Description |
|---|---|---|---|
| amount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one |   |
| tenure | [TenureSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TenureSpec) | Only one |   |

### InProcessStateContext

ApplicationState specific context information given by bank while
application id under review process.

### InterestStructureSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| fixed | [InterestStructureSpec.FixedInterestCharge](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InterestStructureSpec.FixedInterestCharge) | Zero or one |   |

### InterestStructureSpec.FixedInterestCharge

| Field | Type | Cardinality | Description |
|---|---|---|---|
| interestCharge | [InterestStructureSpec.InterestCharge](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InterestStructureSpec.InterestCharge) | Zero or one |   |

### InterestStructureSpec.InterestCharge

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
| Only one of these fields can be present | fixedValue | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Zero or one |   |
| Only one of these fields can be present | percentageValueE5 | int64 | Zero or one |   |

### ApprovedStateContext

Kyc step is approved by partner.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| validityTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp until approval is valid for the kyc step. |

### AwaitingApprovalStateContext

Kyc step pending approval from partner. No further user action action is
required.

### Ckyc

CKYC refers to Central KYC (Know Your Customer), an initiative of the
Government of India. The aim of this initiative is to have a structure in
place which allows customers to complete their KYC only once before
interacting with various entities across the financial sector. CKYC is
managed by CERSAI (Central Registry of Securitization Asset Reconstruction
and Security Interest of India), which is authorized by the Government of
India to function as the Central KYC Registry (CKYCR)

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | lastUpdateTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp represent latest update made on partner system while processing cKYC record. |
|   | expirationTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp until user is eligible to complete cKYC process. |
| Only one of these fields can be present | notStartedStateContext | [NotStartedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.NotStartedStateContext) | Zero or one | User has not started ckyc process |
| Only one of these fields can be present | inProgressStateContext | [InProgressStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.InProgressStateContext) | Zero or one | User has started the cKYC flow, but have not completed the whole process. |
| Only one of these fields can be present | awaitingApprovalStateContext | [AwaitingApprovalStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.AwaitingApprovalStateContext) | Zero or one | User has provided complete details required during cKYC step and partner is processing the details before updating to the approved state. |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.ApprovedStateContext) | Zero or one | Ckyc has been successfully approved by the partner. |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.RejectedStateContext) | Zero or one | Ckyc is rejected by the partner. |

### Ekyc

Ekyc (electronic - know your customer) is a paperless Know Your Customer
(KYC) process, wherein the identity and address of the user are verified
electronically through government id verification. In India, Aadhaar, which
is a government id, is used for digital authentication.

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | lastUpdateTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp represent latest update made on partner system while processing identity proof using adhaar verification during eKYC. |
|   | expirationTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp until user is eligible to complete eKYC process. |
| Only one of these fields can be present | notStartedStateContext | [NotStartedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.NotStartedStateContext) | Zero or one | User has not started the aadhar authentication for identity and address verification. |
| Only one of these fields can be present | inProgressStateContext | [InProgressStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.InProgressStateContext) | Zero or one | User has started the eKYC flow, but have not completed the whole process. |
| Only one of these fields can be present | awaitingApprovalStateContext | [AwaitingApprovalStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.AwaitingApprovalStateContext) | Zero or one | User has provided complete details required during eKYC step and partner is processing the details before updating to the approved state. |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.ApprovedStateContext) | Zero or one | Ekyc has been successfully approved by the partner. |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.RejectedStateContext) | Zero or one | Ekyc is rejected by the partner. |
| Only one of these fields can be present | expiredStateContext | [ExpiredStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.ExpiredStateContext) | Zero or one |   |

### ExpiredStateContext

### InProgressStateContext

An example case would be if user has already started the Ekyc flow and Aadhar
system is down (which is a dependent system at partners end), partner is
expected to specify the reason associated with the temporary failure so that
it can be retried by user.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| reason | [InProgressStateContext.Reason](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.InProgressStateContext.Reason) | Zero or one | Specify the reason associated with inprogress state for a given kyc step. |

### Kyc

For e.g. In case of AXIS card onboarding flow in order to complete the KYC
journey user could be eligible for any of the following combinations.
1) ekyc + videoKyc.
2) offline
3) ekyc + videoKyc + offline.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| eKyc | [Ekyc](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.Ekyc) | Zero or one | Option for user to complete KYC via online adhaar verification with the partner. |
| vKyc | [VideoKyc](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.VideoKyc) | Zero or one | Option for user to complete KYC over video with the partner. |
| cKyc | [Ckyc](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.Ckyc) | Zero or one | Option for user to complete KYC via Central KYC Registry where users KYC details are verified from the centralised depository of KYC documents managed by CERSAI which is authorized by the Government of India. |
| offlineKyc | [OfflineKyc](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.OfflineKyc) | Zero or one | Physical documents submitted by user as an offline process to complete the kyc journey. |
| kycState | [Kyc.KycState](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.Kyc.KycState) | Zero or one |   |

### NotStartedStateContext

Kyc step has not started.

### OfflineKyc

Offline step associated with user while performing KYC with the partner.

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | lastUpdateTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp represent latest update made on partner system while processing identity verification documents received using offline method. |
|   | expirationTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp until user is eligible to complete the kyc step via offline method. |
| Only one of these fields can be present | notStartedStateContext | [NotStartedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.NotStartedStateContext) | Zero or one | User has not shared the physical identity verification documents with the partner. |
| Only one of these fields can be present | inProgressStateContext | [InProgressStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.InProgressStateContext) | Zero or one | User has pysical kyc process but has not completed it yet. |
| Only one of these fields can be present | awaitingApprovalStateContext | [AwaitingApprovalStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.AwaitingApprovalStateContext) | Zero or one | User has provided complete details required during for kyc and partner is processing the details before updating to the approved state. |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.ApprovedStateContext) | Zero or one | Identity verification documents shared by user via offline method has been successfully approved by the partner. |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.RejectedStateContext) | Zero or one | Physical copy of identity verification documents shared by user has been rejected by partner. Partner will provide reason code associated with given rejection type. |

### RejectedStateContext

Kyc step is in a rejected state. The step cannot be retried in case if a kyc
step gets rejected by the partner.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| reason | [RejectedStateContext.Reason](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.RejectedStateContext.Reason) | Zero or one | Specify the reason associated with rejection for a given kyc step. |

### VideoKyc

Video kyc performed by user by giving their identity proof online through a
video call.

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | lastUpdateTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp represent latest update made on partner system while processing identity proof via video call. |
|   | expirationTimestamp | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Zero or one | Timestamp until user is eligible to complete the kyc journey via video call on gpay surface. |
| Only one of these fields can be present | notStartedStateContext | [NotStartedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.NotStartedStateContext) | Zero or one | User has not started the video call with the partner's agent for identity verification. |
| Only one of these fields can be present | inProgressStateContext | [InProgressStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.InProgressStateContext) | Zero or one | User has started the video kyc flow, but have not completed the whole process. |
| Only one of these fields can be present | awaitingApprovalStateContext | [AwaitingApprovalStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.AwaitingApprovalStateContext) | Zero or one | User has provided complete details required during video kyc step and partner is processing the details before updating to the approved state. |
| Only one of these fields can be present | approvedStateContext | [ApprovedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.ApprovedStateContext) | Zero or one | Video kyc has been successfully approved by the partner. |
| Only one of these fields can be present | rejectedStateContext | [RejectedStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.RejectedStateContext) | Zero or one | Video kyc is rejected by the partner. |
| Only one of these fields can be present | expiredStateContext | [ExpiredStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.ExpiredStateContext) | Zero or one |   |

### KycPendingStateContext

ApplicationState specific context information given by bank when application
is pending KYC.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| kycFlow | [KycPendingStateContext.KycFlow](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.KycPendingStateContext.KycFlow) | Zero or one |   |

### KycPendingStateContext.KycFlow

Possible kyc and document verification options for the user in the kyc
flow. This will contain empty messages with optional expiry timestamp
corresponding to the steps that a user is eligible for.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| kyc | [kyc.Kyc](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.kyc.Kyc) | Zero or one |   |
| incomeVerification | [documentverification.DocumentVerification](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.documentverification.DocumentVerification) | Zero or one |   |

### OfferSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| offerId | string | Only one | A unique offer identifier on partner's side. We intend to refer this offer in future APIs using this ID. |
| productId | string | Only one | Unique ID of credit product on partner's side. |
| startTime | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one | The time from when this offer will be valid. Used to post-date offers being sent. |
| endTime | [TimestampSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TimestampSpec) | Only one | The time at when this offer will cease to be valid. Used to limit offer availability. |
| creditLimit | [CreditLimitSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.CreditLimitSpec) | Zero or one | The credit limit for the offer. |
| termCreditOfferDetails | [TermCreditOfferDetailsSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.TermCreditOfferDetailsSpec) | Only one | Offer details for term credit type of product. |
| userIdentifier | [UserIdentifier](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.UserIdentifier) | Zero or one |   |
| provenance | [Provenance](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.Provenance) | Zero or one |   |
| offerType | [OfferType](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.OfferType) | Zero or one |   |
| offerStateInfo | [OfferStateInfo](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.OfferStateInfo) | Zero or one |   |

### OfferStateInfo

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
| Only one of these fields can be present | availableStateContext | [OfferStateInfo.AvailableStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.OfferStateInfo.AvailableStateContext) | Zero or one |   |
| Only one of these fields can be present | unavailableStateContext | [OfferStateInfo.UnavailableStateContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.OfferStateInfo.UnavailableStateContext) | Zero or one |   |

### OfferStateInfo.AvailableStateContext

State when customer can apply for the credit offer. Offer state specific
context information describing why the state was set to AVAILABLE.

### OfferStateInfo.UnavailableStateContext

State when customer cannot apply for the credit offer. Offer state specific
context information describing why the state was set to UNAVAILABLE.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| reason | [OfferStateInfo.UnavailableStateContext.Reason](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.OfferStateInfo.UnavailableStateContext.Reason) | Zero or one |   |

### OfferType

| Field | Type | Cardinality | Description |
|---|---|---|---|
| topupOfferType | [OfferType.TopupOfferType](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.OfferType.TopupOfferType) | Zero or one |   |

### OfferType.TopupOfferType

TopupOffer is generated when partner issues offers against user's existing
active credit account.

### Provenance

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
| Only one of these fields can be present | prequalified | [Provenance.Prequalified](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.Provenance.Prequalified) | Zero or one |   |
| Only one of these fields can be present | preapproved | [Provenance.Preapproved](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.Provenance.Preapproved) | Zero or one |   |
|   | accountToken | string | Zero or one | Partner shared account token of the user's existing credit account against which the offer has been generated. |

### Provenance.Preapproved

Provenance attributes for pre-approved offers.

### Provenance.Prequalified

Provenance attributes for prequalified offers.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| qualificationCriteria | [Provenance.Prequalified.QualificationCriteria](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.Provenance.Prequalified.QualificationCriteria) | Zero or one | Optional. Qualification criteria pertaining to this offer. Offer will be enabled only if this qualification criteria is met. |

### Provenance.Prequalified.QualificationCriteria

Qualification checks that need to be run before enabling the offer. This
will be triggered only for unavailable offers with reason as
PENDING_PREQUALIFIED_CRITERIA_CHECKS.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| eligibleTierIds | string | Zero to many | List of tiers that should be used for running the qualification checks. This list will contain the names referred to by the FinancialInstitution for the segments. |

### RejectedStateContext

ApplicationState specific context information given by bank when application
got rejected.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| reason | [ApplicationRejectionReason.Reason](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.ApplicationRejectionReason.Reason) | Only one | Rejection reason. |
| description | string | Only one | Description for the reason of rejection. |

### RepaymentSetupPendingStateContext

### SubmitApplicationRequest.Data.User

| Field | Type | Cardinality | Description |
|---|---|---|---|
| type | string | Only one |   |
| emailAddress | string | Only one | Needed for communication. |

### TenureStructureSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| minimumAmount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one |   |
| maximumAmount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one |   |
| tenureRange | [TenureRangeSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TenureRangeSpec) | Only one | Variable terms are only applicable to this offer. These terms are either defined by the lender or tentatively defined by the pre-qualification process. |

### TermCreditAccountDetailsSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| approvedLoanAmount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one | The approved amount of the loan. |
| disbursedLoanAmount | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one | The amount of loan disbursed by the financial institution. This is equal to the loan amount approved minus the various fees (like processing fee) charged to the customer. |
| interestRateE5 | int64 | Only one | Interest rate \* 10\^5. For example, 12.75% would be 1275000. |
| loanTenure | [TenureSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TenureSpec) | Only one | The tenure for the loan. |
| emi | [MoneySpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.MoneySpec) | Only one | EMI amount of the loan. |
| disbursalDate | [DateSpec](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.DateSpec) | Only one | The date on which money was disbursed to the customer. |
| emiSchedule | [EmiScheduleSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.EmiScheduleSpec) | Only one | EMI schedule details. |
| accountNumber | string | Only one | Loan account number required for repayment flow. |

### TermCreditOfferDetailsSpec

| Field | Type | Cardinality | Description |
|---|---|---|---|
| tenureStructure | [TenureStructureSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.TenureStructureSpec) | One to many |   |
| interestStructure | [InterestStructureSpec](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#java.com.google.nbu.paisa.simulator.credit.actions.specs.InterestStructureSpec) | Only one | Represents interest rate \* 10\^5 as an integer. This makes sure there aren't rounding and precision issues with doubles. |

### TermsAgreementPendingStateContext

| Field | Type | Cardinality | Description |
|---|---|---|---|
| agreementUrl | string | Only one | URL of a vendor-hosted document explaining terms of credit, that needs to be surfaced to customers and agreed. |

### TncAcceptanceMetadata

Metadata associated with terms and condition.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| type | [TermsAndConditionType](https://developers.google.com/pay/india/api/banks/loans/reference/common-api-refs#java.com.google.nbu.paisa.simulator.credit.actions.specs.TermsAndConditionType) | Only one |   |
| acceptance | bool | Only one | Whether the user accepted the terms or not. |

### ApproveUserForCreditContext

### CardDetailsContext

| Field | Type | Cardinality | Description |
|---|---|---|---|
| accountToken | string | Only one | Unique identifier shared between financial institution and google to refer this account. |

### CreditApprovalApplicationStateInfo.ApprovedStateContext

Context information given by lender when applicant is approved.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| offerId | string | Only one | Unique identifier shared between financial institution and google to refer this pre-approved offer. |

### CreditApprovalApplicationStateInfo.IncomeVerificationStateContext

### CreditApprovalApplicationStateInfo.InProcessStateContext

### CreditApprovalApplicationStateInfo.RejectedStateContext

Context information given by lender when applicant is rejected.

| Field | Type | Cardinality | Description |
|---|---|---|---|
| rejectionReason | string | Zero or one |   |

### CustomerChallengeContext

|   | Field | Type | Cardinality | Description |
|---|---|---|---|---|
|   | reason | [CustomerChallengeContext.Reason](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CustomerChallengeContext.Reason) | Zero or one |   |
| Only one of these fields can be present | submitApplicationContext | [SubmitApplicationContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.SubmitApplicationContext) | Zero or one | Represents submit application context payload |
| Only one of these fields can be present | userDetailsContext | [UserDetailsContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.UserDetailsContext) | Zero or one | Represents user details context payload |
| Only one of these fields can be present | cardDetailsContext | [CardDetailsContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.CardDetailsContext) | Zero or one | Represents card details context payload |
| Only one of these fields can be present | approveUserForCreditContext | [ApproveUserForCreditContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.ApproveUserForCreditContext) | Zero or one | Represents approve user for credit context payload |
| Only one of these fields can be present | updateSettingsContext | [UpdateSettingsContext](https://developers.google.com/pay/india/api/banks/loans/reference/loan-issue-apis#nbu.paisa.simulators.credit.UpdateSettingsContext) | Zero or one | Represents update settings context payload |

### SubmitApplicationContext

### UpdateSettingsContext

| Field | Type | Cardinality | Description |
|---|---|---|---|
| accountToken | string | Only one | Unique identifier shared between financial institution and google to refer this account. |

### UserDetailsContext

### AccountSpec.AccountType

| Name | Description |
|---|---|
| CREDIT_CARD_ACCOUNT |   |
| LOAN_ACCOUNT |   |

### AccountStateSpec.State

| Name | Description |
|---|---|
| ACTIVE | Active account state. |
| INACTIVE | Inactive account state. |
| CLOSED | Account is closed. |
| DELINQUENT | Account is in delinquency. |

### ApplicationRejectionReason.Reason

| Name | Description |
|---|---|
| BUREAU_RECORD | Application was rejected based on the Bureau Track Record. |
| CREDIT_RISK_ASSESSMENT | Customer's credit data did not meet the criteria. |
| CO_LENDER_REJECT | Application was rejected by the co-lender. |
| KYC_REJECT |   |
| LANGUAGE_BARRIER | Application was rejected due to the language barrier between the partner and the customer. |
| BANKING_RELATIONSHIP | Application was rejected based on the past relationship between the partner and the customer, e.g. previous loans not paid on time, past loan rejections etc. |
| UNSERVICEABLE_LOCATION | Lender doesn't provide service at the customer's location. |
| BORROWER_REJECTED | The application was abandoned by the borrower. |
| DUPLICATE_APPLICATION | Another application for the same user was submitted, approved or rejected recently. |
| USER_UNREACHABLE | Lender was unable to contact the customer to continue application process. Eg, unable to reach customer for offline KYC. |
| OTHERS |   |
| PENDING_CUSTOMER_ACTION | The application is in rejected state because it needs some input from the customer. Exact fields which need input can be determined using the field mask in RejectedStateContext. |
| INVALID_DATA_WITH_VENDOR | User data is in invalid state on partner's end to proceed with the application. |

### ApproveUserForCreditRequest.Data.User.ResidenceInfo.ResidenceOwnership

| Name | Description |
|---|---|
| RENTED |   |
| OWNED |   |

### DocumentVerification.DocumentVerificationState

Enum specifying the overall state of document verification process. User
could be eligible for both online and offline provisioning of the document
and each of them has its own state context. If one of the methods goes into
terminal state, there are other methods available for users to complete the
document verification process. The value of enum will be derived depending
upon state context of all options that the user is eligible for.

| Name | Description |
|---|---|
| NOT_STARTED | When user is eligible to upload the documents but has not yet started the document upload journey via any of the options provided by partner. |
| IN_PROGRESS | User has started the document uploading process with the partner. |
| AWAITING_APPROVAL | User has completed the document uploading process and partner is processing the documents before moving it to a terminal state. |
| APPROVED | User's documents have been successfully uploaded and verified by partner. |
| REJECTED | User is no longer eligible to submit documents from any options provided due to rejection at partner's end or expiry of the timeframe to complete those steps. |

### InProgressStateContext.Reason

| Name | Description |
|---|---|
| USER_ERROR | Error state due to some user initiated action and requires user action to course correct the document verification step. For eg, user dropping off during the process, invalid document upload etc. |
| INTERNAL_DEPENDENCY_FAILURE | Error state due to some system failure at partners end. |

### RejectedStateContext.Reason

| Name | Description |
|---|---|
| POLICY_ERROR | Rejected due to policy error such as transaction criteria for a given bank statement doesn't comply with policy at partner's end. |
| SKIPPED | Rejected on user action of skipping the document verification step at partner surface. |
| EXPIRED | Rejected when the current timestamp is greater than expiry timestamp for a given document verification step. |

### GetAuthTokenRequest.Data.AssociatedEntity.AssociatedEntityType

| Name | Description |
|---|---|
| APPROVAL_APPLICATION |   |

### GetAuthTokenRequest.Data.AuthContext

| Name | Description |
|---|---|
| INCOME_VERIFICATION |   |

### InProgressStateContext.Reason

| Name | Description |
|---|---|
| CAMERA_OR_LOCATION_DENIED | Error state user has not provided access to camera or location access at partner surface. |
| AADHAAR_SERVICE_ERROR | Error state due to Aadhaar service down and partner is unable to validate the aadhaar details of the user. |
| VKYC_SERVICE_ERROR | Error due to failure in vkyc service used by the partner. |
| USER_ERROR | Error state due to some user initiated action that requires user action to course correct the step. For eg, user dropping off during the process, invalid otp attempt etc. |
| INTERNAL_DEPENDENCY_FAILURE | Error state due to some system failure or technical issues at partners end during video kyc step. |
| VALIDITY_EXPIRED | Error state where user completed the step in past, but approval got expired because other steps weren't completed in the required timeframe. |

### Kyc.KycState

Enum specifying the overall state of user's kyc journey. User could be
eligible for multiple kyc steps as currently we support three different
types of kyc and each individual step has its own state context. If one of
the steps goes into the rejected state, there are other steps available for
users to complete the kyc journey. The value of enum will be derived
depending upon state context of all options that the user is eligible for.

| Name | Description |
|---|---|
| NOT_STARTED | When user is eligible for kyc journey but has not yet started the kyc process via any of the options provided by partner. |
| IN_PROGRESS | When user has started the kyc process and it is pending action from user to complete the process. |
| AWAITING_APPROVAL | User has completed the kyc process and partner is processing the documents before moving it to a terminal state. |
| APPROVED | User's kyc have been verified and approved by partner. |
| REJECTED | When user is no longer eligible to complete the KYC journey. |
| EXPIRED |   |

### RejectedStateContext.Reason

| Name | Description |
|---|---|
| POLICY_ERROR | Kyc rejected due to some policy error. This rejection is sent in case partner cannot send a granular error enum such as NAME_MATCH_FAILURE. |
| LOCATION_CHECK_FAILED | Rejected due to location of user did not meet the criteria at partners end while performing online kyc. |
| VKYC_REJECTED | Video kyc step is marked rejected by video call agent or got rejected during concurrent audit stage at partners end. |
| EXPIRED | Rejected when the current timestamp is greater than expiry timestamp for a given kyc step. |
| SKIPPED | Rejected when user skipped the given kyc step. |
| USER_ERROR | Rejection due to some user initiated action which cannot be corrected. For eg, user exhausting the maximum wrong otp attempts. |
| EKYC_REJECTED | In case ekyc step gets rejected, video kyc step is automatically rejected for some partners. This reason is to be used to mark the rejection in video kyc. |
| NAME_MATCH_FAILURE | Digital KYC would be rejected if there is a mismatch in the applicant's name in the submitted application and the one on the Aadhar card. The following error would be sent in the vKYC rejection state context reason. |

### OfferStateInfo.UnavailableStateContext.Reason

| Name | Description |
|---|---|
| UNKNOWN_REASON |   |
| PREMATURE | The offer is complete but will be made available after some time. |
| PENDING_PREQUALIFIED_CRITERIA_CHECKS | The offer is unavailable as prequalified criteria checks (PQCs) have not been performed yet. |

### CreditApprovalApplicationStateInfo.State

| Name | Description |
|---|---|
| APPROVED | User is approved for a credit offer, offer has been provided. Terminal state. |
| REJECTED | User was rejected by the lender. Terminal state. |
| IN_PROCESS | Initial state when for credit approval application. |
| INCOME_VERIFICATION | User needs to supply more details to verify their income before their application can be approved. |

### CustomerChallengeContext.Reason

| Name | Description |
|---|---|
| OFFER_ACTIVATION | Customer is challenged during offer activation |
| USER_DETAILS | Customer is challenged during getting user details |
| CARD_DETAILS | Customer is challenged during getting card details |
| USER_APPROVAL | Customer is challenged during credit approval application |
| UPDATE_SETTINGS | Customer is challenged during updating settings |
| EKYC_VERIFICATION | Customer is challenged for ekyc verification. |

### CustomerChallengeMechanism

| Name | Description |
|---|---|
| SMS_OTP |   |