notarize 1.2.0
notarize python sdk

# Notarize Python SDK

https://pypi.org/project/notarize/

The Notarize Python library provides methods for hitting the Notarize Business and Real Estate APIs.

## Table of Contents  
1. [Installation](#installation)  
2. [Build](#build)  
3. [Contributing](#contributing)  
    1.  [Requirements](#requirements)  
4. [Usage](#usage)
    1.  [Set api key](#apikey)  
    2.  [Business Transactions](#businesstransactions)  
        a. [Create Business Transaction](#createbusinesstransactions)  
        b. [Retrieve a Business Transaction](#retrievebusinesstransactions)  
        c. [Add a document to a Business Transaction](#adddocument)  
        d. [Activate a Draft Business Transaction](#activatetransaction)  
        e. [Delete a Business Transaction](#deletetransaction)  
    3.  [Real Estate/Lender Transactions](#realtransactions)  
        a. [Create Business Transaction](#createrealtransactions)  
        b. [Retrieve a Real Estate/Lender Transaction](#retrieverealtransactions)  
        c. [Add a document to a Real Estate/Lender Transaction](#realadddocument)  
        d. [Activate a Draft Real Estate/ Lender Transaction](#realactivatetransaction)  
        e. [Delete a Real Estate/Lender Transaction](#realdeletetransaction)  


See the [Notarize API docs](https://dev.notarize.com/).


## Installation <a name="installation"></a>

You don't need this source code unless you want to modify the package. If you just want to use the
package you can run:

```sh
pip install notarize
```

install from source
```sh
python setup.py install
```

pip installing locally
```sh
git clone https://github.com/notarize/notarize-python
cd notarize-python
pip uninstall notarize # if its uninstalled
cd /path/to/notarize-python
pip install -e .
```




## Developing <a name="build"></a>
```sh
git clone https://github.com/notarize/notarize-python
sh dev-setup.sh
```
then you can start making changes

### Requirements <a name="requirements"></a>

- The requirements can be installed with `pip install -r requirements.txt`
- Alternatively, to create a virtual environment and install the requirements there, you can run
the developer setup script `dev-setup.sh`

## Usage <a name="usage"></a>

To use the Notarize API you will need the API key for your organization.

### Set api key<a name="apikey"></a>


```python
import notarize
from notarize.business.transactions import retrieve_transaction

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

# Get transaction info
response = retrieve_transaction(transaction_id)
```

### Business Transactions <a name="businesstransactions"></a>

needs a business apikey get from 
https://business.fairfax.notarize.com/settings/api
#### Create a Business Transaction <a name="businesstransactions"></a>

```python
import notarize

from notarize.business import create_transaction

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

params = {
    "documents": [
		{
		    "requirement": "esign",
			"customer_can_annotate": True,
			"resource": "www.test.com/sample.pdf"
		}
	],
    "signers": [
        {
		    "email": "user@google.com",
		    "first_name": "josh",
                    "last_name": "smith",
		}
    ],
    "draft": False,
    "suppress_email": False,
    "transaction_type": "Youse It",
    "transaction_name": "test transaction"
    "redirect": {
        "url": "www.test.com/redirect",
        "message": "Provide Feedback"
    }
}

response = create_transaction(params)
# {'id': 'ot_d5mjbzr', 'date_created': '2022-09-21T19:25:34.717763Z', 'date_updated': '2022-09-21T19:25:34.741482Z', 'transaction_name': 'Untitled Transaction' ...
```

#### Retrieve a Business Transaction <a name="retrievebusinesstransactions"></a>

```python
import notarize

from notarize.business import retrieve_transaction

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

params = {
    "documents": [ {
        "requirement": "esign",
        "customer_can_annotate": True,
        "resource": "www.test.com/sample.pdf"
    }
    ],
    "signers": [
        {
            "email": "user@google.com",
            "first_name": "josh",
            "last_name": "smith",
        }
    ],
    "draft": False,
    "suppress_email": False,
    "transaction_type": "Youse It",
    "transaction_name": "test transaction"
    "redirect": {
        "url": "www.test.com/redirect",
        "message": "Provide Feedback"
    }
}

retrieve_transaction("transaction_id")
# {'id': 'ot_nzp5b8k', 'date_created': '2022-09-21T19:26:49.459824Z', 'date_updated': '2022-09-21T19:26:49.479209Z', 'transaction_name': 'Untitled Transaction', 'documents': [{'id': 'do_bba6908c-2681-4a37-ada3-f380e2856bc4', 'allowed_actions': ['
```

#### Add a document to a Business Transaction <a name="adddocument"></a>

```python
import notarize

from notarize.business import add_document

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

param = {
    "document": "http://www.africau.edu/images/default/sample.pdf",
    "requirement": "esign",
    "signing_designation_groups": [
        {
            "name": "radio_group",
            "min_required": 1,
            "max_required": 1
        },
        {
            "name": "min_1_max_1",
            "min_required": 0,
            "max_required": 4
        }
    ],
    "signing_designations": [
        {
            "signer_identifier": "signer1",
            "page_number": 1,
            "x": 1,
            "y": 2,
            "height": 10,
            "width": 11,
            "type": "radio_checkmark",
            "signing_designation_group": "radio_group"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 1,
            "x": 15,
            "y": 2,
            "height": 10,
            "width": 11,
            "type": "radio_checkmark",
            "signing_designation_group": "radio_group"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 1,
            "x": 30,
            "y": 2,
            "height": 10,
            "width": 11,
            "type": "radio_checkmark",
            "signing_designation_group": "radio_group"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 1,
            "y": 15,
            "height": 10,
            "width": 11,
            "type": "checkmark",
            "signing_designation_group": "min_1_max_1"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 15,
            "y": 15,
            "height": 10,
            "width": 11,
            "type": "checkmark",
            "signing_designation_group": "min_1_max_1"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 30,
            "y": 15,
            "height": 10,
            "width": 11,
            "type": "checkmark",
            "signing_designation_group": "min_1_max_1"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 60,
            "y": 100,
            "height": 10,
            "width": 50,
            "type": "signature"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 10,
            "y": 100,
            "height": 10,
            "width": 50,
            "type": "signature"
        }
    ]
}

response = add_document("transation gid", params)
# {'id': 'do_995d7a3a-6114-4e23-8638-97d6f378bb6a', 'allowed_actions': 
# ['ESIGN_REQUIRED'], 'bundle_position': 2, 'completion_state':...
```

#### Activate a Draft Transaction<a name="activatetransaction"></a>

```python
import notarize

from notarize.business import activate_transaction

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

delete_transaction("transaction gid", params)
# {'id': 'ot_d5mjbzr', 'date_created': '2022-09-21T19:25:34.717763Z', 'date_updated': # '2022-09-21T19:25:36.719323Z', 'transaction_name': 'Untitled Transaction', 
```

#### Delete a Draft Transaction<a name="deletetransaction"></a>

```python
import notarize

from notarize.business import delete_transaction 

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

delete_transaction('transaction gid')
# {'message': 'Deleted Transaction <txn id> successfully'}
```

### RealEstate/ Lender Transactions <a name="realtransactions"></a>

needs a business apikey get from 
https://business.fairfax.notarize.com/settings/api
#### Create a Business Transaction <a name="realtransactions"></a>

```python
import notarize

from notarize.realestate import create_transaction

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

params = {
		"documents": [
				{
						"requirement": "esign",
						"customer_can_annotate": True,
						"resource": "www.test.com/sample.pdf"
				}
		],

		"signers": [

				{
						"email": "user@google.com",
						"first_name": "josh",
						"last_name": "smith",
				}

		],

		"draft": False,
		"suppress_email": False,
		"transaction_type": "Youse It",
		"transaction_name": "test transaction"
		"redirect": {
				"url": "www.test.com/redirect",
				"message": "Provide Feedback"
		}
}

response = create_transaction(params)

```

#### Retrieve a RealEstate/Lender Transaction <a name="retrieverealtransactions"></a>

```python
import notarize

from notarize.realestate import retrieve_transaction

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

params = {
    "documents": [ {
        "requirement": "esign",
        "customer_can_annotate": True,
        "resource": "www.test.com/sample.pdf"
    }
    ],
    "signers": [
        {
            "email": "user@google.com",
            "first_name": "josh",
            "last_name": "smith",
        }
    ],
    "draft": False,
    "suppress_email": False,
    "transaction_type": "Youse It",
    "transaction_name": "test transaction"
    "redirect": {
        "url": "www.test.com/redirect",
        "message": "Provide Feedback"
    }
}



retrieve_tranaction("transaction_id")
```

#### Add a document to a RealEstate/ Lender Transaction <a name="realadddocument"></a>

```python
import notarize

from notarize.realestate import add_document

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

param = {
    "document": "http://www.africau.edu/images/default/sample.pdf",
    "requirement": "esign",
    "signing_designation_groups": [
        {
            "name": "radio_group",
            "min_required": 1,
            "max_required": 1
        },
        {
            "name": "min_1_max_1",
            "min_required": 0,
            "max_required": 4
        }
    ],
    "signing_designations": [
        {
            "signer_identifier": "signer1",
            "page_number": 1,
            "x": 1,
            "y": 2,
            "height": 10,
            "width": 11,
            "type": "radio_checkmark",
            "signing_designation_group": "radio_group"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 1,
            "x": 15,
            "y": 2,
            "height": 10,
            "width": 11,
            "type": "radio_checkmark",
            "signing_designation_group": "radio_group"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 1,
            "x": 30,
            "y": 2,
            "height": 10,
            "width": 11,
            "type": "radio_checkmark",
            "signing_designation_group": "radio_group"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 1,
            "y": 15,
            "height": 10,
            "width": 11,
            "type": "checkmark",
            "signing_designation_group": "min_1_max_1"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 15,
            "y": 15,
            "height": 10,
            "width": 11,
            "type": "checkmark",
            "signing_designation_group": "min_1_max_1"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 30,
            "y": 15,
            "height": 10,
            "width": 11,
            "type": "checkmark",
            "signing_designation_group": "min_1_max_1"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 60,
            "y": 100,
            "height": 10,
            "width": 50,
            "type": "signature"
        },
        {
            "signer_identifier": "signer1",
            "page_number": 0,
            "x": 10,
            "y": 100,
            "height": 10,
            "width": 50,
            "type": "signature"
        }
    ]
}

response = add_document("transation gid", params)
```


#### Activate a Draft RealEstate Transaction<a name="realactivatetransaction"></a>

```python
import notarize

from notarize.realestate import activate_transaction

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

params = {"suppress_email" : True}
activate_transaction("transaction gid", params)

```

#### Delete a Draft Transaction<a name="realdeletetransaction"></a>

```python
import notarize

from notarize.realestate import delete_transaction 

# Set your API key
notarize.api_key = 'api_key' # get apikey in the business 

delete_transaction('transaction gid')
# {'message': 'Deleted Transaction <txn id> successfully'}
```