Add a customer
Adds a customer using POST.
Request
POST https://api.frontcore.com/v2/customers
For every API request you make, you'll need to present the API access key in the HTTP Header as
X-API-Key to be authenticated.
Parameters
Name |
Required |
Value |
Description |
title | required |
string |
Customer name |
department | optional |
string |
Department |
type | optional |
integer |
Default is 1 ("Company") |
orgnr | optional |
string |
Orgnr. |
email | optional |
string |
E-mail |
phone | optional |
string |
Phone |
fax | optional |
string |
Fax |
web_address | optional |
string |
Address to website |
customer_reference_id | optional |
string |
Customer number (freetext) |
country | optional |
string |
Default is NO- AF = Afghanistan
- AL = Albania
- DZ = Algeria
- AS = American Samoa
- AD = Andorra
- AO = Angola
- AI = Anguilla
- AG = Antigua and Barbuda
- AR = Argentina
- AM = Armenia
- AW = Aruba
- AU = Australia
- AT = Austria
- AZ = Azerbaijan
- BS = Bahamas, The
- BH = Bahrain
- BD = Bangladesh
- BB = Barbados
- BY = Belarus
- BE = Belgium
- BZ = Belize
- BJ = Benin
- BM = Bermuda
- BT = Bhutan
- BO = Bolivia
- BA = Bosnia and Herzegovina
- BW = Botswana
- BR = Brazil
- VG = British Virgin Islands
- BN = Brunei
- BG = Bulgaria
- BF = Burkina Faso
- BI = Burundi
- KH = Cambodia
- CM = Cameroon
- CA = Canada
- CV = Cape Verde
- KY = Cayman Islands
- CF = Central African Republic
- TD = Chad
- CL = Chile
- CN = China
- CX = Christmas Island
- CC = Cocos (Keeling) Islands
- CO = Colombia
- KM = Comoros
- CG = Congo
- CD = Congo, DR
- CK = Cook Islands
- CR = Costa Rica
- HR = Croatia
- CU = Cuba
- CW = Curaçao
- CY = Cyprus
- CZ = Czech Republic
- CI = Côte d'Ivoire
- DK = Denmark
- DJ = Djibouti
- DM = Dominica
- DO = Dominican Republic
- TL = East Timor
- EC = Ecuador
- EG = Egypt
- SV = El Salvador
- GQ = Equatorial Guinea
- ER = Eritrea
- EE = Estonia
- ET = Ethiopia
- FK = Falkland Islands (Islas Malvinas)
- FO = Faroe Islands
- FM = Federated States of Micronesia
- FJ = Fiji
- FI = Finland
- FR = France
- GF = French Guiana
- PF = French Polynesia
- GA = Gabon
- GM = Gambia
- GE = Georgia
- DE = Germany
- GH = Ghana
- GI = Gibraltar
- GR = Greece
- GL = Greenland
- GD = Grenada
- GP = Guadeloupe (Fr.)
- GU = Guam
- GT = Guatemala
- GG = Guernsey
- GN = Guinea
- GW = Guinea-Bissau
- GY = Guyana
- HT = Haiti
- HN = Honduras
- HK = Hong Kong
- HU = Hungary
- IS = Iceland
- IN = India
- ID = Indonesia
- IR = Iran
- IQ = Iraq
- IE = Ireland
- IM = Isle of Man
- IL = Israel
- IT = Italy
- JM = Jamaica
- JP = Japan
- JE = Jersey
- JO = Jordan
- KZ = Kazakhstan
- KE = Kenya
- KI = Kiribati
- XK = Kosovo
- KW = Kuwait
- KG = Kyrgyzstan
- LA = Laos
- LV = Latvia
- LB = Lebanon
- LS = Lesotho
- LR = Liberia
- LY = Libya
- LI = Liechtenstein
- LT = Lithuania
- LU = Luxembourg
- MO = Macau
- MK = Macedonia
- MG = Madagascar
- MW = Malawi
- MY = Malaysia
- MV = Maldives
- ML = Mali
- MT = Malta
- MH = Marshall Islands
- MQ = Martinique (Fr.)
- MR = Mauritania
- MU = Mauritius
- MX = Mexico
- MD = Moldova
- MC = Monaco
- MN = Mongolia
- ME = Montenegro
- MS = Montserrat
- MA = Morocco
- MZ = Mozambique
- MM = Myanmar
- NA = Namibia
- NR = Nauru
- NP = Nepal
- NL = Netherlands
- AN = Netherlands Antilles
- NC = New Caledonia
- NZ = New Zealand
- NI = Nicaragua
- NE = Niger
- NG = Nigeria
- NU = Niue
- NF = Norfolk Island
- MP = Northern Mariana Islands
- KP = North Korea
- NO = Norway
- OM = Oman
- PK = Pakistan
- PW = Palau
- PS = Palestinian Territories
- PA = Panama
- PG = Papua New Guinea
- PY = Paraguay
- PE = Peru
- PH = Philippines
- PN = Pitcairn Islands
- PL = Poland
- PT = Portugal
- PR = Puerto Rico
- QA = Qatar
- RE = Reunion (Fr.)
- RO = Romania
- RU = Russia
- RW = Rwanda
- SH = Saint Helena
- KN = Saint Kitts and Nevis
- LC = Saint Lucia
- VC = Saint Vincent and the Grenadines
- WS = Samoa
- SM = San Marino
- ST = Sao Tome and Principe
- SA = Saudi Arabia
- SN = Senegal
- RS = Serbia
- SC = Seychelles
- SL = Sierra Leone
- SG = Singapore
- SX = Sint Maarten
- SK = Slovakia
- SI = Slovenia
- SB = Solomon Islands
- SO = Somalia
- ZA = South Africa
- GS = South Georgia and the South Sandwich Islands
- KR = South Korea
- SS = South Sudan
- ES = Spain
- LK = Sri Lanka
- SD = Sudan
- SR = Suriname
- SZ = Swaziland
- SE = Sweden
- CH = Switzerland
- SY = Syria
- TW = Taiwan
- TJ = Tajikistan
- TZ = Tanzania
- TH = Thailand
- TG = Togo
- TK = Tokelau
- TO = Tonga
- TT = Trinidad and Tobago
- TN = Tunisia
- TR = Turkey
- TM = Turkmenistan
- TC = Turks and Caicos Islands
- TV = Tuvalu
- UG = Uganda
- UA = Ukraine
- AE = United Arab Emirates
- GB = United Kingdom
- UY = Uruguay
- US = USA
- UZ = Uzbekistan
- VU = Vanuatu
- VA = Vatican City
- VE = Venezuela
- VN = Vietnam
- VI = Virgin Islands
- EH = Western Sahara
- YE = Yemen
- ZM = Zambia
- ZW = Zimbabwe
|
post_address_1 | optional |
string |
Home address, line 1 |
post_address_2 | optional |
string |
Home address, line 2 |
post_address_3 | optional |
string |
Home address, line 3 |
post_zipcode | optional |
string |
Home address, zipcode |
post_city | optional |
string |
Home address, city |
invoice_address_1 | optional |
string |
Invoice address, line 1 |
invoice_address_2 | optional |
string |
Invoice address, line 2 |
invoice_address_3 | optional |
string |
Invoice address, line 3 |
invoice_zipcode | optional |
string |
Invoice address, zipcode |
invoice_city | optional |
string |
Invoice address, city |
invoice_customer_reference | optional |
string |
Customer ref. for invoices |
invoice_due_days | optional |
integer |
Due days for invoices |
invoice_email | optional |
string |
E-mail for invoices |
office_address_1 | optional |
string |
Work address, line 1 |
office_address_2 | optional |
string |
Work address, line 2 |
office_address_3 | optional |
string |
Work address, line 3 |
office_zipcode | optional |
string |
Work address, zipcode |
office_city | optional |
string |
Work address, city |
seller_id | optional |
integer |
ID from /app-users |
note | optional |
string |
Freetext |
status | optional |
integer |
Default is 1 ("Active") |
Example code in PHP
$post_params = array();
$post_params['title'] = 'Great Company AS';
$post_params['department'] = 'Great Department';
$post_params['country'] = 'NO';
$post_params['type'] = '1';
$post_params['status'] = '1';
$post_params['email'] = 'great@example.com';
$request_url = 'https://api.frontcore.com/v2/customers';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-API-Key: {your-api-key}',
'Accept: application/json',
));
$result = curl_exec($ch);
curl_close($ch);
Response
If the method is successful it responds with an JSON structure, as it is shown below.
{
"customer_id": 64927
}
Unsuccessful response sample:
{
"error": "Wrong API Key"
}