Get a customer using GET.
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.
Name | Required | Value | Description |
---|---|---|---|
include[] | optional | string: employees | Automatically added for customer type 'Private' |
$request_url = 'https://api.frontcore.com/v2/customers/32714';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-API-Key: {your-api-key}',
'Accept: application/json',
));
$result = curl_exec($ch);
curl_close($ch);
If the method is successful it responds with an JSON structure, as it is shown below.
{ "id": 32714, "title": "Beste Kunde AS", "department": null, "phone": null, "fax": null, "email": null, "webaddress": null, "orgnr": "85454545", "invoice_email": null, "customer_reference_id": null, "customer_reference": "Per Pedersen", "note": null, "turnover": null, "idParentCustomer": null, "invoice_method": "electronic", "country": { "id": 159, "title": "Norway", "code": "NO" }, "status": "Deactivated", "type": "Company", "duedate_days": 10, "seller": null, "invoice_address": { "address": "Kundeveien 10", "address_2": null, "address_3": null, "zipcode": "2130", "city": "Oslo" }, "post_address": { "address": null, "address_2": null, "address_3": null, "zipcode": null, "city": null }, "visit_address": { "address": null, "address_2": null, "address_3": null, "zipcode": null, "city": null }, "custom_properties": null, "created_at": "2017-03-31T20:27:41+02:00", "updated_at": "2024-12-18T08:25:22+01:00" }
Unsuccessful response sample:
{ "error": "Wrong API Key" }