Exemple #1
0
merchantAccountId = 1
bypassCommissions = False
print infusionsoft.InvoiceService('chargeInvoice', invoiceId, notes, creditCardId, merchantAccountId, bypassCommissions)

# Example 6: Send an email using the email service
#----------------------------------------------------------------------------------------
contactList = [123, 456, 789]
fromAddress = '*****@*****.**'
toAddress = '~Contact.Email~'
ccAddress = ''
bccAddress = ''
contentType = 'Text'
subject = 'This is just a test email, relax!'
htmlBody = ''
textBody = 'This is the contant for the email'
print infusionsoft.APIEmailService('sendEmail', contactList, fromAddress, toAddress, ccAddress, bccAddress, contentType, subject, htmlBody, textBody)

# Example 7: Get all report columns using the search service
#----------------------------------------------------------------------------------------
savedSearchId = 3
userId = 1
print infusionsoft.SearchService('getAllReportColumns', savedSearchId, userId)

# Example 8: Get all shipping options with the shipping service
#----------------------------------------------------------------------------------------
print infusionsoft.ShippingService('getAllShippingOptions')

# Example 9: Get affiliate payouts info using filter with the affiliate service
#----------------------------------------------------------------------------------------
from datetime import datetime
affiliateId = 2
Exemple #2
0
                values=','.join(df['Industry'].dropna().unique())
            )['Name']
            APIMAPPING['Salesperson'] = create_custom_field(
                ifs,
                'Salesperson',
                fieldtype='Text',
            )['Name']
            APIMAPPING['Customer_Prospect_Dormant'] = create_custom_field(
                ifs,
                'Customer/Prospect/Dormant',
                fieldtype='Select',
                values=','.join(df['Customer_Prospect_Dormant'].dropna().unique())
            )['Name']
            APIMAPPING['Service of Interest'] = create_custom_field(
                ifs,
                'Product/Solution of Interest',
                fieldtype='Select',
                values=','.join(df['Service of Interest'].dropna().unique())
            )['Name']

            df.rename(APIMAPPING,axis='columns',inplace=True)
            for contact in df.to_dict('records'):
                resp = ifs.ContactService(
                    'add',
                    contact,
                )
                if contact.get('Email'):
                    ifs.APIEmailService('optIn',contact['Email'],'FranServ Import')
                if isinstance(resp, tuple):
                    raise ValueError(
                        f'InfusionsoftAPIError: {resp}')