Criar documento no PandaDoc, por uma API

Cria um documento a partir de um template (template_uuid) ou de um PDF público (url e name). Fica em document.uploaded por alguns segundos e depois vira document.draft. Nada é enviado: chame Send document quando Get document status mostrar document.draft.

Identificador
pandadoc_create_document

A chamada

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": []
  }
}

Seu sistema envia o id da conexão do cliente e os argumentos da tool. Os headers são os mesmos de toda a API do Connect: o token do seu produto e o token do cliente.

Parâmetros

As descrições dos parâmetros seguem a documentação oficial do app, em inglês.

ParâmetroTipoObrigatórioDescrição
template_uuidstringNãoId of the template, from List templates. Send it or url, never both.
urlstringNãoPublic 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_fieldsbooleanNãoOnly with url: true when the PDF has form fields, false when it uses PandaDoc field tags.
namestringNãoName of the document. Required with url.
recipientsarraySimPeople who receive the document. Each one needs email or phone.
tokensarrayNãoValues of the template variables, as listed by Get template.
fieldsobjectNãoValues 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.
textsarrayNãoContent for the text blocks of the template, by block name, as listed by Get template.
pricing_tablesarrayNãoContent 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_uuidstringNãoFolder for the document, with the uuid from List document folders. Omit it for the root folder.
metadataobjectNãoYour own key-value data stored with the document, like the id of the deal in your system.
tagsarrayNãoTags of the document.

Conexões possíveis

O seu cliente conecta a conta do PandaDoc uma vez, por um dos modos abaixo. A mesma conexão serve para todas as tools do toolkit.

Chave de API

O cliente cola a chave do app numa tela do Connect, ou o seu sistema envia a chave por POST /api/customer-toolkits, sem tela.

OAuth com o app do seu produto

Você cadastra o app OAuth do seu produto uma vez, em POST /api/merchants/credentials/pandadoc, e o cliente autoriza a conta numa tela de consentimento. O Connect renova o token quando ele está para vencer.

A resposta

Em caso de sucesso, o Connect preserva o status e o corpo da resposta do app. Erros HTTP retornados pelo app usam o envelope {error, api_error}; falhas de autenticação ou validação podem ocorrer antes da execução. O header X-Toolkit-Execution-Id identifica a execução registrada, consultável em GET /api/tools/executions/{uuid}.

Pronta para agentes de IA

O input desta tool é um JSON Schema, disponível em GET /api/tools/pandadoc_create_document. Ele vira a definição de tool do seu agente sem conversão.

Outras tools do PandaDoc

Ver as 12 tools

Toolkits da mesma categoria

Ver os 100 toolkits

Veja o Connect aplicado ao seu produto.

Teste por 15 dias sem cartão, ou mostre seu cenário ao nosso time.