Example #1
0
def main():
    validate_config()

    with Session() as s:
        vendor = Vendor(name=raw_input('Vendor name: '))
        vendor['id'] = s.create_vendor(vendor)

        print 'Successfully created vendor "{0}" with id {1}'.format(vendor['name'], vendor['id'])

        s.send_vendor_invite(vendorId=vendor['id'], email=raw_input('Vendor email: '))

        print 'Emailed vendor invite.'
Example #2
0
def main():
    validate_config()

    with Session() as s:
        accounts = s.list('ChartOfAccount', sort=[('accountNumber', 'asc')])

    title = 'Got {0} chart of accounts:'.format(len(accounts))
    print title
    print '-'*len(title)

    print 'ID\t\t\tNumber\tName'
    print '-'*60
    for account in accounts:
        print '{id}\t{accountNumber}\t{name}'.format(**account)
def main():
    validate_config()

    auth = dict(CONFIG.items('authentication'))

    params = dict(
        userName = auth['email'],
        password = auth['password'],
        devKey = auth['appkey']
    )

    org_infos = https_post('ListOrgs.json', {}, params=params)

    title = 'Got {0} organizations:'.format(len(org_infos))
    print title
    print '-'*len(title)

    for org in org_infos:
        print '{orgId}\t{orgName}'.format(**org)