Skip to content

Generate Document

Request URL

POST /akepa/document/generate

Description

This endpoint can be used to generate a document ID in preparation to upload a document file.

Schema

Property table for akepa/document/generate

Property Description Required Schema
workflow Type of workflow Yes {
  "type": "string",
  "enum": [ "BUSINESS", "PERSONAL" ],
  "description": "akepa-workflow"
}
name name Yes {
  "type": "string",
  "pattern": "^((?![<>]).)*$",
  "minLength": 1,
  "maxLength": 50,
  "isNotOnlyWhitespace": true,
  "description": "common-commonStr50Req"
}
extension File extension Yes {
  "type": "string",
  "enum": [ "jpg", "png" ]
}
type type Yes {
  "type": "string",
  "enum": [ "contract", "license", "passport",
"utility", "other", "internal",
"identification_card", "residence_permit",
"canada_provincial_id", "indigenous_card",
"paystub", "bank_statement", "w2", "1099",
"1120", "1065", "t1", "t4" ]
}
note A note or description No {
  "type": "string",
  "pattern": "^((?![<>]).)*$",
  "minLength": 0,
  "maxLength": 500,
  "nullable": true,
  "description": "common-commonStr500"
}
note_author_agent_email Email address of the note author No {
  "type": "string",
  "format": "email",
  "description": "customer-email"
}

Request Body

{
    "workflow": "PERSONAL",
    "name": "license",
    "extension": "jpg",
    "type": "license"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "workflow": "PERSONAL",
    "name": "license",
    "extension": "jpg",
    "type": "license"
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/akepa/document/generate',
  headers: {
    'Content-Type': "application/json",
    'x-connectfi-token': "A long random string token received from /auth/get-token request"
  },
  data
};

let result;
try {
  result = await axios.request(config);
  if (result.status === 200) {
    console.log(JSON.stringify(result.data));
  }
} catch (err) {
  console.log({
    errCode: err.code,
    responseStatus: err.response && err.response.status,
    data: err.response && JSON.stringify(err.response.data)
  });
}

cURL

curl --location "CONNECTFI_BASE_URL/akepa/document/generate" --data "{\"workflow\":\"PERSONAL\",\"name\":\"license\",\"extension\":\"jpg\",\"type\":\"license\"}" --header "Content-Type: application/json" --header "x-connectfi-token: A long random string token received from /auth/get-token request" 

Successful Response Examples

200 AKEPA/DOCUMENT/GENERATE SUCCESSFUL RESPONSE FOR INDIVIDUAL CUSTOMER

HEADERS

Header Value
Content-Type application/json
x-connectfi-token A long random string token received from /auth/get-token request

REQUEST BODY

{
    "workflow": "PERSONAL",
    "name": "license",
    "extension": "jpg",
    "type": "license"
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "id": "doc_71YxuRUnKqLhOWriDJFMI2",
        "aggregatorId": "CLIENTID",
        "uploadStatus": false,
        "workflow": "PERSONAL",
        "name": "license",
        "extension": "jpg",
        "type": "license",
        "dtsCreatedAt": "2023-11-01T16:44:19.473Z"
    },
    "requestId": "e70a679078d511eeb5658f28ab5fe311"
}

200 AKEPA/DOCUMENT/GENERATE SUCCESSFUL RESPONSE FOR BUSINESS CUSTOMER

HEADERS

Header Value
Content-Type application/json
x-connectfi-token A long random string token received from /auth/get-token request

REQUEST BODY

{
    "workflow": "BUSINESS",
    "name": "license",
    "extension": "jpg",
    "type": "license"
}

RESPONSE BODY

{
    "code": "0",
    "data": {
        "id": "doc_30DWsUZtnyV6gCw7aRtkfU",
        "aggregatorId": "CLIENTID",
        "uploadStatus": false,
        "workflow": "BUSINESS",
        "name": "license",
        "extension": "jpg",
        "type": "license",
        "dtsCreatedAt": "2023-11-01T17:30:44.268Z"
    },
    "requestId": "62e7f11078dc11eeb5658f28ab5fe311"
}