View on GitHub

api-documentation

RESTful API for MyTourist

Back to overview


Debtors

This API endpoint let you manage your debtors. Parameters can be found on the very end of this page.

Index:

List all debtors

Get a list of all your debtors returned in JSON format.
GET https://app.mytourist.cloud/api/v1/debtors

Results

{
    "id":"23192010299",
    "company_name":null,
    "company_chamber_id":null,
    "first_name":"Max",
    "last_name":"Musterman",
    "address":"streetname 55 Block 3",
    "latitude" : "27.606888", 
    "longitude" : "-42.670898", 
    "...":"..."
},
{
    "id":"23192010300",
    "company_name":null,
    "company_chamber_id":null,
    "first_name":"Daniel",
    "last_name":"Musterman",
    "address":"streetname 66",
    "latitude" : "27.606888", 
    "longitude" : "-42.670898", 
    "...":"..."
}

Retrieve a single debtor

Get a single Debtor returned in JSON format. We also add all the bookings attached to this debtor and also all invoices.

GET https://app.mytourist.cloud/api/v1/debtors/{DEBTOR_ID}

Results

{
    "id":"23192010299",
    "company_name":null,
    "company_chamber_id":null,
    "first_name":"Max",
    "last_name":"Musterman",
    "address":"streetname 55 Block 3",
    "latitude" : "27.606888", 
    "longitude" : "-42.670898", 
    "...":"...",

    "bookings":[
        {
            "id":231920102956,
            "state":"archived",            
            "arrival":"20201008",
            "departure":"20201011"
        }
    ],
    "invoices":[
        {
            "id":"P1120078",
            "state":"open",
            "type":"proforma"
        }
    ]
}

Create / Update a debtor

You can create or update a debtor by posting to the following URL. This endpoints will return (when success) the saved debtor (200 HTTP response). You can either post the full JSON file or single individual fields. When the field is posted we always overwrite them. When a field is not posted trough the API we won’t overwrite it and keep the existing data.

POST (Create) https://app.mytourist.cloud/api/v1/debtors
POST (Update) https://app.mytourist.cloud/api/v1/debtors/{DEBTOR_ID}

Available Parameters

first_namerequiredwhen creating debtor
last_namerequiredwhen creating debtor
company_nameoptional-
company_chamber_idoptionalChamber / KVK nr.
vat_idoptional
addressoptional
zipcodeoptional
cityoptional
countryoptionalISO 639-1
mobileoptional
phoneoptional
emailoptional
noteoptional
latitudeoptionalFloat like eg. 27.606888
longitudeoptionalFloat like eg. -42.670898