Package: acrosure-sdk
# Acrosure Python SDK![Acrosure](./static/Acrosure-color.png)Python version 2 and 3 SDK for connecting with Acrosure Insurance Gateway## InstallationInstall via pip:`pip install acrosure_sdk`## Requirements* Python 2.7.1+* `requests` library## Getting StartedImport AcrosureClient into your project.```pythonfrom acrosure_sdk import AcrosureClient```Instantiate with an API key from [Acrosure Dashboard](https://dashboard.acrosure.com).```pythonacrosure_client = AcrosureClient(token = '<your_api_key>')```## Basic UsageAcrosureClient provides several objects such as `application`, `product`, etc. and associated APIs.Any data will be inside an response object with `data` key, along with meta data, such as:```json{"data": { ... },"status": "ok",...}```### Application#### GetGet application with specified id.```pythonapplication = acrosure_client.application.get('<application_id>')```#### CreateCreate an application.```pythoncreated_application = acrosure_client.application.create(productId = '<product_id>', # requiredbasic_data = {},package_options = {},additional_data = {},package_code = '<package_code>',attachments = [])```#### UpdateUpdate an application.```pythonupdatedApplication = acrosure_client.application.update(application_id = '<application_id>', # requiredbasic_data = {},package_options = {},additional_data = {},package_code = '<package_code>',attachments = [])```#### Get packagesGet current application available packages.```pythonpackages = acrosure_client.application.get_packages('<application_id>')```#### Select packageSelect package for current application.```pythonupdated_application = acrosure_client.application.select_package(application_id = '<application_id>',package_code = '<package_code>')```#### Get packageGet selected package of current application.```pythoncurrent_package = acrosure_client.application.get_package('<application_id>')```#### Get 2C2P hashGet 2C2P hash.```pythonreturned_hash = acrosure_client.application.get_2c2p_hash(application_id = '<application_id>',args = '<arguments>')```#### SubmitSubmit current application.```pythonsubmitted_application = acrosure_client.application.submit('<application_id>')```#### ConfirmConfirm current application._This function needs secret API key._```pythonconfirmed_application = acrosure_client.application.confirm('<application_id>')```#### ListList your applications (with or without query).```pythonapplications = acrosure_client.application.list(query)```### Product#### GetGet product with specified id.```pythonproduct = acrosure_client.product.get('<product_id>')```#### ListList your products (with or without query).```tproducts = acrosure_client.product.list(query)```### Policy#### GetGet policy with specified id.```pythonpolicy = acrosure_client.policy.get('<policy_id>')```#### ListList your policies (with or without query).```pythonpolicies = acrosure_client.policy.list(query)```### Data#### GetGet values for a handler (with or without dependencies, please refer to Acrosure API Document).```python// Without dependenciesvalues = acrosure_client.data.get(handler = '<some_handler>')// With dependenciesvalues = acrosure_client.data.get(handler = '<some_handler>',dependencies = ['<dependency_1>', '<dependency_2>'])```### Team#### Get infoGet current team information.```pythonteam_info = acrosure_client.team.get_info()```### Other functionality#### Verify webhook signatureVerify webhook signature by specify signature and raw data string```pythonis_signature_valid = acrosure_client.verify_webhook(signature = '<signature>',data = '<raw_data>')```## Advanced UsagePlease refer to [this document](https://github.com/Acrosure/acrosure-python-sdk/wiki/Acrosure-Python-SDK) for AcrosureClient usage.And refer to [Acrosure API Document](https://docs.acrosure.com/docs/api-overall.html) for more details on Acrosure API.## Associated Acrosure API endpoints### Application```/applications/get/applications/list/applications/create/applications/update/applications/get-packages/applications/get-package/applications/select-package/applications/submit/applications/confirm/applications/get-hash```### Product```/products/get/products/list```### Policy```/policies/get/policies/list```### Data```/data/get```### Team```/teams/get-info```