api.v2.deliverables module

api.v2.deliverables.delete_html_template(name=None)[source]

Deletes an HTML Template by name

Parameters:name (str) – The name to use when referencing the HTMLTemplate.
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (none)
api.v2.deliverables.delete_static_resource(name=None)[source]

Deletes a static resource by name

Parameters:name (str) – The name to use when referencing the static resource in your Jinja template. (ex. test.png)
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (none)
api.v2.deliverables.expire_all_static_resources()[source]

Expires all static resources

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (none)
api.v2.deliverables.expire_static_resource(name=None)[source]

Expires a static resource by name

Parameters:name (str) – The name to use when referencing the static resource in your Jinja template. (ex. test.png)
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (none)
api.v2.deliverables.getDeliverableData(revision_id=None, deliverable_type=None, reason=None, date_cursor=None, invoice_id=None, state_id=None, claim_num=None, ref_type='policies', return_premium_id=None, indexed=True, file_path=None)[source]

Get Deliverable Data

Parameters:
  • revision_id (str) –
  • date_cursor (str) –
  • deliverable_type (str) –
  • reason (str) –
  • state_id (str) –
  • invoice_id (str) –
Returns:

data – The data response having the form:

custom_fee_names
    cancellation_threshold
    last_invoice
        debit_custom_fee_fully_earned
        date_updated
        waive_id
        debit_custom_fee_fully_billed
        policy_term_id
        id
        debit_premium_fully_billed
        generated_by
        debit_premium_fully_earned
        payment_amount
        day_zero_date
        transaction_date_time
        due_date
        account_balance
        description
        deleted
        debit_custom_fee_pro_rata
        cancel_date
        file_id
        date_added
        back_cancel_date
        payment_id
        debit_premium_pro_rata
        date_added_micro
        date_deleted
        transaction_type
        paid_in_full
        snapshot
        dirty
        debit_system_fee
        revision_id
    submit_bound
    word_replace
        {last_nonpay_cancel_date}
        {billing_schedule}
        {past_due}
        {agency}
        {cancellation_date}
        {insured_properties}
        {agent}
        {payoff_amount}
        {print_description}
        {insured}
        {premium}
        {late_payment_fee}
        {cancellation_reason}
        {premium_diff}
        {policy_status}
        {insured_address}
        {policy_type}
        {agency_phone}
        {adjuster}
        {inception_date}
        {expiration_date}
        {reinstatement_date}
        {app_id}
        {agent_phone}
        {todays_date}
        {insured_phone}
        {due_date}
        {last_payment_date}
        {last_payment_amount}
        {last_nonpay_due_date}
        {policy_number}
        {amount_due}
        {claim_number}
        {return_premium_reason}
        {effective_date}
        {mortgagee}
        {nonrenew_reason}
    bill_when
    date
    manual_cancellation
    silence_non_pay
    underwriting_questions
    auto_pay_schedule
        has_installment_fees
        table
        due
        has_custom_fees
    procdate
    payoff_amount
    last_payment
        debit_custom_fee_fully_earned
        date_updated
        waive_id
        debit_custom_fee_fully_billed
        policy_term_id
        id
        debit_premium_fully_billed
        generated_by
        debit_premium_fully_earned
        payment_amount
        day_zero_date
        transaction_date_time
        due_date
        account_balance
        description
        deleted
        debit_custom_fee_pro_rata
        cancel_date
        file_id
        date_added
        back_cancel_date
        payment_id
        debit_premium_pro_rata
        date_added_micro
        date_deleted
        transaction_type
        paid_in_full
        snapshot
        dirty
        debit_system_fee
        revision_id
    story
    reinsurance_contract_id
    billing
        recur
        first
    contacts
        insured
        additional_interests
        agent
    forms
    index_info
        read_only
        sub_type
        received_meta_data
        print_date
        id
        label
        type
        form_ids
        rev_id
    return_prem_reason
    last_page
    num_dec_footer_lines
    report_type
    report_due_date_minus_x
    dec_options
    revision
        separate_dec_sections
        submit_bound
        line_of_business
        app_id
        inception_date
        policy_name
        renewal_status
        exp_date
        renewal_reason
        committed
        policy_type_id
        is_renewal
        location_id
        id
        policy_type_system_tags
        annual_fee
        policy_term_id
        unsubmitted_policy_change
        commission_rate
        dec_description
        written_fee
        eff_date
        revision_date
        annual_premium
        reinstate
        status
        description
        written_premium
        auto_payment_method_id
        line_id
        cancel_date
        has_write_off
        active
        status_reason
        properties
        first_payment_method_id
        dec_display_options
        items
        policy_number
        policy_term
        commit_date
        revision_state
        underwriting_contact_date
        line_system_tags
        underwriting_contacted
        policy_id
    separate_dec_sections
    header_info
        h-line2
        h-line3
        h-line1
        h-line4
    account_balance
    first_underpaid_debit_exceeding_threshold
    billing_schedule_installments
    primary_carrier
        address_line2
        address_city
        address_line1
        name
        signature
        phone
        address_state
        logo
        id
        address_zip
    return_prem
    prev_rev_comp
    overwrite_stock
    remarks
    report_settings
        forms_agent
        module
        dec_blurb
        location_id
        id
        print_on_initial_dec
        requires_user_input
        dec_signature
        dec_signature_image
        include_mortgagee
        certified_mail
        forms_addt_int
        built_in_html
        include_agent
        include_insured
        include_primary_insured
        show_fixed_dec_sig
        print_on_renewal_dec
        print_on_non_autopay
        include_addt_int
        overwrite_stock
        forms_insured
        dec_footer
        report_id
        forms_mortgagee
        send_dec
        custom_name
    past_due
    billing_schedule_options
    unpaid_debits_to_date
    report_id
    debit_deltas_to_date
    del_reason
    auto_pay_method
    cancel_on_due_date
    current_page
    flow
    card_list
    last_non_pay
    submit_payment
    has_a_payment_vendor
    display_topmost_name_on_dec

