Skip to main content

Credit Terms Service Methods

This section highlights the different methods that can be used to create and retrieve credit terms resources through the DeepIDV API.

Table of Contents

Create and Send a Credit Terms Request

POST /credit-terms

Parameters

Headers

TypeParamsValuesDescription
HEADERx-api-key*stringThe users API Key

Body Parameters

TypeParamsValuesDescription
BODYbusinessEmail*stringThe end business email where the request will be sent to
BODYfirstName*stringThe end users first name
BODYlastName*stringThe end users last name
BODYbusinessName*stringThe end business name
BODYbusinessAddress*stringThe end business address
BODYrequestedCreditAmount *numberThe total amount of requested credit from the applicant
BODYexternalIdstringA unique identifier that can be used to retrieve the generated statement session
BODYrequestedCreditPeriodstringThe period (in months) of a bank statement to reuqest (DEFAULT: 30) VALUES(30, 60, 90)
BODYsendEmailInvitebooleanSend an email to the applicant (DEFAULT: true)

Example Request

{
"businessEmail": "applicant@example.com",
"businessName": "Example Corp",
"businessAddress": "123 Example St, City, Country",
"firstName": "John",
"lastName": "Doe",
"externalId": "external-123",
"period": "60",
"requestedCreditAmount": 50000,
"sendEmailInvite": true
}

Response

Success (200)

{
"creditTermsId": "<credit_terms_id>",
"creditTermsUrl": "<credit_terms_url>",
"externalId": "<external_id>",
"links": "<links>"
}
Response Fields
FieldTypeDescription
credit_terms_idstringThe unique id for the created credit terms session
credit_terms_urlstringThe link created to complete the credit terms ssession
external_idstringThe externalId that was passed as a parameter
linksarrayA list of discoverable URLs for related resources

Best Practices

  • Always validate required fields before sending requests
  • Store the id and externalId for future reference
  • Handle error responses appropriately in your application

Fetch Credit Terms

Request to fetch all credit terms sessions under the authenticated organization

Request

GET /credit-terms

Parameters

Headers

TypeParamsValuesDescription
HEADERx-api-key*stringThe users API Key

Query Parameters

TypeParamsValuesDescription
QUERYnextTokenstringTo retrieve the next page of sessions, provided the limit of 500 was reached in a previous call

Response

Success (200)

{
"creditTerms": [
{
"id": "<credit_terms_id>",
"externalId": "<external_id>",
"status": "<status>",
"type": "<statement_type>",
"createdAt": "<created_at>",
"updatedAt": "<updated_at>",
"senderUserId": "<sender_user_id>",
"Config": "<config>"
}
],
"nextToken": "<next_token>"
}
Response Fields
FieldTypeDescription
credit_terms_idstringThe unique id for a credit terms
external_idstringThe externalId for a credit terms
statusstringThe status of a bank statement
statement_typestringType of the bank statement VALUES: (upload, request)
created_atstringThe date stamp of when a session was created
updated_atstringThe date stamp of when a session was updated
sender_user_idstringID of the user that sent out the request
configobjectThe configuration for the bank statement
next_tokenstringThe token to get the next page of statements (if limit of 500 was reached)
Status Values

The status field can have one of the following values:

  • PENDING: Session has not been started
  • IN_PROGRESS: Sataement is processing
  • COMPLETED: Statement and analysis has completed
Config Values
  • period: The period in months of the requested bank statement (VALUES: 30, 60, 90)
  • name: Name of the business requesting the credit
  • address: Address of the business requesting the credit
  • requestedAmount: The total amount of credit requested

Fetch Credit Terms by External Id

Request to fetch all credit terms session by its external ID

Request

GET /credit-terms/externalId/{external_id}

Parameters

Headers

TypeParamsValuesDescription
HEADERx-api-key*stringThe users API Key

Response

Success (200)

{
"creditTerms": [
{
"id": "<credit_terms_id>",
"externalId": "<external_id>",
"status": "<status>",
"type": "<statement_type>",
"createdAt": "<created_at>",
"updatedAt": "<updated_at>",
"senderUserId": "<sender_user_id>",
"Config": "<config>"
}
],
"nextToken": "<next_token>"
}
Response Fields
FieldTypeDescription
credit_terms_idstringThe unique id for a credit terms
external_idstringThe externalId for a credit terms
statusstringThe status of a bank statement
statement_typestringType of the bank statement VALUES: (upload, request)
created_atstringThe date stamp of when a session was created
updated_atstringThe date stamp of when a session was updated
sender_user_idstringID of the user that sent out the request
configobjectThe configuration for the bank statement
next_tokenstringThe token to get the next page of statements (if limit of 500 was reached)
Status Values

The status field can have one of the following values:

  • PENDING: Session has not been started
  • IN_PROGRESS: Sataement is processing
  • COMPLETED: Statement and analysis has completed
Config Values
  • period: The period in months of the requested bank statement (VALUES: 30, 60, 90)
  • name: Name of the business requesting the credit
  • address: Address of the business requesting the credit
  • requestedAmount: The total amount of credit requested

Fetch Credit Terms by ID

Fetches a credit terms by credit terms ID

Request

GET /credit-terms/{credit_terms_id}

Parameters

Headers

TypeParamsValuesDescription
HEADERx-api-key*stringThe users API Key

Response

Success (200)

{
"id": "<credit_terms_id>",
"externalId": "<external_id>",
"status": "<status>",
"type": "<statement_type>",
"createdAt": "<created_at>",
"updatedAt": "<updated_at>",
"senderUserId": "<sender_user_id>",
"Config": "<config>"
}
Response Fields
FieldTypeDescription
credit_terms_idstringThe unique id for a credit terms
external_idstringThe externalId for a credit terms
statusstringThe status of a bank statement
statement_typestringType of the bank statement VALUES: (upload, request)
created_atstringThe date stamp of when a session was created
updated_atstringThe date stamp of when a session was updated
sender_user_idstringID of the user that sent out the request
configobjectThe configuration for the bank statement
Status Values

The status field can have one of the following values:

  • PENDING: Session has not been started
  • IN_PROGRESS: Sataement is processing
  • COMPLETED: Statement and analysis has completed
Config Values
  • period: The period in months of the requested bank statement (VALUES: 30, 60, 90)
  • name: Name of the business requesting the credit
  • address: Address of the business requesting the credit
  • requestedAmount: The total amount of credit requested

Error Status Reference

The DeepIDV API uses standard HTTP status codes to indicate the success or failure of requests. The following table describes the possible error responses you may encounter:

Status CodeError MessageDescription
400{"error": "Invalid Input."}The request parameters are invalid or missing required fields
401{"error": "Invalid API key."}The provided API key is invalid or expired
402{"error": "Insufficient funds or subscription."}Unauthorized - Payment required
403{"error": "API key is missing."}No API key was provided in the request
429{"error": "Rate limit exceeded."}Too many requests have been made in a short period
500{"error": "Something went wrong."}An unexpected error occurred on the server

Best Practices for Error Handling

  • Always validate required fields before sending requests
  • Implement retry logic with exponential backoff for rate limit errors (429)
  • Store error logs for debugging and monitoring purposes
  • Display user-friendly error messages in your application