api.v2.commissions module

api.v2.commissions.delete_batch_payments(payment_ids)[source]

Deletes commission payments in batch

Parameters:payment_ids (list of str) – BriteCore commission_payment id UUIDs
Returns:
  • success (bool) – True if completely successful, false if not
  • messages (list of str) – List of human-readable error messages
api.v2.commissions.delete_payment(payment_id)[source]

Deletes single commission payment

Parameters:payment_id (str) – A BriteCore commission_payment id UUID
Returns:
  • success (bool) – True if completely successful, false if not
  • messages (list of str) – List of human-readable error messages
api.v2.commissions.get_commission_payees()[source]

Retrieves a list of payees agency numbers

Returns:
  • success (bool) – True if completely successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of str) – Contains agency numbers of valid commission payees
api.v2.commissions.get_payment(commission_payment_id)[source]

Gets a commission payment record.

Parameters:commission_payment_id (str) – A BriteCore commission_payment id UUID
Returns:
  • success (bool) – True if completely successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – A dict containing the following data representation. ::
    {
    commission_payments.pay_amount (DECIMAL) commission_payments.date_updated (TIMESTAMP) commission_payments.is_electronic_payment (BOOLEAN) commission_payments.payee_id (CHAR(36)) commission_payments.reviewed (BOOLEAN) commission_payments.date_reviewed (DATETIME) commission_payments.transaction_date (DATETIME) commission_payments.exported (BOOLEAN) commission_payments.date_added (DATETIME) commission_payments.date_exported (DATETIME) commission_payments.id (CHAR(36)) commission_payments.payment_method_id (CHAR(36))

    }

api.v2.commissions.save_batch_payments(payments=None)[source]

Saves commission payments in batch

Parameters:payments (list of dict) –

A list of dicts with the keys agency_number and amount.

agency_number should correspond with a single BriteCore agency.

amount should be a decimal representation of a monetary amount to be paid.

Returns:
  • success (bool) – True if completely successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of dict) – Contains important information about the inserted records.
    {
        'commission_payment_id': commission_payment.id,
        'payment_method_id': commission_payment.payment_method_id,
        'agency_id': commission_payment.payee_id,
        'amount': commission_payment.pay_amount
    }
    
api.v2.commissions.save_batch_payments_csv(data=None)[source]

Saves commission payments in batch

Parameters:data (str) –

A string representation of a csv file. Entries should map agency_number to a respective amount used to create a commission payment record. Agency numbers can appear more than once on the input csv, and must refer to one and only one contact (i.e. an agency number cannot be used on the csv if two contacts can be reached by this number). Any value convertible to a python float is acceptable., including 0.

Example 1 (with csv header row):
agency_number,amount T34514,11207.12 T34515,15000.00 T34516,12120.55 T34514,720.00 T34516,720.00
Example 2 (without csv header row):
A0001,0.00 A0002,14.00
Returns:
  • success (bool) – True if completely successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (list of dict) – Contains important information about the inserted records.
    {
        'commission_payment_id': commission_payment.id,
        'payment_method_id': commission_payment.payment_method_id,
        'agency_id': commission_payment.payee_id,
        'amount': commission_payment.pay_amount
    }
    
api.v2.commissions.save_payment(agency_number, amount)[source]

Saves commission payment

Parameters:
  • agency_number (str) – A BriteCore agency contact id UUID
  • amount (decimal) – Should be a decimal representation of a monetary amount to be paid
Returns:

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

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

  • data (list of dict) – Contains important information about the inserted record.

    {
        'commission_payment_id': commission_payment.id,
        'payment_method_id': commission_payment.payment_method_id,
        'agency_number': commission_payment.payee_id,
        'amount': commission_payment.pay_amount
    }