Return type:

dict

api.v2.deliverables.get_all_html_templates()[source]

Gets a list with all HTML Templates

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of dict) – The data response having the form:
    [{
        'id': 'Some UUID id',
        'name': 'Declaration',
        'html': '<html><body><h1>{{ policy.policy_number }}</h1></body></html>',
        'use_new_html_render': False
        'use_new_pdf_render': False
        'enabled': False
        'date_created': "2015-01-01 00:00:00",
        'date_updated': "2015-01-01 00:00:00",
    }]
    
api.v2.deliverables.get_all_static_resources()[source]

Gets a list with all static resources

Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of dict) – The data response having the form:
    [{
        'id': 'Some UUID id',
        'name': 'name.png', # Name of static resource. Used to reference in Jinja {{ static_resource('name.png') }},
        'url': 'http://cdn.someurl.com/name.png', # The URL used to pull in the cached version of the static resource,
        'expire_in': 50000, # Number of seconds until resource auto-expires and is refreshed,
        'date_created': "2015-01-01 00:00:00",
        'date_updated': "2015-01-01 00:00:00",
    }]
    
api.v2.deliverables.get_attachment(file_id=None, resized=False)[source]

Retrieve attachment by id.

Parameters:file_id (str) – attachment id
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict containing attachment)
api.v2.deliverables.get_dec(policy_id=None, revision_id=None, reason=None)[source]

retrieves deliverable

Parameters:
  • policy_id (str) – Policy ID (UUID)
  • revision_id (str) – Revision ID (UUID)
  • reason (str) –
Returns:

data – list of base64 encoded files

{
    'files': []
}

Return type:

dict

api.v2.deliverables.get_edeliverables(date_from=None, date_to=None, unprocessed_only=True)[source]

