Skip to main content

Creating a customer

Creating new customers stores customer and contact information within ChargeOver.

Call the ChargeOver.Customer.create(...) to create a new customer.

var my_data = {
customer: {
company: 'My Company Name, LLC',

// external_key: '1234abcd1234', // Use external keys to link your app to ChargeOver data

bill_addr1: '56 Cowles Road',
bill_addr2: '',
bill_addr3: '',
bill_city: 'Mt Pleasant',
bill_state: 'MI',
bill_postcode: '48858',
bill_country: 'United States',

custom_1: '', // Custom field values
custom_2: '',
custom_3: ''
},
user: {
name: 'John Doe',
phone: '888-924-2347',
email: 'test@ChargeOver.com'
}

// You can optionally specify a credit card too if you want
/*
creditcard: {
number: '4111 1111 1111 1111',
expdate_month: '7',
expdate_year: '2016',
name: 'John D Doe'
}
*/
};

//
function my_callback_function(code, message, response)
{
if (code == 200)
{
alert('Thanks, we created the customer ' + response.customer.company);
}
else
{
alert('Error: ' + message);
}
}

//
ChargeOver.Customer.create(my_data, my_callback_function);