Download an order using GET and its ID number.
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 | Request additional information by specifying the 'include' parameter as a path using dot notation. You can include multiple objects at once by specifying multiple items in the include array. Supported items for this endpoint: `lines.database_relations.course` `lines.database_relations.participants` |
$request_url = 'https://api.frontcore.com/v2/orders/27244';
$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": 27244, "title": "Learn REST API #27244", "title_detailed": "04.01.2020 - 06.01.2020 - Sem", "is_paid": true, "payment_method": null, "your_reference": null, "booker": null, "gln_number": null, "customer": { "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" }, "idCampaign": null, "seller_id": null, "invoice_address": null, "invoice_address_2": null, "invoice_address_3": null, "invoice_zipcode": null, "invoice_city": null, "invoice_email": "lars@eksemel.ek", "first_user": { "id": 154420, "firstname": "Lars", "lastname": "Larsen", "date_of_birth": "12.05.1992 00:00:00", "email": "lars@eksemel.ek", "phone": "21212121", "company": "ABC AS", "position": null, "invoice_address": { "address": "Veien 2", "address_2": null, "address_3": null, "zipcode": "3120", "city": "Oslo", "phone": null }, "home_address": { "address": "Veien 2", "address_2": null, "address_3": null, "zipcode": "3120", "city": "Oslo", "phone": null }, "work_address": { "address": null, "address_2": null, "address_3": null, "zipcode": null, "city": null, "phone": null } }, "lines": [ { "id": 31400, "currency": { "id": "1", "title": "NOK", "long_title": "Norwegian kroner" }, "price_at_order_per_item_vat_excluded": 1500, "discount_percent_at_order": 0, "discount_amount_at_order": 0, "discount_calculated_at_order": 0, "price_at_invoice_per_item_vat_excluded": 0, "discount_percent_at_invoice": 0, "discount_calculated_at_invoice": 0, "price_at_export_per_item_vat_excluded": 0, "discount_percent_at_export": 0, "discount_calculated_at_export": 0, "quantity": 1, "database_relations": [ { "type": "participant", "participant_id": 124920, "coursedate_id": 9304757, "user_id": 154420, "course_id": 22353 } ], "product": { "id": 8079, "item_number": "8079", "title": "Learn REST API", "title_label": null, "price": 1500, "currency": "NOK", "is_main_product": true, "vat_percentage": 0 }, "users": [ { "id": 154420, "firstname": "Lars", "lastname": "Larsen", "date_of_birth": "12.05.1992 00:00:00", "email": "lars@eksemel.ek", "phone": "21212121", "company": "ABC AS", "position": null, "invoice_address": { "address": "Veien 2", "address_2": null, "address_3": null, "zipcode": "3120", "city": "Oslo", "phone": null }, "home_address": { "address": "Veien 2", "address_2": null, "address_3": null, "zipcode": "3120", "city": "Oslo", "phone": null }, "work_address": { "address": null, "address_2": null, "address_3": null, "zipcode": null, "city": null, "phone": null }, "invoice_reference": null } ], "created_at": "2017-03-31T20:27:04+02:00", "updated_at": null } ], "booker_admin_user": null, "webintegration_id": null, "custom_properties": null, "calculated_totals": { "total_amount_before_discounts": 1500, "total_amount_after_discounts": 1500, "total_amount_of_discounts": 0, "total_amount_of_vat": 0, "total_amount_incl_discounts_and_vat": 1500 }, "exported_at": null, "updated_at": "2025-01-21T10:06:42+01:00", "created_at": "2017-03-31T20:27:04+02:00" } ]
Unsuccessful response sample:
{ "error": "Wrong API Key" }