PacteryDevelopers

템플릿으로 문서 생성

자주 쓰는 계약서는 템플릿으로 저장해두고 변수만 채워 문서를 만들 수 있습니다.

템플릿 목록

GET /v1/templates
{ "object": "list", "data": [ { "id": "tmpl_a1", "name": "표준 위탁계약서" } ] }

템플릿으로 문서 생성

POST /v1/documents
curl https://api.pactery.com/v1/documents \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "from_template": "tmpl_a1",
    "title": "위탁계약서 - 홍길동",
    "variables": { "client_name": "홍길동", "fee": "월 200만원" }
  }'

템플릿에 정의된 {{client_name}} 같은 변수가 치환되어 draft 문서가 생성됩니다.