Orders

As the name suggests, orders are a core part of House Check. On this page, we'll dive into the different order endpoints you can use to manage orders programmatically. We'll look at how to query, create, update, and delete orders.

The order model

The order model contains all the information about your orders, such as their address and contact person. It also contains a reference to inspections related to the order.

Properties

  • Name
    property_type
    Type
    string
    Description

    Type of the property. Must be one of the following:

    Studio / Appartement, Rijwoning / Duplex, Halfopen bebouwing, Vrijstaande woning, Collectieve woning, Andere

  • Name
    habbitable_space
    Type
    integer
    Description

    Habitable space of the property.

  • Name
    no_inv_mail
    Type
    integer
    Description

    Enter 1 if no invoice mail is present.

  • Name
    no_contact_mail
    Type
    integer
    Description

    Enter 1 if no contact mail is present..

  • Name
    address1
    Type
    string
    Description

    Street of the property.

  • Name
    address2
    Type
    string
    Description

    House number, this may also include a bus number.

  • Name
    city
    Type
    string
    Description

    City where the property is located.

  • Name
    postal_code
    Type
    string
    Description

    Zip code where the property is located.

  • Name
    contact_name
    Type
    string
    Description

    Name of the contact person.

  • Name
    contact_language
    Type
    string
    Description

    Language of the contact person.

    Language must be one of the following:

    nl, en, fr

  • Name
    contact_email
    Type
    string
    Description

    Email of the contact person.

  • Name
    contact_phone1
    Type
    string
    Description

    Phone of the contact person.

  • Name
    remark
    Type
    string
    Description

    Optional | Extra information about the order.

  • Name
    inv_company_name
    Type
    string
    Description

    Invoice name.

  • Name
    inv_vat
    Type
    string
    Description

    Optional Vat for the invoice.

  • Name
    inv_address1
    Type
    string
    Description

    Street for the invoice.

  • Name
    inv_address2
    Type
    string
    Description

    House number for the invoice, this may also include a bus number..

  • Name
    inv_city
    Type
    string
    Description

    City for the invoice.

  • Name
    inv_mail
    Type
    string
    Description

    Email for the invoice.

  • Name
    inv_postal_code
    Type
    string
    Description

    Zip code for the invoice.

  • Name
    inv_phone1
    Type
    string
    Description

    Phone for the invoice_to.

  • Name
    invoice_to
    Type
    string
    Description

    Who should receive the invoice. Must be one of the following:

    tenant beeing the contact person. salesman beeing you, the api user. other beeing someone else than the above mentioned options.

  • Name
    keyPickup_location
    Type
    string
    Description

    The address where the key needs to be picked up. This is done in the following convention:

    'street nr, zip city'

  • Name
    is_contact_owner
    Type
    string
    Description

    Who is the contact person. Must be one of the following:

    contact beeing the contact person. yes beeing you, the api user. other beeing someone else than the above mentioned options.

  • Name
    order_products
    Type
    array
    Description

    For the products we expect a array of objects with the following properties:

    • Name
      id
      Type
      string
      Description

      The id of the product.

    • Name
      quantity
      Type
      integer
      Description

      The amount of the product.

  • Name
    breaker_boxes
    Type
    integer
    Description

    This is only required if one of the products has one of the following categories: 1.1, 1.2, 2.1

  • Name
    floors
    Type
    integer
    Description

    This is only required if one of the products has the category: 2.4

  • Name
    units
    Type
    integer
    Description

    This is only required if one of the products has the category: 2.3


POST/api/orders

Create a order

This endpoint allows you to add a new order to your organisation in House Check.

To add a order, you must provide the above mentioned properties.

Request

POST
/api/orders
curl --location 'https://housecheck.be/api/orders/' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "property_type": "Rijwoning / Duplex",
    "habbitable_space": "125",
    "address1": "Brusselsesteenweg",
    "address2": "34",
    "city": "Meise",
    "postal_code": "1860",
    "contact_name": "John Doe",
    "contact_language": "nl",
    "contact_email": "john@doe.com",
    "contact_phone1": "025826232",
    "inv_company_name": "House Check",
    "inv_address1": "Brusselsesteenweg",
    "inv_address2": "34",
    "inv_city": "Meise",
    "inv_postal_code": "1860",
    "inv_phone1": "025826232",
    "inv_mail": "jane@doe.com",
    "invoice_to": "salesman",
    "is_contact_owner": "contact",
    "breaker_boxes": "1",
    "order_products": [
        {
            "id": "23",
            "quantity": 1
        },
        {
            "id": "46",
            "quantity": 1
        }
    ]
}'

Response 201

{
    "id": 201,
    "inspections": [
        {
            "id": 24,
            "product_id": "23"
        },
        {
            "id": 25,
            "product_id": "46"
        }
    ]
}

GET/api/orders/:id

Retrieve a order

This endpoint allows you to retrieve a order by providing the order id. Refer to the list at the top of this page to see which properties are included with order objects.

You will get the related inspecions for the order with the following parameters:

  • Name
    product_id
    Type
    string
    Description

    Product id.

  • Name
    product_name
    Type
    integer
    Description

    Name of the product/inspection.

  • Name
    date
    Type
    date
    Description

    Date of the inspection.

  • Name
    inspector_name
    Type
    string
    Description

    Name of the inspector.

Request

GET
/api/orders/1234
curl https://housecheck.be/api/orders/1234 \
  -H "Authorization: Bearer {token}"

Response 200

{
    "data": {
        "id": 150239,
        "client_account_id": "88",
        "status": "to schedule",
        "property_type": "Rijwoning / Duplex",
        "address1": "Brusselsesteenweg",
        "address2": "34",
        "city": "Meise",
        "postal_code": "1860",
        "habbitable_space": "125",
        "no_inv_mail": 0,
        "no_contact_mail": 0,
        "contact_name": "John Doe",
        "contact_language": "nl",
        "contact_email": "john@doe.com",
        "contact_phone1": "+3225826232",
        "contact_language": null,
        "remark": null,
        "inv_company_name": "House Check",
        "inv_vat": null,
        "inv_address1": "Brusselsesteenweg",
        "inv_address2": "34",
        "inv_city": "Meise",
        "inv_postal_code": "1860",
        "inv_phone1": "+3225826232",
        "inv_mail": "jane@doe.com",
        "invoice_to": "salesman",
        "keyPickup_location": null,
        "is_contact_owner": "contact",
        "cancel_reason": null,
        "floors": null,
        "units": null,
        "breaker_boxes": "1",
        "key_pickup_location": null,
        "inspections": [
        {
            "product_id": "23",
            "product_name": "Keuring laadpaal niet-residentieel",
            "date": "2023-03-20 15:53:03",
            "inspector_name": "test inspector"
        },
        {
            "product_id": "46",
            "product_name": "Asbestattest residentieel",
            "date": null,
            "inspector_name": null
        }
    ]
    }
}