Returns e-deliverable documents that have not yet been sent. Candidacy criteria is having: - settings > deliverable > specific deliverable > This document may be eDelivered to insureds via BriteApps - print_state === ‘tbd’ - print_date between date_from and date_to - if unprocessed_only==True then only ‘unprocessed’ returned; if unprocessed_only==False all states returned

Parameters:
  • date_from (str) – from “print_date”(inclusive). Format is mm/dd/yyyy
  • date_to (str) – to “print_date”(inclusive). Format is mm/dd/yyyy
  • unprocessed_only (bool) – return only unprocessed e-deliverable documents. Defaults to True
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (list of dict) – List of deliverables that meet search criteria and can be e-delivered

    [
        {
            "print_date": "2019-07-01",
            "state": "unprocessed",
            "meta_data": {
                "policy_term": {
                    "effective_date": "2018-08-19",
                    "expiration_date": "2019-08-19",
                    "id": "2bb7e400-d31c-4612-89fa-dc8d2d8c16a1"
                },
                "contact": {
                    "addresses": [
                        {
                            "address_line2": "",
                            "address_city": "Ardmore",
                            "address_line1": "2222 N Mdw DR",
                            "type_label": "",
                            "date_updated": null,
                            "address_country": "USA",
                            "address_county": "Carter",
                            "contact_id": "c1bfa8a0-4eb2-4f7b-b649-baf8e61eb080",
                            "longitude": null,
                            "attention": "",
                            "address_state": "OK",
                            "latitude": null,
                            "type": "Mailing/Billing",
                            "id": "e3ca04ca-d7e9-4319-b151-b71c2ee99da8",
                            "address_zip": "73401"
                        }
                    ],
                    "id": "c1bfa8a0-4eb2-4f7b-b649-baf8e61eb080",
                    "phones": [
                        {
                            "date_updated": null,
                            "phone": "(111) 221-7526",
                            "type": "Home",
                            "id": "05b103d9-9400-41fd-b459-28303ac29564",
                            "contact_id": "c1bfa8a0-4eb2-4f7b-b649-baf8e61eb080"
                        }
                    ],
                    "email_notices": false,
                    "emails": [],
                    "name": "JANET BROWN"
                },
                "named_insureds": [
                    {
                        "addresses": [
                            {
                                "address_line2": "",
                                "address_city": "Ardmore",
                                "address_line1": "2222 N Mdw DR",
                                "type_label": "",
                                "date_updated": null,
                                "address_country": "USA",
                                "address_county": "Carter",
                                "contact_id": "c1bfa8a0-4eb2-4f7b-b649-baf8e61eb080",
                                "longitude": null,
                                "attention": "",
                                "address_state": "OK",
                                "latitude": null,
                                "type": "Mailing/Billing",
                                "id": "e3ca04ca-d7e9-4319-b151-b71c2ee99da8",
                                "address_zip": "73401"
                            }
                        ],
                        "id": "c1bfa8a0-4eb2-4f7b-b649-baf8e61eb080",
                        "phones": [
                            {
                                "date_updated": null,
                                "phone": "(111) 221-7526",
                                "type": "Home",
                                "id": "05b103d9-9400-41fd-b459-28303ac29564",
                                "contact_id": "c1bfa8a0-4eb2-4f7b-b649-baf8e61eb080"
                            }
                        ],
                        "email_notices": false,
                        "emails": [],
                        "name": "JANE DOE"
                    },
                    {
                        "addresses": [
                            {
                                "address_line2": "",
                                "address_city": "Ardmore",
                                "address_line1": "2222 N MDW DR",
                                "type_label": "",
                                "date_updated": null,
                                "address_country": "USA",
                                "address_county": "Carter",
                                "contact_id": "ab3c07a5-1b08-4c87-b32d-f0d93841f0c9",
                                "longitude": null,
                                "attention": "",
                                "address_state": "OK",
                                "latitude": null,
                                "type": "Mailing/Billing",
                                "id": "1cf47ef8-7163-45c5-925b-c4d6e871f83e",
                                "address_zip": "73401"
                            }
                        ],
                        "id": "ab3c07a5-1b08-4c87-b32d-f0d93841f0c9",
                        "phones": [
                            {
                                "date_updated": null,
                                "phone": "(111) 221-7526",
                                "type": "Home",
                                "id": "7ca45a3f-988b-48ed-a875-7476034485fd",
                                "contact_id": "ab3c07a5-1b08-4c87-b32d-f0d93841f0c9"
                            }
                        ],
                        "email_notices": false,
                        "emails": [],
                        "name": "JOHN DOE"
                    }
                ],
                "file": {
                    "print_state": "tbd",
                    "title": "06-29-2019 - Installment Billing Statement - JANET BROWN",
                    "date_added": "2019-02-04 15:17:04",
                    "id": "dda9c813-8fbc-4e44-87b7-61278e1eca28",
                    "print_date": "2019-07-01",
                    "label": "Installment Billing Statement"
                },
                "policy": {
                    "id": "a26935eb-7466-46af-a656-ccac17388f40",
                    "policy_number": "10-2011-120"
                },
                "type": "document",
                "deliverable_type": {
                    "custom_name": null
                },
                "revision": {
                    "revision_date": "2018-08-19",
                    "id": "0c64929f-f8b6-4617-8b25-911aa14faaa7",
                    "policy_status": "Active",
                    "revision_state": "committed"
                }
            },
            "file_id": "dda9c813-8fbc-4e44-87b7-61278e1eca28",
            "exclude_from_printing_queue": false,
            "date_added": "2019-05-24 08:39:30",
            "x_file_id": null,
            "id": "014386b3-d74c-4925-8d2c-f744ec5892e3"
        }
    ]
    

