📝 Create Business Request

Endpoint: POST https://api.vlenseg.com/api/BusinessRequest/Create/{typeId}

Overview:

Creates a new Business Request of a given type.

This endpoint is used to create a new Business Request of a given type (typeId).

  • It collects information such as customer location, device time, dynamic request field values, and the required signers.

  • geoLocation → The customer’s device location at the time of request creation (latitude & longitude).

  • userDeviceUtcTime → The UTC timestamp from the customer’s device.

  • requestFieldsValues → A set of key-value pairs (dynamic fields) required for this specific request type.

  • isDynamicSubTypes → Boolean flag to indicate if the request has dynamic subtypes.

  • customerSignersIdentifiers → List of identifiers for customers who must sign the request (e.g., phone, email, userId).

  • minimumRequiredSignatories → Minimum number of signers required for the request to be valid.

Workflow:

  1. Send a POST request with the required headers and request body.

  2. Receive a response with the request ID upon successful creation.

post
Path parameters
typeIdinteger · int32Required
Body
userDeviceUtcTimestring · date-time | nullableOptional
isDynamicSubTypesbooleanOptional
customerSignersIdentifiersstring[] | nullableOptional
minimumRequiredSignatoriesinteger · int32 | nullableOptional
Responses
200

Success

post
/api/BusinessRequest/Create/{typeId}
POST /api/BusinessRequest/Create/{typeId} HTTP/1.1
Host: 
Content-Type: application/json-patch+json
Accept: */*
Content-Length: 242

{
  "geoLocation": {
    "latitude": 1,
    "longitude": 1
  },
  "userDeviceUtcTime": "2025-11-08T01:05:07.832Z",
  "requestFieldsValues": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "isDynamicSubTypes": true,
  "customerSignersIdentifiers": [
    "text"
  ],
  "minimumRequiredSignatories": 1
}
200

Success

{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "requestNumber": "text",
    "type": 0,
    "typeName": "text",
    "contractTypeId": 1,
    "contractTypeName": "text",
    "requestFields": [
      {
        "order": 1,
        "key": "text",
        "displayText": "text",
        "displayArText": "text",
        "value": "text",
        "multiValues": [
          "text"
        ],
        "tabularData": [
          [
            "text"
          ]
        ],
        "type": "text",
        "visibleToUser": true,
        "defaultValue": "text",
        "defaultArValue": "text",
        "availableValues": [
          "text"
        ],
        "firstRowHeader": true,
        "convertNumbersToArabic": true,
        "availableValuesItems": [
          {
            "id": 1,
            "name": "text",
            "relatedQuestions": "[Circular Reference]"
          }
        ],
        "parentQuestionKey": "text",
        "parentQuestionValue": "text",
        "relatedQuestions": [
          {
            "order": 1,
            "key": "text",
            "displayText": "text",
            "displayArText": "text",
            "value": "text",
            "multiValues": [
              "text"
            ],
            "tabularData": [
              [
                "text"
              ]
            ],
            "type": "text",
            "visibleToUser": true,
            "defaultValue": "text",
            "defaultArValue": "text",
            "availableValues": [
              "text"
            ],
            "firstRowHeader": true,
            "convertNumbersToArabic": true,
            "availableValuesItems": "[Circular Reference]",
            "parentQuestionKey": "text",
            "parentQuestionValue": "text",
            "relatedQuestions": "[Circular Reference]",
            "groupTitle": "text",
            "groupArTitle": "text"
          }
        ],
        "groupTitle": "text",
        "groupArTitle": "text"
      }
    ],
    "relatedBusinessRequest": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "requestNumber": "text",
        "type": 0,
        "typeName": "text",
        "contractTypeId": 1,
        "contractTypeName": "text",
        "requestFields": [
          {
            "order": 1,
            "key": "text",
            "displayText": "text",
            "displayArText": "text",
            "value": "text",
            "multiValues": [
              "text"
            ],
            "tabularData": [
              [
                "text"
              ]
            ],
            "type": "text",
            "visibleToUser": true,
            "defaultValue": "text",
            "defaultArValue": "text",
            "availableValues": [
              "text"
            ],
            "firstRowHeader": true,
            "convertNumbersToArabic": true,
            "availableValuesItems": [
              {
                "id": 1,
                "name": "text",
                "relatedQuestions": "[Circular Reference]"
              }
            ],
            "parentQuestionKey": "text",
            "parentQuestionValue": "text",
            "relatedQuestions": [
              {
                "order": 1,
                "key": "text",
                "displayText": "text",
                "displayArText": "text",
                "value": "text",
                "multiValues": [
                  "text"
                ],
                "tabularData": [
                  [
                    "text"
                  ]
                ],
                "type": "text",
                "visibleToUser": true,
                "defaultValue": "text",
                "defaultArValue": "text",
                "availableValues": [
                  "text"
                ],
                "firstRowHeader": true,
                "convertNumbersToArabic": true,
                "availableValuesItems": "[Circular Reference]",
                "parentQuestionKey": "text",
                "parentQuestionValue": "text",
                "relatedQuestions": "[Circular Reference]",
                "groupTitle": "text",
                "groupArTitle": "text"
              }
            ],
            "groupTitle": "text",
            "groupArTitle": "text"
          }
        ],
        "relatedBusinessRequest": [
          {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "requestNumber": "text",
            "type": 0,
            "typeName": "text",
            "contractTypeId": 1,
            "contractTypeName": "text",
            "requestFields": "[Circular Reference]",
            "relatedBusinessRequest": "[Circular Reference]",
            "customerSignersIdentifiers": [
              "text"
            ]
          }
        ],
        "customerSignersIdentifiers": [
          "text"
        ]
      }
    ],
    "customerSignersIdentifiers": [
      "text"
    ]
  },
  "error_code": 1,
  "error_message": "text",
  "error_descriptions": null
}

async function createBusinessRequest(typeId, geoLocation, requestFieldsValues) {
  const url = `https://api.vlenseg.com/api/BusinessRequest/Create/${typeId}`;
  const headers = {
    "Content-Type": "application/json",
    "ApiKey": "<your-api-key>",
    "Authorization": "Bearer <accessToken>"
  };
  const body = JSON.stringify({
    geoLocation,
    requestFieldsValues
  });

  try {
    const response = await fetch(url, {
      method: 'POST',
      headers,
      body
    });
    if (response.ok) {
      const data = await response.json();
      console.log(data);
    } else {
      console.error(`Error: ${response.status} - ${response.statusText}`);
    }
  } catch (error) {
    console.error('Fetch error:', error);
  }
}

createBusinessRequest(
  "123",
  { latitude: 34.0522, longitude: -118.2437 },
  { field1: "value1", field2: "value2" }
);

Last updated