Create on Member's Behalf

Introduction

Create documents on your colleagues' behalf when it's needed. For this, add an owner section to the document creation request.
You can set an owner of a document as an email or membership_id. For membership_id, query List Members.

This recipe assumes:

Define member data to create on his behalf

Use the List Members to retrieve members' data.

[
  {
    "user_id": "ajnN7eGutJZsRKjQrNuPkh",
    "membership_id": "radQBiBkU7MBk59NSgaGf5",
    "email": "[email protected]",
    "first_name": "Josh",
    "last_name": "Ron",
    "is_active": true,
    "workspace": "xc4mBZ7dKErXQtJwwD6Ghg",
    "workspace_name": "PandaDoc",
    "email_verified": true,
    "role": "Admin",
    "user_license": "Full",
    "date_created": "2020-11-17T08:42:34.237567Z",
    "date_modified": "2021-11-30T10:30:35.071428Z"
  },
  {
    "user_id": "THhehtdMkbXNEJUBLCRw85",
    "membership_id": "icLT5zJDkq4NGoZyezKjR4",
    "email": "[email protected]",
    "first_name": "John",
    "last_name": "Snow",
    "is_active": true,
    "workspace": "egq9z84gW6s8S9CAEiXWXd",
    "workspace_name": "PandaDoc",
    "email_verified": true,
    "role": "Manager",
    "user_license": "Full",
    "date_created": "2020-11-18T13:44:23.827698Z",
    "date_modified": "2020-11-18T13:44:23.889319Z"
  }
]

Structure your Document details

Use the create document endpoint description to decide what metadata and details you need to pass to your document.

Use membership_id to create on member's behalf:

{ 
  "name": "My minimal document",
  "owner": {
    "membership_id":"radQBiBkU7MBk59NSgaGfd"
  },
  "recipients": [
  	{
    	"email":"[email protected]"
   	}
  ]
}

Or member email:

{ 
  "name": "My minimal document",
  "owner": {
    "email":"[email protected]"
  },
  "recipients": [
  	{
    	"email":"[email protected]"
   	}
  ]
}

Create the Document

Using your authentication token or API key, and the content-type application/json
POST https://api.pandadoc.com/public/v1/documents
The response will contain the document ID as the element “id”

{
  "id":"XHjv8z3SfDuTseFSnhprML",
  "name":"My minimal document",
  "Status":"document.uploaded",
  "date_created":"2021-07-05T15:05:27.787341Z",
  "date_modified":"2021-07-05T15:05:27.787341Z",
  "Expiration_date":null,
  "Version":null,
  "uuid":"XHjv8z3SfDuTseFSnhprML"
}

Wait for the Document to enter a draft status

See Listening for changes in document status. If you are actively polling your document ID is “id” from the previous step.