Crear documento en PandaDoc, con una API

Crea un documento a partir de una plantilla (template_uuid) o de un PDF público (url y name). Queda en document.uploaded unos segundos y luego pasa a document.draft. No se envía nada: llama a Send document cuando Get document status muestre document.draft.

Identificador
pandadoc_create_document

La llamada

POST https://connect.reportei.com/api/tools/pandadoc_create_document/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "recipients": []
  }
}

Tu sistema envía el id de la conexión de tu cliente y los argumentos de la tool. Los headers son los mismos de toda la API de Connect: el token de tu producto y el token de tu cliente.

Parámetros

Las descripciones de los parámetros siguen la documentación oficial de la app, en inglés.

ParámetroTipoObligatorioDescripción
template_uuidstringNoId of the template, from List templates. Send it or url, never both.
urlstringNoPublic HTTPS URL of a PDF to build the document from, instead of a template. Requires name. The signers fill the fields marked in the PDF with PandaDoc field tags, or its own form fields when parse_form_fields is true.
parse_form_fieldsbooleanNoOnly with url: true when the PDF has form fields, false when it uses PandaDoc field tags.
namestringNoName of the document. Required with url.
recipientsarraySíPeople who receive the document. Each one needs email or phone.
tokensarrayNoValues of the template variables, as listed by Get template.
fieldsobjectNoValues of the fields by field name, as listed by Get template. Each value is an object with value (text, number, boolean or an RFC 3339 date) and, optionally, the role it belongs to, like {"Company": {"value": "Acme"}}. Signature fields cannot be filled.
textsarrayNoContent for the text blocks of the template, by block name, as listed by Get template.
pricing_tablesarrayNoContent for the pricing tables of the template, by table name, as listed by Get template. Send every product of a table, because the table is rebuilt from what you send.
folder_uuidstringNoFolder for the document, with the uuid from List document folders. Omit it for the root folder.
metadataobjectNoYour own key-value data stored with the document, like the id of the deal in your system.
tagsarrayNoTags of the document.

Conexiones posibles

Tu cliente conecta su cuenta de PandaDoc una sola vez, con uno de los modos de abajo. La misma conexión sirve para todas las tools del toolkit.

Clave de API

Tu cliente pega la clave de la app en una pantalla de Connect, o tu sistema envía la clave con POST /api/customer-toolkits, sin pantalla.

OAuth con la app de tu producto

Registras la app OAuth de tu producto una sola vez, con POST /api/merchants/credentials/pandadoc, y tu cliente autoriza la cuenta en una pantalla de consentimiento. Connect renueva el token cuando está por vencer.

La respuesta

Si la llamada tiene éxito, Connect conserva el status y el cuerpo de la respuesta de la app. Los errores HTTP devueltos por la app usan el objeto {error, api_error}; la autenticación o validación pueden fallar antes de la ejecución. El header X-Toolkit-Execution-Id identifica la ejecución registrada, disponible en GET /api/tools/executions/{uuid}.

Lista para agentes de IA

El input de esta tool es un JSON Schema, disponible en GET /api/tools/pandadoc_create_document. Se convierte en la definición de tool de tu agente sin conversión.

Otras tools de PandaDoc

Ver las 12 tools

Toolkits de la misma categoría

Ver los 100 toolkits

Mira Connect aplicado a tu producto.

Pruébalo durante 15 días sin tarjeta, o cuéntale tu caso a nuestro equipo.