def create_customer(name, email, phone):
    """
    Create a customer with the name.
    Then attach the email and phone as contact methods
    """
    Party = client.model('party.party')
    ContactMechanism = client.model('party.contact_mechanism')

    party, = Party.create([{'name': name}])

    # Bulk create the email and phone
    ContactMechanism.create([
        {'type': 'email', 'value': email, 'party': party},
        {'type': 'phone', 'value': phone, 'party': party},
    ])

    return party
Create a customer with the name.
    Then attach the email and phone as contact methods