api.v2.deliverables.get_html_template(name=None)[source]

Gets an HTMLTemplate by name

Parameters:name (str) – The name to use when referencing the HTMLTemplate.
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – The data response having the form:
    {
        'id': 'Some UUID id',
        'name': 'Declaration',
        'html': '<html><body><h1>{{ policy.policy_number }}</h1></body></html>',
        'use_new_html_render': False
        'use_new_pdf_render': False
        'enabled': False
        'date_created': "2015-01-01 00:00:00",
        'date_updated': "2015-01-01 00:00:00",
    }
    
api.v2.deliverables.get_pending_email_count(from_date=None, to_date=None)[source]

Returns the number of pending emails.

Parameters:
  • from_date (date) –
  • to_date (date) –
Returns:

data – The data response having the form:

{
    'pending_email_count': the count (int)
}

Return type:

dict

api.v2.deliverables.get_static_resource(name=None)[source]

Gets a static resource by name

Parameters:name (str) – The name to use when referencing the static resource in your Jinja template. (ex. test.png)
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – The data response having the form:
    {
        'id': 'Some UUID id',
        'name': 'name.png', # Name of static resource. Used to reference in Jinja {{ static_resource('name.png') }},
        'url': 'http://cdn.someurl.com/name.png', # The URL used to pull in the cached version of the static resource,
        'expire_in': 50000, # Number of seconds until resource auto-expires and is refreshed,
        'date_created': "2015-01-01 00:00:00",
        'date_updated': "2015-01-01 00:00:00",
    }
    
api.v2.deliverables.index_edelivery_records(date_from=None, date_to=None)[source]

Launch edelivery documents indexing in given date range It is a slow process so it is better to not pass date ranges bigger than week

Parameters:
  • date_from (str) – from “print_date”(inclusive). Format is mm/dd/yyyy
  • date_to (str) – to “print_date”(inclusive). Format is mm/dd/yyyy
Returns:

  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – Deleted entities count

api.v2.deliverables.list_attachments(policy_id=None, contact_id=None, print_date_from=None, print_date_to=None, print_state_ne=None, print_state=None, order_by=None)[source]

