acp_create_session
Create a checkout session to generate DOCX or PDF documents from templates. Pass template details and data records, then receive a Stripe checkout URL for payment.
Instructions
Create an ACP checkout session to generate documents without a BulkRender account. Pricing: $0.10/credit — DOCX = 1 credit, PDF = 2 credits. Minimum charge $1.00 (covers up to 10 DOCX or 5 PDF docs). Pass 'records' array (up to 200 objects) with one data object per document. Agents are responsible for passing all required template variable mappings — variables not provided will render as empty strings. Returns session_id, amount_due (USD), checkout_url (Stripe hosted payment page), and expires_at. Share checkout_url for browser payment, then poll acp_get_session until status is 'completed'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bearerToken | Yes | Any non-empty string — acts as your session bearer token | |
| templateType | Yes | 'B' = use a public template by ID, 'C' = bring your own DOCX | |
| templateId | No | Required for template_type B — UUID from acp_list_public_templates | |
| templateBuffer | No | Required for template_type C — base64-encoded DOCX content | |
| templateName | No | Required for template_type C — filename e.g. my-doc.docx | |
| records | Yes | Array of data objects, one per document (max 200). Each object fills one document using the template variables. All documents use the same template and output_format. Keys must match the template field_schema variables — missing keys render as empty strings. | |
| agentEmail | Yes | Email address to associate with this session | |
| outputFormat | No | Output format for ALL documents in this session — docx (1 credit/$0.10) or pdf (2 credits/$0.20). $1.00 minimum applies. | docx |