Offertes

Authenticatie vereist

Met deze resource kunnen offertes van u opgehaald en aangemaakt worden.

Resource mogelijkheden

HTTP Request Type Resource Type Vereisten Rechten
GET Collectie Quotations.read
POST Collectie Quotations.write
GET Element Quotations.read
POST Element Quotations.write
DELETE Element Quotations.write
Speciale acties
GET Action get layouts Quotations.read
GET Action get send email Quotations.write
POST Action post send email Quotations.write

Resource Containments

Depth Resource
0 Geen containments
1
2

Velden

Veld Beschrijving Zichbaar Aanpasbaar Vereist bij aanmaken
id Het indificatie nummer van de offerte. Ja Nee Nee
code   Ja Nee Nee
hash   Ja Nee Nee
name   Ja Ja Nee
description   Ja Ja Nee
autosend_status   Nee Nee Nee
contact_id Id van de contact persoon waar de offerte voor is. Ja Ja Ja
contact_attention   Ja Ja Nee
project_id   Ja Ja Nee
status De status van de offerte standaard 1 Ja Ja Nee
date_sent   Ja Ja Nee
date_accepted   Ja Ja Nee
discount De korting in procenten Ja Ja Nee
total_price De totaalprijs van de offerte. Wordt berekend op basis van de offerteregels. Ja Nee Nee
total_price_vat   Ja Nee Nee
total_price_discount   Ja Nee Nee
layout Bij het aanmaken kan met dit veld een speciale layout worden gekozen. Ja Nee Nee
modified   Ja Nee Nee
created   Ja Nee Nee

Collectie GET

GET Collectie

Een GET request op de collectie zal resulteren in een volledige lijst van uw offertes.

Voorbeeld reactie(JSON):
{
    "response": {
        "message": "success",
        "exception": [],
        "code": 200,
        "data": {
            "count": 2,
            "Quotations": [
                {
                    "Quotation": {
                        "id": "53",
                        "code": "2013-0001",
                        "hash": null,
                        "name": "Schilderen pand",
                        "description": "",
                        "contact_id": "521",
                        "contact_attention": "",
                        "project_id": "65",
                        "status": "1",
                        "date_sent": null,
                        "date_accepted": null,
                        "discount": null,
                        "total_price": "10700000",
                        "total_price_vat": "2247000",
                        "layout": "",
                        "modified": "2014-10-29 13:05:49",
                        "created": "2013-02-19 14:39:51",
                        "total_price_discount": null
                    },
                    "Contact": [],
                    "QuotationLine": []
                },
                {
                    "Quotation": {
                        "id": "212",
                        "code": "2013-0004",
                        "hash": null,
                        "name": "Test nieuwe regel",
                        "description": "",
                        "contact_id": "521",
                        "contact_attention": "",
                        "project_id": null,
                        "status": "1",
                        "date_sent": null,
                        "date_accepted": null,
                        "discount": null,
                        "total_price": "0",
                        "total_price_vat": "0",
                        "layout": "",
                        "modified": "2014-10-29 13:05:49",
                        "created": "2013-05-06 10:59:20",
                        "total_price_discount": null
                    },
                    "Contact": [],
                    "QuotationLine": []
                }
            ]
        }
    }
}

Mogelijke fout meldingen Errors

Action HTTP Reponse Code Message
GET 404 Not Found Quotations not found.

Collectie POST

POST Collectie

Een POST request op de collectie zal resulteren in het aanmaken van een nieuw element.

Let op

Bij een POST Request via het HTTP protocol wordt de header Content-Type: application/x-www-form-urlencoded verwacht.

Mogelijke fout meldingen Errors

Action HTTP Reponse Code Message
POST 400 Bad Request Something went wrong while saving the data.

ELEMENT GET

GET Element

Een GET request op het element zal resulteren op een enkele offerte.

Parameters
{id} Het indentificatie nummer van de offerte in formaat (0-9)
Voorbeeld reactie(JSON):
{
    "response": {
        "message": "success",
        "exception": [],
        "code": 200,
        "data": {
            "Quotation": {
                "id": "53",
                "code": "2013-0001",
                "hash": null,
                "name": "Schilderen pand",
                "description": "",
                "contact_id": "521",
                "contact_attention": "",
                "project_id": "65",
                "status": "1",
                "date_sent": null,
                "date_accepted": null,
                "discount": null,
                "total_price": "10700000",
                "total_price_vat": "2247000",
                "layout": "",
                "modified": "2014-10-29 13:05:49",
                "created": "2013-02-19 14:39:51",
                "total_price_discount": null
            },
            "Contact": [],
            "QuotationLine": []
        }
    }
}

ELEMENT POST

POST Element

Een POST request op het element zal resulteren in het aanpassen van het element. Alleen specifieke velden zijn aanpasbaar.

Parameters
{id} Het indentificatie nummer van de offerte in formaat (0-9)

Let op

Bij een POST Request via het HTTP protocol wordt de header Content-Type: application/x-www-form-urlencoded verwacht.

Mogelijke fout meldingen Errors

Action HTTP Reponse Code Message
POST 400 Bad Request Something went wrong while saving the data.
POST 404 Not Found Quotation not found.

ELEMENT DELETE

DELETE Element

Een DELETE request op het element zal resulteren in het verwijderen van het element.

Parameters
{id} Het indentificatie nummer van de offerte in formaat (0-9)

Mogelijke fout meldingen Errors

Action HTTP Reponse Code Message
DELETE 404 Not Found Quotation not found.

Actions Overview

OPTIONS Resource

Een OPTIONS request op de resource zal resulteren in een overzicht van de beschikbare opties.

Voorbeeld reactie(JSON):
{
    "response": {
        "message": "",
        "exception": [],
        "code": 200,
        "data": {
            "Supported actions": {
                "\/quotations\/actions\/send_email\/{id}.json": [
                    "GET",
                    "POST"
                ]
            }
        }
    }
}

ACTION GET Layouts

GET

Een GET request op deze actie zal resulteren in een overzicht van de beschikbare offerte layouts.

Voorbeeld reactie(JSON):
{
    "response": {
        "message": "success",
        "exception": [],
        "code": 200,
        "data": [
            "Standaard template",
            "Layout zonder logo",
            "Layout tweede vestiging"
        ]
    }
}

ACTION GET Send Email

GET

Een GET request op deze actie zal resulteren in een overzicht van de email template.

Voorbeeld reactie(JSON):
{
    "response": {
        "message": "success",
        "exception": [],
        "code": 200,
        "data": {
            "Template": {
                "email_to": "info@test.nl",
                "sender_name": "ABC Schilders B.V.",
                "subject": "Offerte 2013-0001",
                "mail_layout": "",
                "sender_email": "demo@workspace.nl"
            }
        }
    }
}

ACTION POST Send Email

POST

Een POST request op de actie zal resulteren in versturen van een email.

Benodigde Velden

Veld
email_to
sender_name
subject
mail_layout
sender_email

Mogelijke fout meldingen Errors

Action HTTP Reponse Code Message
DELETE 400 Bad Request Not all required fields are provided.