Retrieves attachments list related to policy/contact/contact+policy.

Parameters:
  • policy_id (str) – Filter attachments by policy_id
  • contact_id (str) – Filter attachments by contact_id
  • print_date_from (date) – Filter attachments younger print_date_from
  • print_date_to (date) – Filter attachments older print_date_from
  • print_state_ne (str) – Filter attachments exclude print_state_ne==print_state
  • print_state (str) – Filter attachments print_state==print_state
  • order_by (str) – Order by field
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (dict) – The data response having the form:

    {
        'id': 'attachment_id,
        'title': 'attachment_title',
        'label': 'attachment_title',
        'print_date': '11/11/2011,
        'policy_id': 'some_policy_id,
    }
    

api.v2.deliverables.regenerate_combined_billing_statements(start_date, end_date=None)[source]

Generate any combined billing covers that were sent out on the specified start_date and end_date range If no end_date is supplied, we work with the respective date range (start_date-1, start_date).

api.v2.deliverables.remove_edelivery_records(date_from=None, date_to=None)[source]

Removing e-deliverable documents entities in given date range

Parameters:
  • date_from (str) – from “print_date”(inclusive). Format is mm/dd/yyyy
  • date_to (str) – to “print_date”(inclusive). Format is mm/dd/yyyy
Returns:

  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – Deleted entities count

api.v2.deliverables.retrieve_available_document_options(location_id=None, location_abbr=None, location_name=None, module='policies')[source]

Finds all document types configured within a given Business Location that can be generated with “standard” parameters. Excludes billing, return premium, and claim acknolwedgement documents. These specific documents require more detailed processing and arguments, and therefore do not fit into this description.

Parameters:
  • location_id (str) – The UUID of the Business Location. May be omitted if location_abbr or location_name is provided.
  • location_abbr (str) – The abbreviation of the Business Location. May be omitted if location_id or location_name is provided.
  • location_name (str) – The full name of the Business Location. May be omitted if location_id or location_abbr is provided.
  • module (str) – The related module that the documents are intended for. Valid options are “policies” or “claims”. Defaults to “policies”.
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (list) – The data response having the form:

    [
        "Declaration",
        "Policy Application",
        "Quote Summary"
    ]
    

api.v2.deliverables.retrieve_files_for_entity(reference_id=None, policy_number=None, claim_number=None, allow_null_reference=False, ascending=False, advanced_filters=[])[source]

Finds all active files for a specific entity, given a reference point. Optionally can retrieve files with a NULL reference object as well (example, Report files). Additional filters can also be applied if desired.

Parameters:
  • reference_id (str) – The UUID of the object reference to which the files are associated. If intentionally omitted, allow_null_reference is expected, or policy_number/claim_number should be provided.
  • policy_number (str) – The policy number, if reference_id is unknown but the files are tied to a policy.
  • claim_number (str) – The claim number, if reference_id is unknown but the files are tied to a claim.
  • allow_null_reference (bool) – If the queried files are not tied to a specific entity, pass as True (defaults to False). Example: Report result files do not currently have reference_id to any given entity.
  • ascending (bool) – By default, the resulting list will be ordered by dateAdded-descending for most recently created first. Pass this in as True to show oldest first.
  • advanced_filters (list) –

    A list of specific dictionaries that expands filtering to a File by giving explicit comparison operators. Must have three keys in the dict to accomplish successful filtering and failing to pass any of them will result in the given filter being ignored. They are column, operator, value

    column:The column’s value in a File table.
    operator:The comparison operator, have a look at python’s built in operator package The only allowed operators are lt le eq ne ge gt
    value:The value being compared to.

    Below is an example of how an advanced filter dictionary looks like:

    {
        "column": "label",
        "operator": "ne",
        "value": "Form"
    }
    
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (list) – The data response having the form:

    [
        {
            "id": "UUID",
            "title": "Declaration - John Smith",
            "label": "Declaration",
            "date_added": "2018-01-01 12:00:00",
            "print_state": "printed",
            "print_date": "2018-02-01",
            "actual_print_date": "2018-02-02",
            "folder_id": "UUID",
            "mime_type": "application/pdf",
            "size": 4096,
            "type": "policies",
            "sub_type": "New Policy"
        }
    ]
    

