Generate a contract
Files
Generate Contract
Generates a PDF contract for an order using tenant-configured templates.
POST
Generate a contract
Overview
Generate a contract document for an order. Contracts are automatically populated with order details, customer information, and your tenant’s terms and branding.Request Fields
| Field | Required | Description |
|---|---|---|
orderId | Yes | Order to generate contract for |
templateId | No | Custom template ID (uses default if not specified) |
Example Request
What Gets Generated
The contract includes:- Customer Information: Name, company, contact details
- Order Details: Items, quantities, pricing
- Billing Terms: Payment schedule, amounts
- Contract Terms: Duration, conditions
- Your Branding: Logo, company info from tenant settings
Response
Example: Generate and Attach to Order
Contract Templates
Contracts use templates configured in your tenant settings:- Default Template: Standard contract layout
- Custom Templates: Industry or use-case specific formats
Common Use Cases
- Order Confirmation: Generate contract when order is confirmed
- Customer Portal: Let customers download their contracts
- Compliance: Maintain signed contract records
- Automation: Auto-generate contracts on order creation
Example: Auto-Generate on Order Confirm
Error Handling
| Error Code | Cause | Solution |
|---|---|---|
ORDER_NOT_FOUND | Invalid order ID | Verify order exists |
TEMPLATE_NOT_FOUND | Invalid template ID | Use valid template or omit for default |
Related Endpoints
- Get File - Get contract metadata
- Get File URL - Get download URL
- List Files - View all order documents
- Get Order - View order details
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier