[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-recipes\u002Fdocument-requisites":3,"docs-tabs-recipes\u002Fdocument-requisites":6},{"content":4,"lastmod":5},"# Company requisites for document generation\n\n**Difficulty:** medium | **Scopes:** crm, documentgenerator | **Stack:** cURL \u002F JavaScript\n\nCollect the client's legal details for a deal — the company requisite, the bank account and the legal address — and pass the collected values into a document template. The result is a document in your Bitrix24 account with links to the file.\n\n## What you need\n\n- A Vibecode API key with the `crm` and `documentgenerator` scopes\n- A deal with a company filled in, and a company that has requisites\n- A document template in your Bitrix24 account\n- Node.js 18 or newer\n\nIn all examples `$VIBE_URL` is the base address `https:\u002F\u002Fvibecode.bitrix24.com` and `$VIBE_API_KEY` is your API key.\n\n## How the solution works\n\n1. From the deal, find the company and which of its requisites is selected for this deal.\n2. Read the requisite: the company name and the VAT ID.\n3. Take the requisite's bank account: current account, BIC, correspondent account.\n4. Pick the legal one among the requisite's addresses.\n5. Pass the collected values into the template and get a document with links to the file.\n\nThe step examples show individual calls. The ready-to-run script is in the \"Full code\" section.\n\n## Step 1. Deal: company and the selected requisite\n\n[`GET \u002Fv1\u002Fdeals\u002F:id`](\u002Fdocs\u002Fentities\u002Fdeals\u002Fget) returns the deal's company in the `companyId` field.\n\n### cURL\n\n```bash\ncurl -s -H \"X-Api-Key: $VIBE_API_KEY\" \"$VIBE_URL\u002Fv1\u002Fdeals\u002F5289?select=id,title,companyId\"\n```\n\n### JavaScript\n\n```javascript\nconst res = await fetch(`${VIBE_URL}\u002Fv1\u002Fdeals\u002F${dealId}?select=id,title,companyId`, {\n  headers: { 'X-Api-Key': VIBE_API_KEY },\n})\nconst { data: deal } = await res.json()\n```\n\n```json\n{ \"success\": true, \"data\": { \"id\": 5289, \"title\": \"Equipment supply\", \"companyId\": 42 } }\n```\n\nA company can have several requisites, and the requisite link determines which of them applies to this deal. [`GET \u002Fv1\u002Frequisite-links\u002F:entityTypeId\u002F:entityId`](\u002Fdocs\u002Fentities\u002Frequisite-links\u002Fget) returns it by a pair of values: `2` — deal, then the deal identifier.\n\n### cURL\n\n```bash\ncurl -s -H \"X-Api-Key: $VIBE_API_KEY\" \"$VIBE_URL\u002Fv1\u002Frequisite-links\u002F2\u002F5289\"\n```\n\n### JavaScript\n\n```javascript\nconst res = await fetch(`${VIBE_URL}\u002Fv1\u002Frequisite-links\u002F2\u002F${dealId}`, {\n  headers: { 'X-Api-Key': VIBE_API_KEY },\n})\nconst link = res.status === 404 ? null : (await res.json()).data\n```\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"entityTypeId\": 2,\n    \"entityId\": 5289,\n    \"requisiteId\": 305,\n    \"bankDetailId\": 0,\n    \"mcRequisiteId\": 3,\n    \"mcBankDetailId\": 3\n  }\n}\n```\n\nA `0` in any of the four identifiers means there is no binding. The `requisiteId` and `bankDetailId` fields describe the client side, `mcRequisiteId` and `mcBankDetailId` describe your own company. Both sets of identifiers arrive in one call, and the requisites themselves are read in the steps below — each by its own identifier.\n\nIf the deal has no link, the call returns `404`. Branch on the response status rather than on the code: this `404` has two codes — `ENTITY_NOT_FOUND` when Bitrix24 returned an error, and `NOT_FOUND` when it returned an empty result.\n\n```json\n{ \"success\": false, \"error\": { \"code\": \"ENTITY_NOT_FOUND\", \"message\": \"Not found\" } }\n```\n\nThis is an expected state, not a failure: no requisite has been selected for the deal yet. In that case take the company requisites from step 2 and pick the first one.\n\n## Step 2. Company requisite\n\nWhen the link carries a `requisiteId`, the requisite is read by identifier — [`GET \u002Fv1\u002Frequisites\u002F:id`](\u002Fdocs\u002Fentities\u002Frequisites\u002Fget). When there is no link, the company requisites are selected by [`POST \u002Fv1\u002Frequisites\u002Fsearch`](\u002Fdocs\u002Fentities\u002Frequisites\u002Fsearch) with a pair of conditions: `entityTypeId` equals `4` — company, `entityId` — the company identifier from step 1.\n\n### cURL\n\n```bash\ncurl -s -X POST -H \"X-Api-Key: $VIBE_API_KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  \"$VIBE_URL\u002Fv1\u002Frequisites\u002Fsearch\" \\\n  -d '{\n    \"filter\": { \"entityTypeId\": 4, \"entityId\": 42 },\n    \"select\": [\"id\", \"name\", \"presetId\", \"rqCompanyName\", \"rqCompanyFullName\", \"rqVatId\", \"rqInn\", \"rqKpp\", \"rqOgrn\", \"rqDirector\"],\n    \"limit\": 50\n  }'\n```\n\n### JavaScript\n\n```javascript\nconst res = await fetch(`${VIBE_URL}\u002Fv1\u002Frequisites\u002Fsearch`, {\n  method: 'POST',\n  headers: { 'X-Api-Key': VIBE_API_KEY, 'Content-Type': 'application\u002Fjson' },\n  body: JSON.stringify({\n    filter: { entityTypeId: 4, entityId: deal.companyId },\n    select: ['id', 'name', 'presetId', 'rqCompanyName', 'rqCompanyFullName', 'rqVatId', 'rqInn', 'rqKpp', 'rqOgrn', 'rqDirector'],\n    limit: 50,\n  }),\n})\nconst { data: requisites } = await res.json()\n```\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 305,\n      \"name\": \"Main requisite\",\n      \"presetId\": 1,\n      \"rqCompanyName\": \"Acme\",\n      \"rqCompanyFullName\": null,\n      \"rqVatId\": \"GB123456789\",\n      \"rqInn\": null,\n      \"rqKpp\": null,\n      \"rqOgrn\": null,\n      \"rqDirector\": null\n    }\n  ],\n  \"meta\": { \"total\": 1, \"hasMore\": false, \"durationMs\": 360 }\n}\n```\n\nThe set of filled fields is defined by the requisite preset — `presetId`. Which presets exist depends on the account country: an international Bitrix24 account has two built-in ones, `Company` and `Person`. The `Company` preset carries the company name and the VAT ID, the `Person` preset carries identity-document fields, and any field a preset does not define arrives as `null`. The field set of a specific preset is returned by [`GET \u002Fv1\u002Frequisite-presets\u002F:presetId\u002Ffields`](\u002Fdocs\u002Fentities\u002Frequisite-presets\u002Fpreset-fields\u002Flist).\n\n## Step 3. Bank account\n\nA bank account belongs to a requisite, not to a company: in the filter, `entityId` is the requisite identifier from step 2. The owner of a bank account is always of the same type, so the pair of values that addresses require is not needed here. Accounts are selected by [`POST \u002Fv1\u002Fbank-details\u002Fsearch`](\u002Fdocs\u002Fentities\u002Fbank-details\u002Fsearch).\n\n### cURL\n\n```bash\ncurl -s -X POST -H \"X-Api-Key: $VIBE_API_KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  \"$VIBE_URL\u002Fv1\u002Fbank-details\u002Fsearch\" \\\n  -d '{\n    \"filter\": { \"entityId\": 305 },\n    \"select\": [\"id\", \"name\", \"rqBankName\", \"rqBik\", \"rqAccNum\", \"rqCorAccNum\"],\n    \"limit\": 50\n  }'\n```\n\n### JavaScript\n\n```javascript\nconst res = await fetch(`${VIBE_URL}\u002Fv1\u002Fbank-details\u002Fsearch`, {\n  method: 'POST',\n  headers: { 'X-Api-Key': VIBE_API_KEY, 'Content-Type': 'application\u002Fjson' },\n  body: JSON.stringify({\n    filter: { entityId: requisite.id },\n    select: ['id', 'name', 'rqBankName', 'rqBik', 'rqAccNum', 'rqCorAccNum'],\n    limit: 50,\n  }),\n})\nconst { data: accounts } = await res.json()\n```\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 5,\n      \"name\": \"Main account\",\n      \"rqBankName\": \"First Bank\",\n      \"rqBik\": \"123456789\",\n      \"rqAccNum\": \"12345678901234567890\",\n      \"rqCorAccNum\": \"09876543210987654321\"\n    }\n  ],\n  \"meta\": { \"total\": 1, \"hasMore\": false, \"durationMs\": 583 }\n}\n```\n\nThere may be no bank account at all — then `data` comes back as an empty array and `meta.total` as zero. That is enough for an acceptance certificate or a power of attorney, but not for an invoice, so check the array before substituting the values into the template.\n\n## Step 4. Legal address\n\nThe requisite's addresses are returned by [`GET \u002Fv1\u002Faddresses`](\u002Fdocs\u002Fentities\u002Faddresses\u002Flist) with a filter: `entityTypeId` equals `8` — requisite, `entityId` — the requisite identifier.\n\n### cURL\n\n```bash\ncurl -g -s -H \"X-Api-Key: $VIBE_API_KEY\" \\\n  \"$VIBE_URL\u002Fv1\u002Faddresses?filter[entityTypeId]=8&filter[entityId]=305\"\n```\n\n### JavaScript\n\n```javascript\nconst res = await fetch(\n  `${VIBE_URL}\u002Fv1\u002Faddresses?filter[entityTypeId]=8&filter[entityId]=${requisite.id}`,\n  { headers: { 'X-Api-Key': VIBE_API_KEY } },\n)\nconst { data: addresses } = await res.json()\n```\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"typeId\": 6,\n      \"entityTypeId\": 8,\n      \"entityId\": 305,\n      \"address1\": \"123 Main St, floor 1\",\n      \"address2\": \"Suite 2\",\n      \"city\": \"Springfield\",\n      \"postalCode\": \"62701\",\n      \"region\": null,\n      \"province\": \"Illinois\",\n      \"country\": \"United States\",\n      \"countryCode\": null,\n      \"locAddrId\": 465,\n      \"anchorTypeId\": 4,\n      \"anchorId\": 42\n    }\n  ],\n  \"meta\": { \"total\": 1, \"hasMore\": false }\n}\n```\n\nThe address type is set by `typeId`. For a document take the legal one — `6` — and when it is missing, the actual one — `1`. Which codes are available depends on the account country, so pick the type from what actually arrived in the response. The full code reference is in [Get address](\u002Fdocs\u002Fentities\u002Faddresses\u002Fget).\n\nAssemble the string for the template from the response fields in the order you need: `postalCode`, `country`, `province`, `city`, `address1`, `address2`. Unfilled fields arrive as `null`, so drop empty values and duplicates before joining: `city` and `province` sometimes hold the same value, and without deduplication the city would appear in the string twice.\n\n## Step 5. Document from a template\n\n[`POST \u002Fv1\u002Fdocuments`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcreate) builds the file from a template. The template identifier comes from [`GET \u002Fv1\u002Fdoc-templates`](\u002Fdocs\u002Fentities\u002Fdoc-templates), the collected values are passed in `values`, and `value` is your external identifier of the source object.\n\n### cURL\n\n```bash\ncurl -s -X POST -H \"X-Api-Key: $VIBE_API_KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  \"$VIBE_URL\u002Fv1\u002Fdocuments\" \\\n  -d '{\n    \"templateId\": 237,\n    \"providerClassName\": \"Bitrix\\\\DocumentGenerator\\\\DataProvider\\\\Rest\",\n    \"value\": \"DEAL-5289\",\n    \"values\": {\n      \"CompanyName\": \"Acme\",\n      \"CompanyInn\": \"1234567890\",\n      \"CompanyAddress\": \"62701, United States, Illinois, Springfield, 123 Main St, floor 1, Suite 2\"\n    }\n  }'\n```\n\n### JavaScript\n\n```javascript\nconst res = await fetch(`${VIBE_URL}\u002Fv1\u002Fdocuments`, {\n  method: 'POST',\n  headers: { 'X-Api-Key': VIBE_API_KEY, 'Content-Type': 'application\u002Fjson' },\n  body: JSON.stringify({\n    templateId: TEMPLATE_ID,\n    providerClassName: 'Bitrix\\\\DocumentGenerator\\\\DataProvider\\\\Rest',\n    value: `DEAL-${dealId}`,\n    values,\n  }),\n})\nconst { data: document } = await res.json()\n```\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 1895,\n    \"title\": \"Supply contract A003\u002F\u002F08\u002F2026\",\n    \"number\": \"A003\u002F\u002F08\u002F2026\",\n    \"templateId\": 237,\n    \"provider\": \"Bitrix\\\\DocumentGenerator\\\\DataProvider\\\\Rest\",\n    \"value\": \"DEAL-5289\",\n    \"values\": {\n      \"productsTableVariant\": \"\",\n      \"_creationMethod\": \"rest\",\n      \"CompanyName\": \"Acme\",\n      \"CompanyInn\": \"1234567890\",\n      \"CompanyAddress\": \"62701, United States, Illinois, Springfield, 123 Main St, floor 1, Suite 2\"\n    },\n    \"createTime\": \"2026-08-10T08:35:44.000Z\",\n    \"createdBy\": 1,\n    \"stampsEnabled\": false,\n    \"isTransformationError\": false,\n    \"downloadUrl\": \"\u002Fbitrix\u002Fservices\u002Fmain\u002Fajax.php?action=documentgenerator.api.document.getfile&SITE_ID=s1&id=1895\"\n  }\n}\n```\n\n`downloadUrl` is a path relative to the Bitrix24 account address. A user signed in to Bitrix24 opens the file in the browser via this path. A document built from a REST template has no `downloadUrlMachine` field, and its file cannot be downloaded with an API key.\n\n## Limitations\n\n**The link picks the requisite, not the record order.** A company can have several requisites — an old one and the current one, a head office and a branch. The first one in the results is not necessarily the right one, so the deal link in step 1 comes before the search by company and overrides its result.\n\n**The PDF link does not appear immediately.** The creation response carries `downloadUrl`, while `pdfUrl` and `imageUrl` arrive after the file has been converted. You get them with a repeat call to [`GET \u002Fv1\u002Fdocuments\u002F:id`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fget). The same response carries `isTransformationError` — the flag that marks a failed conversion.\n\n**A repeat run creates a new document.** The creation endpoint has no separate marker for \"a document for this deal has already been built\". The script below checks for a document by its own `value` through [`GET \u002Fv1\u002Fdocuments`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Flist) with a filter and does not build a second one. The check protects against a repeat run, but not against two simultaneous ones: both copies see an empty result and each creates a document.\n\n**Refusals on document creation.** An unknown `templateId` gives `404` with the `ENTITY_NOT_FOUND` code and a message that the template was not found. If the data provider did not parse `value`, a `422` with the `BITRIX_ERROR` code arrives. The script stops on both and prints the message returned by Bitrix24.\n\n**The template defines the label names.** The keys in `values` are the labels of a specific document template, not the requisite field names. Before the first run, match the label set against the template named in `templateId`.\n\n**The preset decides which requisite fields carry data.** On an international Bitrix24 account the built-in `Company` preset defines the company name, the VAT ID (`rqVatId`), the address, the signature and the stamp. Fields belonging to another country's preset stay in the entity schema and can be requested, but come back as `null`. Read the actual set for your account with [`GET \u002Fv1\u002Frequisite-presets\u002F:presetId\u002Ffields`](\u002Fdocs\u002Fentities\u002Frequisite-presets\u002Fpreset-fields\u002Flist) and keep in `values` only what the preset fills.\n\n**Account queue.** A Bitrix24 account runs a limited number of API requests at a time. A chain of calls per deal — one per step plus the check for an already created document — in a loop over a large list receives `429` with the `QUEUE_OVERFLOW` or `QUEUE_TIMEOUT` code. The recommended pause arrives in the `Retry-After` header and is duplicated in `error.retryAfter`. The full list of codes is in [Errors](\u002Fdocs\u002Ferrors).\n\n## Full code\n\nRun: `VIBE_API_KEY=\u003Ckey> DEAL_ID=\u003Cdeal id> TEMPLATE_ID=\u003Ctemplate id> node deal-document.js`\n\n```javascript\n\u002F\u002F deal-document.js — collects the client requisites for a deal and builds the document\nconst VIBE_URL = process.env.VIBE_URL ?? 'https:\u002F\u002Fvibecode.bitrix24.com'\nconst VIBE_API_KEY = process.env.VIBE_API_KEY\nif (!VIBE_API_KEY) throw new Error('The VIBE_API_KEY environment variable is not set')\n\nconst DEAL_ID = Number(process.env.DEAL_ID)\nconst TEMPLATE_ID = Number(process.env.TEMPLATE_ID)\nif (!DEAL_ID || !TEMPLATE_ID) throw new Error('Set DEAL_ID and TEMPLATE_ID')\n\nconst PROVIDER = 'Bitrix\\\\DocumentGenerator\\\\DataProvider\\\\Rest'\nconst headers = { 'X-Api-Key': VIBE_API_KEY, 'Content-Type': 'application\u002Fjson' }\nconst MAX_RETRIES = 5\n\n\u002F\u002F A 429 refusal means the request never reached Bitrix24 — repeating it is safe.\n\u002F\u002F How long to wait comes from the Retry-After header, or from error.retryAfter when it is absent.\n\u002F\u002F A random fraction of a second is added to the pause so that parallel copies of the script\n\u002F\u002F do not retry at the same moment.\nasync function apiCall(url, init = {}, { allow404 = false } = {}) {\n  for (let attempt = 0; ; attempt++) {\n    const res = await fetch(url, { headers, ...init })\n    if (res.status === 404 && allow404) return null\n    const body = await res.json().catch(() => null)\n\n    if (res.status === 429 && attempt \u003C MAX_RETRIES) {\n      const advised = Number(res.headers.get('Retry-After') || body?.error?.retryAfter)\n      const base = advised > 0 ? advised : Math.min(2 ** attempt, 30)\n      \u002F\u002F The spread is proportional to the pause so that parallel copies of the script do not\n      \u002F\u002F retry at the same moment. The 300-second ceiling is the maximum Bitrix24 reports.\n      const wait = Math.min(base, 300) * (0.75 + Math.random() * 0.5)\n      console.warn(`Account queue is busy, retrying in ${Math.round(wait)} s`)\n      await new Promise(resolve => setTimeout(resolve, wait * 1000))\n      continue\n    }\n\n    if (!body?.success) throw new Error(body?.error?.message ?? `request rejected (${res.status})`)\n    return body.data\n  }\n}\n\nasync function resolveRequisite(dealId) {\n  const deal = await apiCall(`${VIBE_URL}\u002Fv1\u002Fdeals\u002F${dealId}?select=id,title,companyId`)\n  if (!deal?.companyId) throw new Error(`deal ${dealId} has no company filled in`)\n\n  \u002F\u002F The link knows which of the company requisites is selected for this deal.\n  const link = await apiCall(`${VIBE_URL}\u002Fv1\u002Frequisite-links\u002F2\u002F${dealId}`, {}, { allow404: true })\n  if (link?.requisiteId) {\n    const byLink = await apiCall(`${VIBE_URL}\u002Fv1\u002Frequisites\u002F${link.requisiteId}`, {}, { allow404: true })\n    if (byLink) return { deal, requisite: byLink, bankDetailId: link.bankDetailId || null }\n    console.warn(`  requisite ${link.requisiteId} from the link was not found — taking the company requisites`)\n  }\n\n  \u002F\u002F There is no link — take the company requisites and pick the first one.\n  const list = await apiCall(`${VIBE_URL}\u002Fv1\u002Frequisites\u002Fsearch`, {\n    method: 'POST',\n    body: JSON.stringify({\n      filter: { entityTypeId: 4, entityId: deal.companyId },\n      select: ['id', 'name', 'presetId', 'rqCompanyName', 'rqCompanyFullName', 'rqVatId', 'rqInn', 'rqKpp', 'rqOgrn', 'rqDirector'],\n      limit: 50,\n    }),\n  })\n  if (!list?.length) throw new Error(`company ${deal.companyId} has no requisites`)\n  return { deal, requisite: list[0], bankDetailId: null }\n}\n\nasync function resolveAccount(requisiteId, preferredId) {\n  const list = await apiCall(`${VIBE_URL}\u002Fv1\u002Fbank-details\u002Fsearch`, {\n    method: 'POST',\n    body: JSON.stringify({\n      filter: { entityId: requisiteId },\n      select: ['id', 'name', 'rqBankName', 'rqBik', 'rqAccNum', 'rqCorAccNum'],\n      limit: 50,\n    }),\n  })\n  if (!list?.length) return null\n  const chosen = list.find(account => account.id === preferredId)\n  if (preferredId && !chosen) console.warn(`  account ${preferredId} from the link was not found — using ${list[0].id} instead`)\n  return chosen ?? list[0]\n}\n\n\u002F\u002F The legal address is typeId 6; the fallback when it is missing is the actual one, typeId 1.\nasync function resolveLegalAddress(requisiteId) {\n  const list = await apiCall(\n    `${VIBE_URL}\u002Fv1\u002Faddresses?filter[entityTypeId]=8&filter[entityId]=${requisiteId}`,\n  )\n  if (!list?.length) return null\n  return list.find(a => a.typeId === 6) ?? list.find(a => a.typeId === 1) ?? null\n}\n\nfunction formatAddress(address) {\n  if (!address) return ''\n  return [\n    address.postalCode,\n    address.country,\n    address.province,\n    address.city,\n    address.address1,\n    address.address2,\n  ].filter((part, i, all) => part && all.indexOf(part) === i).join(', ')\n}\n\nasync function findExistingDocument(value) {\n  const query = new URLSearchParams({ 'filter[value]': value, select: 'id,value,number' })\n  const list = await apiCall(`${VIBE_URL}\u002Fv1\u002Fdocuments?${query}`)\n  return list?.find(doc => doc.value === value) ?? null\n}\n\nasync function main() {\n  \u002F\u002F The value is stable for a deal, so the check goes FIRST: for an already\n  \u002F\u002F processed deal that is one call to Bitrix24 instead of five.\n  const value = `DEAL-${DEAL_ID}`\n  const existing = await findExistingDocument(value)\n  if (existing) {\n    console.log(`A document for the deal has already been built: ${existing.id} (${existing.number})`)\n    return\n  }\n\n  const { deal, requisite, bankDetailId } = await resolveRequisite(DEAL_ID)\n  const account = await resolveAccount(requisite.id, bankDetailId)\n  const address = await resolveLegalAddress(requisite.id)\n\n  const values = {\n    CompanyName: requisite.rqCompanyName ?? requisite.name ?? '',\n    CompanyFullName: requisite.rqCompanyFullName ?? '',\n    CompanyVatId: requisite.rqVatId ?? '',\n    CompanyInn: requisite.rqInn ?? '',\n    CompanyKpp: requisite.rqKpp ?? '',\n    CompanyOgrn: requisite.rqOgrn ?? '',\n    CompanyDirector: requisite.rqDirector ?? '',\n    CompanyAddress: formatAddress(address),\n    BankName: account?.rqBankName ?? '',\n    BankBik: account?.rqBik ?? '',\n    BankAccount: account?.rqAccNum ?? '',\n    BankCorAccount: account?.rqCorAccNum ?? '',\n  }\n\n  console.log(`Deal ${deal.id}: requisite ${requisite.id}, account ${account?.id ?? 'not set up'}`)\n  \u002F\u002F For an acceptance certificate or a power of attorney empty account fields are enough. For an invoice\n  \u002F\u002F they are not: if you build a payment document, exit here instead of warning.\n  if (!account) console.warn('  bank account not found — the account fields will stay empty')\n  if (!address) console.warn('  address not found — the address field will stay empty')\n\n  const document = await apiCall(`${VIBE_URL}\u002Fv1\u002Fdocuments`, {\n    method: 'POST',\n    body: JSON.stringify({ templateId: TEMPLATE_ID, providerClassName: PROVIDER, value, values }),\n  })\n  console.log(`Document ${document.id} created: ${document.title}`)\n  console.log(`Link for the user: ${document.downloadUrl}`)\n}\n\nmain().catch(error => {\n  console.error(error.message)\n  process.exitCode = 1\n})\n```\n\n## See also\n\n- [Requisites](\u002Fdocs\u002Fentities\u002Frequisites)\n- [Bank details](\u002Fdocs\u002Fentities\u002Fbank-details)\n- [Addresses](\u002Fdocs\u002Fentities\u002Faddresses)\n- [Requisite links](\u002Fdocs\u002Fentities\u002Frequisite-links)\n- [Documents](\u002Fdocs\u002Fentities\u002Fdocuments)\n- [Document templates](\u002Fdocs\u002Fentities\u002Fdoc-templates)\n","2026-10-05",{},1794739453434]