api.v2.deliverables.retrieve_invoice_document(invoice_number)[source]

Handles retrieving an invoice PDF in base64. :param invoice_number: 0000a461-1722-4111-8b82-b0cc286306db :type invoice_number: str

Returns:
  • success (bool) – True if successful, False if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – Representation of dict result:
    {
        'success': true,
        'messages': [],
        'content': "the pdf encoded in base64 format",
        'headers': {
            'Content-Length': 9983,
            'Content-type': "application/pdf",
            'Content-Disposition': "inline; filename="09-21-2018 - Installment Billing Statement - Georgie Man.pdf""
        },
        'content_type': "application/pdf"
    }
    
api.v2.deliverables.save_html_template(name=None, html=None, use_new_html_render=False, use_new_pdf_render=False, enabled=False)[source]

Saves an HTMLTemplate record to be used as a BriteCore Document Jinja template.

Parameters:
  • name (str) – The name to use when referencing the template. Should be the same as the custom_deliverable name.
  • html (str) – The HTML string (Jinja template) to be converted into a deliverable or served from render.view
  • use_new_html_render (bool) – Whether or not to use the new render.py code to render the Jinja template.
  • use_new_pdf_render (bool) – Whether or not to use the new render.py code to render the PDF deliverable.
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (dict) – The data response having the form:

    {
        'id': 'Some UUID id',
        'name': 'Declaration',
        'html': '<html><body><h1>{{ policy.policy_number }}</h1></body></html>',
        'use_new_html_render': False
        'use_new_pdf_render': False
        'enabled': False
        'date_created': "2015-01-01 00:00:00",
        'date_updated': "2015-01-01 00:00:00",
    }
    

api.v2.deliverables.save_static_resource(name=None, url=None, expire_in=0)[source]

Saves a static resource to be used in BriteCore Document Jinja templates.

Parameters:
  • name (str) – The name to use when referencing the static resource in your Jinja template. (ex. test.png)
  • url (str) – The URL of the static resource. This URL must be present at the time of the fetch. Using a CDN is recommended.
  • expire_in (int) – Number of seconds before the cached version of the resource is expired.
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (dict) – The data response having the form:

    {
        'id': 'Some UUID id',
        'name': 'name.png', # Name of static resource. Used to reference in Jinja {{ static_resource('name.png') }},
        'url': 'http://cdn.someurl.com/name.png', # The URL used to pull in the cached version of the static resource,
        'expire_in': 50000, # Number of seconds until resource auto-expires and is refreshed,
        'date_created': "2015-01-01 00:00:00",
        'date_updated': "2015-01-01 00:00:00",
    }
    

api.v2.deliverables.update_edelivery_records(records=None)[source]

Update edelivery_documents

Parameters:records (dict of dicts) –

records need to be updated. Format is

{
    "ef763124-8b7f-4016-ac54-7d07e4adfe70": {  # UUID of e-deliverable_document entity
        "state": "pending"                     # desired state. One of unprocessed/pending/processed. Flags internal state of e-delivery
    },
    "ef763124-8b7f-4016-ac54-7d07e4adfe71": {  # UUID of e-deliverable_document entity
        "state": "processed",                  # desired state. One of unprocessed/pending/processed
        "exclude_from_printing_queue": "True"  # if set to true - document will be excluded from printing queue
    }
}
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – Dict with update results (true or false)
    {
        'ef763124-8b7f-4016-ac54-7d07e4adfe70': True,
        'ef763124-8b7f-4016-ac54-7d07e4adfe71': False
    }